From 3813d9a186666e6d910049ea31e3dfb98cb0b16e Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Mon, 24 Feb 2020 02:32:55 +0000 Subject: [PATCH] Fix MRS tags request header issue --- openstack/mrs/v1/tags/requests.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/openstack/mrs/v1/tags/requests.go b/openstack/mrs/v1/tags/requests.go index db4b36fc1..94ae37165 100644 --- a/openstack/mrs/v1/tags/requests.go +++ b/openstack/mrs/v1/tags/requests.go @@ -4,6 +4,10 @@ import ( "github.com/huaweicloud/golangsdk" ) +var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{ + MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, +} + // Tag is a structure of key value pair. type Tag struct { //tag key @@ -49,13 +53,17 @@ func BatchAction(client *golangsdk.ServiceClient, clusterID string, opts BatchOp return } _, r.Err = client.Post(actionURL(client, clusterID), b, nil, &golangsdk.RequestOpts{ - OkCodes: []int{204}, + OkCodes: []int{204}, + MoreHeaders: RequestOpts.MoreHeaders, JSONBody: nil, }) return } // Get retrieves the tags of a specific instance. func Get(client *golangsdk.ServiceClient, clusterID string) (r GetResult) { - _, r.Err = client.Get(resourceURL(client, clusterID), &r.Body, nil) + _, r.Err = client.Get(resourceURL(client, clusterID), &r.Body, &golangsdk.RequestOpts{ + OkCodes: []int{200}, + MoreHeaders: RequestOpts.MoreHeaders, JSONBody: nil, + }) return }