Docs Menu

Docs HomeMongoDB Cloud Manager

SSH Keys

On this page

  • Endpoints
  • Sample Entity
  • Entity Fields
  • Links
  • Examples

Note

Groups and projects are synonymous terms. Your {PROJECT-ID} is the same as your project id. For existing groups, your group/project id remains the same. This page uses the more familiar term group when referring to descriptions. The endpoint remains as stated in the document.

The sshKeys resource displays the public keys available to choose from when you provision servers through Cloud Manager's integration with a cloud service provider. When you provision a new server, Cloud Manager adds the public key to the server's authorized keys list. You must have the corresponding private key to log into the provisioned server.

For more information on Cloud Manager integration with cloud service providers, see Provision Servers.

Base 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" : []
}
Name
Type
Description
id
string
Unique identifier.
name
string
The name of the public key as it appears in Cloud Manager Provisioning Settings. For more information on provisioning, see Provision Servers.
publicKey
string
The contents of the public key.
Relation
Description
self
Me
http://mms.mongodb.com/group
The project the SSH key belongs to
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}

This endpoint doesn't return a response body.

MongoDB Cloud Manager →