github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/compute/v2/extensions/pauseunpause/requests.go (about) 1 package pauseunpause 2 3 import "github.com/huaweicloud/golangsdk" 4 5 func actionURL(client *golangsdk.ServiceClient, id string) string { 6 return client.ServiceURL("servers", id, "action") 7 } 8 9 // Pause is the operation responsible for pausing a Compute server. 10 func Pause(client *golangsdk.ServiceClient, id string) (r PauseResult) { 11 _, r.Err = client.Post(actionURL(client, id), map[string]interface{}{"pause": nil}, nil, nil) 12 return 13 } 14 15 // Unpause is the operation responsible for unpausing a Compute server. 16 func Unpause(client *golangsdk.ServiceClient, id string) (r UnpauseResult) { 17 _, r.Err = client.Post(actionURL(client, id), map[string]interface{}{"unpause": nil}, nil, nil) 18 return 19 }