Example Houston API queries
You can retrieve common information for specific Astronomer objects by using the following sample queries.
Finding the id of a workspace you belong to
Use the workspaces
query to find the ID of a Workspace that you belong to. Optionally, you can choose to filter by Deployment label.
Finding the id of all workspaces
System administrators can use the sysWorkspaces
query to perform a bulk-fetch of all Workspaces and their respective IDs using the sysWorkspaces
query. After retrieving the full list, you can filter the Workspaces within your application to locate the ID corresponding to the label of interest.
Query Deployment details
You can use the workspaceDeployment
query to retrieve details about a Deployment in a given Workspace. It requires the following inputs:
- Workspace ID: To retrieve this value, use the
sysWorkspaces
orworkspaces
query, or runastro workspace list
. Alternatively, open a Workspace in the Astro Private Cloud UI and copy the value after/w/
in your Workspace URL, for example,https://app.basedomain/w/<workspace-id>
. - Deployment release name: To retrieve this value, run
astro deployment list
in your Workspace. Alternatively, you can copy the Release name from your Deployment’s Settings tab in the Astro Private Cloud UI.
The workspaceDeployment
query can return also any of the fields under Type Details
, such as:
config
uuid
status
createdAt
updatedAt
roleBindings
For example, you can run the following query to retrieve the Deployment’s:
- ID
- Health status
- Creation time
- Update time
- Users
Query user details
A common query is users
, which lets you retrieve information about multiple users at once. To use this query, you must provide:
-
At least one of the following
userSearch
values:userId
(String): The user’s IDuserUuid
(String): The user’s unique IDusername
(String): The user’s usernameemail
(String): The user’s emailfullName
(String): The user’s full namecreatedAt
(DateTime): When the user was createdupdatedAt
(DateTime): When the user was updated
The query returns the requested details for all users who exactly match the values provided for the userSearch
. For example, the following query would retrieve the requested values for any user accounts with the email name@mycompany.com
: