访问阿里云服务的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>UsageComputeServiceComputeService 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();BlobStoreBlobStore 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();LoadBalancerServiceLoadBalancerService 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();Buildmvn package -DskipTests点击空白处退出提示
评论