Houston API

Use the Houston API on Astro Private Cloud

The Houston API allows you to build applications that provision and manage resources on Astro Private Cloud. You can use the Houston API to perform CRUD operations on entities scoped to the Astronomer platform, including Airflow Deployments, Workspaces, and users.

For example, you can:

  • Delete a Deployment
  • Look up a Deployment’s resource config
  • Add a user to a Workspace
  • Make a user a System Administrator

Anything you can do with the Astro Private Cloud UI, you can do programmatically with the Houston API.

Schema overview

The Houston API uses the GraphQL API query language. You can make GraphQL requests using standard REST API tools such as HTTP and curl. GraphQL APIs support two main request types: queries and mutations. You can run these requests against objects which are similar to endpoints in REST APIs.

A query is a request for specific information and is similar to a GET request in a REST API. The primary difference between GraphQL queries and REST API queries is that GraphQL queries only return the fields that you specify within your request. For example, consider the following query to retrieve information about a user:

1query User {
2 users(user: { email: "name@mycompany.com"} )
3 {
4 id
5 roleBindings {role}
6 }
7}

The Houston API would only return the ID and role bindings for the user because those are the only fields specified in the query.

A mutation is a request to update data for a specific object. Different mutations exist for creating, updating, and deleting objects. When you write a mutation request, it’s best practice to use variables to store the data you want to update. For example, consider the following example mutation:

1mutation workspaceAddUser(
2 $workspaceUuid: Uuid = "<your-workspace-uuid>"
3 $email: String! = "<user-email-address>"
4 $role: Role! = <user-workspace-role>
5 $bypassInvite: Boolean! = true
6) {
7 workspaceAddUser(
8 workspaceUuid: $workspaceUuid
9 email: $email
10 role: $role
11 bypassInvite: $bypassInvite
12 ) {
13 id
14 }
15}

In this mutation, the values to update are formatted as variables in the first part of the request, then applied in the second half. Variables marked with a ! are required in order for the query to complete. Lastly, the mutation requests the Houston API to return id of the added user to confirm that the mutation was successful. In this way, it’s possible to make a mutation and a query in a single request.

For more basic GraphQL usage rules and examples, see the GraphQL documentation.