1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ots
  5. getTunnels
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.ots.getTunnels

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the ots tunnels of the current Alibaba Cloud user.

    For information about OTS tunnel and how to use it, see Tunnel overview.

    NOTE: Available in v1.172.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const tunnelsDs = alicloud.ots.getTunnels({
        instanceName: "sample-instance",
        tableName: "sample-table",
        nameRegex: "sample-tunnel",
        outputFile: "tunnels.txt",
    });
    export const firstTunnelId = tunnelsDs.then(tunnelsDs => tunnelsDs.tunnels?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    tunnels_ds = alicloud.ots.get_tunnels(instance_name="sample-instance",
        table_name="sample-table",
        name_regex="sample-tunnel",
        output_file="tunnels.txt")
    pulumi.export("firstTunnelId", tunnels_ds.tunnels[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		tunnelsDs, err := ots.GetTunnels(ctx, &ots.GetTunnelsArgs{
    			InstanceName: "sample-instance",
    			TableName:    "sample-table",
    			NameRegex:    pulumi.StringRef("sample-tunnel"),
    			OutputFile:   pulumi.StringRef("tunnels.txt"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstTunnelId", tunnelsDs.Tunnels[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var tunnelsDs = AliCloud.Ots.GetTunnels.Invoke(new()
        {
            InstanceName = "sample-instance",
            TableName = "sample-table",
            NameRegex = "sample-tunnel",
            OutputFile = "tunnels.txt",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstTunnelId"] = tunnelsDs.Apply(getTunnelsResult => getTunnelsResult.Tunnels[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ots.OtsFunctions;
    import com.pulumi.alicloud.ots.inputs.GetTunnelsArgs;
    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 tunnelsDs = OtsFunctions.getTunnels(GetTunnelsArgs.builder()
                .instanceName("sample-instance")
                .tableName("sample-table")
                .nameRegex("sample-tunnel")
                .outputFile("tunnels.txt")
                .build());
    
            ctx.export("firstTunnelId", tunnelsDs.applyValue(getTunnelsResult -> getTunnelsResult.tunnels()[0].id()));
        }
    }
    
    variables:
      tunnelsDs:
        fn::invoke:
          Function: alicloud:ots:getTunnels
          Arguments:
            instanceName: sample-instance
            tableName: sample-table
            nameRegex: sample-tunnel
            outputFile: tunnels.txt
    outputs:
      firstTunnelId: ${tunnelsDs.tunnels[0].id}
    

    Using getTunnels

    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 getTunnels(args: GetTunnelsArgs, opts?: InvokeOptions): Promise<GetTunnelsResult>
    function getTunnelsOutput(args: GetTunnelsOutputArgs, opts?: InvokeOptions): Output<GetTunnelsResult>
    def get_tunnels(ids: Optional[Sequence[str]] = None,
                    instance_name: Optional[str] = None,
                    name_regex: Optional[str] = None,
                    output_file: Optional[str] = None,
                    table_name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetTunnelsResult
    def get_tunnels_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    instance_name: Optional[pulumi.Input[str]] = None,
                    name_regex: Optional[pulumi.Input[str]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    table_name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetTunnelsResult]
    func GetTunnels(ctx *Context, args *GetTunnelsArgs, opts ...InvokeOption) (*GetTunnelsResult, error)
    func GetTunnelsOutput(ctx *Context, args *GetTunnelsOutputArgs, opts ...InvokeOption) GetTunnelsResultOutput

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

    public static class GetTunnels 
    {
        public static Task<GetTunnelsResult> InvokeAsync(GetTunnelsArgs args, InvokeOptions? opts = null)
        public static Output<GetTunnelsResult> Invoke(GetTunnelsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTunnelsResult> getTunnels(GetTunnelsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ots/getTunnels:getTunnels
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceName string
    The name of OTS instance.
    TableName string
    The name of OTS table.
    Ids List<string>
    A list of tunnel IDs.
    NameRegex string
    A regex string to filter results by tunnel name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    InstanceName string
    The name of OTS instance.
    TableName string
    The name of OTS table.
    Ids []string
    A list of tunnel IDs.
    NameRegex string
    A regex string to filter results by tunnel name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    instanceName String
    The name of OTS instance.
    tableName String
    The name of OTS table.
    ids List<String>
    A list of tunnel IDs.
    nameRegex String
    A regex string to filter results by tunnel name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    instanceName string
    The name of OTS instance.
    tableName string
    The name of OTS table.
    ids string[]
    A list of tunnel IDs.
    nameRegex string
    A regex string to filter results by tunnel name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    instance_name str
    The name of OTS instance.
    table_name str
    The name of OTS table.
    ids Sequence[str]
    A list of tunnel IDs.
    name_regex str
    A regex string to filter results by tunnel name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    instanceName String
    The name of OTS instance.
    tableName String
    The name of OTS table.
    ids List<String>
    A list of tunnel IDs.
    nameRegex String
    A regex string to filter results by tunnel name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getTunnels Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of tunnel IDs.
    InstanceName string
    The OTS instance name.
    Names List<string>
    A list of tunnel names.
    TableName string
    The table name of the OTS which could not be changed.
    Tunnels List<Pulumi.AliCloud.Ots.Outputs.GetTunnelsTunnel>
    A list of tunnels. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of tunnel IDs.
    InstanceName string
    The OTS instance name.
    Names []string
    A list of tunnel names.
    TableName string
    The table name of the OTS which could not be changed.
    Tunnels []GetTunnelsTunnel
    A list of tunnels. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of tunnel IDs.
    instanceName String
    The OTS instance name.
    names List<String>
    A list of tunnel names.
    tableName String
    The table name of the OTS which could not be changed.
    tunnels List<GetTunnelsTunnel>
    A list of tunnels. Each element contains the following attributes:
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of tunnel IDs.
    instanceName string
    The OTS instance name.
    names string[]
    A list of tunnel names.
    tableName string
    The table name of the OTS which could not be changed.
    tunnels GetTunnelsTunnel[]
    A list of tunnels. Each element contains the following attributes:
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of tunnel IDs.
    instance_name str
    The OTS instance name.
    names Sequence[str]
    A list of tunnel names.
    table_name str
    The table name of the OTS which could not be changed.
    tunnels Sequence[GetTunnelsTunnel]
    A list of tunnels. Each element contains the following attributes:
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of tunnel IDs.
    instanceName String
    The OTS instance name.
    names List<String>
    A list of tunnel names.
    tableName String
    The table name of the OTS which could not be changed.
    tunnels List<Property Map>
    A list of tunnels. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetTunnelsTunnel

    Channels List<Pulumi.AliCloud.Ots.Inputs.GetTunnelsTunnelChannel>
    The channels of OTS tunnel. Each element contains the following attributes:
    CreateTime int
    The creation time of the Tunnel.
    Expired bool
    Whether the tunnel has expired.
    Id string
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    InstanceName string
    The name of OTS instance.
    TableName string
    The name of OTS table.
    TunnelId string
    The tunnel id of the OTS which could not be changed.
    TunnelName string
    The tunnel name of the OTS which could not be changed.
    TunnelRpo int
    The latest consumption time of the tunnel, unix time in nanosecond.
    TunnelStage string
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    TunnelType string
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.
    Channels []GetTunnelsTunnelChannel
    The channels of OTS tunnel. Each element contains the following attributes:
    CreateTime int
    The creation time of the Tunnel.
    Expired bool
    Whether the tunnel has expired.
    Id string
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    InstanceName string
    The name of OTS instance.
    TableName string
    The name of OTS table.
    TunnelId string
    The tunnel id of the OTS which could not be changed.
    TunnelName string
    The tunnel name of the OTS which could not be changed.
    TunnelRpo int
    The latest consumption time of the tunnel, unix time in nanosecond.
    TunnelStage string
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    TunnelType string
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.
    channels List<GetTunnelsTunnelChannel>
    The channels of OTS tunnel. Each element contains the following attributes:
    createTime Integer
    The creation time of the Tunnel.
    expired Boolean
    Whether the tunnel has expired.
    id String
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    instanceName String
    The name of OTS instance.
    tableName String
    The name of OTS table.
    tunnelId String
    The tunnel id of the OTS which could not be changed.
    tunnelName String
    The tunnel name of the OTS which could not be changed.
    tunnelRpo Integer
    The latest consumption time of the tunnel, unix time in nanosecond.
    tunnelStage String
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    tunnelType String
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.
    channels GetTunnelsTunnelChannel[]
    The channels of OTS tunnel. Each element contains the following attributes:
    createTime number
    The creation time of the Tunnel.
    expired boolean
    Whether the tunnel has expired.
    id string
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    instanceName string
    The name of OTS instance.
    tableName string
    The name of OTS table.
    tunnelId string
    The tunnel id of the OTS which could not be changed.
    tunnelName string
    The tunnel name of the OTS which could not be changed.
    tunnelRpo number
    The latest consumption time of the tunnel, unix time in nanosecond.
    tunnelStage string
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    tunnelType string
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.
    channels Sequence[GetTunnelsTunnelChannel]
    The channels of OTS tunnel. Each element contains the following attributes:
    create_time int
    The creation time of the Tunnel.
    expired bool
    Whether the tunnel has expired.
    id str
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    instance_name str
    The name of OTS instance.
    table_name str
    The name of OTS table.
    tunnel_id str
    The tunnel id of the OTS which could not be changed.
    tunnel_name str
    The tunnel name of the OTS which could not be changed.
    tunnel_rpo int
    The latest consumption time of the tunnel, unix time in nanosecond.
    tunnel_stage str
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    tunnel_type str
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.
    channels List<Property Map>
    The channels of OTS tunnel. Each element contains the following attributes:
    createTime Number
    The creation time of the Tunnel.
    expired Boolean
    Whether the tunnel has expired.
    id String
    The resource ID. The value is <instance_name>:<table_name>:<tunnel_name>.
    instanceName String
    The name of OTS instance.
    tableName String
    The name of OTS table.
    tunnelId String
    The tunnel id of the OTS which could not be changed.
    tunnelName String
    The tunnel name of the OTS which could not be changed.
    tunnelRpo Number
    The latest consumption time of the tunnel, unix time in nanosecond.
    tunnelStage String
    The stage of OTS tunnel, valid values: InitBaseDataAndStreamShard, ProcessBaseData, ProcessStream.
    tunnelType String
    The type of the OTS tunnel, valid values: BaseAndStream, BaseData, Stream.

    GetTunnelsTunnelChannel

    ChannelId string
    The id of the channel.
    ChannelRpo int
    The latest consumption time of the channel, unix time in nanosecond
    ChannelStatus string
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    ChannelType string
    The type of the channel, valid values: BaseData, Stream.
    ClientId string
    The client id of the channel.
    ChannelId string
    The id of the channel.
    ChannelRpo int
    The latest consumption time of the channel, unix time in nanosecond
    ChannelStatus string
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    ChannelType string
    The type of the channel, valid values: BaseData, Stream.
    ClientId string
    The client id of the channel.
    channelId String
    The id of the channel.
    channelRpo Integer
    The latest consumption time of the channel, unix time in nanosecond
    channelStatus String
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    channelType String
    The type of the channel, valid values: BaseData, Stream.
    clientId String
    The client id of the channel.
    channelId string
    The id of the channel.
    channelRpo number
    The latest consumption time of the channel, unix time in nanosecond
    channelStatus string
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    channelType string
    The type of the channel, valid values: BaseData, Stream.
    clientId string
    The client id of the channel.
    channel_id str
    The id of the channel.
    channel_rpo int
    The latest consumption time of the channel, unix time in nanosecond
    channel_status str
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    channel_type str
    The type of the channel, valid values: BaseData, Stream.
    client_id str
    The client id of the channel.
    channelId String
    The id of the channel.
    channelRpo Number
    The latest consumption time of the channel, unix time in nanosecond
    channelStatus String
    The status of the channel, valid values: WAIT, OPEN, CLOSING, CLOSE, TERMINATED.
    channelType String
    The type of the channel, valid values: BaseData, Stream.
    clientId String
    The client id of the channel.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi