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

alicloud.cloudstoragegateway.getGateways

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 Gateways of the current Alibaba Cloud user.

    NOTE: Available in v1.132.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.cloudstoragegateway.StorageBundle("example", {storageBundleName: "example_value"});
    const nameRegex = alicloud.cloudstoragegateway.getGatewaysOutput({
        storageBundleId: example.id,
        nameRegex: "^my-Gateway",
    });
    export const cloudStorageGatewayGatewayId = nameRegex.apply(nameRegex => nameRegex.gateways?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cloudstoragegateway.StorageBundle("example", storage_bundle_name="example_value")
    name_regex = alicloud.cloudstoragegateway.get_gateways_output(storage_bundle_id=example.id,
        name_regex="^my-Gateway")
    pulumi.export("cloudStorageGatewayGatewayId", name_regex.gateways[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 {
    		example, err := cloudstoragegateway.NewStorageBundle(ctx, "example", &cloudstoragegateway.StorageBundleArgs{
    			StorageBundleName: pulumi.String("example_value"),
    		})
    		if err != nil {
    			return err
    		}
    		nameRegex := cloudstoragegateway.GetGatewaysOutput(ctx, cloudstoragegateway.GetGatewaysOutputArgs{
    			StorageBundleId: example.ID(),
    			NameRegex:       pulumi.String("^my-Gateway"),
    		}, nil)
    		ctx.Export("cloudStorageGatewayGatewayId", nameRegex.ApplyT(func(nameRegex cloudstoragegateway.GetGatewaysResult) (*string, error) {
    			return &nameRegex.Gateways[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        {
            StorageBundleName = "example_value",
        });
    
        var nameRegex = AliCloud.CloudStorageGateway.GetGateways.Invoke(new()
        {
            StorageBundleId = example.Id,
            NameRegex = "^my-Gateway",
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudStorageGatewayGatewayId"] = nameRegex.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cloudstoragegateway.StorageBundle;
    import com.pulumi.alicloud.cloudstoragegateway.StorageBundleArgs;
    import com.pulumi.alicloud.cloudstoragegateway.CloudstoragegatewayFunctions;
    import com.pulumi.alicloud.cloudstoragegateway.inputs.GetGatewaysArgs;
    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) {
            var example = new StorageBundle("example", StorageBundleArgs.builder()
                .storageBundleName("example_value")
                .build());
    
            final var nameRegex = CloudstoragegatewayFunctions.getGateways(GetGatewaysArgs.builder()
                .storageBundleId(example.id())
                .nameRegex("^my-Gateway")
                .build());
    
            ctx.export("cloudStorageGatewayGatewayId", nameRegex.applyValue(getGatewaysResult -> getGatewaysResult).applyValue(nameRegex -> nameRegex.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id())));
        }
    }
    
    resources:
      example:
        type: alicloud:cloudstoragegateway:StorageBundle
        properties:
          storageBundleName: example_value
    variables:
      nameRegex:
        fn::invoke:
          Function: alicloud:cloudstoragegateway:getGateways
          Arguments:
            storageBundleId: ${example.id}
            nameRegex: ^my-Gateway
    outputs:
      cloudStorageGatewayGatewayId: ${nameRegex.gateways[0].id}
    

    Using getGateways

    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 getGateways(args: GetGatewaysArgs, opts?: InvokeOptions): Promise<GetGatewaysResult>
    function getGatewaysOutput(args: GetGatewaysOutputArgs, opts?: InvokeOptions): Output<GetGatewaysResult>
    def get_gateways(ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     page_number: Optional[int] = None,
                     page_size: Optional[int] = None,
                     status: Optional[str] = None,
                     storage_bundle_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetGatewaysResult
    def get_gateways_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     page_number: Optional[pulumi.Input[int]] = None,
                     page_size: Optional[pulumi.Input[int]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     storage_bundle_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetGatewaysResult]
    func GetGateways(ctx *Context, args *GetGatewaysArgs, opts ...InvokeOption) (*GetGatewaysResult, error)
    func GetGatewaysOutput(ctx *Context, args *GetGatewaysOutputArgs, opts ...InvokeOption) GetGatewaysResultOutput

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

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

    The following arguments are supported:

    StorageBundleId string
    storage bundle id.
    Ids List<string>
    A list of Gateway IDs.
    NameRegex string
    A regex string to filter results by Gateway name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Status string
    gateway status.
    StorageBundleId string
    storage bundle id.
    Ids []string
    A list of Gateway IDs.
    NameRegex string
    A regex string to filter results by Gateway name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Status string
    gateway status.
    storageBundleId String
    storage bundle id.
    ids List<String>
    A list of Gateway IDs.
    nameRegex String
    A regex string to filter results by Gateway name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    status String
    gateway status.
    storageBundleId string
    storage bundle id.
    ids string[]
    A list of Gateway IDs.
    nameRegex string
    A regex string to filter results by Gateway name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    status string
    gateway status.
    storage_bundle_id str
    storage bundle id.
    ids Sequence[str]
    A list of Gateway IDs.
    name_regex str
    A regex string to filter results by Gateway name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    status str
    gateway status.
    storageBundleId String
    storage bundle id.
    ids List<String>
    A list of Gateway IDs.
    nameRegex String
    A regex string to filter results by Gateway name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    status String
    gateway status.

    getGateways Result

    The following output properties are available:

    Gateways List<Pulumi.AliCloud.CloudStorageGateway.Outputs.GetGatewaysGateway>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    StorageBundleId string
    TotalCount int
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    Status string
    Gateways []GetGatewaysGateway
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    StorageBundleId string
    TotalCount int
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    Status string
    gateways List<GetGatewaysGateway>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    storageBundleId String
    totalCount Integer
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    status String
    gateways GetGatewaysGateway[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    storageBundleId string
    totalCount number
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    status string
    gateways Sequence[GetGatewaysGateway]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    storage_bundle_id str
    total_count int
    name_regex str
    output_file str
    page_number int
    page_size int
    status str
    gateways List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    storageBundleId String
    totalCount Number
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    status String

    Supporting Types

    GetGatewaysGateway

    ActivatedTime string
    gateway .
    BuyUrl string
    Category string
    gateway category.
    CreateTime string
    gateway created timestamp in second format.
    Description string
    gateway description.
    EcsInstanceId string
    gateway ecs instance id.
    ExpireStatus int
    gateway expiration status.
    ExpiredTime string
    gateway expiration timestamp in second format.
    GatewayClass string
    gateway class.
    GatewayId string
    gateway id.
    GatewayName string
    gateway name.
    GatewayVersion string
    gateway version.
    Id string
    The ID of the Gateway.
    InnerIp string
    gateway service ip.
    Ip string
    gateway public ip.
    IsReleaseAfterExpiration bool
    whether subscription gateway is released after expiration or not.
    Location string
    gateway location.
    PaymentType string
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    PublicNetworkBandwidth int
    gateway public network bandwidth.
    RenewUrl string
    Status string
    gateway status.
    StorageBundleId string
    storage bundle id.
    TaskId string
    gateway task id.
    Type string
    gateway type.
    VpcId string
    gateway vpc id.
    VswitchId string
    The vswitch id.
    ActivatedTime string
    gateway .
    BuyUrl string
    Category string
    gateway category.
    CreateTime string
    gateway created timestamp in second format.
    Description string
    gateway description.
    EcsInstanceId string
    gateway ecs instance id.
    ExpireStatus int
    gateway expiration status.
    ExpiredTime string
    gateway expiration timestamp in second format.
    GatewayClass string
    gateway class.
    GatewayId string
    gateway id.
    GatewayName string
    gateway name.
    GatewayVersion string
    gateway version.
    Id string
    The ID of the Gateway.
    InnerIp string
    gateway service ip.
    Ip string
    gateway public ip.
    IsReleaseAfterExpiration bool
    whether subscription gateway is released after expiration or not.
    Location string
    gateway location.
    PaymentType string
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    PublicNetworkBandwidth int
    gateway public network bandwidth.
    RenewUrl string
    Status string
    gateway status.
    StorageBundleId string
    storage bundle id.
    TaskId string
    gateway task id.
    Type string
    gateway type.
    VpcId string
    gateway vpc id.
    VswitchId string
    The vswitch id.
    activatedTime String
    gateway .
    buyUrl String
    category String
    gateway category.
    createTime String
    gateway created timestamp in second format.
    description String
    gateway description.
    ecsInstanceId String
    gateway ecs instance id.
    expireStatus Integer
    gateway expiration status.
    expiredTime String
    gateway expiration timestamp in second format.
    gatewayClass String
    gateway class.
    gatewayId String
    gateway id.
    gatewayName String
    gateway name.
    gatewayVersion String
    gateway version.
    id String
    The ID of the Gateway.
    innerIp String
    gateway service ip.
    ip String
    gateway public ip.
    isReleaseAfterExpiration Boolean
    whether subscription gateway is released after expiration or not.
    location String
    gateway location.
    paymentType String
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    publicNetworkBandwidth Integer
    gateway public network bandwidth.
    renewUrl String
    status String
    gateway status.
    storageBundleId String
    storage bundle id.
    taskId String
    gateway task id.
    type String
    gateway type.
    vpcId String
    gateway vpc id.
    vswitchId String
    The vswitch id.
    activatedTime string
    gateway .
    buyUrl string
    category string
    gateway category.
    createTime string
    gateway created timestamp in second format.
    description string
    gateway description.
    ecsInstanceId string
    gateway ecs instance id.
    expireStatus number
    gateway expiration status.
    expiredTime string
    gateway expiration timestamp in second format.
    gatewayClass string
    gateway class.
    gatewayId string
    gateway id.
    gatewayName string
    gateway name.
    gatewayVersion string
    gateway version.
    id string
    The ID of the Gateway.
    innerIp string
    gateway service ip.
    ip string
    gateway public ip.
    isReleaseAfterExpiration boolean
    whether subscription gateway is released after expiration or not.
    location string
    gateway location.
    paymentType string
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    publicNetworkBandwidth number
    gateway public network bandwidth.
    renewUrl string
    status string
    gateway status.
    storageBundleId string
    storage bundle id.
    taskId string
    gateway task id.
    type string
    gateway type.
    vpcId string
    gateway vpc id.
    vswitchId string
    The vswitch id.
    activated_time str
    gateway .
    buy_url str
    category str
    gateway category.
    create_time str
    gateway created timestamp in second format.
    description str
    gateway description.
    ecs_instance_id str
    gateway ecs instance id.
    expire_status int
    gateway expiration status.
    expired_time str
    gateway expiration timestamp in second format.
    gateway_class str
    gateway class.
    gateway_id str
    gateway id.
    gateway_name str
    gateway name.
    gateway_version str
    gateway version.
    id str
    The ID of the Gateway.
    inner_ip str
    gateway service ip.
    ip str
    gateway public ip.
    is_release_after_expiration bool
    whether subscription gateway is released after expiration or not.
    location str
    gateway location.
    payment_type str
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    public_network_bandwidth int
    gateway public network bandwidth.
    renew_url str
    status str
    gateway status.
    storage_bundle_id str
    storage bundle id.
    task_id str
    gateway task id.
    type str
    gateway type.
    vpc_id str
    gateway vpc id.
    vswitch_id str
    The vswitch id.
    activatedTime String
    gateway .
    buyUrl String
    category String
    gateway category.
    createTime String
    gateway created timestamp in second format.
    description String
    gateway description.
    ecsInstanceId String
    gateway ecs instance id.
    expireStatus Number
    gateway expiration status.
    expiredTime String
    gateway expiration timestamp in second format.
    gatewayClass String
    gateway class.
    gatewayId String
    gateway id.
    gatewayName String
    gateway name.
    gatewayVersion String
    gateway version.
    id String
    The ID of the Gateway.
    innerIp String
    gateway service ip.
    ip String
    gateway public ip.
    isReleaseAfterExpiration Boolean
    whether subscription gateway is released after expiration or not.
    location String
    gateway location.
    paymentType String
    gateway payment type. The Payment type of gateway. The valid value: PayAsYouGo, Subscription.
    publicNetworkBandwidth Number
    gateway public network bandwidth.
    renewUrl String
    status String
    gateway status.
    storageBundleId String
    storage bundle id.
    taskId String
    gateway task id.
    type String
    gateway type.
    vpcId String
    gateway vpc id.
    vswitchId String
    The vswitch 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