import requests
url = "https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects"
payload = { "projects": [
{
"permissions": ["<string>"],
"project": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{permissions: ['<string>'], project: '<string>'}]})
};
fetch('https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"permissions": [
"<string>"
],
"project": "<string>"
}
]
}
'{
"application": {
"id": "<string>",
"name": "<string>"
},
"created_at": "<string>",
"credential_name": "<string>",
"description": "<string>",
"expires_at": "<string>",
"host": "<string>",
"kind": "user",
"managed": true,
"name": "<string>",
"permissions": [
"<string>"
],
"project": "<string>",
"project_access": [
{
"permissions": [
"<string>"
],
"project": "<string>",
"project_name": "<string>",
"scope": "push"
}
],
"project_name": "<string>",
"projects": [
"<string>"
],
"robot_name": "<string>",
"rotated_at": "<string>",
"scope": "push",
"secret_changed": true,
"account_email": "<string>",
"provider": "harbor",
"docker_login": "<string>",
"secret": "<string>",
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Change the projects a registry robot reaches
Change which projects the robot reaches. Where the registry can change the robot in place, its login and secret keep working: on Harbor that takes a robot reaching several projects and a user as the admin credential, because no robot may hold Harbor’s robot update right. Any other change replaces the robot, and only with allow_new_secret: the answer carries the new secret once, and whatever logs in with the current one stops working. Asking for what the robot already holds changes nothing. The robot keeps its name, description and expiry. A browser session twin is mounted at the same path without the /api/v1 prefix (cookie authentication).
import requests
url = "https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects"
payload = { "projects": [
{
"permissions": ["<string>"],
"project": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({projects: [{permissions: ['<string>'], project: '<string>'}]})
};
fetch('https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/registry-robots/{robot_name}/projects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"projects": [
{
"permissions": [
"<string>"
],
"project": "<string>"
}
]
}
'{
"application": {
"id": "<string>",
"name": "<string>"
},
"created_at": "<string>",
"credential_name": "<string>",
"description": "<string>",
"expires_at": "<string>",
"host": "<string>",
"kind": "user",
"managed": true,
"name": "<string>",
"permissions": [
"<string>"
],
"project": "<string>",
"project_access": [
{
"permissions": [
"<string>"
],
"project": "<string>",
"project_name": "<string>",
"scope": "push"
}
],
"project_name": "<string>",
"projects": [
"<string>"
],
"robot_name": "<string>",
"rotated_at": "<string>",
"scope": "push",
"secret_changed": true,
"account_email": "<string>",
"provider": "harbor",
"docker_login": "<string>",
"secret": "<string>",
"warning": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The projects a robot should reach from now on, replacing the ones it reaches.
Every project the robot should reach, 1 to 20 different ones, each with its own scope or permissions.
Show child attributes
Show child attributes
Let Ankra replace the robot when the registry cannot change it in place. The robot gets a new secret, and its login changes when it moves between one project and several. Whatever logs in with the current secret stops working.
Response
Successful Response
The application an application robot belongs to; null for every other kind, and for one whose application is gone.
Show child attributes
Show child attributes
The registry credential holding the login. Unique across the listing, which a robot's name is not.
When the registry stops honouring the robot; null for one that never expires.
Who the robot belongs to: a member (user), organisation provisioning (organisation: the ci and pull robots) or one application (application).
user, organisation, application True for a robot Ankra minted and whose secret it fans out itself. It is listed and read here, never rotated or revoked.
A member's robot: the name it was created under. A managed robot: ci, pull, or app-.
Every grant the robot holds, written resource:action; for a robot reaching several projects, every grant it holds on any of them.
Every project the robot reaches with the grants it holds there: one entry for a robot bound to one project, several for a robot reaching several, none for a managed robot whose project cannot be read.
Show child attributes
Show child attributes
What a member addresses the project by: default for the organisation's own, the name it was created under for an extra project, and empty for a project on a registry the organisation runs itself.
Every registry project the robot reaches; project and project_name are the first of them.
The preset the grants amount to, or custom when they are neither preset. For a robot reaching several projects, the preset every project holds alike, or custom when they differ.
push, pull, custom Whether the robot was replaced. When false, its login and secret still work.
The service account a robot on Google Artifact Registry is; absent on Harbor.
The kind of registry the robot lives on: harbor for the Ankra registry and any integrated Harbor, google_artifact_registry for an integrated Google Artifact Registry.
harbor, google_artifact_registry The login command for the new secret; only when the secret changed.
The new secret, answered once; only when the secret changed.
Set when the change was made but something after it did not finish, and says what is left.