Azion CLI rules engine command and its subcommands
See the command and subcommands that enable the management of your edge applications’ rules in Rules Engine on the Azion Edge Platform using Azion CLI.
Listing your edge application’s rules in Rules Engine
Section titled Listing your edge application’s rules in Rules EngineList the rules related to a specific edge application.
Usage
Section titled Usage azioncli rules_engine list --application-id 1000 --phase request
Required flags
Section titled Required flagsapplication-id
Section titled application-idThe --application-id
flag gives the ID for the edge application and, based on that, the rules related to the application are listed.
phase
Section titled phaseThe --phase
flag informs if you want to list the request
rules or the response
rules.
Optional flags
Section titled Optional flagsdetails
Section titled detailsThe --details
option displays all relevant fields when listing.
filter
Section titled filterThe --filter
option filters items by name.
order_by
Section titled order_byThe --order_by
option sorts the output based on the informed field.
The --page
option returns a page of the list based on the selected field.
page_size
Section titled page_sizeThe --page_size
option defines how many items should be returned per page. By default, it’s 10
.
The --sort
option defines the order of the items on the list. The value should be either asc
or desc
.
The --help
option displays more information about the list
subcommand.
Generating a template for the rules_engine create and update subcommands
Section titled Generating a template for the rules_engine create and update subcommandsGenerate a rules engine template to be used with the create and update subcommands.
Usage
Section titled Usage azioncli rules_engine template
The template will be created, by default, inside the directory you’re running Azion CLI on. It looks similar to:
{ "behaviors": [ { "name": "run_function", "target": 0 } ], "criteria": [ [ { "conditional": "if", "input_value": "/", "operator": "starts_with", "variable": "${uri}" } ] ], "name": "NewRulesEngine" }
Optional flags
Section titled Optional flagsThe --help
option displays more information about the template
subcommand.
Creating a rule in Rules Engine
Section titled Creating a rule in Rules EngineCreate a new rule in Rules Engine based on given attributes to be used with edge applications.
Usage
Section titled Usage azioncli rules_engine create --application-id 100 --phase "response" --in ./file.json
Required flags
Section titled Required flagsapplication-id
Section titled application-idThe --application-id
flag gives the ID for the edge application related to this rule in Rules Engine being created.
phase
Section titled phaseThe --phase
flag informs if you want to create a request
rule or a response
rule.
The --in
flag informs the file path to the template, which must contain all attributes of the rule being created.
Optional flags
Section titled Optional flagsThe --help
option displays more information about the create
subcommand.
Updating a rule in Rules Engine
Section titled Updating a rule in Rules EngineUpdate a rule in Rules Engine based on given attributes.
Usage
Section titled Usage azioncli rules_engine update --application-id 1673635839 --phase request --in rule.json --rule-id
Required flags
Section titled Required flagsrule-id
Section titled rule-idThe --rule-id
flag gives the ID for the rule being updated.
application-id
Section titled application-idThe --application-id
flag gives the ID for the edge application related to this rule in Rules Engine being updated.
phase
Section titled phaseThe --phase
flag informs the phase of the rule, request
or response
.
The --in
flag informs the file path to the template, which must contain all attributes of the rule being updated.
Optional flags
Section titled Optional flagsThe --help
option displays more information about the update
subcommand.
Describing a rule in Rules Engine
Section titled Describing a rule in Rules EngineReturn details about a specific rule in Rules Engine, based on a given ID.
Usage
Section titled Usage azioncli rules_engine describe --application-id 123456 --rule-id 1234 --phase request
Required flags
Section titled Required flagsrule-id
Section titled rule-idThe --rule-id
flag gives the ID for the rule being described.
application-id
Section titled application-idThe --application-id
flag gives the ID for the edge application related to the rule being described.
phase
Section titled phaseThe --phase
flag informs the rule phase, request
or response
.
Optional flags
Section titled Optional flagsThe --out
option exports the output of the describe
command to a given filepath.
format
Section titled formatThe --format
option, followed by the value json
, changes the output format to JSON.
The --help
option displays more information about the describe
subcommand.
Deleting a rule in Rules Engine
Section titled Deleting a rule in Rules EngineDelete a rule in Rules Engine on the Azion platform.
Usage
Section titled Usage azioncli rules_engine delete --application-id 1673635839 --rule-id 12312
Required flags
Section titled Required flagsapplication-id
Section titled application-idThe --application-id
flag informs the ID of the edge application related to the rule being deleted.
rule-id
Section titled rule-idThe --rule-id
flag gives the ID for the rule being deleted.
Optional flags
Section titled Optional flagsThe --help
option displays more information about the delete
subcommand.