Updated on 2024-10-15 GMT+08:00

Modifying Origin Server Details

Function

This API is used to modify the origin server settings of a domain name.

URI

PUT /v1.0/cdn/domains/{domain_id}/origin

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies the acceleration domain name ID. For details, see Querying Details About a Domain Name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project that the domain name to be modified belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API.

Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS).

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

The token can be obtained by calling the IAM API used to obtain a user token. The value of **X-Subject-Token** in the response header is the user token.
Table 4 Request body parameters

Parameter

Mandatory

Type

Description

origin

Yes

ResourceBody object

Origin server.

Table 5 ResourceBody

Parameter

Mandatory

Type

Description

sources

Yes

Array of SourceWithPort objects

Origin server settings.

Table 6 SourceWithPort

Parameter

Mandatory

Type

Description

domain_id

No

String

Domain name ID.

ip_or_domain

Yes

String

Specifies the IP address or domain name of the origin server.

origin_type

Yes

String

Origin server type, which can be origin server IP address, origin server domain name, and OBS bucket domain name.

Enumeration values:

  • ipaddr

  • domain

  • obs_bucket

active_standby

Yes

Integer

Whether the origin server is primary or standby. Possible values: 1 (primary) and 0 (standby).

enable_obs_web_hosting

No

Integer

Specifies whether static hosting is enabled for an OBS bucket. Possible values: 0 (disabled) and 1 (enabled). This parameter is passed only when origin_type is set to obs_bucket.

http_port

No

Integer

Specifies the HTTP port. Default value: 80.

https_port

No

Integer

Specifies the HTTPS port. Default value: 443.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

origin

ResourceBody object

Specifies the origin server.

Table 8 ResourceBody

Parameter

Type

Description

sources

Array of SourceWithPort objects

Origin server settings.

Table 9 SourceWithPort

Parameter

Type

Description

domain_id

String

Domain name ID.

ip_or_domain

String

Specifies the IP address or domain name of the origin server.

origin_type

String

Origin server type, which can be origin server IP address, origin server domain name, and OBS bucket domain name.

Enumeration values:

  • ipaddr

  • domain

  • obs_bucket

active_standby

Integer

Whether the origin server is primary or standby. Possible values: 1 (primary) and 0 (standby).

enable_obs_web_hosting

Integer

Specifies whether static hosting is enabled for an OBS bucket. Possible values: 0 (disabled) and 1 (enabled). This parameter is passed only when origin_type is set to obs_bucket.

http_port

Integer

Specifies the HTTP port. Default value: 80.

https_port

Integer

Specifies the HTTPS port. Default value: 443.

Example Requests

PUT https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff808**********************2d71/origin?enterprise_project_id=0

{
  "origin" : {
    "sources" : [ {
      "ip_or_domain" : "0.0.0.0",
      "origin_type" : "ipaddr",
      "active_standby" : 1,
      "http_port" : 80,
      "https_port" : 443
    } ]
  }
}

Example Responses

Status code: 200

OK

{
  "origin" : {
    "sources" : [ {
      "domain_id" : "12ab***********************02b71",
      "origin_type" : "ipaddr",
      "ip_or_domain" : "0.0.0.0",
      "active_standby" : 1,
      "http_port" : 80,
      "https_port" : 443
    } ]
  }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.