Documentation
¶
Overview ¶
Package cockpit provides methods and message types of the cockpit v1beta1 API.
Index ¶
- Constants
- type API
- func (s *API) ActivateCockpit(req *ActivateCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)
- func (s *API) CreateContactPoint(req *CreateContactPointRequest, opts ...scw.RequestOption) (*ContactPoint, error)
- func (s *API) CreateGrafanaUser(req *CreateGrafanaUserRequest, opts ...scw.RequestOption) (*GrafanaUser, error)
- func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error)
- func (s *API) DeactivateCockpit(req *DeactivateCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)
- func (s *API) DeleteContactPoint(req *DeleteContactPointRequest, opts ...scw.RequestOption) error
- func (s *API) DeleteGrafanaUser(req *DeleteGrafanaUserRequest, opts ...scw.RequestOption) error
- func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) error
- func (s *API) DisableManagedAlerts(req *DisableManagedAlertsRequest, opts ...scw.RequestOption) error
- func (s *API) EnableManagedAlerts(req *EnableManagedAlertsRequest, opts ...scw.RequestOption) error
- func (s *API) GetCockpit(req *GetCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)
- func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error)
- func (s *API) ListContactPoints(req *ListContactPointsRequest, opts ...scw.RequestOption) (*ListContactPointsResponse, error)
- func (s *API) ListGrafanaUsers(req *ListGrafanaUsersRequest, opts ...scw.RequestOption) (*ListGrafanaUsersResponse, error)
- func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)
- func (s *API) ResetCockpitGrafana(req *ResetCockpitGrafanaRequest, opts ...scw.RequestOption) (*Cockpit, error)
- func (s *API) ResetGrafanaUserPassword(req *ResetGrafanaUserPasswordRequest, opts ...scw.RequestOption) (*GrafanaUser, error)
- func (s *API) TriggerTestAlert(req *TriggerTestAlertRequest, opts ...scw.RequestOption) error
- func (s *API) WaitForCockpit(req *WaitForCockpitRequest, opts ...scw.RequestOption) (*Cockpit, error)
- type ActivateCockpitRequest
- type Cockpit
- type CockpitEndpoints
- type CockpitStatus
- type ContactPoint
- type ContactPointEmail
- type CreateContactPointRequest
- type CreateGrafanaUserRequest
- type CreateTokenRequest
- type DeactivateCockpitRequest
- type DeleteContactPointRequest
- type DeleteGrafanaUserRequest
- type DeleteTokenRequest
- type DisableManagedAlertsRequest
- type EnableManagedAlertsRequest
- type GetCockpitRequest
- type GetTokenRequest
- type GrafanaUser
- type GrafanaUserRole
- type ListContactPointsRequest
- type ListContactPointsResponse
- type ListGrafanaUsersRequest
- type ListGrafanaUsersRequestOrderBy
- type ListGrafanaUsersResponse
- type ListTokensRequest
- type ListTokensRequestOrderBy
- type ListTokensResponse
- type ResetCockpitGrafanaRequest
- type ResetGrafanaUserPasswordRequest
- type Token
- type TokenScopes
- type TriggerTestAlertRequest
- type WaitForCockpitRequest
Constants ¶
const ( CockpitStatusUnknownStatus = CockpitStatus("unknown_status") CockpitStatusCreating = CockpitStatus("creating") CockpitStatusReady = CockpitStatus("ready") CockpitStatusDeleting = CockpitStatus("deleting") CockpitStatusUpdating = CockpitStatus("updating") CockpitStatusError = CockpitStatus("error") )
const ( GrafanaUserRoleUnknownRole = GrafanaUserRole("unknown_role") GrafanaUserRoleEditor = GrafanaUserRole("editor") GrafanaUserRoleViewer = GrafanaUserRole("viewer") )
const ( ListGrafanaUsersRequestOrderByLoginAsc = ListGrafanaUsersRequestOrderBy("login_asc") ListGrafanaUsersRequestOrderByLoginDesc = ListGrafanaUsersRequestOrderBy("login_desc") )
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 (*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 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 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 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"`
}