通过 API 更新 S3 凭据

Updating S3 credentials via API

我正在编写自动化程序来更新 softlayer 的 S3 帐户密钥。我知道我可以通过 UI 做到这一点。是否有任何选项可以通过 api (python / java/ rest/ cli)?

我在 slcli 中看不到任何东西,我在这里也看不到任何休息端点:

https://sldn.softlayer.com/reference/softlayerapi/

无法通过控制门户更新 S3 的凭据或访问密钥,api,您只能创建和删除凭据(访问密钥)。

默认情况下,对象存储 S3 的凭据限制为 2 个。如果您已经创建了 2 个凭据,则必须删除其中一个才能创建另一个。

要了解您的 S3 凭据限制,请使用以下 rest 调用:

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage_Hub_Cleversafe_Account/[networkStorageAccountId]/getCredentialLimit

参考: https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Hub_Cleversafe_Account/getCredentialLimit/

要检索凭据,请使用以下 rest 调用:

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage_Hub_Cleversafe_Account/[networkStorageAccountId]/getCredentials

参考: https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Hub_Cleversafe_Account/getCredentials/

要创建凭据,请使用此 rest 调用:

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage_Hub_Cleversafe_Account/[networkStorageAccountId]/credentialCreate

参考: https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Hub_Cleversafe_Account/credentialCreate/

要删除凭据:

方法:POST

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Network_Storage_Hub_Cleversafe_Account/[networkStorageAccountId]/credentialDelete

正文:Json

{  
   "parameters":[  
      {  
        "id": 11111
      }
   ]
}

将 11111 数据替换为您的 credentialId。

参考: https://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage_Hub_Cleversafe_Account/credentialDelete/