Dynatrace v0.21.0 published on Sunday, Nov 17, 2024 by Pulumiverse
dynatrace.getApiTokens
Explore with Pulumi AI
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, map[string]interface{}{}, 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:
- Api
Tokens List<Pulumiverse.Dynatrace. Outputs. Get Api Tokens Api Token> - Id string
- The provider-assigned unique ID for this managed resource.
- Api
Tokens []GetApi Tokens Api Token - Id string
- The provider-assigned unique ID for this managed resource.
- api
Tokens List<GetApi Tokens Api Token> - id String
- The provider-assigned unique ID for this managed resource.
- api
Tokens GetApi Tokens Api Token[] - id string
- The provider-assigned unique ID for this managed resource.
- api_
tokens Sequence[GetApi Tokens Api Token] - id str
- The provider-assigned unique ID for this managed resource.
- api
Tokens List<Property Map> - id String
- The provider-assigned unique ID for this managed resource.
Supporting Types
GetApiTokensApiToken
- Creation
Date string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used stringDate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used stringIp Address - Token last used IP address.
- Modified
Date 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).
- Expiration
Date string - The expiration date of the token.
- Personal
Access boolToken - The token is a personal access token (true) or an API token (false).
- Creation
Date string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used stringDate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- Last
Used stringIp Address - Token last used IP address.
- Modified
Date 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).
- Expiration
Date string - The expiration date of the token.
- Personal
Access boolToken - The token is a personal access token (true) or an API token (false).
- creation
Date String - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used StringDate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used StringIp Address - Token last used IP address.
- modified
Date 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).
- expiration
Date String - The expiration date of the token.
- personal
Access BooleanToken - The token is a personal access token (true) or an API token (false).
- creation
Date string - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used stringDate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used stringIp Address - Token last used IP address.
- modified
Date 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).
- expiration
Date string - The expiration date of the token.
- personal
Access booleanToken - 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_ strdate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last_
used_ strip_ address - 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_ booltoken - The token is a personal access token (true) or an API token (false).
- creation
Date String - Token creation date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used StringDate - Token last used date in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')
- last
Used StringIp Address - Token last used IP address.
- modified
Date 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).
- expiration
Date String - The expiration date of the token.
- personal
Access BooleanToken - 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.