Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.TemplateExtraction


      AsyncCreateResponse response = client.getTemplateClient().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
      assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());

      // Get the result
      AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobClient().getAsyncJob(response.getJobId());
      TemplateExtraction extract = asyncJob.getResult();
      assertNotNull(extract);

      // Check that the URL can be retrieved
      String extractUrl = extract.getUrl();
      assertNotNull(extractUrl);
      URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
      assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
   }
View Full Code Here


               if ("template".equals(entry.getKey())) {
                  // Sometimes Cloudstack will say 'template' and the payload is a Template object.
                  // Sometimes Cloudstack will say 'template' and the payload is a TemplateExtraction object.
                  // The 'state' field only exists on TemplateExtraction, so we can test this to work out what we have actually been given.
                  Template template = json.fromJson(entry.getValue().toString(), Template.class);
                  TemplateExtraction templateExtraction = json.fromJson(entry.getValue().toString(), TemplateExtraction.class);
                  boolean isTemplate = Strings.isNullOrEmpty(templateExtraction.getState());
                  builder.result(isTemplate ? template : templateExtraction);
               } else if (typeMap.containsKey(entry.getKey())) {
                  builder.result(json.fromJson(entry.getValue().toString(), typeMap.get(entry.getKey())));
               } else {
                  logger.warn(
View Full Code Here

      AsyncCreateResponse response = client.getTemplateApi().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
      assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());

      // Get the result
      AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobApi().getAsyncJob(response.getJobId());
      TemplateExtraction extract = asyncJob.getResult();
      assertNotNull(extract);

      // Check that the URL can be retrieved
      String extractUrl = extract.getUrl();
      assertNotNull(extractUrl);
      URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
      assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
   }
View Full Code Here

               if ("template".equals(entry.getKey())) {
                  // Sometimes Cloudstack will say 'template' and the payload is a Template object.
                  // Sometimes Cloudstack will say 'template' and the payload is a TemplateExtraction object.
                  // The 'state' field only exists on TemplateExtraction, so we can test this to work out what we have actually been given.
                  Template template = json.fromJson(entry.getValue().toString(), Template.class);
                  TemplateExtraction templateExtraction = json.fromJson(entry.getValue().toString(), TemplateExtraction.class);
                  boolean isTemplate = Strings.isNullOrEmpty(templateExtraction.getState());
                  builder.result(isTemplate ? template : templateExtraction);
               } else if (typeMap.containsKey(entry.getKey())) {
                  builder.result(json.fromJson(entry.getValue().toString(), typeMap.get(entry.getKey())));
               } else {
                  logger.warn(
View Full Code Here

      AsyncCreateResponse response = client.getTemplateClient().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
      assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());

      // Get the result
      AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobClient().getAsyncJob(response.getJobId());
      TemplateExtraction extract = asyncJob.getResult();
      assertNotNull(extract);

      // Check that the URL can be retrieved
      String extractUrl = extract.getUrl();
      assertNotNull(extractUrl);
      URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
      assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
   }
View Full Code Here

               if ("template".equals(entry.getKey())) {
                  // Sometimes Cloudstack will say 'template' and the payload is a Template object.
                  // Sometimes Cloudstack will say 'template' and the payload is a TemplateExtraction object.
                  // The 'state' field only exists on TemplateExtraction, so we can test this to work out what we have actually been given.
                  Template template = json.fromJson(entry.getValue().toString(), Template.class);
                  TemplateExtraction templateExtraction = json.fromJson(entry.getValue().toString(), TemplateExtraction.class);
                  boolean isTemplate = Strings.isNullOrEmpty(templateExtraction.getState());
                  builder.result(isTemplate ? template : templateExtraction);
               } else if (typeMap.containsKey(entry.getKey())) {
                  builder.result(json.fromJson(entry.getValue().toString(), typeMap.get(entry.getKey())));
               } else {
                  logger.warn(
View Full Code Here

               if ("template".equals(entry.getKey())) {
                  // Sometimes Cloudstack will say 'template' and the payload is a Template object.
                  // Sometimes Cloudstack will say 'template' and the payload is a TemplateExtraction object.
                  // The 'state' field only exists on TemplateExtraction, so we can test this to work out what we have actually been given.
                  Template template = json.fromJson(entry.getValue().toString(), Template.class);
                  TemplateExtraction templateExtraction = json.fromJson(entry.getValue().toString(), TemplateExtraction.class);
                  boolean isTemplate = Strings.isNullOrEmpty(templateExtraction.getState());
                  builder.result(isTemplate ? template : templateExtraction);
               } else if (typeMap.containsKey(entry.getKey())) {
                  builder.result(json.fromJson(entry.getValue().toString(), typeMap.get(entry.getKey())));
               } else {
                  logger.warn(
View Full Code Here

      AsyncCreateResponse response = client.getTemplateApi().extractTemplate(registeredTemplate.getId(), ExtractMode.HTTP_DOWNLOAD, registeredTemplate.getZoneId());
      assertTrue(jobComplete.apply(response.getJobId()), registeredTemplate.toString());

      // Get the result
      AsyncJob<TemplateExtraction> asyncJob = client.getAsyncJobApi().getAsyncJob(response.getJobId());
      TemplateExtraction extract = asyncJob.getResult();
      assertNotNull(extract);

      // Check that the URL can be retrieved
      String extractUrl = extract.getUrl();
      assertNotNull(extractUrl);
      URI uri = new URI(URLDecoder.decode(extractUrl, "utf-8"));
      assertTrue(cloudStackContext.utils().http().exists(uri), "does not exist: " + uri);
   }
View Full Code Here

TOP

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

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.