コード例 #1
0
 @Ignore
 public void testPostServer() throws PhrescoException {
   List<Server> servers = new ArrayList<Server>();
   Server server = new Server();
   server.setName("hello");
   server.setDescription("tomcat");
   servers.add(server);
   serviceManager = ServiceClientFactory.getServiceManager(context);
   String ServerJson = new Gson().toJson(servers);
   RestClient<Server> ServerClient =
       serviceManager.getRestClient(RestResourceURIs.REST_API_SERVERS);
   ServerClient.setAccept(MediaType.APPLICATION_JSON);
   ServerClient.setType(MediaType.APPLICATION_JSON);
   ServerClient.create(ServerJson);
 }
コード例 #2
0
 @Ignore
 public void testPutServer() throws PhrescoException {
   String id = "2c909c4836f2bb7b0136f2bba6db0003";
   List<Server> servers = new ArrayList<Server>();
   Server server = new Server();
   server.setName("Local Server");
   server.setDescription("Apache tomcat");
   servers.add(server);
   server.setId(id);
   serviceManager = ServiceClientFactory.getServiceManager(context);
   String ServerJson = new Gson().toJson(servers);
   RestClient<Server> ServerClient =
       serviceManager.getRestClient(RestResourceURIs.REST_API_SERVERS);
   ServerClient.setAccept(MediaType.APPLICATION_JSON);
   ServerClient.setType(MediaType.APPLICATION_JSON);
   ServerClient.update(ServerJson);
 }