import requests
url = "https://api.platform.ankra.app/org/onboarding/apps"
payload = {
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repository": "<string>",
"branch": "<string>"
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
credential_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner: '<string>',
repository: '<string>',
branch: '<string>'
})
};
fetch('https://api.platform.ankra.app/org/onboarding/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/onboarding/apps \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repository": "<string>",
"branch": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository": "<string>",
"state": "setting_up",
"url": "<string>",
"message": "<string>",
"steps": [
{
"key": "application",
"state": "todo",
"message": "<string>"
}
],
"dependencies": [
"postgres"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Start an onboarding app
Register an existing GitHub repository as an application on the cluster and turn on AI code review, pull request previews (the cluster becomes the organisation’s staging cluster when it has none), backups of the app’s database, merge-when-green on Ankra’s setup pull request and the first deploy, each as far as the caller’s permissions allow. Answers 202 at once; poll the onboarding app. A second start for the same repository answers the existing one. Browser-session route; requires the X-Ankra-CSRF header.
import requests
url = "https://api.platform.ankra.app/org/onboarding/apps"
payload = {
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repository": "<string>",
"branch": "<string>"
}
headers = {
"cookie": "ankra_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'ankra_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
cluster_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
credential_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner: '<string>',
repository: '<string>',
branch: '<string>'
})
};
fetch('https://api.platform.ankra.app/org/onboarding/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/onboarding/apps \
--header 'Content-Type: application/json' \
--cookie ankra_session= \
--data '
{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner": "<string>",
"repository": "<string>",
"branch": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repository": "<string>",
"state": "setting_up",
"url": "<string>",
"message": "<string>",
"steps": [
{
"key": "application",
"state": "todo",
"message": "<string>"
}
],
"dependencies": [
"postgres"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}Authorizations
Body
An existing GitHub repository to put online on the cluster. A second start for the same repository answers the onboarding app the organisation already has and creates no second application.
Response
The onboarding app, new or the one the organisation already started for the repository.
The onboarding wizard's app: an existing repository registered as an application on the cluster, with AI code review, pull request previews, backups, merge-when-green on the setup pull request and the first deploy turned on. The id is the application's id.