1. Packages
  2. Linode
  3. API Docs
  4. getAccountLogins
Linode v4.6.1 published on Friday, Sep 15, 2023 by Pulumi

linode.getAccountLogins

Explore with Pulumi AI

linode logo
Linode v4.6.1 published on Friday, Sep 15, 2023 by Pulumi

    Provides information about Linode account logins that match a set of filters.

    Filterable Fields

    • ip

    • restricted

    • username

    Example Usage

    The following example shows how one might use this data source to access information about a Linode account login.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered_account_logins = Linode.GetAccountLogins.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetAccountLoginsFilterInputArgs
                {
                    Name = "restricted",
                    Values = new[]
                    {
                        "true",
                    },
                },
                new Linode.Inputs.GetAccountLoginsFilterInputArgs
                {
                    Name = "username",
                    Values = new[]
                    {
                        "myUsername",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["loginIds"] = filtered_account_logins.Apply(filtered_account_logins => filtered_account_logins.Apply(getAccountLoginsResult => getAccountLoginsResult.Logins).Select(__item => __item.Id).ToList()),
        };
    });
    
    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_account_logins, err := linode.GetAccountLogins(ctx, &linode.GetAccountLoginsArgs{
    			Filters: []linode.GetAccountLoginsFilter{
    				{
    					Name: "restricted",
    					Values: []string{
    						"true",
    					},
    				},
    				{
    					Name: "username",
    					Values: []string{
    						"myUsername",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var splat0 []*int
    		for _, val0 := range filtered_account_logins.Logins {
    			splat0 = append(splat0, val0.Id)
    		}
    		ctx.Export("loginIds", splat0)
    		return nil
    	})
    }
    
    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.GetAccountLoginsArgs;
    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-account-logins = LinodeFunctions.getAccountLogins(GetAccountLoginsArgs.builder()
                .filters(            
                    GetAccountLoginsFilterArgs.builder()
                        .name("restricted")
                        .values("true")
                        .build(),
                    GetAccountLoginsFilterArgs.builder()
                        .name("username")
                        .values("myUsername")
                        .build())
                .build());
    
            ctx.export("loginIds", filtered_account_logins.logins().stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_account_logins = linode.get_account_logins(filters=[
        linode.GetAccountLoginsFilterArgs(
            name="restricted",
            values=["true"],
        ),
        linode.GetAccountLoginsFilterArgs(
            name="username",
            values=["myUsername"],
        ),
    ])
    pulumi.export("loginIds", [__item.id for __item in filtered_account_logins.logins])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filtered-account-logins = linode.getAccountLogins({
        filters: [
            {
                name: "restricted",
                values: ["true"],
            },
            {
                name: "username",
                values: ["myUsername"],
            },
        ],
    });
    export const loginIds = filtered_account_logins.then(filtered_account_logins => filtered_account_logins.logins.map(__item => __item.id));
    

    Coming soon!

    Using getAccountLogins

    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 getAccountLogins(args: GetAccountLoginsArgs, opts?: InvokeOptions): Promise<GetAccountLoginsResult>
    function getAccountLoginsOutput(args: GetAccountLoginsOutputArgs, opts?: InvokeOptions): Output<GetAccountLoginsResult>
    def get_account_logins(filters: Optional[Sequence[GetAccountLoginsFilter]] = None,
                           logins: Optional[Sequence[GetAccountLoginsLogin]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAccountLoginsResult
    def get_account_logins_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetAccountLoginsFilterArgs]]]] = None,
                           logins: Optional[pulumi.Input[Sequence[pulumi.Input[GetAccountLoginsLoginArgs]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAccountLoginsResult]
    func GetAccountLogins(ctx *Context, args *GetAccountLoginsArgs, opts ...InvokeOption) (*GetAccountLoginsResult, error)
    func GetAccountLoginsOutput(ctx *Context, args *GetAccountLoginsOutputArgs, opts ...InvokeOption) GetAccountLoginsResultOutput

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

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

    The following arguments are supported:

    getAccountLogins Result

    The following output properties are available:

    Id string

    The unique ID of this login object.

    Filters []GetAccountLoginsFilter
    Logins []GetAccountLoginsLogin
    id string

    The unique ID of this login object.

    filters GetAccountLoginsFilter[]
    logins GetAccountLoginsLogin[]
    id String

    The unique ID of this login object.

    filters List<Property Map>
    logins List<Property Map>

    Supporting Types

    GetAccountLoginsFilter

    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)

    GetAccountLoginsLogin

    Datetime string

    When the login was initiated.

    Id int

    The unique ID of this login object.

    Ip string

    The remote IP address that requested the login.

    Restricted bool

    True if the User that was logged into was a restricted User, false otherwise.

    Status string
    Username string

    The username of the User that was logged into.

    Datetime string

    When the login was initiated.

    Id int

    The unique ID of this login object.

    Ip string

    The remote IP address that requested the login.

    Restricted bool

    True if the User that was logged into was a restricted User, false otherwise.

    Status string
    Username string

    The username of the User that was logged into.

    datetime String

    When the login was initiated.

    id Integer

    The unique ID of this login object.

    ip String

    The remote IP address that requested the login.

    restricted Boolean

    True if the User that was logged into was a restricted User, false otherwise.

    status String
    username String

    The username of the User that was logged into.

    datetime string

    When the login was initiated.

    id number

    The unique ID of this login object.

    ip string

    The remote IP address that requested the login.

    restricted boolean

    True if the User that was logged into was a restricted User, false otherwise.

    status string
    username string

    The username of the User that was logged into.

    datetime str

    When the login was initiated.

    id int

    The unique ID of this login object.

    ip str

    The remote IP address that requested the login.

    restricted bool

    True if the User that was logged into was a restricted User, false otherwise.

    status str
    username str

    The username of the User that was logged into.

    datetime String

    When the login was initiated.

    id Number

    The unique ID of this login object.

    ip String

    The remote IP address that requested the login.

    restricted Boolean

    True if the User that was logged into was a restricted User, false otherwise.

    status String
    username String

    The username of the User that was logged into.

    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.6.1 published on Friday, Sep 15, 2023 by Pulumi