actions

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

Types

type ActionType

type ActionType int
const (
	AutoDeploy ActionType = iota
	DeployLatestRelease
	DeployNewRelease
	RunRunbook
)

func ActionTypeString

func ActionTypeString(s string) (ActionType, error)

ActionTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ActionTypeValues

func ActionTypeValues() []ActionType

ActionTypeValues returns all values of the enum

func (ActionType) IsAActionType

func (i ActionType) IsAActionType() bool

IsAActionType returns "true" if the value is listed in the enum definition. "false" otherwise

func (ActionType) MarshalJSON

func (i ActionType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ActionType

func (ActionType) String

func (i ActionType) String() string

func (*ActionType) UnmarshalJSON

func (i *ActionType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ActionType

type AutoDeployAction

type AutoDeployAction struct {
	ShouldRedeploy bool `json:"ShouldRedeployWhenMachineHasBeenDeployedTo"`
	// contains filtered or unexported fields
}

func NewAutoDeployAction

func NewAutoDeployAction(shouldRedeploy bool) *AutoDeployAction

func (*AutoDeployAction) GetActionType

func (a *AutoDeployAction) GetActionType() ActionType

func (*AutoDeployAction) SetActionType

func (a *AutoDeployAction) SetActionType(actionType ActionType)

type CommunityActionTemplate

type CommunityActionTemplate struct {
	ActionType  string                                    `json:"ActionType" validate:"required,notblank"`
	Author      string                                    `json:"Author,omitempty"`
	Category    string                                    `json:"Category,omitempty"`
	Description string                                    `json:"Description,omitempty"`
	ExternalId  *uuid.UUID                                `json:"ExternalId,omitempty"`
	HistoryURL  string                                    `json:"HistoryUrl,omitempty"`
	Name        string                                    `json:"Name" validate:"required"`
	Packages    []packages.PackageReference               `json:"Packages,omitempty"`
	Parameters  []actiontemplates.ActionTemplateParameter `json:"Parameters"`
	Properties  map[string]core.PropertyValue             `json:"Properties,omitempty"`
	Type        string                                    `json:"Type,omitempty"`
	Version     int32                                     `json:"Version,omitempty"`
	Website     string                                    `json:"Website,omitempty"`

	resources.Resource
}

CommunityActionTemplate represents a community action template in Octopus Deploy.

func NewCommunityActionTemplate

func NewCommunityActionTemplate(name string, actionType string) *CommunityActionTemplate

NewCommunityActionTemplate initializes a community action template.

func (*CommunityActionTemplate) Validate

func (c *CommunityActionTemplate) Validate() error

Validate checks the state of this CommunityActionTemplate and returns an error if invalid.

type CommunityActionTemplateService

type CommunityActionTemplateService struct {
	services.Service
}

CommunityActionTemplateService handles communication with Account-related methods of the Octopus API.

func NewCommunityActionTemplateService

func NewCommunityActionTemplateService(sling *sling.Sling, uriTemplate string) *CommunityActionTemplateService

NewCommunityActionTemplateService returns an CommunityActionTemplateService with a preconfigured client.

func (*CommunityActionTemplateService) Get

Get returns a collection of community action templates based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.

func (*CommunityActionTemplateService) GetAll

GetAll returns all community action templates. If none can be found or an error occurs, it returns an empty collection.

func (*CommunityActionTemplateService) GetByID

GetByID returns the community action template that matches the input ID. If one cannot be found, it returns nil and an error.

func (*CommunityActionTemplateService) GetByIDs

GetByIDs returns the accounts that match the input IDs.

func (*CommunityActionTemplateService) GetByName

GetByName performs a lookup and returns the community action template with a matching name.

func (*CommunityActionTemplateService) Install

Install installs a community step template.

func (*CommunityActionTemplateService) Update

Update modifies a community action template based on the one provided as input.

type CommunityActionTemplates

type CommunityActionTemplates struct {
	Items []*CommunityActionTemplate `json:"Items"`
	resources.PagedResults
}

CommunityActionTemplates defines a collection of community action templates with built-in support for paged results.

type CommunityActionTemplatesQuery

type CommunityActionTemplatesQuery struct {
	IDs  []string `uri:"ids,omitempty" url:"ids,omitempty"`
	Skip int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Take int      `uri:"take,omitempty" url:"take,omitempty"`
}

type DeployLatestReleaseAction

type DeployLatestReleaseAction struct {
	DestinationEnvironment string   `json:"DestinationEnvironmentId"`
	ShouldRedeploy         bool     `json:"ShouldRedeployWhenReleaseIsCurrent"`
	SourceEnvironments     []string `json:"SourceEnvironmentIds"`
	Variables              string   `json:"Variables"`
	// contains filtered or unexported fields
}

func NewDeployLatestReleaseAction

func NewDeployLatestReleaseAction(destinationEnvironment string, shouldRedeploy bool, sourceEnvironments []string, variables string) *DeployLatestReleaseAction

func (*DeployLatestReleaseAction) GetActionType

func (a *DeployLatestReleaseAction) GetActionType() ActionType

func (*DeployLatestReleaseAction) SetActionType

func (a *DeployLatestReleaseAction) SetActionType(actionType ActionType)

type DeployNewReleaseAction

type DeployNewReleaseAction struct {
	Environment             string                   `json:"EnvironmentId,omitempty"`
	Variables               string                   `json:"Variable,omitempty"`
	VersionControlReference *VersionControlReference `json:"VersionControlReference,omitempty"`
	// contains filtered or unexported fields
}

func NewDeployNewReleaseAction

func NewDeployNewReleaseAction(environment string, variables string, versionControlReference *VersionControlReference) *DeployNewReleaseAction

func (*DeployNewReleaseAction) GetActionType

func (a *DeployNewReleaseAction) GetActionType() ActionType

func (*DeployNewReleaseAction) SetActionType

func (a *DeployNewReleaseAction) SetActionType(actionType ActionType)

type ITriggerAction

type ITriggerAction interface {
	GetActionType() ActionType
	SetActionType(actionType ActionType)
}

ITriggerAction defines the interface for trigger actions.

func FromJson

func FromJson(rawMessage *json.RawMessage) (ITriggerAction, error)

type ProjectTriggerAction

type ProjectTriggerAction struct {
	ActionType                                 string `json:"ActionType"`
	DestinationEnvironmentID                   string `json:"DestinationEnvironmentId"`
	ShouldRedeployWhenMachineHasBeenDeployedTo bool   `json:"ShouldRedeployWhenMachineHasBeenDeployedTo"`
	SourceEnvironmentID                        string `json:"SourceEnvironmentId"`
}

func (*ProjectTriggerAction) GetActionType

func (a *ProjectTriggerAction) GetActionType() ActionType

func (*ProjectTriggerAction) SetActionType

func (a *ProjectTriggerAction) SetActionType(actionType ActionType)

type RunRunbookAction

type RunRunbookAction struct {
	Environments []string `json:"EnvironmentIds"`
	Runbook      string   `json:"RunbookId"`
	Tenants      []string `json:"TenantIds"`
	TenantTags   []string `json:"TenantTags"`
	// contains filtered or unexported fields
}

func NewRunRunbookAction

func NewRunRunbookAction() *RunRunbookAction

func (*RunRunbookAction) GetActionType

func (a *RunRunbookAction) GetActionType() ActionType

func (*RunRunbookAction) SetActionType

func (a *RunRunbookAction) SetActionType(actionType ActionType)

type VersionControlReference

type VersionControlReference struct {
	GitRef    string `json:"GitRef"`
	GitCommit string `json:"GitCommit"`
}

Jump to

Keyboard shortcuts

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