Portal
Adopt this appliance into the Portal
curl
curl -X PUT "https://appliance.example.com/api/v1/portal/adopt" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "<email>",
"password": "<password>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/portal/adopt';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'email' => '<email>',
'password' => '<password>',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
payload = {
"email": "<email>",
"password": "<password>"
}
response = requests.put("https://appliance.example.com/api/v1/portal/adopt", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/portal/adopt', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"email": "<email>",
"password": "<password>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Update Sidecar successfully"
}
Remote
curl
curl -X GET "https://appliance.example.com/api/v1/portal/remote" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/portal/remote';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
response = requests.get("https://appliance.example.com/api/v1/portal/remote", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/portal/remote', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Remote Sidecar Details",
"data": {
"managementIP": "10.10.10.10",
"managementPort": 12000
}
}
curl
curl -X PUT "https://appliance.example.com/api/v1/portal/remote" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"managementIP": "<managementIP>",
"managementPort": "<managementPort>"
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/portal/remote';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'managementIP' => '<managementIP>',
'managementPort' => '<managementPort>',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
payload = {
"managementIP": "<managementIP>",
"managementPort": "<managementPort>"
}
response = requests.put("https://appliance.example.com/api/v1/portal/remote", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/portal/remote', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"managementIP": "<managementIP>",
"managementPort": "<managementPort>"
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Remote Sidecar updated successfully"
}
Get the Portal connection status
curl
curl -X GET "https://appliance.example.com/api/v1/portal/status" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/portal/status';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
response = requests.get("https://appliance.example.com/api/v1/portal/status", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/portal/status', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Sidecar Details",
"data": {
"adopted": false
}
}
Sidecar
curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/portal/sidecar" \
-H "Authorization: Bearer $TOKEN"
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/portal/sidecar';
$headers = [
'Authorization: Bearer ' . $token,
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
response = requests.get("https://appliance.example.com/api/v1/{applianceId}/portal/sidecar", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/portal/sidecar', {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
Response
{
"status": "success",
"message": "Sidecar Details",
"data": []
}
curl
curl -X PUT "https://appliance.example.com/api/v1/{applianceId}/portal/sidecar" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"portalAddress": "<portalAddress>",
"portalPort": 0,
"managementIPId": "<managementIPId>",
"managementPort": 0,
"subnetIds": [
"<subnetIds>"
]
}'
PHP
<?php
$url = 'https://appliance.example.com/api/v1/{applianceId}/portal/sidecar';
$headers = [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
];
$payload = [
'enabled' => true,
'portalAddress' => '<portalAddress>',
'portalPort' => 0,
'managementIPId' => '<managementIPId>',
'managementPort' => 0,
'subnetIds' => [
'<subnetIds>',
],
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests
headers = {"Authorization": f"Bearer {token}"}
payload = {
"enabled": true,
"portalAddress": "<portalAddress>",
"portalPort": 0,
"managementIPId": "<managementIPId>",
"managementPort": 0,
"subnetIds": [
"<subnetIds>"
]
}
response = requests.put("https://appliance.example.com/api/v1/{applianceId}/portal/sidecar", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/portal/sidecar', {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"enabled": true,
"portalAddress": "<portalAddress>",
"portalPort": 0,
"managementIPId": "<managementIPId>",
"managementPort": 0,
"subnetIds": [
"<subnetIds>"
]
}),
});
const data = await response.json();
Response
{
"status": "success",
"message": "Sidecar updated successfully"
}