All the commands and their options within Odin are listed in this page with examples.
This document contains all the existing commands which are part of Odin. You can also explore various commands using the command odin -h or odin -help.
Basic Configuration
Know the version
Following commands show the version of odin installed in your system:
odin [flag]
The available options are as follow:
-v, --version, -version
Configuring Odin
Following commands set the access and secret key for Odin which you have received upon signing up for Odin:
The following finally configures Odin in your system:
odin configure
Creation & Deletion of entities
Environment Create
Following is the format of the command to be used for environment creation:
odin create env [Options]
Environment creation in AWS & GCP
Currently following and the combination of the same are the available options for creating environment:
--name // name of the env created, should be unique
--env-type // type of environment (this is an optional field)
--account // comma separated account names to provision the environment in (this is an optional field)
Valid values for account: load, staging, staging_gcp etc
Example:
#Creates a dev environment
odin create env --name my-env
#Creates an environment which is a load type
odin create env --name my-env --env-type load //creates a load type environment
#Creates a load environment in the load account
odin create env --name my-env --env-type load --account load
# Creates a dev environment in aws stage and gcp stage account
odin create env --name my-env --account staging,staging_gcp
Environment Update
Odin update env command is available from version 1.2.0-beta.3. So upgrade to the latest version via command 'brew install dream11/tools/odin'
Following is the format of the command to be used for environment updation:
odin update env [Options]
Currently the available options for updating environment are:
--name //name of environment to update
--data //inline JSON data of the fields that should be updated in the environment
--file //JSON file with the data of the fields that should be updated in the environment
Example:
#Updates the environment with name dev-0001 using the --data option
odin update env --name dev-0001 --data {\"autoDeletionTime\":\"10-10-2022\"}
#Updates the environment with name dev-0001 using the --file option
odin update env --name dev-0001 --file updationdata.json
Note:
The constraints for updating the autoDeletionTime of an environment are:
autoDeletionTime can be updated starting from 3 days prior to the existing autoDeletionTime
You can only extend the autoDeletionTime by 1 to 3 days from the existing autoDeletionTime
Environment Delete
Following is the format of the command to be used for environment deletion:
odin delete env [Options]
The options can be as follow:
--name //name of environment to delete
Example:
#Deletes the environment with name dev-0001
odin delete env --name dev-0001
Environment Operate
Following is the format of the command to be used for environment deletion:
skip-suspend //to skip auto-suspension of a kuberenetes based environmen
suspend //manually downscale containerised components of an environment
resume //manually upscale containerised components of an environment
Example:
#Supends the environment with name dev-0001
odin operate env --name dev-0001 --operation suspend
Label Creation
Following is the format of the command to be used for label creation:
odin create label [Options]
The options can be as follow:
--name //name of the label
--cardinality //whether the label can be linked to multiple versions of a service (this is an optional field)
Example:
#Creates a label called stage where the label can be linked to upto 2 versions of a service
odin create label --name stage --cardinality 2
Label Deletion
Following is the format of the command to be used for label deletion:
odin delete label [Options]
The options can be as follow:
--name //name of label to delete
Example:
#Deletes a label called stage
odin delete label --name stage
Service Set Creation
Following is the format of the command to be used for service-set creation:
odin create service-set [Options]
The options can be as follow:
--file //yaml file to read service-set definition
Example:
#Creates a service set called gameplay
odin create service-set --file gameplay.json
Service Set Deletion
Following is the format of the command to be used for service-set deletion:
odin delete service-set [Options]
The options can be as follow:
--name //name of service-set to delete
Example:
#Deletes the service set called gameplay
odin delete service-set --name gameplay
Release a Service
Release a service
Following is the format of command for releasing a service:
odin release service [Options]
The options can be as follow:
--path //path to directory containing service definition and provisioning config
Example:
#Releases a service where the service definition is lying in the folder service
odin release service --path service
Setting default environment
Setting default environment
Following is the format for setting a default environment:
odin set env [Options]
The options can be as follow:
--name //name of environment
Example:
#Sets the environment dev-0001 as default i.e in further commands, if no environment name is passed, this is going to be considered as default
odin set env --name dev-0001
Deployment & Un-deployment
Deploy a service
Following is the format for deploying a service [for service-set deployment, please check the next section]:
odin deploy service [Options]
The options can be as follow:
--name //name of the service to deploy
--version //version of the service to deploy
--env //name of the environment to deploy service in
--d11-config-store-namespace //config store branch/tag to use
--provisioning //file to read the provisioning config
--file //file to read the service definition
Example :
/************* Use service name when the service is already released **************/
#Deploys a service called profile with version 1.0.0-SNAPSHOT in the environment dev-0001
odin deploy service --name profile --version 1.0.0-SNAPSHOT --env dev-0001
#Deploys a service called profile with version 1.0.0-SNAPSHOT in the environment dev-0001 while using the provisioning config provided in provisioning.json
odin deploy service --name profile --version 1.0.0-SNAPSHOT --provisioning provisioning.json --env dev-0001
/************* Use service definition file when the service is yet to be released **********/
#Deploys a service whose definition is in the file definition.json in the environment dev-0001
odin deploy service --file definition.json --provisioning provisioning-dev.json --env dev-0001
#Deploys a service whose definition is in the file definition.json in the evironment dev-0001 with the config lying in the branch [BRANCH]
odin deploy service --file definition.json --provisioning provisioning-dev.json --env dev-0001 ----d11-config-store-namespace [BRANCH]
Deploy a service-set
Following is the format of the command to deploy a service-set:
odin deploy service-set [Options]
The options can be as follow:
--name //name of service-set to deploy
--env //name of environment to deploy service-set in
--force //forcefully deploy service-set into the environment
--d11-config-store-namespace //config store branch/tag to use
Example:
#Deploys the service-set gameplay in the environment dev-0001
odin deploy service-set --name gameplay --env dev-0001
#Deploys the service-set gameplay in the environment dev-0001 forcefully over the existing version
odin deploy service-set --name gameplay --env dev-0001 --force true
#Deploys a service-set gameplay in the evironment dev-0001 with the config lying in the branch [BRANCH]
odin deploy service-set --name gameplay --env dev-0001 --d11-config-store-namespace [BRANCH]
Un-deploy a service
Following is the format of command for un-deploying a service:
odin undeploy service [Options]
The options can be as follow:
--name //name of service to undeploy
--env //name of environment to undeploy service in
Example :
#To un-deploy the service called profile in the environment dev-0001
odin undeploy service --name profile --env dev-0001
Un-deploy a service-set
Following is the format of command for un-deploying a service-set:
odin undeploy service-set [Options]
The options can be as follow:
--name //name of service-set to deploy
--env //name of environment to deploy service-set in
--force //forcefully undeploy service-set from the environment
Example :
#To un-deploy the service-set called gameplay in the environment dev-0001
odin undeploy service-set --name gameplay --env dev-0001
#To un-deploy the service-set called gameplay in the environment dev-0001 forcefully
odin undeploy service-set --name gameplay --env dev-0001 --force true
Operations on Deployed Components
Available from 1.3.0-beta
Perform operations on existing deployed components
The above command redeploys the my_application component for service auth in environment dev-0001 with new artifact_version as 1.2.0
Labelling a Service Version
Label a version of a service
The format of command for labelling a service version is as follow:
odin label service [Options]
The options can be as follow:
--name //name of service to label
--version //version of service to label
--label //name of the label
Example:
#Labels the version 1.0.0-SNAPSHOT of the service profile with a label "Stable"
odin label service --name profile --version 1.0.0-SNAPSHOT --label stable
Status & Description
Status of an environment and a service
Following is the format of command for checking the status of the environment or a service:
odin status [Option]
The options can be as follow:
# For environment status
env //Fetch deployment status of the environment
--name //Name of the environment
--service //Name of service
# For service status
service //Get status of a service version
--name //Name of service
--version //Version of the service
Example:
#Fetches the status of the environment dev-0001
odin status env --name dev-0001
#Fetches the status of the service called auth deployed in the environment dev-0001
odin status env --name dev-0001 --service auth
#Fetches the status of the service called auth for the version 1.0.1-SNAPSHOT
odin status service --name auth --version 1.0.1-SNAPSHOT
Description of entities
To view the definition of the entities, one can use odin describe entities. Following are the type of entities which are supported for describe command:
Component-type
Following is the format for describe command for component type:
odin describe component-type [Options]
Following are the available options:
--name //Name of component type (required)
--version //Version of component type (deafult value for this is latest, unless mentioned)
Example:
#Describes the stepfunction component type for version 1.0.0
odin describe component-type --name stepfunction --version 1.0.0
Environment
Following is the format for describe command for environment:
odin describe env [Options]
Following are the available options:
--name //Name of environment to describe
--service //Service config that is deployed on env (Optional)
--component //Component config that is deployed on env (Optional)
Example:
#Describes the environment dev-0001
odin describe env --name dev-0001
#Describes the component localisation-rds in the service licalisation within environment dev-0001
odin describe env --name dev-9045 --service localisation --component localisation-rds
Service
Following is the format for describe command for service:
odin describe service [Options]
Following are the available options:
--name //Name of service to describe
--version //Version of service to describe
--component //Name of component to describe
Example:
#Describes the service auth
odin describe service --name auth
#Describes the service auth for the version 1.0.1-SNAPSHOT
odin describe service --name auth --version 1.0.1-SNAPSHOT
Service-set
Following is the format for describe command for service-set:
odin describe service [Options]
Following are the available options:
--name //Name of the service-set to describe
Example:
#Describes the service-set gameplay
odin describe service-set --name gameplay
List & History
List the elements
Following is the format for listing elements for a particular entity:
odin list [Option]
The options can be as follow:
component-type //List all components types
env //List all active environment
env-type // List env types
label //List all labels
service //List all services
service-set //List all service-sets
operation //list all operations on environment, service or a component-type
Example:
#Lists all the available component-types with versions
odin list component-type
#Lists all the environments running
odin list env
#Lists all the labels avaialble
odin list label
#Lists all the services onboarded
odin list service
#Lists all the service-sets
odin list service-set
#Lists all operations for environment
odin list operation --entity env
#Lists all operations for service
odin list operation --entity service
#Lists all operations for component
odin list operation --entity component --component-type NameComponentType
History of the environment
To view the history i.e the change logs within an environment, following is the format of the command:
odin history env [Options]
The options can be as follow:
--name //Name of environment to fetch changelog for
--id //Unique id of a changelog for the specified env to get details for (positive integer)
Example:
#Fetches the chanhge logs for the environment dev-0001
odin history env --name dev-0001
#Fetches the details of the change log id 302 for the environment dev-0001
odin history env --name dev-0001 --id 302
Generating application template
Application template of a service
To generate application template of a service, following is the format. Make sure to execute this command from Odin root directory.
odin generate application-template [Options]
The options can be as follow:
--name //Name of the service
Example:
#Generates application template for the service called auth
odin generate application-template --name auth