scrapeconfig

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package scrapeconfig provides primitives to interact with the openapi HTTP API.

Code generated by dev.azure.com/schwarzit/schwarzit.odj.core/_git/stackit-client-generator.git version v1.0.23 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateRequest

func NewCreateRequest(ctx context.Context, server string, projectID string, instanceID string, body CreateJSONRequestBody) (*http.Request, error)

NewCreateRequest calls the generic Create builder with application/json body

func NewCreateRequestWithBody

func NewCreateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, contentType string, body io.Reader) (*http.Request, error)

NewCreateRequestWithBody generates requests for Create with any type of body

func NewDeleteConfigsRequest

func NewDeleteConfigsRequest(ctx context.Context, server string, projectID string, instanceID string, jobName string) (*http.Request, error)

NewDeleteConfigsRequest generates requests for DeleteConfigs

func NewDeleteRequest

func NewDeleteRequest(ctx context.Context, server string, projectID string, instanceID string, params *DeleteParams) (*http.Request, error)

NewDeleteRequest generates requests for Delete

func NewGetRequest

func NewGetRequest(ctx context.Context, server string, projectID string, instanceID string, jobName string) (*http.Request, error)

NewGetRequest generates requests for Get

func NewListRequest

func NewListRequest(ctx context.Context, server string, projectID string, instanceID string) (*http.Request, error)

NewListRequest generates requests for List

func NewPartialUpdateRequest

func NewPartialUpdateRequest(ctx context.Context, server string, projectID string, instanceID string, body PartialUpdateJSONRequestBody) (*http.Request, error)

NewPartialUpdateRequest calls the generic PartialUpdate builder with application/json body

func NewPartialUpdateRequestWithBody

func NewPartialUpdateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, contentType string, body io.Reader) (*http.Request, error)

NewPartialUpdateRequestWithBody generates requests for PartialUpdate with any type of body

func NewUpdateRequest

func NewUpdateRequest(ctx context.Context, server string, projectID string, instanceID string, jobName string, body UpdateJSONRequestBody) (*http.Request, error)

NewUpdateRequest calls the generic Update builder with application/json body

func NewUpdateRequestWithBody

func NewUpdateRequestWithBody(ctx context.Context, server string, projectID string, instanceID string, jobName string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRequestWithBody generates requests for Update with any type of body

Types

type BasicAuth

type BasicAuth struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

BasicAuth defines model for BasicAuth.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client contracts.BaseClientInterface
}

Client which conforms to the OpenAPI3 specification for this service.

func NewRawClient

func NewRawClient(server string, httpClient contracts.BaseClientInterface) *Client

NewRawClient Creates a new Client, with reasonable defaults

func (*Client) CreateRaw

func (c *Client) CreateRaw(ctx context.Context, projectID string, instanceID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateRawWithBody

func (c *Client) CreateRawWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteConfigsRaw

func (c *Client) DeleteConfigsRaw(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteRaw

func (c *Client) DeleteRaw(ctx context.Context, projectID string, instanceID string, params *DeleteParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetRaw

func (c *Client) GetRaw(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListRaw

func (c *Client) ListRaw(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PartialUpdateRaw

func (c *Client) PartialUpdateRaw(ctx context.Context, projectID string, instanceID string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PartialUpdateRawWithBody

func (c *Client) PartialUpdateRawWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateRaw

func (c *Client) UpdateRaw(ctx context.Context, projectID string, instanceID string, jobName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateRawWithBody

func (c *Client) UpdateRawWithBody(ctx context.Context, projectID string, instanceID string, jobName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientWithResponses

type ClientWithResponses struct {
	// contains filtered or unexported fields
}

ClientWithResponses builds on rawClientInterface to offer response payloads

func NewClient

func NewClient(server string, httpClient contracts.BaseClientInterface) *ClientWithResponses

NewClient creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) Create

func (c *ClientWithResponses) Create(ctx context.Context, projectID string, instanceID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

func (*ClientWithResponses) CreateWithBody

func (c *ClientWithResponses) CreateWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

CreateWithBody request with arbitrary body returning *CreateResponse

func (*ClientWithResponses) Delete

func (c *ClientWithResponses) Delete(ctx context.Context, projectID string, instanceID string, params *DeleteParams, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

Delete request returning *DeleteResponse

func (*ClientWithResponses) DeleteConfigs

func (c *ClientWithResponses) DeleteConfigs(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*DeleteConfigsResponse, error)

DeleteConfigs request returning *DeleteConfigsResponse

func (*ClientWithResponses) Get

func (c *ClientWithResponses) Get(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*GetResponse, error)

Get request returning *GetResponse

func (*ClientWithResponses) List

func (c *ClientWithResponses) List(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*ListResponse, error)

List request returning *ListResponse

func (*ClientWithResponses) ParseCreateResponse

func (c *ClientWithResponses) ParseCreateResponse(rsp *http.Response) (*CreateResponse, error)

ParseCreateResponse parses an HTTP response from a Create call

func (*ClientWithResponses) ParseDeleteConfigsResponse

func (c *ClientWithResponses) ParseDeleteConfigsResponse(rsp *http.Response) (*DeleteConfigsResponse, error)

ParseDeleteConfigsResponse parses an HTTP response from a DeleteConfigs call

func (*ClientWithResponses) ParseDeleteResponse

func (c *ClientWithResponses) ParseDeleteResponse(rsp *http.Response) (*DeleteResponse, error)

ParseDeleteResponse parses an HTTP response from a Delete call

func (*ClientWithResponses) ParseGetResponse

func (c *ClientWithResponses) ParseGetResponse(rsp *http.Response) (*GetResponse, error)

ParseGetResponse parses an HTTP response from a Get call

func (*ClientWithResponses) ParseListResponse

func (c *ClientWithResponses) ParseListResponse(rsp *http.Response) (*ListResponse, error)

ParseListResponse parses an HTTP response from a List call

func (*ClientWithResponses) ParsePartialUpdateResponse

func (c *ClientWithResponses) ParsePartialUpdateResponse(rsp *http.Response) (*PartialUpdateResponse, error)

ParsePartialUpdateResponse parses an HTTP response from a PartialUpdate call

func (*ClientWithResponses) ParseUpdateResponse

func (c *ClientWithResponses) ParseUpdateResponse(rsp *http.Response) (*UpdateResponse, error)

ParseUpdateResponse parses an HTTP response from a Update call

func (*ClientWithResponses) PartialUpdate

func (c *ClientWithResponses) PartialUpdate(ctx context.Context, projectID string, instanceID string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

func (*ClientWithResponses) PartialUpdateWithBody

func (c *ClientWithResponses) PartialUpdateWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

PartialUpdateWithBody request with arbitrary body returning *PartialUpdateResponse

func (*ClientWithResponses) Update

func (c *ClientWithResponses) Update(ctx context.Context, projectID string, instanceID string, jobName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

func (*ClientWithResponses) UpdateWithBody

func (c *ClientWithResponses) UpdateWithBody(ctx context.Context, projectID string, instanceID string, jobName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

UpdateWithBody request with arbitrary body returning *UpdateResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Delete request
	Delete(ctx context.Context, projectID string, instanceID string, params *DeleteParams, reqEditors ...RequestEditorFn) (*DeleteResponse, error)

	// List request
	List(ctx context.Context, projectID string, instanceID string, reqEditors ...RequestEditorFn) (*ListResponse, error)

	// PartialUpdate request with any body
	PartialUpdateWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

	PartialUpdate(ctx context.Context, projectID string, instanceID string, body PartialUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*PartialUpdateResponse, error)

	// Create request with any body
	CreateWithBody(ctx context.Context, projectID string, instanceID string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	Create(ctx context.Context, projectID string, instanceID string, body CreateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateResponse, error)

	// DeleteConfigs request
	DeleteConfigs(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*DeleteConfigsResponse, error)

	// Get request
	Get(ctx context.Context, projectID string, instanceID string, jobName string, reqEditors ...RequestEditorFn) (*GetResponse, error)

	// Update request with any body
	UpdateWithBody(ctx context.Context, projectID string, instanceID string, jobName string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateResponse, error)

	Update(ctx context.Context, projectID string, instanceID string, jobName string, body UpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateJSONBody

type CreateJSONBody struct {
	// BasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password.
	// `Additional Validators:`
	// * if basicAuth is in the body no other authentication method should be in the body
	BasicAuth *struct {
		// Password password
		Password *string `json:"password,omitempty"`

		// Username username
		Username *string `json:"username,omitempty"`
	} `json:"basicAuth,omitempty"`

	// BearerToken Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'.
	// `Additional Validators:`
	// * needs to be a valid bearer token
	// * if bearerToken is in the body no other authentication method should be in the body
	BearerToken *string `json:"bearerToken,omitempty"`

	// HonorLabels Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise.
	HonorLabels *bool `json:"honorLabels,omitempty"`

	// HonorTimeStamps honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.
	HonorTimeStamps *bool `json:"honorTimeStamps,omitempty"`

	// HttpSdConfigs HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms.
	HttpSdConfigs *[]struct {
		// BasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password.
		// `Additional Validators:`
		// * if basicAuth is in the body no other authentication method should be in the body
		BasicAuth *struct {
			// Password password
			Password *string `json:"password,omitempty"`

			// Username username
			Username *string `json:"username,omitempty"`
		} `json:"basicAuth,omitempty"`

		// Oauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys.
		// `Additional Validators:`
		// * if oauth2 is in the body no other authentication method should be in the body
		Oauth2 *struct {
			// ClientId clientId
			ClientID string `json:"clientId"`

			// ClientSecret clientSecret
			ClientSecret string `json:"clientSecret"`

			// Scopes The URL to fetch the token from.
			Scopes *[]string `json:"scopes,omitempty"`

			// TlsConfig Configures the scrape request's TLS settings.
			TlsConfig *struct {
				// InsecureSkipVerify Disable validation of the server certificate.
				InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
			} `json:"tlsConfig,omitempty"`

			// TokenUrl The URL to fetch the token from.
			TokenURL string `json:"tokenUrl"`
		} `json:"oauth2,omitempty"`

		// RefreshInterval Refresh interval to re-query the endpoint. E.g. 60s
		// `Additional Validators:`
		// * must be a valid time format* must be >= 60s
		RefreshInterval *string `json:"refreshInterval,omitempty"`

		// TlsConfig Configures the scrape request's TLS settings.
		TlsConfig *struct {
			// InsecureSkipVerify Disable validation of the server certificate.
			InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
		} `json:"tlsConfig,omitempty"`

		// Url URL from which the targets are fetched.
		URL string `json:"url"`
	} `json:"httpSdConfigs,omitempty"`

	// JobName The job name assigned to scraped metrics by default.
	// `Additional Validators:`
	// * must be unique
	// * key and values should only include the characters: a-zA-Z0-9-
	JobName string `json:"jobName"`

	// MetricsPath The HTTP resource path on which to fetch metrics from targets. E.g. /metrics
	MetricsPath *string `json:"metricsPath,omitempty"`

	// MetricsRelabelConfigs List of metric relabel configurations
	MetricsRelabelConfigs *[]struct {
		// Action Action to perform based on regex matching.
		// `Additional Validators:`
		// * if action is replace, targetLabel needs to be in body
		Action *CreateJSONBodyMetricsRelabelConfigsAction `json:"action,omitempty"`

		// Modulus Modulus to take of the hash of the source label values.
		Modulus *float32 `json:"modulus,omitempty"`

		// Regex Regular expression against which the extracted value is matched.
		Regex *string `json:"regex,omitempty"`

		// Replacement Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available.
		Replacement *string `json:"replacement,omitempty"`

		// Separator Separator placed between concatenated source label values.
		Separator *string `json:"separator,omitempty"`

		// SourceLabels The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.
		SourceLabels *[]string `json:"sourceLabels,omitempty"`

		// TargetLabel Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.
		TargetLabel *string `json:"targetLabel,omitempty"`
	} `json:"metricsRelabelConfigs,omitempty"`

	// Oauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys.
	// `Additional Validators:`
	// * if oauth2 is in the body no other authentication method should be in the body
	Oauth2 *struct {
		// ClientId clientId
		ClientID string `json:"clientId"`

		// ClientSecret clientSecret
		ClientSecret string `json:"clientSecret"`

		// Scopes The URL to fetch the token from.
		Scopes *[]string `json:"scopes,omitempty"`

		// TlsConfig Configures the scrape request's TLS settings.
		TlsConfig *struct {
			// InsecureSkipVerify Disable validation of the server certificate.
			InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
		} `json:"tlsConfig,omitempty"`

		// TokenUrl The URL to fetch the token from.
		TokenURL string `json:"tokenUrl"`
	} `json:"oauth2,omitempty"`

	// Params Optional http params
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not have more than 200 characters
	Params *map[string]interface{} `json:"params,omitempty"`

	// SampleLimit Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples
	SampleLimit *float32 `json:"sampleLimit,omitempty"`

	// Scheme Configures the protocol scheme used for requests. https or http
	Scheme CreateJSONBodyScheme `json:"scheme"`

	// ScrapeInterval How frequently to scrape targets from this job. E.g. 5m
	// `Additional Validators:`
	// * must be a valid time format* must be >= 60s
	ScrapeInterval string `json:"scrapeInterval"`

	// ScrapeTimeout Per-scrape timeout when scraping this job.
	// `Additional Validators:`
	// * must be a valid time format* must be smaller than scrapeInterval
	ScrapeTimeout string `json:"scrapeTimeout"`

	// StaticConfigs A list of scrape configurations.
	StaticConfigs []struct {
		// Labels Labels assigned to all metrics scraped from the targets.
		// `Additional Validators:`
		// * should not contain more than 10 keys
		// * each key and value should not be longer than 200 characters
		Labels *map[string]interface{} `json:"labels,omitempty"`

		// Targets The targets specified by the static config.
		Targets []string `json:"targets"`
	} `json:"staticConfigs"`

	// TlsConfig Configures the scrape request's TLS settings.
	TlsConfig *struct {
		// InsecureSkipVerify Disable validation of the server certificate.
		InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
	} `json:"tlsConfig,omitempty"`
}

CreateJSONBody defines parameters for Create.

type CreateJSONBodyMetricsRelabelConfigsAction

type CreateJSONBodyMetricsRelabelConfigsAction string

CreateJSONBodyMetricsRelabelConfigsAction defines parameters for Create.

const (
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_DROP      CreateJSONBodyMetricsRelabelConfigsAction = "drop"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_HASHMOD   CreateJSONBodyMetricsRelabelConfigsAction = "hashmod"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_KEEP      CreateJSONBodyMetricsRelabelConfigsAction = "keep"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELDROP CreateJSONBodyMetricsRelabelConfigsAction = "labeldrop"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELKEEP CreateJSONBodyMetricsRelabelConfigsAction = "labelkeep"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELMAP  CreateJSONBodyMetricsRelabelConfigsAction = "labelmap"
	CREATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_REPLACE   CreateJSONBodyMetricsRelabelConfigsAction = "replace"
)

Defines values for CreateJSONBodyMetricsRelabelConfigsAction.

type CreateJSONBodyScheme

type CreateJSONBodyScheme string

CreateJSONBodyScheme defines parameters for Create.

const (
	CREATE_JSON_BODY_SCHEME_HTTP  CreateJSONBodyScheme = "http"
	CREATE_JSON_BODY_SCHEME_HTTPS CreateJSONBodyScheme = "https"
)

Defines values for CreateJSONBodyScheme.

type CreateJSONRequestBody

type CreateJSONRequestBody CreateJSONBody

CreateJSONRequestBody defines body for Create for application/json ContentType.

type CreateJob

type CreateJob struct {
	Data    []Job  `json:"data"`
	Message string `json:"message"`
}

CreateJob defines model for CreateJob.

type CreateResponse

type CreateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *CreateJob
	JSON400      *Error
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (CreateResponse) Status

func (r CreateResponse) Status() string

Status returns HTTPResponse.Status

func (CreateResponse) StatusCode

func (r CreateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteConfigsResponse

type DeleteConfigsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *DeleteJob
	JSON403      *PermissionDenied
	JSON404      *Message
	Error        error // Aggregated error
}

func (DeleteConfigsResponse) Status

func (r DeleteConfigsResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteConfigsResponse) StatusCode

func (r DeleteConfigsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteJob

type DeleteJob struct {
	Data    []Job  `json:"data"`
	Message string `json:"message"`
}

DeleteJob defines model for DeleteJob.

type DeleteParams

type DeleteParams struct {
	// JobName Name of the jobs that should be deleted
	JobName []string `form:"jobName" json:"jobName"`
}

DeleteParams defines parameters for Delete.

type DeleteResponse

type DeleteResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *CreateJob
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (DeleteResponse) Status

func (r DeleteResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteResponse) StatusCode

func (r DeleteResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	Errors  *[]map[string]string `json:"errors,omitempty"`
	Message string               `json:"message"`
}

Error defines model for Error.

type GetAllJob

type GetAllJob struct {
	Data    []Job  `json:"data"`
	Message string `json:"message"`
}

GetAllJob defines model for GetAllJob.

type GetJob

type GetJob struct {
	Data    Job    `json:"data"`
	Message string `json:"message"`
}

GetJob defines model for GetJob.

type GetResponse

type GetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GetJob
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (GetResponse) Status

func (r GetResponse) Status() string

Status returns HTTPResponse.Status

func (GetResponse) StatusCode

func (r GetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPServiceSD

type HTTPServiceSD struct {
	BasicAuth       *BasicAuth `json:"basicAuth,omitempty"`
	Oauth2          *OAuth2    `json:"oauth2,omitempty"`
	RefreshInterval *string    `json:"refreshInterval,omitempty"`
	TlsConfig       *TLSConfig `json:"tlsConfig,omitempty"`
	URL             string     `json:"url"`
}

HTTPServiceSD defines model for HTTPServiceSD.

type Job

type Job struct {
	BasicAuth             *BasicAuth              `json:"basicAuth,omitempty"`
	BearerToken           *string                 `json:"bearerToken,omitempty"`
	HonorLabels           *bool                   `json:"honorLabels,omitempty"`
	HonorTimeStamps       *bool                   `json:"honorTimeStamps,omitempty"`
	HttpSdConfigs         *[]HTTPServiceSD        `json:"httpSdConfigs,omitempty"`
	JobName               string                  `json:"jobName"`
	MetricsPath           *string                 `json:"metricsPath,omitempty"`
	MetricsRelabelConfigs *[]MetricsRelabelConfig `json:"metricsRelabelConfigs,omitempty"`
	Oauth2                *OAuth2                 `json:"oauth2,omitempty"`
	Params                *map[string][]string    `json:"params,omitempty"`
	SampleLimit           *int                    `json:"sampleLimit,omitempty"`
	Scheme                *JobScheme              `json:"scheme,omitempty"`
	ScrapeInterval        string                  `json:"scrapeInterval"`
	ScrapeTimeout         string                  `json:"scrapeTimeout"`
	StaticConfigs         []StaticConfigs         `json:"staticConfigs"`
	TlsConfig             *TLSConfig              `json:"tlsConfig,omitempty"`
}

Job defines model for Job.

type JobScheme

type JobScheme string

JobScheme defines model for Job.Scheme.

const (
	JOB_SCHEME_HTTP  JobScheme = "http"
	JOB_SCHEME_HTTPS JobScheme = "https"
)

Defines values for JobScheme.

type ListResponse

type ListResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *GetAllJob
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (ListResponse) Status

func (r ListResponse) Status() string

Status returns HTTPResponse.Status

func (ListResponse) StatusCode

func (r ListResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Message

type Message struct {
	Message string `json:"message"`
}

Message defines model for Message.

type MetricsRelabelConfig

type MetricsRelabelConfig struct {
	Action       *MetricsRelabelConfigAction `json:"action,omitempty"`
	Modulus      *int                        `json:"modulus,omitempty"`
	Regex        *string                     `json:"regex,omitempty"`
	Replacement  *string                     `json:"replacement,omitempty"`
	Separator    *string                     `json:"separator,omitempty"`
	SourceLabels []string                    `json:"sourceLabels"`
	TargetLabel  *string                     `json:"targetLabel,omitempty"`
}

MetricsRelabelConfig defines model for MetricsRelabelConfig.

type MetricsRelabelConfigAction

type MetricsRelabelConfigAction string

MetricsRelabelConfigAction defines model for MetricsRelabelConfig.Action.

const (
	METRICS_RELABEL_CONFIG_ACTION_DROP      MetricsRelabelConfigAction = "drop"
	METRICS_RELABEL_CONFIG_ACTION_HASHMOD   MetricsRelabelConfigAction = "hashmod"
	METRICS_RELABEL_CONFIG_ACTION_KEEP      MetricsRelabelConfigAction = "keep"
	METRICS_RELABEL_CONFIG_ACTION_LABELDROP MetricsRelabelConfigAction = "labeldrop"
	METRICS_RELABEL_CONFIG_ACTION_LABELKEEP MetricsRelabelConfigAction = "labelkeep"
	METRICS_RELABEL_CONFIG_ACTION_LABELMAP  MetricsRelabelConfigAction = "labelmap"
	METRICS_RELABEL_CONFIG_ACTION_REPLACE   MetricsRelabelConfigAction = "replace"
)

Defines values for MetricsRelabelConfigAction.

type OAuth2

type OAuth2 struct {
	ClientID     string     `json:"clientId"`
	ClientSecret string     `json:"clientSecret"`
	Scopes       *[]string  `json:"scopes,omitempty"`
	TlsConfig    *TLSConfig `json:"tlsConfig,omitempty"`
	TokenURL     string     `json:"tokenUrl"`
}

OAuth2 defines model for OAuth2.

type PartialUpdateJSONBody

type PartialUpdateJSONBody = []struct {
	// BasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password.
	// `Additional Validators:`
	// * if basicAuth is in the body no other authentication method should be in the body
	BasicAuth *struct {
		// Password password
		Password *string `json:"password,omitempty"`

		// Username username
		Username *string `json:"username,omitempty"`
	} `json:"basicAuth,omitempty"`

	// BearerToken Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'.
	// `Additional Validators:`
	// * needs to be a valid bearer token
	// * if bearerToken is in the body no other authentication method should be in the body
	BearerToken *string `json:"bearerToken,omitempty"`

	// HonorLabels Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise.
	HonorLabels *bool `json:"honorLabels,omitempty"`

	// HonorTimeStamps honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.
	HonorTimeStamps *bool `json:"honorTimeStamps,omitempty"`

	// HttpSdConfigs HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms.
	HttpSdConfigs *[]struct {
		// BasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password.
		// `Additional Validators:`
		// * if basicAuth is in the body no other authentication method should be in the body
		BasicAuth *struct {
			// Password password
			Password *string `json:"password,omitempty"`

			// Username username
			Username *string `json:"username,omitempty"`
		} `json:"basicAuth,omitempty"`

		// Oauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys.
		// `Additional Validators:`
		// * if oauth2 is in the body no other authentication method should be in the body
		Oauth2 *struct {
			// ClientId clientId
			ClientID string `json:"clientId"`

			// ClientSecret clientSecret
			ClientSecret string `json:"clientSecret"`

			// Scopes The URL to fetch the token from.
			Scopes *[]string `json:"scopes,omitempty"`

			// TlsConfig Configures the scrape request's TLS settings.
			TlsConfig *struct {
				// InsecureSkipVerify Disable validation of the server certificate.
				InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
			} `json:"tlsConfig,omitempty"`

			// TokenUrl The URL to fetch the token from.
			TokenURL string `json:"tokenUrl"`
		} `json:"oauth2,omitempty"`

		// RefreshInterval Refresh interval to re-query the endpoint. E.g. 60s
		// `Additional Validators:`
		// * must be a valid time format* must be >= 60s
		RefreshInterval *string `json:"refreshInterval,omitempty"`

		// TlsConfig Configures the scrape request's TLS settings.
		TlsConfig *struct {
			// InsecureSkipVerify Disable validation of the server certificate.
			InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
		} `json:"tlsConfig,omitempty"`

		// Url URL from which the targets are fetched.
		URL string `json:"url"`
	} `json:"httpSdConfigs,omitempty"`

	// JobName The job name assigned to scraped metrics by default.
	// `Additional Validators:`
	// * must be unique
	// * key and values should only include the characters: a-zA-Z0-9-
	JobName string `json:"jobName"`

	// MetricsPath The HTTP resource path on which to fetch metrics from targets. E.g. /metrics
	MetricsPath *string `json:"metricsPath,omitempty"`

	// MetricsRelabelConfigs List of metric relabel configurations
	MetricsRelabelConfigs *[]struct {
		// Action Action to perform based on regex matching.
		// `Additional Validators:`
		// * if action is replace, targetLabel needs to be in body
		Action *PartialUpdateJSONBodyMetricsRelabelConfigsAction `json:"action,omitempty"`

		// Modulus Modulus to take of the hash of the source label values.
		Modulus *float32 `json:"modulus,omitempty"`

		// Regex Regular expression against which the extracted value is matched.
		Regex *string `json:"regex,omitempty"`

		// Replacement Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available.
		Replacement *string `json:"replacement,omitempty"`

		// Separator Separator placed between concatenated source label values.
		Separator *string `json:"separator,omitempty"`

		// SourceLabels The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.
		SourceLabels *[]string `json:"sourceLabels,omitempty"`

		// TargetLabel Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.
		TargetLabel *string `json:"targetLabel,omitempty"`
	} `json:"metricsRelabelConfigs,omitempty"`

	// Oauth2 OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys.
	// `Additional Validators:`
	// * if oauth2 is in the body no other authentication method should be in the body
	Oauth2 *struct {
		// ClientId clientId
		ClientID string `json:"clientId"`

		// ClientSecret clientSecret
		ClientSecret string `json:"clientSecret"`

		// Scopes The URL to fetch the token from.
		Scopes *[]string `json:"scopes,omitempty"`

		// TlsConfig Configures the scrape request's TLS settings.
		TlsConfig *struct {
			// InsecureSkipVerify Disable validation of the server certificate.
			InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
		} `json:"tlsConfig,omitempty"`

		// TokenUrl The URL to fetch the token from.
		TokenURL string `json:"tokenUrl"`
	} `json:"oauth2,omitempty"`

	// Params Optional http params
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not have more than 200 characters
	Params *map[string]interface{} `json:"params,omitempty"`

	// SampleLimit Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples
	SampleLimit *float32 `json:"sampleLimit,omitempty"`

	// Scheme Configures the protocol scheme used for requests. https or http
	Scheme PartialUpdateJSONBodyScheme `json:"scheme"`

	// ScrapeInterval How frequently to scrape targets from this job. E.g. 5m
	// `Additional Validators:`
	// * must be a valid time format* must be >= 60s
	ScrapeInterval string `json:"scrapeInterval"`

	// ScrapeTimeout Per-scrape timeout when scraping this job.
	// `Additional Validators:`
	// * must be a valid time format* must be smaller than scrapeInterval
	ScrapeTimeout string `json:"scrapeTimeout"`

	// StaticConfigs A list of scrape configurations.
	StaticConfigs []struct {
		// Labels Labels assigned to all metrics scraped from the targets.
		// `Additional Validators:`
		// * should not contain more than 10 keys
		// * each key and value should not be longer than 200 characters
		Labels *map[string]interface{} `json:"labels,omitempty"`

		// Targets The targets specified by the static config.
		Targets []string `json:"targets"`
	} `json:"staticConfigs"`

	// TlsConfig Configures the scrape request's TLS settings.
	TlsConfig *struct {
		// InsecureSkipVerify Disable validation of the server certificate.
		InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
	} `json:"tlsConfig,omitempty"`
}

PartialUpdateJSONBody defines parameters for PartialUpdate.

type PartialUpdateJSONBodyMetricsRelabelConfigsAction

type PartialUpdateJSONBodyMetricsRelabelConfigsAction string

PartialUpdateJSONBodyMetricsRelabelConfigsAction defines parameters for PartialUpdate.

const (
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_DROP      PartialUpdateJSONBodyMetricsRelabelConfigsAction = "drop"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_HASHMOD   PartialUpdateJSONBodyMetricsRelabelConfigsAction = "hashmod"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_KEEP      PartialUpdateJSONBodyMetricsRelabelConfigsAction = "keep"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELDROP PartialUpdateJSONBodyMetricsRelabelConfigsAction = "labeldrop"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELKEEP PartialUpdateJSONBodyMetricsRelabelConfigsAction = "labelkeep"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELMAP  PartialUpdateJSONBodyMetricsRelabelConfigsAction = "labelmap"
	PARTIAL_UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_REPLACE   PartialUpdateJSONBodyMetricsRelabelConfigsAction = "replace"
)

Defines values for PartialUpdateJSONBodyMetricsRelabelConfigsAction.

type PartialUpdateJSONBodyScheme

type PartialUpdateJSONBodyScheme string

PartialUpdateJSONBodyScheme defines parameters for PartialUpdate.

const (
	PARTIAL_UPDATE_JSON_BODY_SCHEME_HTTP  PartialUpdateJSONBodyScheme = "http"
	PARTIAL_UPDATE_JSON_BODY_SCHEME_HTTPS PartialUpdateJSONBodyScheme = "https"
)

Defines values for PartialUpdateJSONBodyScheme.

type PartialUpdateJSONRequestBody

type PartialUpdateJSONRequestBody = PartialUpdateJSONBody

PartialUpdateJSONRequestBody defines body for PartialUpdate for application/json ContentType.

type PartialUpdateResponse

type PartialUpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *CreateJob
	JSON400      *Error
	JSON403      *PermissionDenied
	Error        error // Aggregated error
}

func (PartialUpdateResponse) Status

func (r PartialUpdateResponse) Status() string

Status returns HTTPResponse.Status

func (PartialUpdateResponse) StatusCode

func (r PartialUpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PermissionDenied

type PermissionDenied struct {
	Detail string `json:"detail"`
}

PermissionDenied defines model for PermissionDenied.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type StaticConfigs

type StaticConfigs struct {
	Labels  *map[string]string `json:"labels,omitempty"`
	Targets []string           `json:"targets"`
}

StaticConfigs defines model for StaticConfigs.

type TLSConfig

type TLSConfig struct {
	InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
}

TLSConfig defines model for TLSConfig.

type UpdateJSONBody

type UpdateJSONBody struct {
	// BasicAuth Sets the 'Authorization' header on every scrape request with the configured username and password.
	// `Additional Validators:`
	// * if basicAuth is in the body no other authentication method should be in the body
	BasicAuth *struct {
		// Password password
		Password *string `json:"password,omitempty"`

		// Username username
		Username *string `json:"username,omitempty"`
	} `json:"basicAuth,omitempty"`

	// BearerToken Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'.
	// `Additional Validators:`
	// * needs to be a valid bearer token
	// * if bearerToken is in the body no other authentication method should be in the body
	BearerToken *string `json:"bearerToken,omitempty"`

	// HonorLabels Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise.
	HonorLabels *bool `json:"honorLabels,omitempty"`

	// HonorTimeStamps honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.
	HonorTimeStamps *bool `json:"honorTimeStamps,omitempty"`

	// MetricsPath The HTTP resource path on which to fetch metrics from targets. E.g. /metrics
	MetricsPath string `json:"metricsPath"`

	// MetricsRelabelConfigs List of metric relabel configurations
	MetricsRelabelConfigs *[]struct {
		// Action Action to perform based on regex matching.
		// `Additional Validators:`
		// * if action is replace, targetLabel needs to be in body
		Action *UpdateJSONBodyMetricsRelabelConfigsAction `json:"action,omitempty"`

		// Modulus Modulus to take of the hash of the source label values.
		Modulus *float32 `json:"modulus,omitempty"`

		// Regex Regular expression against which the extracted value is matched.
		Regex *string `json:"regex,omitempty"`

		// Replacement Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available.
		Replacement *string `json:"replacement,omitempty"`

		// Separator Separator placed between concatenated source label values.
		Separator *string `json:"separator,omitempty"`

		// SourceLabels The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions.
		SourceLabels *[]string `json:"sourceLabels,omitempty"`

		// TargetLabel Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available.
		TargetLabel *string `json:"targetLabel,omitempty"`
	} `json:"metricsRelabelConfigs,omitempty"`

	// Params Optional http params
	// `Additional Validators:`
	// * should not contain more than 5 keys
	// * each key and value should not have more than 200 characters
	Params *map[string]interface{} `json:"params,omitempty"`

	// Scheme Configures the protocol scheme used for requests. https or http
	Scheme UpdateJSONBodyScheme `json:"scheme"`

	// ScrapeInterval How frequently to scrape targets from this job. E.g. 5m
	// `Additional Validators:`
	// * must be a valid time format* must be >= 60s
	ScrapeInterval string `json:"scrapeInterval"`

	// ScrapeTimeout Per-scrape timeout when scraping this job.
	// `Additional Validators:`
	// * must be a valid time format* must be smaller than scrapeInterval
	ScrapeTimeout string `json:"scrapeTimeout"`

	// StaticConfigs A list of scrape configurations.
	StaticConfigs []struct {
		// Labels Labels assigned to all metrics scraped from the targets.
		// `Additional Validators:`
		// * should not contain more than 5 keys
		// * each key and value should not be longer than 200 characters
		Labels *map[string]interface{} `json:"labels,omitempty"`

		// Targets The targets specified by the static config.
		Targets []string `json:"targets"`
	} `json:"staticConfigs"`

	// TlsConfig Configures the scrape request's TLS settings.
	TlsConfig *struct {
		// InsecureSkipVerify Disable validation of the server certificate.
		InsecureSkipVerify *bool `json:"insecureSkipVerify,omitempty"`
	} `json:"tlsConfig,omitempty"`
}

UpdateJSONBody defines parameters for Update.

type UpdateJSONBodyMetricsRelabelConfigsAction

type UpdateJSONBodyMetricsRelabelConfigsAction string

UpdateJSONBodyMetricsRelabelConfigsAction defines parameters for Update.

const (
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_DROP      UpdateJSONBodyMetricsRelabelConfigsAction = "drop"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_HASHMOD   UpdateJSONBodyMetricsRelabelConfigsAction = "hashmod"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_KEEP      UpdateJSONBodyMetricsRelabelConfigsAction = "keep"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELDROP UpdateJSONBodyMetricsRelabelConfigsAction = "labeldrop"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELKEEP UpdateJSONBodyMetricsRelabelConfigsAction = "labelkeep"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_LABELMAP  UpdateJSONBodyMetricsRelabelConfigsAction = "labelmap"
	UPDATE_JSON_BODY_METRICS_RELABEL_CONFIGS_ACTION_REPLACE   UpdateJSONBodyMetricsRelabelConfigsAction = "replace"
)

Defines values for UpdateJSONBodyMetricsRelabelConfigsAction.

type UpdateJSONBodyScheme

type UpdateJSONBodyScheme string

UpdateJSONBodyScheme defines parameters for Update.

const (
	UPDATE_JSON_BODY_SCHEME_HTTP  UpdateJSONBodyScheme = "http"
	UPDATE_JSON_BODY_SCHEME_HTTPS UpdateJSONBodyScheme = "https"
)

Defines values for UpdateJSONBodyScheme.

type UpdateJSONRequestBody

type UpdateJSONRequestBody UpdateJSONBody

UpdateJSONRequestBody defines body for Update for application/json ContentType.

type UpdateResponse

type UpdateResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *CreateJob
	JSON400      *Message
	JSON403      *PermissionDenied
	JSON404      *Message
	Error        error // Aggregated error
}

func (UpdateResponse) Status

func (r UpdateResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateResponse) StatusCode

func (r UpdateResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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