Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions openstack/mrs/v1/tags/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}