Re-prioritize SSL Certificates
client.CustomCertificates.Prioritize.Update(ctx, params) (*SinglePage[CustomCertificate], error)
PUT/zones/{zone_id}/custom_certificates/prioritize
If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Re-prioritize SSL Certificates
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/custom_certificates"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
page, err := client.CustomCertificates.Prioritize.Update(context.TODO(), custom_certificates.PrioritizeUpdateParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Certificates: cloudflare.F([]custom_certificates.PrioritizeUpdateParamsCertificate{custom_certificates.PrioritizeUpdateParamsCertificate{
}, custom_certificates.PrioritizeUpdateParamsCertificate{
}}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": [
{
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"zone_id": "023e105f4ecef8ad9ca31a8372d0c353",
"bundle_method": "ubiquitous",
"custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752",
"expires_on": "2016-01-01T05:20:00Z",
"geo_restrictions": {
"label": "us"
},
"hosts": [
"example.com"
],
"issuer": "GlobalSign",
"keyless_server": {
"id": "4d2844d2ce78891c34d0b6c0535a291e",
"created_on": "2014-01-01T05:20:00Z",
"enabled": false,
"host": "example.com",
"modified_on": "2014-01-01T05:20:00Z",
"name": "example.com Keyless SSL",
"permissions": [
"#ssl:read",
"#ssl:edit"
],
"port": 24008,
"status": "active",
"tunnel": {
"private_ip": "10.0.0.1",
"vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c"
}
},
"modified_on": "2014-01-01T05:20:00Z",
"policy_restrictions": "(country: US) or (region: EU)",
"priority": 1,
"signature": "SHA256WithRSA",
"status": "active",
"uploaded_on": "2014-01-01T05:20:00Z"
}
],
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000,
"total_pages": 100
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": [
{
"id": "023e105f4ecef8ad9ca31a8372d0c353",
"zone_id": "023e105f4ecef8ad9ca31a8372d0c353",
"bundle_method": "ubiquitous",
"custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752",
"expires_on": "2016-01-01T05:20:00Z",
"geo_restrictions": {
"label": "us"
},
"hosts": [
"example.com"
],
"issuer": "GlobalSign",
"keyless_server": {
"id": "4d2844d2ce78891c34d0b6c0535a291e",
"created_on": "2014-01-01T05:20:00Z",
"enabled": false,
"host": "example.com",
"modified_on": "2014-01-01T05:20:00Z",
"name": "example.com Keyless SSL",
"permissions": [
"#ssl:read",
"#ssl:edit"
],
"port": 24008,
"status": "active",
"tunnel": {
"private_ip": "10.0.0.1",
"vnet_id": "7365377a-85a4-4390-9480-531ef7dc7a3c"
}
},
"modified_on": "2014-01-01T05:20:00Z",
"policy_restrictions": "(country: US) or (region: EU)",
"priority": 1,
"signature": "SHA256WithRSA",
"status": "active",
"uploaded_on": "2014-01-01T05:20:00Z"
}
],
"result_info": {
"count": 1,
"page": 1,
"per_page": 20,
"total_count": 2000,
"total_pages": 100
}
}