【问题标题】:How to get a region list in IBM cloud object storage using Rest API如何使用 Rest API 在 IBM 云对象存储中获取区域列表
【发布时间】:2019-12-15 04:06:34
【问题描述】:

我需要使用 Rest API 在 IBM Cloud Object Storage 中获取区域列表。例如:us-east、au-syd 等。我没有找到任何与获取区域列表相关的 API 参考。

【问题讨论】:

    标签: rest api ibm-cloud-infrastructure ibm-cloud-storage


    【解决方案1】:

    您可能想要检索区域端点。

    尝试使用以下 rest api 调用:

    https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Hub_Cleversafe_Account/[accountId]/getEndpoints
    

    输出:

    [
      {
            "legacy": true,
            "location": "us-south",
            "region": "regional",
            "type": "public",
            "url": "s3.us-south.objectstorage.softlayer.net"
        },
        {
            "legacy": true,
            "location": "us-east",
            "region": "regional",
            "type": "public",
            "url": "s3.us-east.objectstorage.softlayer.net"
        },
        {
            "legacy": true,
            "location": "eu-gb",
            "region": "regional",
            "type": "public",
            "url": "s3.eu-gb.objectstorage.softlayer.net"
        },
    ]
    

    参考:

    https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Hub_Cleversafe_Account/getEndpoints/

    希望这会有所帮助。

    【讨论】:

    • 感谢 F.Ojeda 的回复。但是我在尝试 APi {"error":"Unable to find object with id of '188xxxx'.","code":"SoftLayer_Exception_ObjectNotFound"} 时遇到错误。请告诉我如何解决此错误。
    • 要通过 api 获取对象存储帐户 ID,请尝试使用以下带有对象过滤器的 rest api:https://[username]:[apikey]@api.softlayer.com/rest/v3/ SoftLayer_Account/getNetworkStorage?objectFilter={"networkStorage":{"username":{"operation":"SLOSC1232-5"}}} 将“SLOSC1232-5”替换为您的用户名(在控制门户中,您会发现帐户名称.
    • 感谢 F.Ojeda。使用 SL COS 帐户 ID 获取 SL COS 区域的工作正常。但我需要使用 IBM COS 帐户 ID 来获取区域。如何获取任何其他 IBM COS API??
    • 据我所知,它应该适用于 IBM 和 SL,请参阅以下文档 cloud.ibm.com/docs/infrastructure/…。在以下文档中,您将找到有关 IBM COS API cloud.ibm.com/docs/infrastructure/… 的更多示例
    猜你喜欢
    • 1970-01-01
    • 2018-12-03
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 2017-11-17
    • 1970-01-01
    • 2018-11-25
    • 2019-11-16
    相关资源
    最近更新 更多