edgeconnect

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 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 {
	ModificationInfo           ModificationInfo `json:"modificationInfo"`
	Metadata                   Metadata         `json:"metadata"`
	ID                         string           `json:"id,omitempty"`
	Name                       string           `json:"name"`
	OauthClientId              string           `json:"oauthClientId"`
	OauthClientSecret          string           `json:"oauthClientSecret"`
	OauthClientResource        string           `json:"oauthClientResource"`
	HostPatterns               []string         `json:"hostPatterns"`
	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 {
	ModificationInfo           ModificationInfo `json:"modificationInfo"`
	Metadata                   Metadata         `json:"metadata"`
	ID                         string           `json:"id,omitempty"`
	Name                       string           `json:"name"`
	OauthClientId              string           `json:"oauthClientId"`
	HostPatterns               []string         `json:"hostPatterns"`
	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 {
	OauthClientStatus string     `json:"oauthClientStatus"`
	Instances         []Instance `json:"instances"`
}

type ModificationInfo

type ModificationInfo struct {
	LastModifiedTime *time.Time `json:"lastModifiedTime,omitempty"`
	LastModifiedBy   string     `json:"lastModifiedBy,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"`
	OauthClientId              string   `json:"oauthClientId,omitempty"`
	HostPatterns               []string `json:"hostPatterns"`
	ManagedByDynatraceOperator bool     `json:"managedByDynatraceOperator,omitempty"`
}

func NewRequest

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

type ServerError

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

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