Routing commands
These commands govern how the gateway router chooses a model provider for a request. See Routing requests to models for the tasks they support.
Every command on this page is a subcommand of akka optimize. Documents sent with -f FILE are JSON. Passing -f - reads the document from standard input instead.
Static routing rulesets
A ruleset holds the attribute-matching rules that choose a destination for a request. See Routing ruleset for the predicates and attributes a rule can use.
The singular forms ruleset and rule are accepted as aliases.
Listing and reading rulesets
To list every ruleset with its revision and priority:
akka optimize rulesets list
To print the current document for one ruleset:
akka optimize rulesets get NAME
To read a past revision instead of the current one:
akka optimize rulesets get NAME --revision 3
Applying and deleting rulesets
To create or replace a ruleset in full:
akka optimize rulesets apply NAME -f ruleset.json
To write only while the ruleset is still at a known revision, pass --if-revision. The write fails if another author has changed the ruleset in the meantime:
akka optimize rulesets apply NAME -f ruleset.json --if-revision 3
To retire a ruleset:
akka optimize rulesets delete NAME
The record of a retired ruleset survives its deletion.
Editing a single rule
To add or replace one rule without sending the rest of the ruleset:
akka optimize rulesets rules apply RULESET RULE -f rule.json
To remove one rule:
akka optimize rulesets rules delete RULESET RULE
Testing a ruleset
To see what a ruleset would decide for a sample request, with no traffic involved:
akka optimize rulesets test NAME -f request.json
Execution order and history
Rulesets are evaluated in priority order. To read the order set for a ruleset:
akka optimize rulesets priority NAME
To change it:
akka optimize rulesets priority NAME --set 10
To list every change made to a ruleset, with its revision and who made it:
akka optimize rulesets history NAME
Routing classifiers
A classifier is a named pointer to a model provider that a rule can select. Registration is immutable, so a retrained model is registered under a new id. The forms routing-classifier, classifiers, and classifier are accepted as aliases.
Listing and reading classifiers
To list what is registered, with retired entries omitted:
akka optimize routing-classifiers list
To print one classifier as it is stored:
akka optimize routing-classifiers get ID
Registering and retiring classifiers
To register a classifier:
akka optimize routing-classifiers apply ID -f classifier.json
Registration is immutable. Sending the same document again under the same id succeeds, and reinstates the entry if it had been retired. Sending a different document under an existing id is refused. A retrained model is registered under a new id.
To retire a classifier:
akka optimize routing-classifiers delete ID
Retirement is unconditional. Nothing checks whether a rule still names the classifier, so repoint any rule that selects it before retiring it. The command asks for confirmation first.
Semantic routing
The commands in this section govern the use cases a semantic router recognizes and what serves each one. See Routing on request meaning for how the routing itself works.
The working set and its manifests
akka optimize use-cases covers the use cases discovered in traffic. The aliases use-case and uc are accepted. Discovery runs against live traffic. The working set is what has been discovered so far, and a manifest fixes that set so it can enforce routing. See Defining use cases for what a use case is and how one is discovered.
| Command | Description |
|---|---|
|
The working set, and whether it can be frozen. |
|
The use cases currently being discovered in traffic. |
|
One use case and the requests nearest its center. |
|
Name a use case in the working set. |
|
Fix the working set as a manifest. |
|
Every manifest, and whether it can enforce. |
|
One manifest as it was frozen. |
|
A manifest against the working set as it stands now. |
|
Make a manifest the live routing policy. |
|
Tombstone a manifest. |
Routing policies
akka optimize routing-policies states what serves a use case, and in what share. The aliases routing-policy, policies, and policy are accepted.
| Command | Description |
|---|---|
|
The current policy and its history. |
|
Publish a policy version. |
|
Republish a previous version. |
|
Refuse routing changes until lifted. |
|
Set the shadow and canary dials. |
|
The features described in this section are an add-on to Akka Automated Operations. They are not included in the base product. |