生成一个 SoftLayer_Security_Ssh_Key 对象 API
Generate a SoftLayer_Security_Ssh_Key object API
我想为我的 SoftLayer 帐户生成一个新的 SSH 密钥。
我找到了一个如何上传生成的密钥的示例。
https://developer.ibm.com/marketplace/docs/technical-scenarios/obtain-virtual-server-ibm-cloud/
但是我想要生成一个密钥,所以我尝试调用以下 REST 但我无法使其工作
HTTP 方法:[POST]
API: rest/v3.1/SoftLayer_Security_Ssh_Key.json
正文:
{ "parameters": [
{
"label": "new-ssh-key"
}
]}
回复:
{
"error": "Key is required."
"code": "SoftLayer_Exception_Public"
}
此外,我检查了SoftLayer_Security_Ssh_Key的方法,但它没有任何生成密钥的方法。
您知道是否可以通过调用 SoftLayer API 生成 SSH 密钥吗?
谢谢
无法通过 API 生成 Ssh 密钥。 API 只是创建一条记录,它将一个 ssh 密钥附加到您的帐户(因此,在这种情况下,您需要已经生成的 Ssh 密钥)
API 会像这样做同样的事情:
https://control.softlayer.com/devices/sshkeys
我想为我的 SoftLayer 帐户生成一个新的 SSH 密钥。
我找到了一个如何上传生成的密钥的示例。 https://developer.ibm.com/marketplace/docs/technical-scenarios/obtain-virtual-server-ibm-cloud/
但是我想要生成一个密钥,所以我尝试调用以下 REST 但我无法使其工作
HTTP 方法:[POST]
API: rest/v3.1/SoftLayer_Security_Ssh_Key.json
正文:
{ "parameters": [
{
"label": "new-ssh-key"
}
]}
回复:
{
"error": "Key is required."
"code": "SoftLayer_Exception_Public"
}
此外,我检查了SoftLayer_Security_Ssh_Key的方法,但它没有任何生成密钥的方法。
您知道是否可以通过调用 SoftLayer API 生成 SSH 密钥吗?
谢谢
无法通过 API 生成 Ssh 密钥。 API 只是创建一条记录,它将一个 ssh 密钥附加到您的帐户(因此,在这种情况下,您需要已经生成的 Ssh 密钥)
API 会像这样做同样的事情: https://control.softlayer.com/devices/sshkeys