Use the v4 Component API to create a component directly from a repository URL, without first configuring an SCM integration. Use this if your source code is behind a VPN or firewall, and you still want component-level visibility and Jenkins job discovery through CloudBees CI.
| Without an SCM integration, CloudBees Unify doesn’t read any data directly from the repository. Pipeline job data appears only when an external CI/CD tool reports it against the component, either through the CloudBees CI integration on CloudBees Unify or by calling the Run APIs directly. For the full list of limitations when no SCM integration is attached, refer to Components without SCM integration. |
Before you begin, generate a personal access token to authenticate your requests. For instructions, refer to Manage personal access tokens. You also need the organization ID that will own the component. For instructions, refer to Locate organization ID.
All requests use the base URL https://api.cloudbees.io and authenticate with the personal access token as a bearer token.
Create a component
Send a POST request to /v4/organizations/{orgId}/components.
| Field | Required? | Description |
|---|---|---|
|
Yes |
Display name for the component. |
|
Yes |
Repository clone URL, in the format |
|
No |
Optional free-text description. Mutable via |
|
No |
The SCM provider backing the repository. Inferred from the |
|
No |
Default branch for the repository. Defaults to |
|
No |
ID of an existing SCM integration to attach at creation. If you provide a valid ID, the component is created with that integration attached. If omitted, CloudBees Unify checks for an existing SCM integration that has access to |
The response contains the new component’s id.
Capture this value to get, update, or delete the component later.
For an example, refer to Example: Create a component.
List and view components
To list components in an organization, send a GET request to /v4/organizations/{orgId}/components.
Filter the results with the name, repositoryUrl, or provider query parameters, and page through large result sets with pageSize and pageToken.
To view a single component, send a GET request to /v4/organizations/{orgId}/components/{id}.
For examples, refer to Example: List and filter components and Example: Retrieve a single component.
Update or delete a component
To rename a component, change its default branch, or attach an SCM integration, send a PATCH request to /v4/organizations/{orgId}/components/{id} with only the fields to change.
For an example, refer to Example: Update a component.
To detach an already-attached SCM integration and return the component to integration-less state, send the same PATCH request with the removeIntegration=true query parameter instead of a body.
To delete a component, send a DELETE request to /v4/organizations/{orgId}/components/{id}.
For an example, refer to Example: Delete a component.
| Deleting a component is irreversible. |
Upgrade to a full SCM integration later
When you configure an SCM integration that has access to an existing integration-less component’s repository, CloudBees Unify attaches it to that component automatically and upgrades it to a regular, fully integrated component. No data migration or manual steps are needed. To see this entire lifecycle end-to-end, including reporting a run against the integration-less component before the upgrade, refer to Example end-to-end use case, onboard a component without SCM and upgrade it later.