Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.TemplateMetadata


      Set<OSType> osTypes = client.getGuestOSClient().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateClient().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here


   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object input) {
      checkArgument(input instanceof TemplateMetadata, "this binder is only valid for TemplateMetadata");
      TemplateMetadata metadata = (TemplateMetadata) input;
      Builder<String, String> builder = ImmutableMultimap.<String, String>builder();
      builder.put("name", metadata.getName());
      builder.put("ostypeid", metadata.getOsTypeId());
      builder.put("displaytext", metadata.getDisplayText());
      if (metadata.getSnapshotId() != null) {
        builder.put("snapshotid", metadata.getSnapshotId());
      }
      if (metadata.getVolumeId() != null) {
        builder.put("volumeid", metadata.getVolumeId());
      }
      if (metadata.getVirtualMachineId() != null) {
        builder.put("virtualmachineid", metadata.getVirtualMachineId());
      }
      if (metadata.isPasswordEnabled() != null) {
        builder.put("passwordenabled", metadata.isPasswordEnabled().toString());
      }
      return (R) request.toBuilder().replaceQueryParams(builder.build()).build();
   }
View Full Code Here

      Set<OSType> osTypes = client.getGuestOSApi().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateApi().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

      Set<OSType> osTypes = client.getGuestOSClient().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix+"-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateClient().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object input) {
      checkArgument(input instanceof TemplateMetadata, "this binder is only valid for TemplateMetadata");
      TemplateMetadata metadata = (TemplateMetadata) input;
      Builder<String, String> builder = ImmutableMultimap.<String, String>builder();
      builder.put("name", metadata.getName());
      builder.put("ostypeid", metadata.getOsTypeId());
      builder.put("displaytext", metadata.getDisplayText());
      if (metadata.getSnapshotId() != null) {
        builder.put("snapshotid", metadata.getSnapshotId());
      }
      if (metadata.getVolumeId() != null) {
        builder.put("volumeid", metadata.getVolumeId());
      }
      if (metadata.getVirtualMachineId() != null) {
        builder.put("virtualmachineid", metadata.getVirtualMachineId());
      }
      if (metadata.isPasswordEnabled() != null) {
        builder.put("passwordenabled", metadata.isPasswordEnabled().toString());
      }
      return (R) request.toBuilder().replaceQueryParams(builder.build()).build();
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object input) {
      checkArgument(input instanceof TemplateMetadata, "this binder is only valid for TemplateMetadata");
      TemplateMetadata metadata = (TemplateMetadata) input;
      Builder<String, String> builder = ImmutableMultimap.<String, String>builder();
      builder.put("name", metadata.getName());
      builder.put("ostypeid", metadata.getOsTypeId());
      builder.put("displaytext", metadata.getDisplayText());
      if (metadata.getSnapshotId() != null) {
        builder.put("snapshotid", metadata.getSnapshotId());
      }
      if (metadata.getVolumeId() != null) {
        builder.put("volumeid", metadata.getVolumeId());
      }
      if (metadata.getVirtualMachineId() != null) {
        builder.put("virtualmachineid", metadata.getVirtualMachineId());
      }
      if (metadata.isPasswordEnabled() != null) {
        builder.put("passwordenabled", metadata.isPasswordEnabled().toString());
      }
      return (R) request.toBuilder().replaceQueryParams(builder.build()).build();
   }
View Full Code Here

      Set<OSType> osTypes = client.getGuestOSApi().listOSTypes();
      OSType osType = Iterables.getFirst(osTypes, null);

      // Register a template
      RegisterTemplateOptions options = RegisterTemplateOptions.Builder.bits(32).isExtractable(true);
      TemplateMetadata templateMetadata = TemplateMetadata.builder().name(prefix + "-registerTemplate").osTypeId(osType.getId()).displayText("jclouds live testRegisterTemplate").build();
      Set<Template> templates = client.getTemplateApi().registerTemplate(templateMetadata, "VHD", "XenServer", IMPORT_VHD_URL, zone.getId(), options);
      registeredTemplate = Iterables.getOnlyElement(templates, null);
      assertNotNull(registeredTemplate);

      // Ensure it is available
View Full Code Here

TOP

Related Classes of org.jclouds.cloudstack.domain.TemplateMetadata

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.