psm MySQLCS add-ssh-public-key

Adds a new public SSH key to the MySQL Cloud Service instance. This overwrites the existing SSH key with the new one.

Syntax

In the following syntax, line breaks have been added for clarity. Do not include them when entering the command.

psm MySQLCS add-ssh-public-key -s|--service-name instance-name 
    -c|--credential-name vmspublickey 
    -k|--public-key "ssh-rsa ......."
    [-wc|--wait-until-complete true|false]
    [-of|--output-format json|html|short]

Parameters

Parameter Description

-s|--service-name instance-name

Specifies the name of the instance.

-c|--credential-name vmspublickey

A string which identifies the new SSH key. Currently, the only value you can use is vmspublickey

-k|--public-key "ssh-rsa ......."

Sets the new key. Add the contents of the public key file.

–wc|--wait-until-complete true|false

(Optional) If set to true, the command behaves synchronously. That is, it does not return until the submitted job is complete. The following message is displayed until the job is complete:

Waiting for the job to complete... (it cannot be cancelled)

The default value is false.

-of|--output-format json|html|short

(Optional) Specifies the output format of the command’s response:

  • json—output is formatted as a JSON array.

  • html—output is formatted as HTML

  • short—output is formatted as a brief summary.

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

Examples

The following example updates the SSH key of the MySQL57–aas instance:

$ psm MySQLCS add-ssh-publickey -s MySQL57–aas 
	--credential-name vmspublickey 
	--public-key "ssh-rsa AAAA..."