aliyun-Jclouds访问阿里云的 Jclouds 组件库

联合创作 · 2023-09-30 04:52

aliyun-Jclouds

访问阿里云服务的 Jclouds 组件库

Maven

<dependencies>
  <dependency>
    <groupId>io.github.aliyun-beta</groupId>
    <artifactId>aliyun-ecs</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <groupId>io.github.aliyun-beta</groupId>
    <artifactId>aliyun-oss</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <groupId>io.github.aliyun-beta</groupId>
    <artifactId>aliyun-slb</artifactId>
    <version>1.0.0</version>
  </dependency>
</dependencies>

Usage

ComputeService
ComputeService computeService;
String provider = "aliyun-ecs";
String key = "Your AccessKey";
String secret = "Your AccessKeySecret";
ComputeServiceContext context = ContextBuilder
      .newBuilder(provider)
      .credentials(key, secret)
      .buildView(ComputeServiceContext.class);
computeService = context.getComputeService();
BlobStore
BlobStore blobStore;
String provider = "aliyun-oss";
String key = "Your AccessKey";
String secret = "Your AccessKeySecret";
BlobStoreContext context = ContextBuilder
      .newBuilder(provider)
      .credentials(key, secret)
      .buildView(BlobStoreContext.class);
blobStore = context.getBlobStore();
LoadBalancerService
LoadBalancerService loadBalancerService;
String provider = "aliyun-slb";
String key = "Your AccessKey";
String secret = "Your AccessKeySecret";
LoadBalancerServiceContext context = ContextBuilder
      .newBuilder(provider)
      .credentials(key, secret)
      .buildView(LoadBalancerServiceContext.class);
loadBalancerService = context.getLoadBalancerService();

Build

mvn package -DskipTests
浏览 14
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报