List Variable Sets associated with workspace #551
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
These changes build off of #520, namely I'm making a slight modification on which interface this method belongs to.
In the original PR, the method to list variable sets for a workspace was
VariableSets.ListForWorkspaces()
and I've changed it to:Workspaces.ListVariableSets()
. Given we typically have children relationships exposed as part of the parent interface, i.eWorkspaces.ListSomeChildren()
, I felt this API was more natural in describing the one-to-many relationship.It is worth noting that this endpoint is documented under our Variable Set API, however the path is
/workspaces/:workspace_id/varsets
so I felt like this is ultimately part of the Workspaces API.I've also added the
applyVariableSetToWorkspace()
test helper, which was missing in the original PR.Besides this, I've kept the original implementation from @tstapler (Great work if you see this!)
Testing plan
go test -v ./... -run TestWorkspacesListVariableSets -tags=integration
External links