1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cloudstoragegateway
  5. getStocks
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cloudstoragegateway.getStocks

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Cloud Storage Gateway Stocks 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 default = alicloud.cloudstoragegateway.getStocks({
        gatewayClass: "Advanced",
    });
    export const zoneId = _default.then(_default => _default.stocks?.[0]?.zoneId);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.cloudstoragegateway.get_stocks(gateway_class="Advanced")
    pulumi.export("zoneId", default.stocks[0].zone_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 {
    		_default, err := cloudstoragegateway.GetStocks(ctx, &cloudstoragegateway.GetStocksArgs{
    			GatewayClass: pulumi.StringRef("Advanced"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("zoneId", _default.Stocks[0].ZoneId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.CloudStorageGateway.GetStocks.Invoke(new()
        {
            GatewayClass = "Advanced",
        });
    
        return new Dictionary<string, object?>
        {
            ["zoneId"] = @default.Apply(@default => @default.Apply(getStocksResult => getStocksResult.Stocks[0]?.ZoneId)),
        };
    });
    
    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.GetStocksArgs;
    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 = CloudstoragegatewayFunctions.getStocks(GetStocksArgs.builder()
                .gatewayClass("Advanced")
                .build());
    
            ctx.export("zoneId", default_.stocks()[0].zoneId());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getStocks
          Arguments:
            gatewayClass: Advanced
    outputs:
      zoneId: ${default.stocks[0].zoneId}
    

    Using getStocks

    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 getStocks(args: GetStocksArgs, opts?: InvokeOptions): Promise<GetStocksResult>
    function getStocksOutput(args: GetStocksOutputArgs, opts?: InvokeOptions): Output<GetStocksResult>
    def get_stocks(gateway_class: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetStocksResult
    def get_stocks_output(gateway_class: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetStocksResult]
    func GetStocks(ctx *Context, args *GetStocksArgs, opts ...InvokeOption) (*GetStocksResult, error)
    func GetStocksOutput(ctx *Context, args *GetStocksOutputArgs, opts ...InvokeOption) GetStocksResultOutput

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

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

    The following arguments are supported:

    GatewayClass string
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    GatewayClass string
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    gatewayClass String
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    gatewayClass string
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    gateway_class str
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    output_file str
    File name where to save data source results (after running pulumi preview).
    gatewayClass String
    The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getStocks Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Stocks List<Pulumi.AliCloud.CloudStorageGateway.Outputs.GetStocksStock>
    GatewayClass string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Stocks []GetStocksStock
    GatewayClass string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    stocks List<GetStocksStock>
    gatewayClass String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    stocks GetStocksStock[]
    gatewayClass string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    stocks Sequence[GetStocksStock]
    gateway_class str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    stocks List<Property Map>
    gatewayClass String
    outputFile String

    Supporting Types

    GetStocksStock

    AvailableGatewayClasses List<string>
    A list of available gateway class in this Zone ID.
    ZoneId string
    The Zone ID.
    AvailableGatewayClasses []string
    A list of available gateway class in this Zone ID.
    ZoneId string
    The Zone ID.
    availableGatewayClasses List<String>
    A list of available gateway class in this Zone ID.
    zoneId String
    The Zone ID.
    availableGatewayClasses string[]
    A list of available gateway class in this Zone ID.
    zoneId string
    The Zone ID.
    available_gateway_classes Sequence[str]
    A list of available gateway class in this Zone ID.
    zone_id str
    The Zone ID.
    availableGatewayClasses List<String>
    A list of available gateway class in this Zone ID.
    zoneId String
    The Zone ID.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi