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_nameThe
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
TESTwithlocalhostand8080as host and port respectively.- Enter the command
The following message is displayed to add host and port nameocli context new TESTocli 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:8080A 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 enterhttporhttpsas 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
LOCALcontext withlocalhostand9433as host and port respectively.- Enter the command
The following message is displayed to add host and port nameocli context new LOCALocli 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 enterhttporhttpsas 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