bruincloud

package
v0.11.496 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDateString added in v0.11.496

func ExtractDateString(raw json.RawMessage) string

ExtractDateString extracts a date string from the API's date JSON format. API dates come as {"date": "2026-03-06 20:22:29.753319", "timezone_type": 1, "timezone": "+00:00"}.

Types

type APIClient added in v0.11.496

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

APIClient is the HTTP client for the Bruin Cloud API.

func NewAPIClient added in v0.11.496

func NewAPIClient(apiKey string) *APIClient

NewAPIClient creates a new API client with the given API key.

func (*APIClient) DeletePipeline added in v0.11.496

func (c *APIClient) DeletePipeline(ctx context.Context, project, pipeline string) error

func (*APIClient) DisablePipeline added in v0.11.496

func (c *APIClient) DisablePipeline(ctx context.Context, project, pipeline string) error

func (*APIClient) EnablePipeline added in v0.11.496

func (c *APIClient) EnablePipeline(ctx context.Context, project, pipeline string) error

func (*APIClient) GetAgentMessageStatus added in v0.11.496

func (c *APIClient) GetAgentMessageStatus(ctx context.Context, agentID, threadID, messageID int) (*AgentMessage, error)

func (*APIClient) GetAsset added in v0.11.496

func (c *APIClient) GetAsset(ctx context.Context, project, pipeline, asset string) (*Asset, error)

func (*APIClient) GetGlossaryEntity added in v0.11.496

func (c *APIClient) GetGlossaryEntity(ctx context.Context, project, entityName string) (json.RawMessage, error)

func (*APIClient) GetInstance added in v0.11.496

func (c *APIClient) GetInstance(ctx context.Context, project, pipeline, runID, assetName string) (json.RawMessage, error)

func (*APIClient) GetInstanceLogs added in v0.11.496

func (c *APIClient) GetInstanceLogs(ctx context.Context, project, pipeline, runID, stepID string, tryNumber int) (json.RawMessage, error)

func (*APIClient) GetLatestRun added in v0.11.496

func (c *APIClient) GetLatestRun(ctx context.Context, project, pipeline string) (*PipelineRun, error)

func (*APIClient) GetPipeline added in v0.11.496

func (c *APIClient) GetPipeline(ctx context.Context, project, name string) (*Pipeline, error)

func (*APIClient) GetPipelineErrors added in v0.11.496

func (c *APIClient) GetPipelineErrors(ctx context.Context) ([]json.RawMessage, error)

func (*APIClient) GetRun added in v0.11.496

func (c *APIClient) GetRun(ctx context.Context, project, pipeline, runID string) (*PipelineRun, error)

func (*APIClient) ListAgentMessages added in v0.11.496

func (c *APIClient) ListAgentMessages(ctx context.Context, agentID, threadID int, limit, offset int) ([]AgentMessage, error)

func (*APIClient) ListAgentThreads added in v0.11.496

func (c *APIClient) ListAgentThreads(ctx context.Context, agentID int, limit, offset int) ([]AgentThread, error)

func (*APIClient) ListAgents added in v0.11.496

func (c *APIClient) ListAgents(ctx context.Context) ([]Agent, error)

func (*APIClient) ListAssets added in v0.11.496

func (c *APIClient) ListAssets(ctx context.Context, project, pipeline string) ([]Asset, error)

func (*APIClient) ListGlossaryEntities added in v0.11.496

func (c *APIClient) ListGlossaryEntities(ctx context.Context) (json.RawMessage, error)

func (*APIClient) ListInstances added in v0.11.496

func (c *APIClient) ListInstances(ctx context.Context, project, pipeline, runID string) (json.RawMessage, error)

func (*APIClient) ListInstancesParsed added in v0.11.496

func (c *APIClient) ListInstancesParsed(ctx context.Context, project, pipeline, runID string) (*AssetInstanceResponse, error)

func (*APIClient) ListPipelines added in v0.11.496

func (c *APIClient) ListPipelines(ctx context.Context) ([]Pipeline, error)

func (*APIClient) ListProjects added in v0.11.496

func (c *APIClient) ListProjects(ctx context.Context) ([]Project, error)

func (*APIClient) ListRuns added in v0.11.496

func (c *APIClient) ListRuns(ctx context.Context, project, pipeline string, limit, offset int) ([]PipelineRun, error)

func (*APIClient) MarkRunStatus added in v0.11.496

func (c *APIClient) MarkRunStatus(ctx context.Context, project, pipeline, runID, status string) error

func (*APIClient) RerunRun added in v0.11.496

func (c *APIClient) RerunRun(ctx context.Context, project, pipeline, runID string, onlyFailed bool) error

func (*APIClient) SendAgentMessage added in v0.11.496

func (c *APIClient) SendAgentMessage(ctx context.Context, agentID int, message string, threadID *int) (json.RawMessage, error)

func (*APIClient) TriggerRun added in v0.11.496

func (c *APIClient) TriggerRun(ctx context.Context, project, pipeline, startDate, endDate string) error

type APIError added in v0.11.496

type APIError struct {
	Message    string              `json:"message"`
	Errors     map[string][]string `json:"errors,omitempty"`
	StatusCode int                 `json:"-"`
}

APIError represents an error response from the API.

func (*APIError) Error added in v0.11.496

func (e *APIError) Error() string

type Agent added in v0.11.496

type Agent struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
}

Agent represents a Bruin Cloud agent.

type AgentMessage added in v0.11.496

type AgentMessage struct {
	ID                int             `json:"id"`
	Status            string          `json:"status"`
	OutputMessage     *string         `json:"output_message"`
	AgentLogs         json.RawMessage `json:"agent_logs"`
	QueryLogs         json.RawMessage `json:"query_logs"`
	OutputAttachments json.RawMessage `json:"output_attachments"`
	CreatedAt         string          `json:"created_at"`
	UpdatedAt         string          `json:"updated_at"`
}

AgentMessage represents a message in an agent thread.

type AgentThread added in v0.11.496

type AgentThread struct {
	ID        int    `json:"id"`
	AgentID   int    `json:"agent_id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

AgentThread represents a thread for an agent.

type Asset added in v0.11.496

type Asset struct {
	Project                 string          `json:"project"`
	Pipeline                string          `json:"pipeline"`
	ID                      string          `json:"id"`
	Name                    string          `json:"name"`
	Type                    string          `json:"type"`
	URI                     string          `json:"uri"`
	Description             *string         `json:"description"`
	Content                 *string         `json:"content"`
	Upstreams               json.RawMessage `json:"upstreams"`
	Downstream              json.RawMessage `json:"downstream"`
	Columns                 json.RawMessage `json:"columns"`
	CustomChecks            json.RawMessage `json:"custom_checks"`
	Owner                   json.RawMessage `json:"owner"`
	Materialization         json.RawMessage `json:"materialization"`
	Instance                *string         `json:"instance"`
	Tags                    json.RawMessage `json:"tags"`
	Connection              *string         `json:"connection"`
	Image                   *string         `json:"image"`
	Parameters              json.RawMessage `json:"parameters"`
	Metadata                json.RawMessage `json:"metadata"`
	MarkdownDescription     *string         `json:"markdown_description"`
	QualityScore            int             `json:"quality_score"`
	MaxPossibleQualityScore int             `json:"max_possible_quality_score"`
	QualityScorePercentage  int             `json:"quality_score_percentage"`
}

Asset represents a pipeline asset.

type AssetInstance added in v0.11.496

type AssetInstance struct {
	json.RawMessage
}

AssetInstance represents an asset instance within a pipeline run. The API returns dynamic JSON, so we use json.RawMessage for the full response.

type AssetInstanceCheck added in v0.11.496

type AssetInstanceCheck struct {
	Name     string       `json:"name"`
	Instance StepInstance `json:"instance"`
}

AssetInstanceCheck represents a named check with its step instance.

type AssetInstanceChecks added in v0.11.496

type AssetInstanceChecks struct {
	Column []AssetInstanceCheck `json:"column"`
	Custom []AssetInstanceCheck `json:"custom"`
}

AssetInstanceChecks represents checks for an asset instance.

type AssetInstanceInfo added in v0.11.496

type AssetInstanceInfo struct {
	Asset                  string             `json:"asset"`
	Type                   string             `json:"type"`
	StartDate              string             `json:"startDate"`
	EndDate                string             `json:"endDate"`
	WallTimeDuration       float64            `json:"wallTimeDuration"`
	TotalExecutionDuration float64            `json:"totalExecutionDuration"`
	Status                 string             `json:"status"`
	IsFinished             bool               `json:"isFinished"`
	Steps                  AssetInstanceSteps `json:"steps"`
	StepIDs                []string           `json:"stepIds"`
}

AssetInstanceInfo represents detailed information about an asset instance.

type AssetInstanceResponse added in v0.11.496

type AssetInstanceResponse struct {
	Message        string                       `json:"message"`
	AssetInstances map[string]AssetInstanceInfo `json:"asset_instances"`
	RunID          string                       `json:"run_id"`
}

AssetInstanceResponse represents the parsed response from the asset instances endpoint.

type AssetInstanceSteps added in v0.11.496

type AssetInstanceSteps struct {
	Main   []StepInstance      `json:"main"`
	Checks AssetInstanceChecks `json:"checks"`
}

AssetInstanceSteps represents the steps of an asset instance.

type BruinCloudConfig

type BruinCloudConfig interface {
	GetIngestrURI() string
}

type Client

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

func NewClient

func NewClient(c Config) (*Client, error)

func (*Client) GetIngestrURI

func (c *Client) GetIngestrURI() (string, error)

type Config

type Config struct {
	APIToken string
}

func (*Config) GetIngestrURI

func (c *Config) GetIngestrURI() string

type GlossaryEntity added in v0.11.496

type GlossaryEntity struct {
	json.RawMessage
}

GlossaryEntity represents a glossary entity. The API returns dynamic JSON structures, so we use json.RawMessage.

type LogEntry added in v0.11.496

type LogEntry struct {
	json.RawMessage
}

LogEntry represents a log entry for an asset instance.

type Pipeline added in v0.11.496

type Pipeline struct {
	Name               string          `json:"name"`
	Description        *string         `json:"description"`
	Schedule           *string         `json:"schedule"`
	Assets             json.RawMessage `json:"assets"`
	Owner              json.RawMessage `json:"owner"`
	StartDate          string          `json:"start_date"`
	Project            string          `json:"project"`
	DefaultConnections json.RawMessage `json:"default_connections"`
	Commit             *string         `json:"commit"`
	Variables          json.RawMessage `json:"variables"`
	OxrScheduling      *bool           `json:"oxrScheduling"`
}

Pipeline represents a Bruin Cloud pipeline.

type PipelineRun added in v0.11.496

type PipelineRun struct {
	Project                   string          `json:"project"`
	Pipeline                  string          `json:"pipeline"`
	RunID                     string          `json:"run_id"`
	DataIntervalStart         json.RawMessage `json:"data_interval_start"`
	DataIntervalEnd           json.RawMessage `json:"data_interval_end"`
	StartDate                 json.RawMessage `json:"start_date"`
	EndDate                   json.RawMessage `json:"end_date"`
	WallTimeDuration          *float64        `json:"wall_time_duration"`
	WallTimeDurationHumanized *string         `json:"wall_time_duration_humanized"`
	TotalExecutionDuration    *float64        `json:"total_execution_duration"`
	Status                    string          `json:"status"`
	UnknownInstanceCount      int             `json:"unknown_instance_count"`
	Note                      *string         `json:"note"`
}

PipelineRun represents a pipeline run.

type PipelineValidationError added in v0.11.496

type PipelineValidationError struct {
	json.RawMessage
}

PipelineValidationError represents a pipeline validation error. The API returns dynamic JSON structures.

type Project added in v0.11.496

type Project struct {
	ID       string          `json:"id"`
	Name     string          `json:"name"`
	Repo     Repo            `json:"repo"`
	Rollouts json.RawMessage `json:"rollouts"`
}

Project represents a Bruin Cloud project.

type Repo added in v0.11.496

type Repo struct {
	URL    string `json:"url"`
	Branch string `json:"branch"`
}

Repo represents a git repository configuration.

type SendAgentMessageResponse added in v0.11.496

type SendAgentMessageResponse struct {
	ThreadID  int `json:"thread_id"`
	MessageID int `json:"message_id"`
}

SendAgentMessageResponse represents the response from sending a message to an agent.

type StepInstance added in v0.11.496

type StepInstance struct {
	Name       string  `json:"name"`
	StepID     string  `json:"stepId"`
	StartDate  string  `json:"startDate"`
	EndDate    string  `json:"endDate"`
	Duration   float64 `json:"duration"`
	TryNumber  int     `json:"tryNumber"`
	Status     string  `json:"status"`
	IsFinished bool    `json:"isFinished"`
}

StepInstance represents a step or check instance.

Jump to

Keyboard shortcuts

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