cockpit

package
v1.0.0-beta.14 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	CockpitStatusUnknownStatus = CockpitStatus("unknown_status")
	CockpitStatusCreating      = CockpitStatus("creating")
	CockpitStatusReady         = CockpitStatus("ready")
	CockpitStatusDeleting      = CockpitStatus("deleting")
	CockpitStatusUpdating      = CockpitStatus("updating")
	CockpitStatusError         = CockpitStatus("error")
)
View Source
const (
	GrafanaUserRoleUnknownRole = GrafanaUserRole("unknown_role")
	GrafanaUserRoleEditor      = GrafanaUserRole("editor")
	GrafanaUserRoleViewer      = GrafanaUserRole("viewer")
)
View Source
const (
	ListGrafanaUsersRequestOrderByLoginAsc  = ListGrafanaUsersRequestOrderBy("login_asc")
	ListGrafanaUsersRequestOrderByLoginDesc = ListGrafanaUsersRequestOrderBy("login_desc")
)
View Source
const (
	ListTokensRequestOrderByCreatedAtAsc  = ListTokensRequestOrderBy("created_at_asc")
	ListTokensRequestOrderByCreatedAtDesc = ListTokensRequestOrderBy("created_at_desc")
	ListTokensRequestOrderByNameAsc       = ListTokensRequestOrderBy("name_asc")
	ListTokensRequestOrderByNameDesc      = ListTokensRequestOrderBy("name_desc")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: this API allows to manage Cockpits.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) ActivateCockpit

func (s *API) ActivateCockpit(req *ActivateCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)

ActivateCockpit: activate a cockpit associated with the given project ID.

func (*API) CreateContactPoint

func (s *API) CreateContactPoint(req *CreateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)

CreateContactPoint: create an alert contact point for the default receiver.

func (*API) CreateGrafanaUser

func (s *API) CreateGrafanaUser(req *CreateGrafanaUserRequest, opts ...scw.RequestOption) (*GrafanaUser, error)

CreateGrafanaUser: create a grafana user for your grafana instance.

func (*API) CreateToken

func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error)

CreateToken: create a token associated with the given project ID.

func (*API) DeactivateCockpit

func (s *API) DeactivateCockpit(req *DeactivateCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)

DeactivateCockpit: deactivate a cockpit associated with the given project ID.

func (*API) DeleteContactPoint

func (s *API) DeleteContactPoint(req *DeleteContactPointRequest, opts ...scw.RequestOption) error

DeleteContactPoint: delete an alert contact point for the default receiver.

func (*API) DeleteGrafanaUser

func (s *API) DeleteGrafanaUser(req *DeleteGrafanaUserRequest, opts ...scw.RequestOption) error

DeleteGrafanaUser: delete a grafana user from your grafana instance.

func (*API) DeleteToken

func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) error

DeleteToken: delete the token associated with the given ID.

func (*API) DisableManagedAlerts

func (s *API) DisableManagedAlerts(req *DisableManagedAlertsRequest, opts ...scw.RequestOption) error

DisableManagedAlerts: disable managed alerts.

func (*API) EnableManagedAlerts

func (s *API) EnableManagedAlerts(req *EnableManagedAlertsRequest, opts ...scw.RequestOption) error

EnableManagedAlerts: enable managed alerts.

func (*API) GetCockpit

func (s *API) GetCockpit(req *GetCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)

GetCockpit: get the cockpit associated with the given project ID.

func (*API) GetToken

func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error)

GetToken: get the token associated with the given ID.

func (*API) ListContactPoints

func (s *API) ListContactPoints(req *ListContactPointsRequest, opts ...scw.RequestOption) (*ListContactPointsResponse, error)

ListContactPoints: list alert contact points associated with the given cockpit ID.

func (*API) ListGrafanaUsers

func (s *API) ListGrafanaUsers(req *ListGrafanaUsersRequest, opts ...scw.RequestOption) (*ListGrafanaUsersResponse, error)

ListGrafanaUsers: list grafana users who are able to connect to your grafana instance.

func (*API) ListTokens

func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)

ListTokens: list tokens associated with the given project ID.

func (*API) ResetCockpitGrafana

func (s *API) ResetCockpitGrafana(req *ResetCockpitGrafanaRequest, opts ...scw.RequestOption) (*Cockpit, error)

ResetCockpitGrafana: reset the Grafana of your cockpit associated with the given project ID.

func (*API) ResetGrafanaUserPassword

func (s *API) ResetGrafanaUserPassword(req *ResetGrafanaUserPasswordRequest, opts ...scw.RequestOption) (*GrafanaUser, error)

ResetGrafanaUserPassword: reset the Grafana user password from your grafana instance.

func (*API) TriggerTestAlert

func (s *API) TriggerTestAlert(req *TriggerTestAlertRequest, opts ...scw.RequestOption) error

TriggerTestAlert: trigger a test alert to all receivers.

func (*API) WaitForCockpit

func (s *API) WaitForCockpit(
	req *WaitForCockpitRequest,
	opts ...scw.RequestOption,
) (*Cockpit, error)

type ActivateCockpitRequest

type ActivateCockpitRequest struct {
	ProjectID string `json:"project_id"`
}

type Cockpit

type Cockpit struct {
	// ProjectID: project ID.
	ProjectID string `json:"project_id"`
	// CreatedAt: created at.
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: updated at.
	UpdatedAt *time.Time `json:"updated_at"`
	// Endpoints: endpoints.
	Endpoints *CockpitEndpoints `json:"endpoints"`
	// Status: status.
	// Default value: unknown_status
	Status CockpitStatus `json:"status"`
	// ManagedAlertsEnabled: managed alerts enabled.
	ManagedAlertsEnabled bool `json:"managed_alerts_enabled"`
}

Cockpit: cockpit.

type CockpitEndpoints

type CockpitEndpoints struct {
	MetricsURL string `json:"metrics_url"`

	LogsURL string `json:"logs_url"`

	AlertmanagerURL string `json:"alertmanager_url"`

	GrafanaURL string `json:"grafana_url"`
}

CockpitEndpoints: cockpit. endpoints.

type CockpitStatus

type CockpitStatus string

func (CockpitStatus) MarshalJSON

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

func (CockpitStatus) String

func (enum CockpitStatus) String() string

func (*CockpitStatus) UnmarshalJSON

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

type ContactPoint

type ContactPoint struct {
	// Email: alert contact point configuration.
	// Precisely one of Email must be set.
	Email *ContactPointEmail `json:"email,omitempty"`
}

ContactPoint: alert contact point.

type ContactPointEmail

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

type CreateContactPointRequest

type CreateContactPointRequest struct {
	// ProjectID: project ID.
	ProjectID string `json:"project_id"`
	// ContactPoint: contact point to create.
	ContactPoint *ContactPoint `json:"contact_point"`
}

type CreateGrafanaUserRequest

type CreateGrafanaUserRequest struct {
	ProjectID string `json:"project_id"`

	Login string `json:"login"`
	// Role:
	// Default value: unknown_role
	Role GrafanaUserRole `json:"role"`
}

type CreateTokenRequest

type CreateTokenRequest struct {
	ProjectID string `json:"project_id"`

	Name string `json:"name"`

	Scopes *TokenScopes `json:"scopes"`
}

type DeactivateCockpitRequest

type DeactivateCockpitRequest struct {
	ProjectID string `json:"project_id"`
}

type DeleteContactPointRequest

type DeleteContactPointRequest struct {
	ProjectID string `json:"project_id"`
	// ContactPoint: contact point to delete.
	ContactPoint *ContactPoint `json:"contact_point"`
}

type DeleteGrafanaUserRequest

type DeleteGrafanaUserRequest struct {
	GrafanaUserID uint32 `json:"-"`

	ProjectID string `json:"project_id"`
}

type DeleteTokenRequest

type DeleteTokenRequest struct {
	TokenID string `json:"-"`
}

type DisableManagedAlertsRequest

type DisableManagedAlertsRequest struct {
	ProjectID string `json:"project_id"`
}

type EnableManagedAlertsRequest

type EnableManagedAlertsRequest struct {
	ProjectID string `json:"project_id"`
}

type GetCockpitRequest

type GetCockpitRequest struct {
	ProjectID string `json:"-"`
}

type GetTokenRequest

type GetTokenRequest struct {
	TokenID string `json:"-"`
}

type GrafanaUser

type GrafanaUser struct {
	ID uint32 `json:"id"`

	Login string `json:"login"`
	// Role:
	// Default value: unknown_role
	Role GrafanaUserRole `json:"role"`

	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

type ListContactPointsRequest

type ListContactPointsRequest struct {
	// Page: page number.
	Page *int32 `json:"-"`
	// PageSize: page size.
	PageSize *uint32 `json:"-"`
	// ProjectID: project ID.
	ProjectID string `json:"-"`
}

type ListContactPointsResponse

type ListContactPointsResponse struct {
	// TotalCount: total count of contact points.
	TotalCount uint32 `json:"total_count"`
	// ContactPoints: contact points array.
	ContactPoints []*ContactPoint `json:"contact_points"`
	// HasAdditionalReceivers: has receivers other than default.
	HasAdditionalReceivers bool `json:"has_additional_receivers"`
	// HasAdditionalContactPoints: has unmanaged contact points.
	HasAdditionalContactPoints bool `json:"has_additional_contact_points"`
}

ListContactPointsResponse: list contact points response.

func (*ListContactPointsResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListContactPointsResponse) UnsafeGetTotalCount

func (r *ListContactPointsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListGrafanaUsersRequest

type ListGrafanaUsersRequest struct {
	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
	// OrderBy:
	// Default value: login_asc
	OrderBy ListGrafanaUsersRequestOrderBy `json:"-"`

	ProjectID string `json:"-"`
}

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

type ListGrafanaUsersResponse

type ListGrafanaUsersResponse struct {
	TotalCount uint32 `json:"total_count"`

	GrafanaUsers []*GrafanaUser `json:"grafana_users"`
}

ListGrafanaUsersResponse: list grafana users response.

func (*ListGrafanaUsersResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListGrafanaUsersResponse) UnsafeGetTotalCount

func (r *ListGrafanaUsersResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListTokensRequest

type ListTokensRequest struct {
	Page *int32 `json:"-"`

	PageSize *uint32 `json:"-"`
	// OrderBy:
	// Default value: created_at_asc
	OrderBy ListTokensRequestOrderBy `json:"-"`

	ProjectID string `json:"-"`
}

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

type ListTokensResponse

type ListTokensResponse struct {
	TotalCount uint32 `json:"total_count"`

	Tokens []*Token `json:"tokens"`
}

ListTokensResponse: list tokens response.

func (*ListTokensResponse) UnsafeAppend

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

UnsafeAppend should not be used Internal usage only

func (*ListTokensResponse) UnsafeGetTotalCount

func (r *ListTokensResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ResetCockpitGrafanaRequest

type ResetCockpitGrafanaRequest struct {
	ProjectID string `json:"project_id"`
}

type ResetGrafanaUserPasswordRequest

type ResetGrafanaUserPasswordRequest struct {
	GrafanaUserID uint32 `json:"-"`

	ProjectID string `json:"project_id"`
}

type Token

type Token struct {
	ID string `json:"id"`

	ProjectID string `json:"project_id"`

	Name string `json:"name"`

	CreatedAt *time.Time `json:"created_at"`

	UpdatedAt *time.Time `json:"updated_at"`

	Scopes *TokenScopes `json:"scopes"`

	SecretKey *string `json:"secret_key"`
}

Token: token.

type TokenScopes

type TokenScopes struct {
	QueryMetrics bool `json:"query_metrics"`

	WriteMetrics bool `json:"write_metrics"`

	SetupMetricsRules bool `json:"setup_metrics_rules"`

	QueryLogs bool `json:"query_logs"`

	WriteLogs bool `json:"write_logs"`

	SetupLogsRules bool `json:"setup_logs_rules"`

	SetupAlerts bool `json:"setup_alerts"`
}

TokenScopes: token scopes.

type TriggerTestAlertRequest

type TriggerTestAlertRequest struct {
	ProjectID string `json:"project_id"`
}

type WaitForCockpitRequest

type WaitForCockpitRequest struct {
	ProjectID     string
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForCockpitRequest is used by WaitForCockpit method.

Jump to

Keyboard shortcuts

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