Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi
alicloud.hbr.getServerBackupPlans
Explore with Pulumi AI
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.
Ali Cloud. Hbr. Inputs. Get Server Backup Plans Filter> - The filters.
- Ids List<string>
- A list of Server Backup Plan IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Filters
[]Get
Server Backup Plans Filter - The filters.
- Ids []string
- A list of Server Backup Plan IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- filters
List<Get
Server Backup Plans Filter> - The filters.
- ids List<String>
- A list of Server Backup Plan IDs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- filters
Get
Server Backup Plans Filter[] - The filters.
- ids string[]
- A list of Server Backup Plan IDs.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- filters
Sequence[Get
Server Backup Plans Filter] - 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.
- output
File 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 List<string>
- Plans
List<Pulumi.
Ali Cloud. Hbr. Outputs. Get Server Backup Plans Plan> - Filters
List<Pulumi.
Ali Cloud. Hbr. Outputs. Get Server Backup Plans Filter> - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Plans
[]Get
Server Backup Plans Plan - Filters
[]Get
Server Backup Plans Filter - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- plans
List<Get
Server Backup Plans Plan> - filters
List<Get
Server Backup Plans Filter> - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- plans
Get
Server Backup Plans Plan[] - filters
Get
Server Backup Plans Filter[] - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- plans
Sequence[Get
Server Backup Plans Plan] - filters
Sequence[Get
Server Backup Plans Filter] - 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>
- output
File String
Supporting Types
GetServerBackupPlansFilter
GetServerBackupPlansPlan
- Create
Time string - The creation time of backup plan.
- Details
List<Pulumi.
Ali Cloud. Hbr. Inputs. Get Server Backup Plans Plan Detail> - ECS server backup plan details.
- Disabled bool
- Whether to disable the backup task. Valid values:
true
,false
. - Ecs
Server stringBackup Plan Id - The ID of the server backup plan.
- Ecs
Server stringBackup Plan Name - 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.
- Instance
Id string - The ID of ECS Instance.
- Retention string
- Backup retention days, the minimum is 1.
- Schedule string
- Backup strategy.
- Create
Time string - The creation time of backup plan.
- Details
[]Get
Server Backup Plans Plan Detail - ECS server backup plan details.
- Disabled bool
- Whether to disable the backup task. Valid values:
true
,false
. - Ecs
Server stringBackup Plan Id - The ID of the server backup plan.
- Ecs
Server stringBackup Plan Name - 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.
- Instance
Id string - The ID of ECS Instance.
- Retention string
- Backup retention days, the minimum is 1.
- Schedule string
- Backup strategy.
- create
Time String - The creation time of backup plan.
- details
List<Get
Server Backup Plans Plan Detail> - ECS server backup plan details.
- disabled Boolean
- Whether to disable the backup task. Valid values:
true
,false
. - ecs
Server StringBackup Plan Id - The ID of the server backup plan.
- ecs
Server StringBackup Plan Name - 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.
- instance
Id String - The ID of ECS Instance.
- retention String
- Backup retention days, the minimum is 1.
- schedule String
- Backup strategy.
- create
Time string - The creation time of backup plan.
- details
Get
Server Backup Plans Plan Detail[] - ECS server backup plan details.
- disabled boolean
- Whether to disable the backup task. Valid values:
true
,false
. - ecs
Server stringBackup Plan Id - The ID of the server backup plan.
- ecs
Server stringBackup Plan Name - 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.
- instance
Id 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[Get
Server Backup Plans Plan Detail] - ECS server backup plan details.
- disabled bool
- Whether to disable the backup task. Valid values:
true
,false
. - ecs_
server_ strbackup_ plan_ id - The ID of the server backup plan.
- ecs_
server_ strbackup_ plan_ name - 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.
- create
Time 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
. - ecs
Server StringBackup Plan Id - The ID of the server backup plan.
- ecs
Server StringBackup Plan Name - 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.
- instance
Id String - The ID of ECS Instance.
- retention String
- Backup retention days, the minimum is 1.
- schedule String
- Backup strategy.
GetServerBackupPlansPlanDetail
- App
Consistent bool - Destination
Region stringId - Destination
Retention int - Disk
Id List<string>Lists - Do
Copy bool - Enable
Fs boolFreeze - Post
Script stringPath - Pre
Script stringPath - Snapshot
Group bool - Timeout
In intSeconds
- App
Consistent bool - Destination
Region stringId - Destination
Retention int - Disk
Id []stringLists - Do
Copy bool - Enable
Fs boolFreeze - Post
Script stringPath - Pre
Script stringPath - Snapshot
Group bool - Timeout
In intSeconds
- app
Consistent Boolean - destination
Region StringId - destination
Retention Integer - disk
Id List<String>Lists - do
Copy Boolean - enable
Fs BooleanFreeze - post
Script StringPath - pre
Script StringPath - snapshot
Group Boolean - timeout
In IntegerSeconds
- app
Consistent boolean - destination
Region stringId - destination
Retention number - disk
Id string[]Lists - do
Copy boolean - enable
Fs booleanFreeze - post
Script stringPath - pre
Script stringPath - snapshot
Group boolean - timeout
In numberSeconds
- app_
consistent bool - destination_
region_ strid - destination_
retention int - disk_
id_ Sequence[str]lists - do_
copy bool - enable_
fs_ boolfreeze - post_
script_ strpath - pre_
script_ strpath - snapshot_
group bool - timeout_
in_ intseconds
- app
Consistent Boolean - destination
Region StringId - destination
Retention Number - disk
Id List<String>Lists - do
Copy Boolean - enable
Fs BooleanFreeze - post
Script StringPath - pre
Script StringPath - snapshot
Group Boolean - timeout
In NumberSeconds
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.