Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package cockpit provides methods and message types of the cockpit v1 API.
Index ¶
- Constants
 - type Alert
 - type AlertManager
 - type AlertState
 - type AlertStatus
 - type ContactPoint
 - type ContactPointEmail
 - type DataSource
 - type DataSourceOrigin
 - type DataSourceType
 - type DisableAlertRulesResponse
 - type EnableAlertRulesResponse
 - type GetConfigResponse
 - type GetConfigResponseRetention
 - type GetRulesCountResponse
 - type GlobalAPI
 - func (s *GlobalAPI) CreateGrafanaUser(req *GlobalAPICreateGrafanaUserRequest, opts ...scw.RequestOption) (*GrafanaUser, error)
 - func (s *GlobalAPI) DeleteGrafanaUser(req *GlobalAPIDeleteGrafanaUserRequest, opts ...scw.RequestOption) error
 - func (s *GlobalAPI) GetCurrentPlan(req *GlobalAPIGetCurrentPlanRequest, opts ...scw.RequestOption) (*Plan, error)deprecated
 - func (s *GlobalAPI) GetGrafana(req *GlobalAPIGetGrafanaRequest, opts ...scw.RequestOption) (*Grafana, error)
 - func (s *GlobalAPI) GetGrafanaProductDashboard(req *GlobalAPIGetGrafanaProductDashboardRequest, opts ...scw.RequestOption) (*GrafanaProductDashboard, error)
 - func (s *GlobalAPI) ListGrafanaProductDashboards(req *GlobalAPIListGrafanaProductDashboardsRequest, opts ...scw.RequestOption) (*ListGrafanaProductDashboardsResponse, error)
 - func (s *GlobalAPI) ListGrafanaUsers(req *GlobalAPIListGrafanaUsersRequest, opts ...scw.RequestOption) (*ListGrafanaUsersResponse, error)
 - func (s *GlobalAPI) ListPlans(req *GlobalAPIListPlansRequest, opts ...scw.RequestOption) (*ListPlansResponse, error)deprecated
 - func (s *GlobalAPI) ResetGrafanaUserPassword(req *GlobalAPIResetGrafanaUserPasswordRequest, opts ...scw.RequestOption) (*GrafanaUser, error)
 - func (s *GlobalAPI) SelectPlan(req *GlobalAPISelectPlanRequest, opts ...scw.RequestOption) (*Plan, error)deprecated
 - func (s *GlobalAPI) SyncGrafanaDataSources(req *GlobalAPISyncGrafanaDataSourcesRequest, opts ...scw.RequestOption) error
 
- type GlobalAPICreateGrafanaUserRequest
 - type GlobalAPIDeleteGrafanaUserRequest
 - type GlobalAPIGetCurrentPlanRequest
 - type GlobalAPIGetGrafanaProductDashboardRequest
 - type GlobalAPIGetGrafanaRequest
 - type GlobalAPIListGrafanaProductDashboardsRequest
 - type GlobalAPIListGrafanaUsersRequest
 - type GlobalAPIListPlansRequest
 - type GlobalAPIResetGrafanaUserPasswordRequest
 - type GlobalAPISelectPlanRequest
 - type GlobalAPISyncGrafanaDataSourcesRequest
 - type Grafana
 - type GrafanaProductDashboard
 - type GrafanaUser
 - type GrafanaUserRole
 - type ListAlertsResponse
 - type ListContactPointsResponse
 - type ListDataSourcesRequestOrderBy
 - type ListDataSourcesResponse
 - type ListGrafanaProductDashboardsResponse
 - type ListGrafanaUsersRequestOrderBy
 - type ListGrafanaUsersResponse
 - type ListPlansRequestOrderBy
 - type ListPlansResponse
 - type ListTokensRequestOrderBy
 - type ListTokensResponse
 - type Plan
 - type PlanName
 - type PreconfiguredAlertData
 - type RegionalAPI
 - func (s *RegionalAPI) CreateContactPoint(req *RegionalAPICreateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)
 - func (s *RegionalAPI) CreateDataSource(req *RegionalAPICreateDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)
 - func (s *RegionalAPI) CreateToken(req *RegionalAPICreateTokenRequest, opts ...scw.RequestOption) (*Token, error)
 - func (s *RegionalAPI) DeleteContactPoint(req *RegionalAPIDeleteContactPointRequest, opts ...scw.RequestOption) error
 - func (s *RegionalAPI) DeleteDataSource(req *RegionalAPIDeleteDataSourceRequest, opts ...scw.RequestOption) error
 - func (s *RegionalAPI) DeleteToken(req *RegionalAPIDeleteTokenRequest, opts ...scw.RequestOption) error
 - func (s *RegionalAPI) DisableAlertManager(req *RegionalAPIDisableAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)
 - func (s *RegionalAPI) DisableAlertRules(req *RegionalAPIDisableAlertRulesRequest, opts ...scw.RequestOption) (*DisableAlertRulesResponse, error)
 - func (s *RegionalAPI) DisableManagedAlerts(req *RegionalAPIDisableManagedAlertsRequest, opts ...scw.RequestOption) (*AlertManager, error)
 - func (s *RegionalAPI) EnableAlertManager(req *RegionalAPIEnableAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)
 - func (s *RegionalAPI) EnableAlertRules(req *RegionalAPIEnableAlertRulesRequest, opts ...scw.RequestOption) (*EnableAlertRulesResponse, error)
 - func (s *RegionalAPI) EnableManagedAlerts(req *RegionalAPIEnableManagedAlertsRequest, opts ...scw.RequestOption) (*AlertManager, error)
 - func (s *RegionalAPI) GetAlertManager(req *RegionalAPIGetAlertManagerRequest, opts ...scw.RequestOption) (*AlertManager, error)
 - func (s *RegionalAPI) GetConfig(req *RegionalAPIGetConfigRequest, opts ...scw.RequestOption) (*GetConfigResponse, error)
 - func (s *RegionalAPI) GetDataSource(req *RegionalAPIGetDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)
 - func (s *RegionalAPI) GetRulesCount(req *RegionalAPIGetRulesCountRequest, opts ...scw.RequestOption) (*GetRulesCountResponse, error)
 - func (s *RegionalAPI) GetToken(req *RegionalAPIGetTokenRequest, opts ...scw.RequestOption) (*Token, error)
 - func (s *RegionalAPI) GetUsageOverview(req *RegionalAPIGetUsageOverviewRequest, opts ...scw.RequestOption) (*UsageOverview, error)
 - func (s *RegionalAPI) ListAlerts(req *RegionalAPIListAlertsRequest, opts ...scw.RequestOption) (*ListAlertsResponse, error)
 - func (s *RegionalAPI) ListContactPoints(req *RegionalAPIListContactPointsRequest, opts ...scw.RequestOption) (*ListContactPointsResponse, error)
 - func (s *RegionalAPI) ListDataSources(req *RegionalAPIListDataSourcesRequest, opts ...scw.RequestOption) (*ListDataSourcesResponse, error)
 - func (s *RegionalAPI) ListTokens(req *RegionalAPIListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)
 - func (s *RegionalAPI) Regions() []scw.Region
 - func (s *RegionalAPI) TriggerTestAlert(req *RegionalAPITriggerTestAlertRequest, opts ...scw.RequestOption) error
 - func (s *RegionalAPI) UpdateContactPoint(req *RegionalAPIUpdateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)
 - func (s *RegionalAPI) UpdateDataSource(req *RegionalAPIUpdateDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)
 
- type RegionalAPICreateContactPointRequest
 - type RegionalAPICreateDataSourceRequest
 - type RegionalAPICreateTokenRequest
 - type RegionalAPIDeleteContactPointRequest
 - type RegionalAPIDeleteDataSourceRequest
 - type RegionalAPIDeleteTokenRequest
 - type RegionalAPIDisableAlertManagerRequest
 - type RegionalAPIDisableAlertRulesRequest
 - type RegionalAPIDisableManagedAlertsRequest
 - type RegionalAPIEnableAlertManagerRequest
 - type RegionalAPIEnableAlertRulesRequest
 - type RegionalAPIEnableManagedAlertsRequest
 - type RegionalAPIGetAlertManagerRequest
 - type RegionalAPIGetConfigRequest
 - type RegionalAPIGetDataSourceRequest
 - type RegionalAPIGetRulesCountRequest
 - type RegionalAPIGetTokenRequest
 - type RegionalAPIGetUsageOverviewRequest
 - type RegionalAPIListAlertsRequest
 - type RegionalAPIListContactPointsRequest
 - type RegionalAPIListDataSourcesRequest
 - type RegionalAPIListTokensRequest
 - type RegionalAPITriggerTestAlertRequest
 - type RegionalAPIUpdateContactPointRequest
 - type RegionalAPIUpdateDataSourceRequest
 - type RulesCount
 - type Token
 - type TokenScope
 - type Usage
 - type UsageOverview
 - type UsageUnit
 
Constants ¶
const ( AlertStateUnknownState = AlertState("unknown_state") // The alert is inactive and may transition to `pending` or `firing` if its conditions are met. AlertStateInactive = AlertState("inactive") // The alert's conditions are met. They must persist for the configured duration before transitioning to the `firing` state. AlertStatePending = AlertState("pending") // The alert's conditions, including the required duration, have been fully met. AlertStateFiring = AlertState("firing") )
const ( AlertStatusUnknownStatus = AlertStatus("unknown_status") // The alert is enabled and may trigger based on its conditions. AlertStatusEnabled = AlertStatus("enabled") // The alert is disabled. It will never trigger, and will not be evaluated. AlertStatusDisabled = AlertStatus("disabled") // The alert has been marked for activation. It will be enabled momentarily. AlertStatusEnabling = AlertStatus("enabling") // The alert has been marked for deactivation. It will be disabled momentarily. AlertStatusDisabling = AlertStatus("disabling") )
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 custom resources. DataSourceOriginExternal = DataSourceOrigin("external") // Data source created by the user, used to store and query metrics, logs and traces from user's custom resources. DataSourceOriginCustom = DataSourceOrigin("custom") )
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") )
const ( // Unknown role. GrafanaUserRoleUnknownRole = GrafanaUserRole("unknown_role") // Editor role. GrafanaUserRoleEditor = GrafanaUserRole("editor") // Viewer role. GrafanaUserRoleViewer = GrafanaUserRole("viewer") )
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") )
const ( ListGrafanaUsersRequestOrderByLoginAsc = ListGrafanaUsersRequestOrderBy("login_asc") ListGrafanaUsersRequestOrderByLoginDesc = ListGrafanaUsersRequestOrderBy("login_desc") )
const ( ListPlansRequestOrderByNameAsc = ListPlansRequestOrderBy("name_asc") ListPlansRequestOrderByNameDesc = ListPlansRequestOrderBy("name_desc") )
const ( ListTokensRequestOrderByCreatedAtAsc = ListTokensRequestOrderBy("created_at_asc") ListTokensRequestOrderByCreatedAtDesc = ListTokensRequestOrderBy("created_at_desc") ListTokensRequestOrderByNameAsc = ListTokensRequestOrderBy("name_asc") ListTokensRequestOrderByNameDesc = ListTokensRequestOrderBy("name_desc") )
const ( PlanNameUnknownName = PlanName("unknown_name") PlanNameFree = PlanName("free") PlanNamePremium = PlanName("premium") PlanNameCustom = PlanName("custom") )
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") )
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 {
	// Region: the region in which the alert is defined.
	Region scw.Region `json:"region"`
	// Preconfigured: indicates if the alert is preconfigured or custom.
	Preconfigured bool `json:"preconfigured"`
	// Name: name of the alert.
	Name string `json:"name"`
	// Rule: rule defining the alert condition.
	Rule string `json:"rule"`
	// Duration: duration for which the alert must be active before firing. The format of this duration follows the prometheus duration format.
	Duration string `json:"duration"`
	// RuleStatus: indicates if the alert is enabled, enabling, disabled or disabling. Preconfigured alerts can have any of these values, whereas custom alerts can only have the status "enabled".
	// Default value: unknown_status
	RuleStatus AlertStatus `json:"rule_status"`
	// State: current state of the alert. Possible states are `inactive`, `pending`, and `firing`.
	// Default value: unknown_state
	State *AlertState `json:"state"`
	// Annotations: annotations for the alert, used to provide additional information about the alert.
	Annotations map[string]string `json:"annotations"`
	// PreconfiguredData: contains additional data for preconfigured alerts, such as the rule ID, display name, and description. Only present if the alert is preconfigured.
	PreconfiguredData *PreconfiguredAlertData `json:"preconfigured_data"`
	// DataSourceID: ID of the data source containing the alert rule.
	DataSourceID string `json:"data_source_id"`
}
    Alert: Structure representing an 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 AlertState ¶
type AlertState string
func (AlertState) MarshalJSON ¶
func (enum AlertState) MarshalJSON() ([]byte, error)
func (AlertState) String ¶
func (enum AlertState) String() string
func (*AlertState) UnmarshalJSON ¶
func (enum *AlertState) UnmarshalJSON(data []byte) error
func (AlertState) Values ¶
func (enum AlertState) Values() []AlertState
type AlertStatus ¶
type AlertStatus string
func (AlertStatus) MarshalJSON ¶
func (enum AlertStatus) MarshalJSON() ([]byte, error)
func (AlertStatus) String ¶
func (enum AlertStatus) String() string
func (*AlertStatus) UnmarshalJSON ¶
func (enum *AlertStatus) UnmarshalJSON(data []byte) error
func (AlertStatus) Values ¶
func (enum AlertStatus) Values() []AlertStatus
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.
	Region scw.Region `json:"region"`
	// SendResolvedNotifications: send an email notification when an alert is marked as resolved.
	SendResolvedNotifications bool `json:"send_resolved_notifications"`
}
    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"`
	// RetentionDays: duration for which the data will be retained in the data source.
	RetentionDays uint32 `json:"retention_days"`
	// 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 DisableAlertRulesResponse ¶
type DisableAlertRulesResponse struct {
	// DisabledRuleIDs: only newly disabled rules are listed. Rules that were already disabled are not returned in the output.
	DisabledRuleIDs []string `json:"disabled_rule_ids"`
}
    DisableAlertRulesResponse: Output returned when alert rules are disabled.
type EnableAlertRulesResponse ¶
type EnableAlertRulesResponse struct {
	// EnabledRuleIDs: only newly enabled rules are listed. Rules that were already enabled are not returned in the output.
	EnabledRuleIDs []string `json:"enabled_rule_ids"`
}
    EnableAlertRulesResponse: Output returned when alert rules are enabled.
type GetConfigResponse ¶
type GetConfigResponse struct {
	// CustomMetricsRetention: custom metrics retention configuration.
	CustomMetricsRetention *GetConfigResponseRetention `json:"custom_metrics_retention"`
	// CustomLogsRetention: custom logs retention configuration.
	CustomLogsRetention *GetConfigResponseRetention `json:"custom_logs_retention"`
	// CustomTracesRetention: custom traces retention configuration.
	CustomTracesRetention *GetConfigResponseRetention `json:"custom_traces_retention"`
	// ProductMetricsRetention: scaleway metrics retention configuration.
	ProductMetricsRetention *GetConfigResponseRetention `json:"product_metrics_retention"`
	// ProductLogsRetention: scaleway logs retention configuration.
	ProductLogsRetention *GetConfigResponseRetention `json:"product_logs_retention"`
}
    GetConfigResponse: Cockpit configuration.
type GetConfigResponseRetention ¶
type GetConfigResponseRetention struct {
	MinDays uint32 `json:"min_days"`
	MaxDays uint32 `json:"max_days"`
	DefaultDays uint32 `json:"default_days"`
}
    GetConfigResponseRetention: get config response retention.
type GetRulesCountResponse ¶
type GetRulesCountResponse struct {
	// RulesCountByDatasource: total count of rules grouped by data source.
	RulesCountByDatasource []*RulesCount `json:"rules_count_by_datasource"`
	// PreconfiguredRulesCount: total count of preconfigured rules.
	PreconfiguredRulesCount int32 `json:"preconfigured_rules_count"`
	// CustomRulesCount: total count of custom rules.
	CustomRulesCount int32 `json:"custom_rules_count"`
}
    GetRulesCountResponse: get rules count response.
type GlobalAPI ¶
type GlobalAPI struct {
	// contains filtered or unexported fields
}
    The Cockpit Global API allows you to manage your Cockpit's Grafana.
func NewGlobalAPI ¶
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
            deprecated
            
          
  
    
  
      
      func (s *GlobalAPI) GetCurrentPlan(req *GlobalAPIGetCurrentPlanRequest, opts ...scw.RequestOption) (*Plan, error)
Deprecated: GetCurrentPlan: Retrieve a pricing plan for the given Project, specified by the ID of the Project. Deprecated: retention is now managed at the data source level.
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 ¶
func (s *GlobalAPI) GetGrafanaProductDashboard(req *GlobalAPIGetGrafanaProductDashboardRequest, opts ...scw.RequestOption) (*GrafanaProductDashboard, error)
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 ¶
func (s *GlobalAPI) ListGrafanaProductDashboards(req *GlobalAPIListGrafanaProductDashboardsRequest, opts ...scw.RequestOption) (*ListGrafanaProductDashboardsResponse, error)
ListGrafanaProductDashboards: Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit.
func (*GlobalAPI) ListGrafanaUsers ¶
func (s *GlobalAPI) ListGrafanaUsers(req *GlobalAPIListGrafanaUsersRequest, opts ...scw.RequestOption) (*ListGrafanaUsersResponse, error)
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
            deprecated
            
          
  
    
  
      
      func (s *GlobalAPI) ListPlans(req *GlobalAPIListPlansRequest, opts ...scw.RequestOption) (*ListPlansResponse, error)
Deprecated: ListPlans: Retrieve a list of available pricing plan types. Deprecated: retention is now managed at the data source level.
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
            deprecated
            
          
  
    
  
      
      func (s *GlobalAPI) SelectPlan(req *GlobalAPISelectPlanRequest, opts ...scw.RequestOption) (*Plan, error)
Deprecated: 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. Deprecated: retention is now managed at the data source level.
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 ListAlertsResponse ¶
type ListAlertsResponse struct {
	// TotalCount: total count of alerts matching the request.
	TotalCount uint64 `json:"total_count"`
	// Alerts: list of alerts matching the applied filters.
	Alerts []*Alert `json:"alerts"`
}
    ListAlertsResponse: Retrieve a list of alerts matching the request.
func (*ListAlertsResponse) UnsafeAppend ¶
func (r *ListAlertsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListAlertsResponse) UnsafeGetTotalCount ¶
func (r *ListAlertsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
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 any) (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 ¶
func (enum ListDataSourcesRequestOrderBy) Values() []ListDataSourcesRequestOrderBy
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 any) (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 any) (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 ¶
func (enum ListGrafanaUsersRequestOrderBy) Values() []ListGrafanaUsersRequestOrderBy
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 any) (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 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 ¶
func (enum ListPlansRequestOrderBy) Values() []ListPlansRequestOrderBy
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 any) (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 ¶
func (enum ListTokensRequestOrderBy) Values() []ListTokensRequestOrderBy
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 any) (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 PreconfiguredAlertData ¶
type PreconfiguredAlertData struct {
	// PreconfiguredRuleID: ID of the preconfigured rule if the alert is preconfigured.
	PreconfiguredRuleID string `json:"preconfigured_rule_id"`
	// DisplayName: human readable name of the alert.
	DisplayName string `json:"display_name"`
	// DisplayDescription: human readable description of the alert.
	DisplayDescription string `json:"display_description"`
	// ProductName: product associated with the alert.
	ProductName string `json:"product_name"`
	// ProductFamily: family of the product associated with the alert.
	ProductFamily string `json:"product_family"`
}
    PreconfiguredAlertData: Structure for additional data relative to preconfigured alerts.
type RegionalAPI ¶
type RegionalAPI struct {
	// contains filtered or unexported fields
}
    The Cockpit API allows you to create data sources and Cockpit 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 name and type (metrics, logs, traces) upon creation. 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. Note that this action will permanently delete this data source and any data associated with it.
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) DisableAlertRules ¶
func (s *RegionalAPI) DisableAlertRules(req *RegionalAPIDisableAlertRulesRequest, opts ...scw.RequestOption) (*DisableAlertRulesResponse, error)
DisableAlertRules: Disable alert rules from the list of available preconfigured rules.
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) EnableAlertRules ¶
func (s *RegionalAPI) EnableAlertRules(req *RegionalAPIEnableAlertRulesRequest, opts ...scw.RequestOption) (*EnableAlertRulesResponse, error)
EnableAlertRules: Enable alert rules from the list of available preconfigured rules.
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) GetConfig ¶
func (s *RegionalAPI) GetConfig(req *RegionalAPIGetConfigRequest, opts ...scw.RequestOption) (*GetConfigResponse, error)
GetConfig: Get the Cockpit configuration.
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) GetRulesCount ¶
func (s *RegionalAPI) GetRulesCount(req *RegionalAPIGetRulesCountRequest, opts ...scw.RequestOption) (*GetRulesCountResponse, error)
GetRulesCount: Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules.
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 volume of data ingested for each of your data sources in the specified project and region.
func (*RegionalAPI) ListAlerts ¶
func (s *RegionalAPI) ListAlerts(req *RegionalAPIListAlertsRequest, opts ...scw.RequestOption) (*ListAlertsResponse, error)
ListAlerts: List preconfigured and/or custom alerts for the specified Project and data source.
func (*RegionalAPI) ListContactPoints ¶
func (s *RegionalAPI) ListContactPoints(req *RegionalAPIListContactPointsRequest, opts ...scw.RequestOption) (*ListContactPointsResponse, error)
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 ¶
func (s *RegionalAPI) ListDataSources(req *RegionalAPIListDataSourcesRequest, opts ...scw.RequestOption) (*ListDataSourcesResponse, error)
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.
func (*RegionalAPI) ListTokens ¶
func (s *RegionalAPI) ListTokens(req *RegionalAPIListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)
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) UpdateContactPoint ¶
func (s *RegionalAPI) UpdateContactPoint(req *RegionalAPIUpdateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)
UpdateContactPoint:
func (*RegionalAPI) UpdateDataSource ¶
func (s *RegionalAPI) UpdateDataSource(req *RegionalAPIUpdateDataSourceRequest, opts ...scw.RequestOption) (*DataSource, error)
UpdateDataSource: Update a given data source attributes (name and/or retention_days).
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"`
	// SendResolvedNotifications: send an email notification when an alert is marked as resolved.
	SendResolvedNotifications *bool `json:"send_resolved_notifications,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"`
	// RetentionDays: default values are 31 days for metrics, 7 days for logs and traces.
	RetentionDays *uint32 `json:"retention_days,omitempty"`
}
    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 RegionalAPIDisableAlertRulesRequest ¶
type RegionalAPIDisableAlertRulesRequest 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"`
	// RuleIDs: list of IDs of the rules to enable. If empty, disables all preconfigured rules.
	RuleIDs []string `json:"rule_ids"`
}
    RegionalAPIDisableAlertRulesRequest: regional api disable alert rules request.
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 RegionalAPIEnableAlertRulesRequest ¶
type RegionalAPIEnableAlertRulesRequest 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"`
	// RuleIDs: list of IDs of the rules to enable. If empty, enables all preconfigured rules.
	RuleIDs []string `json:"rule_ids"`
}
    RegionalAPIEnableAlertRulesRequest: regional api enable alert rules request.
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 RegionalAPIGetConfigRequest ¶
type RegionalAPIGetConfigRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
}
    RegionalAPIGetConfigRequest: Get Cockpit configuration.
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 RegionalAPIGetRulesCountRequest ¶
type RegionalAPIGetRulesCountRequest 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 retrieve the rule count for.
	ProjectID string `json:"project_id"`
}
    RegionalAPIGetRulesCountRequest: regional api get rules count request.
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 RegionalAPIListAlertsRequest ¶
type RegionalAPIListAlertsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// ProjectID: project ID to filter for, only alerts from this Project will be returned.
	ProjectID string `json:"-"`
	// RuleStatus: returns only alerts with the given activation status. If omitted, no alert filtering is applied. Other filters may still apply.
	// Default value: unknown_status
	RuleStatus *AlertStatus `json:"-"`
	// IsPreconfigured: true returns only preconfigured alerts. False returns only custom alerts. If omitted, no filtering is applied on alert types. Other filters may still apply.
	IsPreconfigured *bool `json:"-"`
	// State: valid values to filter on are `inactive`, `pending` and `firing`. If omitted, no filtering is applied on alert states. Other filters may still apply.
	// Default value: unknown_state
	State *AlertState `json:"-"`
	// DataSourceID: if omitted, only alerts from the default Scaleway metrics data source will be listed.
	DataSourceID *string `json:"-"`
}
    RegionalAPIListAlertsRequest: Retrieve a list of alerts.
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. If omitted, all types will be returned.
	// Default value: unknown_origin
	Origin DataSourceOrigin `json:"-"`
	// Types: types to filter for (metrics, logs, traces), only data sources with matching types will be returned. If omitted, all types will be returned.
	Types []DataSourceType `json:"-"`
}
    RegionalAPIListDataSourcesRequest: List data sources.
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 RegionalAPIUpdateContactPointRequest ¶
type RegionalAPIUpdateContactPointRequest 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 update.
	ProjectID string `json:"project_id"`
	// Email: email address of the contact point to update.
	// Precisely one of Email must be set.
	Email *ContactPointEmail `json:"email,omitempty"`
	// SendResolvedNotifications: enable or disable notifications when alert is resolved.
	SendResolvedNotifications *bool `json:"send_resolved_notifications,omitempty"`
}
    RegionalAPIUpdateContactPointRequest: Update a contact point.
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"`
	// RetentionDays: duration for which the data will be retained in the data source.
	RetentionDays *uint32 `json:"retention_days,omitempty"`
}
    RegionalAPIUpdateDataSourceRequest: Update a data source name.
type RulesCount ¶
type RulesCount struct {
	// DataSourceID: ID of the data source.
	DataSourceID string `json:"data_source_id"`
	// DataSourceName: name of the data source.
	DataSourceName string `json:"data_source_name"`
	// RulesCount: total count of rules associated with this data source.
	RulesCount int32 `json:"rules_count"`
}
    RulesCount: rules count.
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