Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Add UI_GetDeployment Endpoint #3856

Merged
merged 2 commits into from
Sep 26, 2022
Merged

Add UI_GetDeployment Endpoint #3856

merged 2 commits into from
Sep 26, 2022

Conversation

andrew-hashicorp
Copy link
Contributor

This PR adds a UI_GetDeployment endpoint for use on the front end as proposed in this RFC. These UI convenience methods return a DeploymentBundle, which contains a deployment with its associated artifact, build, deployUrl, jobDataSourceRef, and latestStatusReport.

This PR also moves the code responsible for creating a DeploymentBundle out of UI_ListDeployments into a utility method, getDeploymentBundle that is then shared by both UI_GetDeployment and UI_ListDeployments.

To run relevant tests:

go test -test.v ./pkg/server/singleprocess -count=1 -run TestHandlers/ui_deploy/TestServiceUI_Deployment_GetDeployment
go test -test.v ./pkg/server/singleprocess -count=1 -run TestHandlers/ui_deploy/TestServiceUI_Deployment_ListDeployments

To test on your local server:

grpcurl -insecure -H "client-api-protocol: 1,1" -H "authorization: YOUR_AUTH_TOKEN" -d '{"ref": { "id": "A_DEPLOYMENT_ID" } }' 127.0.0.1:9701 hashicorp.waypoint.Waypoint.GetDeployment

To get your auth token:

waypoint context inspect -json YOUR_LOCAL_WAYPOINT_CONTEXT_NAME

To get your deployments, so you can get a deployment ID:

grpcurl -insecure -H "client-api-protocol: 1,1" -H "authorization: YOUR_AUTH_TOKEN" -d '{"application": { "application": "YOUR_APPLICATION_NAME", "project": "YOUR_PROJECT_NAME" } }' 127.0.0.1:9701 hashicorp.waypoint.Waypoint.ListDeployments

Copy link
Contributor

@izaaklauer izaaklauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this! One quibble with a log message, but the functionality looks spot-on.

pkg/server/singleprocess/service_ui_deploy.go Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants