Create a Deployment user with the Houston API

Create a Deployment user

To add an existing Astro Private Cloud user to a Deployment, you need:

  • Workspace Admin privileges
  • A Deployment ID. To retrieve this value, run astro deployment list or request the id value in the workspaceDeployment query.
  • The ID of the user to add. To retrieve this, request the id value in a users query or run astro workspace user list.
  • The role to add the user as. Can be DEPLOYMENT_ADMIN, DEPLOYMENT_EDITOR, or DEPLOYMENT_VIEWER.

The following query adds a user to a Deployment as a Deployment viewer, then returns the user and Deployment information back to the requester.

1mutation AddDeploymentUser(
2 $userId: Id! = "<user-id>",
3 $email: String! = "usertoadd@mycompany.com",
4 $deploymentId: Id! = "<some_id>",
5 $role: Role! = DEPLOYMENT_VIEWER
6)
7{
8 deploymentAddUserRole(
9 userId: $userId
10 email: $email
11 deploymentId: $deploymentId
12 role: $role
13 ) {
14 id
15 user {
16 username
17 }
18 role
19 deployment {
20 id
21 releaseName
22 }
23 }
24 }