api

package
v2.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertingProfile                      = "alerting-profile"
	NetworkZone                          = "network-zone"
	ManagementZone                       = "management-zone"
	Autotag                              = "auto-tag"
	Dashboard                            = "dashboard"
	DashboardShareSettings               = "dashboard-share-settings"
	DashboardV2                          = "dashboard-v2"
	Notification                         = "notification"
	Extension                            = "extension"
	ExtensionElasticSearch               = "extension-elasticsearch"
	CustomServiceJava                    = "custom-service-java"
	CustomServiceDotNet                  = "custom-service-dotnet"
	CustomServiceGo                      = "custom-service-go"
	CustomServiceNodeJs                  = "custom-service-nodejs"
	CustomServicePhp                     = "custom-service-php"
	AnomalyDetectionMetrics              = "anomaly-detection-metrics"
	AnomalyDetectionDisks                = "anomaly-detection-disks"
	SyntheticLocation                    = "synthetic-location"
	SyntheticMonitor                     = "synthetic-monitor"
	ApplicationWeb                       = "application-web"
	ApplicationMobile                    = "application-mobile"
	AppDetectionRule                     = "app-detection-rule"
	AwsCredentials                       = "aws-credentials"
	KubernetesCredentials                = "kubernetes-credentials" // #nosec G101
	AzureCredentials                     = "azure-credentials"      // #nosec G101
	RequestAttributes                    = "request-attributes"
	CalculatedMetricsService             = "calculated-metrics-service"
	CalculatedMetricsLog                 = "calculated-metrics-log"
	CalculatedMetricsApplicationMobile   = "calculated-metrics-application-mobile"
	CalculatedMetricsSynthetic           = "calculated-metrics-synthetic"
	CalculatedMetricsApplicationWeb      = "calculated-metrics-application-web"
	ConditionalNamingProcessgroup        = "conditional-naming-processgroup"
	ConditionalNamingHost                = "conditional-naming-host"
	ConditionalNamingService             = "conditional-naming-service"
	MaintenanceWindow                    = "maintenance-window"
	RequestNamingService                 = "request-naming-service"
	Slo                                  = "slo"
	CredentialVault                      = "credential-vault" // #nosec G101
	FailureDetectionParametersets        = "failure-detection-parametersets"
	FailureDetectionRules                = "failure-detection-rules"
	ServiceDetectionFullWebRequest       = "service-detection-full-web-request"
	ServiceDetectionFullWebService       = "service-detection-full-web-service"
	ServiceDetectionOpaqueWebRequest     = "service-detection-opaque-web-request"
	ServiceDetectionOpaqueWebService     = "service-detection-opaque-web-service"
	Reports                              = "reports"
	FrequentIssueDetection               = "frequent-issue-detection"
	DataPrivacy                          = "data-privacy"
	HostsAutoUpdate                      = "hosts-auto-update"
	AnomalyDetectionApplications         = "anomaly-detection-applications"
	AnomalyDetectionAws                  = "anomaly-detection-aws"
	AnomalyDetectionDatabaseServices     = "anomaly-detection-database-services"
	AnomalyDetectionHosts                = "anomaly-detection-hosts"
	AnomalyDetectionServices             = "anomaly-detection-services"
	AnomalyDetectionVmware               = "anomaly-detection-vmware"
	ServiceResourceNaming                = "service-resource-naming"
	AppDetectionRuleHost                 = "app-detection-rule-host"
	ContentResources                     = "content-resources"
	AllowedBeaconOrigins                 = "allowed-beacon-origins"
	GeoIpDetectionHeaders                = "geo-ip-detection-headers"
	GeoIpAddressMappings                 = "geo-ip-address-mappings"
	KeyUserActionsMobile                 = "key-user-actions-mobile"
	KeyUserActionsWeb                    = "key-user-actions-web"
	UserActionAndSessionPropertiesMobile = "user-action-and-session-properties-mobile"
)
View Source
const StandardApiPropertyNameOfGetAllResponse string = "values"

Variables

This section is empty.

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

func RemoveDisabled added in v2.10.1

func RemoveDisabled(api API) bool

RemoveDisabled filter every endpoint for which all of required featureflags.FeatureFlag aren't set

func RemoveNonDeletable added in v2.12.0

func RemoveNonDeletable(api API) bool

RemoveNonDeletable filters every api for which configs are not deletable

Types

type API

type API struct {
	ID string
	//URLPath defines default path
	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
	// TweakResponseFunc can be optionally registered to add custom code that changes the
	// payload of the downloaded api content (e.g. to exclude unwanted/unnecessary fields)
	TweakResponseFunc func(map[string]any)
	// Parent is used for SubPath APIs to store the related configuration.
	Parent *API
	// AppliedParentObjectID is the parent object ID for a SubPath API once it has been applied.
	AppliedParentObjectID string
	// CheckEqualFunc can be used to compare existing objects with current objects based on their payload
	CheckEqualFunc func(map[string]any, map[string]any) bool
	// RequireAllFF lists all feature flags that needs to be enabled in order to utilize this API
	RequireAllFF []featureflags.FeatureFlag
	// PropertyNameOfIdentifier defines the id field if it's not called 'ID'
	PropertyNameOfIdentifier string
	// NonDeletable indicates that configs of that type cannot be deleted
	NonDeletable bool
	// DeployWaitDuration defines the amount of time that shall elapse between deploying configs of this type.
	// Note, that this only applies to configs within the same independent graph component
	DeployWaitDuration time.Duration
}

API structure present definition of config endpoints

func (API) ApplyParentObjectID added in v2.12.0

func (a API) ApplyParentObjectID(parentObjectID string) API

ApplyParentObjectID returns a new API instance with the specified parent object ID applied within the URLPath.

func (API) HasParent added in v2.11.0

func (a API) HasParent() bool

HasParent returns true iff the API has a relation to another (parent) API. This is typically the case for "Sub-path" APIs, e.g. Key User Actions for Mobile applications. In this case "mobile-application" would be the parent API, which is also reflected in the URLs to be used to query and create key user actions.

func (API) IsStandardAPI

func (a API) IsStandardAPI() bool

func (API) String added in v2.12.0

func (a API) String() string

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 types of APIs

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 Config added in v2.11.0

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

func (Config) Id added in v2.11.0

func (p Config) Id() string

func (Config) Type added in v2.11.0

func (p Config) Type() string

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