1. Packages
  2. Linode
  3. API Docs
  4. getAccountAvailabilities
Linode v4.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

linode.getAccountAvailabilities

Explore with Pulumi AI

linode logo
Linode v4.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

    Provides information about services which are unavailable for the current Linode account.

    Example Usage

    The following example shows how one might use this data source to discover regions without specific service availability.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    export = async () => {
        const filtered-availabilities = await linode.getAccountAvailabilities({
            filters: [{
                name: "unavailable",
                values: ["Linodes"],
            }],
        });
        return {
            "regions-without-linodes": filtered_availabilities.availabilities.map(__item => __item.region),
        };
    }
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_availabilities = linode.get_account_availabilities(filters=[linode.GetAccountAvailabilitiesFilterArgs(
        name="unavailable",
        values=["Linodes"],
    )])
    pulumi.export("regions-without-linodes", [__item.region for __item in filtered_availabilities.availabilities])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		filtered_availabilities, err := linode.GetAccountAvailabilities(ctx, &linode.GetAccountAvailabilitiesArgs{
    			Filters: []linode.GetAccountAvailabilitiesFilter{
    				{
    					Name: "unavailable",
    					Values: []string{
    						"Linodes",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var splat0 []*string
    		for _, val0 := range filtered_availabilities.Availabilities {
    			splat0 = append(splat0, val0.Region)
    		}
    		ctx.Export("regions-without-linodes", splat0)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered_availabilities = Linode.GetAccountAvailabilities.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetAccountAvailabilitiesFilterInputArgs
                {
                    Name = "unavailable",
                    Values = new[]
                    {
                        "Linodes",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["regions-without-linodes"] = filtered_availabilities.Apply(filtered_availabilities => filtered_availabilities.Apply(getAccountAvailabilitiesResult => getAccountAvailabilitiesResult.Availabilities).Select(__item => __item.Region).ToList()),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetAccountAvailabilitiesArgs;
    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 filtered-availabilities = LinodeFunctions.getAccountAvailabilities(GetAccountAvailabilitiesArgs.builder()
                .filters(GetAccountAvailabilitiesFilterArgs.builder()
                    .name("unavailable")
                    .values("Linodes")
                    .build())
                .build());
    
            ctx.export("regions-without-linodes", filtered_availabilities.availabilities().stream().map(element -> element.region()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Filterable Fields

    • region

    • unavailable

    Using getAccountAvailabilities

    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 getAccountAvailabilities(args: GetAccountAvailabilitiesArgs, opts?: InvokeOptions): Promise<GetAccountAvailabilitiesResult>
    function getAccountAvailabilitiesOutput(args: GetAccountAvailabilitiesOutputArgs, opts?: InvokeOptions): Output<GetAccountAvailabilitiesResult>
    def get_account_availabilities(availabilities: Optional[Sequence[GetAccountAvailabilitiesAvailability]] = None,
                                   filters: Optional[Sequence[GetAccountAvailabilitiesFilter]] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetAccountAvailabilitiesResult
    def get_account_availabilities_output(availabilities: Optional[pulumi.Input[Sequence[pulumi.Input[GetAccountAvailabilitiesAvailabilityArgs]]]] = None,
                                   filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetAccountAvailabilitiesFilterArgs]]]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetAccountAvailabilitiesResult]
    func GetAccountAvailabilities(ctx *Context, args *GetAccountAvailabilitiesArgs, opts ...InvokeOption) (*GetAccountAvailabilitiesResult, error)
    func GetAccountAvailabilitiesOutput(ctx *Context, args *GetAccountAvailabilitiesOutputArgs, opts ...InvokeOption) GetAccountAvailabilitiesResultOutput

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

    public static class GetAccountAvailabilities 
    {
        public static Task<GetAccountAvailabilitiesResult> InvokeAsync(GetAccountAvailabilitiesArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountAvailabilitiesResult> Invoke(GetAccountAvailabilitiesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountAvailabilitiesResult> getAccountAvailabilities(GetAccountAvailabilitiesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getAccountAvailabilities:getAccountAvailabilities
      arguments:
        # arguments dictionary

    The following arguments are supported:

    getAccountAvailabilities Result

    The following output properties are available:

    Supporting Types

    GetAccountAvailabilitiesAvailability

    Region string
    The region this availability entry refers to.
    Unavailables List<string>
    A set of services that are unavailable for the given region.
    Region string
    The region this availability entry refers to.
    Unavailables []string
    A set of services that are unavailable for the given region.
    region String
    The region this availability entry refers to.
    unavailables List<String>
    A set of services that are unavailable for the given region.
    region string
    The region this availability entry refers to.
    unavailables string[]
    A set of services that are unavailable for the given region.
    region str
    The region this availability entry refers to.
    unavailables Sequence[str]
    A set of services that are unavailable for the given region.
    region String
    The region this availability entry refers to.
    unavailables List<String>
    A set of services that are unavailable for the given region.

    GetAccountAvailabilitiesFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.18.0 published on Wednesday, Apr 10, 2024 by Pulumi