volume_backup_policy_assignments
Creates, updates, deletes, gets or lists a volume_backup_policy_assignments resource.
Overview​
| Name | volume_backup_policy_assignments |
| Type | Resource |
| Id | oci.block_storage.volume_backup_policy_assignments |
Fields​
The following fields are returned by SELECT queries:
- get
The volume backup policy assignment was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the volume backup policy assignment. |
assetId | string | The OCID of the volume the policy has been assigned to. |
policyId | string | The OCID of the volume backup policy that has been assigned to the volume. |
timeCreated | string (date-time) | The date and time the volume backup policy was assigned to the volume. The format is defined by [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 | policyAssignmentId, region | Gets information for the specified volume backup policy assignment. | |
create | insert | region, policyId, assetId | Assigns a volume backup policy to the specified volume. Note that a given volume can<br />only have one backup policy assigned to it. If this operation is used for a volume that already<br />has a different backup policy assigned, the prior backup policy will be silently unassigned.<br /> | |
delete | delete | policyAssignmentId, region | if-match | Deletes a volume backup policy assignment. |
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 |
|---|---|---|
policyAssignmentId | string | The OCID of the volume backup policy assignment. |
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 | 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 will be updated or deleted only if the etag you provide matches the resource's current etag value. |
SELECT examples​
- get
Gets information for the specified volume backup policy assignment.
SELECT
id,
assetId,
policyId,
timeCreated
FROM oci.block_storage.volume_backup_policy_assignments
WHERE policyAssignmentId = '{{ policyAssignmentId }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples​
- create
- Manifest
Assigns a volume backup policy to the specified volume. Note that a given volume can<br />only have one backup policy assigned to it. If this operation is used for a volume that already<br />has a different backup policy assigned, the prior backup policy will be silently unassigned.<br />
INSERT INTO oci.block_storage.volume_backup_policy_assignments (
assetId,
policyId,
region
)
SELECT
'{{ assetId }}' /* required */,
'{{ policyId }}' /* required */,
'{{ region }}'
RETURNING
id,
assetId,
policyId,
timeCreated
;
# Description fields are for documentation purposes
- name: volume_backup_policy_assignments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the volume_backup_policy_assignments resource.
- name: assetId
value: "{{ assetId }}"
description: |
The OCID of the volume to assign the policy to.
- name: policyId
value: "{{ policyId }}"
description: |
The OCID of the volume backup policy to assign to the volume.
DELETE examples​
- delete
Deletes a volume backup policy assignment.
DELETE FROM oci.block_storage.volume_backup_policy_assignments
WHERE policyAssignmentId = '{{ policyAssignmentId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;