本文整理了Java中org.jclouds.compute.Utils.http()
方法的一些代码示例,展示了Utils.http()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.http()
方法的具体详情如下:
包路径:org.jclouds.compute.Utils
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!