Help us shape the future of Go! Take the 2026 Go Developer Survey

cortex

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgentPrefix is the prefix of the User-Agent header that all terraform REST calls perform.
	UserAgentPrefix = "cortex-terraform-provider"
)

Variables

View Source
var (
	ApiErrorNotFound     = errors.New("not found")
	ApiErrorUnauthorized = errors.New("unauthorized")
)
View Source
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 AnyToFloat64

func AnyToFloat64(unk any) (float64, error)

func InterfaceToString

func InterfaceToString(v interface{}) (string, error)

func MapFetch

func MapFetch(m map[string]interface{}, key string, defaultValue any) any

func MapFetchToString

func MapFetchToString(m map[string]interface{}, key string) string

func Route

func Route(domain string, path string) string

func StringToInterface

func StringToInterface(v string) (interface{}, error)

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 ApiError struct {
	Details           string `json:"details"`
	GatewayHttpStatus int    `json:"gatewayHttpStatus"`
	HttpStatus        int    `json:"httpStatus"`
	Message           string `json:"message"`
	RequestId         string `json:"requestId"`
	Type              string `json:"type"`
}

func (ApiError) String

func (err ApiError) String() string

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 (*CatalogEntitiesClient) GetFromDescriptor

func (c *CatalogEntitiesClient) GetFromDescriptor(ctx context.Context, tag string) (CatalogEntityData, error)

func (*CatalogEntitiesClient) List

List retrieves a list of scorecards based on a query.

func (*CatalogEntitiesClient) Upsert

func (*CatalogEntitiesClient) YamlClient

func (c *CatalogEntitiesClient) YamlClient() *sling.Sling

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"`
	Page       int             `json:"page"`
	TotalPages int             `json:"totalPages"`
	Total      int             `json:"total"`
}

CatalogEntitiesResponse is the response from the GET /v1/scorecards endpoint.

type CatalogEntity

type CatalogEntity struct {
	Tag           string                      `json:"tag" yaml:"x-cortex-tag"`
	Name          string                      `json:"name" yaml:"title"`
	Description   string                      `json:"description" yaml:"description"`
	Type          string                      `json:"type" yaml:"x-cortex-type"`
	Id            string                      `json:"id"`
	IsArchived    bool                        `json:"isArchived"`
	LastUpdated   string                      `json:"lastUpdated"`
	Groups        []string                    `json:"groups" yaml:"x-cortex-groups"`
	Links         []CatalogEntityLink         `json:"links" yaml:"x-cortex-link"`
	Metadata      []CatalogEntityMetadata     `json:"metadata" yaml:"x-cortex-custom-metadata"`
	Dependencies  []string                    `json:"dependencies" yaml:"x-cortex-dependency"`
	Ownership     CatalogEntityOwnership      `json:"ownership" yaml:"x-cortex-owners"`
	Owners        CatalogEntityOwnersResponse `json:"owners"`
	SlackChannels []CatalogEntitySlackChannel `json:"slackChannels"`
	Git           CatalogEntityGitSummary     `json:"git"`
}

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

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

func (c *CatalogEntityApm) Enabled() bool

type CatalogEntityApmDataDog

type CatalogEntityApmDataDog struct {
	Monitors []int64 `json:"monitors" yaml:"monitors"`
}

func (*CatalogEntityApmDataDog) Enabled

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

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

func (o *CatalogEntityApmNewRelic) Enabled() bool

type CatalogEntityBugSnag

type CatalogEntityBugSnag struct {
	Project string `json:"project" yaml:"project"`
}

func (*CatalogEntityBugSnag) Enabled

func (o *CatalogEntityBugSnag) Enabled() bool

type CatalogEntityCheckmarx

type CatalogEntityCheckmarx struct {
	Projects []CatalogEntityCheckmarxProject `json:"projects" yaml:"projects"`
}

func (*CatalogEntityCheckmarx) Enabled

func (o *CatalogEntityCheckmarx) Enabled() bool

type CatalogEntityCheckmarxProject

type CatalogEntityCheckmarxProject struct {
	ID   int64  `json:"projectId,omitempty" yaml:"projectId,omitempty"`
	Name string `json:"projectName,omitempty" yaml:"projectName,omitempty"`
}

type CatalogEntityChild

type CatalogEntityChild struct {
	Tag string `json:"tag" yaml:"tag"`
}

type CatalogEntityCiCd

type CatalogEntityCiCd struct {
	Buildkite CatalogEntityCiCdBuildkite `json:"buildkite,omitempty" yaml:"buildkite,omitempty"`
}

func (*CatalogEntityCiCd) Enabled

func (c *CatalogEntityCiCd) Enabled() bool

type CatalogEntityCiCdBuildkite

type CatalogEntityCiCdBuildkite struct {
	Pipelines []CatalogEntityCiCdBuildkitePipeline `json:"pipelines" yaml:"pipelines"`
	Tags      []CatalogEntityCiCdBuildkiteTag      `json:"tags,omitempty" yaml:"tags,omitempty"`
}

func (*CatalogEntityCiCdBuildkite) Enabled

func (o *CatalogEntityCiCdBuildkite) Enabled() bool

type CatalogEntityCiCdBuildkitePipeline

type CatalogEntityCiCdBuildkitePipeline struct {
	Slug string `json:"slug" yaml:"slug"`
}

func (*CatalogEntityCiCdBuildkitePipeline) Enabled

type CatalogEntityCiCdBuildkiteTag

type CatalogEntityCiCdBuildkiteTag struct {
	Tag string `json:"tag" yaml:"tag"`
}

func (*CatalogEntityCiCdBuildkiteTag) Enabled

func (o *CatalogEntityCiCdBuildkiteTag) Enabled() bool

type CatalogEntityCircleCi added in v0.4.3

type CatalogEntityCircleCi struct {
	Projects []CatalogEntityCircleCiProject `json:"projects" yaml:"projects"`
}

func (*CatalogEntityCircleCi) Enabled added in v0.4.3

func (o *CatalogEntityCircleCi) Enabled() bool

type CatalogEntityCircleCiProject added in v0.4.3

type CatalogEntityCircleCiProject struct {
	Slug  string `json:"projectSlug" yaml:"projectSlug"`
	Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityCircleCiProject) Enabled added in v0.4.3

func (o *CatalogEntityCircleCiProject) Enabled() bool

type CatalogEntityCoralogix

type CatalogEntityCoralogix struct {
	Applications []CatalogEntityCoralogixApplication `json:"applications" yaml:"applications"`
}

func (*CatalogEntityCoralogix) Enabled

func (o *CatalogEntityCoralogix) Enabled() bool

type CatalogEntityCoralogixApplication

type CatalogEntityCoralogixApplication struct {
	Name  string `json:"applicationName,omitempty" yaml:"applicationName"`
	Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityCoralogixApplication) Enabled

type CatalogEntityCustomData

type CatalogEntityCustomData struct {
	Tag         string      `json:"tag"` // tag of catalog entity
	Key         string      `json:"key"` // key of custom data
	Description string      `json:"description,omitempty"`
	Source      string      `json:"source"`
	Value       interface{} `json:"value"`
	DateUpdated string      `json:"dateUpdated,omitempty"`
}

func (*CatalogEntityCustomData) ID

func (*CatalogEntityCustomData) ValueAsString

func (c *CatalogEntityCustomData) ValueAsString() (string, error)

type CatalogEntityCustomDataClient

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

func (*CatalogEntityCustomDataClient) Client

func (*CatalogEntityCustomDataClient) Delete

func (c *CatalogEntityCustomDataClient) Delete(ctx context.Context, entityTag string, key string) error

func (*CatalogEntityCustomDataClient) Get

func (*CatalogEntityCustomDataClient) List

List retrieves a list of scorecards based on a query.

func (*CatalogEntityCustomDataClient) Upsert

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)
	Upsert(ctx context.Context, entityTag string, req UpsertCatalogEntityCustomDataRequest) (CatalogEntityCustomData, error)
	Delete(ctx context.Context, entityTag string, key string) 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

func (c *CatalogEntityDashboards) Enabled() bool

type CatalogEntityDashboardsEmbed

type CatalogEntityDashboardsEmbed struct {
	Type string `json:"type" yaml:"type"` // <datadog | grafana | newrelic>
	URL  string `json:"url" yaml:"url"`
}

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"`
	Children       []CatalogEntityChild      `json:"x-cortex-children,omitempty" yaml:"x-cortex-children,omitempty"`
	Parents        []CatalogEntityParent     `json:"x-cortex-parents,omitempty" yaml:"x-cortex-parents,omitempty"`
	Groups         []string                  `json:"x-cortex-groups,omitempty" yaml:"x-cortex-groups,omitempty"` // TODO: is this -groups or -service-groups? docs unclear
	Links          []CatalogEntityLink       `json:"x-cortex-link,omitempty" yaml:"x-cortex-link,omitempty"`
	IgnoreMetadata bool                      `json:"-" yaml:"-"`
	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"`
	CiCd           CatalogEntityCiCd           `json:"x-cortex-ci-cd,omitempty" yaml:"x-cortex-ci-cd,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"`
	CircleCi       CatalogEntityCircleCi        `json:"x-cortex-circle-ci,omitempty" yaml:"x-cortex-circle-ci,omitempty"`
	Coralogix      CatalogEntityCoralogix       `json:"x-cortex-coralogix,omitempty" yaml:"x-cortex-coralogix,omitempty"`
	FireHydrant    CatalogEntityFireHydrant     `json:"x-cortex-firehydrant,omitempty" yaml:"x-cortex-firehydrant,omitempty"`
	LaunchDarkly   CatalogEntityLaunchDarkly    `json:"x-cortex-launch-darkly,omitempty" yaml:"x-cortex-launch-darkly,omitempty"`
	MicrosoftTeams []CatalogEntityMicrosoftTeam `json:"x-cortex-microsoft-teams,omitempty" yaml:"x-cortex-microsoft-teams,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"`
	ServiceNow     CatalogEntityServiceNow      `json:"x-cortex-servicenow,omitempty" yaml:"x-cortex-servicenow,omitempty"`
	Slack          CatalogEntitySlack           `json:"x-cortex-slack,omitempty" yaml:"x-cortex-slack,omitempty"`
	Snyk           CatalogEntitySnyk            `json:"x-cortex-snyk,omitempty" yaml:"x-cortex-snyk,omitempty"`
	Wiz            CatalogEntityWiz             `json:"x-cortex-wiz,omitempty" yaml:"x-cortex-wiz,omitempty"`

	// Infrastructure, Resources, and Deployments attributes
	K8s CatalogEntityK8s `json:"x-cortex-k8s,omitempty" yaml:"x-cortex-k8s,omitempty"`

	// Team-specific attributes
	Team CatalogEntityTeam `json:"team" yaml:"x-cortex-team,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 CatalogEntityEmail struct {
	Email       string `json:"email" yaml:"email"`
	Description string `json:"description" yaml:"description"`
	Inheritance string `json:"inheritance,omitempty" yaml:"inheritance,omitempty"`
}

type CatalogEntityFireHydrant

type CatalogEntityFireHydrant struct {
	Services []CatalogEntityFireHydrantService `json:"services" yaml:"services"`
}

func (*CatalogEntityFireHydrant) Enabled

func (o *CatalogEntityFireHydrant) Enabled() bool

type CatalogEntityFireHydrantService

type CatalogEntityFireHydrantService struct {
	ID   string `json:"identifier" yaml:"identifier"`
	Type string `json:"identifierType" yaml:"identifierType"`
}

func (*CatalogEntityFireHydrantService) Enabled

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

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

func (o *CatalogEntityGitAzureDevOps) Enabled() bool

type CatalogEntityGitBitBucket

type CatalogEntityGitBitBucket struct {
	Repository string `json:"repository" yaml:"repository"`
}

func (*CatalogEntityGitBitBucket) Enabled

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

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

func (o *CatalogEntityGitGitlab) Enabled() bool

type CatalogEntityGitSummary added in v0.9.0

type CatalogEntityGitSummary struct {
	Alias         string `json:"alias"`
	Basepath      string `json:"basepath"`
	Provider      string `json:"provider"`
	Repository    string `json:"repository"`
	RepositoryUrl string `json:"repositoryUrl"`
}

CatalogEntityGitSummary is the git summary returned as part of entity detail responses.

type CatalogEntityGroup

type CatalogEntityGroup struct {
	GroupName   string `json:"groupName" yaml:"groupName"`
	Description string `json:"description" yaml:"description"`
	Provider    string `json:"provider" yaml:"provider"`
	Inheritance string `json:"inheritance,omitempty" yaml:"inheritance,omitempty"`
}

type CatalogEntityGroupMember

type CatalogEntityGroupMember struct {
	Name     string `json:"name" yaml:"name"`
	Provider string `json:"provider" yaml:"provider"`
}

func (*CatalogEntityGroupMember) Enabled

func (o *CatalogEntityGroupMember) Enabled() bool

type CatalogEntityIssues

type CatalogEntityIssues struct {
	Jira CatalogEntityIssuesJira `json:"jira,omitempty" yaml:"jira,omitempty"`
}

func (*CatalogEntityIssues) Enabled

func (c *CatalogEntityIssues) Enabled() bool

type CatalogEntityIssuesJira

type CatalogEntityIssuesJira struct {
	DefaultJQL string   `json:"defaultJql,omitempty" yaml:"defaultJql,omitempty"`
	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

func (o *CatalogEntityIssuesJira) Enabled() bool

type CatalogEntityK8s

type CatalogEntityK8s struct {
	Deployments  []CatalogEntityK8sDeployment  `json:"deployment,omitempty" yaml:"deployment,omitempty"`
	ArgoRollouts []CatalogEntityK8sArgoRollout `json:"argorollout,omitempty" yaml:"argorollout,omitempty"`
	StatefulSets []CatalogEntityK8sStatefulSet `json:"statefulset,omitempty" yaml:"statefulset,omitempty"`
	CronJobs     []CatalogEntityK8sCronJob     `json:"cronjob,omitempty" yaml:"cronjob,omitempty"`
}

func (*CatalogEntityK8s) Enabled

func (o *CatalogEntityK8s) Enabled() bool

type CatalogEntityK8sArgoRollout

type CatalogEntityK8sArgoRollout struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sArgoRollout) Enabled

func (o *CatalogEntityK8sArgoRollout) Enabled() bool

type CatalogEntityK8sCronJob

type CatalogEntityK8sCronJob struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sCronJob) Enabled

func (o *CatalogEntityK8sCronJob) Enabled() bool

type CatalogEntityK8sDeployment

type CatalogEntityK8sDeployment struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sDeployment) Enabled

func (o *CatalogEntityK8sDeployment) Enabled() bool

type CatalogEntityK8sStatefulSet

type CatalogEntityK8sStatefulSet struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sStatefulSet) Enabled

func (o *CatalogEntityK8sStatefulSet) Enabled() bool

type CatalogEntityLaunchDarkly

type CatalogEntityLaunchDarkly struct {
	Projects []CatalogEntityLaunchDarklyProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}

func (*CatalogEntityLaunchDarkly) Enabled

func (o *CatalogEntityLaunchDarkly) Enabled() bool

type CatalogEntityLaunchDarklyProject

type CatalogEntityLaunchDarklyProject struct {
	ID           string                                        `json:"identifier" yaml:"identifier"`
	Type         string                                        `json:"identifierType" yaml:"identifierType"`
	Alias        string                                        `json:"alias,omitempty" yaml:"alias,omitempty"`
	Environments []CatalogEntityLaunchDarklyProjectEnvironment `json:"environments,omitempty" yaml:"environments,omitempty"`
}

func (*CatalogEntityLaunchDarklyProject) Enabled

type CatalogEntityLaunchDarklyProjectEnvironment

type CatalogEntityLaunchDarklyProjectEnvironment struct {
	Name string `json:"environmentName" yaml:"environmentName"`
}

func (*CatalogEntityLaunchDarklyProjectEnvironment) Enabled

type CatalogEntityLink struct {
	Name        string `json:"name" yaml:"name"`
	Type        string `json:"type" yaml:"type"` // runbook, documentation, logs, dashboard, metrics, healthcheck
	Url         string `json:"url" yaml:"url"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

type CatalogEntityListParams

type CatalogEntityListParams struct {
	Groups               []string `url:"groups,omitempty,comma"`
	Owners               []string `url:"owners,omitempty,comma"`
	Types                []string `url:"types,omitempty,comma"`
	GitRepositories      []string `url:"gitRepositories,omitempty,comma"`
	Query                string   `url:"query,omitempty"`
	IncludeArchived      bool     `url:"includeArchived,omitempty"`
	IncludeOwners        bool     `url:"includeOwners,omitempty"`
	IncludeSlackChannels bool     `url:"includeSlackChannels,omitempty"`
	PageSize             int      `url:"pageSize,omitempty"`
	Page                 int      `url:"page,omitempty"`
}

CatalogEntityListParams are the query parameters for the GET /v1/catalog endpoint.

type CatalogEntityMetadata added in v0.7.0

type CatalogEntityMetadata struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

type CatalogEntityMicrosoftTeam

type CatalogEntityMicrosoftTeam struct {
	Name                 string `json:"name" yaml:"name"`
	Description          string `json:"description,omitempty" yaml:"description,omitempty"`
	NotificationsEnabled bool   `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"`
}

func (*CatalogEntityMicrosoftTeam) Enabled

func (o *CatalogEntityMicrosoftTeam) Enabled() bool

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"`
	XMatters  CatalogEntityOnCallXMatters  `json:"xmatters,omitempty" yaml:"xmatters,omitempty"`
}

func (*CatalogEntityOnCall) Enabled

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

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

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

func (o *CatalogEntityOnCallVictorOps) Enabled() bool

type CatalogEntityOnCallXMatters

type CatalogEntityOnCallXMatters struct {
	ID   string `json:"id" yaml:"id"`
	Type string `json:"type" yaml:"type"`
}

func (*CatalogEntityOnCallXMatters) Enabled

func (o *CatalogEntityOnCallXMatters) Enabled() bool

type CatalogEntityOpenAPI added in v0.4.4

type CatalogEntityOpenAPI struct {
	Tag  string `json:"tag"`  // tag of catalog entity
	Spec string `json:"spec"` // OpenAPI specification
}

func (*CatalogEntityOpenAPI) ID added in v0.4.4

func (c *CatalogEntityOpenAPI) ID() string

func (*CatalogEntityOpenAPI) ToUpsertRequest added in v0.4.4

type CatalogEntityOpenAPIClient added in v0.4.4

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

func (*CatalogEntityOpenAPIClient) Client added in v0.4.4

func (c *CatalogEntityOpenAPIClient) Client() *sling.Sling

func (*CatalogEntityOpenAPIClient) Delete added in v0.4.4

func (c *CatalogEntityOpenAPIClient) Delete(ctx context.Context, entityTag string) error

func (*CatalogEntityOpenAPIClient) Get added in v0.4.4

func (*CatalogEntityOpenAPIClient) Upsert added in v0.4.4

type CatalogEntityOpenAPIClientInterface added in v0.4.4

type CatalogEntityOpenAPIClientInterface interface {
	Get(ctx context.Context, entityTag string) (CatalogEntityOpenAPI, error)
	Upsert(ctx context.Context, entityTag string, req UpsertCatalogEntityOpenAPIRequest) (CatalogEntityOpenAPI, error)
	Delete(ctx context.Context, entityTag string) error
}

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"`
	Inheritance          string `json:"inheritance,omitempty" yaml:"inheritance,omitempty"` // APPEND, FALLBACK, or NONE
}

type CatalogEntityOwnerIndividual added in v0.10.0

type CatalogEntityOwnerIndividual struct {
	Email       string `json:"email"`
	Description string `json:"description"`
}

type CatalogEntityOwnerTeam added in v0.10.0

type CatalogEntityOwnerTeam struct {
	Name        string `json:"name"`
	Tag         string `json:"tag"`
	Description string `json:"description"`
	Provider    string `json:"provider"`
	Inheritance string `json:"inheritance"`
}

type CatalogEntityOwnersResponse added in v0.10.0

type CatalogEntityOwnersResponse struct {
	Teams       []CatalogEntityOwnerTeam       `json:"teams"`
	Individuals []CatalogEntityOwnerIndividual `json:"individuals"`
}

CatalogEntityOwnersResponse is the ownership data returned by the list endpoint when includeOwners=true. This is distinct from CatalogEntityOwnership (used by the single-entity GET) — the list endpoint nests owners under "owners" with "teams" and "individuals" arrays.

type CatalogEntityOwnership

type CatalogEntityOwnership struct {
	Emails        []CatalogEntityEmail                 `json:"emails"`
	Groups        []CatalogEntityGroup                 `json:"groups"`
	SlackChannels []CatalogEntityOwnershipSlackChannel `json:"slackChannels"`
}

type CatalogEntityOwnershipSlackChannel

type CatalogEntityOwnershipSlackChannel struct {
	Channel              string `json:"channel" yaml:"channel"`
	Description          string `json:"description" yaml:"description"`
	NotificationsEnabled bool   `json:"notificationsEnabled" yaml:"notificationsEnabled"`
}

type CatalogEntityParent added in v0.4.0

type CatalogEntityParent struct {
	Tag string `json:"tag" yaml:"tag"`
}

type CatalogEntityParser

type CatalogEntityParser struct{}

func (*CatalogEntityParser) YamlToEntity

func (c *CatalogEntityParser) YamlToEntity(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

func (o *CatalogEntityRollbar) Enabled() bool

type CatalogEntitySLODataDog

type CatalogEntitySLODataDog struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLODataDog) Enabled

func (o *CatalogEntitySLODataDog) Enabled() bool

type CatalogEntitySLODynatrace

type CatalogEntitySLODynatrace struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLODynatrace) Enabled

func (o *CatalogEntitySLODynatrace) Enabled() bool

type CatalogEntitySLOLightstepStream

type CatalogEntitySLOLightstepStream struct {
	StreamID string                           `json:"streamId" yaml:"streamId"`
	Targets  CatalogEntitySLOLightstepTargets `json:"targets" yaml:"targets"`
}

type CatalogEntitySLOLightstepTargetLatency

type CatalogEntitySLOLightstepTargetLatency struct {
	Percentile float64 `json:"percentile" yaml:"percentile"`
	Target     int64   `json:"target" yaml:"target"`
	SLO        float64 `json:"slo" yaml:"slo"`
}

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 CatalogEntitySLOSignalFX

type CatalogEntitySLOSignalFX struct {
	Query     string `json:"query" yaml:"query"`
	Rollup    string `json:"rollup" yaml:"rollup"`
	Target    int64  `json:"target" yaml:"target"`
	Lookback  string `json:"lookback" yaml:"lookback"`
	Operation string `json:"operation" yaml:"operation"`
}

type CatalogEntitySLOSumoLogic

type CatalogEntitySLOSumoLogic struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLOSumoLogic) Enabled

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

func (c *CatalogEntitySLOs) Enabled() bool

type CatalogEntitySentry

type CatalogEntitySentry struct {
	Project string `json:"project" yaml:"project"`
}

func (*CatalogEntitySentry) Enabled

func (o *CatalogEntitySentry) Enabled() bool

type CatalogEntityServiceNow

type CatalogEntityServiceNow struct {
	Services []CatalogEntityServiceNowService `json:"services" yaml:"services"`
}

func (*CatalogEntityServiceNow) Enabled

func (o *CatalogEntityServiceNow) Enabled() bool

type CatalogEntityServiceNowService

type CatalogEntityServiceNowService struct {
	ID        int64  `json:"id" yaml:"id"`
	TableName string `json:"tableName" yaml:"tableName"`
}

func (*CatalogEntityServiceNowService) Enabled

func (o *CatalogEntityServiceNowService) Enabled() bool

type CatalogEntitySlack

type CatalogEntitySlack struct {
	Channels []CatalogEntitySlackIntegrationChannel `json:"channels,omitempty" yaml:"channels,omitempty"`
}

func (*CatalogEntitySlack) Enabled

func (o *CatalogEntitySlack) Enabled() bool

type CatalogEntitySlackChannel

type CatalogEntitySlackChannel struct {
	Name                 string `json:"name"`
	Description          string `json:"description"`
	NotificationsEnabled bool   `json:"notificationsEnabled"`
}

CatalogEntitySlackChannel is the Slack channel information returned as part of entity detail responses.

type CatalogEntitySlackIntegrationChannel added in v0.9.0

type CatalogEntitySlackIntegrationChannel struct {
	Name                 string `json:"name" yaml:"name"`
	NotificationsEnabled bool   `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"`
}

func (*CatalogEntitySlackIntegrationChannel) Enabled added in v0.9.0

type CatalogEntitySnyk

type CatalogEntitySnyk struct {
	Projects []CatalogEntitySnykProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}

func (*CatalogEntitySnyk) Enabled

func (o *CatalogEntitySnyk) Enabled() bool

type CatalogEntitySnykProject

type CatalogEntitySnykProject struct {
	Organization string `json:"organizationId" yaml:"organizationId"`
	ProjectID    string `json:"projectId" yaml:"projectId"`
	Source       string `json:"source,omitempty" yaml:"source,omitempty"`
}

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

func (c *CatalogEntityStaticAnalysis) Enabled() bool

type CatalogEntityStaticAnalysisCodeCov

type CatalogEntityStaticAnalysisCodeCov struct {
	Repository string `json:"repo" yaml:"repo"`
	Provider   string `json:"provider" yaml:"provider"`
	Owner      string `json:"owner" yaml:"owner"`
	Flag       string `json:"flag" yaml:"flag"`
}

func (*CatalogEntityStaticAnalysisCodeCov) Enabled

type CatalogEntityStaticAnalysisMend

type CatalogEntityStaticAnalysisMend struct {
	ApplicationIDs []string `json:"applicationIds,omitempty" yaml:"applicationIds,omitempty"`
	ProjectIDs     []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"`
}

func (*CatalogEntityStaticAnalysisMend) Enabled

type CatalogEntityStaticAnalysisSonarQube

type CatalogEntityStaticAnalysisSonarQube struct {
	Project string `json:"project" yaml:"project"`
	Alias   string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityStaticAnalysisSonarQube) Enabled

type CatalogEntityStaticAnalysisVeracode

type CatalogEntityStaticAnalysisVeracode struct {
	ApplicationNames []string                                     `json:"applicationNames,omitempty" yaml:"applicationNames,omitempty"`
	Sandboxes        []CatalogEntityStaticAnalysisVeracodeSandbox `json:"sandboxes,omitempty" yaml:"sandboxes,omitempty"`
}

func (*CatalogEntityStaticAnalysisVeracode) Enabled

type CatalogEntityStaticAnalysisVeracodeSandbox

type CatalogEntityStaticAnalysisVeracodeSandbox struct {
	ApplicationName string `json:"applicationName,omitempty" yaml:"applicationName,omitempty"`
	SandboxName     string `json:"sandboxName,omitempty" yaml:"sandboxName,omitempty"`
}

type CatalogEntityTeam

type CatalogEntityTeam struct {
	Members []CatalogEntityTeamMember  `json:"members" yaml:"members,omitempty"`
	Groups  []CatalogEntityGroupMember `json:"groups" yaml:"groups,omitempty"`
}

func (*CatalogEntityTeam) Enabled

func (o *CatalogEntityTeam) Enabled() bool

type CatalogEntityTeamMember

type CatalogEntityTeamMember struct {
	Name                 string `json:"name" yaml:"name"`
	Email                string `json:"email" yaml:"email"`
	Role                 string `json:"role,omitempty" yaml:"role,omitempty"`
	NotificationsEnabled bool   `json:"notificationsEnabled" yaml:"notificationsEnabled"`
}

func (*CatalogEntityTeamMember) Enabled

func (o *CatalogEntityTeamMember) 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 CatalogEntityWiz

type CatalogEntityWiz struct {
	Projects []CatalogEntityWizProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}

func (*CatalogEntityWiz) Enabled

func (o *CatalogEntityWiz) Enabled() bool

type CatalogEntityWizProject

type CatalogEntityWizProject struct {
	ProjectID string `json:"projectId" yaml:"projectId"`
}

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 CreateResourceDefinitionRequest

type CreateResourceDefinitionRequest struct {
	Type        string                 `json:"type"`
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Schema      map[string]interface{} `json:"schema,omitempty"`
	Source      string                 `json:"source,omitempty"`
}

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 DeleteCatalogEntityCustomDataRequest

type DeleteCatalogEntityCustomDataRequest struct {
	Key   string `json:"key" url:"key"`
	Force bool   `json:"force" url:"force,omitempty"`
}

type DeleteCatalogEntityCustomDataResponse

type DeleteCatalogEntityCustomDataResponse 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.

func (*Department) ToCreateRequest

func (r *Department) ToCreateRequest() CreateDepartmentRequest

ToCreateRequest https://docs.cortex.io/docs/api/create-department

func (*Department) ToUpdateRequest

func (r *Department) ToUpdateRequest() UpdateDepartmentRequest

ToUpdateRequest https://docs.cortex.io/docs/api/update-department

type DepartmentGetParams

type DepartmentGetParams struct {
	DepartmentTag string `json:"departmentTag" url:"departmentTag"`
}

type DepartmentMember

type DepartmentMember struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Email       string `json:"email"`
}

type DepartmentsClient

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

func (*DepartmentsClient) Client

func (c *DepartmentsClient) Client() *sling.Sling

func (*DepartmentsClient) Create

func (*DepartmentsClient) Delete

func (c *DepartmentsClient) Delete(ctx context.Context, tag string) error

func (*DepartmentsClient) Get

func (*DepartmentsClient) Update

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) CatalogEntityOpenAPI added in v0.4.4

func (c *HttpClient) CatalogEntityOpenAPI() CatalogEntityOpenAPIClientInterface

func (*HttpClient) Client

func (c *HttpClient) Client() *sling.Sling

func (*HttpClient) Departments

func (c *HttpClient) Departments() DepartmentsClientInterface

func (*HttpClient) HandleResponseStatus added in v0.11.0

func (c *HttpClient) HandleResponseStatus(response *http.Response, apiError *ApiError) error

HandleResponseStatus maps the status of a response to an error. Clients in other packages use it.

func (*HttpClient) Ping

func (c *HttpClient) Ping(ctx context.Context) error

func (*HttpClient) ResourceDefinitions

func (c *HttpClient) ResourceDefinitions() ResourceDefinitionsClientInterface

func (*HttpClient) Scorecards

func (c *HttpClient) Scorecards() ScorecardsClientInterface

func (*HttpClient) Teams

func (c *HttpClient) Teams() TeamsClientInterface

func (*HttpClient) YamlClient

func (c *HttpClient) YamlClient() *sling.Sling

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.

func (*ResourceDefinition) SchemaAsString

func (r *ResourceDefinition) SchemaAsString() (string, error)

func (*ResourceDefinition) ToCreateRequest

func (*ResourceDefinition) ToUpdateRequest

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 (*ResourceDefinitionsClient) Delete

func (c *ResourceDefinitionsClient) Delete(ctx context.Context, typeName string) error

func (*ResourceDefinitionsClient) Get

func (*ResourceDefinitionsClient) List

List retrieves a list of resource definitions based on a query.

func (*ResourceDefinitionsClient) Update

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" yaml:"name"`
	Description string              `json:"description,omitempty" yaml:"description,omitempty"`
	Draft       bool                `json:"draft,omitempty" yaml:"draft,omitempty"`
	Rules       []ScorecardRule     `json:"rules,omitempty" yaml:"rules,omitempty"`
	Ladder      ScorecardLadder     `json:"ladder,omitempty" yaml:"ladder,omitempty"`
	Filter      ScorecardFilter     `json:"filter,omitempty" yaml:"filter,omitempty"`
	Evaluation  ScorecardEvaluation `json:"evaluation,omitempty" yaml:"evaluation,omitempty"`
}

Scorecard is the nested response object that is typically returned from the scorecards endpoints.

func (*Scorecard) ToYaml

func (s *Scorecard) ToYaml() (string, error)

func (*Scorecard) ToYamlStringReader

func (s *Scorecard) ToYamlStringReader() (*strings.Reader, error)

type ScorecardEvaluation

type ScorecardEvaluation struct {
	Window int64 `json:"window,omitempty" yaml:"window,omitempty"`
}

func (*ScorecardEvaluation) Enabled

func (s *ScorecardEvaluation) Enabled() bool

type ScorecardFilter

type ScorecardFilter struct {
	Kind   string                 `json:"kind,omitempty" yaml:"kind,omitempty"`
	Types  *ScorecardFilterTypes  `json:"types,omitempty" yaml:"types,omitempty"`
	Groups *ScorecardFilterGroups `json:"groups,omitempty" yaml:"groups,omitempty"`
	Query  string                 `json:"query,omitempty" yaml:"query,omitempty"`
}

func (*ScorecardFilter) Enabled

func (s *ScorecardFilter) Enabled() bool

type ScorecardFilterGroups added in v0.5.0

type ScorecardFilterGroups struct {
	Include []string `json:"include,omitempty" yaml:"include,omitempty"`
	Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type ScorecardFilterTypes added in v0.5.0

type ScorecardFilterTypes struct {
	Include []string `json:"include,omitempty" yaml:"include,omitempty"`
	Exclude []string `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}

type ScorecardLadder

type ScorecardLadder struct {
	Levels []ScorecardLevel `json:"levels" yaml:"levels"`
}

func (*ScorecardLadder) Enabled

func (s *ScorecardLadder) Enabled() bool

type ScorecardLevel

type ScorecardLevel struct {
	Name        string `json:"name" yaml:"name"`
	Rank        int64  `json:"rank" yaml:"rank"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Color       string `json:"color" yaml:"color"`
}

func (*ScorecardLevel) Enabled

func (s *ScorecardLevel) Enabled() bool

type ScorecardParser

type ScorecardParser struct{}

func (*ScorecardParser) YamlToEntity

func (c *ScorecardParser) YamlToEntity(yamlEntity map[string]interface{}) (Scorecard, error)

YamlToEntity converts YAML into a Scorecard, from the specification.

type ScorecardRule

type ScorecardRule struct {
	Title          string `json:"title" yaml:"title"`
	Expression     string `json:"expression" yaml:"expression"`
	Weight         int64  `json:"weight" yaml:"weight"`
	Level          string `json:"level" yaml:"level"`
	Description    string `json:"description,omitempty" yaml:"description,omitempty"`
	FailureMessage string `json:"failure_message,omitempty" yaml:"failureMessage,omitempty"`
}

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) Get

func (c *ScorecardsClient) Get(ctx context.Context, tag string) (Scorecard, error)

func (*ScorecardsClient) Upsert

func (c *ScorecardsClient) Upsert(ctx context.Context, scorecard Scorecard) (Scorecard, error)

func (*ScorecardsClient) YamlClient

func (c *ScorecardsClient) YamlClient() *sling.Sling

type ScorecardsClientInterface

type ScorecardsClientInterface interface {
	Get(ctx context.Context, tag string) (Scorecard, error)
	Upsert(ctx context.Context, scorecard Scorecard) (Scorecard, error)
	Delete(ctx context.Context, tag string) error
}

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"`
	CortexTeam        TeamCortexManaged  `json:"cortexTeam,omitempty"`
}

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 TeamIdpGroupMember struct {
	Email string `json:"email,omitempty"`
	ID    string `json:"id"`
	Name  string `json:"name"`
}
type TeamLink struct {
	Name        string `json:"name"`
	Type        string `json:"type,omitempty"`
	Url         string `json:"url"`
	Description string `json:"description,omitempty"`
}

type TeamListParams

type TeamListParams struct {
}

TeamListParams are the query parameters for the GET /v1/teams endpoint.

type TeamMember

type TeamMember struct {
	Description string `json:"description,omitempty" tfsdk:"description"`
	Name        string `json:"name" tfsdk:"name"`
	Email       string `json:"email" tfsdk:"email"`
}

type TeamMetadata

type TeamMetadata struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Summary     string `json:"summary,omitempty"`
}

type TeamSlackChannel

type TeamSlackChannel struct {
	Name                 string `json:"name" tfsdk:"name"`
	NotificationsEnabled bool   `json:"notificationsEnabled" tfsdk:"notifications_enabled"`
}

type TeamsClient

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

func (*TeamsClient) Archive

func (c *TeamsClient) Archive(ctx context.Context, tag string) error

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) Delete

func (c *TeamsClient) Delete(ctx context.Context, tag string) error

func (*TeamsClient) Get

func (c *TeamsClient) Get(ctx context.Context, tag string) (*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 UpdateResourceDefinitionRequest

type UpdateResourceDefinitionRequest struct {
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Schema      map[string]interface{} `json:"schema,omitempty"`
}

type UpdateTeamRequest

type UpdateTeamRequest struct {
	Metadata          TeamMetadata       `json:"metadata"`
	Links             []TeamLink         `json:"links"`
	SlackChannels     []TeamSlackChannel `json:"slackChannels"`
	AdditionalMembers []TeamMember       `json:"additionalMembers"`
}

type UpsertCatalogEntityCustomDataRequest

type UpsertCatalogEntityCustomDataRequest struct {
	Key         string      `json:"key"`
	Description string      `json:"description,omitempty"`
	Value       interface{} `json:"value"`
	Force       bool        `json:"force" url:"force,omitempty"`
}

type UpsertCatalogEntityOpenAPIRequest added in v0.4.4

type UpsertCatalogEntityOpenAPIRequest struct {
	Spec  string `json:"spec"`
	Force bool   `json:"force" url:"force,omitempty"`
}

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 UpsertScorecardResponse

type UpsertScorecardResponse struct {
	Scorecard Scorecard `json:"scorecard" yaml:"scorecard"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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