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.

HTTP
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.

Shell
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

workspace_id

string

Yes

The workspace ID to which it belongs.

agent_id

string

Yes

agent ID.

Request body

Field

Type

Required

Description

name

string

No

Channel name. This query does not save the value.

description

string

No

Channel description. This query does not save the value.

config

object

Yes

GitHub channel configuration, such as the organization to which the warehouse belongs and the name of the warehouse.

config.owner

string

When the object is provided

owner. Cannot be empty.

config.repository

string

When the object is provided

Warehouse name. Cannot be empty.

config.base_url

string

No

Enterprise GitHub service address.

secrets

object

Yes

Key configuration required for GitHub channels. This query is only used to read the item, the key will not be saved.

secrets.access_token

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

JSON
{
  "code": 0,
  "data": {
    "items": []
  }
}

Field

Type

Description

data.items

array of object

Project matching commit configuration.

data.items[].project_id

string

GitHub project ID.

data.items[].owner

string

owner.

data.items[].owner_type

string

Owner type.

data.items[].number

integer

number.

data.items[].title

string

title.

data.items[].url

string

address.

data.items[].host

string

host.

Error response

JSON
{
  "code": 2,
  "message": "invalid request"
}

A parameter error is returned when the requested configuration is missing the warehouse owner, warehouse name, or access token.

Last updated on