The following sections gives the Sample Payloads in both Python and CURL for various APIs.
Get all data protection plans (jobs) - Python
import requests
# URL path for API with backup-type=BACKUP
url = 'https://<console-url>/api/accounts/<account-id>/baas/jobs'
params = {
'page': 1,
'page-size': 10,
'backup-type': 'BACKUP'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <jwt>'
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
CURL# Format
curl --request GET \
--url 'https://<console-url>/api/accounts/<account-id>/baas/jobs?page=1&page-size=10&backup-type=BACKUP' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <JWT token>'
# Example
curl --request GET \
--url 'https://<URL path for API with backup-type= BACKUP' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <JWT token>'
Get data protection plan (job) by id - Python
import requests
# URL path for API with job-id
url = 'https://<console-url>/api/accounts/<account-id>/baas/jobs/<job-id>'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <JWT token>'
}
response = requests.get(url, headers=headers)
print(response.json())
CURL# Format
curl --request GET \
--url 'https://<console-url>/api/accounts/<account-id>/baas/jobs/<job-id>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <JWT token>'
# Example
curl --request GET \
--url 'https://abc.xyz.com/api/accounts/bxxxx-e1/baas/jobs/14594/' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <JWT token>'
Execute a data protection plan (job) - Python
import requests
# URL path for API with job-id
url = 'https://<console-url>/api/accounts/<account-id>/baas/jobs/<job-id>'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <JWT token>'
}
response = requests.get(url, headers=headers)
print(response.json())
CURL# Curl command format
curl --request POST \
--url '<console-url>/api/accounts/<account-id> /baas/jobs/<job-id>/execute' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${JWT_TOKEN}" \
--data '{"run_type":"FULL"}'
# Example
curl --request POST \
--url '<https://abc.xyz.com/api/accounts/bxxxx-e1/baas/jobs/14594/execute' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${JWT_TOKEN}" \
--data '{"run_type":"FULL"}'