Endurance

Authentication

Updated

Get the browser SSL confirmation page

Return a ide html pages for confirming the browser SSL

GET /confirm

This endpoint does not require authentication.

curl
curl -X GET "https://appliance.example.com/api/v1/confirm"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/confirm';
$headers = [
];

$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


response = requests.get("https://appliance.example.com/api/v1/confirm")
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/confirm', {
  method: 'GET',
});

const data = await response.json();
Bruno
meta {
  name: Get the browser SSL confirmation page
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/confirm
  body: none
  auth: none
}
Response
"<!DOCTYPE html><html lang=\"en\"><head>…</head><body>…</body></html>"

Get the login options for an identity

Pre-auth login options for an identity (password vs SSO)

POST /login/options

This endpoint does not require authentication.

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

Body parameters
email string Required
curl
curl -X POST "https://appliance.example.com/api/v1/login/options" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/login/options';
$headers = [
    'Content-Type: application/json',
];

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

$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

payload = {
    "email": "<email>"
}

response = requests.post("https://appliance.example.com/api/v1/login/options", json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/login/options', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Get the login options for an identity
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/login/options
  body: json
  auth: none
}

headers {
  Content-Type: application/json
}

body:json {
  {
    "email": "<email>"
  }
}
Response
{
  "status": "success",
  "message": "Login options",
  "data": {
    "loginType": "password",
    "ssoEnforced": false,
    "samlConfigured": false,
    "samlEnforced": false,
    "2faRequired": false
  }
}

Check that the API is answering

Answered without authentication, and answered while the appliance is locked, so it is also how a client watches a long operation such as a major update: systemLock is true while the appliance holds the cluster for an operation of its own, userLock while an administrator holds it. Both are omitted if the lock could not be read.

GET /ping

This endpoint does not require authentication.

curl
curl -X GET "https://appliance.example.com/api/v1/ping"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ping';
$headers = [
];

$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


response = requests.get("https://appliance.example.com/api/v1/ping")
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ping', {
  method: 'GET',
});

const data = await response.json();
Bruno
meta {
  name: Check that the API is answering
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/ping
  body: none
  auth: none
}
Response
{
  "status": "success",
  "message": "pong",
  "data": {
    "nodeId": "cfa-ce4-93f-657",
    "userLock": false,
    "systemLock": false
  }
}

Token

Refresh the JWT token before if expires

GET /token

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

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

const data = await response.json();
Bruno
meta {
  name: Refresh your token
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Token refreshed",
  "data": {
    "token": "****jwt token ****"
  }
}

Login and get the JWT token. A cluster node logging in to a peer also sends requesterVersion, its own release and lb_api build. When that build differs from this node’s, or either cannot be read, an authenticated login is refused with 409 and the message the requester would itself have refused the pair with, worded from its side.

POST /token

This endpoint does not require authentication.

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

Body parameters
email string Required
password string Required
requesterVersion object

Sent by a cluster node only.

Fields
release string
build string
curl
curl -X POST "https://appliance.example.com/api/v1/token" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>",
  "password": "<password>",
  "requesterVersion": {
    "release": "<release>",
    "build": "<build>"
  }
}'
PHP
<?php

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

$payload = [
    'email' => '<email>',
    'password' => '<password>',
    'requesterVersion' => [
        'release' => '<release>',
        'build' => '<build>',
    ],
];

$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

payload = {
    "email": "<email>",
    "password": "<password>",
    "requesterVersion": {
        "release": "<release>",
        "build": "<build>"
    }
}

response = requests.post("https://appliance.example.com/api/v1/token", json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>",
  "password": "<password>",
  "requesterVersion": {
    "release": "<release>",
    "build": "<build>"
  }
}),
});

const data = await response.json();
Bruno
meta {
  name: Log in and get a token
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/token
  body: json
  auth: none
}

headers {
  Content-Type: application/json
}

body:json {
  {
    "email": "<email>",
    "password": "<password>",
    "requesterVersion": {
      "release": "<release>",
      "build": "<build>"
    }
  }
}
Response
{
  "status": "success",
  "message": "Successfully login",
  "data": {
    "user": {
      "id": "5d1-9be-6bb-c5a",
      "email": "loadbalancer@loadbalancer.org",
      "name": "Loadbalancer",
      "extra": []
    },
    "token": "****jwt token ****",
    "appliance_id": "5d9-be6-bbc-5af",
    "applianceVersion": "9.0.1",
    "licence": {
      "updateType": "full",
      "platform": "vmware",
      "serial": "5c6d53365a1e2",
      "model": "max",
      "supportExpired": false,
      "daysToExpire": 30,
      "companyName": "Acme Inc",
      "maxVips": 0,
      "maxRips": 0,
      "supportExpireDate": "31/07/2019",
      "modules": [],
      "licenceType": "trial"
    }
  }
}