You can create components using the Compass GraphQL API by:
cloudId for your Atlassian sitecloudId1 2query getCloudId($hostName: String!) { tenantContexts(hostNames: [$hostName]) { cloudId } }
hostName value with your Atlassian site hostname:
1 2{ "hostName": "your-site-hostname.atlassian.net" }
cloudId for your site appears in the results area on the right side.cloudId to your clipboard.Use the createComponent mutation to create the new component.
1 2mutation createComponent($cloudId: ID!, $componentDetails: CreateCompassComponentInput!) { compass { createComponent(cloudId: $cloudId, input: $componentDetails) { success componentDetails { id name typeId } } } }
1 2{ "cloudId": "your-cloudid", "componentDetails": { "name": "your-component-name", "typeId": "your-component-type" } }
cloudId and the name of the new component.typeId with your component’s type. The valid values are SERVICE, LIBRARY, APPLICATION, CAPABILITY, CLOUD RESOURCE, DATA PIPELINE, MACHINE LEARNING MODEL, UI ELEMENT, WEBSITE, OTHER.id, name and typeId of your newly created component in the results area on the right side.Components have more attributes other than name and typeId. For a complete list of input parameters to create components using the API, see the createComponent mutation in the Compass GraphQL API reference documentation.
We recommend that you don't exceed 20,000 components in Compass, beyond which you may notice some performance degradation. We are working on scaling the solution to increase the limits over time.
If you get an error when attempting to create the component, make sure you’ve provided:
cloudId for your Atlassian site and there are no typosname and typeId, which are both mandatorySERVICE, LIBRARY, APPLICATION, CAPABILITY, CLOUD RESOURCE, DATA PIPELINE, MACHINE LEARNING MODEL, UI ELEMENT, WEBSITE, OTHER) for typeIdYou can perform numerous other operations using the Compass GraphQL API. To learn more, see the following resources:
Rate this page: