HashiCorp Nomad

Pulumi Official
Package maintained by Pulumi
v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

getDatacenters

Retrieve a list of datacenters.

Example Usage

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var datacenters = Output.Create(Nomad.GetDatacenters.InvokeAsync(new Nomad.GetDatacentersArgs
        {
            IgnoreDownNodes = true,
            Prefix = "prod",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := true
		opt1 := "prod"
		_, err := nomad.GetDatacenters(ctx, &GetDatacentersArgs{
			IgnoreDownNodes: &opt0,
			Prefix:          &opt1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_nomad as nomad

datacenters = nomad.get_datacenters(ignore_down_nodes=True,
    prefix="prod")
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const datacenters = pulumi.output(nomad.getDatacenters({
    ignoreDownNodes: true,
    prefix: "prod",
}));

Coming soon!

Using getDatacenters

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 getDatacenters(args: GetDatacentersArgs, opts?: InvokeOptions): Promise<GetDatacentersResult>
function getDatacentersOutput(args: GetDatacentersOutputArgs, opts?: InvokeOptions): Output<GetDatacentersResult>
def get_datacenters(ignore_down_nodes: Optional[bool] = None,
                    prefix: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDatacentersResult
def get_datacenters_output(ignore_down_nodes: Optional[pulumi.Input[bool]] = None,
                    prefix: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDatacentersResult]
func GetDatacenters(ctx *Context, args *GetDatacentersArgs, opts ...InvokeOption) (*GetDatacentersResult, error)
func GetDatacentersOutput(ctx *Context, args *GetDatacentersOutputArgs, opts ...InvokeOption) GetDatacentersResultOutput

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

public static class GetDatacenters 
{
    public static Task<GetDatacentersResult> InvokeAsync(GetDatacentersArgs args, InvokeOptions? opts = null)
    public static Output<GetDatacentersResult> Invoke(GetDatacentersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatacentersResult> getDatacenters(GetDatacentersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: nomad:index/getDatacenters:getDatacenters
  Arguments:
    # Arguments dictionary

The following arguments are supported:

IgnoreDownNodes bool

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

Prefix string

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

IgnoreDownNodes bool

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

Prefix string

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

ignoreDownNodes Boolean

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

prefix String

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

ignoreDownNodes boolean

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

prefix string

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

ignore_down_nodes bool

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

prefix str

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

ignoreDownNodes Boolean

(bool: false): An optional flag that, if set to true will ignore down nodes when compiling the list of datacenters.

prefix String

(string): An optional string to filter datacenters based on name prefix. If not provided, all datacenters are returned.

getDatacenters Result

The following output properties are available:

Datacenters List<string>
Id string

The provider-assigned unique ID for this managed resource.

IgnoreDownNodes bool
Prefix string
Datacenters []string
Id string

The provider-assigned unique ID for this managed resource.

IgnoreDownNodes bool
Prefix string
datacenters List<String>
id String

The provider-assigned unique ID for this managed resource.

ignoreDownNodes Boolean
prefix String
datacenters string[]
id string

The provider-assigned unique ID for this managed resource.

ignoreDownNodes boolean
prefix string
datacenters Sequence[str]
id str

The provider-assigned unique ID for this managed resource.

ignore_down_nodes bool
prefix str
datacenters List<String>
id String

The provider-assigned unique ID for this managed resource.

ignoreDownNodes Boolean
prefix String

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes

This Pulumi package is based on the nomad Terraform Provider.