inventory_rules
Creates, updates, deletes, gets or lists an inventory_rules resource.
Overview​
| Name | inventory_rules |
| Type | Resource |
| Id | oci.object_storage.inventory_rules |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The specified inventory rule.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the inventory rule. |
etag | string | The entity tag (ETag) for the inventory rule. |
filter | object | Defines rule filter. |
isEnabled | boolean | A Boolean that determines whether this rule is currently enabled. |
report | object | Defines output report. |
reportRecurrences | string (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) |
ruleName | string | The 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 (.). |
ruleType | string | The inventory rule type. (BUCKET_RULE, OBJECT_RULE) (default: OBJECT_RULE) |
timeCreated | string (date-time) | The date and time that the inventory rule was created as per [RFC3339](https:​//tools.ietf.org/html/rfc3339). |
timeModified | string (date-time) | The date and time that the inventory rule was modified as per [RFC3339](https:​//tools.ietf.org/html/rfc3339). |
The list of inventory rules.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the inventory rule. |
etag | string | The entity tag (ETag) for the inventory rule. |
filter | object | Defines rule filter. |
isEnabled | boolean | A Boolean that determines whether this rule is currently enabled. |
report | object | Defines output report. |
reportRecurrences | string (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) |
ruleName | string | The 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 (.). |
ruleType | string | The inventory rule type. (BUCKET_RULE, OBJECT_RULE) (default: OBJECT_RULE) |
timeCreated | string (date-time) | The date and time that the inventory rule was created as per [RFC3339](https:​//tools.ietf.org/html/rfc3339). |
timeModified | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | namespaceName, inventoryRuleId, region | opc-client-request-id | Get the specified inventory rule. |
list | select | namespaceName, region | page, limit, opc-client-request-id | List the inventory rules.<br /> |
create | insert | namespaceName, region, ruleName, filter, report | opc-client-request-id | Creates a new inventory rule in the namespace<br /> |
update | update | namespaceName, inventoryRuleId, region, ruleName, filter, report | if-match, opc-client-request-id | Updates the specified inventory rule. Rule changes take effect typically within 30 seconds.<br /> |
delete | delete | namespaceName, inventoryRuleId, region | if-match, opc-client-request-id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
inventoryRuleId | string | The ID of the inventory rule. |
namespaceName | string | The Object Storage namespace used for the request. |
region | string | OCI 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-match | string | The 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. |
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](/iaas/Content/API/Concepts/usingapi.htm#nine). |
opc-client-request-id | string | The client request ID for tracing. |
page | string | 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](/iaas/Content/API/Concepts/usingapi.htm#nine). |
SELECT examples​
- get
- list
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 }}'
;
List the inventory rules.<br />
SELECT
id,
etag,
filter,
isEnabled,
report,
reportRecurrences,
ruleName,
ruleType,
timeCreated,
timeModified
FROM oci.object_storage.inventory_rules
WHERE namespaceName = '{{ namespaceName }}' -- required
AND region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND opc-client-request-id = '{{ opc-client-request-id }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: inventory_rules
props:
- name: namespaceName
value: "{{ namespaceName }}"
description: Required parameter for the inventory_rules resource.
- name: region
value: "{{ region }}"
description: Required parameter for the inventory_rules resource.
- name: filter
description: |
Defines rule filter.
value:
createdWithinDays: {{ createdWithinDays }}
exclusionPrefixes:
- "{{ exclusionPrefixes }}"
inclusionPrefixes:
- "{{ inclusionPrefixes }}"
objectTypes:
- "{{ objectTypes }}"
- name: isEnabled
value: {{ isEnabled }}
description: |
A Boolean that determines whether this rule is currently enabled.
default: true
- name: report
description: |
Defines output report.
value:
format: "{{ format }}"
schemaFields:
- "{{ schemaFields }}"
targetBucket: "{{ targetBucket }}"
- name: reportRecurrences
value: "{{ reportRecurrences }}"
description: |
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
- name: ruleName
value: "{{ ruleName }}"
description: |
The 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 (.).
- name: ruleType
value: "{{ ruleType }}"
description: |
The inventory rule type.
valid_values: ['BUCKET_RULE', 'OBJECT_RULE']
default: OBJECT_RULE
- name: opc-client-request-id
value: "{{ opc-client-request-id }}"
description: The client request ID for tracing.
description: The client request ID for tracing.
UPDATE examples​
- update
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​
- delete
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 }}'
;