api

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StandardApiPropertyNameOfGetAllResponse = "values"

Functions

func GetV2ID

func GetV2ID(forV1Api API) string

GetV2ID returns the ID of APIs in v2 - replacing deprecated APIs with their new version and dropping the -v2 marker from APIs introducing the breaking change of handling non-unique-names. This is used in v1 -> v2 conversion

Types

type API

type API struct {
	ID                           string
	URLPath                      string
	PropertyNameOfGetAllResponse string
	// SingleConfiguration are those APIs that configure an environment global setting.
	// Such settings require additional handling and can't be deleted.
	SingleConfiguration bool
	// NonUniqueName name APIs are those APIs that don't work with an environment wide unique ID.
	// For such APIs, the name attribute can't be used as a ID (Monaco default behavior), hence
	// such APIs require additional handling.
	NonUniqueName bool
	DeprecatedBy  string
	// SkipDownload indicates whether an API should be downloaded or not.
	//
	// Some APIs are not re-uploadable by design, either as they require hidden credentials,
	// or if they require a special format, e.g. a zip file.
	//
	// Those configs include all configs handling credentials, as well as the extension-API.
	SkipDownload bool
}

API structure present definition of config endpoints

func (API) CreateURL

func (a API) CreateURL(environmentURL string) string

CreateURL creates final URL for given environmentUrl/domain

func (API) IsStandardAPI

func (a API) IsStandardAPI() bool

type APIs

type APIs map[string]API

APIs is a collection of API

func NewAPIs

func NewAPIs() APIs

NewAPIs returns collection of predefined API to work with Dynatrace

func NewV1APIs

func NewV1APIs() APIs

NewV1APIs returns collection of predefined API to work with Dynatrace Deprecated: Please use NewAPIs. This one is legacy and is used only to convert old to new stype of

func (APIs) Contains

func (apis APIs) Contains(api string) bool

Contains return true iff requested API is part APIs set

func (APIs) Filter

func (apis APIs) Filter(filters ...Filter) APIs

Filter apply all passed filters and return new filtered array

func (APIs) GetApiNameLookup

func (apis APIs) GetApiNameLookup() map[string]struct{}

func (APIs) GetNames

func (apis APIs) GetNames() []string

GetNames return names of API contained by this structure

type Filter

type Filter func(api API) bool

Filter return true iff specific api needs to be filtered/ removed from list

func RetainByName

func RetainByName(apis []string) Filter

RetainByName creates a Filter that leaves the API in the map if API.ID is part of the provided list. If the provided list is empty, a no-op filter is returned.

Jump to

Keyboard shortcuts

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