github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dws/v1/cluster/ResetPassword.go (about) 1 package cluster 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 type ResetPasswordOpts struct { 9 ClusterId string `json:"-"` 10 // New password of the GaussDB(DWS) cluster administrator 11 // A password must conform to the following rules: 12 // Contains 8 to 32 characters. 13 // Cannot be the same as the username or the username written in reverse order. 14 // Contains at least three types of the following: 15 // Lowercase letters 16 // Uppercase letters 17 // Digits 18 // Special characters: ~!?,.:;-_'"(){}[]/<>@#%^&*+|\= 19 // Cannot be the same as previous passwords. 20 // Cannot be a weak password. 21 NewPassword string `json:"new_password" required:"true"` 22 } 23 24 func ResetPassword(client *golangsdk.ServiceClient, opts ResetPasswordOpts) (err error) { 25 b, err := build.RequestBody(opts, "") 26 if err != nil { 27 return 28 } 29 30 // POST /v1.0/{project_id}/clusters/{cluster_id}/reset-password 31 _, err = client.Post(client.ServiceURL("clusters", opts.ClusterId, "reset-password"), b, nil, &golangsdk.RequestOpts{ 32 OkCodes: []int{200}, 33 }) 34 return 35 }