Skip to content
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

Merged
merged 2 commits into from
Sep 20, 2017
Merged

pkg/vsphere/tags: Add UpdateCategory #6381

merged 2 commits into from
Sep 20, 2017

Conversation

vancluever
Copy link
Contributor

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.

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.
@vmwclabot
Copy link
Member

@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 {
Copy link
Contributor

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

Copy link
Contributor Author

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"`
}

@vmwclabot
Copy link
Member

@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.

@vmwclabot
Copy link
Member

@vancluever, VMware has approved your signed contributor license agreement.

vancluever added a commit to hashicorp/terraform-provider-vsphere that referenced this pull request Sep 19, 2017
Note that this is temporary until vmware/vic#6381 is merged, at which
point we will vendor off of the upstream commit.
vancluever added a commit to hashicorp/terraform-provider-vsphere that referenced this pull request Sep 19, 2017
Note that this is temporary until vmware/vic#6381 is merged, at which
point we will vendor off of the upstream commit.
vancluever added a commit to hashicorp/terraform-provider-vsphere that referenced this pull request Sep 19, 2017
Note that this is temporary until vmware/vic#6381 is merged, at which
point we will vendor off of the upstream commit.
Copy link
Member

@dougm dougm left a 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.

@dougm dougm merged commit 10ba339 into vmware:master Sep 20, 2017
@vancluever vancluever deleted the f-tag-update branch September 20, 2017 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants