1 of 20
2 of 20
3 of 20
4 of 20
5 of 20
6 of 20
7 of 20
8 of 20
9 of 20
10 of 20
11 of 20
12 of 20
13 of 20
14 of 20
15 of 20
16 of 20
17 of 20
18 of 20
19 of 20
20 of 20

site

doc

blog

success stories

Origins

Edit on GitHub

With the API of Origins you can check, remove or update existing settings, besides creating new ones.

  1. Retrieving a list of Origins
  2. Retrieving details of Origins
  3. Deleting Origins
  4. Creating new Origins
  5. Overwriting Origins
  6. Updating the fields of Origins

1. Retrieving a list of Origins

It returns a list of Origins.

GET /edge_applications/:edge_application_id:/origins

Required permission: View Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation. header string
Accept
*required
Details about the type of return and version. header string;
application/json;version=3

Request Example

GET /edge_applications/06101992/origins 
Accept: application/json; version=3
Authorization: token cf2078926f91a6e638af3f4a6977b505edfe5941

Response Example

{
    "count": 5,
    "total_pages": 1,
    "schema_version": 3,
    "links": {
        "previous": null,
        "next": null
    },
    "results": [
        {
            "origin_id": "235e8fac-8619-453d-83ef-240ffc3da70e",
            "name": "Origins test",
            "origin_type": "single_origin",
            "addresses": [
                {
                    "address": "httpbin.org",
                    "weight": null,
                    "server_role": "primary",
                    "is_active": true
                }
            ],
            "origin_protocol_policy": "http",
            "host_header": "${host}",
            "method": "",
            "origin_path": "/requests",
            "connection_timeout": 60,
            "timeout_between_bytes": 120,
            "hmac_authentication": false,
            "hmac_region_name": "",
            "hmac_access_key": "",
            "hmac_secret_key": ""
        }

2. Retrieving details of Origins

It provides Origins details. The information returned by this command refers to the Origins of an Application.

GET /edge_applications/:edge_application_id:/origins/:origin_id:

Required permission: View Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation header string
Accept
*required
Details about the type of return and version. header string;
application/json;version=3
:id
*required
The id of the Origin that you plan to query. path number

Request Example

GET /edge_applications/06101992/origins/52adb0b2-4b78-474d-93c6-25f5f4320c3d
Accept: application/json; version=3
Authorization: token cf2078926f91a6e638af3f4a6977b505edfe5941

Response Example

{
    "results": {
        "origin_id": "52adb0b2-4b78-474d-93c6-25f5f4320c3d",
        "name": "Default Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "s3.amazonaws.com",
                "weight": null,
                "server_role": "primary",
                "is_active": true
            }
        ],
        "origin_protocol_policy": "preserve",
        "host_header": "s3.amazonaws.com",
        "method": "",
        "origin_path": "/azion-hmac-test",
        "connection_timeout": 60,
        "timeout_between_bytes": 120,
        "hmac_authentication": true,
        "hmac_region_name": "sa-east-1",
        "hmac_access_key": "AKIAV2SSWEBHTDH23BW2",
        "hmac_secret_key": "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"
    },
    "schema_version": 3
}

3. Deleting Origins

It deletes Origins. This operation is final; there is no way to roll back the information after it has been confirmed by the user.

All information associated with this Origin will be removed.

The API does not require confirmation in order to run this instruction.

DELETE /edge_applications/:edge_application_id:/origins/:origin_id:

Required permission: Edit Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation. header string
Accept
*mandatory
Details about the type of return and version. header string;
application/json;version=3
:id
*required
The id of the Origin that you plan to delete. path number

Request Example

DELETE /edge_applications/06101992/origins/235e8fac-8619-453d-83ef-240ffc3da70e
Accept: application/json; version=3
Authorization: token 2909f3932069047f4736dc87e72baaddd19c9f75

Response Example

HTTP/2 204

4. Creating new Origins

It enables the Origins creation.

POST /edge_applications/:edge_application_id:/origins

Required permission: Edit Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation. header string
Accept
*required
Details about the type of return and version. header string;
application/json;version=3
Content-Type
*required
The type of coding used in the Body (application/json).

Example:
Content-Type: application/json
header string

Request Example

POST /edge_applications/06101992/origins
Accept: application/json; version=3
Authorization: token cf2078926f91a6e638af3f4a6977b505edfe5941
Content-Type: application/json
{
        "name": "Create New Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org"
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "origin_path": "/requests",
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
}

Response Example

{
    "results": {
        "origin_id": "1ba5d8f8-12c8-4174-b814-5a02a62a3ad9",
        "name": "Create New Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org",
                "weight": null,
                "server_role": "primary",
                "is_active": true
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "method": "",
        "origin_path": "/requests",
        "connection_timeout": 60,
        "timeout_between_bytes": 120,
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
    },
    "schema_version": 3
}

5. Overwriting Origins

It overwrites all the Origins fields, retaining the id.

If you only want to update some fields, without changing the values of the rest, consider using the PATCH method, instead of PUT.

PUT /edge_applications/:edge_application_id:/origins/:origin_id:

Required permission: Edit Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation header string
Accept
*required
Details about the type of return and version header string;
application/json;version=3
Content-Type
*required
The type of coding used in the Body (application/json).

Example:
Content-Type: application/json
header string
:id
*required
The Id of the Origin to be overwritten. path number

Request Example

PUT /edge_applications/06101992/origins/52adb0b2-4b78-474d-93c6-25f5f4320c3d
Accept: application/json; version=3
Authorization: token ec6aabdc0b6bbeed826a36d8731630e36b6e3f24
Content-Type: application/json
{
        "name": "Overwrite Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org"
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "origin_path": "/anything",
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
}

Response Example

{
    "results": {
        "origin_id": "52adb0b2-4b78-474d-93c6-25f5f4320c3d",
        "name": "Overwrite Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org",
                "weight": null,
                "server_role": "primary",
                "is_active": true
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "method": "",
        "origin_path": "/anything",
        "connection_timeout": 60,
        "timeout_between_bytes": 120,
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
    },
    "schema_version": 3
}

6. Updating the fields of Origins

It updates one or more Origins fields, retaining the value of those fields not included.

PATCH /edge_applications/:edge_application_id:/origins/:origin_id:

Required permission: Edit Edge Application

Parameter Description Type Type of Data
Authorization
*required
Authentication through the Token, previously created through the endpoint of Token Creation. header string
Accept
*required
Details about the type of return and version. header string;
application/json;version=3
Content-Type
*required
The type of coding used in the Body (application/json).

Example:
Content-Type: application/json
header string
:id
*required
The Id of the Origin to be overwritten. path number

Request Example

PATCH /edge_applications/06101992/origins/52adb0b2-4b78-474d-93c6-25f5f4320c3d
Accept: application/json; version=3
Authorization: token ec6aabdc0b6bbeed826a36d8731630e36b6e3f24
Content-Type: application/json
{
        "name": "Update Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org"
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "origin_path": "/anything",
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
}

Response Example

{
    "results": {
        "origin_id": "52adb0b2-4b78-474d-93c6-25f5f4320c3d",
        "name": "Update Origin",
        "origin_type": "single_origin",
        "addresses": [
            {
                "address": "httpbin.org",
                "weight": null,
                "server_role": "primary",
                "is_active": true
            }
        ],
        "origin_protocol_policy": "http",
        "host_header": "${host}",
        "method": "",
        "origin_path": "/anything",
        "connection_timeout": 60,
        "timeout_between_bytes": 120,
        "hmac_authentication": false,
        "hmac_region_name": "",
        "hmac_access_key": "",
        "hmac_secret_key": ""
    },
    "schema_version": 3
}

Didn’t find what you were looking for? Open a support ticket.