Add an SSH Public Key

post

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/credentials/crednames/{credentialName}

Adds an SSH public key to a MySQL Cloud Service instance.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the details of the SSH public key name and value.
Root Schema : ssh-add-key-post-request
Type: object
The request body defines the SSH public key value to add.
Show Source
  • The value of the SSH public key, with any slashes (/) it contains preceded by backslashes, as in \/.

Response

Supported Media Types

202 Response

Accepted. See Status Codes for information about other HTTP status codes.
Body ()
The response body contains information about the add SSH key operation.
Root Schema : ssh-add-key-response
Type: object
The response body contains information about the add SSH key operation.
Show Source

Examples

The following example shows how to add an SSH public key to a MySQL Cloud Service instance by submitting a POST request on the REST endpoint using cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the Oracle Public Cloud or Oracle Cloud Machine REST server to contact for your identity domain or tenant name. See Send Requests for the appropriate URL structure to use on Oracle Public Cloud or Oracle Cloud Machine.

cURL Command

This example adds a new SSH public key to a MySQL Cloud Service instance named MyTestInstance in the ExampleIdentityDomain identity domain. It passes in a request body using curl's -d (--data) parameter by defining public-key in the request body's JSON object.

curl -i -X POST \
  -u "username:password" \
  -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"public-key":"ssh-rsaACDAB3NzaC1yc..."}' \
  https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/credentials/crednames/vmspublickey

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 202 Accepted
Date: Wed, 30 Nov 2016 23:16:03 GMT
Transfer-Encoding: chunked
Location: https://rest_server_url/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/3488
Content-Type: application/json
X-ORACLE-DMS-ECID: 8-d-38137164168c6c0-d-bd607b880dc37e230c13e-9
X-Frame-Options: DENY
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Retry-After: 5
Access-Control-Allow-Origin: *

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "status": "submitted job"
}