-
Notifications
You must be signed in to change notification settings - Fork 33
add drs service #2
Conversation
Pull Request Test Coverage Report for Build 13
💛 - Coveralls |
type CreateOps struct { | ||
// The name of the EVS replication pair. | ||
// The name can contain a maximum of 255 bytes. | ||
Name string `q:"name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't add any more tags, like required or omitempty, this field will be send to backend. If this filed can not be empty string, please add the tag of 'required="true"'
) | ||
|
||
// RequestOpts specifies the header | ||
var RequestOpts = golangsdk.RequestOpts{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, you do not need this variable. Take the 'Content-Type' for example. It will be add at https://github.com/huaweicloud/golangsdk/blob/master/provider_client.go#L193
Please add more comments to make it clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
} | ||
|
||
_, r.Err = client.Post(createURL(client), b, &r.Body, &golangsdk.RequestOpts{ | ||
OkCodes: []int{202, 201, 200}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to my experience, the return code should be only one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Delete a replication by id | ||
func Delete(client *golangsdk.ServiceClient, id string) (r DeleteResult) { | ||
_, r.Err = client.Delete(deleteURL(client, id), &RequestOpts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need specify 'RequestOpts'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
// Get a replication with detailed information by id | ||
func Get(client *golangsdk.ServiceClient, id string) (r GetResult) { | ||
_, r.Err = client.Get(getURL(client, id), &r.Body, &RequestOpts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need specify 'RequestOpts'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
by the way, you can use the tool to generate these go files. |
af54acb
to
e1b1a6b
Compare
@zengchen1024 Thanks very much:) |
e1b1a6b
to
f5a189c
Compare
f5a189c
to
4842728
Compare
260f3a6
to
48c46dc
Compare
What this PR does / why we need it: add replication resource
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: