Azion CLI connector
Azion CLI commands that create, list, describe, update, and delete connectors, with every flag and the JSON file the commands read.
The Azion CLI connector commands create, list, describe, update, and delete connectors, the objects that hold where and how an application reaches an origin, the server that holds your content. A connector is created and changed from a JSON file, never from one flag per setting. The options every command accepts, such as --format, --out, and -y, are on Global options.
Create
azion create connector creates a connector from a JSON file and the type you pass:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--file | — | string | — | Required. Path to a JSON file with the attributes of the connector. Use - to read the JSON from standard input. Without it, the command asks for the path. |
--type | — | string | — | Required. Type of the connector: http, storage, or live_ingest. Without it, the command asks for the type, even when the file carries "type". |
The CLI sends any --type value to the API without checking it. A value outside the three, such as ftp, fails with a server error that does not name the type:
This file, my-connector.json, describes a connector of type http named my-connector that sends requests to httpbin.org:
This command creates the connector from the file:
The command prints the ID of the connector:
List
azion list connector prints the connectors of your account, 50 on each page by default:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--details | — | — | — | Adds the LAST EDITOR and LAST MODIFIED columns to the ID, NAME, TYPE, and ACTIVE columns. |
--filter | — | string | — | Name to filter the list by. |
--order-by | — | string | — | Field to sort the list by, such as id or name. |
--page | — | int | 1 | Number of the page to return. |
--page-size | — | int | 50 | Number of connectors on each page. |
This command returns the first page of a list split into pages of two connectors:
The command prints one row per connector, with its type:
Describe
azion describe connector prints the settings of one connector:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--connector-id | — | int | — | ID of the connector to describe. |
This command describes the connector with ID 123475:
The command prints the ID, the name, the last change, the state, and the type of the connector. The Language row holds the type:
With --format json, the command prints the full object: active, attributes, created_at, id, is_versioned, last_editor, last_modified, name, product_version, type, version, version_id, and version_state. On a connector of type http, attributes holds addresses, connection_options, and modules.
Update
azion update connector changes the name, the state, or the settings of a connector. The command has no flag per setting, so the changes come from a JSON file:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--connector-id | — | int | — | ID of the connector to update. |
--file | — | string | — | Path to a JSON file with the attributes of the connector. Use - to read the JSON from standard input. |
--type | — | string | — | Required. Type of the connector: http, storage, or live_ingest. Without it, the command asks for the type, even when the file carries "type". |
The file carries the whole connector, as on create. A file with only the fields to change, such as name and active, is refused before any request is sent:
This file, my-connector-update.json, renames the connector to my-connector-renamed and repeats every other attribute it was created with:
This command applies the file to the connector with ID 123475:
The command prints the ID of the updated connector:
Delete
azion delete connector deletes a connector:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--connector-id | — | int | — | ID of the connector to delete. |
This command deletes the connector with ID 123475:
The command confirms the deletion:
Use a JSON file
azion create connector and azion update connector read the connector from a JSON file with --file, and both also take --type on the command line. The file holds name, active, type, and attributes. A connector of type http carries addresses and connection_options in attributes; the types storage and live_ingest carry other attributes.
The API fills every field the file leaves out with its default. A file with one address and three connection options produces this connector, as azion describe connector --connector-id 123475 --format json prints it:
Each address gets http_port 80 and https_port 443, and Load Balancer and Origin Shield stay off. For every field of each type, with its range and its default, refer to Connector settings.