Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getBackupPolicies

This data source provides the Click House Backup Policies of the current Alibaba Cloud user.

NOTE: Available in v1.147.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.ClickHouse.GetBackupPolicies.InvokeAsync(new AliCloud.ClickHouse.GetBackupPoliciesArgs
        {
            DbClusterId = "example_value",
        }));
        this.ClickHouseBackupPolicyId1 = example.Apply(example => example.Policies?[0]?.Id);
    }

    [Output("clickHouseBackupPolicyId1")]
    public Output<string> ClickHouseBackupPolicyId1 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/clickhouse"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := clickhouse.GetBackupPolicies(ctx, &clickhouse.GetBackupPoliciesArgs{
			DbClusterId: "example_value",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("clickHouseBackupPolicyId1", example.Policies[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.clickhouse.ClickhouseFunctions;
import com.pulumi.alicloud.clickhouse.inputs.GetBackupPoliciesArgs;
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 example = ClickhouseFunctions.getBackupPolicies(GetBackupPoliciesArgs.builder()
            .dbClusterId("example_value")
            .build());

        ctx.export("clickHouseBackupPolicyId1", example.applyValue(getBackupPoliciesResult -> getBackupPoliciesResult.policies()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.clickhouse.get_backup_policies(db_cluster_id="example_value")
pulumi.export("clickHouseBackupPolicyId1", example.policies[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.clickhouse.getBackupPolicies({
    dbClusterId: "example_value",
});
export const clickHouseBackupPolicyId1 = example.then(example => example.policies?[0]?.id);
variables:
  example:
    Fn::Invoke:
      Function: alicloud:clickhouse:getBackupPolicies
      Arguments:
        dbClusterId: example_value
outputs:
  clickHouseBackupPolicyId1: ${example.policies[0].id}

Using getBackupPolicies

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 getBackupPolicies(args: GetBackupPoliciesArgs, opts?: InvokeOptions): Promise<GetBackupPoliciesResult>
function getBackupPoliciesOutput(args: GetBackupPoliciesOutputArgs, opts?: InvokeOptions): Output<GetBackupPoliciesResult>
def get_backup_policies(db_cluster_id: Optional[str] = None,
                        output_file: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetBackupPoliciesResult
def get_backup_policies_output(db_cluster_id: Optional[pulumi.Input[str]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetBackupPoliciesResult]
func GetBackupPolicies(ctx *Context, args *GetBackupPoliciesArgs, opts ...InvokeOption) (*GetBackupPoliciesResult, error)
func GetBackupPoliciesOutput(ctx *Context, args *GetBackupPoliciesOutputArgs, opts ...InvokeOption) GetBackupPoliciesResultOutput

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

public static class GetBackupPolicies 
{
    public static Task<GetBackupPoliciesResult> InvokeAsync(GetBackupPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetBackupPoliciesResult> Invoke(GetBackupPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBackupPoliciesResult> getBackupPolicies(GetBackupPoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: alicloud:clickhouse/getBackupPolicies:getBackupPolicies
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DbClusterId string

The db cluster id.

OutputFile string
DbClusterId string

The db cluster id.

OutputFile string
dbClusterId String

The db cluster id.

outputFile String
dbClusterId string

The db cluster id.

outputFile string
db_cluster_id str

The db cluster id.

output_file str
dbClusterId String

The db cluster id.

outputFile String

getBackupPolicies Result

The following output properties are available:

DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Policies List<Pulumi.AliCloud.ClickHouse.Outputs.GetBackupPoliciesPolicy>
OutputFile string
DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Policies []GetBackupPoliciesPolicy
OutputFile string
dbClusterId String
id String

The provider-assigned unique ID for this managed resource.

policies List<GetBackupPoliciesPolicy>
outputFile String
dbClusterId string
id string

The provider-assigned unique ID for this managed resource.

policies GetBackupPoliciesPolicy[]
outputFile string
db_cluster_id str
id str

The provider-assigned unique ID for this managed resource.

policies Sequence[GetBackupPoliciesPolicy]
output_file str
dbClusterId String
id String

The provider-assigned unique ID for this managed resource.

policies List<Property Map>
outputFile String

Supporting Types

GetBackupPoliciesPolicy

BackupRetentionPeriod int

Data backup days. Valid values: 7 to 730.

DbClusterId string

The db cluster id.

Id string

The ID of the Backup Policy.

PreferredBackupPeriods List<string>

DBCluster Backup period.

PreferredBackupTime string

Backup Time, UTC time.

Status string

The status of the resource.

BackupRetentionPeriod int

Data backup days. Valid values: 7 to 730.

DbClusterId string

The db cluster id.

Id string

The ID of the Backup Policy.

PreferredBackupPeriods []string

DBCluster Backup period.

PreferredBackupTime string

Backup Time, UTC time.

Status string

The status of the resource.

backupRetentionPeriod Integer

Data backup days. Valid values: 7 to 730.

dbClusterId String

The db cluster id.

id String

The ID of the Backup Policy.

preferredBackupPeriods List<String>

DBCluster Backup period.

preferredBackupTime String

Backup Time, UTC time.

status String

The status of the resource.

backupRetentionPeriod number

Data backup days. Valid values: 7 to 730.

dbClusterId string

The db cluster id.

id string

The ID of the Backup Policy.

preferredBackupPeriods string[]

DBCluster Backup period.

preferredBackupTime string

Backup Time, UTC time.

status string

The status of the resource.

backup_retention_period int

Data backup days. Valid values: 7 to 730.

db_cluster_id str

The db cluster id.

id str

The ID of the Backup Policy.

preferred_backup_periods Sequence[str]

DBCluster Backup period.

preferred_backup_time str

Backup Time, UTC time.

status str

The status of the resource.

backupRetentionPeriod Number

Data backup days. Valid values: 7 to 730.

dbClusterId String

The db cluster id.

id String

The ID of the Backup Policy.

preferredBackupPeriods List<String>

DBCluster Backup period.

preferredBackupTime String

Backup Time, UTC time.

status String

The status of the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.