Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Associate ¶
func Associate(c *golangsdk.ServiceClient, opts AssociateOpts) (string, error)
Associate is used to bind an SSH key pair to a specified VM
func Disassociate ¶
func Disassociate(c *golangsdk.ServiceClient, opts DisassociateOpts) (string, error)
Disassociate is used to unbind an SSH key pair to a specified VM
Types ¶
type AssociateOpts ¶
type AssociateOpts struct { // the SSH keypair name Name string `json:"keypair_name" required:"true"` // Information about the VM to which the key pair is to be bound Server EcsServerOpts `json:"server" required:"true"` }
AssociateOpts is the request body of binding an SSH keypair
type AuthOpts ¶
type AuthOpts struct { // the Authentication type, the value can be password or keypair Type string `json:"type,omitempty"` // If type is set to password, this parameter indicates the password. // If type is set to keypair, this parameter indicates the private key. Key string `json:"key,omitempty"` }
AuthOpts is the object about server authentication
type DisassociateOpts ¶
type DisassociateOpts struct { // the ID of the VM to which the SSH key pair is to be unbound ServerID string `json:"id" required:"true"` // server authentication object, this parameter is required when the server is poweron Auth *AuthOpts `json:"auth,omitempty"` }
DisassociateOpts is the request body of unbinding an SSH keypair
type EcsServerOpts ¶
type EcsServerOpts struct { // the ID of the VM to which the SSH key pair is to be bound ID string `json:"id" required:"true"` // server authentication object, this parameter is required when the server is poweron Auth *AuthOpts `json:"auth,omitempty"` // whether to disable SSH login on the VM DisablePassword *bool `json:"disable_password,omitempty"` }
EcsServerOpts is object about the VM to which the key pair is to be bound
type GetResult ¶
GetResult contains the response body and error from a GetTask request.
Click to show internal directories.
Click to hide internal directories.