Repository navigation
Create projects and delete empty ones - #19
Merged
Merged
Conversation
`valar projects create [--public] name` and `valar projects delete [--yes] name`
call the platform's POST /projects and DELETE /projects/{project}, which need
Valar platform 2.11.0. Delete asks for the project name unless --yes is given,
and says the name is retired for good.
The client now takes any 2xx as success, since POST /projects answers 201.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements the two project commands the README listed as not implemented, against the endpoints in valar/platform#241 (platform 2.11.0).
valar projects create [--public] namesendsPOST /projectsand prints the project's name, creator and access. API errors come back as they are, for exampleConflict: project name is takenorForbidden: a user can create at most 3 projects.valar projects delete [--yes|-y] namesendsDELETE /projects/{name}. Unless--yesis given, it warns that the name is retired for good and asks you to type the project name. Anything else aborts without a request. The name is checked against the existing project-name pattern before it goes into the request path.api.Client.requestnow treats any 2xx as success, becausePOST /projectsanswers 201.--publicallows anonymous invocation, that only empty projects can be deleted, that deleted names are retired, and the minimum platform version.The command is
projectwith the aliasprojects, matchingservice/servicesanddomain/domains.Testing
go test ./...: new API client tests cover the 201 decode, the request body and error surfacing. New command tests cover the confirmation (match, mismatch, no input),--yes, and rejecting a name likedemo/services/apiwithout sending a request.-yon a non-empty project (409 message shown).No release tag: this waits until platform 2.11.0 is in production.