Azion CLI origin
Azion CLI commands that create, list, describe, update, and delete the origins of an application, with every flag, its type, and its default.
The Azion CLI origin commands create, list, describe, update, and delete the origins of an application. An origin is the server from which Azion retrieves the content of the application, such as a cloud server or an Object Storage bucket. Each origin belongs to one application, so every command takes --application-id. Connectors replace the Origins feature, and the connector commands manage them. The options every command accepts, such as --format, --out, and -y, are on Global options.
Create
azion create origin creates an origin in an application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--addresses | — | strings | — | Addresses of the origin. Separate several addresses with commas. |
--application-id | — | int | — | ID of the application that holds the origin. |
--bucket | — | string | — | Required when --origin-type is object_storage. Name of the Object Storage bucket the origin serves content from. |
--file | — | string | — | Path to a JSON file with the attributes of the origin. Use - to read the JSON from standard input. |
--hmac-access-key | — | string | — | Access key for HMAC authentication. |
--hmac-authentication | — | string | — | Turns HMAC authentication on (true) or off (false) for the origin. |
--hmac-region-name | — | string | — | Region name for HMAC authentication. |
--hmac-secret-key | — | string | — | Secret key for HMAC authentication. |
--host-header | — | string | — | Host name of the server being accessed, which the origin receives in the Host header. |
--name | — | string | — | Name of the origin. |
--origin-path | — | string | — | Path appended to the URI when the request is forwarded to the origin. Leave it empty to forward the URI alone. |
--origin-protocol-policy | — | string | — | Protocol policy of the origin. An origin created without this flag reports preserve. |
--origin-type | — | string | — | Required unless the --file JSON carries origin_type. Type of the origin. Without it, the command asks you to choose single_origin or object_storage. |
--prefix | — | string | — | Path of the folder inside the bucket that holds the content. Applies only when --origin-type is object_storage. |
This command creates an origin named my-origin that retrieves content from httpbin.org:
The command prints the key of the origin, which the describe, update, and delete commands take in --origin-key:
List
azion list origin lists the origins of an application, 50 to a page:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--application-id | — | int | — | ID of the application whose origins are listed. |
--details | — | — | — | Adds the ID, ORIGIN TYPE, ORIGIN PATH, ADDRESSES, and CONNECTION TIMEOUT columns to the ORIGIN KEY and NAME columns. |
--filter | — | string | — | Name to filter the list by. |
--order-by | — | string | — | Field to sort the list by, such as name. |
--page | — | int | 1 | Number of the page to return. |
--page-size | — | int | 50 | Number of origins on each page. |
The command needs --order-by. Without it, the command fails with this error, with or without --details, --page, and --page-size:
This command lists the origins of the application with ID 1234567890, sorted by name, with every column:
The command prints one row per origin:
The ADDRESSES column prints each address in this raw form. To read the settings of each address, use azion describe origin with --format json.
Describe
azion describe origin prints the settings of one origin:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--application-id | — | int | — | ID of the application that holds the origin. |
--origin-key | — | string | — | Key of the origin to describe. |
This command describes the origin with key 00000000-0000-0000-0000-000000000003:
The command prints the ID, the key, the name, and the settings of the origin:
With --format json, the command prints the full object: addresses, bucket, connection_timeout, hmac_access_key, hmac_authentication, hmac_region_name, hmac_secret_key, host_header, is_origin_redirection_enabled, method, name, origin_id, origin_key, origin_path, origin_protocol_policy, origin_type, prefix, and timeout_between_bytes. Each item of addresses holds address, is_active, server_role, and weight.
A key that does not exist in the application fails with this error:
Update
azion update origin changes the name, the addresses, or the settings of an origin:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--addresses | — | strings | — | Addresses of the origin. Separate several addresses with commas. |
--application-id | — | int | — | ID of the application that holds the origin. |
--bucket | — | string | — | Name of the Object Storage bucket the origin serves content from. |
--file | — | string | — | Path to a JSON file with the attributes to change. Use - to read the JSON from standard input. |
--hmac-access-key | — | string | — | Access key for HMAC authentication. |
--hmac-authentication | — | string | — | Turns HMAC authentication on (true) or off (false) for the origin. |
--hmac-region-name | — | string | — | Region name for HMAC authentication. |
--hmac-secret-key | — | string | — | Secret key for HMAC authentication. |
--host-header | — | string | — | Host name of the server being accessed, which the origin receives in the Host header. |
--name | — | string | — | New name of the origin. |
--origin-key | — | string | — | Required. Key of the origin to update. Without it, the command asks for the key, even when the --file JSON carries origin_key. |
--origin-path | — | string | — | Path appended to the URI when the request is forwarded to the origin. Leave it empty to forward the URI alone. |
--origin-protocol-policy | — | string | — | Protocol policy of the origin. |
--origin-type | — | string | — | Type of the origin, such as single_origin or object_storage. |
--prefix | — | string | — | Path of the folder inside the bucket that holds the content. |
This command renames the origin with key 00000000-0000-0000-0000-000000000003 to my-origin-renamed and sets its origin path to /anything:
The command prints the key of the updated origin:
The settings you do not pass keep their values. In this example, the address httpbin.org stays unchanged.
Delete
azion delete origin deletes an origin from an application:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--application-id | — | int | — | ID of the application that holds the origin. |
--origin-key | — | string | — | Key of the origin to delete. |
This command deletes the origin with key 00000000-0000-0000-0000-000000000004:
The command confirms the deletion:
Use a JSON file
azion create origin and azion update origin read the attributes of the origin from a JSON file with --file. Pass --application-id on the command line.
This file creates an origin named my-site-origin that retrieves content from example.com:
Pass the file to the create command:
The command prints the key of the origin:
On update, the command does not read origin_key from the file, so pass --origin-key on the command line too. This file renames the origin with key 00000000-0000-0000-0000-000000000004:
Pass the file and the key to the update command:
The command prints the key of the updated origin:
The fields the file leaves out keep their values.