Examples of CreateServerOptions


Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

      NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
            responseWithKeystoneAccess, createServer, createServerResponse);

      assertEquals(apiWithNewServer.getServerApiForZone("az-1.region-a.geo-1").create("test-e92", "1241",
               "100", new CreateServerOptions().networks("b3856ac0-f481-11e2-b778-0800200c9a66", "bf0f0f90-f481-11e2-b778-0800200c9a66")).toString(),
              new ParseCreatedServerTest().expected().toString());
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

      NovaApi apiWithNewServer = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            createServer, createServerResponse);

      assertEquals(apiWithNewServer.getServerApiForZone("az-1.region-a.geo-1").create("test-e92", "1241",
               "100", new CreateServerOptions().diskConfig(Server.DISK_CONFIG_AUTO)).toString(),
              new ParseCreatedServerTest().expectedWithDiskConfig(Server.DISK_CONFIG_AUTO).toString());
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

      NovaApi apiWithNewServer = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
            createServer, createServerResponse);

      assertEquals(apiWithNewServer.getServerApiForZone("az-1.region-a.geo-1").create("test-e92", "1241",
               "100", new CreateServerOptions().diskConfig(Server.DISK_CONFIG_MANUAL)).toString(),
              new ParseCreatedServerTest().expectedWithDiskConfig(Server.DISK_CONFIG_MANUAL).toString());
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

   public void testCreateWithNetworkOptions() {
      String serverId = null;
      for (String zoneId : zones) {
         ServerApi serverApi = api.getServerApiForZone(zoneId);
         try {
            CreateServerOptions options = CreateServerOptions.Builder.novaNetworks(
                  // This network UUID must match an existing network.
                  ImmutableSet.of(Network.builder().networkUuid("bc4cfa2b-2b27-4671-8e8f-73009623def0").fixedIp("192.168.55.56").build())
                  );
            ServerCreated server = serverApi.create(hostName, imageIdForZone(zoneId), "1", options);
            serverId = server.getId();
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

      }
   }

   private Server createServer(String regionId, Server.Status serverStatus) {
      ServerApi serverApi = api.getServerApiForZone(regionId);
      CreateServerOptions options = new CreateServerOptions();
      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);

      blockUntilServerInState(server.getId(), serverApi, serverStatus);

      return serverApi.get(server.getId());
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

      return serverApi.get(server.getId());
   }

   private Server createServer(String regionId, String availabilityZoneId, Server.Status serverStatus) {
      ServerApi serverApi = api.getServerApiForZone(regionId);
      CreateServerOptions options = new CreateServerOptions();
      options = options.availabilityZone(availabilityZoneId);
      ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
      blockUntilServerInState(server.getId(), serverApi, serverStatus);
      return serverApi.get(server.getId());
   }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

            Template template) {

      LoginCredentials.Builder credentialsBuilder = LoginCredentials.builder();
      NovaTemplateOptions templateOptions = template.getOptions().as(NovaTemplateOptions.class);

      CreateServerOptions options = new CreateServerOptions();
      options.metadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions()));
      if (templateOptions.getSecurityGroupNames().isPresent())
         options.securityGroupNames(templateOptions.getSecurityGroupNames().get());
      options.userData(templateOptions.getUserData());
      options.diskConfig(templateOptions.getDiskConfig());
      options.configDrive(templateOptions.getConfigDrive());
      options.availabilityZone(templateOptions.getAvailabilityZone());

      if (templateOptions.getNovaNetworks() != null) {
         options.novaNetworks(templateOptions.getNovaNetworks());
      }
      if (templateOptions.getNetworks() != null) {
         options.networks(templateOptions.getNetworks());
      }

      Optional<String> privateKey = Optional.absent();
      if (templateOptions.getKeyPairName() != null) {
         options.keyPairName(templateOptions.getKeyPairName());       
         KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName()));
         if (keyPair != null && keyPair.getPrivateKey() != null) {
            privateKey = Optional.of(keyPair.getPrivateKey());
            credentialsBuilder.privateKey(privateKey.get());
         }
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

    this.metadata = metadata;
  }

  @Override
  public Server doRequest(NovaApi api) {
    CreateServerOptions serverOptions = new CreateServerOptions();
    serverOptions.keyPairName(this.keyPair);
    serverOptions.securityGroupNames(this.securityGroups);
    serverOptions.metadata(this.metadata);
    if (this.userData.isPresent()) {
      serverOptions.userData(this.userData.get().getBytes());
    }

    // create server
    ServerApi serverApi = api.getServerApiForZone(getAccount().getRegion());
    ServerCreated serverCreated = serverApi.create(this.serverName,
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

        }
    }

    private Server createServer(String regionId, Server.Status serverStatus) {
        ServerApi serverApi = api.getServerApiForZone(regionId);
        CreateServerOptions options = new CreateServerOptions();
        ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);

        blockUntilServerInState(server.getId(), serverApi, serverStatus);

        return serverApi.get(server.getId());
View Full Code Here

Examples of org.jclouds.openstack.nova.v2_0.options.CreateServerOptions

        return serverApi.get(server.getId());
    }

    private Server createServer(String regionId, String availabilityZoneId, Server.Status serverStatus) {
        ServerApi serverApi = api.getServerApiForZone(regionId);
        CreateServerOptions options = new CreateServerOptions();
        options = options.availabilityZone(availabilityZoneId);
        ServerCreated server = serverApi.create(hostName, imageIdForZone(regionId), flavorRefForZone(regionId), options);
        blockUntilServerInState(server.getId(), serverApi, serverStatus);
        return serverApi.get(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.