edgeconnect

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBaseURL

func WithBaseURL(url string) func(*client)

func WithContext

func WithContext(ctx context.Context) func(*client)

WithContext can set context for client NB: via context you can override default http client to add Proxy or CA certificates

func WithOauthScopes

func WithOauthScopes(scopes []string) func(*client)

func WithTokenURL

func WithTokenURL(url string) func(*client)

Types

type Client

type Client interface {
	// GetEdgeConnect return details of single edge connect
	GetEdgeConnect(edgeConnectId string) (GetResponse, error)

	// CreateEdgeConnect creates edge connect
	CreateEdgeConnect(name string, hostPatterns []string, oauthClientId string) (CreateResponse, error)

	// UpdateEdgeConnect updates edge connect
	UpdateEdgeConnect(edgeConnectId, name string, hostPatterns []string, oauthClientId string) error

	// DeleteEdgeConnect deletes edge connect
	DeleteEdgeConnect(edgeConnectId string) error

	// GetEdgeConnects returns list of edge connects
	GetEdgeConnects(name string) (ListResponse, error)
}

Client is the interface for the Dynatrace EdgeConnect REST API client.

func NewClient

func NewClient(clientID, clientSecret string, options ...Option) (Client, error)

NewClient creates a REST client for the given API base URL options can be used to customize the created client.

type ConstraintViolations

type ConstraintViolations struct {
	Message           string `json:"message"`
	Path              string `json:"path,omitempty"`
	ParameterLocation string `json:"parameterLocation,omitempty"`
}

ConstraintViolations represents constraint violation errors

type CreateResponse

type CreateResponse struct {
	ID                         string           `json:"id,omitempty"`
	Name                       string           `json:"name"`
	HostPatterns               []string         `json:"hostPatterns"`
	OauthClientId              string           `json:"oauthClientId"`
	OauthClientSecret          string           `json:"oauthClientSecret"`
	OauthClientResource        string           `json:"oauthClientResource"`
	ModificationInfo           ModificationInfo `json:"modificationInfo"`
	Metadata                   Metadata         `json:"metadata"`
	ManagedByDynatraceOperator bool             `json:"managedByDynatraceOperator,omitempty"`
}

type DetailsError

type DetailsError struct {
	ConstraintViolations ConstraintViolations `json:"constraintViolations"`
	MissingScopes        []string             `json:"missingScopes,omitempty"`
}

DetailsError represents details of errors

type GetResponse

type GetResponse struct {
	ID                         string           `json:"id,omitempty"`
	Name                       string           `json:"name"`
	HostPatterns               []string         `json:"hostPatterns"`
	OauthClientId              string           `json:"oauthClientId"`
	ModificationInfo           ModificationInfo `json:"modificationInfo"`
	Metadata                   Metadata         `json:"metadata"`
	ManagedByDynatraceOperator bool             `json:"managedByDynatraceOperator,omitempty"`
}

type Instance

type Instance struct {
	Version    string `json:"version,omitempty"`
	InstanceId string `json:"instanceId,omitempty"`
}

type ListResponse

type ListResponse struct {
	EdgeConnects []GetResponse `json:"edgeConnects"`
	TotalCount   int           `json:"totalCount"`
}

type Metadata

type Metadata struct {
	Instances         []Instance `json:"instances"`
	OauthClientStatus string     `json:"oauthClientStatus"`
}

type ModificationInfo

type ModificationInfo struct {
	LastModifiedBy   string     `json:"lastModifiedBy,omitempty"`
	LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty"`
}

type OauthClientStatus

type OauthClientStatus int

type Option

type Option func(client *client)

Option can be passed to NewClient and customizes the created client instance.

type Request

type Request struct {
	Name                       string   `json:"name"`
	HostPatterns               []string `json:"hostPatterns"`
	OauthClientId              string   `json:"oauthClientId,omitempty"`
	ManagedByDynatraceOperator bool     `json:"managedByDynatraceOperator,omitempty"`
}

func NewRequest

func NewRequest(name string, hostPatterns []string, oauthClientId string) *Request

type ServerError

type ServerError struct {
	Code    int          `json:"code,omitempty"`
	Message string       `json:"message,omitempty"`
	Details DetailsError `json:"details"`
}

ServerError represents an error returned from the server (e.g. authentication failure).

func (ServerError) Error

func (e ServerError) Error() string

Error formats the server error code and message.

Jump to

Keyboard shortcuts

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