Query the system agent GitHub project according to the new configuration¶
Submit a 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 this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
Set the operation-specific values used in the request: $AGENT_ID, $GITHUB_ACCESS_TOKEN.
Request¶
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 '{"config":{"owner":"example-org","repository":"example-repo"},"secrets":{"access_token":"$GITHUB_ACCESS_TOKEN"}}'
Request body
Parameters |
Type |
Is it 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 |
No |
GitHub channel configuration, such as the organization to which the warehouse belongs and the name of the warehouse. |
|
object |
No |
Key configuration required for the GitHub channel. This query is only used to read the item, the key will not be saved. |
Successful response¶
Returns 200 and optional items on success.
{"code":0,"data":{"items":[]}}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
array |
Items matching the submitted configuration. |
Error response¶
{"code":2,"message":"invalid request"}