Documentation ¶
Index ¶
- Constants
- Variables
- func MapFetch(m map[string]interface{}, key string, defaultValue any) any
- func MapFetchToString(m map[string]interface{}, key string) string
- func Route(domain string, path string) string
- func WithContext(ctx context.Context) func(*HttpClient) error
- func WithToken(token string) func(*HttpClient) error
- func WithURL(baseUrl string) func(*HttpClient) error
- func WithVersion(version string) func(*HttpClient) error
- type ApiError
- type ArchiveTeamResponse
- type CatalogEntitiesClient
- func (c *CatalogEntitiesClient) Client() *sling.Sling
- func (c *CatalogEntitiesClient) Delete(ctx context.Context, tag string) error
- func (c *CatalogEntitiesClient) Get(ctx context.Context, tag string) (*CatalogEntity, error)
- func (c *CatalogEntitiesClient) GetFromDescriptor(ctx context.Context, tag string) (*CatalogEntityData, error)
- func (c *CatalogEntitiesClient) List(ctx context.Context, params *CatalogEntityListParams) (*CatalogEntitiesResponse, error)
- func (c *CatalogEntitiesClient) Upsert(ctx context.Context, req UpsertCatalogEntityRequest) (*CatalogEntityData, error)
- type CatalogEntitiesClientInterface
- type CatalogEntitiesResponse
- type CatalogEntity
- type CatalogEntityAlert
- type CatalogEntityApm
- type CatalogEntityApmDataDog
- type CatalogEntityApmDynatrace
- type CatalogEntityApmNewRelic
- type CatalogEntityBugSnag
- type CatalogEntityCheckmarx
- type CatalogEntityCheckmarxProject
- type CatalogEntityCustomData
- type CatalogEntityCustomDataClient
- func (c *CatalogEntityCustomDataClient) Client() *sling.Sling
- func (c *CatalogEntityCustomDataClient) Get(ctx context.Context, entityTag string, key string) (*CatalogEntityCustomData, error)
- func (c *CatalogEntityCustomDataClient) List(ctx context.Context, entityTag string, ...) ([]CatalogEntityCustomData, error)
- type CatalogEntityCustomDataClientInterface
- type CatalogEntityCustomDataListParams
- type CatalogEntityDashboards
- type CatalogEntityDashboardsEmbed
- type CatalogEntityData
- type CatalogEntityDependency
- type CatalogEntityEmail
- type CatalogEntityGetDescriptorParams
- type CatalogEntityGit
- type CatalogEntityGitAzureDevOps
- type CatalogEntityGitBitBucket
- type CatalogEntityGitGithub
- type CatalogEntityGitGitlab
- type CatalogEntityGroup
- type CatalogEntityIssues
- type CatalogEntityIssuesJira
- type CatalogEntityLink
- type CatalogEntityListParams
- type CatalogEntityOnCall
- type CatalogEntityOnCallOpsGenie
- type CatalogEntityOnCallPagerDuty
- type CatalogEntityOnCallVictorOps
- type CatalogEntityOwner
- type CatalogEntityOwnership
- type CatalogEntityParser
- type CatalogEntityRollbar
- type CatalogEntitySLODataDog
- type CatalogEntitySLODynatrace
- type CatalogEntitySLOLightstepStream
- type CatalogEntitySLOLightstepTargetLatency
- type CatalogEntitySLOLightstepTargets
- type CatalogEntitySLOPrometheusQuery
- type CatalogEntitySLOSignalFX
- type CatalogEntitySLOSumoLogic
- type CatalogEntitySLOs
- type CatalogEntitySentry
- type CatalogEntitySlackChannel
- type CatalogEntitySnyk
- type CatalogEntitySnykProject
- type CatalogEntityStaticAnalysis
- type CatalogEntityStaticAnalysisCodeCov
- type CatalogEntityStaticAnalysisMend
- type CatalogEntityStaticAnalysisSonarQube
- type CatalogEntityStaticAnalysisVeracode
- type CatalogEntityStaticAnalysisVeracodeSandbox
- type CatalogEntityViolation
- type CreateDepartmentRequest
- type CreateResourceDefinitionRequest
- type CreateResourceDefinitionResponse
- type CreateTeamRequest
- type DeleteCatalogEntityResponse
- type DeleteDepartmentRequest
- type DeleteDepartmentResponse
- type DeleteResourceDefinitionResponse
- type DeleteScorecardResponse
- type DeleteTeamRequest
- type DeleteTeamResponse
- type Department
- type DepartmentGetParams
- type DepartmentMember
- type DepartmentsClient
- func (c *DepartmentsClient) Client() *sling.Sling
- func (c *DepartmentsClient) Create(ctx context.Context, req CreateDepartmentRequest) (*Department, error)
- func (c *DepartmentsClient) Delete(ctx context.Context, tag string) error
- func (c *DepartmentsClient) Get(ctx context.Context, tag string) (*Department, error)
- func (c *DepartmentsClient) Update(ctx context.Context, tag string, req UpdateDepartmentRequest) (*Department, error)
- type DepartmentsClientInterface
- type DepartmentsResponse
- type GetScorecardResponse
- type HttpClient
- func (c *HttpClient) CatalogEntities() CatalogEntitiesClientInterface
- func (c *HttpClient) CatalogEntityCustomData() CatalogEntityCustomDataClientInterface
- func (c *HttpClient) Departments() DepartmentsClientInterface
- func (c *HttpClient) Ping(ctx context.Context) error
- func (c *HttpClient) ResourceDefinitions() ResourceDefinitionsClientInterface
- func (c *HttpClient) Scorecards() ScorecardsClientInterface
- func (c *HttpClient) Teams() TeamsClientInterface
- type OptionDelegator
- type ResourceDefinition
- type ResourceDefinitionListParams
- type ResourceDefinitionsClient
- func (c *ResourceDefinitionsClient) Client() *sling.Sling
- func (c *ResourceDefinitionsClient) Create(ctx context.Context, req CreateResourceDefinitionRequest) (*ResourceDefinition, error)
- func (c *ResourceDefinitionsClient) Delete(ctx context.Context, typeName string) error
- func (c *ResourceDefinitionsClient) Get(ctx context.Context, typeName string) (*ResourceDefinition, error)
- func (c *ResourceDefinitionsClient) List(ctx context.Context, params *ResourceDefinitionListParams) (*ResourceDefinitionsResponse, error)
- func (c *ResourceDefinitionsClient) Update(ctx context.Context, typeName string, req UpdateResourceDefinitionRequest) (*ResourceDefinition, error)
- type ResourceDefinitionsClientInterface
- type ResourceDefinitionsResponse
- type Scorecard
- type ScorecardEvaluation
- type ScorecardFilter
- type ScorecardLadder
- type ScorecardLevel
- type ScorecardLevelSummary
- type ScorecardListParams
- type ScorecardRule
- type ScorecardsClient
- func (c *ScorecardsClient) Client() *sling.Sling
- func (c *ScorecardsClient) Delete(ctx context.Context, tag string) error
- func (c *ScorecardsClient) Get(ctx context.Context, tag string) (*Scorecard, error)
- func (c *ScorecardsClient) GetFromDescriptor(ctx context.Context, tag string) (*Scorecard, error)
- func (c *ScorecardsClient) List(ctx context.Context, params *ScorecardListParams) (*ScorecardsResponse, error)
- func (c *ScorecardsClient) Upsert(ctx context.Context, req UpsertScorecardRequest) (*Scorecard, error)
- type ScorecardsClientInterface
- type ScorecardsResponse
- type Team
- type TeamCortexManaged
- type TeamIdpGroup
- type TeamIdpGroupMember
- type TeamLink
- type TeamListParams
- type TeamMember
- type TeamMetadata
- type TeamSlackChannel
- type TeamsClient
- func (c *TeamsClient) Archive(ctx context.Context, tag string) error
- func (c *TeamsClient) Client() *sling.Sling
- func (c *TeamsClient) Create(ctx context.Context, req CreateTeamRequest) (*Team, error)
- func (c *TeamsClient) Delete(ctx context.Context, tag string) error
- func (c *TeamsClient) Get(ctx context.Context, tag string) (*Team, error)
- func (c *TeamsClient) List(ctx context.Context, params *TeamListParams) (*TeamsResponse, error)
- func (c *TeamsClient) Unarchive(ctx context.Context, tag string) error
- func (c *TeamsClient) Update(ctx context.Context, tag string, req UpdateTeamRequest) (*Team, error)
- type TeamsClientInterface
- type TeamsResponse
- type UnarchiveTeamResponse
- type UpdateDepartmentRequest
- type UpdateResourceDefinitionRequest
- type UpdateTeamRequest
- type UpsertCatalogEntityRequest
- type UpsertCatalogEntityResponse
- type UpsertScorecardRequest
- type UpsertScorecardResponse
Constants ¶
const (
// UserAgentPrefix is the prefix of the User-Agent header that all terraform REST calls perform.
UserAgentPrefix = "cortex-terraform-provider"
)
Variables ¶
var ( ApiErrorNotFound = errors.New("not found") )
var BaseUris = map[string]string{
"teams": "/api/v1/teams/",
"departments": "/api/v1/teams/departments/",
"scorecards": "/api/v1/scorecards/",
"catalog_entities": "/api/v1/catalog/",
"open_api": "/api/v1/open-api",
"resource_definitions": "/api/v1/catalog/definitions/",
}
Functions ¶
func MapFetchToString ¶
func WithContext ¶
func WithContext(ctx context.Context) func(*HttpClient) error
WithContext Specify the context for the cortex client to use.
func WithToken ¶
func WithToken(token string) func(*HttpClient) error
WithToken Specify the API token for the cortex client to use.
func WithURL ¶
func WithURL(baseUrl string) func(*HttpClient) error
WithURL Specify the base URL for the cortex client to connect to.
func WithVersion ¶
func WithVersion(version string) func(*HttpClient) error
Types ¶
type ApiError ¶
type ArchiveTeamResponse ¶
type ArchiveTeamResponse struct{}
type CatalogEntitiesClient ¶
type CatalogEntitiesClient struct {
// contains filtered or unexported fields
}
func (*CatalogEntitiesClient) Client ¶
func (c *CatalogEntitiesClient) Client() *sling.Sling
func (*CatalogEntitiesClient) Delete ¶
func (c *CatalogEntitiesClient) Delete(ctx context.Context, tag string) error
func (*CatalogEntitiesClient) Get ¶
func (c *CatalogEntitiesClient) Get(ctx context.Context, tag string) (*CatalogEntity, error)
func (*CatalogEntitiesClient) GetFromDescriptor ¶
func (c *CatalogEntitiesClient) GetFromDescriptor(ctx context.Context, tag string) (*CatalogEntityData, error)
func (*CatalogEntitiesClient) List ¶
func (c *CatalogEntitiesClient) List(ctx context.Context, params *CatalogEntityListParams) (*CatalogEntitiesResponse, error)
List retrieves a list of scorecards based on a query.
func (*CatalogEntitiesClient) Upsert ¶
func (c *CatalogEntitiesClient) Upsert(ctx context.Context, req UpsertCatalogEntityRequest) (*CatalogEntityData, error)
type CatalogEntitiesClientInterface ¶
type CatalogEntitiesClientInterface interface { Get(ctx context.Context, tag string) (*CatalogEntity, error) GetFromDescriptor(ctx context.Context, tag string) (*CatalogEntityData, error) List(ctx context.Context, params *CatalogEntityListParams) (*CatalogEntitiesResponse, error) Upsert(ctx context.Context, req UpsertCatalogEntityRequest) (*CatalogEntityData, error) Delete(ctx context.Context, tag string) error }
type CatalogEntitiesResponse ¶
type CatalogEntitiesResponse struct {
Entities []CatalogEntity `json:"entities" yaml:"entities"`
}
CatalogEntitiesResponse is the response from the GET /v1/scorecards endpoint.
type CatalogEntity ¶
type CatalogEntity struct { Tag string `json:"tag" yaml:"x-cortex-tag"` Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Type string `json:"type" yaml:"x-cortex-type"` Groups []string `json:"groups" yaml:"x-cortex-groups"` Links []CatalogEntityLink `json:"links" yaml:"x-cortex-link"` Metadata map[string]interface{} `json:"metadata" yaml:"x-cortex-custom-metadata"` Dependencies []string `json:"dependencies" yaml:"x-cortex-dependency"` Ownership CatalogEntityOwnership `json:"ownership" yaml:"x-cortex-owners"` }
CatalogEntity is the nested response object that is typically returned from the catalog entities endpoints.
type CatalogEntityAlert ¶
type CatalogEntityAlert struct { Type string `json:"type" yaml:"type"` Tag string `json:"tag" yaml:"tag"` Value string `json:"value" yaml:"value"` }
func (*CatalogEntityAlert) Enabled ¶ added in v0.0.3
func (o *CatalogEntityAlert) Enabled() bool
type CatalogEntityApm ¶
type CatalogEntityApm struct { DataDog CatalogEntityApmDataDog `json:"datadog,omitempty" yaml:"datadog,omitempty"` Dynatrace CatalogEntityApmDynatrace `json:"dynatrace,omitempty" yaml:"dynatrace,omitempty"` NewRelic CatalogEntityApmNewRelic `json:"newrelic,omitempty" yaml:"newrelic,omitempty"` }
func (*CatalogEntityApm) Enabled ¶ added in v0.0.2
func (c *CatalogEntityApm) Enabled() bool
type CatalogEntityApmDataDog ¶
type CatalogEntityApmDataDog struct {
Monitors []int64 `json:"monitors" yaml:"monitors"`
}
func (*CatalogEntityApmDataDog) Enabled ¶ added in v0.0.2
func (o *CatalogEntityApmDataDog) Enabled() bool
type CatalogEntityApmDynatrace ¶
type CatalogEntityApmDynatrace struct { EntityIDs []string `json:"entityIds,omitempty" yaml:"entityIds,omitempty"` EntityNameMatchers []string `json:"entityNameMatchers,omitempty" yaml:"entityNameMatchers,omitempty"` }
func (*CatalogEntityApmDynatrace) Enabled ¶ added in v0.0.2
func (o *CatalogEntityApmDynatrace) Enabled() bool
type CatalogEntityApmNewRelic ¶
type CatalogEntityApmNewRelic struct { ApplicationID int64 `json:"applicationId" yaml:"applicationId"` Alias string `json:"alias,omitempty" yaml:"alias,omitempty"` }
func (*CatalogEntityApmNewRelic) Enabled ¶ added in v0.0.2
func (o *CatalogEntityApmNewRelic) Enabled() bool
type CatalogEntityBugSnag ¶
type CatalogEntityBugSnag struct {
Project string `json:"project" yaml:"project"`
}
func (*CatalogEntityBugSnag) Enabled ¶ added in v0.0.2
func (o *CatalogEntityBugSnag) Enabled() bool
type CatalogEntityCheckmarx ¶
type CatalogEntityCheckmarx struct {
Projects []CatalogEntityCheckmarxProject `json:"projects" yaml:"projects"`
}
func (*CatalogEntityCheckmarx) Enabled ¶ added in v0.0.2
func (o *CatalogEntityCheckmarx) Enabled() bool
type CatalogEntityCustomData ¶
type CatalogEntityCustomDataClient ¶
type CatalogEntityCustomDataClient struct {
// contains filtered or unexported fields
}
func (*CatalogEntityCustomDataClient) Client ¶
func (c *CatalogEntityCustomDataClient) Client() *sling.Sling
func (*CatalogEntityCustomDataClient) Get ¶
func (c *CatalogEntityCustomDataClient) Get(ctx context.Context, entityTag string, key string) (*CatalogEntityCustomData, error)
func (*CatalogEntityCustomDataClient) List ¶
func (c *CatalogEntityCustomDataClient) List(ctx context.Context, entityTag string, params *CatalogEntityCustomDataListParams) ([]CatalogEntityCustomData, error)
List retrieves a list of scorecards based on a query.
type CatalogEntityCustomDataClientInterface ¶
type CatalogEntityCustomDataClientInterface interface { Get(ctx context.Context, entityTag string, key string) (*CatalogEntityCustomData, error) List(ctx context.Context, entityTag string, params *CatalogEntityCustomDataListParams) ([]CatalogEntityCustomData, error) }
type CatalogEntityCustomDataListParams ¶
type CatalogEntityCustomDataListParams struct{}
CatalogEntityCustomDataListParams are the query parameters for the GET /v1/catalog/:tag/custom-data endpoint.
type CatalogEntityDashboards ¶
type CatalogEntityDashboards struct {
Embeds []CatalogEntityDashboardsEmbed `json:"embeds,omitempty" yaml:"embeds,omitempty"`
}
func (*CatalogEntityDashboards) Enabled ¶ added in v0.0.2
func (c *CatalogEntityDashboards) Enabled() bool
type CatalogEntityData ¶
type CatalogEntityData struct { Title string `json:"title" yaml:"title"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Tag string `json:"x-cortex-tag" yaml:"x-cortex-tag"` Type string `json:"x-cortex-type,omitempty" yaml:"x-cortex-type,omitempty"` Definition map[string]interface{} `json:"x-cortex-definition,omitempty" yaml:"x-cortex-definition,omitempty"` Owners []CatalogEntityOwner `json:"x-cortex-owners,omitempty" yaml:"x-cortex-owners,omitempty"` Groups []string `json:"x-cortex-groups,omitempty" yaml:"x-cortex-groups"` // TODO: is this -groups or -service-groups? docs unclear Links []CatalogEntityLink `json:"x-cortex-link,omitempty" yaml:"x-cortex-link,omitempty"` Metadata map[string]interface{} `json:"x-cortex-custom-metadata,omitempty" yaml:"x-cortex-custom-metadata,omitempty"` Dependencies []CatalogEntityDependency `json:"x-cortex-dependency,omitempty" yaml:"x-cortex-dependency,omitempty"` // Various generic integration attributes Alerts []CatalogEntityAlert `json:"x-cortex-alerts,omitempty" yaml:"x-cortex-alerts,omitempty"` Apm CatalogEntityApm `json:"x-cortex-apm,omitempty" yaml:"x-cortex-apm,omitempty"` Dashboards CatalogEntityDashboards `json:"x-cortex-dashboards,omitempty" yaml:"x-cortex-dashboards,omitempty"` Git CatalogEntityGit `json:"x-cortex-git,omitempty" yaml:"x-cortex-git,omitempty"` Issues CatalogEntityIssues `json:"x-cortex-issues,omitempty" yaml:"x-cortex-issues,omitempty"` OnCall CatalogEntityOnCall `json:"x-cortex-oncall,omitempty" yaml:"x-cortex-oncall,omitempty"` SLOs CatalogEntitySLOs `json:"x-cortex-slos,omitempty" yaml:"x-cortex-slos,omitempty"` StaticAnalysis CatalogEntityStaticAnalysis `json:"x-cortex-static-analysis,omitempty" yaml:"x-cortex-static-analysis,omitempty"` // Integration-specific things BugSnag CatalogEntityBugSnag `json:"x-cortex-bugsnag,omitempty" yaml:"x-cortex-bugsnag,omitempty"` Checkmarx CatalogEntityCheckmarx `json:"x-cortex-checkmarx,omitempty" yaml:"x-cortex-checkmarx,omitempty"` Rollbar CatalogEntityRollbar `json:"x-cortex-rollbar,omitempty" yaml:"x-cortex-rollbar,omitempty"` Sentry CatalogEntitySentry `json:"x-cortex-sentry,omitempty" yaml:"x-cortex-sentry,omitempty"` Snyk CatalogEntitySnyk `json:"x-cortex-snyk,omitempty" yaml:"x-cortex-snyk,omitempty"` }
CatalogEntityData is a struct used from YAML-based data, since its structure does not match the structure of the CatalogEntity struct in other responses. See: https://github.com/cortexapps/solutions/blob/master/examples/yaml/catalog/resource.yaml
type CatalogEntityDependency ¶
type CatalogEntityDependency struct { Tag string `json:"tag" yaml:"tag"` Method string `json:"method,omitempty" yaml:"method,omitempty"` Path string `json:"path,omitempty" yaml:"path,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"` }
type CatalogEntityEmail ¶
type CatalogEntityGetDescriptorParams ¶
type CatalogEntityGetDescriptorParams struct {
Yaml bool `url:"yaml"`
}
type CatalogEntityGit ¶
type CatalogEntityGit struct { Github CatalogEntityGitGithub `json:"github,omitempty" yaml:"github,omitempty"` Gitlab CatalogEntityGitGitlab `json:"gitlab,omitempty" yaml:"gitlab,omitempty"` Azure CatalogEntityGitAzureDevOps `json:"azure,omitempty" yaml:"azure,omitempty"` BitBucket CatalogEntityGitBitBucket `json:"bitbucket,omitempty" yaml:"bitbucket,omitempty"` }
CatalogEntityGit represents the Git metadata around a catalog entity @see https://docs.cortex.io/docs/reference/basics/entities#example-cortexyaml-for-service-entity
func (*CatalogEntityGit) Enabled ¶ added in v0.0.2
func (o *CatalogEntityGit) Enabled() bool
type CatalogEntityGitAzureDevOps ¶
type CatalogEntityGitAzureDevOps struct { Project string `json:"project" yaml:"project"` Repository string `json:"repository" yaml:"repository"` BasePath string `json:"basepath,omitempty" yaml:"basepath,omitempty"` }
func (*CatalogEntityGitAzureDevOps) Enabled ¶ added in v0.0.2
func (o *CatalogEntityGitAzureDevOps) Enabled() bool
type CatalogEntityGitBitBucket ¶
type CatalogEntityGitBitBucket struct {
Repository string `json:"repository" yaml:"repository"`
}
func (*CatalogEntityGitBitBucket) Enabled ¶ added in v0.0.2
func (o *CatalogEntityGitBitBucket) Enabled() bool
type CatalogEntityGitGithub ¶
type CatalogEntityGitGithub struct { Repository string `json:"repository" yaml:"repository"` BasePath string `json:"basepath,omitempty" yaml:"basepath,omitempty"` }
func (*CatalogEntityGitGithub) Enabled ¶ added in v0.0.2
func (o *CatalogEntityGitGithub) Enabled() bool
type CatalogEntityGitGitlab ¶
type CatalogEntityGitGitlab struct { Repository string `json:"repository" yaml:"repository"` BasePath string `json:"basepath,omitempty" yaml:"basepath,omitempty"` }
func (*CatalogEntityGitGitlab) Enabled ¶ added in v0.0.2
func (o *CatalogEntityGitGitlab) Enabled() bool
type CatalogEntityGroup ¶
type CatalogEntityIssues ¶
type CatalogEntityIssues struct {
Jira CatalogEntityIssuesJira `json:"jira,omitempty" yaml:"jira,omitempty"`
}
func (*CatalogEntityIssues) Enabled ¶ added in v0.0.2
func (c *CatalogEntityIssues) Enabled() bool
type CatalogEntityIssuesJira ¶
type CatalogEntityIssuesJira struct { DefaultJQL string `json:"defaultJql" yaml:"defaultJql"` Projects []string `json:"projects,omitempty" yaml:"projects,omitempty"` Labels []string `json:"labels,omitempty" yaml:"labels,omitempty"` Components []string `json:"components,omitempty" yaml:"components,omitempty"` }
func (*CatalogEntityIssuesJira) Enabled ¶ added in v0.0.2
func (o *CatalogEntityIssuesJira) Enabled() bool
type CatalogEntityLink ¶
type CatalogEntityListParams ¶
type CatalogEntityListParams struct { Groups []string `url:"groups,omitempty"` Types []string `url:"types,omitempty"` GitRepositories []string `url:"gitRepositories,omitempty"` }
CatalogEntityListParams are the query parameters for the GET /v1/catalog endpoint.
type CatalogEntityOnCall ¶
type CatalogEntityOnCall struct { PagerDuty CatalogEntityOnCallPagerDuty `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"` OpsGenie CatalogEntityOnCallOpsGenie `json:"opsgenie,omitempty" yaml:"opsgenie,omitempty"` VictorOps CatalogEntityOnCallVictorOps `json:"victorops,omitempty" yaml:"victorops,omitempty"` }
func (*CatalogEntityOnCall) Enabled ¶ added in v0.0.2
func (c *CatalogEntityOnCall) Enabled() bool
type CatalogEntityOnCallOpsGenie ¶
type CatalogEntityOnCallOpsGenie struct { ID string `json:"id" yaml:"id"` Type string `json:"type" yaml:"type"` }
func (*CatalogEntityOnCallOpsGenie) Enabled ¶ added in v0.0.2
func (o *CatalogEntityOnCallOpsGenie) Enabled() bool
type CatalogEntityOnCallPagerDuty ¶
type CatalogEntityOnCallPagerDuty struct { ID string `json:"id" yaml:"id"` Type string `json:"type" yaml:"type"` }
func (*CatalogEntityOnCallPagerDuty) Enabled ¶ added in v0.0.2
func (o *CatalogEntityOnCallPagerDuty) Enabled() bool
type CatalogEntityOnCallVictorOps ¶
type CatalogEntityOnCallVictorOps struct { ID string `json:"id" yaml:"id"` Type string `json:"type" yaml:"type"` }
func (*CatalogEntityOnCallVictorOps) Enabled ¶ added in v0.0.2
func (o *CatalogEntityOnCallVictorOps) Enabled() bool
type CatalogEntityOwner ¶
type CatalogEntityOwner struct { Type string `json:"type" yaml:"type"` // group, user, slack Name string `json:"name,omitempty" yaml:"name,omitempty"` // Must be of form <org>/<team> Email string `json:"email,omitempty" yaml:"email,omitempty"` // user only Description string `json:"description,omitempty" yaml:"description,omitempty"` Provider string `json:"provider,omitempty" yaml:"provider,omitempty"` Channel string `json:"channel,omitempty" yaml:"channel,omitempty"` // for slack, do not add # to beginning NotificationsEnabled bool `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"` }
type CatalogEntityOwnership ¶
type CatalogEntityOwnership struct { Emails []CatalogEntityEmail `json:"emails"` Groups []CatalogEntityGroup `json:"groups"` SlackChannels []CatalogEntitySlackChannel `json:"slackChannels"` }
type CatalogEntityParser ¶
type CatalogEntityParser struct{}
func (*CatalogEntityParser) YamlToEntity ¶
func (c *CatalogEntityParser) YamlToEntity(entity *CatalogEntityData, yamlEntity map[string]interface{}) (*CatalogEntityData, error)
YamlToEntity converts YAML into a CatalogEntity, from the specification.
type CatalogEntityRollbar ¶
type CatalogEntityRollbar struct {
Project string `json:"project" yaml:"project"`
}
func (*CatalogEntityRollbar) Enabled ¶ added in v0.0.2
func (o *CatalogEntityRollbar) Enabled() bool
type CatalogEntitySLODataDog ¶
type CatalogEntitySLODataDog struct {
ID string `json:"id" yaml:"id"`
}
func (*CatalogEntitySLODataDog) Enabled ¶ added in v0.0.2
func (o *CatalogEntitySLODataDog) Enabled() bool
type CatalogEntitySLODynatrace ¶
type CatalogEntitySLODynatrace struct {
ID string `json:"id" yaml:"id"`
}
func (*CatalogEntitySLODynatrace) Enabled ¶ added in v0.0.2
func (o *CatalogEntitySLODynatrace) Enabled() bool
type CatalogEntitySLOLightstepStream ¶
type CatalogEntitySLOLightstepStream struct { StreamID string `json:"streamId" yaml:"streamId"` Targets CatalogEntitySLOLightstepTargets `json:"targets" yaml:"targets"` }
type CatalogEntitySLOLightstepTargets ¶
type CatalogEntitySLOLightstepTargets struct {
Latencies []CatalogEntitySLOLightstepTargetLatency `json:"latency" yaml:"latency"`
}
type CatalogEntitySLOPrometheusQuery ¶
type CatalogEntitySLOPrometheusQuery struct { ErrorQuery string `json:"errorQuery" yaml:"errorQuery"` TotalQuery string `json:"totalQuery" yaml:"totalQuery"` SLO float64 `json:"slo" yaml:"slo"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Alias string `json:"alias,omitempty" yaml:"alias,omitempty"` }
type CatalogEntitySLOSumoLogic ¶
type CatalogEntitySLOSumoLogic struct {
ID string `json:"id" yaml:"id"`
}
func (*CatalogEntitySLOSumoLogic) Enabled ¶ added in v0.0.2
func (o *CatalogEntitySLOSumoLogic) Enabled() bool
type CatalogEntitySLOs ¶
type CatalogEntitySLOs struct { DataDog []CatalogEntitySLODataDog `json:"datadog,omitempty" yaml:"datadog,omitempty"` Dynatrace []CatalogEntitySLODynatrace `json:"dynatrace,omitempty" yaml:"dynatrace,omitempty"` Lightstep []CatalogEntitySLOLightstepStream `json:"lightstep,omitempty" yaml:"lightstep,omitempty"` Prometheus []CatalogEntitySLOPrometheusQuery `json:"prometheus,omitempty" yaml:"prometheus,omitempty"` SignalFX []CatalogEntitySLOSignalFX `json:"signalfx,omitempty" yaml:"signalfx,omitempty"` SumoLogic []CatalogEntitySLOSumoLogic `json:"sumologic,omitempty" yaml:"sumologic,omitempty"` }
func (*CatalogEntitySLOs) Enabled ¶ added in v0.0.2
func (c *CatalogEntitySLOs) Enabled() bool
type CatalogEntitySentry ¶
type CatalogEntitySentry struct {
Project string `json:"project" yaml:"project"`
}
func (*CatalogEntitySentry) Enabled ¶ added in v0.0.2
func (o *CatalogEntitySentry) Enabled() bool
type CatalogEntitySnyk ¶
type CatalogEntitySnyk struct {
Projects []CatalogEntitySnykProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}
func (*CatalogEntitySnyk) Enabled ¶ added in v0.0.2
func (o *CatalogEntitySnyk) Enabled() bool
type CatalogEntityStaticAnalysis ¶
type CatalogEntityStaticAnalysis struct { CodeCov CatalogEntityStaticAnalysisCodeCov `json:"codecov,omitempty" yaml:"codecov,omitempty"` Mend CatalogEntityStaticAnalysisMend `json:"mend,omitempty" yaml:"mend,omitempty"` SonarQube CatalogEntityStaticAnalysisSonarQube `json:"sonarqube,omitempty" yaml:"sonarqube,omitempty"` Veracode CatalogEntityStaticAnalysisVeracode `json:"veracode,omitempty" yaml:"veracode,omitempty"` }
func (*CatalogEntityStaticAnalysis) Enabled ¶ added in v0.0.2
func (c *CatalogEntityStaticAnalysis) Enabled() bool
type CatalogEntityStaticAnalysisCodeCov ¶
type CatalogEntityStaticAnalysisCodeCov struct { Repository string `json:"repo" yaml:"repo"` Provider string `json:"provider" yaml:"provider"` }
func (*CatalogEntityStaticAnalysisCodeCov) Enabled ¶ added in v0.0.2
func (o *CatalogEntityStaticAnalysisCodeCov) Enabled() bool
type CatalogEntityStaticAnalysisMend ¶
type CatalogEntityStaticAnalysisMend struct { ApplicationIDs []string `json:"applicationIds,omitempty" yaml:"applicationIds,omitempty"` ProjectIDs []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"` }
func (*CatalogEntityStaticAnalysisMend) Enabled ¶ added in v0.0.2
func (o *CatalogEntityStaticAnalysisMend) Enabled() bool
type CatalogEntityStaticAnalysisSonarQube ¶
type CatalogEntityStaticAnalysisSonarQube struct { Project string `json:"project" yaml:"project"` Alias string `json:"alias,omitempty" yaml:"alias,omitempty"` }
func (*CatalogEntityStaticAnalysisSonarQube) Enabled ¶ added in v0.0.2
func (o *CatalogEntityStaticAnalysisSonarQube) Enabled() bool
type CatalogEntityStaticAnalysisVeracode ¶
type CatalogEntityStaticAnalysisVeracode struct { ApplicationNames []string `json:"applicationNames,omitempty" yaml:"applicationNames,omitempty"` Sandboxes []CatalogEntityStaticAnalysisVeracodeSandbox `json:"sandboxes,omitempty" yaml:"sandboxes,omitempty"` }
func (*CatalogEntityStaticAnalysisVeracode) Enabled ¶ added in v0.0.2
func (o *CatalogEntityStaticAnalysisVeracode) Enabled() bool
type CatalogEntityViolation ¶
type CatalogEntityViolation struct { Description string `json:"description"` ViolationType string `json:"violationType"` StartLine int `json:"startLine"` EndLine int `json:"endLine"` Paths []string `json:"paths"` Pointer string `json:"pointer"` RuleLink string `json:"ruleLink"` Title string `json:"title"` }
func (*CatalogEntityViolation) String ¶
func (v *CatalogEntityViolation) String() string
type CreateDepartmentRequest ¶
type CreateDepartmentRequest struct { Tag string `json:"departmentTag" url:"departmentTag"` Name string `json:"name"` Description string `json:"description,omitempty"` Members []DepartmentMember `json:"members"` }
type CreateResourceDefinitionResponse ¶
type CreateResourceDefinitionResponse struct {
ResourceDefinition *ResourceDefinition `json:"scorecard"`
}
type CreateTeamRequest ¶
type CreateTeamRequest struct { TeamTag string `json:"teamTag"` Type string `json:"type"` Metadata TeamMetadata `json:"metadata"` IsArchived bool `json:"isArchived,omitempty"` AdditionalMembers []TeamMember `json:"additionalMembers"` SlackChannels []TeamSlackChannel `json:"slackChannels"` Links []TeamLink `json:"links"` CortexTeam TeamCortexManaged `json:"cortexTeam,omitempty"` IdpGroup TeamIdpGroup `json:"idpGroup,omitempty"` }
type DeleteCatalogEntityResponse ¶
type DeleteCatalogEntityResponse struct{}
type DeleteDepartmentRequest ¶
type DeleteDepartmentRequest struct {
DepartmentTag string `json:"departmentTag" url:"departmentTag"`
}
type DeleteDepartmentResponse ¶
type DeleteDepartmentResponse struct{}
type DeleteResourceDefinitionResponse ¶
type DeleteResourceDefinitionResponse struct{}
type DeleteScorecardResponse ¶
type DeleteScorecardResponse struct{}
type DeleteTeamRequest ¶
type DeleteTeamRequest struct {
Tag string `json:"teamTag" url:"teamTag"`
}
type DeleteTeamResponse ¶
type DeleteTeamResponse struct{}
type Department ¶
type Department struct { Tag string `json:"departmentTag" url:"departmentTag"` Name string `json:"name"` Description string `json:"description,omitempty"` Members []DepartmentMember `json:"members"` }
Department is the response from the GET /v1/teams/departments/ endpoint.
type DepartmentGetParams ¶
type DepartmentGetParams struct {
DepartmentTag string `json:"departmentTag" url:"departmentTag"`
}
type DepartmentMember ¶
type DepartmentsClient ¶
type DepartmentsClient struct {
// contains filtered or unexported fields
}
func (*DepartmentsClient) Client ¶
func (c *DepartmentsClient) Client() *sling.Sling
func (*DepartmentsClient) Create ¶
func (c *DepartmentsClient) Create(ctx context.Context, req CreateDepartmentRequest) (*Department, error)
func (*DepartmentsClient) Delete ¶
func (c *DepartmentsClient) Delete(ctx context.Context, tag string) error
func (*DepartmentsClient) Get ¶
func (c *DepartmentsClient) Get(ctx context.Context, tag string) (*Department, error)
func (*DepartmentsClient) Update ¶
func (c *DepartmentsClient) Update(ctx context.Context, tag string, req UpdateDepartmentRequest) (*Department, error)
type DepartmentsClientInterface ¶
type DepartmentsClientInterface interface { Get(ctx context.Context, tag string) (*Department, error) Create(ctx context.Context, req CreateDepartmentRequest) (*Department, error) Update(ctx context.Context, tag string, req UpdateDepartmentRequest) (*Department, error) Delete(ctx context.Context, tag string) error }
type DepartmentsResponse ¶
type DepartmentsResponse struct {
Departments []Department `json:"department"`
}
type GetScorecardResponse ¶
type GetScorecardResponse struct {
Scorecard *Scorecard `json:"scorecard"`
}
GetScorecardResponse is the generic root response object for scorecards.
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...OptionDelegator) (*HttpClient, error)
NewClient initializes a new API client for Cortex.
func (*HttpClient) CatalogEntities ¶
func (c *HttpClient) CatalogEntities() CatalogEntitiesClientInterface
func (*HttpClient) CatalogEntityCustomData ¶
func (c *HttpClient) CatalogEntityCustomData() CatalogEntityCustomDataClientInterface
func (*HttpClient) Departments ¶
func (c *HttpClient) Departments() DepartmentsClientInterface
func (*HttpClient) ResourceDefinitions ¶
func (c *HttpClient) ResourceDefinitions() ResourceDefinitionsClientInterface
func (*HttpClient) Scorecards ¶
func (c *HttpClient) Scorecards() ScorecardsClientInterface
func (*HttpClient) Teams ¶
func (c *HttpClient) Teams() TeamsClientInterface
type OptionDelegator ¶
type OptionDelegator func(c *HttpClient) error
type ResourceDefinition ¶
type ResourceDefinition struct { Type string `json:"type" yaml:"type"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Schema map[string]interface{} `json:"schema,omitempty" yaml:"schema,omitempty"` Source string `json:"source,omitempty" yaml:"source,omitempty"` }
ResourceDefinition is the response object that is typically returned from the resource definitions endpoints.
type ResourceDefinitionListParams ¶
type ResourceDefinitionListParams struct {
IncludeBuiltIn bool `url:"includeBuiltIn,omitempty"`
}
ResourceDefinitionListParams are the query parameters for the GET /v1/catalog/definitions endpoint.
type ResourceDefinitionsClient ¶
type ResourceDefinitionsClient struct {
// contains filtered or unexported fields
}
func (*ResourceDefinitionsClient) Client ¶
func (c *ResourceDefinitionsClient) Client() *sling.Sling
func (*ResourceDefinitionsClient) Create ¶
func (c *ResourceDefinitionsClient) Create(ctx context.Context, req CreateResourceDefinitionRequest) (*ResourceDefinition, error)
func (*ResourceDefinitionsClient) Delete ¶
func (c *ResourceDefinitionsClient) Delete(ctx context.Context, typeName string) error
func (*ResourceDefinitionsClient) Get ¶
func (c *ResourceDefinitionsClient) Get(ctx context.Context, typeName string) (*ResourceDefinition, error)
func (*ResourceDefinitionsClient) List ¶
func (c *ResourceDefinitionsClient) List(ctx context.Context, params *ResourceDefinitionListParams) (*ResourceDefinitionsResponse, error)
List retrieves a list of resource definitions based on a query.
func (*ResourceDefinitionsClient) Update ¶
func (c *ResourceDefinitionsClient) Update(ctx context.Context, typeName string, req UpdateResourceDefinitionRequest) (*ResourceDefinition, error)
type ResourceDefinitionsClientInterface ¶
type ResourceDefinitionsClientInterface interface { Get(ctx context.Context, typeName string) (*ResourceDefinition, error) List(ctx context.Context, params *ResourceDefinitionListParams) (*ResourceDefinitionsResponse, error) Create(ctx context.Context, req CreateResourceDefinitionRequest) (*ResourceDefinition, error) Update(ctx context.Context, typeName string, req UpdateResourceDefinitionRequest) (*ResourceDefinition, error) Delete(ctx context.Context, typeName string) error }
type ResourceDefinitionsResponse ¶
type ResourceDefinitionsResponse struct {
ResourceDefinitions []ResourceDefinition `json:"definitions"`
}
ResourceDefinitionsResponse is the response from the GET /v1/catalog/definitions endpoint.
type Scorecard ¶
type Scorecard struct { Tag string `json:"tag" yaml:"tag"` Name string `json:"name,omitempty" yaml:"name,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` IsDraft bool `json:"is_draft" yaml:"is_draft"` Rules []ScorecardRule `json:"rules" yaml:"rules"` Levels []ScorecardLevelSummary `json:"levels" yaml:"levels"` Filter ScorecardFilter `json:"filter" yaml:"filter"` Evaluation ScorecardEvaluation `json:"evaluation" yaml:"evaluation"` }
Scorecard is the nested response object that is typically returned from the scorecards endpoints.
type ScorecardEvaluation ¶
type ScorecardEvaluation struct {
Window int `json:"window" yaml:"window"`
}
type ScorecardFilter ¶
type ScorecardLadder ¶
type ScorecardLadder struct {
Levels []ScorecardLevel `json:"levels" yaml:"levels"`
}
type ScorecardLevel ¶
type ScorecardLevelSummary ¶
type ScorecardListParams ¶
type ScorecardListParams struct { }
ScorecardListParams are the query parameters for the GET /v1/scorecards endpoint.
type ScorecardRule ¶
type ScorecardRule struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Expression string `json:"expression" yaml:"expression"` FailureMessage string `json:"failure_message" yaml:"failureMessage"` LevelName string `json:"level_name" yaml:"levelName"` Weight int `json:"weight" yaml:"weight"` }
type ScorecardsClient ¶
type ScorecardsClient struct {
// contains filtered or unexported fields
}
func (*ScorecardsClient) Client ¶
func (c *ScorecardsClient) Client() *sling.Sling
func (*ScorecardsClient) Delete ¶
func (c *ScorecardsClient) Delete(ctx context.Context, tag string) error
func (*ScorecardsClient) GetFromDescriptor ¶
func (*ScorecardsClient) List ¶
func (c *ScorecardsClient) List(ctx context.Context, params *ScorecardListParams) (*ScorecardsResponse, error)
List retrieves a list of scorecards based on a query.
func (*ScorecardsClient) Upsert ¶
func (c *ScorecardsClient) Upsert(ctx context.Context, req UpsertScorecardRequest) (*Scorecard, error)
type ScorecardsClientInterface ¶
type ScorecardsClientInterface interface { Get(ctx context.Context, tag string) (*Scorecard, error) List(ctx context.Context, params *ScorecardListParams) (*ScorecardsResponse, error) Upsert(ctx context.Context, req UpsertScorecardRequest) (*Scorecard, error) Delete(ctx context.Context, tag string) error }
type ScorecardsResponse ¶
type ScorecardsResponse struct {
Scorecards []Scorecard `json:"scorecards"`
}
ScorecardsResponse is the response from the GET /v1/scorecards endpoint.
type Team ¶
type Team struct { AdditionalMembers []TeamMember `json:"additionalMembers,omitempty"` IsArchived bool `json:"isArchived,omitempty"` Metadata TeamMetadata `json:"metadata"` SlackChannels []TeamSlackChannel `json:"slackChannels,omitempty"` Links []TeamLink `json:"links,omitempty"` TeamTag string `json:"teamTag"` }
Team is the response from the GET /v1/teams/{team_tag} endpoint.
type TeamCortexManaged ¶
type TeamCortexManaged struct {
Members []TeamMember `json:"members"`
}
type TeamIdpGroup ¶
type TeamIdpGroup struct { Group string `json:"group"` Members []TeamIdpGroupMember `json:"members"` Provider string `json:"provider"` }
type TeamIdpGroupMember ¶
type TeamListParams ¶
type TeamListParams struct { }
TeamListParams are the query parameters for the GET /v1/teams endpoint.
type TeamMember ¶
type TeamMetadata ¶
type TeamSlackChannel ¶
type TeamsClient ¶
type TeamsClient struct {
// contains filtered or unexported fields
}
func (*TeamsClient) Client ¶
func (c *TeamsClient) Client() *sling.Sling
func (*TeamsClient) Create ¶
func (c *TeamsClient) Create(ctx context.Context, req CreateTeamRequest) (*Team, error)
func (*TeamsClient) List ¶
func (c *TeamsClient) List(ctx context.Context, params *TeamListParams) (*TeamsResponse, error)
List retrieves a list of teams based on a team query.
func (*TeamsClient) Unarchive ¶
func (c *TeamsClient) Unarchive(ctx context.Context, tag string) error
func (*TeamsClient) Update ¶
func (c *TeamsClient) Update(ctx context.Context, tag string, req UpdateTeamRequest) (*Team, error)
type TeamsClientInterface ¶
type TeamsClientInterface interface { Get(ctx context.Context, tag string) (*Team, error) List(ctx context.Context, params *TeamListParams) (*TeamsResponse, error) Create(ctx context.Context, createReq CreateTeamRequest) (*Team, error) Update(ctx context.Context, tag string, updateReq UpdateTeamRequest) (*Team, error) Delete(ctx context.Context, tag string) error Archive(ctx context.Context, tag string) error Unarchive(ctx context.Context, tag string) error }
type TeamsResponse ¶
type TeamsResponse struct {
Teams []Team `json:"teams"`
}
TeamsResponse is the response from the GET /v1/teams endpoint.
type UnarchiveTeamResponse ¶
type UnarchiveTeamResponse struct{}
type UpdateDepartmentRequest ¶
type UpdateDepartmentRequest struct { Name string `json:"name"` Description string `json:"description,omitempty"` Members []DepartmentMember `json:"members"` }
type UpdateTeamRequest ¶
type UpdateTeamRequest struct { Metadata TeamMetadata `json:"metadata"` Links []TeamLink `json:"links"` SlackChannels []TeamSlackChannel `json:"slackChannels"` AdditionalMembers []TeamMember `json:"additionalMembers"` }
type UpsertCatalogEntityRequest ¶
type UpsertCatalogEntityRequest struct { Info CatalogEntityData `json:"info"` OpenApi string `json:"openapi"` }
type UpsertCatalogEntityResponse ¶
type UpsertCatalogEntityResponse struct { Ok bool `json:"ok"` Violations []CatalogEntityViolation `json:"violations"` }
type UpsertScorecardRequest ¶
type UpsertScorecardRequest struct { Tag string `yaml:"tag"` Name string `yaml:"name"` Description string `yaml:"description"` IsDraft bool `yaml:"is_draft"` Rules []ScorecardRule `yaml:"rules"` Ladder ScorecardLadder `yaml:"ladder"` }
UpsertScorecardRequest is the request object that is a struct representation of the Scorecard descriptor YAML file. We do this to allow for easier creation of scorecards in Go or Terraform, rather than having to pass through a YAML file or string, and figure out how to tell Terraform to "compare" that data.
type UpsertScorecardResponse ¶
type UpsertScorecardResponse struct {
Scorecard *Scorecard `json:"scorecard"`
}