platformtoken

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles platform token resources via the Account Management API.

func NewHandler

func NewHandler(c *httpclient.Client, accountUUID string) *Handler

NewHandler creates a new platform token handler.

func (*Handler) Create

Create creates a new platform token.

func (*Handler) List

func (h *Handler) List(ctx context.Context) ([]PlatformToken, error)

List returns all platform tokens for the account.

func (*Handler) Revoke

func (h *Handler) Revoke(ctx context.Context, tokenID string) error

Revoke deletes (revokes) a platform token by ID.

type PlatformToken

type PlatformToken struct {
	Name           string   `json:"name"`
	TokenID        string   `json:"tokenId"`
	Token          string   `json:"token,omitempty"` // secret, returned only on create
	AccountUUID    string   `json:"accountUuid,omitempty"`
	Scope          []string `json:"scope"`
	Resource       []string `json:"resource,omitempty"`
	Status         string   `json:"status,omitempty"`
	ExpirationDate string   `json:"expirationDate,omitempty"`
	CreatedAt      string   `json:"createdAt,omitempty"`
	Owner          string   `json:"owner,omitempty"`
}

PlatformToken represents a Dynatrace platform token.

type PlatformTokenCreate

type PlatformTokenCreate struct {
	Name           string   `json:"name"`
	UserUUID       string   `json:"userUuid"`
	Scope          []string `json:"scope"`
	Resource       []string `json:"resource,omitempty"`
	Tags           []string `json:"tags,omitempty"`
	ExpirationDate string   `json:"expirationDate"`
}

PlatformTokenCreate is the request body for creating a platform token.

type PlatformTokenListResponse

type PlatformTokenListResponse struct {
	Total      int             `json:"total"`
	PageSize   int             `json:"pageSize"`
	PageNumber int             `json:"pageNumber"`
	Results    []PlatformToken `json:"results"`
}

PlatformTokenListResponse wraps the list API page response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL