oci_object_storage_object_lifecycle_policy_facts – Fetches details about one or multiple ObjectLifecyclePolicy resources in Oracle Cloud Infrastructure¶
New in version 2.5.
Synopsis¶
- Fetches details about one or multiple ObjectLifecyclePolicy resources in Oracle Cloud Infrastructure
- Gets the object lifecycle policy for the bucket.
Requirements¶
The below requirements are needed on the host that executes this module.
- python >= 2.7
- Python SDK for Oracle Cloud Infrastructure https://oracle-cloud-infrastructure-python-sdk.readthedocs.io
Parameters¶
| Parameter | Choices/Defaults | Comments |
|---|---|---|
|
api_user
string
|
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See
config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm. |
|
|
api_user_fingerprint
string
|
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See
config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm. |
|
|
api_user_key_file
string
|
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See
config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided. |
|
|
api_user_key_pass_phrase
string
|
Passphrase used by the key referenced in
api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location). |
|
|
auth_type
string
|
|
The type of authentication to use for making API requests. By default
auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible` playbooks within an OCI compute instance. |
|
bucket_name
-
/ required
|
The name of the bucket. Avoid entering confidential information. Example: `my-new-bucket1`
|
|
|
config_file_location
string
|
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
|
|
|
config_profile_name
string
|
The profile to load from the config file referenced by
config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location. |
|
|
namespace_name
-
/ required
|
The Object Storage namespace used for the request.
|
|
|
region
string
|
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See
config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions. |
|
|
tenancy
string
|
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See
config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm |
Notes¶
Note
- For OCI python sdk configuration, please refer to https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/configuration.html
Examples¶
- name: Get a specific object_lifecycle_policy
oci_object_storage_object_lifecycle_policy_facts:
namespace_name: namespace_name_example
bucket_name: my-new-bucket1
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | |||
|---|---|---|---|---|---|
|
object_lifecycle_policies
complex
|
on success |
List of ObjectLifecyclePolicy resources
Sample:
[{'items': [{'time_unit': 'DAYS', 'action': 'action_example', 'name': 'name_example', 'object_name_filter': {'exclusion_patterns': [], 'inclusion_prefixes': [], 'inclusion_patterns': []}, 'is_enabled': True, 'time_amount': 56}], 'time_created': '2013-10-20T19:20:30+01:00'}]
|
|||
|
items
complex
|
on success |
The live lifecycle policy on the bucket.
For an example of this value, see the PutObjectLifecyclePolicy API documentation.
|
|||
|
action
string
|
on success |
The action of the object lifecycle policy rule. Rules using the action 'ARCHIVE' move objects into the Archive Storage tier. Rules using the action 'DELETE' permanently delete objects from buckets. 'ARCHIVE' and 'DELETE' are the only two supported actions at this time.
Sample:
action_example
|
|||
|
is_enabled
boolean
|
on success |
A boolean that determines whether this rule is currently enabled.
Sample:
True
|
|||
|
name
string
|
on success |
The name of the lifecycle rule to be applied.
Sample:
name_example
|
|||
|
object_name_filter
complex
|
on success |
A filter limiting object names that the rule will apply to.
|
|||
|
exclusion_patterns
list
|
on success |
An array of glob patterns to match the object names to exclude. An empty array is ignored. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
The special pattern characters have the following meanings:
\ Escapes the following character * Matches any string of characters. ? Matches any single character . [...] Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
|
|||
|
inclusion_patterns
list
|
on success |
An array of glob patterns to match the object names to include. An empty array includes all objects in the bucket. Exclusion patterns take precedence over inclusion patterns. A Glob pattern is a sequence of characters to match text. Any character that appears in the pattern, other than the special pattern characters described below, matches itself. Glob patterns must be between 1 and 1024 characters.
The special pattern characters have the following meanings:
\ Escapes the following character * Matches any string of characters. ? Matches any single character . [...] Matches a group of characters. A group of characters can be: A set of characters, for example: [Zafg9@]. This matches any character in the brackets. A range of characters, for example: [a-z]. This matches any character in the range. [a-f] is equivalent to [abcdef]. For character ranges only the CHARACTER-CHARACTER pattern is supported. [ab-yz] is not valid [a-mn-z] is not valid Character ranges can not start with ^ or : To include a '-' in the range, make it the first or last character.
|
|||
|
inclusion_prefixes
list
|
on success |
An array of object name prefixes that the rule will apply to. An empty array means to include all objects.
|
|||
|
time_amount
integer
|
on success |
Specifies the age of objects to apply the rule to. The timeAmount is interpreted in units defined by the timeUnit parameter, and is calculated in relation to each object's Last-Modified time.
Sample:
56
|
|||
|
time_unit
string
|
on success |
The unit that should be used to interpret timeAmount. Days are defined as starting and ending at midnight UTC. Years are defined as 365.2425 days long and likewise round up to the next midnight UTC.
Sample:
DAYS
|
|||
|
time_created
string
|
on success |
The date and time the object lifecycle policy was created, as described in RFC 3339, section 14.29.
Sample:
2013-10-20 19:20:30+01:00
|
|||
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Manoj Meda (@manojmeda)
- Mike Ross (@mross22)
- Nabeel Al-Saber (@nalsaber)
Hint
If you notice any issues in this documentation you can edit this document to improve it.