1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. simpleapplicationserver
  5. getServerDisks
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.simpleapplicationserver.getServerDisks

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    This data source provides the Simple Application Server Disks of the current Alibaba Cloud user.

    NOTE: Available in v1.143.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.simpleapplicationserver.getServerDisks({
        ids: ["example_id"],
    });
    export const simpleApplicationServerDiskId1 = ids.then(ids => ids.disks?.[0]?.id);
    const nameRegex = alicloud.simpleapplicationserver.getServerDisks({
        nameRegex: "^my-Disk",
    });
    export const simpleApplicationServerDiskId2 = nameRegex.then(nameRegex => nameRegex.disks?.[0]?.id);
    const status = alicloud.simpleapplicationserver.getServerDisks({
        status: "In_use",
    });
    export const simpleApplicationServerDiskId3 = status.then(status => status.disks?.[0]?.id);
    const instanceId = alicloud.simpleapplicationserver.getServerDisks({
        instanceId: "example_value",
    });
    export const simpleApplicationServerDiskId4 = instanceId.then(instanceId => instanceId.disks?.[0]?.id);
    const diskType = alicloud.simpleapplicationserver.getServerDisks({
        diskType: "System",
    });
    export const simpleApplicationServerDiskId5 = diskType.then(diskType => diskType.disks?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.simpleapplicationserver.get_server_disks(ids=["example_id"])
    pulumi.export("simpleApplicationServerDiskId1", ids.disks[0].id)
    name_regex = alicloud.simpleapplicationserver.get_server_disks(name_regex="^my-Disk")
    pulumi.export("simpleApplicationServerDiskId2", name_regex.disks[0].id)
    status = alicloud.simpleapplicationserver.get_server_disks(status="In_use")
    pulumi.export("simpleApplicationServerDiskId3", status.disks[0].id)
    instance_id = alicloud.simpleapplicationserver.get_server_disks(instance_id="example_value")
    pulumi.export("simpleApplicationServerDiskId4", instance_id.disks[0].id)
    disk_type = alicloud.simpleapplicationserver.get_server_disks(disk_type="System")
    pulumi.export("simpleApplicationServerDiskId5", disk_type.disks[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerDiskId1", ids.Disks[0].Id)
    		nameRegex, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
    			NameRegex: pulumi.StringRef("^my-Disk"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerDiskId2", nameRegex.Disks[0].Id)
    		status, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
    			Status: pulumi.StringRef("In_use"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerDiskId3", status.Disks[0].Id)
    		instanceId, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
    			InstanceId: pulumi.StringRef("example_value"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerDiskId4", instanceId.Disks[0].Id)
    		diskType, err := simpleapplicationserver.GetServerDisks(ctx, &simpleapplicationserver.GetServerDisksArgs{
    			DiskType: pulumi.StringRef("System"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("simpleApplicationServerDiskId5", diskType.Disks[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
        {
            NameRegex = "^my-Disk",
        });
    
        var status = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
        {
            Status = "In_use",
        });
    
        var instanceId = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
        {
            InstanceId = "example_value",
        });
    
        var diskType = AliCloud.SimpleApplicationServer.GetServerDisks.Invoke(new()
        {
            DiskType = "System",
        });
    
        return new Dictionary<string, object?>
        {
            ["simpleApplicationServerDiskId1"] = ids.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
            ["simpleApplicationServerDiskId2"] = nameRegex.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
            ["simpleApplicationServerDiskId3"] = status.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
            ["simpleApplicationServerDiskId4"] = instanceId.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
            ["simpleApplicationServerDiskId5"] = diskType.Apply(getServerDisksResult => getServerDisksResult.Disks[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.simpleapplicationserver.SimpleapplicationserverFunctions;
    import com.pulumi.alicloud.simpleapplicationserver.inputs.GetServerDisksArgs;
    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 ids = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("simpleApplicationServerDiskId1", ids.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
            final var nameRegex = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
                .nameRegex("^my-Disk")
                .build());
    
            ctx.export("simpleApplicationServerDiskId2", nameRegex.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
            final var status = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
                .status("In_use")
                .build());
    
            ctx.export("simpleApplicationServerDiskId3", status.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
            final var instanceId = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
                .instanceId("example_value")
                .build());
    
            ctx.export("simpleApplicationServerDiskId4", instanceId.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
            final var diskType = SimpleapplicationserverFunctions.getServerDisks(GetServerDisksArgs.builder()
                .diskType("System")
                .build());
    
            ctx.export("simpleApplicationServerDiskId5", diskType.applyValue(getServerDisksResult -> getServerDisksResult.disks()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerDisks
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerDisks
          Arguments:
            nameRegex: ^my-Disk
      status:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerDisks
          Arguments:
            status: In_use
      instanceId:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerDisks
          Arguments:
            instanceId: example_value
      diskType:
        fn::invoke:
          Function: alicloud:simpleapplicationserver:getServerDisks
          Arguments:
            diskType: System
    outputs:
      simpleApplicationServerDiskId1: ${ids.disks[0].id}
      simpleApplicationServerDiskId2: ${nameRegex.disks[0].id}
      simpleApplicationServerDiskId3: ${status.disks[0].id}
      simpleApplicationServerDiskId4: ${instanceId.disks[0].id}
      simpleApplicationServerDiskId5: ${diskType.disks[0].id}
    

    Using getServerDisks

    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 getServerDisks(args: GetServerDisksArgs, opts?: InvokeOptions): Promise<GetServerDisksResult>
    function getServerDisksOutput(args: GetServerDisksOutputArgs, opts?: InvokeOptions): Output<GetServerDisksResult>
    def get_server_disks(disk_type: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         instance_id: Optional[str] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         status: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetServerDisksResult
    def get_server_disks_output(disk_type: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         instance_id: Optional[pulumi.Input[str]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         status: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetServerDisksResult]
    func GetServerDisks(ctx *Context, args *GetServerDisksArgs, opts ...InvokeOption) (*GetServerDisksResult, error)
    func GetServerDisksOutput(ctx *Context, args *GetServerDisksOutputArgs, opts ...InvokeOption) GetServerDisksResultOutput

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

    public static class GetServerDisks 
    {
        public static Task<GetServerDisksResult> InvokeAsync(GetServerDisksArgs args, InvokeOptions? opts = null)
        public static Output<GetServerDisksResult> Invoke(GetServerDisksInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServerDisksResult> getServerDisks(GetServerDisksArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:simpleapplicationserver/getServerDisks:getServerDisks
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DiskType string
    The type of the disk. Possible values: System, Data.
    Ids List<string>
    A list of Disk IDs.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    NameRegex string
    A regex string to filter results by Disk name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    DiskType string
    The type of the disk. Possible values: System, Data.
    Ids []string
    A list of Disk IDs.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    NameRegex string
    A regex string to filter results by Disk name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    diskType String
    The type of the disk. Possible values: System, Data.
    ids List<String>
    A list of Disk IDs.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    nameRegex String
    A regex string to filter results by Disk name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    diskType string
    The type of the disk. Possible values: System, Data.
    ids string[]
    A list of Disk IDs.
    instanceId string
    Alibaba Cloud simple application server instance ID.
    nameRegex string
    A regex string to filter results by Disk name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    disk_type str
    The type of the disk. Possible values: System, Data.
    ids Sequence[str]
    A list of Disk IDs.
    instance_id str
    Alibaba Cloud simple application server instance ID.
    name_regex str
    A regex string to filter results by Disk name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    diskType String
    The type of the disk. Possible values: System, Data.
    ids List<String>
    A list of Disk IDs.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    nameRegex String
    A regex string to filter results by Disk name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.

    getServerDisks Result

    The following output properties are available:

    Disks List<Pulumi.AliCloud.SimpleApplicationServer.Outputs.GetServerDisksDisk>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    DiskType string
    InstanceId string
    NameRegex string
    OutputFile string
    Status string
    Disks []GetServerDisksDisk
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    DiskType string
    InstanceId string
    NameRegex string
    OutputFile string
    Status string
    disks List<GetServerDisksDisk>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    diskType String
    instanceId String
    nameRegex String
    outputFile String
    status String
    disks GetServerDisksDisk[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    diskType string
    instanceId string
    nameRegex string
    outputFile string
    status string
    disks Sequence[GetServerDisksDisk]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    disk_type str
    instance_id str
    name_regex str
    output_file str
    status str
    disks List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    diskType String
    instanceId String
    nameRegex String
    outputFile String
    status String

    Supporting Types

    GetServerDisksDisk

    Category string
    Disk type. Possible values: ESSD, SSD.
    CreateTime string
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    Device string
    The device name of the disk on the simple application server.
    DiskId string
    The first ID of the resource.
    DiskName string
    The name of the resource.
    DiskType string
    The type of the disk. Possible values: System, Data.
    Id string
    The ID of the Disk.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    PaymentType string
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    Size int
    The size of the disk. Unit: GB.
    Status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    Category string
    Disk type. Possible values: ESSD, SSD.
    CreateTime string
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    Device string
    The device name of the disk on the simple application server.
    DiskId string
    The first ID of the resource.
    DiskName string
    The name of the resource.
    DiskType string
    The type of the disk. Possible values: System, Data.
    Id string
    The ID of the Disk.
    InstanceId string
    Alibaba Cloud simple application server instance ID.
    PaymentType string
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    Size int
    The size of the disk. Unit: GB.
    Status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    category String
    Disk type. Possible values: ESSD, SSD.
    createTime String
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    device String
    The device name of the disk on the simple application server.
    diskId String
    The first ID of the resource.
    diskName String
    The name of the resource.
    diskType String
    The type of the disk. Possible values: System, Data.
    id String
    The ID of the Disk.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    paymentType String
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    size Integer
    The size of the disk. Unit: GB.
    status String
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    category string
    Disk type. Possible values: ESSD, SSD.
    createTime string
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    device string
    The device name of the disk on the simple application server.
    diskId string
    The first ID of the resource.
    diskName string
    The name of the resource.
    diskType string
    The type of the disk. Possible values: System, Data.
    id string
    The ID of the Disk.
    instanceId string
    Alibaba Cloud simple application server instance ID.
    paymentType string
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    size number
    The size of the disk. Unit: GB.
    status string
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    category str
    Disk type. Possible values: ESSD, SSD.
    create_time str
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    device str
    The device name of the disk on the simple application server.
    disk_id str
    The first ID of the resource.
    disk_name str
    The name of the resource.
    disk_type str
    The type of the disk. Possible values: System, Data.
    id str
    The ID of the Disk.
    instance_id str
    Alibaba Cloud simple application server instance ID.
    payment_type str
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    size int
    The size of the disk. Unit: GB.
    status str
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.
    category String
    Disk type. Possible values: ESSD, SSD.
    createTime String
    The time when the disk was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
    device String
    The device name of the disk on the simple application server.
    diskId String
    The first ID of the resource.
    diskName String
    The name of the resource.
    diskType String
    The type of the disk. Possible values: System, Data.
    id String
    The ID of the Disk.
    instanceId String
    Alibaba Cloud simple application server instance ID.
    paymentType String
    The payment type of the resource. Valid values: PayAsYouGo, Subscription.
    size Number
    The size of the disk. Unit: GB.
    status String
    The status of the disk. Valid values: ReIniting, Creating, In_Use, Available, Attaching, Detaching.

    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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi