fastly routing-config path rule update

Update a rule.

Syntax

$ fastly routing-config path rule update --file=FILE --path-id=PATH-ID --routing-config-id=ROUTING-CONFIG-ID --rule-id=RULE-ID

Options

KeyRequired?DefaultDescription
--fileYesPath to a JSON file describing the fields to update, e.g. {"action": {"type": "service", "value": "..."}, "conditions": [...]}. A field omitted from the JSON is left unchanged; set "conditions" to an empty array to turn the rule into the default (catch-all) rule for its path
--path-idYesThe Path Identifier
--routing-config-idYesThe Routing Config Identifier
--rule-idYesThe Rule Identifier

Global options

KeyRequired?DefaultDescription
--helpNoShow context-sensitive help.
--accept-defaultsNoAccept default options for all interactive prompts apart from Yes/No confirmations
--auto-yesNoAnswer yes automatically to all Yes/No confirmations. This may suppress security warnings
--debug-modeNoPrint API request and response details (NOTE: can disrupt the normal CLI flow output formatting)
--non-interactiveNoDo not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes
--quietNoSilence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive)
--tokenNoFastly API token, or name of a stored auth token (use 'default' for the default token). Falls back to FASTLY_API_TOKEN env var
--verboseNoVerbose logging

Examples

Update a rule's conditions

Where rule.json contains {"conditions": [{"type": "header", "key": "X-Test", "operator": "equals", "value": "2"}]}. Fields omitted from the JSON (such as "action" here) are left unchanged.

$ fastly routing-config path rule update --routing-config-id 1a2b3c4d --path-id 5e6f7g8h --rule-id 9i0j1k2l --file rule.json

Turn a rule into the default (catch-all) rule for its path

Where rule.json contains {"conditions": []}, to turn the rule into the default (catch-all) rule for its path.

$ fastly routing-config path rule update --routing-config-id 1a2b3c4d --path-id 5e6f7g8h --rule-id 9i0j1k2l --file rule.json

API equivalent

This command internally uses the following Fastly public APIs: