harness

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL         = "https://app.harness.io/gateway"
	ResourceTypeOrg        = "org"
	ResourceTypeProject    = "project"
	ResourceTypePipeline   = "pipeline"
	DefaultExecutionsLimit = 50
)
View Source
const (
	OnPipelineCompletedPollAction               = "poll"
	OnPipelineCompletedPollInterval             = 1 * time.Minute
	OnPipelineCompletedPollPageSize             = 100
	OnPipelineCompletedPollMaxPages             = 100
	OnPipelineCompletedMaxPollErrors            = 5
	OnPipelineCompletedMaxTimestamplessIDs      = 64
	OnPipelineCompletedCheckpointLockShardCount = 64
	// When pipeline-scoped webhook delivery is configured, defer very recent
	// poll items to avoid duplicate emits from webhook/poll races.
	OnPipelineCompletedPollRaceWindow = 2 * time.Minute
)
View Source
const (
	RunPipelinePayloadType   = "harness.pipeline.finished"
	RunPipelinePollAction    = "poll"
	RunPipelineSuccess       = "success"
	RunPipelineFailed        = "failed"
	RunPipelinePollInterval  = 1 * time.Minute
	RunPipelineMaxPollErrors = 5
)
View Source
const OnPipelineCompletedPayloadType = "harness.pipeline.completed"

Variables

This section is empty.

Functions

func IsExecutionSummaryPipelineIdentifierFilterUnsupported

func IsExecutionSummaryPipelineIdentifierFilterUnsupported(err error) bool

Types

type APIError

type APIError struct {
	StatusCode int
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	APIToken  string
	AccountID string
	OrgID     string
	ProjectID string
	BaseURL   string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) DeletePipelineNotificationRule

func (c *Client) DeletePipelineNotificationRule(pipelineIdentifier, ruleIdentifier string) error

func (*Client) GetExecutionSummary

func (c *Client) GetExecutionSummary(executionID string) (*ExecutionSummary, error)

func (*Client) GetPipelineYAML

func (c *Client) GetPipelineYAML(pipelineIdentifier string) (string, error)

func (*Client) ListExecutionSummariesPage

func (c *Client) ListExecutionSummariesPage(
	page int,
	size int,
	pipelineIdentifier string,
) ([]ExecutionSummary, error)

func (*Client) ListOrganizations

func (c *Client) ListOrganizations() ([]Organization, error)

func (*Client) ListPipelines

func (c *Client) ListPipelines() ([]Pipeline, error)

func (*Client) ListProjects

func (c *Client) ListProjects(orgID string) ([]Project, error)

func (*Client) ResolveAccountID

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

func (*Client) RunPipeline

func (c *Client) RunPipeline(request RunPipelineRequest) (*RunPipelineResponse, error)

func (*Client) UpsertPipelineNotificationRule

func (c *Client) UpsertPipelineNotificationRule(request UpsertPipelineNotificationRuleRequest) error

func (*Client) Verify

func (c *Client) Verify() error

type ExecutionSummary

type ExecutionSummary struct {
	ExecutionID        string
	PipelineIdentifier string
	Status             string
	PlanExecutionURL   string
	StartedAt          string
	EndedAt            string
}

type Harness

type Harness struct{}

func (*Harness) Actions

func (h *Harness) Actions() []core.Action

func (*Harness) Cleanup

func (h *Harness) Cleanup(ctx core.IntegrationCleanupContext) error

func (*Harness) Components

func (h *Harness) Components() []core.Component

func (*Harness) Configuration

func (h *Harness) Configuration() []configuration.Field

func (*Harness) Description

func (h *Harness) Description() string

func (*Harness) HandleAction

func (h *Harness) HandleAction(ctx core.IntegrationActionContext) error

func (*Harness) HandleRequest

func (h *Harness) HandleRequest(ctx core.HTTPRequestContext)

func (*Harness) Icon

func (h *Harness) Icon() string

func (*Harness) Instructions

func (h *Harness) Instructions() string

func (*Harness) Label

func (h *Harness) Label() string

func (*Harness) ListResources

func (h *Harness) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Harness) Name

func (h *Harness) Name() string

func (*Harness) Sync

func (h *Harness) Sync(ctx core.SyncContext) error

func (*Harness) Triggers

func (h *Harness) Triggers() []core.Trigger

type HarnessWebhookHandler

type HarnessWebhookHandler struct{}

func (*HarnessWebhookHandler) Cleanup

func (*HarnessWebhookHandler) CompareConfig

func (h *HarnessWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*HarnessWebhookHandler) Merge

func (h *HarnessWebhookHandler) Merge(current, requested any) (any, bool, error)

func (*HarnessWebhookHandler) Setup

type OnPipelineCompleted

type OnPipelineCompleted struct{}

func (*OnPipelineCompleted) Actions

func (t *OnPipelineCompleted) Actions() []core.Action

func (*OnPipelineCompleted) Cleanup

func (t *OnPipelineCompleted) Cleanup(ctx core.TriggerContext) error

func (*OnPipelineCompleted) Color

func (t *OnPipelineCompleted) Color() string

func (*OnPipelineCompleted) Configuration

func (t *OnPipelineCompleted) Configuration() []configuration.Field

func (*OnPipelineCompleted) Description

func (t *OnPipelineCompleted) Description() string

func (*OnPipelineCompleted) Documentation

func (t *OnPipelineCompleted) Documentation() string

func (*OnPipelineCompleted) ExampleData

func (t *OnPipelineCompleted) ExampleData() map[string]any

func (*OnPipelineCompleted) HandleAction

func (t *OnPipelineCompleted) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*OnPipelineCompleted) HandleWebhook

func (t *OnPipelineCompleted) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*OnPipelineCompleted) Icon

func (t *OnPipelineCompleted) Icon() string

func (*OnPipelineCompleted) Label

func (t *OnPipelineCompleted) Label() string

func (*OnPipelineCompleted) Name

func (t *OnPipelineCompleted) Name() string

func (*OnPipelineCompleted) Setup

type OnPipelineCompletedConfiguration

type OnPipelineCompletedConfiguration struct {
	OrgID              string   `json:"orgId" mapstructure:"orgId"`
	ProjectID          string   `json:"projectId" mapstructure:"projectId"`
	PipelineIdentifier string   `json:"pipelineIdentifier" mapstructure:"pipelineIdentifier"`
	Statuses           []string `json:"statuses" mapstructure:"statuses"`
}

type OnPipelineCompletedMetadata

type OnPipelineCompletedMetadata struct {
	PipelineIdentifier                 string `json:"pipelineIdentifier,omitempty" mapstructure:"pipelineIdentifier"`
	LastExecutionID                    string `json:"lastExecutionId,omitempty" mapstructure:"lastExecutionId"`
	LastTimestamplessExecutionIDs      string `json:"lastTimestamplessExecutionIds,omitempty" mapstructure:"lastTimestamplessExecutionIds"`
	LastTimestamplessExecutionID       string `json:"lastTimestamplessExecutionId,omitempty" mapstructure:"lastTimestamplessExecutionId"`
	LastExecutionEnded                 int64  `json:"lastExecutionEnded,omitempty" mapstructure:"lastExecutionEnded"`
	PollErrorCount                     int    `json:"pollErrorCount,omitempty" mapstructure:"pollErrorCount"`
	DisableServerPipelineIDFilterInAPI bool   `json:"disableServerPipelineIdFilterInApi,omitempty" mapstructure:"disableServerPipelineIdFilterInApi"`
}

type Organization

type Organization struct {
	Identifier string
	Name       string
}

type Pipeline

type Pipeline struct {
	Identifier string
	Name       string
}

type Project

type Project struct {
	Identifier string
	Name       string
}

type RunPipeline

type RunPipeline struct{}

func (*RunPipeline) Actions

func (r *RunPipeline) Actions() []core.Action

func (*RunPipeline) Cancel

func (r *RunPipeline) Cancel(ctx core.ExecutionContext) error

func (*RunPipeline) Cleanup

func (r *RunPipeline) Cleanup(ctx core.SetupContext) error

func (*RunPipeline) Color

func (r *RunPipeline) Color() string

func (*RunPipeline) Configuration

func (r *RunPipeline) Configuration() []configuration.Field

func (*RunPipeline) Description

func (r *RunPipeline) Description() string

func (*RunPipeline) Documentation

func (r *RunPipeline) Documentation() string

func (*RunPipeline) ExampleOutput

func (r *RunPipeline) ExampleOutput() map[string]any

func (*RunPipeline) Execute

func (r *RunPipeline) Execute(ctx core.ExecutionContext) error

func (*RunPipeline) HandleAction

func (r *RunPipeline) HandleAction(ctx core.ActionContext) error

func (*RunPipeline) HandleWebhook

func (r *RunPipeline) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*RunPipeline) Icon

func (r *RunPipeline) Icon() string

func (*RunPipeline) Label

func (r *RunPipeline) Label() string

func (*RunPipeline) Name

func (r *RunPipeline) Name() string

func (*RunPipeline) OutputChannels

func (r *RunPipeline) OutputChannels(configuration any) []core.OutputChannel

func (*RunPipeline) ProcessQueueItem

func (r *RunPipeline) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*RunPipeline) Setup

func (r *RunPipeline) Setup(ctx core.SetupContext) error

type RunPipelineExecutionMetadata

type RunPipelineExecutionMetadata struct {
	OrgID              string `json:"orgId" mapstructure:"orgId"`
	ProjectID          string `json:"projectId" mapstructure:"projectId"`
	ExecutionID        string `json:"executionId" mapstructure:"executionId"`
	PipelineIdentifier string `json:"pipelineIdentifier" mapstructure:"pipelineIdentifier"`
	Status             string `json:"status" mapstructure:"status"`
	PlanExecutionURL   string `json:"planExecutionUrl,omitempty" mapstructure:"planExecutionUrl"`
	StartedAt          string `json:"startedAt,omitempty" mapstructure:"startedAt"`
	EndedAt            string `json:"endedAt,omitempty" mapstructure:"endedAt"`
	PollErrorCount     int    `json:"pollErrorCount,omitempty" mapstructure:"pollErrorCount"`
}

type RunPipelineRequest

type RunPipelineRequest struct {
	PipelineIdentifier string
	Ref                string
	InputSetRefs       []string
	InputYAML          string
}

type RunPipelineResponse

type RunPipelineResponse struct {
	ExecutionID string
}

type RunPipelineSpec

type RunPipelineSpec struct {
	OrgID              string   `json:"orgId" mapstructure:"orgId"`
	ProjectID          string   `json:"projectId" mapstructure:"projectId"`
	PipelineIdentifier string   `json:"pipelineIdentifier" mapstructure:"pipelineIdentifier"`
	Ref                string   `json:"ref" mapstructure:"ref"`
	InputSetReferences []string `json:"inputSetReferences" mapstructure:"inputSetReferences"`
	InputYAML          string   `json:"inputYAML" mapstructure:"inputYAML"`
}

type UpsertPipelineNotificationRuleRequest

type UpsertPipelineNotificationRuleRequest struct {
	PipelineIdentifier string
	RuleIdentifier     string
	RuleName           string
	EventTypes         []string
	WebhookURL         string
	Headers            map[string]string
}

type WebhookConfiguration

type WebhookConfiguration struct {
	PipelineIdentifier string   `json:"pipelineIdentifier" mapstructure:"pipelineIdentifier"`
	OrgID              string   `json:"orgId" mapstructure:"orgId"`
	ProjectID          string   `json:"projectId" mapstructure:"projectId"`
	EventTypes         []string `json:"eventTypes" mapstructure:"eventTypes"`
}

type WebhookMetadata

type WebhookMetadata struct {
	PipelineIdentifier string `json:"pipelineIdentifier,omitempty" mapstructure:"pipelineIdentifier"`
	OrgID              string `json:"orgId,omitempty" mapstructure:"orgId"`
	ProjectID          string `json:"projectId,omitempty" mapstructure:"projectId"`
	RuleIdentifier     string `json:"ruleIdentifier,omitempty" mapstructure:"ruleIdentifier"`
	URL                string `json:"url,omitempty" mapstructure:"url"`
}

Jump to

Keyboard shortcuts

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