PATCH
/
cdn
/
origin_groups
/
{origin_group_id}
Change origin group
curl --request PATCH \
  --url https://api.gcore.com/cdn/origin_groups/{origin_group_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "YourOriginGroup",
  "use_next": true,
  "proxy_next_upstream": [
    "error",
    "timeout",
    "invalid_header",
    "http_500",
    "http_502",
    "http_503",
    "http_504"
  ],
  "auth_type": "none",
  "sources": [
    {
      "backup": false,
      "enabled": true,
      "source": "yourwebsite.com"
    },
    {
      "backup": true,
      "enabled": true,
      "source": "1.2.3.4:5500"
    }
  ],
  "path": ""
}'
{
  "id": 1,
  "name": "YourOriginGroup",
  "use_next": true,
  "proxy_next_upstream": [
    "error",
    "timeout",
    "invalid_header",
    "http_500",
    "http_502",
    "http_503",
    "http_504"
  ],
  "auth_type": "none",
  "sources": [
    {
      "backup": false,
      "enabled": true,
      "source": "yourwebsite.com"
    },
    {
      "backup": true,
      "enabled": true,
      "source": "1.2.3.4:5500"
    }
  ],
  "path": "",
  "has_related_resources": true
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

origin_group_id
integer
required

Origin group ID.

Body

application/json
name
string

Origin group name.

Example:

"YourOriginGroup"

use_next
boolean

Defines whether to use the next origin from the origin group if origin responds with the cases specified in proxy_next_upstream. If you enable it, you must specify cases in proxy_next_upstream. Possible values:

  • true - Option is enabled.
  • false - Option is disabled.
Example:

true

proxy_next_upstream
string[]

Defines cases when the request should be passed on to the next origin. Possible values:

  • error - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header
  • timeout - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header
  • invalid_header - a origin returned an empty or invalid response
  • http_403 - a origin returned a response with the code 403
  • http_404 - a origin returned a response with the code 404
  • http_429 - a origin returned a response with the code 429
  • http_500 - a origin returned a response with the code 500
  • http_502 - a origin returned a response with the code 502
  • http_503 - a origin returned a response with the code 503
  • http_504 - a origin returned a response with the code 504
Example:
[
"error",
"timeout",
"invalid_header",
"http_500",
"http_502",
"http_503",
"http_504"
]
auth_type
string

Origin authentication type. Possible values:

  • none - Used for public origins.
  • awsSignatureV4 - Used for S3 storage.
Example:

"none"

sources
object[]

List of origin sources in the origin group.

Example:
[
{
"backup": false,
"enabled": true,
"source": "yourwebsite.com"
},
{
"backup": true,
"enabled": true,
"source": "1.2.3.4:5500"
}
]
path
string

Parameter is deprecated.

Example:

""

Response

Successful.

id
integer

Origin group ID.

Example:

1

name
string

Origin group name.

Example:

"YourOriginGroup"

use_next
boolean

Defines whether to use the next origin from the origin group if origin responds with the cases specified in proxy_next_upstream. If you enable it, you must specify cases in proxy_next_upstream. Possible values:

  • true - Option is enabled.
  • false - Option is disabled.
Example:

true

proxy_next_upstream
string[]

Defines cases when the request should be passed on to the next origin. Possible values:

  • error - an error occurred while establishing a connection with the origin, passing a request to it, or reading the response header
  • timeout - a timeout has occurred while establishing a connection with the origin, passing a request to it, or reading the response header
  • invalid_header - a origin returned an empty or invalid response
  • http_403 - a origin returned a response with the code 403
  • http_404 - a origin returned a response with the code 404
  • http_429 - a origin returned a response with the code 429
  • http_500 - a origin returned a response with the code 500
  • http_502 - a origin returned a response with the code 502
  • http_503 - a origin returned a response with the code 503
  • http_504 - a origin returned a response with the code 504
Example:
[
"error",
"timeout",
"invalid_header",
"http_500",
"http_502",
"http_503",
"http_504"
]
auth_type
string

Origin authentication type. Possible values:

  • none - Used for public origins.
  • awsSignatureV4 - Used for S3 storage.
Example:

"none"

sources
object[]

List of origin sources in the origin group.

Example:
[
{
"backup": false,
"enabled": true,
"source": "yourwebsite.com"
},
{
"backup": true,
"enabled": true,
"source": "1.2.3.4:5500"
}
]
path
string

Parameter is deprecated.

Example:

""

Defines whether the origin group has related CDN resources. Possible values:

  • true - Origin group has related CDN resources.
  • false - Origin group does not have related CDN resources.
Example:

true