Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
alias_certificate_status = client.cdn.aliases.get_certificate_status(
0,
)
print(alias_certificate_status.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
aliasCertificateStatus, err := client.CDN.Aliases.GetCertificateStatus(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", aliasCertificateStatus.ID)
}
curl --request GET \
--url https://api.gcore.com/cdn/aliases/{alias_id}/status \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/aliases/{alias_id}/status', 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.gcore.com/cdn/aliases/{alias_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/aliases/{alias_id}/status")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases/{alias_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"statuses": [
{
"id": 1,
"status": "DONE",
"error": "",
"details": "",
"created": "2021-10-29T13:21:01.550849Z",
"retry_after": "2024-01-01T10:00:00Z"
}
],
"latest_status": {
"id": 1,
"status": "DONE",
"error": "",
"details": "",
"created": "2021-10-29T13:21:01.550849Z",
"retry_after": "2024-01-01T10:00:00Z"
},
"started": "2021-10-29T13:20:56.543678Z",
"finished": "2021-10-29T13:21:01.550849Z",
"active": false,
"attempts_count": 1,
"next_attempt_time": "2021-10-29T13:21:01.550849Z",
"reason": "initial",
"challenge_type": "dns_01",
"requested_domains": [
"shop.example.com"
],
"challenges": [
{
"domain": "shop.example.com",
"challenge_type": "http_01",
"state": "invalid",
"error": "A 404 error occurred when attempting to connect to the validation URL."
}
],
"validation_state": "AWAITING_CNAME",
"resource": null,
"cname_records": [
{
"cname_name": "_acme-challenge.shop.example.com",
"cname_target": "0a1b2c3d4e5f6789.le-challenges.example.net"
}
]
}{
"errors": {
"field_name": [
"Error description."
]
}
}Aliases
Get alias certificate issuing details
Get details about the latest Let’s Encrypt certificate issuance attempt for an alias, including the CNAME records to create for domain validation and the state of each domain validation challenge. Returns attempts in all statuses.
While the alias is switching to a Let’s Encrypt certificate, the attempt for the new certificate is returned.
GET
/
cdn
/
aliases
/
{alias_id}
/
status
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
alias_certificate_status = client.cdn.aliases.get_certificate_status(
0,
)
print(alias_certificate_status.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
aliasCertificateStatus, err := client.CDN.Aliases.GetCertificateStatus(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", aliasCertificateStatus.ID)
}
curl --request GET \
--url https://api.gcore.com/cdn/aliases/{alias_id}/status \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cdn/aliases/{alias_id}/status', 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.gcore.com/cdn/aliases/{alias_id}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/aliases/{alias_id}/status")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/aliases/{alias_id}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 1,
"statuses": [
{
"id": 1,
"status": "DONE",
"error": "",
"details": "",
"created": "2021-10-29T13:21:01.550849Z",
"retry_after": "2024-01-01T10:00:00Z"
}
],
"latest_status": {
"id": 1,
"status": "DONE",
"error": "",
"details": "",
"created": "2021-10-29T13:21:01.550849Z",
"retry_after": "2024-01-01T10:00:00Z"
},
"started": "2021-10-29T13:20:56.543678Z",
"finished": "2021-10-29T13:21:01.550849Z",
"active": false,
"attempts_count": 1,
"next_attempt_time": "2021-10-29T13:21:01.550849Z",
"reason": "initial",
"challenge_type": "dns_01",
"requested_domains": [
"shop.example.com"
],
"challenges": [
{
"domain": "shop.example.com",
"challenge_type": "http_01",
"state": "invalid",
"error": "A 404 error occurred when attempting to connect to the validation URL."
}
],
"validation_state": "AWAITING_CNAME",
"resource": null,
"cname_records": [
{
"cname_name": "_acme-challenge.shop.example.com",
"cname_target": "0a1b2c3d4e5f6789.le-challenges.example.net"
}
]
}{
"errors": {
"field_name": [
"Error description."
]
}
}This endpoint is in beta. BETA
Authorizations
Response
Successful.
Why this attempt was opened.
Possible values:
initial– First attempt to issue a certificate.renewal– A scheduled renewal of an existing certificate.manual– Manually triggered, for example via a retry.switch– Switching from your own certificate to a Let's Encrypt certificate.extend– Extending the set of domains covered by the certificate.
Example:
"initial"
State of the domain validation for this attempt.
Possible values:
PENDING– Validation has not started yet.AWAITING_CNAME– Waiting for the CNAME records below to be created.VALIDATING– Validation is in progress.COMPLETED– Validation succeeded.FAILED– Validation did not succeed.
Example:
"AWAITING_CNAME"
Was this page helpful?