Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.cloudstoragegateway.getGatewayCacheDisks
Explore with Pulumi AI
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)
public static Output<GetGatewayCacheDisksResult> getGatewayCacheDisks(GetGatewayCacheDisksArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:cloudstoragegateway/getGatewayCacheDisks:getGatewayCacheDisks
  arguments:
    # arguments dictionaryThe 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.Ali Cloud. Cloud Storage Gateway. Outputs. Get Gateway Cache Disks Disk> 
- GatewayId string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- OutputFile string
- Status int
- Disks
[]GetGateway Cache Disks Disk 
- GatewayId string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- OutputFile string
- Status int
- disks
List<GetGateway Cache Disks Disk> 
- gatewayId String
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- outputFile String
- status Integer
- disks
GetGateway Cache Disks Disk[] 
- gatewayId string
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- outputFile string
- status number
- disks
Sequence[GetGateway Cache Disks Disk] 
- 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    
- CacheDisk stringCategory 
- The category of eht cache disk.
- CacheDisk intSize In Gb 
- 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.
- LocalFile stringPath 
- The cache disk inside the device name.
- RenewUrl string
- A renewal link of the cache disk.
- Status int
- The status of the resource.
- CacheDisk stringCategory 
- The category of eht cache disk.
- CacheDisk intSize In Gb 
- 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.
- LocalFile stringPath 
- The cache disk inside the device name.
- RenewUrl string
- A renewal link of the cache disk.
- Status int
- The status of the resource.
- cacheDisk StringCategory 
- The category of eht cache disk.
- cacheDisk IntegerSize In Gb 
- 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.
- localFile StringPath 
- The cache disk inside the device name.
- renewUrl String
- A renewal link of the cache disk.
- status Integer
- The status of the resource.
- cacheDisk stringCategory 
- The category of eht cache disk.
- cacheDisk numberSize In Gb 
- 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.
- localFile stringPath 
- 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_ strcategory 
- The category of eht cache disk.
- cache_disk_ intsize_ in_ gb 
- 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_ strpath 
- The cache disk inside the device name.
- renew_url str
- A renewal link of the cache disk.
- status int
- The status of the resource.
- cacheDisk StringCategory 
- The category of eht cache disk.
- cacheDisk NumberSize In Gb 
- 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.
- localFile StringPath 
- 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 alicloudTerraform Provider.