Document conventions
This article uses the following conventions:
Angle brackets (<>) indicate that the enclosed element is mandatory. You are required to replace the text within the angle brackets with the appropriate information.
Square brackets ([]) indicate that the enclosed element is optional. You can choose one or more items or no items.
The pipe character (|) indicates that one of the bracketed statements can be specified.
This article contains the following sections for each command:
Synopsis
A description of the commands, options, and arguments available for the command.
Description
General information about the command.
Options
Options to control the behavior of a command. Options always begin with one or two dashes. Use one dash for the abbreviated term such as -v. Use two dashes for the full term such as --version. Square brackets mean that element of the command is optional.
Not all commands have options.
Arguments
Some commands require arguments. Arguments are names of commands, files, host names, IP addresses, URLS and so on that you specify to control the behavior of the command. Not all commands have arguments. You do not precede arguments with dashes.
Not all commands have arguments.
Examples
Usage samples with expected output. Not all commands have examples.
CLI Installation
You install the CLI in these steps:
Download the CLI files to your local machine.
Make them executable if necessary.
Set a PATH to the location where the files are stored.
Run the init command to connect to your ModelOp instance.
To install the CLI
Code Snippet
codeMake the Mac (Darwin) or Linux files executable. Browse to the folder where you stored the CLI file. For Macs and Linux, this folder should be /usr/local/bin/
For Darwin, type
chmod 755 <filename>
For Linux, type
chmod +x <filename>
Set a PATH to the CLI file.
Confirm the installation. At the prompt, type
moc help
.
Output:
Code Block |
---|
Usage:
moc [flags]
moc [command]
Available Commands:
asset Manage assets for models
help Help about any command
init Configure CLI to point to ModelOp Center. Requires an URL with http scheme.
job Manage jobs in ModelOp Center
model Manage models in ModelOp Center
Flags:
-h, --help help for moc
-v, --version Print version information
Use "moc [command] --help" for more information about a command.
|
5. Configure the CLI to connect to your instance of ModelOp Center. Type
moc init <URL of ModelOp Center>
Overview of commands
The term “moc commands” refers to the list of available ModelOp Center CLI commands.
The help for the moc commands is presented in Linux man page format.
Type
help
to get general information about command-line man pages.Type
help <command>
to get information about a specific command.
The following moc commands are available:
asset
init
job
model
Command details
moc
Synopsis
Code Block |
---|
moc [--help | --version]
moc <command> |
Description
The ModelOp Center CLI base command which is the required prefix to execute moc commands.
Options
v, --version
Displays the version of the CLI
h, --
help
Displays information about the specified command
moc command list
asset
Manage assets for models
init
Configure CLI to point to a particular instance of ModelOp Center. Requires a URL to the specific ModelOp Center instance. This should be executed first before using other commands (besides help).
job
Manage jobs in the ModelOp Center
model
Manage models in the ModelOp Center
asset
Synopsis
Code Block |
---|
moc asset [--help]
moc asset <command>
moc asset add <model name> <path to file> [--name]
[--external | --force] [--region] [--verbose] |
Description
Manage assets for models. Use add
command to add an asset to an existing model.
Use moc model ls
to find the model ID and name.
Options
e, --external
Use if file is larger than 10 MB, or needs to be stored in an external storage configured with model-manage. Otherwise, by default, the file is stored internally in model-manage.
If the file already exists in external storage, provide a link to the asset in the following format: [protocol]://ResourceAccessKey: ResourceSecretKey@ResourceDomain/PATH TO FILE/FILENAME.EXTENTION
Supported protocols:
http
https
s3
s3n
s3a
You can use the environment variables to provide Accesskey and SecretKey credentials to enable access to external resource.
f, --force
Stores file in model-manage if file size is less than 10 MB, or in external storage otherwise.
h, --help
Help with asset command
-name string
Name by which asset is stored. Overrides current name
-region string
Region for the asset if provided by a link
V, --verbose
Be verbose
Arguments
Specify the model name, and the path to where the assets are stored.
Examples
Code Block |
---|
moc asset add <model_name> attachment.zip
moc asset add 00000000-0000-0000-0000-000000000000 attachment.zip
moc asset add 00000000-0000-0000-0000-000000000000 attachment.zip --name=testModelAttachment.zip
moc asset add 00000000-0000-0000-0000-000000000000 [http/s3/S3n/S3a]://accessKey:secretKey@Domain/PATH/file.txt --region=us-east-1
moc asset add 00000000-0000-0000-0000-000000000000 http://$ACCESS_KEY:$SECRET_KEY@Domain/PATH/file.txt --region=us-east-1 |