1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cloudstoragegateway
  5. getGatewayCacheDisks
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cloudstoragegateway.getGatewayCacheDisks

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Cloud Storage Gateway Gateway Cache Disks of the current Alibaba Cloud user.

    NOTE: Available in v1.144.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.cloudstoragegateway.getGatewayCacheDisks({
        gatewayId: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
    });
    export const cloudStorageGatewayGatewayCacheDiskId1 = ids.then(ids => ids.disks?.[0]?.id);
    const status = alicloud.cloudstoragegateway.getGatewayCacheDisks({
        gatewayId: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
        status: 0,
    });
    export const cloudStorageGatewayGatewayCacheDiskId2 = status.then(status => status.disks?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.cloudstoragegateway.get_gateway_cache_disks(gateway_id="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ])
    pulumi.export("cloudStorageGatewayGatewayCacheDiskId1", ids.disks[0].id)
    status = alicloud.cloudstoragegateway.get_gateway_cache_disks(gateway_id="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ],
        status=0)
    pulumi.export("cloudStorageGatewayGatewayCacheDiskId2", status.disks[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudstoragegateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := cloudstoragegateway.GetGatewayCacheDisks(ctx, &cloudstoragegateway.GetGatewayCacheDisksArgs{
    			GatewayId: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cloudStorageGatewayGatewayCacheDiskId1", ids.Disks[0].Id)
    		status, err := cloudstoragegateway.GetGatewayCacheDisks(ctx, &cloudstoragegateway.GetGatewayCacheDisksArgs{
    			GatewayId: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    			Status: pulumi.IntRef(0),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cloudStorageGatewayGatewayCacheDiskId2", status.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.CloudStorageGateway.GetGatewayCacheDisks.Invoke(new()
        {
            GatewayId = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
        });
    
        var status = AliCloud.CloudStorageGateway.GetGatewayCacheDisks.Invoke(new()
        {
            GatewayId = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
            Status = 0,
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudStorageGatewayGatewayCacheDiskId1"] = ids.Apply(getGatewayCacheDisksResult => getGatewayCacheDisksResult.Disks[0]?.Id),
            ["cloudStorageGatewayGatewayCacheDiskId2"] = status.Apply(getGatewayCacheDisksResult => getGatewayCacheDisksResult.Disks[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cloudstoragegateway.CloudstoragegatewayFunctions;
    import com.pulumi.alicloud.cloudstoragegateway.inputs.GetGatewayCacheDisksArgs;
    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 = CloudstoragegatewayFunctions.getGatewayCacheDisks(GetGatewayCacheDisksArgs.builder()
                .gatewayId("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .build());
    
            ctx.export("cloudStorageGatewayGatewayCacheDiskId1", ids.applyValue(getGatewayCacheDisksResult -> getGatewayCacheDisksResult.disks()[0].id()));
            final var status = CloudstoragegatewayFunctions.getGatewayCacheDisks(GetGatewayCacheDisksArgs.builder()
                .gatewayId("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .status("0")
                .build());
    
            ctx.export("cloudStorageGatewayGatewayCacheDiskId2", status.applyValue(getGatewayCacheDisksResult -> getGatewayCacheDisksResult.disks()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getGatewayCacheDisks
          Arguments:
            gatewayId: example_value
            ids:
              - example_value-1
              - example_value-2
      status:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getGatewayCacheDisks
          Arguments:
            gatewayId: example_value
            ids:
              - example_value-1
              - example_value-2
            status: '0'
    outputs:
      cloudStorageGatewayGatewayCacheDiskId1: ${ids.disks[0].id}
      cloudStorageGatewayGatewayCacheDiskId2: ${status.disks[0].id}
    

    Using getGatewayCacheDisks

    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 getGatewayCacheDisks(args: GetGatewayCacheDisksArgs, opts?: InvokeOptions): Promise<GetGatewayCacheDisksResult>
    function getGatewayCacheDisksOutput(args: GetGatewayCacheDisksOutputArgs, opts?: InvokeOptions): Output<GetGatewayCacheDisksResult>
    def get_gateway_cache_disks(gateway_id: Optional[str] = None,
                                ids: Optional[Sequence[str]] = None,
                                output_file: Optional[str] = None,
                                status: Optional[int] = None,
                                opts: Optional[InvokeOptions] = None) -> GetGatewayCacheDisksResult
    def get_gateway_cache_disks_output(gateway_id: Optional[pulumi.Input[str]] = None,
                                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                output_file: Optional[pulumi.Input[str]] = None,
                                status: Optional[pulumi.Input[int]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetGatewayCacheDisksResult]
    func GetGatewayCacheDisks(ctx *Context, args *GetGatewayCacheDisksArgs, opts ...InvokeOption) (*GetGatewayCacheDisksResult, error)
    func GetGatewayCacheDisksOutput(ctx *Context, args *GetGatewayCacheDisksOutputArgs, opts ...InvokeOption) GetGatewayCacheDisksResultOutput

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

    public static class GetGatewayCacheDisks 
    {
        public static Task<GetGatewayCacheDisksResult> InvokeAsync(GetGatewayCacheDisksArgs args, InvokeOptions? opts = null)
        public static Output<GetGatewayCacheDisksResult> Invoke(GetGatewayCacheDisksInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGatewayCacheDisksResult> getGatewayCacheDisks(GetGatewayCacheDisksArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cloudstoragegateway/getGatewayCacheDisks:getGatewayCacheDisks
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GatewayId string
    The ID of the gateway.
    Ids List<string>
    A list of Gateway Cache Disk IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.
    GatewayId string
    The ID of the gateway.
    Ids []string
    A list of Gateway Cache Disk IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.
    gatewayId String
    The ID of the gateway.
    ids List<String>
    A list of Gateway Cache Disk IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Integer
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.
    gatewayId string
    The ID of the gateway.
    ids string[]
    A list of Gateway Cache Disk IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status number
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.
    gateway_id str
    The ID of the gateway.
    ids Sequence[str]
    A list of Gateway Cache Disk IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status int
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.
    gatewayId String
    The ID of the gateway.
    ids List<String>
    A list of Gateway Cache Disk IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Number
    The status of the resource. Valid values: 0, 1, 2. 0: Normal. 1: Is about to expire. 2: Has expired.

    getGatewayCacheDisks Result

    The following output properties are available:

    Disks List<Pulumi.AliCloud.CloudStorageGateway.Outputs.GetGatewayCacheDisksDisk>
    GatewayId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    OutputFile string
    Status int
    Disks []GetGatewayCacheDisksDisk
    GatewayId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    OutputFile string
    Status int
    disks List<GetGatewayCacheDisksDisk>
    gatewayId String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    outputFile String
    status Integer
    disks GetGatewayCacheDisksDisk[]
    gatewayId string
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    outputFile string
    status number
    disks Sequence[GetGatewayCacheDisksDisk]
    gateway_id str
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    output_file str
    status int
    disks List<Property Map>
    gatewayId String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    outputFile String
    status Number

    Supporting Types

    GetGatewayCacheDisksDisk

    CacheDiskCategory string
    The category of eht cache disk.
    CacheDiskSizeInGb int
    The size of the cache disk.
    CacheId string
    The ID of the cache disk.
    ExpiredTime int
    The expiration time. Time stamp in seconds (s).
    GatewayId string
    The ID of the gateway.
    Id string
    The ID of the Gateway Cache Disk.
    Iops int
    Per second of the input output.
    IsUsed bool
    Whether it is used.
    LocalFilePath string
    The cache disk inside the device name.
    RenewUrl string
    A renewal link of the cache disk.
    Status int
    The status of the resource.
    CacheDiskCategory string
    The category of eht cache disk.
    CacheDiskSizeInGb int
    The size of the cache disk.
    CacheId string
    The ID of the cache disk.
    ExpiredTime int
    The expiration time. Time stamp in seconds (s).
    GatewayId string
    The ID of the gateway.
    Id string
    The ID of the Gateway Cache Disk.
    Iops int
    Per second of the input output.
    IsUsed bool
    Whether it is used.
    LocalFilePath string
    The cache disk inside the device name.
    RenewUrl string
    A renewal link of the cache disk.
    Status int
    The status of the resource.
    cacheDiskCategory String
    The category of eht cache disk.
    cacheDiskSizeInGb Integer
    The size of the cache disk.
    cacheId String
    The ID of the cache disk.
    expiredTime Integer
    The expiration time. Time stamp in seconds (s).
    gatewayId String
    The ID of the gateway.
    id String
    The ID of the Gateway Cache Disk.
    iops Integer
    Per second of the input output.
    isUsed Boolean
    Whether it is used.
    localFilePath String
    The cache disk inside the device name.
    renewUrl String
    A renewal link of the cache disk.
    status Integer
    The status of the resource.
    cacheDiskCategory string
    The category of eht cache disk.
    cacheDiskSizeInGb number
    The size of the cache disk.
    cacheId string
    The ID of the cache disk.
    expiredTime number
    The expiration time. Time stamp in seconds (s).
    gatewayId string
    The ID of the gateway.
    id string
    The ID of the Gateway Cache Disk.
    iops number
    Per second of the input output.
    isUsed boolean
    Whether it is used.
    localFilePath string
    The cache disk inside the device name.
    renewUrl string
    A renewal link of the cache disk.
    status number
    The status of the resource.
    cache_disk_category str
    The category of eht cache disk.
    cache_disk_size_in_gb int
    The size of the cache disk.
    cache_id str
    The ID of the cache disk.
    expired_time int
    The expiration time. Time stamp in seconds (s).
    gateway_id str
    The ID of the gateway.
    id str
    The ID of the Gateway Cache Disk.
    iops int
    Per second of the input output.
    is_used bool
    Whether it is used.
    local_file_path str
    The cache disk inside the device name.
    renew_url str
    A renewal link of the cache disk.
    status int
    The status of the resource.
    cacheDiskCategory String
    The category of eht cache disk.
    cacheDiskSizeInGb Number
    The size of the cache disk.
    cacheId String
    The ID of the cache disk.
    expiredTime Number
    The expiration time. Time stamp in seconds (s).
    gatewayId String
    The ID of the gateway.
    id String
    The ID of the Gateway Cache Disk.
    iops Number
    Per second of the input output.
    isUsed Boolean
    Whether it is used.
    localFilePath String
    The cache disk inside the device name.
    renewUrl String
    A renewal link of the cache disk.
    status Number
    The status of the resource.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi