Endurance

Service IPs

A service IP is the address a Virtual Service answers on. It is backed by a static IP on each appliance.

Service IPs

Get all Service IPs

GET /service-ips

curl
curl -X GET "https://appliance.example.com/api/v1/service-ips" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips';
$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/service-ips", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the service IPs
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service IPs",
  "data": [
    {
      "id": "189-1e2-8b1-85e",
      "label": "Web Service"
    }
  ]
}

Add a service IP

POST /service-ips

This change is staged. Send PUT /services/apply to apply it.

Body parameters
name string Required
curl
curl -X POST "https://appliance.example.com/api/v1/service-ips" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    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 = {
    "name": "<name>"
}

response = requests.post("https://appliance.example.com/api/v1/service-ips", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a service IP
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>"
  }
}
Response
{
  "status": "success",
  "message": "Service IP added successfully",
  "data": {
    "id": "189-1e2-8b1-85e"
  }
}

Count the service IPs with no static IP on a node

Count of Service IPs with unassigned Static IP on a node

GET /service-ips/unassigned

curl
curl -X GET "https://appliance.example.com/api/v1/service-ips/unassigned" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips/unassigned';
$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/service-ips/unassigned", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips/unassigned', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Count the service IPs with no static IP on a node
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips/unassigned
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Unassigned service IPs",
  "data": {
    "count": 1
  }
}

By ID

Add a service ip to a group

GET /service-ips/{id}

Path parameters
id string Required

The id of the service-ip.

curl
curl -X GET "https://appliance.example.com/api/v1/service-ips/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips/{id}';
$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/service-ips/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a service IP
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service IP",
  "data": {
    "id": "189-1e2-8b1-85e",
    "label": "Web Service",
    "usage": [
      {
        "service": "haproxy",
        "serviceFullName": "HAProxy",
        "serviceId": null,
        "serviceName": "HAProxy Persistence Replication",
        "serviceNodeId": null,
        "section": "",
        "sectionFullName": ""
      }
    ],
    "sips": [
      {
        "nodeId": "edd-1d5-72f-3c0",
        "sipId": "67c-006-613-d3b"
      },
      {
        "nodeId": "ad3-a85-94d-14a",
        "sipId": null
      }
    ]
  }
}

Edit a service IP

PUT /service-ips/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

name string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/service-ips/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "<name>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'name' => '<name>',
];

$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 = {
    "name": "<name>"
}

response = requests.put("https://appliance.example.com/api/v1/service-ips/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "<name>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a service IP
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "name": "<name>"
  }
}
Response
{
  "status": "success",
  "message": "Service IP edited successfully"
}

Delete a service IP

DELETE /service-ips/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/service-ips/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/service-ips/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    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.delete("https://appliance.example.com/api/v1/service-ips/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/service-ips/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a service IP
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/service-ips/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Service IP deleted successfully"
}

Assign a static IP to a service IP

Assign a SIP to a Service IP

POST /{applianceId}/service-ips/{id}/assign

This change is staged. Send PUT /services/apply to apply it.

Path parameters
applianceId string Required

The id of the cluster node the request is for.

id string Required

.Body parameters

sipId string Required

Static IP ID

curl
curl -X POST "https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/assign" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "sipId": "<sipId>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/assign';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'sipId' => '<sipId>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    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 = {
    "sipId": "<sipId>"
}

response = requests.post("https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/assign", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/assign', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "sipId": "<sipId>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Assign a static IP to a service IP
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/service-ips/{id}/assign
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "sipId": "<sipId>"
  }
}
Response
{
  "status": "success",
  "message": "SIP assign to a Service IP successfully"
}

Unassign a static IP from a service IP

Unassign a SIP to a service IP

DELETE /{applianceId}/service-ips/{id}/unassign

This change is staged. Send PUT /services/apply to apply it.

Path parameters
applianceId string Required

The id of the cluster node the request is for.

id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/unassign" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/unassign';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    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.delete("https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/unassign", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/service-ips/{id}/unassign', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Unassign a static IP from a service IP
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/service-ips/{id}/unassign
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "SIP unassign from a Service IP successfully"
}