list
Lists resource data. The maximum number of rows displayed is controlled by OMS property oracle.sysman.core.dataservice.max_fetch_rows. When the property is not set, it uses the default value of 2000.
Format
emcli list [-help] [-resource="list_resource_name"] [-columns="column_options"] [-colsize="column_sizes"] [-search="search_options"] [-bind="bind_parameters"] [-sql='<sql statement>'] [-script | -format= [name:<pretty|script|csv>]; [column_separator:"column_sep_string"]; [row_separator:"row_sep_string"]; ] [-noheader] [ ] indicates that the parameter is optional
Options
-
help
Lists all resource names with their descriptions. Use this option in conjunction with the -resource option below, to see more details about the resource.
-
resource
Resource name for which data is displayed. The display column names and the search attribute names are different for all EM CLI list -resource commands. Use the -help attribute to obtain the full list of all column names (search attribute names) and display names for a given resource type.
-
columns
Specify columns as shown, separated by commas:
-columns="colname,colname,colname"
Example:
-columns="COL1,COL3,COL5"
Specify column size and width as shown below. A colon precedes the size for a given column.
-columns="colname:colsize,colname,colname"
Example:
-columns="COL1:30,COL3,COL5"
-
colsize
Resizes column widths. Most resource columns have some default widths. You can override them with this option. Example: -colsize="col1:30,col2:5"
-
search
You can specify multiple search options. The usage is -search=[ColumnName Operator 'Value', ColumnName Operator 'Value']. The search value must be enclosed in quotes unless searching for null or not null.
The following operators are supported:
= !+ > < >= <= like
The option also supports is null and is not null.
-
bind
Use for resources that require specific input. The usage is -bind="Name Operator Value".
-
sql
Specifies arbitrary SQL against views. This query is executed as MGMT_VIEW user. To execute user-defined SQL using the -sql option:
emcli list -sql='select * from mgmt$target'.
-
script
Sets the default column separator to a tab and the default row separator to a newline. You can change the column and row separator strings to change these defaults.
-
format
Format specification (default is
-format="name:pretty"
).-
format="name:pretty"
prints the output table in a readable format not intended to be parsed by scripts. -
format="name:script"
sets the default column separator to a tab and the default row separator to a newline. The column and row separator strings can be specified to change these defaults. -
format="name:csv"
sets the column separator to a comma and the row separator to a newline. -
format=
column_separator:"column_sep_string" column-separates the verb output by <column_sep_string>. Rows are separated by the newline character. -
row_separator:"row_sep_string" row-separates the verb output by <row_sep_string>. Rows are separated by the tab character.
-
-
noheader
Displays tabular output without column headers.
Output
When run in script mode, returns JSON output that can be easily parsed.
Exit Codes:
-
0 — Appears when successful.
-
1 — Appears when the list service fails to process the request.
Examples
These examples list all resource names.
Example 1 - Command-Line
emcli list -help
Example 2 - Scripting and Interactive
list (help)
These examples list column information about the 'Administrators' resources. They also list which columns users can search.
Example 3 - Command-Line
emcli list -help -resource=Administrators
Example 4 - Scripting and Interactive
list (help ,resource=Administrators)
Example 5 - Searching
list(resource="NamedCredentials", search=[searchColumn + " like '" + mySearchPattern + "'", "CredOwner='SYSMAN'"]
emcli list -help -resource=RolesResult:
Name : Roles Description : Lists all EM Roles Column Name Description Searchable ROLE_NAME Name Yes ROLE_TYPE Type Yes EXTERNAL_ROLE_NAME External Role Yes DESCRIPTION Description Yes PRIVATE_ROLE Private Role Yes
emcli list
-sql='select target_name, target_type,host_name from mgmt$target'
-columns='TARGET_NAME:60,target_type:30,host_name:40'