Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.cloudstoragegateway.getStocks
Explore with Pulumi AI
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:
- Gateway
Class string - The gateway class. Valid values:
Basic
,Standard
,Enhanced
,Advanced
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- Gateway
Class string - The gateway class. Valid values:
Basic
,Standard
,Enhanced
,Advanced
. - Output
File string - File name where to save data source results (after running
pulumi preview
).
- gateway
Class String - The gateway class. Valid values:
Basic
,Standard
,Enhanced
,Advanced
. - output
File String - File name where to save data source results (after running
pulumi preview
).
- gateway
Class string - The gateway class. Valid values:
Basic
,Standard
,Enhanced
,Advanced
. - output
File 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
).
- gateway
Class String - The gateway class. Valid values:
Basic
,Standard
,Enhanced
,Advanced
. - output
File 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.
Ali Cloud. Cloud Storage Gateway. Outputs. Get Stocks Stock> - Gateway
Class string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Stocks
[]Get
Stocks Stock - Gateway
Class string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- stocks
List<Get
Stocks Stock> - gateway
Class String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- stocks
Get
Stocks Stock[] - gateway
Class string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- stocks
Sequence[Get
Stocks Stock] - gateway_
class str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- stocks List<Property Map>
- gateway
Class String - output
File String
Supporting Types
GetStocksStock
- Available
Gateway List<string>Classes - A list of available gateway class in this Zone ID.
- Zone
Id string - The Zone ID.
- Available
Gateway []stringClasses - A list of available gateway class in this Zone ID.
- Zone
Id string - The Zone ID.
- available
Gateway List<String>Classes - A list of available gateway class in this Zone ID.
- zone
Id String - The Zone ID.
- available
Gateway string[]Classes - A list of available gateway class in this Zone ID.
- zone
Id string - The Zone ID.
- available_
gateway_ Sequence[str]classes - A list of available gateway class in this Zone ID.
- zone_
id str - The Zone ID.
- available
Gateway List<String>Classes - A list of available gateway class in this Zone ID.
- zone
Id 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.