cockpit

package
v1.0.0-beta.30 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cockpit provides methods and message types of the cockpit v1 API.

Index

Constants

View Source
const (
	// Unknown data source origin.
	DataSourceOriginUnknownOrigin = DataSourceOrigin("unknown_origin")
	// Data source managed by Scaleway, used to store and query metrics and logs from Scaleway resources.
	DataSourceOriginScaleway = DataSourceOrigin("scaleway")
	// Data source created by the user, used to store and query metrics, logs and traces from user's external resources.
	DataSourceOriginExternal = DataSourceOrigin("external")
)
View Source
const (
	// Unknown data source type.
	DataSourceTypeUnknownType = DataSourceType("unknown_type")
	// Metrics data source type, used to store and query metrics using Grafana Mimir.
	DataSourceTypeMetrics = DataSourceType("metrics")
	// Logs data source type, used to store and query logs using Grafana Loki.
	DataSourceTypeLogs = DataSourceType("logs")
	// Traces data source type, used to store and query traces using Grafana Tempo.
	DataSourceTypeTraces = DataSourceType("traces")
)
View Source
const (
	// Unknown role.
	GrafanaUserRoleUnknownRole = GrafanaUserRole("unknown_role")
	// Editor role.
	GrafanaUserRoleEditor = GrafanaUserRole("editor")
	// Viewer role.
	GrafanaUserRoleViewer = GrafanaUserRole("viewer")
)
View Source
const (
	ListDataSourcesRequestOrderByCreatedAtAsc  = ListDataSourcesRequestOrderBy("created_at_asc")
	ListDataSourcesRequestOrderByCreatedAtDesc = ListDataSourcesRequestOrderBy("created_at_desc")
	ListDataSourcesRequestOrderByNameAsc       = ListDataSourcesRequestOrderBy("name_asc")
	ListDataSourcesRequestOrderByNameDesc      = ListDataSourcesRequestOrderBy("name_desc")
	ListDataSourcesRequestOrderByTypeAsc       = ListDataSourcesRequestOrderBy("type_asc")
	ListDataSourcesRequestOrderByTypeDesc      = ListDataSourcesRequestOrderBy("type_desc")
)
View Source
const (
	ListGrafanaUsersRequestOrderByLoginAsc  = ListGrafanaUsersRequestOrderBy("login_asc")
	ListGrafanaUsersRequestOrderByLoginDesc = ListGrafanaUsersRequestOrderBy("login_desc")
)
View Source
const (
	ListManagedAlertsRequestOrderByCreatedAtAsc  = ListManagedAlertsRequestOrderBy("created_at_asc")
	ListManagedAlertsRequestOrderByCreatedAtDesc = ListManagedAlertsRequestOrderBy("created_at_desc")
	ListManagedAlertsRequestOrderByNameAsc       = ListManagedAlertsRequestOrderBy("name_asc")
	ListManagedAlertsRequestOrderByNameDesc      = ListManagedAlertsRequestOrderBy("name_desc")
	ListManagedAlertsRequestOrderByTypeAsc       = ListManagedAlertsRequestOrderBy("type_asc")
	ListManagedAlertsRequestOrderByTypeDesc      = ListManagedAlertsRequestOrderBy("type_desc")
)
View Source
const (
	ListPlansRequestOrderByNameAsc  = ListPlansRequestOrderBy("name_asc")
	ListPlansRequestOrderByNameDesc = ListPlansRequestOrderBy("name_desc")
)
View Source
const (
	ListTokensRequestOrderByCreatedAtAsc  = ListTokensRequestOrderBy("created_at_asc")
	ListTokensRequestOrderByCreatedAtDesc = ListTokensRequestOrderBy("created_at_desc")
	ListTokensRequestOrderByNameAsc       = ListTokensRequestOrderBy("name_asc")
	ListTokensRequestOrderByNameDesc      = ListTokensRequestOrderBy("name_desc")
)
View Source
const (
	PlanNameUnknownName = PlanName("unknown_name")
	PlanNameFree        = PlanName("free")
	PlanNamePremium     = PlanName("premium")
	PlanNameCustom      = PlanName("custom")
)
View Source
const (
	// The token's permission scope is unknown.
	TokenScopeUnknownScope = TokenScope("unknown_scope")
	// Token has permission to read data from metrics data sources.
	TokenScopeReadOnlyMetrics = TokenScope("read_only_metrics")
	// Token has permission to write data in metrics data sources.
	TokenScopeWriteOnlyMetrics = TokenScope("write_only_metrics")
	// Token has permission to read and write prometheus rules in metrics data sources.
	TokenScopeFullAccessMetricsRules = TokenScope("full_access_metrics_rules")
	// Token has permission to read data from logs data sources.
	TokenScopeReadOnlyLogs = TokenScope("read_only_logs")
	// Token has permission to write data in logs data sources.
	TokenScopeWriteOnlyLogs = TokenScope("write_only_logs")
	// Token has permission to read and write prometheus rules in logs data sources.
	TokenScopeFullAccessLogsRules = TokenScope("full_access_logs_rules")
	// Token has permission to read and write the Alert manager API.
	TokenScopeFullAccessAlertManager = TokenScope("full_access_alert_manager")
	// Token has permission to read data from traces data sources.
	TokenScopeReadOnlyTraces = TokenScope("read_only_traces")
	// Token has permission to write data in traces data sources.
	TokenScopeWriteOnlyTraces = TokenScope("write_only_traces")
)
View Source
const (
	UsageUnitUnknownUnit = UsageUnit("unknown_unit")
	UsageUnitBytes       = UsageUnit("bytes")
	UsageUnitSamples     = UsageUnit("samples")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	ProductFamily string `json:"product_family"`

	Product string `json:"product"`

	Name string `json:"name"`

	Rule string `json:"rule"`

	Description string `json:"description"`
}

Alert: alert.

type AlertManager

type AlertManager struct {
	// AlertManagerURL: alert manager URL.
	AlertManagerURL *string `json:"alert_manager_url"`

	// AlertManagerEnabled: the Alert manager is enabled.
	AlertManagerEnabled bool `json:"alert_manager_enabled"`

	// ManagedAlertsEnabled: managed alerts are enabled.
	ManagedAlertsEnabled bool `json:"managed_alerts_enabled"`

	// Region: regions where the Alert manager is enabled.
	Region scw.Region `json:"region"`
}

AlertManager: Alert manager information.

type ContactPoint

type ContactPoint struct {
	// Email: email address to send alerts to.
	// Precisely one of Email must be set.
	Email *ContactPointEmail `json:"email,omitempty"`

	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"region"`
}

ContactPoint: Contact point.

type ContactPointEmail

type ContactPointEmail struct {
	To string `json:"to"`
}

ContactPointEmail: contact point email.

type DataSource

type DataSource struct {
	// ID: ID of the data source.
	ID string `json:"id"`

	// ProjectID: ID of the Project the data source belongs to.
	ProjectID string `json:"project_id"`

	// Name: data source name.
	Name string `json:"name"`

	// URL: data source URL.
	URL string `json:"url"`

	// Type: data source type.
	// Default value: unknown_type
	Type DataSourceType `json:"type"`

	// Origin: data source origin.
	// Default value: unknown_origin
	Origin DataSourceOrigin `json:"origin"`

	// CreatedAt: date the data source was created.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date the data source was last updated.
	UpdatedAt *time.Time `json:"updated_at"`

	// SynchronizedWithGrafana: indicates whether the data source is synchronized with Grafana.
	SynchronizedWithGrafana bool `json:"synchronized_with_grafana"`

	// Region: region of the data source.
	Region scw.Region `json:"region"`
}

DataSource: Data source.

type DataSourceOrigin

type DataSourceOrigin string

func (DataSourceOrigin) MarshalJSON

func (enum DataSourceOrigin) MarshalJSON() ([]byte, error)

func (DataSourceOrigin) String

func (enum DataSourceOrigin) String() string

func (*DataSourceOrigin) UnmarshalJSON

func (enum *DataSourceOrigin) UnmarshalJSON(data []byte) error

func (DataSourceOrigin) Values

func (enum DataSourceOrigin) Values() []DataSourceOrigin

type DataSourceType

type DataSourceType string

func (DataSourceType) MarshalJSON

func (enum DataSourceType) MarshalJSON() ([]byte, error)

func (DataSourceType) String

func (enum DataSourceType) String() string

func (*DataSourceType) UnmarshalJSON

func (enum *DataSourceType) UnmarshalJSON(data []byte) error

func (DataSourceType) Values

func (enum DataSourceType) Values() []DataSourceType

type GlobalAPI

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

The Cockpit Global API allows you to manage your Cockpit's Grafana and plans.

func NewGlobalAPI

func NewGlobalAPI(client *scw.Client) *GlobalAPI

NewGlobalAPI returns a GlobalAPI object from a Scaleway client.

func (*GlobalAPI) CreateGrafanaUser

func (s *GlobalAPI) CreateGrafanaUser(req *GlobalAPICreateGrafanaUserRequest, opts ...scw.RequestOption) (*GrafanaUser, error)

CreateGrafanaUser: Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it. Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.

func (*GlobalAPI) DeleteGrafanaUser

func (s *GlobalAPI) DeleteGrafanaUser(req *GlobalAPIDeleteGrafanaUserRequest, opts ...scw.RequestOption) error

DeleteGrafanaUser: Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user.

func (*GlobalAPI) GetCurrentPlan

func (s *GlobalAPI) GetCurrentPlan(req *GlobalAPIGetCurrentPlanRequest, opts ...scw.RequestOption) (*Plan, error)

GetCurrentPlan: Retrieve a pricing plan for the given Project, specified by the ID of the Project.

func (*GlobalAPI) GetGrafana

func (s *GlobalAPI) GetGrafana(req *GlobalAPIGetGrafanaRequest, opts ...scw.RequestOption) (*Grafana, error)

GetGrafana: Retrieve information on your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to. The output returned displays the URL to access your Cockpit's Grafana.

func (*GlobalAPI) GetGrafanaProductDashboard

GetGrafanaProductDashboard: Retrieve information about the dashboard of a Scaleway resource in Grafana, specified by the ID of the Project the Cockpit belongs to, and the name of the dashboard.

func (*GlobalAPI) ListGrafanaProductDashboards

ListGrafanaProductDashboards: Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit.

func (*GlobalAPI) ListGrafanaUsers

ListGrafanaUsers: List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.

func (*GlobalAPI) ListPlans

ListPlans: Retrieve a list of available pricing plan types.

func (*GlobalAPI) ResetGrafanaUserPassword

func (s *GlobalAPI) ResetGrafanaUserPassword(req *GlobalAPIResetGrafanaUserPasswordRequest, opts ...scw.RequestOption) (*GrafanaUser, error)

ResetGrafanaUserPassword: Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. A new password regenerates and only displays once. Make sure that you save it.

func (*GlobalAPI) SelectPlan

func (s *GlobalAPI) SelectPlan(req *GlobalAPISelectPlanRequest, opts ...scw.RequestOption) (*Plan, error)

SelectPlan: Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply.

func (*GlobalAPI) SyncGrafanaDataSources

func (s *GlobalAPI) SyncGrafanaDataSources(req *GlobalAPISyncGrafanaDataSourcesRequest, opts ...scw.RequestOption) error

SyncGrafanaDataSources: Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it.

type GlobalAPICreateGrafanaUserRequest

type GlobalAPICreateGrafanaUserRequest struct {
	// ProjectID: ID of the Project in which to create the Grafana user.
	ProjectID string `json:"project_id"`

	// Login: username of the Grafana user. Note that the `admin` username is not available for creation.
	Login string `json:"login"`

	// Role: role assigned to the Grafana user.
	// Default value: unknown_role
	Role GrafanaUserRole `json:"role"`
}

GlobalAPICreateGrafanaUserRequest: Create a Grafana user.

type GlobalAPIDeleteGrafanaUserRequest

type GlobalAPIDeleteGrafanaUserRequest struct {
	// GrafanaUserID: ID of the Grafana user.
	GrafanaUserID uint32 `json:"-"`

	// ProjectID: ID of the Project to target.
	ProjectID string `json:"-"`
}

GlobalAPIDeleteGrafanaUserRequest: Delete a Grafana user.

type GlobalAPIGetCurrentPlanRequest

type GlobalAPIGetCurrentPlanRequest struct {
	// ProjectID: ID of the Project.
	ProjectID string `json:"-"`
}

GlobalAPIGetCurrentPlanRequest: Retrieve a pricing plan for the given Project.

type GlobalAPIGetGrafanaProductDashboardRequest

type GlobalAPIGetGrafanaProductDashboardRequest struct {
	// DashboardName: name of the dashboard.
	DashboardName string `json:"-"`

	// ProjectID: ID of the Project the dashboard belongs to.
	ProjectID string `json:"-"`
}

GlobalAPIGetGrafanaProductDashboardRequest: Retrieve a specific dashboard.

type GlobalAPIGetGrafanaRequest

type GlobalAPIGetGrafanaRequest struct {
	// ProjectID: ID of the Project.
	ProjectID string `json:"-"`
}

GlobalAPIGetGrafanaRequest: Request a Grafana.

type GlobalAPIListGrafanaProductDashboardsRequest

type GlobalAPIListGrafanaProductDashboardsRequest struct {
	// ProjectID: ID of the Project to target.
	ProjectID string `json:"-"`

	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size.
	PageSize *uint32 `json:"-"`

	// Tags: tags to filter for.
	Tags []string `json:"-"`
}

GlobalAPIListGrafanaProductDashboardsRequest: Retrieve a list of available product dashboards.

type GlobalAPIListGrafanaUsersRequest

type GlobalAPIListGrafanaUsersRequest struct {
	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size.
	PageSize *uint32 `json:"-"`

	// OrderBy: order of the Grafana users.
	// Default value: login_asc
	OrderBy ListGrafanaUsersRequestOrderBy `json:"-"`

	// ProjectID: ID of the Project to target.
	ProjectID string `json:"-"`
}

GlobalAPIListGrafanaUsersRequest: List all Grafana users.

type GlobalAPIListPlansRequest

type GlobalAPIListPlansRequest struct {
	// Page: page number.
	Page *int32 `json:"-"`

	// PageSize: page size.
	PageSize *uint32 `json:"-"`

	// OrderBy: default value: name_asc
	OrderBy ListPlansRequestOrderBy `json:"-"`
}

GlobalAPIListPlansRequest: Retrieve a list of available pricing plans.

type GlobalAPIResetGrafanaUserPasswordRequest

type GlobalAPIResetGrafanaUserPasswordRequest struct {
	// GrafanaUserID: ID of the Grafana user.
	GrafanaUserID uint32 `json:"-"`

	// ProjectID: ID of the Project to target.
	ProjectID string `json:"project_id"`
}

GlobalAPIResetGrafanaUserPasswordRequest: Reset a Grafana user's password.

type GlobalAPISelectPlanRequest

type GlobalAPISelectPlanRequest struct {
	// ProjectID: ID of the Project.
	ProjectID string `json:"project_id"`

	// PlanName: name of the pricing plan.
	// Default value: unknown_name
	PlanName PlanName `json:"plan_name"`
}

GlobalAPISelectPlanRequest: Select a specific pricing plan.

type GlobalAPISyncGrafanaDataSourcesRequest

type GlobalAPISyncGrafanaDataSourcesRequest struct {
	// ProjectID: ID of the Project to target.
	ProjectID string `json:"project_id"`
}

GlobalAPISyncGrafanaDataSourcesRequest: Trigger the synchronization of all data sources created in the relevant regions.

type Grafana

type Grafana struct {
	// GrafanaURL: URL to access your Cockpit's Grafana.
	GrafanaURL string `json:"grafana_url"`
}

Grafana: Grafana user.

type GrafanaProductDashboard

type GrafanaProductDashboard struct {
	// Name: dashboard name.
	Name string `json:"name"`

	// Title: dashboard title.
	Title string `json:"title"`

	// URL: dashboard URL.
	URL string `json:"url"`

	// Tags: dashboard tags.
	Tags []string `json:"tags"`

	// Variables: dashboard variables.
	Variables []string `json:"variables"`
}

GrafanaProductDashboard: Grafana dashboard.

type GrafanaUser

type GrafanaUser struct {
	// ID: ID of the Grafana user.
	ID uint32 `json:"id"`

	// Login: username of the Grafana user.
	Login string `json:"login"`

	// Role: role assigned to the Grafana user.
	// Default value: unknown_role
	Role GrafanaUserRole `json:"role"`

	// Password: grafana user's password.
	Password *string `json:"password"`
}

GrafanaUser: Grafana user.

type GrafanaUserRole

type GrafanaUserRole string

func (GrafanaUserRole) MarshalJSON

func (enum GrafanaUserRole) MarshalJSON() ([]byte, error)

func (GrafanaUserRole) String

func (enum GrafanaUserRole) String() string

func (*GrafanaUserRole) UnmarshalJSON

func (enum *GrafanaUserRole) UnmarshalJSON(data []byte) error

func (GrafanaUserRole) Values

func (enum GrafanaUserRole) Values() []GrafanaUserRole

type ListContactPointsResponse

type ListContactPointsResponse struct {
	// TotalCount: total count of contact points associated with the default receiver.
	TotalCount uint64 `json:"total_count"`

	// ContactPoints: list of contact points associated with the default receiver.
	ContactPoints []*ContactPoint `json:"contact_points"`

	// HasAdditionalReceivers: indicates whether the Alert manager has other receivers than the default one.
	HasAdditionalReceivers bool `json:"has_additional_receivers"`

	// HasAdditionalContactPoints: indicates whether there are unmanaged contact points on the default receiver.
	HasAdditionalContactPoints bool `json:"has_additional_contact_points"`
}

ListContactPointsResponse: Response returned when listing contact points.

func (*ListContactPointsResponse) UnsafeAppend

func (r *ListContactPointsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListContactPointsResponse) UnsafeGetTotalCount

func (r *ListContactPointsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListDataSourcesRequestOrderBy

type ListDataSourcesRequestOrderBy string

func (ListDataSourcesRequestOrderBy) MarshalJSON

func (enum ListDataSourcesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListDataSourcesRequestOrderBy) String

func (enum ListDataSourcesRequestOrderBy) String() string

func (*ListDataSourcesRequestOrderBy) UnmarshalJSON

func (enum *ListDataSourcesRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListDataSourcesRequestOrderBy) Values

type ListDataSourcesResponse

type ListDataSourcesResponse struct {
	// TotalCount: total count of data sources matching the request.
	TotalCount uint64 `json:"total_count"`

	// DataSources: data sources matching the request within the pagination.
	DataSources []*DataSource `json:"data_sources"`
}

ListDataSourcesResponse: Response returned when listing data sources.

func (*ListDataSourcesResponse) UnsafeAppend

func (r *ListDataSourcesResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListDataSourcesResponse) UnsafeGetTotalCount

func (r *ListDataSourcesResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListGrafanaProductDashboardsResponse

type ListGrafanaProductDashboardsResponse struct {
	// TotalCount: total count of Grafana dashboards.
	TotalCount uint64 `json:"total_count"`

	// Dashboards: grafana dashboards information.
	Dashboards []*GrafanaProductDashboard `json:"dashboards"`
}

ListGrafanaProductDashboardsResponse: Output returned when listing dashboards.

func (*ListGrafanaProductDashboardsResponse) UnsafeAppend

func (r *ListGrafanaProductDashboardsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListGrafanaProductDashboardsResponse) UnsafeGetTotalCount

func (r *ListGrafanaProductDashboardsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListGrafanaUsersRequestOrderBy

type ListGrafanaUsersRequestOrderBy string

func (ListGrafanaUsersRequestOrderBy) MarshalJSON

func (enum ListGrafanaUsersRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListGrafanaUsersRequestOrderBy) String

func (enum ListGrafanaUsersRequestOrderBy) String() string

func (*ListGrafanaUsersRequestOrderBy) UnmarshalJSON

func (enum *ListGrafanaUsersRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListGrafanaUsersRequestOrderBy) Values

type ListGrafanaUsersResponse

type ListGrafanaUsersResponse struct {
	// TotalCount: total count of Grafana users.
	TotalCount uint64 `json:"total_count"`

	// GrafanaUsers: grafana users information.
	GrafanaUsers []*GrafanaUser `json:"grafana_users"`
}

ListGrafanaUsersResponse: Ouptut returned when listing Grafana users.

func (*ListGrafanaUsersResponse) UnsafeAppend

func (r *ListGrafanaUsersResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListGrafanaUsersResponse) UnsafeGetTotalCount

func (r *ListGrafanaUsersResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListManagedAlertsRequestOrderBy

type ListManagedAlertsRequestOrderBy string

func (ListManagedAlertsRequestOrderBy) MarshalJSON

func (enum ListManagedAlertsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListManagedAlertsRequestOrderBy) String

func (*ListManagedAlertsRequestOrderBy) UnmarshalJSON

func (enum *ListManagedAlertsRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListManagedAlertsRequestOrderBy) Values

type ListManagedAlertsResponse

type ListManagedAlertsResponse struct {
	// TotalCount: total count of data sources matching the request.
	TotalCount uint64 `json:"total_count"`

	// Alerts: alerts matching the request within the pagination.
	Alerts []*Alert `json:"alerts"`
}

ListManagedAlertsResponse: Response returned when listing data sources.

func (*ListManagedAlertsResponse) UnsafeAppend

func (r *ListManagedAlertsResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListManagedAlertsResponse) UnsafeGetTotalCount

func (r *ListManagedAlertsResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListPlansRequestOrderBy

type ListPlansRequestOrderBy string

func (ListPlansRequestOrderBy) MarshalJSON

func (enum ListPlansRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListPlansRequestOrderBy) String

func (enum ListPlansRequestOrderBy) String() string

func (*ListPlansRequestOrderBy) UnmarshalJSON

func (enum *ListPlansRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListPlansRequestOrderBy) Values

type ListPlansResponse

type ListPlansResponse struct {
	// TotalCount: total count of available pricing plans.
	TotalCount uint64 `json:"total_count"`

	// Plans: plan types information.
	Plans []*Plan `json:"plans"`
}

ListPlansResponse: Output returned when listing pricing plans.

func (*ListPlansResponse) UnsafeAppend

func (r *ListPlansResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListPlansResponse) UnsafeGetTotalCount

func (r *ListPlansResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type ListTokensRequestOrderBy

type ListTokensRequestOrderBy string

func (ListTokensRequestOrderBy) MarshalJSON

func (enum ListTokensRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListTokensRequestOrderBy) String

func (enum ListTokensRequestOrderBy) String() string

func (*ListTokensRequestOrderBy) UnmarshalJSON

func (enum *ListTokensRequestOrderBy) UnmarshalJSON(data []byte) error

func (ListTokensRequestOrderBy) Values

type ListTokensResponse

type ListTokensResponse struct {
	// TotalCount: total count of tokens matching the request.
	TotalCount uint64 `json:"total_count"`

	// Tokens: tokens matching the request within the pagination.
	Tokens []*Token `json:"tokens"`
}

ListTokensResponse: Response returned when listing tokens.

func (*ListTokensResponse) UnsafeAppend

func (r *ListTokensResponse) UnsafeAppend(res interface{}) (uint64, error)

UnsafeAppend should not be used Internal usage only

func (*ListTokensResponse) UnsafeGetTotalCount

func (r *ListTokensResponse) UnsafeGetTotalCount() uint64

UnsafeGetTotalCount should not be used Internal usage only

type Plan

type Plan struct {
	// Name: name of a given pricing plan.
	// Default value: unknown_name
	Name PlanName `json:"name"`

	// RetentionMetricsInterval: interval of time during which Scaleway's Cockpit keeps your metrics.
	RetentionMetricsInterval *scw.Duration `json:"retention_metrics_interval"`

	// RetentionLogsInterval: interval of time during which Scaleway's Cockpit keeps your logs.
	RetentionLogsInterval *scw.Duration `json:"retention_logs_interval"`

	// RetentionTracesInterval: interval of time during which Scaleway's Cockpit keeps your traces.
	RetentionTracesInterval *scw.Duration `json:"retention_traces_interval"`

	// SampleIngestionPrice: ingestion price in cents for 1 million samples.
	SampleIngestionPrice uint32 `json:"sample_ingestion_price"`

	// LogsIngestionPrice: ingestion price in cents for 1 GB of logs.
	LogsIngestionPrice uint32 `json:"logs_ingestion_price"`

	// TracesIngestionPrice: ingestion price in cents for 1 GB of traces.
	TracesIngestionPrice uint32 `json:"traces_ingestion_price"`

	// MonthlyPrice: retention price in euros per month.
	MonthlyPrice uint32 `json:"monthly_price"`
}

Plan: Type of pricing plan.

type PlanName

type PlanName string

func (PlanName) MarshalJSON

func (enum PlanName) MarshalJSON() ([]byte, error)

func (PlanName) String

func (enum PlanName) String() string

func (*PlanName) UnmarshalJSON

func (enum *PlanName) UnmarshalJSON(data []byte) error

func (PlanName) Values

func (enum PlanName) Values() []PlanName

type RegionalAPI

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

The Cockpit Regional API allows you to create data sources and tokens to store and query data types such as metrics, logs, and traces. You can also push your data into Cockpit, and send alerts to your contact points when your resources may require your attention, using the regional Alert manager.

func NewRegionalAPI

func NewRegionalAPI(client *scw.Client) *RegionalAPI

NewRegionalAPI returns a RegionalAPI object from a Scaleway client.

func (*RegionalAPI) CreateContactPoint

func (s *RegionalAPI) CreateContactPoint(req *RegionalAPICreateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)

CreateContactPoint: Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to. The source of the alerts are data sources within the same Project and region as the Alert manager. If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager.

func (*RegionalAPI) CreateDataSource

func (s *RegionalAPI) CreateDataSource(req *RegionalAPICreateDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)

CreateDataSource: You must specify the data source type upon creation. Available data source types include:

  • metrics
  • logs
  • traces

The name of the data source will then be used as reference to name the associated Grafana data source.

func (*RegionalAPI) CreateToken

func (s *RegionalAPI) CreateToken(req *RegionalAPICreateTokenRequest, opts ...scw.RequestOption) (*Token, error)

CreateToken: Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for. Upon creation, your token's secret key display only once. Make sure that you save it.

func (*RegionalAPI) DeleteContactPoint

func (s *RegionalAPI) DeleteContactPoint(req *RegionalAPIDeleteContactPointRequest, opts ...scw.RequestOption) error

DeleteContactPoint: Delete a contact point associated with the default receiver.

func (*RegionalAPI) DeleteDataSource

func (s *RegionalAPI) DeleteDataSource(req *RegionalAPIDeleteDataSourceRequest, opts ...scw.RequestOption) error

DeleteDataSource: Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.

func (*RegionalAPI) DeleteToken

func (s *RegionalAPI) DeleteToken(req *RegionalAPIDeleteTokenRequest, opts ...scw.RequestOption) error

DeleteToken: Delete a given token, specified by the token ID. Deleting a token is irreversible and cannot be undone.

func (*RegionalAPI) DisableAlertManager

func (s *RegionalAPI) DisableAlertManager(req *RegionalAPIDisableAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)

DisableAlertManager: Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region.

func (*RegionalAPI) DisableManagedAlerts

func (s *RegionalAPI) DisableManagedAlerts(req *RegionalAPIDisableManagedAlertsRequest, opts ...scw.RequestOption) (*AlertManager, error)

DisableManagedAlerts: Disable the sending of managed alerts for the specified Project.

func (*RegionalAPI) EnableAlertManager

func (s *RegionalAPI) EnableAlertManager(req *RegionalAPIEnableAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)

EnableAlertManager: Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention.

func (*RegionalAPI) EnableManagedAlerts

func (s *RegionalAPI) EnableManagedAlerts(req *RegionalAPIEnableManagedAlertsRequest, opts ...scw.RequestOption) (*AlertManager, error)

EnableManagedAlerts: Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway recources integrated with Cockpit by default.

func (*RegionalAPI) GetAlertManager

func (s *RegionalAPI) GetAlertManager(req *RegionalAPIGetAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)

GetAlertManager: Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled. The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.

func (*RegionalAPI) GetDataSource

func (s *RegionalAPI) GetDataSource(req *RegionalAPIGetDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)

GetDataSource: Retrieve information about a given data source, specified by the data source ID. The data source's information such as its name, type, URL, origin, and retention period, is returned.

func (*RegionalAPI) GetToken

func (s *RegionalAPI) GetToken(req *RegionalAPIGetTokenRequest, opts ...scw.RequestOption) (*Token, error)

GetToken: Retrieve information about a given token, specified by the token ID. The token's information such as its scopes, is returned.

func (*RegionalAPI) GetUsageOverview

func (s *RegionalAPI) GetUsageOverview(req *RegionalAPIGetUsageOverviewRequest, opts ...scw.RequestOption) (*UsageOverview, error)

GetUsageOverview: Retrieve the data source usage overview per type for the specified Project.

func (*RegionalAPI) ListContactPoints

ListContactPoints: Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API.

func (*RegionalAPI) ListDataSources

ListDataSources: Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. You can list data sources by Project, type and origin.

func (*RegionalAPI) ListManagedAlerts

ListManagedAlerts: List all managed alerts for the specified Project.

func (*RegionalAPI) ListTokens

ListTokens: Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes.

func (*RegionalAPI) Regions

func (s *RegionalAPI) Regions() []scw.Region

func (*RegionalAPI) TriggerTestAlert

func (s *RegionalAPI) TriggerTestAlert(req *RegionalAPITriggerTestAlertRequest, opts ...scw.RequestOption) error

TriggerTestAlert: Send a test alert to the Alert manager to make sure your contact points get notified.

func (*RegionalAPI) UpdateDataSource

func (s *RegionalAPI) UpdateDataSource(req *RegionalAPIUpdateDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)

UpdateDataSource: Update a given data source name, specified by the data source ID.

type RegionalAPICreateContactPointRequest

type RegionalAPICreateContactPointRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project to create the contact point in.
	ProjectID string `json:"project_id"`

	// Email: email address of the contact point to create.
	// Precisely one of Email must be set.
	Email *ContactPointEmail `json:"email,omitempty"`
}

RegionalAPICreateContactPointRequest: Create a contact point.

type RegionalAPICreateDataSourceRequest

type RegionalAPICreateDataSourceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project the data source belongs to.
	ProjectID string `json:"project_id"`

	// Name: data source name.
	Name string `json:"name"`

	// Type: data source type.
	// Default value: unknown_type
	Type DataSourceType `json:"type"`
}

RegionalAPICreateDataSourceRequest: Create a data source.

type RegionalAPICreateTokenRequest

type RegionalAPICreateTokenRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project the token belongs to.
	ProjectID string `json:"project_id"`

	// Name: name of the token.
	Name string `json:"name"`

	// TokenScopes: token permission scopes.
	TokenScopes []TokenScope `json:"token_scopes"`
}

RegionalAPICreateTokenRequest: Create a token.

type RegionalAPIDeleteContactPointRequest

type RegionalAPIDeleteContactPointRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project containing the contact point to delete.
	ProjectID string `json:"project_id"`

	// Email: email address of the contact point to delete.
	// Precisely one of Email must be set.
	Email *ContactPointEmail `json:"email,omitempty"`
}

RegionalAPIDeleteContactPointRequest: Delete a contact point.

type RegionalAPIDeleteDataSourceRequest

type RegionalAPIDeleteDataSourceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DataSourceID: ID of the data source to delete.
	DataSourceID string `json:"-"`
}

RegionalAPIDeleteDataSourceRequest: Delete a data source.

type RegionalAPIDeleteTokenRequest

type RegionalAPIDeleteTokenRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TokenID: ID of the token to delete.
	TokenID string `json:"-"`
}

RegionalAPIDeleteTokenRequest: Delete a token.

type RegionalAPIDisableAlertManagerRequest

type RegionalAPIDisableAlertManagerRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project to disable the Alert manager in.
	ProjectID string `json:"project_id"`
}

RegionalAPIDisableAlertManagerRequest: Disable the Alert manager.

type RegionalAPIDisableManagedAlertsRequest

type RegionalAPIDisableManagedAlertsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project.
	ProjectID string `json:"project_id"`
}

RegionalAPIDisableManagedAlertsRequest: Disable the sending of managed alerts.

type RegionalAPIEnableAlertManagerRequest

type RegionalAPIEnableAlertManagerRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project to enable the Alert manager in.
	ProjectID string `json:"project_id"`
}

RegionalAPIEnableAlertManagerRequest: Enable the Alert manager.

type RegionalAPIEnableManagedAlertsRequest

type RegionalAPIEnableManagedAlertsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project.
	ProjectID string `json:"project_id"`
}

RegionalAPIEnableManagedAlertsRequest: Enable the sending of managed alerts.

type RegionalAPIGetAlertManagerRequest

type RegionalAPIGetAlertManagerRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: project ID of the requested Alert manager.
	ProjectID string `json:"project_id"`
}

RegionalAPIGetAlertManagerRequest: Get the Alert manager.

type RegionalAPIGetDataSourceRequest

type RegionalAPIGetDataSourceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DataSourceID: ID of the relevant data source.
	DataSourceID string `json:"-"`
}

RegionalAPIGetDataSourceRequest: Retrieve a data source.

type RegionalAPIGetTokenRequest

type RegionalAPIGetTokenRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TokenID: token ID.
	TokenID string `json:"-"`
}

RegionalAPIGetTokenRequest: Get a token.

type RegionalAPIGetUsageOverviewRequest

type RegionalAPIGetUsageOverviewRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	ProjectID string `json:"-"`

	Interval *scw.Duration `json:"-"`
}

RegionalAPIGetUsageOverviewRequest: regional api get usage overview request.

type RegionalAPIListContactPointsRequest

type RegionalAPIListContactPointsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: total count of contact points to return per page.
	PageSize *uint32 `json:"-"`

	// ProjectID: ID of the Project containing the contact points to list.
	ProjectID string `json:"-"`
}

RegionalAPIListContactPointsRequest: List contact points.

type RegionalAPIListDataSourcesRequest

type RegionalAPIListDataSourcesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of data sources to return per page.
	PageSize *uint32 `json:"-"`

	// OrderBy: sort order for data sources in the response.
	// Default value: created_at_asc
	OrderBy ListDataSourcesRequestOrderBy `json:"-"`

	// ProjectID: project ID to filter for, only data sources from this Project will be returned.
	ProjectID string `json:"-"`

	// Origin: origin to filter for, only data sources with matching origin will be returned.
	// Default value: unknown_origin
	Origin DataSourceOrigin `json:"-"`

	// Types: types to filter for, only data sources with matching types will be returned.
	Types []DataSourceType `json:"-"`
}

RegionalAPIListDataSourcesRequest: List data sources.

type RegionalAPIListManagedAlertsRequest

type RegionalAPIListManagedAlertsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of data sources to return per page.
	PageSize *uint32 `json:"-"`

	// OrderBy: sort order for data sources in the response.
	// Default value: created_at_asc
	OrderBy ListManagedAlertsRequestOrderBy `json:"-"`

	// ProjectID: project ID to filter for, only data sources from this Project will be returned.
	ProjectID string `json:"-"`
}

RegionalAPIListManagedAlertsRequest: Enable the sending of managed alerts.

type RegionalAPIListTokensRequest

type RegionalAPIListTokensRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of tokens to return per page.
	PageSize *uint32 `json:"-"`

	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListTokensRequestOrderBy `json:"-"`

	// ProjectID: ID of the Project the tokens belong to.
	ProjectID string `json:"-"`

	// TokenScopes: token scopes to filter for.
	TokenScopes []TokenScope `json:"-"`
}

RegionalAPIListTokensRequest: List tokens.

type RegionalAPITriggerTestAlertRequest

type RegionalAPITriggerTestAlertRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// ProjectID: ID of the Project.
	ProjectID string `json:"project_id"`
}

RegionalAPITriggerTestAlertRequest: Request to trigger a test alert.

type RegionalAPIUpdateDataSourceRequest

type RegionalAPIUpdateDataSourceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DataSourceID: ID of the data source to update.
	DataSourceID string `json:"-"`

	// Name: updated name of the data source.
	Name *string `json:"name,omitempty"`
}

RegionalAPIUpdateDataSourceRequest: Update a data source name.

type Token

type Token struct {
	// ID: ID of the token.
	ID string `json:"id"`

	// ProjectID: ID of the Project the token belongs to.
	ProjectID string `json:"project_id"`

	// Name: name of the token.
	Name string `json:"name"`

	// CreatedAt: token creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: token last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// Scopes: token permission scopes.
	Scopes []TokenScope `json:"scopes"`

	// SecretKey: token secret key.
	SecretKey *string `json:"secret_key"`

	// Region: regions where the token is located.
	Region scw.Region `json:"region"`
}

Token: Token.

type TokenScope

type TokenScope string

func (TokenScope) MarshalJSON

func (enum TokenScope) MarshalJSON() ([]byte, error)

func (TokenScope) String

func (enum TokenScope) String() string

func (*TokenScope) UnmarshalJSON

func (enum *TokenScope) UnmarshalJSON(data []byte) error

func (TokenScope) Values

func (enum TokenScope) Values() []TokenScope

type Usage

type Usage struct {
	// DataSourceID: ID of the data source.
	DataSourceID *string `json:"data_source_id"`

	// ProjectID: ID of the Project the data source belongs to.
	ProjectID string `json:"project_id"`

	// DataSourceOrigin: origin of the data source.
	// Default value: unknown_origin
	DataSourceOrigin DataSourceOrigin `json:"data_source_origin"`

	// DataSourceType: type of the data source.
	// Default value: unknown_type
	DataSourceType DataSourceType `json:"data_source_type"`

	// Unit: unit of the data source usage.
	// Default value: unknown_unit
	Unit UsageUnit `json:"unit"`

	// Interval: interval for the data source usage.
	Interval *scw.Duration `json:"interval"`

	// QuantityOverInterval: data source usage for the given interval.
	QuantityOverInterval uint64 `json:"quantity_over_interval"`

	// Region: region of the data source usage.
	Region scw.Region `json:"region"`
}

Usage: Data source usage.

type UsageOverview

type UsageOverview struct {
	ScalewayMetricsUsage *Usage `json:"scaleway_metrics_usage"`

	ScalewayLogsUsage *Usage `json:"scaleway_logs_usage"`

	ExternalMetricsUsage *Usage `json:"external_metrics_usage"`

	ExternalLogsUsage *Usage `json:"external_logs_usage"`

	ExternalTracesUsage *Usage `json:"external_traces_usage"`
}

UsageOverview: usage overview.

type UsageUnit

type UsageUnit string

func (UsageUnit) MarshalJSON

func (enum UsageUnit) MarshalJSON() ([]byte, error)

func (UsageUnit) String

func (enum UsageUnit) String() string

func (*UsageUnit) UnmarshalJSON

func (enum *UsageUnit) UnmarshalJSON(data []byte) error

func (UsageUnit) Values

func (enum UsageUnit) Values() []UsageUnit

Jump to

Keyboard shortcuts

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