Presign a workspace bundle upload
import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/bundles"
payload = {
"sha256": "<string>",
"size_bytes": 268435456
}
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({sha256: '<string>', size_bytes: 268435456})
};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/bundles', 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/workspaces/{workspace_id}/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sha256": "<string>",
"size_bytes": 268435456
}
'{
"exists": true,
"expires_at": "2023-11-07T05:31:56Z",
"object_key": "<string>",
"upload_url": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Workspaces
Presign a workspace bundle upload
Bearer PAT authentication; RBAC permission workspaces.use for the caller’s own workspace, workspaces.manage for another member’s. Answers a presigned PUT for the client’s git delta bundle, keyed by its SHA-256 under the workspace’s own prefix in the organisation’s backup vault, and whether the workspace already holds it (exists: the PUT can be skipped). The bundle is named to a run by bundle_object_key.
POST
/
api
/
v1
/
org
/
workspaces
/
{workspace_id}
/
bundles
Presign a workspace bundle upload
import requests
url = "https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/bundles"
payload = {
"sha256": "<string>",
"size_bytes": 268435456
}
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({sha256: '<string>', size_bytes: 268435456})
};
fetch('https://platform.ankra.app/api/v1/org/workspaces/{workspace_id}/bundles', 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/workspaces/{workspace_id}/bundles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sha256": "<string>",
"size_bytes": 268435456
}
'{
"exists": true,
"expires_at": "2023-11-07T05:31:56Z",
"object_key": "<string>",
"upload_url": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "<string>",
"error_code": "CLUSTER_OFFLINE",
"retry_after": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
The workspace.
Body
application/json
Response
Where to upload the bundle