Package org.jclouds.vcloud.director.v1_5.admin

Examples of org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi


      api.getCatalogApi().remove(catalogAdminHref);
   }

   @Test
   public void testRemoveCatalogUrn() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, resolveCatalog,
               resolveCatalogResponse, removeCatalog, removeCatalogResponse);
      api.getCatalogApi().remove(catalogUrn);
   }
View Full Code Here


         .href(URI.create(endpoint + "/admin/group/fff"))
         .build();
  
   @Test(enabled = false)
   public void testGetGroup() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("GET", "/admin/group/fff")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/group/group.xml", VCloudDirectorMediaType.GROUP)
            .httpResponseBuilder().build());

      Group expected = group();

      assertEquals(api.getGroupApi().get(groupRef.getHref()), expected);
   }
View Full Code Here

         .build();
   }
  
   @Test(enabled = false)
   public void testEditGroup() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", "/admin/group/fff")
            .xmlFilePayload("/group/editGroupSource.xml", VCloudDirectorMediaType.GROUP)
            .acceptMedia(VCloudDirectorMediaType.GROUP)
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/group/editGroup.xml", VCloudDirectorMediaType.GROUP)
            .httpResponseBuilder().build());

      Group expected = editGroup();

      assertEquals(api.getGroupApi().edit(groupRef.getHref(), expected), expected);
   }
View Full Code Here

      return null; // TODO chain onto group() then toBuilder() and edit?
   }
  
   @Test
   public void testRemoveGroup() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse,
            new VcloudHttpRequestPrimer()
               .apiCommand("DELETE", "/admin/group/fff")
               .acceptAnyMedia()
               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .httpResponseBuilder().statusCode(204).build());
     
      api.getGroupApi().remove(groupRef.getHref());
   }
View Full Code Here

      HttpResponse queryResponse = HttpResponse.builder()
              .statusCode(200)
              .payload(payloadFromResourceWithContentType("/query/admin/allGroups.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
              .build();

      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);

      QueryResultRecords expected = QueryResultRecords.builder()
            .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/groups/query?page=1&pageSize=25&format=records"))
            .type("application/vnd.vmware.vcloud.query.records+xml")
            .name("group")
            .page(1)
            .pageSize(25)
            .total(0L)
            .link(Link.builder()
                        .rel("alternate")
                        .type("application/vnd.vmware.vcloud.query.references+xml")
                        .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/groups/query?page=1&pageSize=25&format=references"))
                        .build())
            .link(Link.builder()
                        .rel("alternate")
                        .type("application/vnd.vmware.vcloud.query.idrecords+xml")
                        .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/groups/query?page=1&pageSize=25&format=idrecords"))
                        .build())
            .build();
     
      assertEquals(api.getQueryApi().groupsQueryAll(), expected);
   }
View Full Code Here

      HttpResponse queryResponse = HttpResponse.builder()
              .statusCode(200)
              .payload(payloadFromResourceWithContentType("/query/admin/allRoles.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
              .build();

      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);

      QueryResultRecords expected = QueryResultRecords.builder()
            .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=records"))
            .type("application/vnd.vmware.vcloud.query.records+xml")
            .name("role")
            .page(1)
            .pageSize(25)
            .total(1L)
            .link(Link.builder()
                        .rel("alternate")
                        .type("application/vnd.vmware.vcloud.query.references+xml")
                        .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=references"))
                        .build())
            .link(Link.builder()
                        .rel("alternate")
                        .type("application/vnd.vmware.vcloud.query.idrecords+xml")
                        .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=idrecords"))
                        .build())
            .record(QueryResultRoleRecord.builder()
                        .href(URI.create("https://vcloudbeta.bluelock.com/api/admin/role/1bf4457f-a253-3cf1-b163-f319f1a31802"))
                        .name("vApp Author")
                        .isReadOnly(false)
                        .build())
            .build();
     
      assertEquals(api.getQueryApi().rolesQueryAll(), expected);
   }
View Full Code Here

           .payload(payloadFromStringWithContentType(orgEntity, ENTITY + ";version=1.5"))
           .build();
  
   @Test
   public void testAddUserUrn() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, resolveOrg, resolveOrgResponse, add, addResponse);
      assertEquals(api.getUserApi().addUserToOrg(addUserSource(), orgUrn), addUser());
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/user/user.xml", ORG + ";version=1.5"))
            .build();
   
   @Test
   public void testGetUserHref() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, get, getResponse);
      assertEquals(api.getUserApi().get(userHref), user());
   }
View Full Code Here

           .payload(payloadFromStringWithContentType(userEntity, ENTITY + ";version=1.5"))
           .build();
  
   @Test
   public void testGetUserUrn() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, resolveUser, resolveUserResponse, get, getResponse);
      assertEquals(api.getUserApi().get(userUrn), user());
   }
View Full Code Here

            .payload(payloadFromResourceWithContentType("/user/editUser.xml", USER))
            .build();

   @Test
   public void testEditUserHref() {
      VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, edit, editResponse);
      assertEquals(api.getUserApi().edit(userHref, editUserSource()), editUser());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.admin.VCloudDirectorAdminApi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.