1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. RecoveryMod
  5. getProtectionPolicies
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.RecoveryMod.getProtectionPolicies

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    This data source provides the list of Protection Policies in Oracle Cloud Infrastructure Recovery service.

    Gets a list of protection policies based on the specified parameters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testProtectionPolicies = oci.RecoveryMod.getProtectionPolicies({
        compartmentId: compartmentId,
        displayName: protectionPolicyDisplayName,
        owner: protectionPolicyOwner,
        protectionPolicyId: testProtectionPolicy.id,
        state: protectionPolicyState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_protection_policies = oci.RecoveryMod.get_protection_policies(compartment_id=compartment_id,
        display_name=protection_policy_display_name,
        owner=protection_policy_owner,
        protection_policy_id=test_protection_policy["id"],
        state=protection_policy_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/RecoveryMod"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := RecoveryMod.GetProtectionPolicies(ctx, &recoverymod.GetProtectionPoliciesArgs{
    			CompartmentId:      compartmentId,
    			DisplayName:        pulumi.StringRef(protectionPolicyDisplayName),
    			Owner:              pulumi.StringRef(protectionPolicyOwner),
    			ProtectionPolicyId: pulumi.StringRef(testProtectionPolicy.Id),
    			State:              pulumi.StringRef(protectionPolicyState),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testProtectionPolicies = Oci.RecoveryMod.GetProtectionPolicies.Invoke(new()
        {
            CompartmentId = compartmentId,
            DisplayName = protectionPolicyDisplayName,
            Owner = protectionPolicyOwner,
            ProtectionPolicyId = testProtectionPolicy.Id,
            State = protectionPolicyState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.RecoveryMod.RecoveryModFunctions;
    import com.pulumi.oci.RecoveryMod.inputs.GetProtectionPoliciesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testProtectionPolicies = RecoveryModFunctions.getProtectionPolicies(GetProtectionPoliciesArgs.builder()
                .compartmentId(compartmentId)
                .displayName(protectionPolicyDisplayName)
                .owner(protectionPolicyOwner)
                .protectionPolicyId(testProtectionPolicy.id())
                .state(protectionPolicyState)
                .build());
    
        }
    }
    
    variables:
      testProtectionPolicies:
        fn::invoke:
          Function: oci:RecoveryMod:getProtectionPolicies
          Arguments:
            compartmentId: ${compartmentId}
            displayName: ${protectionPolicyDisplayName}
            owner: ${protectionPolicyOwner}
            protectionPolicyId: ${testProtectionPolicy.id}
            state: ${protectionPolicyState}
    

    Using getProtectionPolicies

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProtectionPolicies(args: GetProtectionPoliciesArgs, opts?: InvokeOptions): Promise<GetProtectionPoliciesResult>
    function getProtectionPoliciesOutput(args: GetProtectionPoliciesOutputArgs, opts?: InvokeOptions): Output<GetProtectionPoliciesResult>
    def get_protection_policies(compartment_id: Optional[str] = None,
                                display_name: Optional[str] = None,
                                filters: Optional[Sequence[_recoverymod.GetProtectionPoliciesFilter]] = None,
                                owner: Optional[str] = None,
                                protection_policy_id: Optional[str] = None,
                                state: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetProtectionPoliciesResult
    def get_protection_policies_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                display_name: Optional[pulumi.Input[str]] = None,
                                filters: Optional[pulumi.Input[Sequence[pulumi.Input[_recoverymod.GetProtectionPoliciesFilterArgs]]]] = None,
                                owner: Optional[pulumi.Input[str]] = None,
                                protection_policy_id: Optional[pulumi.Input[str]] = None,
                                state: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetProtectionPoliciesResult]
    func GetProtectionPolicies(ctx *Context, args *GetProtectionPoliciesArgs, opts ...InvokeOption) (*GetProtectionPoliciesResult, error)
    func GetProtectionPoliciesOutput(ctx *Context, args *GetProtectionPoliciesOutputArgs, opts ...InvokeOption) GetProtectionPoliciesResultOutput

    > Note: This function is named GetProtectionPolicies in the Go SDK.

    public static class GetProtectionPolicies 
    {
        public static Task<GetProtectionPoliciesResult> InvokeAsync(GetProtectionPoliciesArgs args, InvokeOptions? opts = null)
        public static Output<GetProtectionPoliciesResult> Invoke(GetProtectionPoliciesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProtectionPoliciesResult> getProtectionPolicies(GetProtectionPoliciesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:RecoveryMod/getProtectionPolicies:getProtectionPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The compartment OCID.
    DisplayName string
    A filter to return only resources that match the entire 'displayname' given.
    Filters List<GetProtectionPoliciesFilter>
    Owner string
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    ProtectionPolicyId string
    The protection policy OCID.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    CompartmentId string
    The compartment OCID.
    DisplayName string
    A filter to return only resources that match the entire 'displayname' given.
    Filters []GetProtectionPoliciesFilter
    Owner string
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    ProtectionPolicyId string
    The protection policy OCID.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    compartmentId String
    The compartment OCID.
    displayName String
    A filter to return only resources that match the entire 'displayname' given.
    filters List<GetProtectionPoliciesFilter>
    owner String
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    protectionPolicyId String
    The protection policy OCID.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    compartmentId string
    The compartment OCID.
    displayName string
    A filter to return only resources that match the entire 'displayname' given.
    filters GetProtectionPoliciesFilter[]
    owner string
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    protectionPolicyId string
    The protection policy OCID.
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    compartment_id str
    The compartment OCID.
    display_name str
    A filter to return only resources that match the entire 'displayname' given.
    filters Sequence[recoverymod.GetProtectionPoliciesFilter]
    owner str
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    protection_policy_id str
    The protection policy OCID.
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    compartmentId String
    The compartment OCID.
    displayName String
    A filter to return only resources that match the entire 'displayname' given.
    filters List<Property Map>
    owner String
    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'.
    protectionPolicyId String
    The protection policy OCID.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.

    getProtectionPolicies Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment that contains the protection policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProtectionPolicyCollections List<GetProtectionPoliciesProtectionPolicyCollection>
    The list of protection_policy_collection.
    DisplayName string
    A user provided name for the protection policy.
    Filters List<GetProtectionPoliciesFilter>
    Owner string
    ProtectionPolicyId string
    State string
    The current state of the protection policy.
    CompartmentId string
    The OCID of the compartment that contains the protection policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProtectionPolicyCollections []GetProtectionPoliciesProtectionPolicyCollection
    The list of protection_policy_collection.
    DisplayName string
    A user provided name for the protection policy.
    Filters []GetProtectionPoliciesFilter
    Owner string
    ProtectionPolicyId string
    State string
    The current state of the protection policy.
    compartmentId String
    The OCID of the compartment that contains the protection policy.
    id String
    The provider-assigned unique ID for this managed resource.
    protectionPolicyCollections List<GetProtectionPoliciesProtectionPolicyCollection>
    The list of protection_policy_collection.
    displayName String
    A user provided name for the protection policy.
    filters List<GetProtectionPoliciesFilter>
    owner String
    protectionPolicyId String
    state String
    The current state of the protection policy.
    compartmentId string
    The OCID of the compartment that contains the protection policy.
    id string
    The provider-assigned unique ID for this managed resource.
    protectionPolicyCollections GetProtectionPoliciesProtectionPolicyCollection[]
    The list of protection_policy_collection.
    displayName string
    A user provided name for the protection policy.
    filters GetProtectionPoliciesFilter[]
    owner string
    protectionPolicyId string
    state string
    The current state of the protection policy.
    compartment_id str
    The OCID of the compartment that contains the protection policy.
    id str
    The provider-assigned unique ID for this managed resource.
    protection_policy_collections Sequence[recoverymod.GetProtectionPoliciesProtectionPolicyCollection]
    The list of protection_policy_collection.
    display_name str
    A user provided name for the protection policy.
    filters Sequence[recoverymod.GetProtectionPoliciesFilter]
    owner str
    protection_policy_id str
    state str
    The current state of the protection policy.
    compartmentId String
    The OCID of the compartment that contains the protection policy.
    id String
    The provider-assigned unique ID for this managed resource.
    protectionPolicyCollections List<Property Map>
    The list of protection_policy_collection.
    displayName String
    A user provided name for the protection policy.
    filters List<Property Map>
    owner String
    protectionPolicyId String
    state String
    The current state of the protection policy.

    Supporting Types

    GetProtectionPoliciesFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetProtectionPoliciesProtectionPolicyCollection

    GetProtectionPoliciesProtectionPolicyCollectionItem

    BackupRetentionPeriodInDays int
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    CompartmentId string
    The compartment OCID.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    DisplayName string
    A filter to return only resources that match the entire 'displayname' given.
    FreeformTags Dictionary<string, string>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    The protection policy OCID.
    IsPredefinedPolicy bool
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    LifecycleDetails string
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    MustEnforceCloudLocality bool
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    PolicyLockedDateTime string
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    TimeCreated string
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    TimeUpdated string
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    BackupRetentionPeriodInDays int
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    CompartmentId string
    The compartment OCID.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    DisplayName string
    A filter to return only resources that match the entire 'displayname' given.
    FreeformTags map[string]string
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    The protection policy OCID.
    IsPredefinedPolicy bool
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    LifecycleDetails string
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    MustEnforceCloudLocality bool
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    PolicyLockedDateTime string
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    TimeCreated string
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    TimeUpdated string
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    backupRetentionPeriodInDays Integer
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    compartmentId String
    The compartment OCID.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    displayName String
    A filter to return only resources that match the entire 'displayname' given.
    freeformTags Map<String,String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    The protection policy OCID.
    isPredefinedPolicy Boolean
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    lifecycleDetails String
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    mustEnforceCloudLocality Boolean
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    policyLockedDateTime String
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    timeCreated String
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    timeUpdated String
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    backupRetentionPeriodInDays number
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    compartmentId string
    The compartment OCID.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    displayName string
    A filter to return only resources that match the entire 'displayname' given.
    freeformTags {[key: string]: string}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id string
    The protection policy OCID.
    isPredefinedPolicy boolean
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    lifecycleDetails string
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    mustEnforceCloudLocality boolean
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    policyLockedDateTime string
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    timeCreated string
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    timeUpdated string
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    backup_retention_period_in_days int
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    compartment_id str
    The compartment OCID.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    display_name str
    A filter to return only resources that match the entire 'displayname' given.
    freeform_tags Mapping[str, str]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id str
    The protection policy OCID.
    is_predefined_policy bool
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    lifecycle_details str
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    must_enforce_cloud_locality bool
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    policy_locked_date_time str
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    time_created str
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    time_updated str
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    backupRetentionPeriodInDays Number
    The maximum number of days to retain backups for a protected database. Specify a period ranging from a minimum 14 days to a maximum 95 days. For example, specify the value 55 if you want to retain backups for 55 days.
    compartmentId String
    The compartment OCID.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}. For more information, see Resource Tags
    displayName String
    A filter to return only resources that match the entire 'displayname' given.
    freeformTags Map<String>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    The protection policy OCID.
    isPredefinedPolicy Boolean
    Set to TRUE if the policy is Oracle-defined, and FALSE for a user-defined custom policy. You can modify only the custom policies.
    lifecycleDetails String
    Detailed description about the current lifecycle state of the protection policy. For example, it can be used to provide actionable information for a resource in a Failed state.
    mustEnforceCloudLocality Boolean
    Indicates whether the protection policy enforces Recovery Service to retain backups in the same cloud service environment where your Oracle Database is provisioned.
    policyLockedDateTime String
    An RFC3339 formatted datetime string that specifies the exact date and time for the retention lock to take effect and permanently lock the retention period defined in the policy.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}. For more information, see Resource Tags
    timeCreated String
    An RFC3339 formatted datetime string that indicates the created time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.
    timeUpdated String
    An RFC3339 formatted datetime string that indicates the updated time for the protection policy. For example: '2020-05-22T21:10:29.600Z'.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi