Query the system agent GitHub project according to the new configuration¶
Submit the GitHub channel configuration and query the projects available for system agent configuration. The request does not save the configuration.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/system-agent-setups/{agent_id}/github-projects
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare personal access token, target workspace ID and system agent ID.
Request body¶
Replace $WORKSPACE_ID, $AGENT_ID, $CLOUDSIGMA_API_KEY, $GITHUB_ACCESS_TOKEN in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/system-agent-setups/$AGENT_ID/github-projects" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg token "$GITHUB_ACCESS_TOKEN" '{config:{owner:"matrixorigin",repository:"matrixflow"},secrets:{access_token:$token}}')"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The workspace ID to which it belongs. |
|
string |
Yes |
agent ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
No |
Channel name. This query does not save the value. |
|
string |
No |
Channel description. This query does not save the value. |
|
object |
Yes |
GitHub channel configuration, such as the organization to which the warehouse belongs and the name of the warehouse. |
|
string |
When the object is provided |
owner. Cannot be empty. |
|
string |
When the object is provided |
Warehouse name. Cannot be empty. |
|
string |
No |
Enterprise GitHub service address. |
|
object |
Yes |
Key configuration required for GitHub channels. This query is only used to read the item, the key will not be saved. |
|
string |
When the object is provided |
GitHub access token. Cannot be empty. |
config.owner, config.repository and secrets.access_token are required. config.base_url can be used for enterprise GitHub addresses. The token is constructed from secure environment variables only and is not written to the sample file or logs.
Successful response¶
{
"code": 0,
"data": {
"items": []
}
}
Field |
Type |
Description |
|---|---|---|
|
array of object |
Project matching commit configuration. |
|
string |
GitHub project ID. |
|
string |
owner. |
|
string |
Owner type. |
|
integer |
number. |
|
string |
title. |
|
string |
address. |
|
string |
host. |
Error response¶
{
"code": 2,
"message": "invalid request"
}
A parameter error is returned when the requested configuration is missing the warehouse owner, warehouse name, or access token.