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

alicloud.mse.getZnodes

Explore with Pulumi AI

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

    This data source provides the Mse Znodes of the current Alibaba Cloud user.

    NOTE: Available in v1.162.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.mse.getZnodes({
        clusterId: "example_value",
        path: "/",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
    });
    export const mseZnodeId1 = ids.then(ids => ids.znodes?.[0]?.id);
    const nameRegex = alicloud.mse.getZnodes({
        path: "/",
        clusterId: "example_value",
        nameRegex: "^my-Znode",
    });
    export const mseZnodeId2 = nameRegex.then(nameRegex => nameRegex.znodes?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.mse.get_znodes(cluster_id="example_value",
        path="/",
        ids=[
            "example_value-1",
            "example_value-2",
        ])
    pulumi.export("mseZnodeId1", ids.znodes[0].id)
    name_regex = alicloud.mse.get_znodes(path="/",
        cluster_id="example_value",
        name_regex="^my-Znode")
    pulumi.export("mseZnodeId2", name_regex.znodes[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mse"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := mse.GetZnodes(ctx, &mse.GetZnodesArgs{
    			ClusterId: "example_value",
    			Path:      "/",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mseZnodeId1", ids.Znodes[0].Id)
    		nameRegex, err := mse.GetZnodes(ctx, &mse.GetZnodesArgs{
    			Path:      "/",
    			ClusterId: "example_value",
    			NameRegex: pulumi.StringRef("^my-Znode"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mseZnodeId2", nameRegex.Znodes[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Mse.GetZnodes.Invoke(new()
        {
            ClusterId = "example_value",
            Path = "/",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
        });
    
        var nameRegex = AliCloud.Mse.GetZnodes.Invoke(new()
        {
            Path = "/",
            ClusterId = "example_value",
            NameRegex = "^my-Znode",
        });
    
        return new Dictionary<string, object?>
        {
            ["mseZnodeId1"] = ids.Apply(getZnodesResult => getZnodesResult.Znodes[0]?.Id),
            ["mseZnodeId2"] = nameRegex.Apply(getZnodesResult => getZnodesResult.Znodes[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.mse.MseFunctions;
    import com.pulumi.alicloud.mse.inputs.GetZnodesArgs;
    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 ids = MseFunctions.getZnodes(GetZnodesArgs.builder()
                .clusterId("example_value")
                .path("/")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .build());
    
            ctx.export("mseZnodeId1", ids.applyValue(getZnodesResult -> getZnodesResult.znodes()[0].id()));
            final var nameRegex = MseFunctions.getZnodes(GetZnodesArgs.builder()
                .path("/")
                .clusterId("example_value")
                .nameRegex("^my-Znode")
                .build());
    
            ctx.export("mseZnodeId2", nameRegex.applyValue(getZnodesResult -> getZnodesResult.znodes()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:mse:getZnodes
          Arguments:
            clusterId: example_value
            path: /
            ids:
              - example_value-1
              - example_value-2
      nameRegex:
        fn::invoke:
          Function: alicloud:mse:getZnodes
          Arguments:
            path: /
            clusterId: example_value
            nameRegex: ^my-Znode
    outputs:
      mseZnodeId1: ${ids.znodes[0].id}
      mseZnodeId2: ${nameRegex.znodes[0].id}
    

    Using getZnodes

    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 getZnodes(args: GetZnodesArgs, opts?: InvokeOptions): Promise<GetZnodesResult>
    function getZnodesOutput(args: GetZnodesOutputArgs, opts?: InvokeOptions): Output<GetZnodesResult>
    def get_znodes(accept_language: Optional[str] = None,
                   cluster_id: Optional[str] = None,
                   ids: Optional[Sequence[str]] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   path: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetZnodesResult
    def get_znodes_output(accept_language: Optional[pulumi.Input[str]] = None,
                   cluster_id: Optional[pulumi.Input[str]] = None,
                   ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   name_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   path: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetZnodesResult]
    func GetZnodes(ctx *Context, args *GetZnodesArgs, opts ...InvokeOption) (*GetZnodesResult, error)
    func GetZnodesOutput(ctx *Context, args *GetZnodesOutputArgs, opts ...InvokeOption) GetZnodesResultOutput

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

    public static class GetZnodes 
    {
        public static Task<GetZnodesResult> InvokeAsync(GetZnodesArgs args, InvokeOptions? opts = null)
        public static Output<GetZnodesResult> Invoke(GetZnodesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetZnodesResult> getZnodes(GetZnodesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:mse/getZnodes:getZnodes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    The ID of the Cluster.
    Path string
    The Node path.
    AcceptLanguage string
    The language type of the returned information. Valid values: zh or en.
    Ids List<string>
    A list of Znode IDs.
    NameRegex string
    A regex string to filter results by Znode name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ClusterId string
    The ID of the Cluster.
    Path string
    The Node path.
    AcceptLanguage string
    The language type of the returned information. Valid values: zh or en.
    Ids []string
    A list of Znode IDs.
    NameRegex string
    A regex string to filter results by Znode name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    clusterId String
    The ID of the Cluster.
    path String
    The Node path.
    acceptLanguage String
    The language type of the returned information. Valid values: zh or en.
    ids List<String>
    A list of Znode IDs.
    nameRegex String
    A regex string to filter results by Znode name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    clusterId string
    The ID of the Cluster.
    path string
    The Node path.
    acceptLanguage string
    The language type of the returned information. Valid values: zh or en.
    ids string[]
    A list of Znode IDs.
    nameRegex string
    A regex string to filter results by Znode name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    cluster_id str
    The ID of the Cluster.
    path str
    The Node path.
    accept_language str
    The language type of the returned information. Valid values: zh or en.
    ids Sequence[str]
    A list of Znode IDs.
    name_regex str
    A regex string to filter results by Znode name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    clusterId String
    The ID of the Cluster.
    path String
    The Node path.
    acceptLanguage String
    The language type of the returned information. Valid values: zh or en.
    ids List<String>
    A list of Znode IDs.
    nameRegex String
    A regex string to filter results by Znode name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getZnodes Result

    The following output properties are available:

    ClusterId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Path string
    Znodes List<Pulumi.AliCloud.Mse.Outputs.GetZnodesZnode>
    AcceptLanguage string
    NameRegex string
    OutputFile string
    ClusterId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Path string
    Znodes []GetZnodesZnode
    AcceptLanguage string
    NameRegex string
    OutputFile string
    clusterId String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    path String
    znodes List<GetZnodesZnode>
    acceptLanguage String
    nameRegex String
    outputFile String
    clusterId string
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    path string
    znodes GetZnodesZnode[]
    acceptLanguage string
    nameRegex string
    outputFile string
    cluster_id str
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    path str
    znodes Sequence[GetZnodesZnode]
    accept_language str
    name_regex str
    output_file str
    clusterId String
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    path String
    znodes List<Property Map>
    acceptLanguage String
    nameRegex String
    outputFile String

    Supporting Types

    GetZnodesZnode

    ClusterId string
    The ID of the Cluster.
    Data string
    The Node data.
    Dir bool
    Node list information, the value is as follows:
    Id string
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    Path string
    The Node path.
    ZnodeName string
    The Node name.
    ClusterId string
    The ID of the Cluster.
    Data string
    The Node data.
    Dir bool
    Node list information, the value is as follows:
    Id string
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    Path string
    The Node path.
    ZnodeName string
    The Node name.
    clusterId String
    The ID of the Cluster.
    data String
    The Node data.
    dir Boolean
    Node list information, the value is as follows:
    id String
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    path String
    The Node path.
    znodeName String
    The Node name.
    clusterId string
    The ID of the Cluster.
    data string
    The Node data.
    dir boolean
    Node list information, the value is as follows:
    id string
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    path string
    The Node path.
    znodeName string
    The Node name.
    cluster_id str
    The ID of the Cluster.
    data str
    The Node data.
    dir bool
    Node list information, the value is as follows:
    id str
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    path str
    The Node path.
    znode_name str
    The Node name.
    clusterId String
    The ID of the Cluster.
    data String
    The Node data.
    dir Boolean
    Node list information, the value is as follows:
    id String
    The ID of the Znode. The value formats as <cluster_id>:<path>.
    path String
    The Node path.
    znodeName String
    The Node name.

    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