org.jclouds.compute.Utils.http()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.jclouds.compute.Utils.http()方法的一些代码示例,展示了Utils.http()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.http()方法的具体详情如下:
包路径:org.jclouds.compute.Utils
类名称:Utils
方法名:http

Utils.http介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

protected void checkHttpGet(NodeMetadata node) {
 ComputeTestUtils.checkHttpGet(view.utils().http(), node, 8080);
}

代码示例来源:origin: apache/jclouds

protected void checkHttpGet(NodeMetadata node) {
 ComputeTestUtils.checkHttpGet(view.utils().http(), node, 8080);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test(enabled = true, dependsOnMethods = "testRegisterTemplate")
public void testExtractTemplate() throws Exception {
 // Initiate the extraction and wait for it to complete
 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);
}

代码示例来源:origin: jclouds/legacy-jclouds-chef

@Test(dependsOnMethods = "testCanUpdateRunList")
public void testRunNodesWithBootstrap() throws IOException {
 Statement bootstrap = view.getChefService().createBootstrapScriptForGroup(group);
 try {
   nodes = computeContext.getComputeService().createNodesInGroup(group, 1, runScript(bootstrap));
 } catch (RunNodesException e) {
   nodes = concat(e.getSuccessfulNodes(), e.getNodeErrors().keySet());
 }
 for (NodeMetadata node : nodes) {
   URI uri = URI.create("http://" + getLast(node.getPublicAddresses()));
   InputStream content = computeContext.utils().http().get(uri);
   String string = Strings2.toStringAndClose(content);
   assert string.indexOf("It works!") >= 0 : string;
 }
}

代码示例来源:origin: apache/jclouds

@Test(enabled = true, dependsOnMethods = "testRegisterTemplate")
public void testExtractTemplate() throws Exception {
 // Initiate the extraction and wait for it to complete
 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);
}

相关文章