Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getStocks

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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var @default = Output.Create(AliCloud.CloudStorageGateway.GetStocks.InvokeAsync(new AliCloud.CloudStorageGateway.GetStocksArgs
        {
            GatewayClass = "Advanced",
        }));
        this.ZoneId = @default.Apply(@default => @default.Stocks?[0]?.ZoneId);
    }

    [Output("zoneId")]
    public Output<string> ZoneId { get; set; }
}
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
	})
}
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());
    }
}
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.cloudstoragegateway.get_stocks(gateway_class="Advanced")
pulumi.export("zoneId", default.stocks[0].zone_id)
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);
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
GatewayClass string

The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.

OutputFile string
gatewayClass String

The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.

outputFile String
gatewayClass string

The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.

outputFile string
gateway_class str

The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.

output_file str
gatewayClass String

The gateway class. Valid values: Basic, Standard,Enhanced,Advanced.

outputFile String

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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.