Documentation
¶
Index ¶
- type CatalogChangesSearchRequest
- type CatalogChangesSearchResponse
- type ConfigChangeRow
- type MissionControl
- func (mc *MissionControl) GetScraper(id string) *Scraper
- func (mc *MissionControl) IsHealthy() (bool, error)
- func (mc *MissionControl) POST(path string, body any) (*http.Response, error)
- func (mc *MissionControl) QueryCatalog(selector ResourceSelector) ([]SelectedResource, error)
- func (mc *MissionControl) SearchCatalog(search string) ([]SelectedResource, error)
- func (mc *MissionControl) SearchCatalogChanges(req CatalogChangesSearchRequest) (*CatalogChangesSearchResponse, error)
- func (mc *MissionControl) WhoAmI() (map[string]any, bool, error)
- type ResourceSelector
- type ScrapeResult
- type ScrapeResults
- type Scraper
- type SearchResourcesRequest
- type SearchResourcesResponse
- type SelectedResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogChangesSearchRequest ¶ added in v0.1.8
type CatalogChangesSearchRequest struct {
CatalogID string `query:"id" json:"id"`
ConfigType string `query:"config_type" json:"config_type"`
ChangeType string `query:"type" json:"type"`
Severity string `query:"severity" json:"severity"`
IncludeDeletedConfigs bool `query:"include_deleted_configs" json:"include_deleted_configs"`
Depth int `query:"depth" json:"depth"`
CreatedByRaw string `query:"created_by" json:"created_by"`
Summary string `query:"summary" json:"summary"`
Source string `query:"source" json:"source"`
Tags string `query:"tags" json:"tags"`
// To Fetch from a particular agent, provide the agent id.
// Use `local` keyword to filter by the local agent.
AgentID string `query:"agent_id" json:"agent_id"`
// From date in datemath format
From string `query:"from" json:"from"`
// To date in datemath format
To string `query:"to" json:"to"`
PageSize int `query:"page_size" json:"page_size"`
Page int `query:"page" json:"page"`
SortBy string `query:"sort_by" json:"sort_by"`
// upstream | downstream | both
Recursive string `query:"recursive" json:"recursive"`
// FIXME: Soft toggle does not work with Recursive=both
// In that case, soft relations are always returned
// It also returns ALL soft relations throughout the tree
// not just soft related to the main config item
Soft bool `query:"soft" json:"soft"`
// contains filtered or unexported fields
}
type CatalogChangesSearchResponse ¶ added in v0.1.8
type CatalogChangesSearchResponse struct {
Summary map[string]int `json:"summary,omitempty"`
Total int64 `json:"total,omitempty"`
Changes []ConfigChangeRow `json:"changes,omitempty"`
}
type ConfigChangeRow ¶ added in v0.1.8
type ConfigChangeRow struct {
AgentID string `gorm:"column:agent_id" json:"agent_id"`
ExternalChangeId string `gorm:"column:external_change_id" json:"external_change_id"`
ID string `gorm:"primaryKey;unique_index;not null;column:id" json:"id"`
ConfigID string `gorm:"column:config_id;default:''" json:"config_id"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"deleted_at,omitempty"`
ChangeType string `gorm:"column:change_type" json:"change_type" faker:"oneof: RunInstances, diff"`
Severity string `gorm:"column:severity" json:"severity" faker:"oneof: critical, high, medium, low, info"`
Source string `gorm:"column:source" json:"source"`
Summary string `gorm:"column:summary;default:null" json:"summary,omitempty"`
CreatedAt *time.Time `gorm:"column:created_at" json:"created_at"`
Count int `gorm:"column:count" json:"count"`
FirstObserved *time.Time `gorm:"column:first_observed" json:"first_observed,omitempty"`
ConfigName string `gorm:"column:name" json:"name,omitempty"`
ConfigType string `gorm:"column:type" json:"type,omitempty"`
Tags map[string]string `gorm:"column:tags" json:"tags,omitempty"`
CreatedBy *uuid.UUID `gorm:"column:created_by" json:"created_by,omitempty"`
ExternalCreatedBy string `gorm:"column:external_created_by" json:"external_created_by,omitempty"`
}
type MissionControl ¶
type MissionControl struct {
HTTP *http.Client
ConfigDB *http.Client
URL string
Username string
Password string
Namespace string
DB *sql.DB
}
func (*MissionControl) GetScraper ¶
func (mc *MissionControl) GetScraper(id string) *Scraper
func (*MissionControl) IsHealthy ¶
func (mc *MissionControl) IsHealthy() (bool, error)
func (*MissionControl) QueryCatalog ¶
func (mc *MissionControl) QueryCatalog(selector ResourceSelector) ([]SelectedResource, error)
func (*MissionControl) SearchCatalog ¶
func (mc *MissionControl) SearchCatalog(search string) ([]SelectedResource, error)
func (*MissionControl) SearchCatalogChanges ¶ added in v0.1.8
func (mc *MissionControl) SearchCatalogChanges(req CatalogChangesSearchRequest) (*CatalogChangesSearchResponse, error)
type ResourceSelector ¶
type ResourceSelector struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Types []string `json:"types,omitempty"`
Statuses []string `json:"statuses,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
FieldSelector string `json:"field_selector,omitempty"`
Search string `json:"search,omitempty"`
}
type ScrapeResult ¶
type ScrapeResults ¶
type SearchResourcesRequest ¶
type SearchResourcesRequest struct {
Limit int `json:"limit,omitempty"`
Configs []ResourceSelector `json:"configs,omitempty"`
}
type SearchResourcesResponse ¶
type SearchResourcesResponse struct {
Configs []SelectedResource `json:"configs"`
}
type SelectedResource ¶
type SelectedResource struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Type string `json:"type,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Config string `json:"config,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Properties map[string]string `json:"properties,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.