Create SSH certificate authority
curl --request POST \
--url https://api.example.com/api/v2/sshcertificateauthorities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "ssh-ca-name",
"description": "A verbose description",
"tags": [
{
"name": "cluster-id",
"value": "9361402c-f998-49cc-ab21-9bb99afcfde8"
}
]
},
"spec": {
"organizationId": "161b9d5a-701d-4fea-848d-0e345edf16e9",
"projectId": "f113be96-4dd2-4c14-9c0e-e96c500f21e0",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}
'import requests
url = "https://api.example.com/api/v2/sshcertificateauthorities"
payload = {
"metadata": {
"name": "ssh-ca-name",
"description": "A verbose description",
"tags": [
{
"name": "cluster-id",
"value": "9361402c-f998-49cc-ab21-9bb99afcfde8"
}
]
},
"spec": {
"organizationId": "161b9d5a-701d-4fea-848d-0e345edf16e9",
"projectId": "f113be96-4dd2-4c14-9c0e-e96c500f21e0",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
name: 'ssh-ca-name',
description: 'A verbose description',
tags: [{name: 'cluster-id', value: '9361402c-f998-49cc-ab21-9bb99afcfde8'}]
},
spec: {
organizationId: '161b9d5a-701d-4fea-848d-0e345edf16e9',
projectId: 'f113be96-4dd2-4c14-9c0e-e96c500f21e0',
publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment'
}
})
};
fetch('https://api.example.com/api/v2/sshcertificateauthorities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/sshcertificateauthorities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'ssh-ca-name',
'description' => 'A verbose description',
'tags' => [
[
'name' => 'cluster-id',
'value' => '9361402c-f998-49cc-ab21-9bb99afcfde8'
]
]
],
'spec' => [
'organizationId' => '161b9d5a-701d-4fea-848d-0e345edf16e9',
'projectId' => 'f113be96-4dd2-4c14-9c0e-e96c500f21e0',
'publicKey' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/sshcertificateauthorities"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/sshcertificateauthorities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/sshcertificateauthorities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a64f9269-36e0-4312-b8d1-52d93d569b7b",
"name": "undefined",
"organizationId": "9a8c6370-4065-4d4a-9da0-7678df40cd9d",
"projectId": "e36c058a-8eba-4f5b-91f4-f6ffb983795c",
"creationTime": "2024-05-31T14:11:00Z",
"createdBy": "john.doe@acme.com",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}SSH certificate authorities
Create SSH certificate authority
Create a new SSH certificate authority.
POST
/
api
/
v2
/
sshcertificateauthorities
Create SSH certificate authority
curl --request POST \
--url https://api.example.com/api/v2/sshcertificateauthorities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "ssh-ca-name",
"description": "A verbose description",
"tags": [
{
"name": "cluster-id",
"value": "9361402c-f998-49cc-ab21-9bb99afcfde8"
}
]
},
"spec": {
"organizationId": "161b9d5a-701d-4fea-848d-0e345edf16e9",
"projectId": "f113be96-4dd2-4c14-9c0e-e96c500f21e0",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}
'import requests
url = "https://api.example.com/api/v2/sshcertificateauthorities"
payload = {
"metadata": {
"name": "ssh-ca-name",
"description": "A verbose description",
"tags": [
{
"name": "cluster-id",
"value": "9361402c-f998-49cc-ab21-9bb99afcfde8"
}
]
},
"spec": {
"organizationId": "161b9d5a-701d-4fea-848d-0e345edf16e9",
"projectId": "f113be96-4dd2-4c14-9c0e-e96c500f21e0",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {
name: 'ssh-ca-name',
description: 'A verbose description',
tags: [{name: 'cluster-id', value: '9361402c-f998-49cc-ab21-9bb99afcfde8'}]
},
spec: {
organizationId: '161b9d5a-701d-4fea-848d-0e345edf16e9',
projectId: 'f113be96-4dd2-4c14-9c0e-e96c500f21e0',
publicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment'
}
})
};
fetch('https://api.example.com/api/v2/sshcertificateauthorities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/sshcertificateauthorities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'name' => 'ssh-ca-name',
'description' => 'A verbose description',
'tags' => [
[
'name' => 'cluster-id',
'value' => '9361402c-f998-49cc-ab21-9bb99afcfde8'
]
]
],
'spec' => [
'organizationId' => '161b9d5a-701d-4fea-848d-0e345edf16e9',
'projectId' => 'f113be96-4dd2-4c14-9c0e-e96c500f21e0',
'publicKey' => 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/sshcertificateauthorities"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v2/sshcertificateauthorities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/sshcertificateauthorities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"ssh-ca-name\",\n \"description\": \"A verbose description\",\n \"tags\": [\n {\n \"name\": \"cluster-id\",\n \"value\": \"9361402c-f998-49cc-ab21-9bb99afcfde8\"\n }\n ]\n },\n \"spec\": {\n \"organizationId\": \"161b9d5a-701d-4fea-848d-0e345edf16e9\",\n \"projectId\": \"f113be96-4dd2-4c14-9c0e-e96c500f21e0\",\n \"publicKey\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment\"\n }\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"id": "a64f9269-36e0-4312-b8d1-52d93d569b7b",
"name": "undefined",
"organizationId": "9a8c6370-4065-4d4a-9da0-7678df40cd9d",
"projectId": "e36c058a-8eba-4f5b-91f4-f6ffb983795c",
"creationTime": "2024-05-31T14:11:00Z",
"createdBy": "john.doe@acme.com",
"provisioningStatus": "provisioned",
"healthStatus": "healthy"
},
"spec": {
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuildOnlyTrustAnchor comment"
}
}{
"error": "invalid_request",
"error_description": "request body invalid",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "access_denied",
"error_description": "authentication failed",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "forbidden",
"error_description": "user credentials do not have the required privileges",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "unprocessable_content",
"error_description": "the request body was in the wrong format",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}{
"error": "server_error",
"error_description": "failed to token claim",
"trace_id": "57bc14d9bd461f0b5a72db830149b67a"
}Authorizations
Operation requires OAuth 2.0 bearer token authentication.
Body
application/json
A request for an SSH certificate authority.
Was this page helpful?
⌘I