簡體   English   中英

Jclouds Rackspace雲文件服務網

[英]Jclouds Rackspace Cloud Files service net

在Java中使用雲文件api時可以使用servicenet嗎? 目前,我正在如下使用它:

ContextBuilder cb = ContextBuilder.newBuilder(config.getProvider())
    .credentials(config.getUserName(), config.getApiKey()).modules(modules);
CloudFilesApi cfa = cb.buildApi(CloudFilesApi.class);

我之所以這樣問是因為,我曾經使用具有boolean參數的python客戶端來選擇使用公共網絡還是服務網絡:

cf = pyrax.connect_to_cloudfiles(region=CDN_REGION, public=CDN_USEPUBLIC)
Iterable<Module> modules = ImmutableSet.<Module> of(new SLF4JLoggingModule(),
        new InternalUrlModule());

ContextBuilder builder = ContextBuilder.newBuilder(PROVIDER)
        .modules(modules)
        .credentials(username, apiKey);
  blobStore = builder.buildView(RegionScopedBlobStoreContext.class).getBlobStore(REGION);
  cloudFiles = blobStore.getContext().unwrapApi(CloudFilesApi.class);

您需要確保將InternalUrlModule添加到模塊列表中。 反過來,這將使jclouds在連接到服務時使用適用的ServiceNet端點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM