Examples of ServerApi


Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

   @Override
   public void setup() {
      super.setup();
      zones = api.getConfiguredZones();
      for (String zone : zones){
         ServerApi serverApi = api.getServerApiForZone(zone);
         for (Resource server : serverApi.list().concat()){
            if (server.getName().equals(hostName))
               serverApi.delete(server.getId());
         }
      }
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      setIfTestSystemPropertyPresent(props, NovaProperties.AUTO_ALLOCATE_FLOATING_IPS);
      return props;
   }
  
   protected Server createServerInZone(String zoneId) {
      ServerApi serverApi = api.getServerApiForZone(zoneId);
      ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), flavorRefForZone(zoneId));
      blockUntilServerInState(server.getId(), serverApi, Status.ACTIVE);
      return serverApi.get(server.getId());
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Resource>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.get().toString();
         final ServerApi serverApi = api.getServerApiForZone(zone);
         return new Function<Object, IterableWithMarker<Resource>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Resource> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(serverApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "list()";
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Server>> markerToNextForArg0(Optional<Object> arg0) {
         String zone = arg0.get().toString();
         final ServerApi serverApi = api.getServerApiForZone(zone);
         return new Function<Object, IterableWithMarker<Server>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Server> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(serverApi.listInDetail(paginationOptions));
            }

            @Override
            public String toString() {
               return "listInDetail()";
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Resource>> markerToNextForArg0(Optional<Object> arg0) {
         String region = arg0.get().toString();
         final ServerApi serverApi = api.getServerApi(region);
         return new Function<Object, IterableWithMarker<Resource>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Resource> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(serverApi.list(paginationOptions));
            }

            @Override
            public String toString() {
               return "list()";
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      }

      @Override
      protected Function<Object, IterableWithMarker<Server>> markerToNextForArg0(Optional<Object> arg0) {
         String region = arg0.get().toString();
         final ServerApi serverApi = api.getServerApi(region);
         return new Function<Object, IterableWithMarker<Server>>() {

            @SuppressWarnings("unchecked")
            @Override
            public IterableWithMarker<Server> apply(Object input) {
               PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
               return IterableWithMarker.class.cast(serverApi.listInDetail(paginationOptions));
            }

            @Override
            public String toString() {
               return "listInDetail()";
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      String serverDetailsActive = stringFromResource("/server_details.json").replace("BUILD(scheduling)", ACTIVE.value());
      server.enqueue(new MockResponse().setBody(serverDetailsActive));

      try {
         NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
         ServerApi serverApi = novaApi.getServerApi("RegionOne");

         boolean result = awaitActive(serverApi).apply("71752");

         assertTrue(result);
         assertEquals(server.getRequestCount(), 5);
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

      String serverDetailsShutoff = stringFromResource("/server_details.json").replace("BUILD(scheduling)", SHUTOFF.value());
      server.enqueue(new MockResponse().setBody(serverDetailsShutoff));

      try {
         NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
         ServerApi serverApi = novaApi.getServerApi("RegionOne");

         boolean result = awaitShutoff(serverApi).apply("71752");

         assertTrue(result);
         assertEquals(server.getRequestCount(), 7);
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

         server.enqueue(new MockResponse().setBody(stringFromResource("/server_details.json")));
      }

      try {
         NovaApi novaApi = api(server.getUrl("/").toString(), "openstack-nova");
         ServerApi serverApi = novaApi.getServerApi("RegionOne");

         boolean result = awaitStatus(serverApi, ACTIVE, 3, 1).apply("71752");

         assertFalse(result);
         assertAuthentication(server);
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.features.ServerApi

            System.err.println("Consoles extension not present in server.");
            continue;
         }

         ConsolesApi api = apiOption.get();
         ServerApi serverApi = this.api.getServerApi(regionId);
         Server server = createServerInRegion(regionId);
         Console console = api.getConsole(server.getId(), consoleType);
         assertNotNull(console.getType());
         assertTrue(consoleType.equals(console.getType()));
         assertNotNull(console.getUrl());
         assertTrue(console.getUrl().toString().startsWith("http"));
         serverApi.delete(server.getId());
      }
   }
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.