Documentation
¶
Index ¶
- Constants
- func IsExecutionSummaryPipelineIdentifierFilterUnsupported(err error) bool
- type APIError
- type Client
- func (c *Client) DeletePipelineNotificationRule(pipelineIdentifier, ruleIdentifier string) error
- func (c *Client) GetExecutionSummary(executionID string) (*ExecutionSummary, error)
- func (c *Client) GetPipelineYAML(pipelineIdentifier string) (string, error)
- func (c *Client) ListExecutionSummariesPage(page int, size int, pipelineIdentifier string) ([]ExecutionSummary, error)
- func (c *Client) ListOrganizations() ([]Organization, error)
- func (c *Client) ListPipelines() ([]Pipeline, error)
- func (c *Client) ListProjects(orgID string) ([]Project, error)
- func (c *Client) ResolveAccountID() (string, error)
- func (c *Client) RunPipeline(request RunPipelineRequest) (*RunPipelineResponse, error)
- func (c *Client) UpsertPipelineNotificationRule(request UpsertPipelineNotificationRuleRequest) error
- func (c *Client) Verify() error
- type ExecutionSummary
- type Harness
- func (h *Harness) Actions() []core.Action
- func (h *Harness) Cleanup(ctx core.IntegrationCleanupContext) error
- func (h *Harness) Components() []core.Component
- func (h *Harness) Configuration() []configuration.Field
- func (h *Harness) Description() string
- func (h *Harness) HandleAction(ctx core.IntegrationActionContext) error
- func (h *Harness) HandleRequest(ctx core.HTTPRequestContext)
- func (h *Harness) Icon() string
- func (h *Harness) Instructions() string
- func (h *Harness) Label() string
- func (h *Harness) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (h *Harness) Name() string
- func (h *Harness) Sync(ctx core.SyncContext) error
- func (h *Harness) Triggers() []core.Trigger
- type HarnessWebhookHandler
- func (h *HarnessWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *HarnessWebhookHandler) CompareConfig(a, b any) (bool, error)
- func (h *HarnessWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *HarnessWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
- type OnPipelineCompleted
- func (t *OnPipelineCompleted) Actions() []core.Action
- func (t *OnPipelineCompleted) Cleanup(ctx core.TriggerContext) error
- func (t *OnPipelineCompleted) Color() string
- func (t *OnPipelineCompleted) Configuration() []configuration.Field
- func (t *OnPipelineCompleted) Description() string
- func (t *OnPipelineCompleted) Documentation() string
- func (t *OnPipelineCompleted) ExampleData() map[string]any
- func (t *OnPipelineCompleted) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnPipelineCompleted) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (t *OnPipelineCompleted) Icon() string
- func (t *OnPipelineCompleted) Label() string
- func (t *OnPipelineCompleted) Name() string
- func (t *OnPipelineCompleted) Setup(ctx core.TriggerContext) error
- type OnPipelineCompletedConfiguration
- type OnPipelineCompletedMetadata
- type Organization
- type Pipeline
- type Project
- type RunPipeline
- func (r *RunPipeline) Actions() []core.Action
- func (r *RunPipeline) Cancel(ctx core.ExecutionContext) error
- func (r *RunPipeline) Cleanup(ctx core.SetupContext) error
- func (r *RunPipeline) Color() string
- func (r *RunPipeline) Configuration() []configuration.Field
- func (r *RunPipeline) Description() string
- func (r *RunPipeline) Documentation() string
- func (r *RunPipeline) ExampleOutput() map[string]any
- func (r *RunPipeline) Execute(ctx core.ExecutionContext) error
- func (r *RunPipeline) HandleAction(ctx core.ActionContext) error
- func (r *RunPipeline) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (r *RunPipeline) Icon() string
- func (r *RunPipeline) Label() string
- func (r *RunPipeline) Name() string
- func (r *RunPipeline) OutputChannels(configuration any) []core.OutputChannel
- func (r *RunPipeline) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (r *RunPipeline) Setup(ctx core.SetupContext) error
- type RunPipelineExecutionMetadata
- type RunPipelineRequest
- type RunPipelineResponse
- type RunPipelineSpec
- type UpsertPipelineNotificationRuleRequest
- type WebhookConfiguration
- type WebhookMetadata
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 ¶
Types ¶
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 (*Client) GetExecutionSummary ¶
func (c *Client) GetExecutionSummary(executionID string) (*ExecutionSummary, error)
func (*Client) GetPipelineYAML ¶
func (*Client) ListExecutionSummariesPage ¶
func (*Client) ListOrganizations ¶
func (c *Client) ListOrganizations() ([]Organization, error)
func (*Client) ListPipelines ¶
func (*Client) ResolveAccountID ¶
func (*Client) RunPipeline ¶
func (c *Client) RunPipeline(request RunPipelineRequest) (*RunPipelineResponse, error)
func (*Client) UpsertPipelineNotificationRule ¶
func (c *Client) UpsertPipelineNotificationRule(request UpsertPipelineNotificationRuleRequest) error
type ExecutionSummary ¶
type Harness ¶
type Harness struct{}
func (*Harness) Components ¶
func (*Harness) Configuration ¶
func (h *Harness) Configuration() []configuration.Field
func (*Harness) Description ¶
func (*Harness) HandleAction ¶
func (h *Harness) HandleAction(ctx core.IntegrationActionContext) error
func (*Harness) HandleRequest ¶
func (h *Harness) HandleRequest(ctx core.HTTPRequestContext)
func (*Harness) Instructions ¶
func (*Harness) ListResources ¶
func (h *Harness) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
type HarnessWebhookHandler ¶
type HarnessWebhookHandler struct{}
func (*HarnessWebhookHandler) Cleanup ¶
func (h *HarnessWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
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 ¶
func (h *HarnessWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
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 ¶
func (t *OnPipelineCompleted) Setup(ctx core.TriggerContext) error
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 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 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 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"`
}
Click to show internal directories.
Click to hide internal directories.