Documentation ¶
Index ¶
- Variables
- func WithAutoServerVersion() func(client *DynatraceClient)
- func WithCachingDisabled(disabled bool) func(client *DynatraceClient)
- func WithClientRequestLimiter(limiter *concurrency.Limiter) func(client *DynatraceClient)
- func WithCustomUserAgentString(userAgent string) func(client *DynatraceClient)
- func WithExternalIDGenerator(g idutils.ExternalIDGenerator) func(client *DynatraceClient)
- func WithRetrySettings(retrySettings rest.RetrySettings) func(*DynatraceClient)
- func WithServerVersion(serverVersion version.Version) func(client *DynatraceClient)
- type DataEntry
- type DownloadSettingsObject
- type DummyClient
- func (c *DummyClient) ConfigExistsByName(_ context.Context, a api.API, name string) (exists bool, id string, err error)
- func (c *DummyClient) CreatedObjects() int
- func (c *DummyClient) DeleteConfigById(a api.API, id string) error
- func (c *DummyClient) DeleteSettings(_ string) error
- func (c *DummyClient) GetEntries(a api.API) ([]DataEntry, bool)
- func (c *DummyClient) GetSchemaById(_ string) (schema Schema, err error)
- func (c *DummyClient) GetSettingById(_ string) (*DownloadSettingsObject, error)
- func (c *DummyClient) ListConfigs(_ context.Context, a api.API) (values []Value, err error)
- func (c *DummyClient) ListSchemas() (SchemaList, error)
- func (c *DummyClient) ListSettings(_ context.Context, _ string, _ ListSettingsOptions) ([]DownloadSettingsObject, error)
- func (c *DummyClient) ReadConfigById(a api.API, id string) ([]byte, error)
- func (c *DummyClient) UpsertConfigByName(_ context.Context, a api.API, name string, data []byte) (entity DynatraceEntity, err error)
- func (c *DummyClient) UpsertConfigByNonUniqueNameAndId(_ context.Context, a api.API, entityId string, name string, data []byte, ...) (entity DynatraceEntity, err error)
- func (c *DummyClient) UpsertSettings(_ context.Context, obj SettingsObject, _ UpsertSettingsOptions) (DynatraceEntity, error)
- type DynatraceClient
- func (d *DynatraceClient) ConfigExistsByName(ctx context.Context, api api.API, name string) (exists bool, id string, err error)
- func (d *DynatraceClient) DeleteConfigById(api api.API, id string) (err error)
- func (d *DynatraceClient) DeleteSettings(objectID string) (err error)
- func (d *DynatraceClient) GetSchemaById(schemaID string) (constraints Schema, err error)
- func (d *DynatraceClient) GetSettingById(objectId string) (res *DownloadSettingsObject, err error)
- func (d *DynatraceClient) ListConfigs(ctx context.Context, api api.API) (values []Value, err error)
- func (d *DynatraceClient) ListSchemas() (schemas SchemaList, err error)
- func (d *DynatraceClient) ListSettings(ctx context.Context, schemaId string, opts ListSettingsOptions) (res []DownloadSettingsObject, err error)
- func (d *DynatraceClient) ReadConfigById(api api.API, id string) (json []byte, err error)
- func (d *DynatraceClient) UpsertConfigByName(ctx context.Context, api api.API, name string, payload []byte) (entity DynatraceEntity, err error)
- func (d *DynatraceClient) UpsertConfigByNonUniqueNameAndId(ctx context.Context, api api.API, entityId string, name string, payload []byte, ...) (entity DynatraceEntity, err error)
- func (d *DynatraceClient) UpsertSettings(ctx context.Context, obj SettingsObject, options UpsertSettingsOptions) (result DynatraceEntity, err error)
- type DynatraceEntity
- type KeyUserActionsMobileResponse
- type ListSettingsFilter
- type ListSettingsOptions
- type Properties
- type Schema
- type SchemaList
- type SchemaListResponse
- type SettingsModificationInfo
- type SettingsObject
- type SyntheticEntity
- type SyntheticLocationResponse
- type SyntheticMonitorsResponse
- type SyntheticValue
- type UpsertSettingsOptions
- type UserActionAndSessionPropertyEntry
- type UserActionAndSessionPropertyResponse
- type Value
- type ValuesResponse
Constants ¶
This section is empty.
Variables ¶
var ErrSettingNotFound = errors.New("settings object not found")
ErrSettingNotFound is returned when no settings 2.0 object could be found
Functions ¶
func WithAutoServerVersion ¶
func WithAutoServerVersion() func(client *DynatraceClient)
WithAutoServerVersion can be used to let the client automatically determine the Dynatrace server version during creation using newDynatraceClient. If the server version is already known WithServerVersion should be used
func WithCachingDisabled ¶ added in v2.6.0
func WithCachingDisabled(disabled bool) func(client *DynatraceClient)
WithCachingDisabled allows disabling the client's builtin caching mechanism for classic configs, schema constraints and settings objects. Disabling the caching is recommended in situations where configs are fetched immediately after their creation (e.g. in test scenarios)
func WithClientRequestLimiter ¶
func WithClientRequestLimiter(limiter *concurrency.Limiter) func(client *DynatraceClient)
WithClientRequestLimiter specifies that a specifies the limiter to be used for limiting parallel client requests
func WithCustomUserAgentString ¶
func WithCustomUserAgentString(userAgent string) func(client *DynatraceClient)
WithCustomUserAgentString allows to configure a custom user-agent string that the Client will send with each HTTP request If none is set, the default Monaco CLI specific user-agent is sent.
func WithExternalIDGenerator ¶
func WithExternalIDGenerator(g idutils.ExternalIDGenerator) func(client *DynatraceClient)
func WithRetrySettings ¶
func WithRetrySettings(retrySettings rest.RetrySettings) func(*DynatraceClient)
WithRetrySettings sets the retry settings to be used by the DynatraceClient
func WithServerVersion ¶
func WithServerVersion(serverVersion version.Version) func(client *DynatraceClient)
WithServerVersion sets the Dynatrace version of the Dynatrace server/tenant the client will be interacting with
Types ¶
type DownloadSettingsObject ¶
type DownloadSettingsObject struct { ExternalId string `json:"externalId"` SchemaVersion string `json:"schemaVersion"` SchemaId string `json:"schemaId"` ObjectId string `json:"objectId"` Scope string `json:"scope"` Value json.RawMessage `json:"value"` ModificationInfo *SettingsModificationInfo `json:"modificationInfo"` }
DownloadSettingsObject is the response type for the ListSettings operation
type DummyClient ¶
type DummyClient struct { Fs afero.Fs RequestOutputDir string // contains filtered or unexported fields }
func (*DummyClient) ConfigExistsByName ¶
func (*DummyClient) CreatedObjects ¶ added in v2.6.0
func (c *DummyClient) CreatedObjects() int
func (*DummyClient) DeleteConfigById ¶
func (c *DummyClient) DeleteConfigById(a api.API, id string) error
func (*DummyClient) DeleteSettings ¶
func (c *DummyClient) DeleteSettings(_ string) error
func (*DummyClient) GetEntries ¶ added in v2.6.0
func (c *DummyClient) GetEntries(a api.API) ([]DataEntry, bool)
func (*DummyClient) GetSchemaById ¶ added in v2.14.0
func (c *DummyClient) GetSchemaById(_ string) (schema Schema, err error)
func (*DummyClient) GetSettingById ¶
func (c *DummyClient) GetSettingById(_ string) (*DownloadSettingsObject, error)
func (*DummyClient) ListConfigs ¶
func (*DummyClient) ListSchemas ¶
func (c *DummyClient) ListSchemas() (SchemaList, error)
func (*DummyClient) ListSettings ¶
func (c *DummyClient) ListSettings(_ context.Context, _ string, _ ListSettingsOptions) ([]DownloadSettingsObject, error)
func (*DummyClient) ReadConfigById ¶
func (*DummyClient) UpsertConfigByName ¶
func (c *DummyClient) UpsertConfigByName(_ context.Context, a api.API, name string, data []byte) (entity DynatraceEntity, err error)
func (*DummyClient) UpsertConfigByNonUniqueNameAndId ¶
func (*DummyClient) UpsertSettings ¶
func (c *DummyClient) UpsertSettings(_ context.Context, obj SettingsObject, _ UpsertSettingsOptions) (DynatraceEntity, error)
type DynatraceClient ¶
type DynatraceClient struct {
// contains filtered or unexported fields
}
DynatraceClient is the default implementation of the HTTP client targeting the relevant Dynatrace APIs for Monaco
func NewClassicClient ¶
func NewClassicClient(dtURL string, client *rest.Client, opts ...func(dynatraceClient *DynatraceClient)) (*DynatraceClient, error)
NewClassicClient creates a new dynatrace client to be used for classic environments
func NewPlatformClient ¶
func NewPlatformClient(dtURL string, classicURL string, client *rest.Client, classicClient *rest.Client, opts ...func(dynatraceClient *DynatraceClient)) (*DynatraceClient, error)
NewPlatformClient creates a new dynatrace client to be used for platform enabled environments
func (*DynatraceClient) ConfigExistsByName ¶
func (*DynatraceClient) DeleteConfigById ¶
func (d *DynatraceClient) DeleteConfigById(api api.API, id string) (err error)
func (*DynatraceClient) DeleteSettings ¶
func (d *DynatraceClient) DeleteSettings(objectID string) (err error)
func (*DynatraceClient) GetSchemaById ¶ added in v2.14.0
func (d *DynatraceClient) GetSchemaById(schemaID string) (constraints Schema, err error)
func (*DynatraceClient) GetSettingById ¶
func (d *DynatraceClient) GetSettingById(objectId string) (res *DownloadSettingsObject, err error)
func (*DynatraceClient) ListConfigs ¶
func (*DynatraceClient) ListSchemas ¶
func (d *DynatraceClient) ListSchemas() (schemas SchemaList, err error)
func (*DynatraceClient) ListSettings ¶
func (d *DynatraceClient) ListSettings(ctx context.Context, schemaId string, opts ListSettingsOptions) (res []DownloadSettingsObject, err error)
func (*DynatraceClient) ReadConfigById ¶
func (*DynatraceClient) UpsertConfigByName ¶
func (d *DynatraceClient) UpsertConfigByName(ctx context.Context, api api.API, name string, payload []byte) (entity DynatraceEntity, err error)
func (*DynatraceClient) UpsertConfigByNonUniqueNameAndId ¶
func (*DynatraceClient) UpsertSettings ¶
func (d *DynatraceClient) UpsertSettings(ctx context.Context, obj SettingsObject, options UpsertSettingsOptions) (result DynatraceEntity, err error)
type DynatraceEntity ¶
type KeyUserActionsMobileResponse ¶ added in v2.10.1
type KeyUserActionsMobileResponse struct { KeyUserActions []struct { Name string `json:"name"` } `json:"keyUserActions"` }
type ListSettingsFilter ¶
type ListSettingsFilter func(DownloadSettingsObject) bool
ListSettingsFilter can be used to filter fetched settings objects with custom criteria, e.g. o.ExternalId == ""
type ListSettingsOptions ¶
type ListSettingsOptions struct { // DiscardValue specifies whether the value field of the returned // settings object shall be included in the payload DiscardValue bool // ListSettingsFilter can be set to pre-filter the result given a special logic Filter ListSettingsFilter }
ListSettingsOptions are additional options for the ListSettings method of the Settings client
type Properties ¶
type Properties struct {
Version *string `json:"version"`
}
type SchemaList ¶
type SchemaListResponse ¶
type SchemaListResponse struct { Items SchemaList `json:"items"` TotalCount int `json:"totalCount"` }
SchemaListResponse is the response type returned by the ListSchemas operation
type SettingsObject ¶
type SettingsObject struct { // Coordinate holds all the information for Monaco to identify a settings object Coordinate coordinate.Coordinate // SchemaId is the Dynatrace settings schema ID SchemaId, SchemaVersion, Scope string // Content is the rendered config for the given settings object Content []byte // OriginObjectId is the object id of the Settings object when it was downloaded from an environment OriginObjectId string }
SettingsObject contains all the information necessary to create/update a settings object
type SyntheticEntity ¶
type SyntheticEntity struct {
EntityId string `json:"entityId"`
}
type SyntheticLocationResponse ¶
type SyntheticLocationResponse struct {
Locations []SyntheticValue `json:"locations"`
}
type SyntheticMonitorsResponse ¶
type SyntheticMonitorsResponse struct {
Monitors []SyntheticValue `json:"monitors"`
}
type SyntheticValue ¶
type UpsertSettingsOptions ¶ added in v2.8.1
type UpsertSettingsOptions struct { OverrideRetry *rest.RetrySetting InsertAfter string }
type UserActionAndSessionPropertyEntry ¶ added in v2.11.0
type UserActionAndSessionPropertyResponse ¶ added in v2.11.0
type UserActionAndSessionPropertyResponse struct { SessionProperties []UserActionAndSessionPropertyEntry `json:"sessionProperties"` UserActionProperties []UserActionAndSessionPropertyEntry `json:"userActionProperties"` }
type Value ¶
type Value struct { Id string `json:"id"` Name string `json:"name"` // Owner is used by dashboards to indicate the creator of the dashboard. We use it to filter Dynatrace created dashboards. Owner *string `json:"owner,omitempty"` // Type is used by synthetic-locations to indicate whether it is a PRIVATE location or not. Type *string `json:"type,omitempty"` // CustomFields holds additional fields. Note that this is not set automatically but would need to be populated // when unmarshalling the payload CustomFields map[string]any `json:"-"` }
type ValuesResponse ¶
type ValuesResponse struct {
Values []Value `json:"values"`
}