import requests
url = "https://platform.ankra.app/api/v1/clusters/managed/{provider}/networks"
payload = {
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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({credential_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/managed/{provider}/networks', 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/clusters/managed/{provider}/networks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"provider_reference": "<string>",
"region": "<string>",
"is_default": false
}{
"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"
}Create a provider network
Provision a provider network with the scoping credential so the create wizard can offer an inline create-network flow. GKE creates an auto subnet-mode VPC (a subnetwork in every region, like the GCP default network) and waits for the compute operation to finish; other providers answer 400. The GCP service account needs the compute.networks.create permission (for example via the Compute Network Admin role, roles/compute.networkAdmin); a credential without it answers 400 with the provider’s permission message. The response is the created network in the options catalog’s private_networks shape. For ankracloud_k8s with no credential_id, the organisation’s built-in Ankra Cloud credential is used: the request answers 404 while the organisation’s ankra_cloud_provider feature flag is off, and 503 with Retry-After when the built-in credential cannot be created or renewed right now.
import requests
url = "https://platform.ankra.app/api/v1/clusters/managed/{provider}/networks"
payload = {
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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({credential_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/managed/{provider}/networks', 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/clusters/managed/{provider}/networks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"provider_reference": "<string>",
"region": "<string>",
"is_default": false
}{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
PAT organisation override.
Path Parameters
doks, uks, gke, ovh_mks, aks, eks, kapsule, ankracloud_k8s "kapsule"
Body
Required for every provider but ankracloud_k8s; the others answer 422 without it. For ankracloud_k8s it may be omitted when the built-in Ankra Cloud credential is configured: the organisation's built-in credential is then used.