1. Packages
  2. Dynatrace
  3. API Docs
  4. getApiTokens
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

dynatrace.getApiTokens

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

    The API tokens data source allows all access tokens to be retrieved, note the token value is not included in the response.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumi/dynatrace";
    
    const exampleApiTokens = dynatrace.getApiTokens({});
    export const example = exampleApiTokens;
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    
    example_api_tokens = dynatrace.get_api_tokens()
    pulumi.export("example", example_api_tokens)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleApiTokens, err := dynatrace.GetApiTokens(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("example", exampleApiTokens)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Dynatrace = Pulumi.Dynatrace;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleApiTokens = Dynatrace.GetApiTokens.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["example"] = exampleApiTokens,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.DynatraceFunctions;
    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 exampleApiTokens = DynatraceFunctions.getApiTokens();
    
            ctx.export("example", exampleApiTokens.applyValue(getApiTokensResult -> getApiTokensResult));
        }
    }
    
    variables:
      exampleApiTokens:
        fn::invoke:
          Function: dynatrace:getApiTokens
          Arguments: {}
    outputs:
      example: ${exampleApiTokens}
    

    Using getApiTokens

    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 getApiTokens(opts?: InvokeOptions): Promise<GetApiTokensResult>
    function getApiTokensOutput(opts?: InvokeOptions): Output<GetApiTokensResult>
    def get_api_tokens(opts: Optional[InvokeOptions] = None) -> GetApiTokensResult
    def get_api_tokens_output(opts: Optional[InvokeOptions] = None) -> Output[GetApiTokensResult]
    func GetApiTokens(ctx *Context, opts ...InvokeOption) (*GetApiTokensResult, error)
    func GetApiTokensOutput(ctx *Context, opts ...InvokeOption) GetApiTokensResultOutput

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

    public static class GetApiTokens 
    {
        public static Task<GetApiTokensResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetApiTokensResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiTokensResult> getApiTokens(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: dynatrace:index/getApiTokens:getApiTokens
      arguments:
        # arguments dictionary

    getApiTokens Result

    The following output properties are available:

    ApiTokens List<Pulumiverse.Dynatrace.Outputs.GetApiTokensApiToken>
    Id string
    The provider-assigned unique ID for this managed resource.
    ApiTokens []GetApiTokensApiToken
    Id string
    The provider-assigned unique ID for this managed resource.
    apiTokens List<GetApiTokensApiToken>
    id String
    The provider-assigned unique ID for this managed resource.
    apiTokens GetApiTokensApiToken[]
    id string
    The provider-assigned unique ID for this managed resource.
    api_tokens Sequence[GetApiTokensApiToken]
    id str
    The provider-assigned unique ID for this managed resource.
    apiTokens List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    GetApiTokensApiToken

    CreationDate string
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    LastUsedDate string
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    LastUsedIpAddress string
    Token last used IP address.
    ModifiedDate string
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    Name string
    The name of the token.
    Owner string
    The owner of the token
    Scopes List<string>
    A list of the scopes to be assigned to the token.
    Token string
    The secret of the token.
    Enabled bool
    The token is enabled (true) or disabled (false), default disabled (false).
    ExpirationDate string
    The expiration date of the token.
    PersonalAccessToken bool
    The token is a personal access token (true) or an API token (false).
    CreationDate string
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    LastUsedDate string
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    LastUsedIpAddress string
    Token last used IP address.
    ModifiedDate string
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    Name string
    The name of the token.
    Owner string
    The owner of the token
    Scopes []string
    A list of the scopes to be assigned to the token.
    Token string
    The secret of the token.
    Enabled bool
    The token is enabled (true) or disabled (false), default disabled (false).
    ExpirationDate string
    The expiration date of the token.
    PersonalAccessToken bool
    The token is a personal access token (true) or an API token (false).
    creationDate String
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedDate String
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedIpAddress String
    Token last used IP address.
    modifiedDate String
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    name String
    The name of the token.
    owner String
    The owner of the token
    scopes List<String>
    A list of the scopes to be assigned to the token.
    token String
    The secret of the token.
    enabled Boolean
    The token is enabled (true) or disabled (false), default disabled (false).
    expirationDate String
    The expiration date of the token.
    personalAccessToken Boolean
    The token is a personal access token (true) or an API token (false).
    creationDate string
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedDate string
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedIpAddress string
    Token last used IP address.
    modifiedDate string
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    name string
    The name of the token.
    owner string
    The owner of the token
    scopes string[]
    A list of the scopes to be assigned to the token.
    token string
    The secret of the token.
    enabled boolean
    The token is enabled (true) or disabled (false), default disabled (false).
    expirationDate string
    The expiration date of the token.
    personalAccessToken boolean
    The token is a personal access token (true) or an API token (false).
    creation_date str
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    last_used_date str
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    last_used_ip_address str
    Token last used IP address.
    modified_date str
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    name str
    The name of the token.
    owner str
    The owner of the token
    scopes Sequence[str]
    A list of the scopes to be assigned to the token.
    token str
    The secret of the token.
    enabled bool
    The token is enabled (true) or disabled (false), default disabled (false).
    expiration_date str
    The expiration date of the token.
    personal_access_token bool
    The token is a personal access token (true) or an API token (false).
    creationDate String
    Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedDate String
    Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
    lastUsedIpAddress String
    Token last used IP address.
    modifiedDate String
    Token last modified date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
    name String
    The name of the token.
    owner String
    The owner of the token
    scopes List<String>
    A list of the scopes to be assigned to the token.
    token String
    The secret of the token.
    enabled Boolean
    The token is enabled (true) or disabled (false), default disabled (false).
    expirationDate String
    The expiration date of the token.
    personalAccessToken Boolean
    The token is a personal access token (true) or an API token (false).

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse