autoconnections

package
v0.0.0-...-de9e006 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateConnectionName

func GenerateConnectionName(definition ConnectionDefinition, runnerName string) string

Types

type ConnectionDefinition

type ConnectionDefinition struct {
	// FQNPrefix is the identifier used in allowlist matching
	// Example: "com.datadoghq.script"
	FQNPrefix string

	// IntegrationType is the integration type sent to the API
	// Example: "Kubernetes", "Script"
	IntegrationType string

	Credentials CredentialConfig
}

ConnectionDefinition defines all metadata needed to create a connection

func DetermineConnectionsToCreate

func DetermineConnectionsToCreate(actionsAllowlist []string) []ConnectionDefinition

type ConnectionRequest

type ConnectionRequest struct {
	ID          string            `jsonapi:"primary,action_connection"`
	Name        string            `jsonapi:"attribute" json:"name" validate:"required"`
	RunnerID    string            `jsonapi:"attribute" json:"runner_id" validate:"required"`
	Tags        []string          `jsonapi:"attribute" json:"tags"`
	Integration IntegrationConfig `jsonapi:"attribute" json:"integration" validate:"required"`
}

type ConnectionsClient

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

ConnectionsClient is an HTTP client for creating connections via the Datadog API.

func NewConnectionsAPIClient

func NewConnectionsAPIClient(cfg model.Reader, ddSite, apiKey, appKey string) (*ConnectionsClient, error)

func (*ConnectionsClient) CreateConnection

func (c *ConnectionsClient) CreateConnection(ctx context.Context, definition ConnectionDefinition, runnerID, runnerName string, tags []string) error

type ConnectionsCreator

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

func NewConnectionsCreator

func NewConnectionsCreator(client ConnectionsClient, provider TagsProvider) ConnectionsCreator

func (ConnectionsCreator) AutoCreateConnections

func (c ConnectionsCreator) AutoCreateConnections(ctx context.Context, runnerID, hostname, runnerName string, actionsAllowlist []string) error

type CredentialConfig

type CredentialConfig struct {
	// Example: "KubernetesServiceAccount", "Script"
	Type string

	// AdditionalFields contains any extra fields needed in the credentials object
	// Example: {"configFileLocation": "/path/to/file"}
	AdditionalFields map[string]interface{}
}

type IntegrationConfig

type IntegrationConfig struct {
	Type        string                 `json:"type" validate:"required"`
	Credentials map[string]interface{} `json:"credentials" validate:"required"`
}

type TagsProvider

type TagsProvider interface {
	GetTags(ctx context.Context, runnerID, hostname string) []string
}

TagsProvider builds connection tags

func NewTagsProvider

func NewTagsProvider(tagger tagger.Component) TagsProvider

NewTagsProvider creates a TagsProvider that uses the tagger component to get cluster tags

Jump to

Keyboard shortcuts

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