From 67632f7c5d3ee1a6e216b8b05a2659950af706d9 Mon Sep 17 00:00:00 2001 From: ShiChangkuo Date: Sat, 25 Jul 2020 17:21:41 +0800 Subject: [PATCH] fix 403 response for css snapshot enable API using "{}" instead of nil as request body, otherwise, we will get 403 response code from the enable/auto_setting API. --- openstack/css/v1/snapshots/requests.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack/css/v1/snapshots/requests.go b/openstack/css/v1/snapshots/requests.go index 42fdf4923..2ffd973bd 100644 --- a/openstack/css/v1/snapshots/requests.go +++ b/openstack/css/v1/snapshots/requests.go @@ -48,7 +48,8 @@ func PolicyGet(client *golangsdk.ServiceClient, clusterId string) (r PolicyResul // Enable will enable the Snapshot function with the provided ID. func Enable(client *golangsdk.ServiceClient, clusterId string) (r ErrorResult) { - _, r.Err = client.Post(enableURL(client, clusterId), nil, nil, &golangsdk.RequestOpts{ + body := make(map[string]interface{}) + _, r.Err = client.Post(enableURL(client, clusterId), body, nil, &golangsdk.RequestOpts{ OkCodes: []int{200}, MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, })