1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. hbr
  5. getServerBackupPlans
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.hbr.getServerBackupPlans

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Hbr Server Backup Plans of the current Alibaba Cloud user.

    NOTE: Available in v1.142.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.ecs.getInstances({
        nameRegex: "no-deleteing-hbr-ecs-server-backup-plan",
        status: "Running",
    });
    const ids = _default.then(_default => alicloud.hbr.getServerBackupPlans({
        filters: [{
            key: "instanceId",
            values: [_default.instances?.[0]?.id],
        }],
    }));
    export const hbrServerBackupPlanId1 = ids.then(ids => ids.plans?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ecs.get_instances(name_regex="no-deleteing-hbr-ecs-server-backup-plan",
        status="Running")
    ids = alicloud.hbr.get_server_backup_plans(filters=[alicloud.hbr.GetServerBackupPlansFilterArgs(
        key="instanceId",
        values=[default.instances[0].id],
    )])
    pulumi.export("hbrServerBackupPlanId1", ids.plans[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    _default, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
    NameRegex: pulumi.StringRef("no-deleteing-hbr-ecs-server-backup-plan"),
    Status: pulumi.StringRef("Running"),
    }, nil);
    if err != nil {
    return err
    }
    ids, err := hbr.GetServerBackupPlans(ctx, &hbr.GetServerBackupPlansArgs{
    Filters: []hbr.GetServerBackupPlansFilter{
    {
    Key: pulumi.StringRef("instanceId"),
    Values: interface{}{
    _default.Instances[0].Id,
    },
    },
    },
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("hbrServerBackupPlanId1", ids.Plans[0].Id)
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Ecs.GetInstances.Invoke(new()
        {
            NameRegex = "no-deleteing-hbr-ecs-server-backup-plan",
            Status = "Running",
        });
    
        var ids = AliCloud.Hbr.GetServerBackupPlans.Invoke(new()
        {
            Filters = new[]
            {
                new AliCloud.Hbr.Inputs.GetServerBackupPlansFilterInputArgs
                {
                    Key = "instanceId",
                    Values = new[]
                    {
                        @default.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["hbrServerBackupPlanId1"] = ids.Apply(getServerBackupPlansResult => getServerBackupPlansResult.Plans[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
    import com.pulumi.alicloud.hbr.HbrFunctions;
    import com.pulumi.alicloud.hbr.inputs.GetServerBackupPlansArgs;
    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 default = EcsFunctions.getInstances(GetInstancesArgs.builder()
                .nameRegex("no-deleteing-hbr-ecs-server-backup-plan")
                .status("Running")
                .build());
    
            final var ids = HbrFunctions.getServerBackupPlans(GetServerBackupPlansArgs.builder()
                .filters(GetServerBackupPlansFilterArgs.builder()
                    .key("instanceId")
                    .values(default_.instances()[0].id())
                    .build())
                .build());
    
            ctx.export("hbrServerBackupPlanId1", ids.applyValue(getServerBackupPlansResult -> getServerBackupPlansResult.plans()[0].id()));
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:ecs:getInstances
          Arguments:
            nameRegex: no-deleteing-hbr-ecs-server-backup-plan
            status: Running
      ids:
        fn::invoke:
          Function: alicloud:hbr:getServerBackupPlans
          Arguments:
            filters:
              - key: instanceId
                values:
                  - ${default.instances[0].id}
    outputs:
      hbrServerBackupPlanId1: ${ids.plans[0].id}
    

    Using getServerBackupPlans

    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 getServerBackupPlans(args: GetServerBackupPlansArgs, opts?: InvokeOptions): Promise<GetServerBackupPlansResult>
    function getServerBackupPlansOutput(args: GetServerBackupPlansOutputArgs, opts?: InvokeOptions): Output<GetServerBackupPlansResult>
    def get_server_backup_plans(filters: Optional[Sequence[GetServerBackupPlansFilter]] = None,
                                ids: Optional[Sequence[str]] = None,
                                output_file: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetServerBackupPlansResult
    def get_server_backup_plans_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetServerBackupPlansFilterArgs]]]] = None,
                                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                output_file: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetServerBackupPlansResult]
    func GetServerBackupPlans(ctx *Context, args *GetServerBackupPlansArgs, opts ...InvokeOption) (*GetServerBackupPlansResult, error)
    func GetServerBackupPlansOutput(ctx *Context, args *GetServerBackupPlansOutputArgs, opts ...InvokeOption) GetServerBackupPlansResultOutput

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

    public static class GetServerBackupPlans 
    {
        public static Task<GetServerBackupPlansResult> InvokeAsync(GetServerBackupPlansArgs args, InvokeOptions? opts = null)
        public static Output<GetServerBackupPlansResult> Invoke(GetServerBackupPlansInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerBackupPlansResult> getServerBackupPlans(GetServerBackupPlansArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:hbr/getServerBackupPlans:getServerBackupPlans
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<Pulumi.AliCloud.Hbr.Inputs.GetServerBackupPlansFilter>
    The filters.
    Ids List<string>
    A list of Server Backup Plan IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Filters []GetServerBackupPlansFilter
    The filters.
    Ids []string
    A list of Server Backup Plan IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    filters List<GetServerBackupPlansFilter>
    The filters.
    ids List<String>
    A list of Server Backup Plan IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    filters GetServerBackupPlansFilter[]
    The filters.
    ids string[]
    A list of Server Backup Plan IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    filters Sequence[GetServerBackupPlansFilter]
    The filters.
    ids Sequence[str]
    A list of Server Backup Plan IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    filters List<Property Map>
    The filters.
    ids List<String>
    A list of Server Backup Plan IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getServerBackupPlans Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Plans []GetServerBackupPlansPlan
    Filters []GetServerBackupPlansFilter
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    plans List<GetServerBackupPlansPlan>
    filters List<GetServerBackupPlansFilter>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    plans GetServerBackupPlansPlan[]
    filters GetServerBackupPlansFilter[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    plans Sequence[GetServerBackupPlansPlan]
    filters Sequence[GetServerBackupPlansFilter]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    plans List<Property Map>
    filters List<Property Map>
    outputFile String

    Supporting Types

    GetServerBackupPlansFilter

    Key string
    Values List<string>
    Key string
    Values []string
    key String
    values List<String>
    key string
    values string[]
    key str
    values Sequence[str]
    key String
    values List<String>

    GetServerBackupPlansPlan

    CreateTime string
    The creation time of backup plan.
    Details List<Pulumi.AliCloud.Hbr.Inputs.GetServerBackupPlansPlanDetail>
    ECS server backup plan details.
    Disabled bool
    Whether to disable the backup task. Valid values: true, false.
    EcsServerBackupPlanId string
    The ID of the server backup plan.
    EcsServerBackupPlanName string
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    Id string
    The ID of the server backup plan.
    InstanceId string
    The ID of ECS Instance.
    Retention string
    Backup retention days, the minimum is 1.
    Schedule string
    Backup strategy.
    CreateTime string
    The creation time of backup plan.
    Details []GetServerBackupPlansPlanDetail
    ECS server backup plan details.
    Disabled bool
    Whether to disable the backup task. Valid values: true, false.
    EcsServerBackupPlanId string
    The ID of the server backup plan.
    EcsServerBackupPlanName string
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    Id string
    The ID of the server backup plan.
    InstanceId string
    The ID of ECS Instance.
    Retention string
    Backup retention days, the minimum is 1.
    Schedule string
    Backup strategy.
    createTime String
    The creation time of backup plan.
    details List<GetServerBackupPlansPlanDetail>
    ECS server backup plan details.
    disabled Boolean
    Whether to disable the backup task. Valid values: true, false.
    ecsServerBackupPlanId String
    The ID of the server backup plan.
    ecsServerBackupPlanName String
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    id String
    The ID of the server backup plan.
    instanceId String
    The ID of ECS Instance.
    retention String
    Backup retention days, the minimum is 1.
    schedule String
    Backup strategy.
    createTime string
    The creation time of backup plan.
    details GetServerBackupPlansPlanDetail[]
    ECS server backup plan details.
    disabled boolean
    Whether to disable the backup task. Valid values: true, false.
    ecsServerBackupPlanId string
    The ID of the server backup plan.
    ecsServerBackupPlanName string
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    id string
    The ID of the server backup plan.
    instanceId string
    The ID of ECS Instance.
    retention string
    Backup retention days, the minimum is 1.
    schedule string
    Backup strategy.
    create_time str
    The creation time of backup plan.
    details Sequence[GetServerBackupPlansPlanDetail]
    ECS server backup plan details.
    disabled bool
    Whether to disable the backup task. Valid values: true, false.
    ecs_server_backup_plan_id str
    The ID of the server backup plan.
    ecs_server_backup_plan_name str
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    id str
    The ID of the server backup plan.
    instance_id str
    The ID of ECS Instance.
    retention str
    Backup retention days, the minimum is 1.
    schedule str
    Backup strategy.
    createTime String
    The creation time of backup plan.
    details List<Property Map>
    ECS server backup plan details.
    disabled Boolean
    Whether to disable the backup task. Valid values: true, false.
    ecsServerBackupPlanId String
    The ID of the server backup plan.
    ecsServerBackupPlanName String
    The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.
    id String
    The ID of the server backup plan.
    instanceId String
    The ID of ECS Instance.
    retention String
    Backup retention days, the minimum is 1.
    schedule String
    Backup strategy.

    GetServerBackupPlansPlanDetail

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi