1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getMetro
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

equinix.metal.getMetro

Explore with Pulumi AI

equinix logo
Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix

    Provides an Equinix Metal metro datasource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as equinix from "@pulumi/equinix";
    
    const sv = equinix.metal.getMetro({
        code: "sv",
    });
    export const id = sv.then(sv => sv.id);
    
    import pulumi
    import pulumi_equinix as equinix
    
    sv = equinix.metal.get_metro(code="sv")
    pulumi.export("id", sv.id)
    
    package main
    
    import (
    	"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		sv, err := metal.GetMetro(ctx, &metal.GetMetroArgs{
    			Code: "sv",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", sv.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Equinix = Pulumi.Equinix;
    
    return await Deployment.RunAsync(() => 
    {
        var sv = Equinix.Metal.GetMetro.Invoke(new()
        {
            Code = "sv",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = sv.Apply(getMetroResult => getMetroResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.equinix.metal.MetalFunctions;
    import com.pulumi.equinix.metal.inputs.GetMetroArgs;
    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 sv = MetalFunctions.getMetro(GetMetroArgs.builder()
                .code("sv")
                .build());
    
            ctx.export("id", sv.applyValue(getMetroResult -> getMetroResult.id()));
        }
    }
    
    variables:
      sv:
        fn::invoke:
          Function: equinix:metal:getMetro
          Arguments:
            code: sv
    outputs:
      id: ${sv.id}
    

    Using getMetro

    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 getMetro(args: GetMetroArgs, opts?: InvokeOptions): Promise<GetMetroResult>
    function getMetroOutput(args: GetMetroOutputArgs, opts?: InvokeOptions): Output<GetMetroResult>
    def get_metro(capacities: Optional[Sequence[GetMetroCapacity]] = None,
                  code: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetMetroResult
    def get_metro_output(capacities: Optional[pulumi.Input[Sequence[pulumi.Input[GetMetroCapacityArgs]]]] = None,
                  code: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetMetroResult]
    func GetMetro(ctx *Context, args *GetMetroArgs, opts ...InvokeOption) (*GetMetroResult, error)
    func GetMetroOutput(ctx *Context, args *GetMetroOutputArgs, opts ...InvokeOption) GetMetroResultOutput

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

    public static class GetMetro 
    {
        public static Task<GetMetroResult> InvokeAsync(GetMetroArgs args, InvokeOptions? opts = null)
        public static Output<GetMetroResult> Invoke(GetMetroInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMetroResult> getMetro(GetMetroArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: equinix:metal/getMetro:getMetro
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Code string
    The metro code to search for.
    Capacities List<GetMetroCapacity>
    One or more device plans for which the metro must have capacity.
    Code string
    The metro code to search for.
    Capacities []GetMetroCapacity
    One or more device plans for which the metro must have capacity.
    code String
    The metro code to search for.
    capacities List<GetMetroCapacity>
    One or more device plans for which the metro must have capacity.
    code string
    The metro code to search for.
    capacities GetMetroCapacity[]
    One or more device plans for which the metro must have capacity.
    code str
    The metro code to search for.
    capacities Sequence[GetMetroCapacity]
    One or more device plans for which the metro must have capacity.
    code String
    The metro code to search for.
    capacities List<Property Map>
    One or more device plans for which the metro must have capacity.

    getMetro Result

    The following output properties are available:

    Code string
    Country string
    The country of the metro.
    Id string
    The ID of the metro.
    Name string
    The name of the metro.
    Capacities List<GetMetroCapacity>
    Code string
    Country string
    The country of the metro.
    Id string
    The ID of the metro.
    Name string
    The name of the metro.
    Capacities []GetMetroCapacity
    code String
    country String
    The country of the metro.
    id String
    The ID of the metro.
    name String
    The name of the metro.
    capacities List<GetMetroCapacity>
    code string
    country string
    The country of the metro.
    id string
    The ID of the metro.
    name string
    The name of the metro.
    capacities GetMetroCapacity[]
    code str
    country str
    The country of the metro.
    id str
    The ID of the metro.
    name str
    The name of the metro.
    capacities Sequence[GetMetroCapacity]
    code String
    country String
    The country of the metro.
    id String
    The ID of the metro.
    name String
    The name of the metro.
    capacities List<Property Map>

    Supporting Types

    GetMetroCapacity

    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    Plan string
    Device plan that must be available in selected location.
    Quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Integer
    Minimum number of devices that must be available in selected location. Default is 1.
    plan string
    Device plan that must be available in selected location.
    quantity number
    Minimum number of devices that must be available in selected location. Default is 1.
    plan str
    Device plan that must be available in selected location.
    quantity int
    Minimum number of devices that must be available in selected location. Default is 1.
    plan String
    Device plan that must be available in selected location.
    quantity Number
    Minimum number of devices that must be available in selected location. Default is 1.

    Package Details

    Repository
    equinix equinix/pulumi-equinix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the equinix Terraform Provider.
    equinix logo
    Equinix v0.10.0 published on Wednesday, May 22, 2024 by Equinix