diff --git a/openstack/cce/v3/nodes/results.go b/openstack/cce/v3/nodes/results.go index fb1d453f1..f223d7c74 100644 --- a/openstack/cce/v3/nodes/results.go +++ b/openstack/cce/v3/nodes/results.go @@ -86,7 +86,14 @@ type Status struct { type LoginSpec struct { // Select the key pair name when logging in by key pair mode - SshKey string `json:"sshKey" required:"true"` + SshKey string `json:"sshKey,omitempty"` + // Select the user/password when logging in + UserPassword UserPassword `json:"userPassword,omitempty"` +} + +type UserPassword struct { + Username string `json:"username" required:"true"` + Password string `json:"password" required:"true"` } type VolumeSpec struct { diff --git a/openstack/cce/v3/nodes/testing/requests_test.go b/openstack/cce/v3/nodes/testing/requests_test.go index 02f4c3801..9e2a603a2 100644 --- a/openstack/cce/v3/nodes/testing/requests_test.go +++ b/openstack/cce/v3/nodes/testing/requests_test.go @@ -148,7 +148,11 @@ func TestCreateV3Node(t *testing.T) { ], "flavor": "s3.large.2", "login": { - "sshKey": "test-keypair" + "sshKey": "test-keypair", + "userPassword": { + "password": "", + "username": "" + } }, "publicIP": { "eip": {