CdnHostname
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames |
create |
App CDN hostname created |
GET |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id} |
load |
Success |
GET |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames |
load |
Success |
PATCH |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id} |
patch |
Success |
DELETE |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id} |
remove |
Success |
PUT |
/api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id} |
update |
Success |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
cdn_hostname, err := client.CdnHostname(nil).Load(map[string]any{"app_id": "example", "cdn_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(cdn_hostname)
created, err := client.CdnHostname(nil).Create(map[string]any{"app_id": "example", "cdn_id": "example", "hostname": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
updated, err := client.CdnHostname(nil).Update(map[string]any{"id": "example_id", "app_id": "example", "cdn_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
patched, err := client.CdnHostname(nil).Patch(map[string]any{"id": "example_id", "app_id": "example", "cdn_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(patched)
removed, err := client.CdnHostname(nil).Remove(map[string]any{"app_id": "example", "cdn_id": "example", "id": "example_id"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local cdn_hostname, err = client:CdnHostname():load({ app_id = "example", cdn_id = "example" })
local created, err = client:CdnHostname():create({ app_id = "example", cdn_id = "example", hostname = "example" })
local updated, err = client:CdnHostname():update({ id = "example_id", app_id = "example", cdn_id = "example" })
local patched, err = client:CdnHostname():patch({ id = "example_id", app_id = "example", cdn_id = "example" })
local removed, err = client:CdnHostname():remove({ app_id = "example", cdn_id = "example", id = "example_id" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$cdn_hostname = $client->CdnHostname()->load(["app_id" => "example", "cdn_id" => "example"]);
$created = $client->CdnHostname()->create(["app_id" => "example", "cdn_id" => "example", "hostname" => "example"]);
$updated = $client->CdnHostname()->update(["id" => "example_id", "app_id" => "example", "cdn_id" => "example"]);
$patched = $client->CdnHostname()->patch(["id" => "example_id", "app_id" => "example", "cdn_id" => "example"]);
$client->CdnHostname()->remove(["app_id" => "example", "cdn_id" => "example", "id" => "example_id"]);
Python
Construct client as shown in the Python setup, then call the operations:
cdn_hostname = client.CdnHostname().load({"app_id": "example", "cdn_id": "example"})
created = client.CdnHostname().create({ "app_id": "example", "cdn_id": "example", "hostname": "example" })
updated = client.CdnHostname().update({"id": "example_id", "app_id": "example", "cdn_id": "example"})
patched = client.CdnHostname().patch({"id": "example_id", "app_id": "example", "cdn_id": "example"})
client.CdnHostname().remove({"app_id": "example", "cdn_id": "example", "id": "example_id"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
cdn_hostname = client.CdnHostname.load({ "app_id" => "example", "cdn_id" => "example" })
created = client.CdnHostname.create({ "app_id" => "example", "cdn_id" => "example", "hostname" => "example" })
updated = client.CdnHostname.update({ "id" => "example_id", "app_id" => "example", "cdn_id" => "example" })
patched = client.CdnHostname.patch({ "id" => "example_id", "app_id" => "example", "cdn_id" => "example" })
client.CdnHostname.remove({ "app_id" => "example", "cdn_id" => "example", "id" => "example_id" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const cdn_hostname = await client.CdnHostname().load({ app_id: "example", cdn_id: "example" })
const created = await client.CdnHostname().create({ app_id: "example", cdn_id: "example", hostname: "example" })
const updated = await client.CdnHostname().update({ id: "example_id", app_id: "example", cdn_id: "example" })
const patched = await client.CdnHostname().patch({ id: "example_id", app_id: "example", cdn_id: "example" })
await client.CdnHostname().remove({ app_id: "example", cdn_id: "example", id: "example_id" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
app_cdn_distribution_id |
string |
Yes | App Cdn Distribution Id |
created_at |
string |
Yes | Created At |
dns_status |
string |
Yes | Dns Status |
force_ssl |
boolean |
Yes | Force Ssl |
hostname |
string |
Yes | Hostname |
id |
string |
Yes | Id |
provider_hostname_id |
one,string,null |
Yes | Provider Hostname Id |
tls_status |
string |
Yes | Tls Status |
updated_at |
string |
Yes | Updated At |
create
POST /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames
Operation ID: post_api_v1_hosting_apps_app_id_cdns_cdn_id_hostnames.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
dns_status |
enum: pending, configured, failed |
No | |
force_ssl |
boolean |
No | |
hostname |
string |
Yes | |
tls_status |
enum: pending, active, failed |
No |
Responses
200: App CDN hostname created
application/json
| Property | Type | Required | Description |
|---|---|---|---|
hostname |
object |
Yes | |
hostname.app_cdn_distribution_id |
string |
Yes | |
hostname.created_at |
string (date-time) |
Yes | |
hostname.dns_status |
enum: pending, configured, failed |
Yes | |
hostname.force_ssl |
boolean |
Yes | |
hostname.hostname |
string |
Yes | |
hostname.id |
string |
Yes | |
hostname.provider_hostname_id |
string |
Yes | |
hostname.tls_status |
enum: pending, active, failed |
Yes | |
hostname.updated_at |
string (date-time) |
Yes |
201: App CDN hostname created
application/json
| Property | Type | Required | Description |
|---|---|---|---|
hostname |
object |
Yes | |
hostname.app_cdn_distribution_id |
string |
Yes | |
hostname.created_at |
string (date-time) |
Yes | |
hostname.dns_status |
enum: pending, configured, failed |
Yes | |
hostname.force_ssl |
boolean |
Yes | |
hostname.hostname |
string |
Yes | |
hostname.id |
string |
Yes | |
hostname.provider_hostname_id |
string |
Yes | |
hostname.tls_status |
enum: pending, active, failed |
Yes | |
hostname.updated_at |
string (date-time) |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: CDN request failed validation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
load
GET /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id}
Operation ID: api_v1_app_cdn_hostname.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames
Operation ID: api_v1_app_cdn_hostnames.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
patch
PATCH /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id}
Operation ID: patch_api_v1_hosting_apps_app_id_cdns_cdn_id_hostnames_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
remove
DELETE /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id}
Operation ID: delete_api_v1_hosting_apps_app_id_cdns_cdn_id_hostnames_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
204: App CDN hostname deleted
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
update
PUT /api/v1/hosting/apps/{app_id}/cdns/{cdn_id}/hostnames/{id}
Operation ID: put_api_v1_hosting_apps_app_id_cdns_cdn_id_hostnames_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
app_id |
path |
string |
Yes | |
cdn_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.