instances

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(projectID, instanceName, planID string) error

Validate

func ValidateInstanceName

func ValidateInstanceName(instanceName string) error

ValidateInstanceName validates argus instance name

func ValidatePlanID

func ValidatePlanID(planID string) error

ValidatePlanID validates argus instance plan ID

Types

type CreateOrUpdateRequest

type CreateOrUpdateRequest struct {
	Name       string            `json:"name"`
	PlanID     string            `json:"planId"`
	Parameters map[string]string `json:"parameter"`
}

CreateOrUpdateRequest is the structure needed for creating or updating an instance

type CreateOrUpdateResponse

type CreateOrUpdateResponse struct {
	Message      string `json:"message,omitempty"`
	InstanceID   string `json:"instanceId,omitempty"`
	DashboardURL string `json:"dashboardUrl,omitempty"`
}

CreateOrUpdateResponse is the api response structure for instance creation/update

type Instance

type Instance struct {
	Message      string                  `json:"message,omitempty"`
	Error        string                  `json:"error,omitempty"`
	DashboardURL string                  `json:"dashboardUrl,omitempty"`
	IsUpdatable  bool                    `json:"isUpdatable,omitempty"`
	Name         string                  `json:"name,omitempty"`
	Parameters   map[string]string       `json:"parameters,omitempty"`
	ID           string                  `json:"id,omitempty"`
	ServiceName  string                  `json:"serviceName,omitempty"`
	PlanID       string                  `json:"planId,omitempty"`
	PlanName     string                  `json:"planName,omitempty"`
	PlanSchema   string                  `json:"planSchema,omitempty"`
	Status       string                  `json:"status,omitempty"`
	Instance     InstanceSensitiveFields `json:"instance,omitempty"`
}

Instance is the structure returned when reading a single instance

type InstanceItem

type InstanceItem struct {
	ID          string `json:"id,omitempty"`
	PlanName    string `json:"planName,omitempty"`
	Instance    string `json:"instance,omitempty"`
	Name        string `json:"name,omitempty"`
	Status      string `json:"status,omitempty"`
	ServiceName string `json:"serviceName,omitempty"`
}

InstanceItem is an item in the list of instances from the list api endpoint

type InstanceList

type InstanceList struct {
	Message   string         `json:"message,omitempty"`
	Instances []InstanceItem `json:"instances"`
}

InstanceList is the structure returned from the list api endpoint

type InstanceSensitiveFields

type InstanceSensitiveFields struct {
	Instance                string        `json:"instance,omitempty"`
	Cluster                 string        `json:"cluster,omitempty"`
	GrafanaURL              string        `json:"grafanaUrl,omitempty"`
	DashboardURL            string        `json:"dashboardUrl,omitempty"`
	GrafanaPlugins          []interface{} `json:"grafanaPlugins,omitempty"`
	Name                    string        `json:"name,omitempty"`
	GrafanaAdminPassword    string        `json:"grafanaAdminPassword,omitempty"`
	GrafanaAdminUser        string        `json:"grafanaAdminUser,omitempty"`
	MetricsRetentionTimeRaw int           `json:"metricsRetentionTimeRaw,omitempty"`
	MetricsRetentionTime5m  int           `json:"MetricsRetentionTime5m,omitempty"`
	MetricsRetentionTime1h  int           `json:"MetricsRetentionTime1h,omitempty"`
	MetricsURL              string        `json:"metricsUrl,omitempty"`
	PushMetricsURL          string        `json:"pushMetricsUrl,omitempty"`
	GrafanaPublicReadAccess bool          `json:"grafanaPublicReadAccess,omitempty"`
	TargetsURL              string        `json:"targetsUrl,omitempty"`
	AlertingURL             string        `json:"alertingUrl,omitempty"`
	Plan                    plans.Plan    `json:"plan,omitempty"`
	LogsURL                 string        `json:"logsUrl,omitempty"`
	LogsPushURL             string        `json:"logsPushUrl,omitempty"`
	JaegerTracesURL         string        `json:"jaegerTracesUrl,omitempty"`
	OtlpTracesURL           string        `json:"otlpTracesUrl,omitempty"`
	ZipkinSpansURL          string        `json:"zipkinSpansUrl,omitempty"`
	JaegerUIURL             string        `json:"jaegerUiUrl,omitempty"`
}

InstanceSensitiveFields provides more elaborated information of the instance, including sensitive data

type InstancesService

type InstancesService common.Service

InstancesService is the service that handles CRUD functionality for Argus instances and also wraps instance credentials service

func (*InstancesService) Create

func (svc *InstancesService) Create(ctx context.Context, projectID, instanceName, planID string, params map[string]string) (res CreateOrUpdateResponse, w *wait.Handler, err error)

Create creates a new Argus instance and returns the server response (CreateOrUpdateResponse) and a wait handler which upon call to `Wait()` will wait until the instance is successfully created Wait() returns the full instance details (Instance) and error if it occurred See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_create

func (*InstancesService) Delete

func (svc *InstancesService) Delete(ctx context.Context, projectID, instanceID string) (res Instance, w *wait.Handler, err error)

Delete deleted an instance by project and instance IDs Delete returns the instance information (Instance), wait handler to wait for the full deletion, and an error See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_delete

func (*InstancesService) Get

func (svc *InstancesService) Get(ctx context.Context, projectID, instanceID string) (res Instance, err error)

Get returns the instance information by project and instance IDs See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_read

func (*InstancesService) List

func (svc *InstancesService) List(ctx context.Context, projectID string) (res InstanceList, err error)

List returns a list of argus instances in project See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_list

func (*InstancesService) Update

func (svc *InstancesService) Update(ctx context.Context, projectID, instanceID, instanceName, planID string, params map[string]string) (res CreateOrUpdateResponse, w *wait.Handler, err error)

Update updates a new Argus instance returns API response CreateOrUpdateResponse, wait handler and error The wait handler will wait for the instance status to be set to "UPDATE_SUCCEEDED" or "CREATE_SUCCEEDED" Wait() returns the instance (Instance struct) and error if failed See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_update

Jump to

Keyboard shortcuts

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