Environment service

The Environment service enables you to manage environments, including defining and selecting the Control-M environment to use. An environment is a combination of an endPointusername, and password

An endPoint looks like the following: 

https://<controlmEndPointHost>:8443/automation-api

Environments are saved in an env.json file located in the home user with read/write permissions only for the logged in user under .ctm folder.

env.json is encrypted.

For example, to add an environment and name it devEnvironment, use the command below:

> ctm environment add devEnvironment "https://<controlmEndPointHost>:8443/automation-api" "<ControlmUser>" "<ControlmPassword>"
 
info:    Environment 'devEnvironment' was created
info:    devEnvironment:
{"endPoint":"https://<controlmEndPointHost>:8443/automation-api","user":"<ControlmUser>"}

environment show

Returns a list of all defined environments.

CLI Syntax

CLI
ctm environment show

environment add

Adds a new environment for a Control-M instance.

CLI Syntax

CLI
ctm environment add <env> <endPoint> <user> <password>

Where:

Parameter

Description

<env>

Environment name

<endPoint>

Control-M REST API endPoint

<user>

Control-M username

Note: If you specify an LDAP user, prefix the username with the domain: <domain>\<user>

<password>

Control-M password

Note

While the environment is added, it is checked for its policy regarding certificates. If the environment is currently set to accept self-signed certificates, a warning is displayed. If you want to apply a stricter policy of accepting only certificates signed by a trusted Certificate Authority (and not accepting self-signed certificates), you can use the ctm environment configure command to set the rootCertificateRequired parameter to true.

environment workbench::add

Adds an environment for the installed Control-M Workbench.

CLI Syntax

CLI
ctm environment workbench::add [<endPoint>]

Where:

Parameter

Description

[<endPoint>]

REST API endPoint for the Control-M Workbench.

By default, the Workbench endpoint is https://localhost:8443/automation-api, with "workbench" as the user name and password.

You can use this parameter if you installed the Workbench on a different host.

environment set 

Sets the default environment for interactive work. All commands are sent to this environment unless a different environment is defined using the -e option.

Note

When no environments are defined and you add the very first environment (using the environment add or the environment workbench::add command), that first environment is automatically set as the default. Later, after additional environments have been defined, use this command to set a new default.

CLI Syntax

CLI
ctm environment set <env>

Where:

Parameter

Description

<env>

Environment name

environment delete

Deletes an environment.

CLI Syntax

CLI
ctm environment delete <env>

Where:

Parameter

Description

<env>

Environment name

environment update

Updates an environment property. The property <name> can be an endPoint, username, password, or additionalLoginHeader. If an environment does not exist, it will be created.

CLI Syntax

CLI
 >ctm environment update <env> <name> <value>

Where:

Parameter

Description

<env>

Environment name

<name>

The name of the property, one of the following:

  • endPoint
  • user
  • password
  • additionalLoginHeader

<value>

Property value for the specified property name:

PropertyDescription
endpointA URL that points to the endpoint and begins with https.
user

Control-M username

Note: If you specify an LDAP user, prefix the username with the domain: <domain>\<user>

passwordControl-M password
additionalLoginHeader

9.0.19.120 An additional header to include in login requests sent by the CLI, with the following format:

“Header_Name:Header_value”

environment copy 

Duplicates an environment. 

CLI Syntax

CLI
ctm environment <env> <newEnv>

Where:

Parameter

Description

<env>

Environment name

<newEnv>

Name of the new environment

environment load 

This command allows you to load a predefined env.json to your environment definitions. 

The file that you are importing must include passwords that are decoded. When saved to the user's env.json file, the passwords are encrypted.

CLI Syntax

CLI
ctm environment load <enviromentsFile>

Where:

Parameter

Description

<enviromentsFile>

An env.json file

environment configure

This command allows you to set  parameters for all environments.

CLI Syntax

CLI
ctm environment configure <setting name> [setting value]

Where:

Parameter

Description

<setting name>

Parameter name

[setting value]

Parameter value

Possible parameters:

ParameterValueDefaultDescription
rootCertificateRequiredfalse | truefalse

Disable API calls that use a self-signed HTTPS certificate, and allow only certificates that are signed by a trusted Certificate Authority.

By default, self-signed certificates are allowed.

Was this page helpful? Yes No Submitting... Thank you

Comments