MongoDB.local SF, Jan 15: See the speaker lineup & ship your AI vision faster. Use WEB50 to save 50%
Find out more >
Docs 菜单
Docs 主页

SSH 密钥

注意

注意:群组和项目是同义词。您的 {PROJECT-ID} 与您的项目 ID 相同。对于现有群组,群组/项目 ID 保持不变。当引用说明时,此页面将使用“群组”这个更为人熟知的术语。端点仍如文档中所述。

sshKeys资源显示当您通过 Cloud Manager 与云服务提供商的集成预配服务器时可供选择的公钥。 当您预配新服务器时, Cloud Manager会将公钥添加到服务器的授权密钥列表中。 您必须拥有相应的私钥才能日志预配的服务器。

有关Cloud Manager与云服务提供商集成的更多信息,请参阅配置服务器。

基本 URL: https://cloud.mongodb.com/api/public/v1.0

GET /groups/{PROJECT-ID}/sshKeys
GET /groups/{PROJECT-ID}/sshKeys/KEY-ID
GET /groups/{PROJECT-ID}/sshKeys/byName/KEY-NAME
POST /groups/{PROJECT-ID}/sshKeys
DELETE /groups/{PROJECT-ID}/sshKeys/KEY-ID
{
"id" : "545e3e3ae4b08a04fbc21005",
"name" : "myKey",
"publicKey" : "<ssh-key>",
"links" : []
}
名称
类型
说明

id

字符串

唯一标识符。

名称

字符串

Cloud Manager Provisioning Settings中显示的公钥名称。 有关预配配的更多信息,请参阅预配服务器。

publicKey

字符串

公钥的内容。

关系
说明

self

Me

http://mms.mongodb.com/group

SSH 密钥所属的项目

curl -u "username:apiKey" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/sshKeys"
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
{
"totalCount" : 1,
"results" : [ {
"id" : "545e3e3ae4b08a04fbc21005",
"name" : "myKey",
"publicKey" : "<ssh-key>",
"links" : []
}, { ...} ],
"links" : []
}
curl -u "username:apiKey" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/sshKeys/545e3e3ae4b08a04fbc21005"
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
{
"id" : "545e3e3ae4b08a04fbc21005",
"name" : "myKey",
"publicKey" : "<ssh-key>",
"links" : []
}
curl -u "username:apiKey" --digest -i -H "Content-Type: application/json" -X POST "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/sshKeys" --data '
{
"name" : "myKey",
"publicKey" : "<ssh-key>"
}'
HTTP/1.1 201 Created
{
"id" : "54c7a8bee4b0b5a9451be44e",
"name" : "myKey",
"publicKey" : "<ssh-key>",
"links" : []
}
curl -u "username:apiKey" --digest -i -X DELETE "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/sshKeys/545e3e3ae4b08a04fbc21005"
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}

此端点不返回响应正文。

在此页面上