Except for the administration commands, all Akamas commands representing Akamas operation require authentication.
Command | Description |
---|---|
The CLI supports two different methods to authenticate with the Akamas server:
direct login: performs the authentication using the username and password provided directly to the CLI
oauth2: performs the authentication redirecting the user to Akamas' login page
Akamas users linked to external identity providers can only authenticate using the oauth2 method. For more details, refer to Configure an external identity provider.
By default, the CLI authenticates using the direct login unless the user provides the argument --method direct|oauth2
or sets it in the local configuration with the akamas set config --method direct|oauth2
command.
Local users (not linked to any external identity provider) can authenticate by providing the credentials as arguments to Akamas CLI:
When the user or password are not provided as arguments, the CLI will prompt for their value. Be aware that passing the password as an argument may store it in the terminal history, so is advised to provide it through the secure prompt.
If the workspace is specified and the user has access to it, it will be set as the default workspace for the session.
If the login is successful, a message like the following will be printed: <username> logged in. Welcome."
If the login fails because the credentials are wrong or the user is not authorized to access, the error message "Login failed: Invalid user credentials" will be printed.
All Akamas users can authenticate through the login page provided by the UI by running the following command:
This command is available since version 2.8.0 of the cli
The CLI will provide you with a link to the login page of the configured Akamas instance, similar to the following:
Open the browser on the provided link and authenticate using your local user or any configured identity provider. Once successfully authenticated, the UI will provide you with a code: paste it into the CLI prompt to complete the login process.
The full reference for the Akamas login command is.
If one of the environmental variables is specified, the corresponding parameter will not be asked to the user. Workspace is not needed for login.
When logged in, this command will log out the current user
On success the message "Logout successful." will be printed.
Option | Short | Description | Environment Variable | Required |
---|---|---|---|---|
login
logout
--method
-m
Authentication method.
no
--user
-u
Username for the direct authentication method. If not specified will be requested by prompt.
AKAMAS_USER
no
--password
-p
Password for the direct authentication method. If not specified will be requested by a prompt. Be aware that providing it as an argument may store it in the terminal's history.
AKAMAS_PASSWORD
no
--workspace
-w
Set a default workspace for the session. The user should have access to the workspace specified
AKAMAS_WORKSPACE
no
This page describes all commands that allow users and workspaces to be managed with their options (see also available for all commands).
Command | Description |
---|
Notice: an Akamas workspace (user) is an Akamas resource (see list of ) so you can also refer to .
The create workspace
command allows defining a new workspace:
The following snippet shows an example:
After the workspace has been created you can add users to the workspace with the following command:
The update workspace
command allows updating the workspace name:
with the following options:
The following snippet shows an example:
The delete workspace
command allows deleting a workspace:
with the following options:
The following snippet shows an example:
The list users
command returns the list of the available users.
The following snippet shows an example:
The create user
command allows defining a new user and assigning it to one or more workspaces.
with the following options
The default policy requires the password to satisfy the following rules:
Include one or more uppercase characters (A-Z)
Include one or more special characters (~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/)
The username and password can be either provided interactively or as command arguments.
The following snippet shows the process of creating a new user interactively:
The same action can be performed using the command options:
The describe user
command returns the details of a valid user matching the provided username or ID:
Notice: users without administrative privileges can only describe their profiles, while administrators can inspect any profile.
The following snippet shows an example:
The update user
command allows updating the user profile attributes for the user matching the username or ID:
with the following options:
For single sign-on users is possible to update only the workspaces and the administration privilege. It is not possible to modify the profile info.
The following snippet shows an example of updating the email of a user:
This command is also used to grant or revoke access to workspaces and administrative privileges to users.
The following snippet shows an example of updating the user’s workspace access privileges, adding write privileges on Workspace 1, and revoking access on Default:
The update password
command updates the password for the user matching the username or ID:
with the following options:
Users without administrative privileges can update only their own passwords, while administrators can perform this action on any profile.
Single sign-on users can't change their password using the Akamas CLI. They must manage their passwords through the configured external identity provider.
The default policy requires the password to satisfy the following rules:
Include one or more uppercase characters (A-Z)
Include one or more special characters (~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/)
The password can be either provided interactively or as command arguments.
The following snippet shows the prompts to update the user password:
The same action can be performed using the command options:
The delete user
command removes the user with the provided username or id:
with the following options:
The following snippet shows an example of deleting interactively a user:
See section for further details
Option | Required | Description |
---|
Option | Required | Description |
---|
Option | Required | Description |
---|
Option | Required | Description |
---|
Option | Required | Description |
---|
Option | Required | Description |
---|
| yes | New workspace name |
| no | Show this message and exit |
| yes | Username |
| yes | Password |
| no | User first name |
| no | User last name |
| no | Valid email |
| no | Add the user to the specified workspace with the specified role (R|W) (e.g., --add-to-workspace WORKSPACE_A R). The option can be specified multiple times to add more workspaces. |
| no | Specify if you want to give Administration privileges to the user |
| no | User first name |
| no | User last name |
| no | Valid email |
| no | Add the user to the specified workspace with the specified role (R|W) (e.g., --add-to-workspace WORKSPACE_A R). The option can be specified multiple times to add more workspaces. |
| no | Remove the user from the specified workspace |
| no | Specify if you want to give Administration privileges to the user |
| no | Specify if you want to remove Administration privileges to the user |
| yes | New password |
| no | Automatic yes to prompts |
create a workspace |
update a workspace |
delete a workspace |
list users |
create a user |
describe a user |
update user profile |
update user password |
delete a user |
This section describes all the commands provided by the Akamas Command Line Interface (CLI):
Administration commands to manage the Akamas installation
User and Workspace management commands to manage user and workspaces
Authentication commands to perform login and logout operations
Resource management commands to manage all the Akamas resources
Optimizer option commands to update the Akamas optimizer options
The Akamas CLI provides a command-line interaction with the Akamas platform, thus enabling an infrastructure-as-code user experience to manage the end-to-end optimization lifecycle.
Notice: the Akamas CLI allows performing all the operations that you can do on the UI and more. In particular, the CLI has to be used for all modification operations on the platform, such as the creation and deletion of Akamas resources.
Read here below to use the built-in help to get started with Akamas commands.
The following table describes all the Akamas' resources and their parent resources.
Akamas resources | Parent Resource |
---|---|
Akamas CLI provides built-in help, which is one of the few commands that do not require any authentication.
By issuing the following command:
you get something like the following:
Component
System
Component Type
Metric
Parameter
Optimization Pack
Study
Step
Experiment
Study
Trial
Telemetry Provider
Telemetry Instance
System
KPI
System
License
Workflow
User
Workspace
The optimizer options can be customized at the study level only. Since a study is an Akamas resource this can be done by using the update command described on the Resource management commands page.
This page provides a quick reference for the update commands that can be used to dynamically change the options that drive how the Akamas optimizer works for live optimization studies.
The following command can be used to update the online mode of live optimization studies:
The following command can be used to update the safety mode of live optimization studies:
The following command can be used to update the workload strategy of live optimization studies:
The following command can be used to update the safety factor of live optimization studies:
The following command can be used to update the exploration factor of live optimization studies:
This page describes all commands that allow Akamas resources to be managed with their options (see also common options available for all commands).
Command | Description |
---|---|
An Akamas license is an Akamas resource (see list of Akamas resources) so you can use the following command (see install command) to install a license in an Akamas instance:
An Akamas license is an Akamas resource (see list of Akamas resources) so you can use the following command (see uninstall command) to remove a license from the Akamas installation:
Print the status of the Akamas instance.
with the following options:
Print the logs of the Akamas services.
with the following options:
Initialize the CLI’s configuration file, either interactively or through the provided options.
with the following options:
Set a value in the CLI’s configuration file
with the following options:
This page describes all commands that allow to be managed with their options (see also available for all commands).
Command | Description |
---|
The following table describes the common options available for all commands:
Option | Short option | Type | Description |
---|
The Akamas CLI allows using a set of alias or shortcuts for many resources.
Any resource can be specified using either the singular or plural form. Furthermore, the shortcuts listed below are available:
You can print the list of available aliases with the following command
This command builds either a new optimization pack or a new scaffolding hierarchy.
In this case, you supply a folder with a specific hierarchy: the needed folders are metrics
, component-types
and parameters
, and each of them contains a set of yaml resource files listing the supported resources. Then the command akamas build optimization-pack FOLDER_NAME
creates a full JSON file with all the optimization pack contents inside it.
In this case, you supply two folders: one for variables, named variables
and one for templates named templates
. The variables
folder must contain one yaml file for each desired output set and the templates
folder should hold all generic templates that can contain variable parameters specified in the variables file.
This command is available since version 2.8.0 of the CLI
For example, the variables
folder could contain two files named test.yaml
and prod.yaml
. The contents of these files are:
Then suppose that the template folder contains some YAML files and one of them the is following file named template-study.yaml
:
Create the Akamas resource described in the provided YAML file.
You can also use the generic resource type entity
to create most of the resources with a YAML file in a single command. The supported resources are component
, system
, optimization-pack
, study
, workflow
, telemetry-instance
and telemetry-provider
. In order to use this feature, adding the kind
key is required. Also, the system
key must be added when the resource is required to be attached to a system (telemetry instance and system component).
For example, to create a new telemetry instance, you should add the following:
to your YAML file, then you can use the akamas create entity <filename.yaml>
command instead of akamas create telemetry-instance <filename.yaml> SYSTEM_NAME
.
Similarly, to create a new telemetry-provider (which does not need the system
attribute), you just need to specify the kind to your yaml file:
This also works for optimization packs. For standard optimization packs provided by akamas you need to write a YAML file such as:
If you want to install a custom optimization pack, you can also supply a JSON file. In this case, there is no need to specify the kind
attribute.
Finally, if you supply a folder to the command akamas create entity
, it will process all files inside this folder and create all the needed resources. You can, for example, use one of the output folders created by the command akamas build scaffold
.
Delete an Akamas resource, identified by UUID or name.
with the following options:
All resources created with the command akamas create entity <folder>
can also be deleted by using the opposite command akamas delete entity <folder>
. The only difference is that the command akamas delete entity
has an additional flag --complete
. When supplied, it deletes all supported objects including optimization packs and telemetry providers. When the --complete
flag is missing, however, optimization packs and telemetry providers are not deleted.
List the resources for the selected type with their id, name, and description. Additional resource-specific fields can be shown.
with the following options:
Describe an Akamas resource with all its fields.
with the following options:
Notice that this command does not support the resource type System.
Update an Akamas resource, identified by UUID or name.
with the following options:
Install a License or an Optimization Pack
with the following options:
Uninstall a License or an Optimization Pack
with the following options:
Start the execution of a Study.
Stop the execution of a Study. Once stopped, the execution cannot be resumed.
To export a study, the study name or the study UUID can be used from the command line.
An optional filename can be specified, with a relative or absolute path:
The exported information will be saved in tar.gz format.
The following entities are exported:
The Study
The Steps of the Study
The Experiments of the Study
The Trials of the Study
The Workflow to which the Study refers
The Timeseries collected during the study run
The System to which the Study refers
The Component related to the Study's System
The ComponentType of each Component
The Metrics definitions of each ComponentTypes
The Parameters definitions of each ComponentTypes
Notice: this operation can require a long time, depending on the quantity of data to be collected. During this time the CLI will wait for Akamas to send the exported package. Do not interrupt the CLI during this phase, as otherwise, the process will need to be restarted from the beginning.
Notice: please make sure that you have installed the latest versions of the optimization packs before starting the import: this way, the import procedure will bind the studies to the latest optimization packs version (i.e. the installed ones) instead of importing the (possibly) old ones from the source system.
Use the following command to import a study into an existing Akamas instance:
Where FILENAME refers to the file of a previously exported study.
When imported, the following entities will have a new UUID:
Study
Workflow
System
Component
ComponentType
Metrics
Parameters
In case a resource that is being imported has the same name as an existing one, the existing entity will not be deleted. The existing entity (with its UUID) will be used instead of the imported one.
All steps, experiments, and trials will maintain the same id and, therefore, the same execution order as the original exported study.
Notice: this operation can require a long time. If the CLI shows a timeout error or if the operation is interrupted, the import will continue on the Akamas server.
Option | Short option | Type | Description |
---|---|---|---|
Option | Short option | Description | Type | Accepted values | Requires | Mutually exclusive |
---|---|---|---|---|---|---|
Option | Short option | Type | Default | Description |
---|---|---|---|---|
Option | Short option | Type | Description |
---|---|---|---|
When launching the command akamas build scaffold SCAFFOLDING_DIR_NAME/
, a new folder output
is created inside SCAFFOLDING_DIR_NAME
along with two sub-folders test
and prod
. Each sub-folder now contains the templates rendered with the values set in the variables
files. The command makes it easier to create bulk entities.
Option | Short option | Type | Description |
---|
Similarly to the create command, you can use the generic resource type entity
to delete the supported resources. See the section for instructions on the supported resources and the additional required fields.
Option | Short option | Type | Values | Default | Description |
---|
Option | Short option | Type | Values | Default | Description |
---|
Option | Short option | Type | Values | Default | Description |
---|
Option | Short option | Type | Description |
---|
Option | Short option | Type | Description |
---|
install license
uninstall license
check the status of the Akamas instance
get logs
initialize Akamas configuration
set Akamas configuration
--debug
-d
Flag
Print a detailed status of Akamas instance
--debug
-d
Show extended error messages, if presents
Flag
-
-
-
--page-size
Number of log's lines to be retrieved at one time
Integer
(0, 65536)
-
no-pagination
dump
--no-pagination
Disable pagination and print all logs
Flag
-
-
page-size
dump
--dump
Output logs without pagination and formatting
Flag
-
-
page-size
no-pagination
--workspace
-ws
UUID or name of the Workspace to visualize. When empty, system logs will be returned instead
String
-
-
-
--from
-f
The start timestamp or timedelta of the logs
String
%Y-%m-%d
%Y-%m-%dT%H:%M:%S
%Y-%m-%d %H:%M:%S
%Y-%m-%dT%H:%M:%S.%f
%Y-%m-%d %H:%M:%S.%f
-nw
-nd
-nh
-nm
-ns
-nms
-
-
--to
-t
The end timestamp or timedelta of the logs
String
%Y-%m-%d
%Y-%m-%dT%H:%M:%S
%Y-%m-%d %H:%M:%S
%Y-%m-%dT%H:%M:%S.%f
%Y-%m-%d %H:%M:%S.%f
-nw
-nd
-nh
-nm
-ns
-nms
-
-
--study
-s
UUID or name of the Study
String
UUID
-
-
-
--exp
-e
Number of the experiment
Integer
-
study
-
--trial
Number of the trial
Integer
-
study
exp
--system
-y
UUID or name of the System
String
UUID
-
--workflow
-w
UUID or name of the Workflow
String
UUID
-
--service
-S
Name of the Akamas Service
String
system
campaign
telemetry
orchestrator
analyzer
metrics
optimizer
license
log
-
-
--log-level
-l
Log level
String
TRACE
DEBUG
INFO
WARN
ERROR
-
-
--without-metadata
Print only timestamp and message
Flag
-
-
-
--sorting
Sorting order of the printed logs
String
asc
desc
<MESSAGE>
Regular expression against the message
String
-
-
-
--api-address
-a
String
http://localhost:8000
Api address
--default-local
-l
Flag
Configure the Akamas CLI for localhost NOTE: This argument is mutually exclusive with arguments: [api_address].
--workspace
-w
String
default
Active workspace
--echo-only
Flag
Print configuration on stdout
--api-address
-a
String
Set the API address of your Akamas instance
--workspace
-w
String
Set the default workspace
--method
-m
local, oauth2
Set the default authentication method
--keyring
-k
String
Set keyring type
--verify-ssl
-v
Boolean
Set Verify SSL
--force | -f | Flag | Force the deletion of the resource(s) |
--no-pagination | -no-pag | Flag | Show all resources without pagination |
--use-seconds | -u-s | Flag | If durations should be output in seconds |
--sort-asc, --sort-desc | -s-asc, -s-desc | Flag | Sort items by creation time |
--output | -o | Choice |
| table | Switch the output to table (default), json or yaml |
--output | -o | Choice |
| table | Switch the output to table (default), json or yaml |
--output | -o | Choice |
| table | Switch the output to table (default), json or yaml |
--force | -f | Flag | Force the installation of the resource |
--force | -f | Flag | Force the uninstall of the resource |
build a resource from a file or directory |
create a resource from a file |
delete a resource |
list a set of resources |
describe a resource |
update a resource |
install a resource from a file |
uninstall a resource |
start a study |
stop a study |
export a study |
import a study |
--debug | -d | Flag | Print detailed information in case of errors |
--workspace | -w | String | Overrides the workspace defined in the configuration file when interacting with resources such as systems, workflows and studies |
--help | Flag | Print command line help |