Examples of VDC


Examples of org.jclouds.savvis.vpdc.domain.VDC

   public Iterable<VM> listNodes() {
      Builder<VM> builder = ImmutableSet.builder();
      for (Resource org1 : api.listOrgs()) {
         Org org = api.getBrowsingApi().getOrg(org1.getId());
         for (Resource vdc : org.getVDCs()) {
            VDC VDC = api.getBrowsingApi().getVDCInOrg(org.getId(), vdc.getId());
            for (Resource vApp : Iterables.filter(VDC.getResourceEntities(), new Predicate<Resource>() {

               @Override
               public boolean apply(Resource arg0) {
                  return VCloudMediaType.VAPP_XML.equals(arg0.getType());
               }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   public Iterable<Network> listLocations() {
      Builder<Network> builder = ImmutableSet.builder();
      for (Resource org1 : api.listOrgs()) {
         Org org = api.getBrowsingApi().getOrg(org1.getId());
         for (Resource vdc : org.getVDCs()) {
            VDC VDC = api.getBrowsingApi().getVDCInOrg(org.getId(), vdc.getId());
            // optionally constrain locations
            if (email != null && VDC.getDescription().indexOf(email) != -1)
               continue;
            for (Resource network : VDC.getAvailableNetworks()) {
               builder.add(api.getBrowsingApi().getNetworkInVDC(org.getId(), vdc.getId(), network.getId()));
            }
         }
      }
      return builder.build();
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

         Org org = api.getBrowsingApi().getOrg(matcher.group(1));

         Location orgLocation = new LocationBuilder().scope(LocationScope.REGION).id(org.getId()).description(
                  org.getDescription()).parent(provider).build();

         VDC vdc = api.getBrowsingApi().getVDCInOrg(org.getId(), matcher.group(2));

         Location vdcLocation = new LocationBuilder().scope(LocationScope.ZONE).id(vdc.getId()).description(
                  vdc.getDescription()).parent(orgLocation).build();

         return new LocationBuilder().scope(LocationScope.NETWORK).id(from.getId()).description(from.getName()).parent(
                  vdcLocation).build();
      } else {
         throw new IllegalArgumentException("network unparsable: " + from);
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   @Test
   public void testVDC() throws Exception {
      for (Resource org1 : restContext.getApi().listOrgs()) {
         Org org = api.getOrg(org1.getId());
         for (Resource vdc : org.getVDCs()) {
            VDC response = api.getVDCInOrg(org.getId(), vdc.getId());
            assertNotNull(response);
            assertNotNull(response.getId());
            assertNotNull(response.getHref());
            assertNotNull(response.getName());
            assertNotNull(response.getStatus());
            assertEquals(response.getType(), "application/vnd.vmware.vcloud.vdc+xml");
            assertNotNull(response.getDescription());
            assertNotNull(response.getResourceEntities());
            assertNotNull(response.getAvailableNetworks());
            assertEquals(api.getVDCInOrg(org.getId(), response.getId()).toString(), response.toString());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   @Test
   public void testNetwork() throws Exception {
      for (Resource org1 : restContext.getApi().listOrgs()) {
         Org org = api.getOrg(org1.getId());
         for (Resource vdc : org.getVDCs()) {
            VDC VDC = api.getVDCInOrg(org.getId(), vdc.getId());
            for (Resource vApp : VDC.getAvailableNetworks()) {
               Network response = api.getNetworkInVDC(org.getId(), vdc.getId(), vApp.getId());
               assertNotNull(response);
               assertNotNull(response.getId());
               assertNotNull(response.getHref());
               assertNotNull(response.getName());
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   @Test
   public void testVM() throws Exception {
      for (Resource org1 : restContext.getApi().listOrgs()) {
         Org org = api.getOrg(org1.getId());
         VDC_LOOP : for (Resource vdc : org.getVDCs()) {
            VDC VDC = api.getVDCInOrg(org.getId(), vdc.getId());
            for (Resource vApp : Iterables.filter(VDC.getResourceEntities(), new Predicate<Resource>() {

               @Override
               public boolean apply(Resource arg0) {
                  return VCloudMediaType.VAPP_XML.equals(arg0.getType());
               }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   public void test() {
      InputStream is = getClass().getResourceAsStream("/vdc.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "demo_vpdcname");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Balanced; ServiceLocation = North America; Email = jim@company.com;");
      assertEquals(result.getStatus(), Status.DEPLOYED);
      assertEquals(
               result.getResourceEntities(),
               ImmutableSet
                        .<Resource> of(
                                 new ResourceImpl(
                                          "1001",
                                          "DemoHost-1",
                                          VCloudMediaType.VAPP_XML,
                                          URI
                                                   .create("https://api.sandbox.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/vApp/1001")),
                                 new ResourceImpl(
                                          "1002",
                                          "DemoHost-2",
                                          VCloudMediaType.VAPP_XML,
                                          URI
                                                   .create("https://api.sandbox.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/vApp/1002")),
                                 new ResourceImpl(
                                          "1003",
                                          "DemoHost-3",
                                          VCloudMediaType.VAPP_XML,
                                          URI
                                                   .create("https://api.sandbox.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/vApp/1003")),
                                 new ResourceImpl(
                                          "1234",
                                          "CustomerTemplateName",
                                          VCloudMediaType.VAPPTEMPLATE_XML,
                                          URI
                                                   .create("https://api.sandbox.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/vAppTemplate/1234")),
                                 new ResourceImpl(
                                          "FirewallService",
                                          "firewall",
                                          "api.savvis.net+xml",
                                          URI
                                                   .create("https://api.sandbox.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/FirewallService"))));
      assertEquals(result.getAvailableNetworks(), ImmutableSet.of());
   }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   public void test1net() {
      InputStream is = getClass().getResourceAsStream("/vdc-1net.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "demo6");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Essential; ServiceLocation = US_WEST; Email = red@chair.com;");
      assertEquals(result.getStatus(), Status.DEPLOYED);
      assertEquals(result.getResourceEntities(), ImmutableSet.of(new ResourceImpl("1001", "Host1",
               VCloudMediaType.VAPP_XML, URI
                        .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1619/vApp/1001")),
               new ResourceImpl("1002", "Host2", VCloudMediaType.VAPP_XML, URI
                        .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1619/vApp/1002")),
               new ResourceImpl("1003", "Host3", VCloudMediaType.VAPP_XML, URI
                        .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1619/vApp/1003")),
               new ResourceImpl("1004", "Host4", VCloudMediaType.VAPP_XML, URI
                        .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1619/vApp/1004"))));
      assertEquals(result.getAvailableNetworks(), ImmutableSet.of(ResourceImpl.builder().id("VM-Tier01").name(
               "VM Tier01").type(VCloudMediaType.NETWORK_XML).href(
               URI.create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1619/network/VM-Tier01"))
               .build()));

   }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   public void testFailed() {
      InputStream is = getClass().getResourceAsStream("/vdc-failed.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Demo7");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Essential; ServiceLocation = US_WEST; Email = red@chair.com;");
      assertEquals(result.getStatus(), Status.FAILED);
      assertEquals(result.getResourceEntities(), ImmutableSet.of(new ResourceImpl("1001", "Host1",
               VCloudMediaType.VAPP_XML, URI
                        .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1641/vApp/1001"))));
      assertEquals(result.getAvailableNetworks(), ImmutableSet.of(ResourceImpl.builder().id("VM-Tier01").name(
               "VM Tier01").type(VCloudMediaType.NETWORK_XML).href(
               URI.create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/1641/network/VM-Tier01"))
               .build()));

   }
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.VDC

   public void testSaved() {
      InputStream is = getClass().getResourceAsStream("/vdc-saved.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "CloudBurst1");
      assertEquals(result.getDescription(),
               "ServiceProfileName = Essential; ServiceLocation = US_WEST; Email = me@my.com;");
      assertEquals(result.getStatus(), Status.SAVED);
      assertEquals(
               result.getResourceEntities(),
               ImmutableSet
                        .of(
                                 ResourceImpl
                                          .builder()
                                          .name("templateHost")
                                          .type("application/vnd.vmware.vcloud.vApp+xml")
                                          .id("1001")
                                          .href(
                                                   URI
                                                            .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/2555/vApp/1001"))
                                          .build(),
                                 ResourceImpl
                                          .builder()
                                          .name("host-c501")
                                          .type("application/vnd.vmware.vcloud.vApp+xml")
                                          .id("1037")
                                          .href(
                                                   URI
                                                            .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/2555/vApp/1037"))
                                          .build(),
                                 ResourceImpl
                                          .builder()
                                          .name("host-c501")
                                          .type("application/vnd.vmware.vcloud.vApp+xml")
                                          .id("1038")
                                          .href(
                                                   URI
                                                            .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/2555/vApp/1038"))
                                          .build(),
                                 ResourceImpl
                                          .builder()
                                          .name("host-c601")
                                          .type("application/vnd.vmware.vcloud.vApp+xml")
                                          .id("1039")
                                          .href(
                                                   URI
                                                            .create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/2555/vApp/1039"))
                                          .build()));
      assertEquals(result.getAvailableNetworks(), ImmutableSet.of(ResourceImpl.builder().id("VM-Tier01").name(
               "VM Tier01").type(VCloudMediaType.NETWORK_XML).href(
               URI.create("https://api.savvis.net/rest/api/v0.8/org/606677.0/vdc/2555/network/VM-Tier01"))
               .build()));

   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.