Tag a context repository on a cluster
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos"
payload = {
"repo_owner": "<string>",
"repo_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({repo_owner: '<string>', repo_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo_owner": "<string>",
"repo_name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"repo_owner": "<string>",
"repo_name": "<string>",
"branch": "<string>",
"note": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Clusters
Tag a context repository on a cluster
The bearer twin of the portal’s AI context repository editor, for the Ankra app and scripts. Tags a repository as context Ankra AI reads when it works on this cluster, optionally with a branch and a note. Access stays bounded by the organisation’s GitHub App installation. Answers 409 when the repository is already tagged, the cluster’s limit is reached, or another project holds the repository. Requires clusters.write on the cluster.
POST
/
api
/
v1
/
org
/
clusters
/
{cluster_id}
/
context-repos
Tag a context repository on a cluster
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos"
payload = {
"repo_owner": "<string>",
"repo_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({repo_owner: '<string>', repo_name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/context-repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo_owner": "<string>",
"repo_name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"repo_owner": "<string>",
"repo_name": "<string>",
"branch": "<string>",
"note": "<string>",
"created_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Body
application/json
Response
The tagged repository.
A repository tagged on a cluster as context for Ankra AI.