Endurance

Certificate authorities

CAs

GET /certificates/cas

Get All CA Certificates

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "CA Certificates",
  "data": [
    {
      "id": "5e1c6079773bb",
      "name": "base-mc-lbnode-1",
      "validFrom": "2020-01-13T12:20:09+00:00",
      "validTo": "2022-01-12T12:20:09+00:00",
      "issuer": "loadbalancer.localdomain",
      "subject": "loadbalancer.localdomain",
      "subjectAltName": "DNS:loadbalancer.localdomain",
      "usage": {
        "userInterface": 1
      }
    }
  ]
}

POST /certificates/cas

Add a Certificate

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

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

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

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

$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>",
    "cert": "<cert>"
}

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "New CA certificate: {name} successfully added",
  "data": {
    "id": "5e1-c83-a66-2ab"
  }
}

CAs by ID

GET /certificates/cas/{id}

Get CA Certificate by ID

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

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "CA Certificate",
  "data": {
    "name": "TEST",
    "cert": [
      "-----BEGIN CERTIFICATE-----\nMIIDljCCAn4CCQCffk5QylMcijANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMC\nVUsxEDAOBgNVBAgMB0V4YW1wbGUxEDAOBgNVBAcMB0V4YW1wbGUxFDASBgNVBAoM\nC0V4YW1wbGUgT3JnMQwwCgYDVQQLDANEZXYxFDASBgNVBAMMC2V4YW1wbGUuY29t\nMR8wHQYJKoZIhvcNAQkBFhB0ZXN0QGV4YW1wbGUuY29tMB4XDTE4M…"
    ],
    "validFrom": "1529321575",
    "validTo": "1844681575",
    "issuer": "example.com",
    "subject": "example.com"
  }
}

PUT /certificates/cas/{id}

Edit a Certificate

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

Path parameters
id string Required

.Body parameters

name string Required
pem string Required
pfx string Required
password string Required

This is the password for pfx xert

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

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

$payload = [
    'name' => '<name>',
    'pem' => '<pem>',
    'pfx' => '<pfx>',
    'password' => '<password>',
    'cert' => '<cert>',
];

$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>",
    "pem": "<pem>",
    "pfx": "<pfx>",
    "password": "<password>",
    "cert": "<cert>"
}

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "CA certificate has been updated successfully"
}

DELETE /certificates/cas/{id}

Remove Certificate by 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/certificates/cas/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

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

const data = await response.json();
Response
{
  "status": "success",
  "message": "CA Certificate has been deleted"
}