Endurance

Certificate authorities

CAs

Get All CA Certificates

GET /certificates/cas

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();
Bruno
meta {
  name: List the certificate authorities
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
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
      }
    }
  ]
}

Add a Certificate

POST /certificates/cas

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();
Bruno
meta {
  name: Create a certificate authority
  type: http
  seq: 1
}

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

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "name": "<name>",
    "cert": "<cert>"
  }
}
Response
{
  "status": "success",
  "message": "New CA certificate: {name} successfully added",
  "data": {
    "id": "5e1-c83-a66-2ab"
  }
}

CAs by ID

Get CA Certificate by ID

GET /certificates/cas/{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();
Bruno
meta {
  name: Get a certificate authority
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
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"
  }
}

Edit a Certificate

PUT /certificates/cas/{id}

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();
Bruno
meta {
  name: Update a certificate authority
  type: http
  seq: 1
}

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

headers {
  Content-Type: application/json
}

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

body:json {
  {
    "name": "<name>",
    "pem": "<pem>",
    "pfx": "<pfx>",
    "password": "<password>",
    "cert": "<cert>"
  }
}
Response
{
  "status": "success",
  "message": "CA certificate has been updated successfully"
}

Remove Certificate by ID

DELETE /certificates/cas/{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();
Bruno
meta {
  name: Delete a certificate authority
  type: http
  seq: 1
}

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

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "CA Certificate has been deleted"
}