org.jclouds.Context.getProviderMetadata()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(180)

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

Context.getProviderMetadata介绍

暂无

代码示例

代码示例来源:origin: gaul/s3proxy

private static String getBlobStoreType(BlobStore blobStore) {
  return blobStore.getContext().unwrap().getProviderMetadata().getId();
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

public String getProviderName() {
  return computeService != null ? computeService.getContext().unwrap().getProviderMetadata().getId() : providerName;
}

代码示例来源:origin: io.cloudsoft.jclouds.labs.representations/representations-codec

@Override
  public Context apply(@Nullable org.jclouds.Context input) {
   if (input == null) {
     return null;
   }
   return Context.builder().name(input.getName()).identity(input.getIdentity())
       .providerId(input.getProviderMetadata() != null ? input.getProviderMetadata().getId() : null).build();
  }
}

代码示例来源:origin: org.gaul/s3proxy

private static String getBlobStoreType(BlobStore blobStore) {
  return blobStore.getContext().unwrap().getProviderMetadata().getId();
}

代码示例来源:origin: Nextdoor/bender

private static String getBlobStoreType(BlobStore blobStore) {
  return blobStore.getContext().unwrap().getProviderMetadata().getId();
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
protected Object doExecute() throws Exception {
 ComputeService service = null;
 try {
   service = getComputeService();
 } catch (Throwable t) {
   System.err.println(t.getMessage());
   t.printStackTrace(System.err);
   return null;
 }
 if (!service.getImageExtension().isPresent()) {
   System.out.print("Provider " + service.getContext().unwrap().getProviderMetadata().getId()
       + " does not currently provide image creation support.");
   return null;
 }
 ImageExtension imageExtension = service.getImageExtension().get();
 ImageTemplate imageTemplate = imageExtension.buildImageTemplateFromNode(imageName, id);
 ListenableFuture<Image> imageFuture = imageExtension.createImage(imageTemplate);
 Image image = imageFuture.get();
 System.out.println("Successfully created image:" + image.getId());
 return null;
}

代码示例来源:origin: io.fabric8/fabric-core-agent-jclouds

public String getApiName() {
  return computeService != null ? computeService.getContext().unwrap().getProviderMetadata().getApiMetadata().getId() : apiName;
}

代码示例来源:origin: bouncestorage/swiftproxy

org.jclouds.Context c = getBlobStore(authToken).get().getContext().unwrap();
resp.access.serviceCatalog[0].name += String.format(" (%s %s)",
    c.getId(), c.getProviderMetadata().getEndpoint());
return Response.ok(resp).build();

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

@Test
public void testAllPropertiesAreStrings() {
 Properties overrides = new Properties();
 overrides.setProperty("foo", "bar");
 overrides.put("one", 1);
 overrides.put("two", 2.0f);
 overrides.put("true", true);
 overrides.put("object", new Object() {
   @Override
   public String toString() {
    return "object";
   }
 });
 Context withObjectsInProps = testContextBuilder().overrides(overrides).build();
 Properties resolved = withObjectsInProps.getProviderMetadata().getDefaultProperties();
 assertEquals(resolved.getProperty("foo"), "bar");
 assertEquals(resolved.getProperty("one"), "1");
 assertEquals(resolved.getProperty("true"), "true");
 assertEquals(resolved.getProperty("object"), "object");
}

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

ApiMetadata apiMetadata = context.unwrap().getProviderMetadata().getApiMetadata();
blobStore = context.getBlobStore();

相关文章