Documentation ¶
Index ¶
- func ValidateDurations(intervalDuration, timeoutDuration string) error
- func ValidateJobName(name string) error
- func ValidateMetricsPath(mp string) error
- func ValidateScheme(protocol string) error
- func ValidateStaticConfigs(sc []StaticConfig) error
- type BasicAuth
- type GetJobResponse
- type Job
- type JobsService
- func (svc *JobsService) Create(ctx context.Context, projectID, instanceID string, job Job) (res ListJobsResponse, err error)
- func (svc *JobsService) Delete(ctx context.Context, projectID, instanceID, jobName string) (res ListJobsResponse, err error)
- func (svc *JobsService) Get(ctx context.Context, projectID, instanceID, jobName string) (res GetJobResponse, err error)
- func (svc *JobsService) List(ctx context.Context, projectID, instanceID string) (res ListJobsResponse, err error)
- func (svc *JobsService) Update(ctx context.Context, projectID, instanceID string, job Job) (res ListJobsResponse, err error)
- type ListJobsResponse
- type MetricsRelabelConfig
- type OAuth2
- type ServiceDiscoryConfig
- type StaticConfig
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDurations ¶
ValidateDurations validates the scraping interval and timeout interval
func ValidateJobName ¶
ValidateJobName validates the job name
func ValidateMetricsPath ¶
ValidateMetricsPath validates the metrics path
func ValidateScheme ¶
ValidateScheme validates the protocol
func ValidateStaticConfigs ¶
func ValidateStaticConfigs(sc []StaticConfig) error
ValidateStaticConfigs validates provided static configs
Types ¶
type BasicAuth ¶
type BasicAuth struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth holds basic auth data
type GetJobResponse ¶
type GetJobResponse struct { Message string `json:"message,omitempty"` Data Job `json:"data,omitempty"` }
GetJobResponse is a struct representing the api response for a single job
type Job ¶
type Job struct { StaticConfigs []StaticConfig `json:"staticConfigs"` JobName string `json:"jobName,omitempty"` Scheme string `json:"scheme,omitempty"` ScrapeInterval string `json:"scrapeInterval,omitempty"` ScrapeTimeout string `json:"scrapeTimeout,omitempty"` MetricsPath string `json:"metricsPath,omitempty"` SampleLimit int `json:"sampleLimit,omitempty"` BasicAuth *BasicAuth `json:"basicAuth,omitempty"` OAuth2 *OAuth2 `json:"oauth2,omitempty"` TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` BearerToken string `json:"bearerToken,omitempty"` MetricsRelabelConfigs []MetricsRelabelConfig `json:"metricsRelabelConfigs,omitempty"` Params map[string]interface{} `json:"params,omitempty"` ServiceDiscoryConfigs []ServiceDiscoryConfig `json:"httpSdConfigs,omitempty"` HonorLabels bool `json:"honorLabels,omitempty"` HonorTimeStamps bool `json:"honorTimeStamps,omitempty"` }
Job is a struct representing a job
type JobsService ¶
JobsService is the service that handles CRUD functionality for Argus metric collection jobs
func (*JobsService) Create ¶
func (svc *JobsService) Create(ctx context.Context, projectID, instanceID string, job Job) (res ListJobsResponse, err error)
Create creates an argus scrape job See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_scrapeconfigs_create
func (*JobsService) Delete ¶
func (svc *JobsService) Delete(ctx context.Context, projectID, instanceID, jobName string) (res ListJobsResponse, err error)
Delete deletes an argus scrape job See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_scrapeconfigs_delete_configs
func (*JobsService) Get ¶
func (svc *JobsService) Get(ctx context.Context, projectID, instanceID, jobName string) (res GetJobResponse, err error)
Get returns an argus job by job name See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_scrapeconfigs_read
func (*JobsService) List ¶
func (svc *JobsService) List(ctx context.Context, projectID, instanceID string) (res ListJobsResponse, err error)
List returns a list of argus jobs See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_scrapeconfigs_list
func (*JobsService) Update ¶
func (svc *JobsService) Update(ctx context.Context, projectID, instanceID string, job Job) (res ListJobsResponse, err error)
Update updates an argus scrape job See also https://api.stackit.schwarz/argus-monitoring-service/openapi.v1.html#operation/v1_projects_instances_scrapeconfigs_create
type ListJobsResponse ¶
type ListJobsResponse struct { Message string `json:"message,omitempty"` Data []Job `json:"data,omitempty"` }
ListJobsResponse is a struct representing the api response for listing jobs
type MetricsRelabelConfig ¶
type MetricsRelabelConfig struct { SourceLabels []string `json:"sourceLabels,omitempty"` Separator string `json:"separator,omitempty"` TargetLabel string `json:"targetLabel,omitempty"` Regex string `json:"regex,omitempty"` Modulus int `json:"modulus,omitempty"` Replacement string `json:"replacement,omitempty"` Action string `json:"action,omitempty"` }
MetricsRelabelConfig configuration for metric relabeling
type OAuth2 ¶
type OAuth2 struct { ClientID string `json:"clientId,omitempty"` ClientSecret string `json:"clientSecret,omitempty"` TokenURL string `json:"tokenUrl,omitempty"` Scopes []string `json:"scopes,omitempty"` TLSConfig TLSConfig `json:"tlsConfig,omitempty"` }
OAuth2 holds OAuth2 data
type ServiceDiscoryConfig ¶
type ServiceDiscoryConfig struct { URL string `json:"url,omitempty"` RefreshInterval string `json:"refreshInterval,omitempty"` BasicAuth BasicAuth `json:"basicAuth,omitempty"` TLSConfig TLSConfig `json:"tlsConfig,omitempty"` OAuth2 OAuth2 `json:"oauth2,omitempty"` }
ServiceDiscoryConfig is the configuration for service discovery
type StaticConfig ¶
type StaticConfig struct { Targets []string `json:"targets,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
StaticConfig holds targets for scraping