Skip to main content

volume_backup_policy_assignments

Creates, updates, deletes, gets or lists a volume_backup_policy_assignments resource.

Overview​

Namevolume_backup_policy_assignments
TypeResource
Idoci.block_storage.volume_backup_policy_assignments

Fields​

The following fields are returned by SELECT queries:

The volume backup policy assignment was retrieved.

NameDatatypeDescription
idstringThe OCID of the volume backup policy assignment.
assetIdstringThe OCID of the volume the policy has been assigned to.
policyIdstringThe OCID of the volume backup policy that has been assigned to the volume.
timeCreatedstring (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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpolicyAssignmentId, regionGets information for the specified volume backup policy assignment.
createinsertregion, policyId, assetIdAssigns 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 />
deletedeletepolicyAssignmentId, regionif-matchDeletes 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.

NameDatatypeDescription
policyAssignmentIdstringThe OCID of the volume backup policy assignment.
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-matchstringFor 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​

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​

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
;

DELETE examples​

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 }}'
;