CLI Commands

List of the CLI commands for Resource Analytics.

Command Description Required Optional
oci resource-analytics -h
Use the Resource Analytics Control Plane CLI to manage Resource Analytics Instances and their Tenancy Attachments, or enabling / disabling OAC on ADW instances.
Resource Analytics Instance
oci resource-analytics resource-analytics-instance -h
A ResourceAnalyticsInstance is an ADW housing analytics for all a customers’ OCI resources.
oci resource-analytics resource-analytics-instance create [OPTIONS]
Creates a ResourceAnalyticsInstance. --adw-admin-password-password [text]--compartment-id, -c [text]--included-regions [complex type]--subnet-id [text] --defined-tags [complex type]--description [text]--display-name [text]--freeform-tags [complex type]--from-json [text]--is-mutual-tls-required [boolean]--max-wait-seconds [integer]--nsg-ids [complex type]--wait-for-state [text]--wait-interval-seconds [integer]
oci resource-analytics resource-analytics-instance change-compartment [OPTIONS]
Moves a ResourceAnalyticsInstance into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment.

--compartment-id, -c [text]

--resource-analytics-instance-id [text]

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

oci resource-analytics resource-analytics-instance delete [OPTIONS]
Deletes a ResourceAnalyticsInstance. --resource-analytics-instance-id [text]

--force

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

oci resource-analytics resource-analytics-instance disable-oac [OPTIONS]
Disable an OAC instance for a ResourceAnalyticsInstance. --resource-analytics-instance-id [text]

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

oci resource-analytics resource-analytics-instance enable-oac [OPTIONS]
Attaches an OAC instance to a ResourceAnalyticsInstance.

--attachment-details [complex type]

--attachment-type [text]

--resource-analytics-instance-id [text]

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

oci resource-analytics resource-analytics-instance get [OPTIONS]
Gets information about a ResourceAnalyticsInstance. --resource-analytics-instance-id [text] --from-json [text]
oci resource-analytics resource-analytics-instance list [OPTIONS]
Gets a list of ResourceAnalyticsInstances.

--all

--compartment-id, -c [text]

--display-name [text]

--from-json [text]

--id [text]

--lifecycle-state [text]

--limit [integer]

--page [text]

--page-size [integer]

--sort-by [text]

--sort-order [text]

oci resource-analytics resource-analytics-instance update [OPTIONS]
Updates a ResourceAnalyticsInstance. --resource-analytics-instance-id [text]

--defined-tags [complex type]

--description [text]

--display-name [text]

--force

--freeform-tags [complex type]

--from-json [text]

--if-match [text]

--included-regions [complex type]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

Tenancy Attachments
oci resource-analytics tenancy-attachment -h
A TenancyAttachment is a customers’ tenancy attached to a ResourceAnalyticsInstance. Attached tenancies are included in analytics collection.
oci resource-analytics tenancy-attachment create [OPTIONS]
Creates a TenancyAttachment. --resource-analytics-instance-id [text]--tenancy-id [text] --description [text]--from-json [text]--max-wait-seconds [integer]--wait-for-state [text]--wait-interval-seconds [integer]
oci resource-analytics tenancy-attachment delete [OPTIONS]
Deletes a TenancyAttachment. --tenancy-attachment-id [text]

--force

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

oci resource-analytics tenancy-attachment get [OPTIONS]
Gets information about a TenancyAttachment. --tenancy-attachment-id [text] --from-json [text]
oci resource-analytics tenancy-attachment list [OPTIONS]
Gets a list of TenancyAttachments.

--all

--from-json [text]

--id [text]

--lifecycle-state [text]

--limit [integer]

--page [text]

--page-size [integer]

--resource-analytics-instance-id [text]

--sort-by [text]

--sort-order [text]

oci resource-analytics tenancy-attachment update [OPTIONS]
Updates a TenancyAttachment.

--description [text]

--tenancy-attachment-id [text]

--from-json [text]

--if-match [text]

--max-wait-seconds [integer]

--wait-for-state [text]

--wait-interval-seconds [integer]

Work Requests
oci resource-analytics work-request -h
An asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, the service creates a work request. A work request is an activity log that lets you track each step in the operation’s progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation.
oci resource-analytics work-request cancel [OPTIONS]
Cancels a work request. --work-request-id [text]

--force

--from-json [text]

--if-match [text]

oci resource-analytics work-request get [OPTIONS]
Gets the details of a work request. --work-request-id [text] --from-json [text]
oci resource-analytics work-request list [OPTIONS]
Lists the work requests in a compartment.

--all

--compartment-id, -c [text]

--from-json [text]

--limit [integer]

--page [text]

--page-size [integer]

--resource-id [text]

--sort-by [text]

--sort-order [text]

--status [text]

--work-request-id [text]

Work Request Errors
oci resource-analytics work-request-error -h
An error met while performing an operation that's tracked by a work request.
oci resource-analytics work-request-error list [OPTIONS]
Lists the errors for a work request. --work-request-id [text]

--all

--from-json [text]

--limit [integer]

--page [text]

--page-size [integer]

--sort-by [text]

--sort-order [text]

Work Request Logs
oci resource-analytics work-request-log-entry -h
A log message from performing an operation that's tracked by a work request.
oci resource-analytics work-request-log-entry list [OPTIONS]
Lists the logs for a work request. --work-request-id [text]

--all

--from-json [text]

--limit [integer]

--page [text]

--page-size [integer]

--sort-by [text]

--sort-order [text]

Parameter Descriptions

Parameter Description SDK Standard Text
--adw-admin-password-password [text] Password for the ADW to be created in User Tenancy. The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It can't contain the double quote symbol " or the username, admin, regardless of casing.
--all Fetches all pages of results. If you provide this option, then you can't provide the --limit option. SDK Standard Text
--attachment-details [complex type]

This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, changing it as needed and then passing it back in through the file:// syntax.

--attachment-type [text]

The type of attachment the OAC instance is using.

Accepted values are:

MANAGED
--compartment-id, -c [text] The OCID of the compartment to create the ResourceAnalyticsInstance in. The OCID of the compartment to move the ResourceAnalyticsInstance to. The OCID of the compartment in which to list resources.
--defined-tags [complex type]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Example:

{"Operations": {"CostCenter": "42"}}

This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, changing it as needed and then passing it back in through the file:// syntax.

SDK Standard Text
--description [text] A description of the ResourceAnalyticsInstance instance. A description of the tenancy.
--display-name [text] A user-friendly name. It doesn't have to be unique, and it's changeable. Don't entering confidential information. A filter to return only resources that match the particular display name exactly.
--id [text]

The OCID of the ResourceAnalyticsInstance.

The OCID of the TenancyAttachment.

--if-match [text] For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag you provide matches the resource's current etag value. SDK Standard Text
--included-regions [complex type]

Regions to be included with data collection. The region ID, For example, us-ashburn-1. At least one region is required. This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, changing it as needed and then passing it back in through the file:// syntax.

--is-mutual-tls-required [boolean] Require mutual TLS (mTLS) when authenticating connections to the ADW database.
--freeform-tags [complex type]

Free-form tags for this resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags.

Example:

{"Department": "Finance"}

This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, changing it as needed and then passing it back in through the file:// syntax.

SDK Standard Text
--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are prepopulated and match the command option names (converted to camelCase format, for example, compartment-id becomes compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts many values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value are used.

For examples on usage of this option, see, using CLI with advanced JSON options

SDK Standard Text
--force

Perform deletion without prompting for confirmation.

Perform update without prompting for confirmation.

SDK Standard Text
--lifecycle-state [text]

A filter to return only resources that match the specific lifecycle state. The state value is case-insensitive.

Accepted values are:

ACTIVE, CREATING, DELETED, DELETING, FAILED, UPDATING
SDK Standard Text
--limit [integer] For list pagination. The maximum number of results per page, or items to return in a paginated List call. For important details about how pagination works, see List Pagination. SDK Standard Text
--max-wait-seconds [integer] The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds. SDK Standard Text
--nsg-ids [complex type]

List of Network Security Group OCID's. This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, changing it as needed and then passing it back in through the file:// syntax.

--page [text] For list pagination. The value of the opc-next-page response header from the previous List call. For important details about how pagination works, see List Pagination. SDK Standard Text
--page-size [integer] When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise. SDK Standard Text
--resource-analytics-instance-id [text]

The OCID of the ResourceAnalyticsInstance.

The OCID of a ResourceAnalyticsInstance.

--resource-id [text] The OCID of the resource affected by the work request. SDK Standard Text
--sort-by [text]

The field to sort by. You can provide only one sort order. Default order for TIME_CREATED is descending. Default order for DISPLAY_NAME is ascending.

Accepted values are:

DISPLAY_NAME, TIME_CREATED

The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending.

Accepted values are:

timeAccepted
SDK Standard Text
--sort-order [text]

The sort order to use, either ascending (ASC) or descending (DESC).

Accepted values are:

ASC, DESC
SDK Standard Text
--status [text]

A filter to return only the resources that match the specific lifecycle state.

Accepted values are:

ACCEPTED, CANCELED, CANCELING, FAILED, IN_PROGRESS, NEEDS_ATTENTION, SUCCEEDED, WAITING
SDK Standard Text
--subnet-id [text] The OCID of the subnet the resource is associated with.
--wait-for-state [text]

This operation asynchronously creates, changes or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Several states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.

Accepted values are:

ACCEPTED, CANCELED, CANCELING, FAILED, IN_PROGRESS, NEEDS_ATTENTION, SUCCEEDED, WAITING
SDK Standard Text
--wait-interval-seconds [integer] Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds. SDK Standard Text
--work-request-id [text] The OCID of the asynchronous work request. SDK Standard Text