new
You can use the new command to create a new context in the config.yaml file.
Syntax and command line options
You can enter the command as
follows:
ocli context new context_name
The
context_name parameter is mandatory. Once you provide the
context name a message is displayed to enter URL. You must provide the host and port
name separated by a colon (:). These are mandatory values that you must provide to
create a context. For more details see the following example.Example:
- Follow the below steps to create a context named
TEST
withlocalhost
and8080
as host and port respectively.- Enter the command
The following message is displayed to add host and port nameocli context new TEST
ocli context new TEST Enter url:
Note: If you do not provide the environment name the following message is displayed:ocli context new Enter context name:
You must enter a valid name to continue.
- Enter the host and port name separated by a colon (:)
ocli context new TEST Enter url: localhost:8080
A confirmation message is displayed to indicate the creation of the new context.ocli context new TEST Enter url: localhost:8080 You have successfully added the TEST context.
Note: If you enterhttp
orhttps
as port, the default values 80 and 443 are respectively added to the config.yaml file.
- Enter the command
- Follow the below steps to create the
LOCAL
context withlocalhost
and9433
as host and port respectively.- Enter the command
The following message is displayed to add host and port nameocli context new LOCAL
ocli context new LOCAL Enter url:
- Enter the url as
https://localhost:9433/
:ocli context new TEST Enter url: https://localhost:9433/
A confirmation message is displayed to indicate the creation of the new context.ocli context new TEST Enter url:https://localhost:9433/ You have successfully added the LOCAL context.
Note: If you enterhttp
orhttps
as URL and did not add any specific value as port, the default values 80 and 443 are respectively added to the config.yaml file.
- Enter the command