Using the Service CLI
The command line interface to the Roving Edge Service Enclave, which we refer to as the Service CLI in the documentation, is available through the Oracle Linux shell on the management nodes. There is no additional installation or configuration required.
The CLI provides access to all the functionality of the Service Web UI, and several additional operations that don't have a UI equivalent. This topic provides general guidelines for using the Service CLI. The actual commands and their functions are documented throughout the administrator area of the documentation, as part of step-by-step instructions.
The CLI only accepts characters from the 7-bit ASCII table of letters, numerics, and other characters. Not all are valid for all fields, but A-Z, a-z, and 0-9 are generally accepted. The CLI ignores accented characters or those from the UTF table. Special care is needed to screen values provided in certificates or other sources.
Accessing the CLI
To access the Service CLI, establish an SSH connection to TCP port 30006 on the virtual management node, and log in as an authorized administrator.
$ ssh admin@admin.red_hostname.example.com -p 30006
Password authentication
RED2-ADMIN>
After successful authentication, you are in an interactive, closed shell environment where you perform administrative operations by entering commands at the RED2-ADMIN> prompt.
To terminate your CLI session, enter the exit command.
Command Syntax
In general, commands entered in the Service CLI have the following syntax:
RED2-ADMIN> command objectType <attributes> [options]
where:
-
commandis the command type to be initiated, for example:listorcreate. -
objectTypeis the target component or process affected by the command, for example:list Faultorcreate Tenant. -
attributesare properties used to identify a specific object of the selected type to which the command must be applied, for example:show Fault name=ilom-pcamn01--PCA-8000-EA. -
optionsare additional parameters that may be provided to affect the behavior of the command.For example, you can add sorting and filtering options to the
listcommand and select which data columns (fields) to display:list Fault fields activatedTime,cause,messageId,severity,workState where status EQ ACTIVE.
The main elements of a command are separated by a space. Attributes are specified as "type=value". Lists are entered as a comma-separated series of values (such as fields activatedTime,cause,messageId,severity,workState).
Help and Command Completion
The Service CLI includes a help command. It shows how the most common types of commands are used, which helps you get familiar with the basics of the CLI.
RED2-ADMIN> help
For Most Object Types:
create <objectType> [(attribute1)="value1"] ... [on <objectType> <instance>]
delete <objectType> <instance>
edit <objectType> <instance> (attribute1)="value1" ...
list <objectType> [fields (attribute1,attribute2)]where [(filterableAttribute1)
<filterComparator> "value1" [AND|OR] [(filterableAttribute2) <filterComparator> "value2"
show <objectType> <instance>
For Most Object Types with Children:
add <objectType> <instance> to <objectType> <instance>
remove <objectType> <instance> from <objectType> <instance>
Other Commands:
exit
showallcustomcmds
showcustomcmds <objectType>
showobjtypes
The easiest way to learn which commands and object types are available, is to use the question mark ("?"). After signing in, you start by entering "?" at the CLI prompt, in order to display the set of base commands.
RED2-ADMIN> ?
add
clear
count
create
delete
edit
[...]
You can drill down into the commands, object types and other elements by adding the "?" to see the available parameters at that cursor position.
Mind the position of the question mark: it's separated from the command by a space. If you omit the space, the CLI displays the parameters allowed at the level of that command, instead of the parameters that might follow after the command.
For example, if you want to see which object types you can list, type list ? and press Enter.
Next, assume that you want to find jobs that have failed, and list them chrnonologically. To achieve this, you can display a list of jobs filtered by their run state. The "?" allows you to navigate through the command parameters, as shown below.
Each time you type "?" the CLI displays the parameters you can use at the cursor position. Press the Up arrow key to bring back the part of the command you already typed at the prompt, then add the next part of your command, and type "?" again to display the next set of parameters.
When your command is complete, press Enter.
RED2-ADMIN> list ?
Event
Fault
Job
Rack
RackUnit
[...]
RED2-ADMIN> list Job ?
fields
limit
orderby
where
RED2-ADMIN> list Job orderby ?
abortedUser
associatedObjId
associatedObjType
endTime
jobName
progressMessage
runState
startTime
transcript
username
workRequestId
RED2-ADMIN> list Job orderby startTime ?
ASCENDING
DESCENDING
RED2-ADMIN> list Job orderby startTime DESCENDING where runState ?
EQ
NE
LIKE
NOT_LIKE
[...]
RED2-ADMIN> list Job orderby startTime DESCENDING where runState EQ ?
ACTIVE
SUCCEEDED
FAILED
ABORTED
RED2-ADMIN> list Job orderby startTime DESCENDING where runState EQ FAILED
Data:
id Run State AssociatedObj Type Name
-- --------- ------------------ ----
3b10ec82-41b4-40be-8ad2-74b9333a8b3d Failed null CREATE_TYPE
fae3c327-42c3-448f-afcc-920f82c2bc8b Failed null OPERATION-EXECUTE_DR_PLAN
eb43d4a6-cd2e-47c0-bd99-f3a788a902ec Failed EdgeLocalEndpoint CREATE_TYPE
cb7c353a-42cd-4661-8334-e19fd0b958db Failed null OPERATION-EXECUTE_DR_PLAN
947e4069-099a-41e0-84ab-3f0c38ee24ab Failed EdgePeerConnection CREATE_TYPE
[...]
The Service CLI also provides a form of tab completion. When you start to type a command and press the Tab key, the CLI autocompletes the part it can predict. If more than one possible value remains, you should add at least one more letter and press the Tab key again. The following examples illustrate how the CLI performs tab completion.
-
Tab completion with one possible match
RED2-ADMIN> list Fa<Tab> RED2-ADMIN> list Fault -
Tab completion with more than one possible match
RED2-ADMIN> list Lim<Tab> PCA-ADMIN> list Limit PCA-ADMIN> list LimitOv<Tab> PCA-ADMIN> list LimitOverride
Base and Custom Commands
When you enter the help command or type the question mark ("?") at the RED2-ADMIN> prompt, the CLI returns information about its base commands, such as create, edit, add, remove, delete, list, show, and so on. However, there is another set of less commonly used custom commands. You can display them all as a single list, or only those available for a particular object type. You can use the "?" to navigate through the commands.
RED2-ADMIN> showallcustomcmds
Operation Name: <Related Object(s)>
-----------------------------------
assignLimitTemplate: LimitTemplateAssignment
backup: BackupJob
cancelWorkItem: WorkItem
changePassword: User
checkNtpServers: PcaSystem
clearC3Proxy: PcaSystem
clearFault: Fault
clearFirstBootError: NetworkConfig
clearProxy: PcaSystem
clearSrIovAllowedPorts: NetworkConfig
configZFSAdDomain: ZfsAdDomain
configZFSAdWorkgroup: ZfsAdDomain
[...]
workflowGetInstances: WorkFlow
workflowGetStep: WorkFlow
workflowGetStepAssignments: WorkFlow
workflowGetSteps: WorkFlow
workflowResume: WorkFlow
RED2-ADMIN> showcustomcmds ?
ApiService
BackupJob
Day0NetworkConfigManager
[...]
UpgradeJob
UpgradeJobList
UpgradeRequest
User
Vcn
WorkFlow
WorkItem
ZFSAppliance
ZfsAdDomain
ZfsPoolManager
RED2-ADMIN> showcustomcmds User
createUserInGroup
changePassword
RED2-ADMIN> showcustomcmds UpgradeJob
getUpgradeJob
killUpgradeJob
getUpgradeStatus