Skip to main content

inventory_rules

Creates, updates, deletes, gets or lists an inventory_rules resource.

Overview​

Nameinventory_rules
TypeResource
Idoci.object_storage.inventory_rules

Fields​

The following fields are returned by SELECT queries:

The specified inventory rule.

NameDatatypeDescription
idstringUnique identifier for the inventory rule.
etagstringThe entity tag (ETag) for the inventory rule.
filterobjectDefines rule filter.
isEnabledbooleanA Boolean that determines whether this rule is currently enabled.
reportobjectDefines output report.
reportRecurrencesstring (x-obmcs-recurring-time)Defines the recurring times for report generation using iCal RFC 5545 format. The report will be generated based on the provided frequency (e.g., daily, weekly, monthly). Supported values: - FREQ=DAILY (Daily recurrence) - FREQ=WEEKLY (Weekly recurrence without specifying days) - FREQ=MONTHLY (Monthly recurrence without specifying days, default value) The recurrence is based purely on the frequency (e.g., daily, weekly, monthly), with no support for finer details like specific days or intervals. (default: FREQ=MONTHLY)
ruleNamestringThe user-defined name for the inventory rule. - Must be unique within the tenancy's Object Storage namespace. - Must be between 1 and 256 characters in length. - Valid characters are uppercase and lowercase letters, numbers, hyphens (-), underscores (_), and periods (.).
ruleTypestringThe inventory rule type. (BUCKET_RULE, OBJECT_RULE) (default: OBJECT_RULE)
timeCreatedstring (date-time)The date and time that the inventory rule was created as per [RFC3339](https:​//tools.ietf.org/html/rfc3339).
timeModifiedstring (date-time)The date and time that the inventory rule was modified as per [RFC3339](https:​//tools.ietf.org/html/rfc3339).

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnamespaceName, inventoryRuleId, regionopc-client-request-idGet the specified inventory rule.
listselectnamespaceName, regionpage, limit, opc-client-request-idList the inventory rules.<br />
createinsertnamespaceName, region, ruleName, filter, reportopc-client-request-idCreates a new inventory rule in the namespace<br />
updateupdatenamespaceName, inventoryRuleId, region, ruleName, filter, reportif-match, opc-client-request-idUpdates the specified inventory rule. Rule changes take effect typically within 30 seconds.<br />
deletedeletenamespaceName, inventoryRuleId, regionif-match, opc-client-request-idDeletes the specified rule.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
inventoryRuleIdstringThe ID of the inventory rule.
namespaceNamestringThe Object Storage namespace used for the request.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
if-matchstringThe entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.
limitintegerFor 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](/iaas/Content/API/Concepts/usingapi.htm#nine).
opc-client-request-idstringThe client request ID for tracing.
pagestringFor 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](/iaas/Content/API/Concepts/usingapi.htm#nine).

SELECT examples​

Get the specified inventory rule.

SELECT
id,
etag,
filter,
isEnabled,
report,
reportRecurrences,
ruleName,
ruleType,
timeCreated,
timeModified
FROM oci.object_storage.inventory_rules
WHERE namespaceName = '{{ namespaceName }}' -- required
AND inventoryRuleId = '{{ inventoryRuleId }}' -- required
AND region = '{{ region }}' -- required
AND opc-client-request-id = '{{ opc-client-request-id }}'
;

INSERT examples​

Creates a new inventory rule in the namespace<br />

INSERT INTO oci.object_storage.inventory_rules (
filter,
isEnabled,
report,
reportRecurrences,
ruleName,
ruleType,
namespaceName,
region,
opc-client-request-id
)
SELECT
'{{ filter }}' /* required */,
{{ isEnabled }},
'{{ report }}' /* required */,
'{{ reportRecurrences }}',
'{{ ruleName }}' /* required */,
'{{ ruleType }}',
'{{ namespaceName }}',
'{{ region }}',
'{{ opc-client-request-id }}'
RETURNING
id,
etag,
filter,
isEnabled,
report,
reportRecurrences,
ruleName,
ruleType,
timeCreated,
timeModified
;

UPDATE examples​

Updates the specified inventory rule. Rule changes take effect typically within 30 seconds.<br />

UPDATE oci.object_storage.inventory_rules
SET
filter = '{{ filter }}',
isEnabled = {{ isEnabled }},
report = '{{ report }}',
reportRecurrences = '{{ reportRecurrences }}',
ruleName = '{{ ruleName }}',
ruleType = '{{ ruleType }}'
WHERE
namespaceName = '{{ namespaceName }}' --required
AND inventoryRuleId = '{{ inventoryRuleId }}' --required
AND region = '{{ region }}' --required
AND ruleName = '{{ ruleName }}' --required
AND filter = '{{ filter }}' --required
AND report = '{{ report }}' --required
AND if-match = '{{ if-match}}'
AND opc-client-request-id = '{{ opc-client-request-id}}'
RETURNING
id,
etag,
filter,
isEnabled,
report,
reportRecurrences,
ruleName,
ruleType,
timeCreated,
timeModified;

DELETE examples​

Deletes the specified rule.

DELETE FROM oci.object_storage.inventory_rules
WHERE namespaceName = '{{ namespaceName }}' --required
AND inventoryRuleId = '{{ inventoryRuleId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-client-request-id = '{{ opc-client-request-id }}'
;