Add an SSH Public Key
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/credentials/crednames/{credentialName}
Request
- application/json
-
credentialName: string
Credential name associated with the SSH public key. The only supported credential name is
vmspublickey
. -
identityDomainId: string
Name of the identity domain for the MySQL Cloud Service account.
-
serviceId: string
The user-defined name of the Oracle MySQL Cloud Service instance.
-
X-ID-TENANT-NAME: string
Name of the identity domain for the MySQL Cloud Service account.
object
-
public-key:
string
The value of the SSH public key, with any slashes (
/
) it contains preceded by backslashes, as in\/
.
Response
- application/json
202 Response
object
-
status(optional):
string
Status description. For example:
submitted job
.
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" }