ace-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bram de Kruijff <bdekrui...@gmail.com>
Subject CRUD on targets howto (via REST)
Date Wed, 03 Aug 2011 14:20:49 GMT
Hi list,

working with the new REST api doing some random CRUD on objects and
noticed I can not delete targets? As the webui does not support
deleting of target either I am kind of wondering how this works (or
should work) conceptually. Are there attributes I can set to make them
deletable?

Regards,
Bram

ps. Below my simple scenario based on clean devserver without any
active targets running.

Simple scenario with my custom client:

        AceClient c = new AceClient("http://localhost:8080/client/work");
        AceClientWorkspace w = c.createNewWorkspace();
        Target developmentT = new Target("ama-2");
        w.createResource(developmentT);
        w.deleteResources(Target.TYPE);
        w.commit();
        w.remove();

Results in a 500 from the server:

  org.amdatu.maven.ace.AceClientException: Error deleting resource:
500 Removing StatefulGatewayObjects is not supported.
  	at org.amdatu.maven.ace.AceClientWorkspace.deleteResource(AceClientWorkspace.java:153)
  	at org.amdatu.maven.ace.AceClientWorkspace.deleteResources(AceClientWorkspace.java:132)

Meanwhile in the workspace:

   GET http://localhost:8080/client/work/rest-1/target
   ["%28%26%28id%3Dama-2%29%29"]

   GET http://localhost:8080/client/work/rest-1/target/%28%26%28id%3Dama-2%29%29
   {"attributes":{"id":"ama-2","autoapprove":"true","KEY_PROVISIONING_STATE":"Idle"},"tags":{"generated":"true"},"state":{"registrationState":"Registered","provisioningState":"Idle","storeState":"New","currentVersion":"(unknown)","isRegistered":"true","needsApproval":"false","autoApprove":"true","artifactsFromShop":[],"artifactsFromDeployment":[],"lastInstallSuccess":false}}

Mime
View raw message