-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/vsphere/tags: Add UpdateCategory #6381
Conversation
Just adding the update (PATCH) method for a category. Pretty basic, sourced from the create method, with new types added to specifically denote update parameters.
@vancluever, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction. |
type CategoryCreate struct { | ||
AssociableTypes []string `json:"associable_types"` | ||
Cardinality string `json:"cardinality"` | ||
Description string `json:"description"` | ||
Name string `json:"name"` | ||
} | ||
|
||
type CategoryUpdate struct { |
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.
Would this work?
type CategoryUpdate CategoryCreate
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.
Hey @hmahmood - I think you all might know better that me in this respect, but even though the fields are the same, personally I would leave it properly typed and keep the name and the redundancy. They are, technically, separate types all the way down (see update_spec
doc here), so I think the client should reflect that.
Personally I think things should have been structured like the following, which kind of illustrates my point a bit better:
type CategoryCreateInput struct {
CreateSpec CategoryCreateSpec `json:"create_spec"`
}
type CategoryUpdateInput struct {
UpdateSpec CategoryUpdateSpec `json:"update_spec"`
}
type CategoryCreateSpec struct {
AssociableTypes []string `json:"associable_types"`
Cardinality string `json:"cardinality"`
Description string `json:"description"`
Name string `json:"name"`
}
type CategoryUpdateSpec struct {
AssociableTypes []string `json:"associable_types"`
Cardinality string `json:"cardinality"`
Description string `json:"description"`
Name string `json:"name"`
}
@vancluever, your company's legal contact has approved your signed contributor license agreement. It will also be reviewed by VMware, but the merge can proceed. |
@vancluever, VMware has approved your signed contributor license agreement. |
Note that this is temporary until vmware/vic#6381 is merged, at which point we will vendor off of the upstream commit.
Note that this is temporary until vmware/vic#6381 is merged, at which point we will vendor off of the upstream commit.
Note that this is temporary until vmware/vic#6381 is merged, at which point we will vendor off of the upstream commit.
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.
lgtm
btw, we have moved packages from pkg/vsphere in the past to govmomi. Open to that and/or a separate repo for the rest based vAPIs.
Just adding the update (
PATCH
) method for a category. Pretty basic,sourced from the create method, with new types added to specifically
denote update parameters.