octopusdeploy

package
v0.0.0-...-d365bde Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeploymentStepPackageRequirement_LetOctopusDecide         = DeploymentStepPackageRequirement("LetOctopusDecide")
	DeploymentStepPackageRequirement_BeforePackageAcquisition = DeploymentStepPackageRequirement("BeforePackageAcquisition")
	DeploymentStepPackageRequirement_AfterPackageAcquisition  = DeploymentStepPackageRequirement("AfterPackageAcquisition")
)
View Source
const (
	DeploymentStepCondition_Success  = DeploymentStepCondition("Success")
	DeploymentStepCondition_Failure  = DeploymentStepCondition("Failure")
	DeploymentStepCondition_Always   = DeploymentStepCondition("Always")
	DeploymentStepCondition_Variable = DeploymentStepCondition("Variable")
)
View Source
const (
	DeploymentStepStartTrigger_StartAfterPrevious = DeploymentStepStartTrigger("StartAfterPrevious")
	DeploymentStepStartTrigger_StartWithPrevious  = DeploymentStepStartTrigger("StartWithPrevious")
)
View Source
const (
	PackageAcquisitionLocation_Server          = "Server"
	PackageAcquisitionLocation_ExecutionTarget = "ExecutionTarget"
	PackageAcquisitionLocation_NotAcquired     = "NotAcquired"
)
View Source
const (
	VariableSetContentType_Variables    = VariableSetContentType("Variables")
	VariableSetContentType_ScriptModule = VariableSetContentType("ScriptModule")
)
View Source
const (
	RetentionUnit_Days  = RetentionUnit("Days")
	RetentionUnit_Items = RetentionUnit("Items")
)
View Source
const ManualInterventionDecline = "Abort"
View Source
const ManualInterverventionApprove = "Proceed"

Variables

View Source
var ErrItemNotFound = errors.New("cannot find the item")

ErrItemNotFound is an OctopusDeploy error returned an item cannot be found.

View Source
var ValidMachineStatuses = []string{
	"Online", "Offline", "Unknown", "NeedsUpgrade", "CalamariNeedsUpgrade", "Disabled",
}

ValidMachineStatuses provides options for valid machine status

View Source
var ValidProjectConnectivityPolicySkipMachineBehaviors = []string{
	"SkipUnavailableMachines", "None",
}

ValidProjectConnectivityPolicySkipMachineBehaviors provides options for "Skip Deployment Targets" - https://octopus.com/docs/deployment-patterns/elastic-and-transient-environments/deploying-to-transient-targets

View Source
var ValidProjectDefaultGuidedFailureModes = []string{
	"EnvironmentDefault", "Off", "On",
}

ValidProjectDefaultGuidedFailureModes provides options for "Default failure mode" - https://octopus.com/docs/deployment-process/releases/guided-failures

View Source
var ValidTenantedDeploymentModes = []string{
	"Untenanted", "TenantedOrUntenanted", "Tenanted",
}

ValidTenantedDeploymentModes provides options for tenanted deployment modes

Functions

func APIErrorChecker

func APIErrorChecker(urlPath string, resp *http.Response, wantedResponseCode int, slingError error, octopusDeployError *APIError) error

APIErrorChecker is a generic error handler for the OctopusDeploy API.

func LoadNextPage

func LoadNextPage(pagedResults PagedResults) (string, bool)

LoadNextPage checks if the next page should be loaded from the API. Returns the new path and a bool if the next page should be checked.

func ValidateLibraryVariableSetValues

func ValidateLibraryVariableSetValues(LibraryVariableSet *LibraryVariableSet) error

ValidateLibraryVariableSetValues checks the values of a LibraryVariableSet object to see if they are suitable for sending to Octopus Deploy. Used when adding or updating libraryVariableSets.

func ValidateLifecycleValues

func ValidateLifecycleValues(Lifecycle *Lifecycle) error

ValidateLifecycleValues checks the values of a Lifecycle object to see if they are suitable for sending to Octopus Deploy. Used when adding or updating lifecycles.

func ValidateMachineValues

func ValidateMachineValues(Machine *Machine) error

ValidateMachineValues checks the values of a Machine object to see if they are suitable for sending to Octopus Deploy. Used when adding or updating machines.

func ValidateMultipleProperties

func ValidateMultipleProperties(validatePropertyErrors []error) error

ValidateMultipleProperties returns the first error in a list of property validations

func ValidateProjectValues

func ValidateProjectValues(Project *Project) error

ValidateProjectValues checks the values of a Project object to see if they are suitable for sending to Octopus Deploy. Used when adding or updating projects.

func ValidatePropertiesMatch

func ValidatePropertiesMatch(firstProperty, firstPropertyName, secondProperty, secondPropertyName string) error

ValidatePropertiesMatch checks two values against each other

func ValidatePropertyValues

func ValidatePropertyValues(propertyName string, propertyValue string, validValues []string) error

ValidatePropertyValues returns an error if the given string is not in a slice of strings

func ValidateRequiredPropertyValue

func ValidateRequiredPropertyValue(propertyName string, propertyValue string) error

ValidateRequiredPropertyValue returns an error if the property value is empty

func ValidateStringInSlice

func ValidateStringInSlice(str string, list []string) bool

ValidateStringInSlice checks if a string is in the given slice

Types

type APIError

type APIError struct {
	ErrorMessage  string   `json:"ErrorMessage"`
	Errors        []string `json:"Errors"`
	FullException string   `json:"FullException"`
}

func (APIError) Error

func (e APIError) Error() string

type ActionTemplateParameter

type ActionTemplateParameter struct {

	// default value
	DefaultValue map[string]PropertyValue `json:"DefaultValue,omitempty"`

	// display settings
	DisplaySettings map[string]string `json:"DisplaySettings,omitempty"`

	// help text
	HelpText string `json:"HelpText,omitempty"`

	// Id
	ID string `json:"Id,omitempty"`

	// label
	Label string `json:"Label,omitempty"`

	// last modified by
	LastModifiedBy string `json:"LastModifiedBy,omitempty"`

	// last modified on
	// Format: date-time
	LastModifiedOn string `json:"LastModifiedOn,omitempty"` // datetime

	// links
	Links Links `json:"Links,omitempty"`

	// name
	Name string `json:"Name,omitempty"`
}

type AutoDeployReleaseOverride

type AutoDeployReleaseOverride struct {

	// environment Id
	// Read Only: true
	EnvironmentID string `json:"EnvironmentId,omitempty"`

	// release Id
	// Read Only: true
	ReleaseID string `json:"ReleaseId,omitempty"`

	// tenant Id
	// Read Only: true
	TenantID string `json:"TenantId,omitempty"`
}

type Client

type Client struct {

	// Octopus Deploy API Services
	DeploymentProcess  *DeploymentProcessService
	ProjectGroup       *ProjectGroupService
	Project            *ProjectService
	ProjectTrigger     *ProjectTriggerService
	Environment        *EnvironmentService
	Variable           *VariableService
	MachinePolicy      *MachinePolicyService
	Machine            *MachineService
	Lifecycle          *LifecycleService
	LibraryVariableSet *LibraryVariableSetService
	Interruption       *InterruptionsService
	// contains filtered or unexported fields
}

Client is an OctopusDeploy for making OctpusDeploy API requests.

func NewClient

func NewClient(httpClient *http.Client, octopusURL, octopusAPIKey string) *Client

NewClient returns a new Client.

type DeploymentAction

type DeploymentAction struct {
	ID                            string             `json:"Id,omitempty"`
	Name                          string             `json:"Name"`
	ActionType                    string             `json:"ActionType"`
	IsDisabled                    bool               `json:"IsDisabled"`
	IsRequired                    bool               `json:"IsRequired"`
	WorkerPoolId                  string             `json:"WorkerPoolId,omitempty"`
	CanBeUsedForProjectVersioning bool               `json:"CanBeUsedForProjectVersioning"`
	Environments                  []string           `json:"Environments,omitempty"`
	ExcludedEnvironments          []string           `json:"ExcludedEnvironments,omitempty"`
	Channels                      []string           `json:"Channels,omitempty"`
	TenantTags                    []string           `json:"TenantTags,omitempty"`
	Properties                    map[string]string  `json:"Properties"` // TODO: refactor to use the PropertyValueResource for handling sensitive values - https://blog.gopheracademy.com/advent-2016/advanced-encoding-decoding/
	Packages                      []PackageReference `json:"Packages,omitempty"`
}

type DeploymentProcess

type DeploymentProcess struct {
	ID             string           `json:"Id,omitempty"`
	LastModifiedBy string           `json:"LastModifiedBy,omitempty"`
	LastModifiedOn string           `json:"LastModifiedOn,omitempty"`
	LastSnapshotID string           `json:"LastSnapshotId,omitempty"`
	Links          Links            `json:"Links,omitempty"`
	ProjectID      string           `json:"ProjectId,omitempty"`
	Steps          []DeploymentStep `json:"Steps,omitempty"`
	Version        int32            `json:"Version"`
}

func (*DeploymentProcess) Validate

func (d *DeploymentProcess) Validate() error

type DeploymentProcessService

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

func NewDeploymentProcessService

func NewDeploymentProcessService(sling *sling.Sling) *DeploymentProcessService

func (*DeploymentProcessService) Get

func (s *DeploymentProcessService) Get(deploymentProcessID string) (*DeploymentProcess, error)

func (*DeploymentProcessService) GetAll

func (*DeploymentProcessService) Update

func (s *DeploymentProcessService) Update(deploymentProcess *DeploymentProcess) (*DeploymentProcess, error)

type DeploymentProcesses

type DeploymentProcesses struct {
	Items []DeploymentProcess `json:"Items"`
	PagedResults
}

type DeploymentStep

type DeploymentStep struct {
	ID                 string                           `json:"Id,omitempty"`
	Name               string                           `json:"Name"`
	PackageRequirement DeploymentStepPackageRequirement `json:"PackageRequirement,omitempty"`                                         // may need its own model / enum
	Properties         map[string]string                `json:"Properties"`                                                           // TODO: refactor to use the PropertyValueResource for handling sensitive values - https://blog.gopheracademy.com/advent-2016/advanced-encoding-decoding/
	Condition          DeploymentStepCondition          `json:"Condition,omitempty" validate:"oneof=Success Failure Always Variable"` // variable option adds a Property "Octopus.Action.ConditionVariableExpression"
	StartTrigger       DeploymentStepStartTrigger       `json:"StartTrigger,omitempty" validate:"oneof=StartAfterPrevious StartWithPrevious"`
	Actions            []DeploymentAction               `json:"Actions,omitempty"`
}

type DeploymentStepCondition

type DeploymentStepCondition string

type DeploymentStepPackageRequirement

type DeploymentStepPackageRequirement string

type DeploymentStepStartTrigger

type DeploymentStepStartTrigger string

type Environment

type Environment struct {
	ID               string `json:"Id"`
	Name             string `json:"Name"`
	Description      string `json:"Description"`
	SortOrder        int    `json:"SortOrder"`
	UseGuidedFailure bool   `json:"UseGuidedFailure"`
}

func NewEnvironment

func NewEnvironment(name, description string, useguidedfailure bool) *Environment

func (*Environment) Validate

func (t *Environment) Validate() error

type EnvironmentService

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

func NewEnvironmentService

func NewEnvironmentService(sling *sling.Sling) *EnvironmentService

func (*EnvironmentService) Add

func (s *EnvironmentService) Add(environment *Environment) (*Environment, error)

func (*EnvironmentService) Delete

func (s *EnvironmentService) Delete(environmentid string) error

func (*EnvironmentService) Get

func (s *EnvironmentService) Get(environmentid string) (*Environment, error)

func (*EnvironmentService) GetAll

func (s *EnvironmentService) GetAll() (*[]Environment, error)

func (*EnvironmentService) GetByName

func (s *EnvironmentService) GetByName(environmentName string) (*Environment, error)

func (*EnvironmentService) Update

func (s *EnvironmentService) Update(environment *Environment) (*Environment, error)

type Environments

type Environments struct {
	Items []Environment `json:"Items"`
	PagedResults
}

type Interruption

type Interruption struct {
	ID        string    `json:"Id"`
	Title     string    `json:"Title"`
	Created   time.Time `json:"Created"`
	IsPending bool      `json:"IsPending"`
	Form      struct {
		Values struct {
			AdditionalProp1 string `json:"additionalProp1"`
			AdditionalProp2 string `json:"additionalProp2"`
			AdditionalProp3 string `json:"additionalProp3"`
		} `json:"Values"`
		Elements []struct {
			Name    string `json:"Name"`
			Control struct {
			} `json:"Control"`
			IsValueRequired bool `json:"IsValueRequired"`
		} `json:"Elements"`
	} `json:"Form"`
	RelatedDocumentIds          []string          `json:"RelatedDocumentIds"`
	ResponsibleTeamIds          []string          `json:"ResponsibleTeamIds"`
	ResponsibleUserID           string            `json:"ResponsibleUserId"`
	CanTakeResponsibility       bool              `json:"CanTakeResponsibility"`
	HasResponsibility           bool              `json:"HasResponsibility"`
	TaskID                      string            `json:"TaskId"`
	CorrelationID               string            `json:"CorrelationId"`
	IsLinkedToOtherInterruption bool              `json:"IsLinkedToOtherInterruption"`
	LastModifiedOn              time.Time         `json:"LastModifiedOn"`
	LastModifiedBy              string            `json:"LastModifiedBy"`
	Links                       InterruptionLinks `json:"Links"`
}
type InterruptionLinks struct {
	Self        string `json:"Self"`
	Submit      string `json:"Submit"`
	Responsible string `json:"Responsible"`
}

type InterruptionSubmitRequest

type InterruptionSubmitRequest struct {
	Instructions string `json:"Instructions"`
	Notes        string `json:"Notes"`
	Result       string `json:"Result"`
}

type Interruptions

type Interruptions struct {
	Items []Interruption `json:"Items"`
	PagedResults
}

type InterruptionsService

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

func NewInterruptionService

func NewInterruptionService(sling *sling.Sling) *InterruptionsService

func (*InterruptionsService) Get

Get returns the interruption matching the id

func (*InterruptionsService) GetAll

func (s *InterruptionsService) GetAll() ([]Interruption, error)

GetAll returns all interruptions in Octopus Deploy

func (*InterruptionsService) GetResponsability

func (s *InterruptionsService) GetResponsability(i *Interruption) (*User, error)

GetResponsability Gets the user that is currently responsible for this interruption.

func (*InterruptionsService) Submit

Submit Submits a dictionary of form values for the interruption. Only the user with responsibility for this interruption can submit this form.

func (*InterruptionsService) TakeResponsability

func (s *InterruptionsService) TakeResponsability(i *Interruption) (*User, error)

TakeResponsability Allows the current user to take responsibility for this interruption. Only users in one of the responsible teams on this interruption can take responsibility for it.

type LibraryVariableSet

type LibraryVariableSet struct {
	ID            string                 `json:"Id,omitempty"`
	Name          string                 `json:"Name" validate:"required"`
	Description   string                 `json:"Description,omitempty"`
	VariableSetId string                 `json:"VariableSetId,omitempty"`
	ContentType   VariableSetContentType `json:"ContentType" validate:"required"`
}

func NewLibraryVariableSet

func NewLibraryVariableSet(name string) *LibraryVariableSet

type LibraryVariableSetService

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

func NewLibraryVariableSetService

func NewLibraryVariableSetService(sling *sling.Sling) *LibraryVariableSetService

func (*LibraryVariableSetService) Add

func (s *LibraryVariableSetService) Add(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)

Add adds an new libraryVariableSet in Octopus Deploy

func (*LibraryVariableSetService) Delete

func (s *LibraryVariableSetService) Delete(libraryVariableSetid string) error

Delete deletes an existing libraryVariableSet in Octopus Deploy

func (*LibraryVariableSetService) Get

func (s *LibraryVariableSetService) Get(libraryVariableSetID string) (*LibraryVariableSet, error)

Get returns a single LibraryVariableSet by its Id in Octopus Deploy

func (*LibraryVariableSetService) GetAll

GetAll returns all libraryVariableSets in Octopus Deploy

func (*LibraryVariableSetService) GetByName

GetByName gets an existing Library Variable Set by its name in Octopus Deploy

func (*LibraryVariableSetService) Update

func (s *LibraryVariableSetService) Update(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)

Update updates an existing libraryVariableSet in Octopus Deploy

type LibraryVariableSets

type LibraryVariableSets struct {
	Items []LibraryVariableSet `json:"Items"`
	PagedResults
}

type Lifecycle

type Lifecycle struct {
	ID                      string          `json:"Id,omitempty"`
	Name                    string          `json:"Name" validate:"required"`
	Description             string          `json:"Description,omitempty"`
	ReleaseRetentionPolicy  RetentionPeriod `json:"ReleaseRetentionPolicy,omitempty"`
	TentacleRetentionPolicy RetentionPeriod `json:"TentacleRetentionPolicy,omitempty"`
	Phases                  []Phase         `json:"Phases"`
}

func NewLifecycle

func NewLifecycle(name string) *Lifecycle

type LifecycleService

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

func NewLifecycleService

func NewLifecycleService(sling *sling.Sling) *LifecycleService

func (*LifecycleService) Add

func (s *LifecycleService) Add(lifecycle *Lifecycle) (*Lifecycle, error)

Add adds an new lifecycle in Octopus Deploy

func (*LifecycleService) Delete

func (s *LifecycleService) Delete(lifecycleid string) error

Delete deletes an existing lifecycle in Octopus Deploy

func (*LifecycleService) Get

func (s *LifecycleService) Get(LifecycleID string) (*Lifecycle, error)

Get returns a single lifecycle by its lifecycleid in Octopus Deploy

func (*LifecycleService) GetAll

func (s *LifecycleService) GetAll() (*[]Lifecycle, error)

GetAll returns all lifecycles in Octopus Deploy

func (*LifecycleService) GetByName

func (s *LifecycleService) GetByName(lifecycleName string) (*Lifecycle, error)

GetByName gets an existing lifecycle by its lifecycle name in Octopus Deploy

func (*LifecycleService) Update

func (s *LifecycleService) Update(lifecycle *Lifecycle) (*Lifecycle, error)

Update updates an existing lifecycle in Octopus Deploy

type Lifecycles

type Lifecycles struct {
	Items []Lifecycle `json:"Items"`
	PagedResults
}
type Links struct {
	Self        string `json:"Self"`
	Template    string `json:"Template"`
	PageAll     string `json:"Page.All"`
	PageCurrent string `json:"Page.Current"`
	PageLast    string `json:"Page.Last"`
	PageNext    string `json:"Page.Next"`
}

type Machine

type Machine struct {
	ID                              string           `json:"Id"`
	Name                            string           `json:"Name"`
	Thumbprint                      string           `json:"Thumbprint"`
	URI                             string           `json:"Uri"`
	IsDisabled                      bool             `json:"IsDisabled"`
	EnvironmentIDs                  []string         `json:"EnvironmentIds"`
	Roles                           []string         `json:"Roles"`
	MachinePolicyID                 string           `json:"MachinePolicyId"`
	TenantedDeploymentParticipation string           `json:"TenantedDeploymentParticipation"`
	TenantIDs                       []string         `json:"TenantIDs"`
	TenantTags                      []string         `json:"TenantTags"`
	Status                          string           `json:"Status"`
	HasLatestCalamari               bool             `json:"HasLatestCalamari"`
	StatusSummary                   string           `json:"StatusSummary"`
	IsInProcess                     bool             `json:"IsInProcess"`
	Endpoint                        *MachineEndpoint `json:"Endpoint,omitempty"`
	LastModifiedOn                  *string          `json:"LastModifiedOn,omitempty"`
	LastModifiedBy                  *string          `json:"LastModifiedBy,omitempty"`
}

func NewMachine

func NewMachine(Name string, Disabled bool, EnvironmentIDs []string, Roles []string, MachinePolicyId string, TenantedDeploymentParticipation string, TenantIDs, TenantTags []string) *Machine

type MachineEndpoint

type MachineEndpoint struct {
	ID                     string                        `json:"Id"`
	CommunicationStyle     string                        `json:"CommunicationStyle"`
	ProxyID                *string                       `json:"ProxyId"`
	Thumbprint             string                        `json:"Thumbprint"`
	TentacleVersionDetails MachineTentacleVersionDetails `json:"TentacleVersionDetails"`
	LastModifiedOn         *string                       `json:"LastModifiedOn,omitempty"`
	LastModifiedBy         *string                       `json:"LastModifiedBy,omitempty"`
	URI                    string                        `json:"Uri"` //This is not in the spec doc, but it shows up and needs to be kept in sync
}

type MachineHealthCheckPolicy

type MachineHealthCheckPolicy struct {
	TentacleEndpointHealthCheckPolicy map[string]string `json:"TentacleEndpointHealthCheckPolicy"`
	SSHEndpointHealthCheckPolicy      map[string]string `json:"SshEndpointHealthCheckPolicy"`
	HealthCheckInterval               string            `json:"HealthCheckInterval"`
}

type MachinePolicies

type MachinePolicies struct {
	Items []MachinePolicy `json:"Items"`
	PagedResults
}

type MachinePolicy

type MachinePolicy struct {
	ID                        string                   `json:"Id"`
	Name                      string                   `json:"Name"`
	Description               string                   `json:"Description"`
	IsDefault                 bool                     `json:"IsDefault"`
	MachineHealthCheckPolicy  MachineHealthCheckPolicy `json:"MachineHealthCheckPolicy"`
	MachineConnectivityPolicy map[string]string        `json:"MachineConnectivityPolicy"`
	MachineCleanupPolicy      map[string]string        `json:"MachineCleanupPolicy"`
	MachineUpdatePolicymap    map[string]string        `json:"MachineUpdatePolicymap"`
	LastModifiedOn            *string                  `json:"LastModifiedOn,omitempty"`
	LastModifiedBy            *string                  `json:"LastModifiedBy,omitempty"`
}

type MachinePolicyService

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

func NewMachinePolicyService

func NewMachinePolicyService(sling *sling.Sling) *MachinePolicyService

func (*MachinePolicyService) Get

func (s *MachinePolicyService) Get(MachinePolicyID string) (*MachinePolicy, error)

Get returns a single machine with a given MachineID

func (*MachinePolicyService) GetAll

func (s *MachinePolicyService) GetAll() (*[]MachinePolicy, error)

GetAll returns all registered machines

type MachineService

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

func NewMachineService

func NewMachineService(sling *sling.Sling) *MachineService

func (*MachineService) Add

func (s *MachineService) Add(machine *Machine) (*Machine, error)

Add creates a new machine in Octopus Deploy

func (*MachineService) Delete

func (s *MachineService) Delete(MachineID string) error

Delete deletes an existing machine in Octopus Deploy

func (*MachineService) Get

func (s *MachineService) Get(MachineID string) (*Machine, error)

Get returns a single machine with a given MachineID

func (*MachineService) GetAll

func (s *MachineService) GetAll() (*[]Machine, error)

GetAll returns all registered machines

func (*MachineService) Update

func (s *MachineService) Update(machine *Machine) (*Machine, error)

Delete updates an existing machine in Octopus Deploy

type MachineTentacleVersionDetails

type MachineTentacleVersionDetails struct {
	UpgradeLocked    bool   `json:"UpgradeLocked"`
	Version          string `json:"Version"`
	UpgradeSuggested bool   `json:"UpgradeSuggested"`
	UpgradeRequired  bool   `json:"UpgradeRequired"`
}

type Machines

type Machines struct {
	Items []Machine `json:"Items"`
	PagedResults
}

type PackageReference

type PackageReference struct {
	ID                  string            `json:"Id,omitempty"`
	Name                string            `json:"Name,omitempty"`
	PackageId           string            `json:"PackageId,omitempty"`
	FeedId              string            `json:"FeedId"`
	AcquisitionLocation string            `json:"AcquisitionLocation"` // This can be an expression
	Properties          map[string]string `json:"Properties"`
}

type PagedResults

type PagedResults struct {
	ItemType       string `json:"ItemType"`
	TotalResults   int    `json:"TotalResults"`
	NumberOfPages  int    `json:"NumberOfPages"`
	LastPageNumber int    `json:"LastPageNumber"`
	ItemsPerPage   int    `json:"ItemsPerPage"`
	IsStale        bool   `json:"IsStale"`
	Links          Links  `json:"Links"`
}

type Phase

type Phase struct {
	ID                                 string           `json:"Id,omitempty"`
	Name                               string           `json:"Name" validate:"required"`
	MinimumEnvironmentsBeforePromotion int32            `json:"MinimumEnvironmentsBeforePromotion"`
	IsOptionalPhase                    bool             `json:"IsOptionalPhase"`
	ReleaseRetentionPolicy             *RetentionPeriod `json:"ReleaseRetentionPolicy"`
	TentacleRetentionPolicy            *RetentionPeriod `json:"TentacleRetentionPolicy"`
	AutomaticDeploymentTargets         []string         `json:"AutomaticDeploymentTargets"`
	OptionalDeploymentTargets          []string         `json:"OptionalDeploymentTargets"`
}

type Project

type Project struct {
	AutoCreateRelease               bool                        `json:"AutoCreateRelease"`
	AutoDeployReleaseOverrides      []AutoDeployReleaseOverride `json:"AutoDeployReleaseOverrides"`
	DefaultGuidedFailureMode        string                      `json:"DefaultGuidedFailureMode,omitempty"`
	DefaultToSkipIfAlreadyInstalled bool                        `json:"DefaultToSkipIfAlreadyInstalled"`
	DeploymentProcessID             string                      `json:"DeploymentProcessId"`
	Description                     string                      `json:"Description"`
	DiscreteChannelRelease          bool                        `json:"DiscreteChannelRelease"`
	ID                              string                      `json:"Id,omitempty"`
	IncludedLibraryVariableSetIds   []string                    `json:"IncludedLibraryVariableSetIds"`
	IsDisabled                      bool                        `json:"IsDisabled"`
	LifecycleID                     string                      `json:"LifecycleId"`
	Name                            string                      `json:"Name"`
	ProjectConnectivityPolicy       ProjectConnectivityPolicy   `json:"ProjectConnectivityPolicy"`
	ProjectGroupID                  string                      `json:"ProjectGroupId"`
	ReleaseCreationStrategy         ReleaseCreationStrategy     `json:"ReleaseCreationStrategy"`
	Slug                            string                      `json:"Slug"`
	Templates                       []ActionTemplateParameter   `json:"Templates,omitempty"`
	TenantedDeploymentMode          string                      `json:"TenantedDeploymentMode,omitempty"`
	VariableSetID                   string                      `json:"VariableSetId"`
	VersioningStrategy              VersioningStrategy          `json:"VersioningStrategy"`
}

func NewProject

func NewProject(name, lifeCycleID, projectGroupID string) *Project

type ProjectConnectivityPolicy

type ProjectConnectivityPolicy struct {
	AllowDeploymentsToNoTargets bool     `json:"AllowDeploymentsToNoTargets,omitempty"`
	TargetRoles                 []string `json:"TargetRoles,omitempty"`
	SkipMachineBehavior         string   `json:"SkipMachineBehavior,omitempty"`
}

type ProjectGroup

type ProjectGroup struct {
	Description       string   `json:"Description,omitempty"`
	EnvironmentIds    []string `json:"EnvironmentIds"`
	ID                string   `json:"Id,omitempty"`
	LastModifiedBy    string   `json:"LastModifiedBy,omitempty"`
	LastModifiedOn    string   `json:"LastModifiedOn,omitempty"`
	Links             Links    `json:"Links,omitempty"`
	Name              string   `json:"Name,omitempty" validate:"required"`
	RetentionPolicyID string   `json:"RetentionPolicyId,omitempty"`
}

func NewProjectGroup

func NewProjectGroup(name string) *ProjectGroup

func (*ProjectGroup) Validate

func (p *ProjectGroup) Validate() error

type ProjectGroupService

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

func NewProjectGroupService

func NewProjectGroupService(sling *sling.Sling) *ProjectGroupService

func (*ProjectGroupService) Add

func (s *ProjectGroupService) Add(projectGroup *ProjectGroup) (*ProjectGroup, error)

func (*ProjectGroupService) Delete

func (s *ProjectGroupService) Delete(projectGroupID string) error

func (*ProjectGroupService) Get

func (s *ProjectGroupService) Get(projectGroupID string) (*ProjectGroup, error)

func (*ProjectGroupService) GetAll

func (s *ProjectGroupService) GetAll() (*[]ProjectGroup, error)

func (*ProjectGroupService) Update

func (s *ProjectGroupService) Update(projectGroup *ProjectGroup) (*ProjectGroup, error)

type ProjectGroups

type ProjectGroups struct {
	Items []ProjectGroup `json:"Items"`
	PagedResults
}

type ProjectService

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

func NewProjectService

func NewProjectService(sling *sling.Sling) *ProjectService

func (*ProjectService) Add

func (s *ProjectService) Add(project *Project) (*Project, error)

Add adds an new project in Octopus Deploy

func (*ProjectService) Delete

func (s *ProjectService) Delete(projectid string) error

Delete deletes an existing project in Octopus Deploy

func (*ProjectService) Get

func (s *ProjectService) Get(projectid string) (*Project, error)

Get returns a single project by its projectid in Octopus Deploy

func (*ProjectService) GetAll

func (s *ProjectService) GetAll() (*[]Project, error)

GetAll returns all projects in Octopus Deploy

func (*ProjectService) GetByName

func (s *ProjectService) GetByName(projectName string) (*Project, error)

GetByName gets an existing project by its project name in Octopus Deploy

func (*ProjectService) Update

func (s *ProjectService) Update(project *Project) (*Project, error)

Update updates an existing project in Octopus Deploy

type ProjectTrigger

type ProjectTrigger struct {
	Action     ProjectTriggerAction `json:"Action"`
	Filter     ProjectTriggerFilter `json:"Filter"`
	ID         string               `json:"Id,omitempty"`
	IsDisabled bool                 `json:"IsDisabled,omitempty"`
	Name       string               `json:"Name"`
	ProjectID  string               `json:"ProjectId,omitempty"`
}

func NewProjectDeploymentTargetTrigger

func NewProjectDeploymentTargetTrigger(name, projectID string, shouldRedeploy bool, roles, eventGroups, eventCategories []string) *ProjectTrigger

func (*ProjectTrigger) AddEventCategories

func (t *ProjectTrigger) AddEventCategories(eventCategories []string)

func (*ProjectTrigger) AddEventGroups

func (t *ProjectTrigger) AddEventGroups(eventGroups []string)

type ProjectTriggerAction

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

type ProjectTriggerFilter

type ProjectTriggerFilter struct {
	DateOfMonth         string   `json:"DateOfMonth"`
	DayNumberOfMonth    string   `json:"DayNumberOfMonth"`
	DayOfWeek           string   `json:"DayOfWeek"`
	EnvironmentIds      []string `json:"EnvironmentIds,omitempty"`
	EventCategories     []string `json:"EventCategories,omitempty"`
	EventGroups         []string `json:"EventGroups,omitempty"`
	FilterType          string   `json:"FilterType"`
	MonthlyScheduleType string   `json:"MonthlyScheduleType"`
	Roles               []string `json:"Roles"`
	StartTime           string   `json:"StartTime"`
	Timezone            string   `json:"Timezone"`
}

type ProjectTriggerService

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

func NewProjectTriggerService

func NewProjectTriggerService(sling *sling.Sling) *ProjectTriggerService

func (*ProjectTriggerService) Add

func (s *ProjectTriggerService) Add(projectTrigger *ProjectTrigger) (*ProjectTrigger, error)

func (*ProjectTriggerService) Delete

func (s *ProjectTriggerService) Delete(projectTriggerID string) error

func (*ProjectTriggerService) Get

func (s *ProjectTriggerService) Get(projectTriggerID string) (*ProjectTrigger, error)

func (*ProjectTriggerService) GetAll

func (s *ProjectTriggerService) GetAll() (*[]ProjectTrigger, error)

func (*ProjectTriggerService) GetByProjectID

func (s *ProjectTriggerService) GetByProjectID(projectID string) (*[]ProjectTrigger, error)

func (*ProjectTriggerService) Update

func (s *ProjectTriggerService) Update(projectTrigger *ProjectTrigger) (*ProjectTrigger, error)

type ProjectTriggers

type ProjectTriggers struct {
	Items []ProjectTrigger `json:"Items"`
	PagedResults
}

type Projects

type Projects struct {
	Items []Project `json:"Items"`
	PagedResults
}

type PropertyValue

type PropertyValue string

type ReleaseCreationStrategy

type ReleaseCreationStrategy struct {
	ReleaseCreationPackageStepID string `json:"ReleaseCreationPackageStepId"`
	ChannelID                    string `json:"ChannelId"`
}

type RetentionPeriod

type RetentionPeriod struct {
	Unit              RetentionUnit `json:"Unit"`
	QuantityToKeep    int32         `json:"QuantityToKeep"`
	ShouldKeepForever bool          `json:"ShouldKeepForever"`
}

type RetentionUnit

type RetentionUnit string

type ScopeValue

type ScopeValue struct {
	ID   string `json:"Id"`
	Name string `json:"Name"`
}

type ScopeValues

type ScopeValues struct {
	Environments []ScopeValue `json:"Environments"`
	Machines     []ScopeValue `json:"Machines"`
	Actions      []ScopeValue `json:"Actions"`
	Roles        []ScopeValue `json:"Roles"`
	Channels     []ScopeValue `json:"Channels"`
	TenantTags   []ScopeValue `json:"TenantTags"`
}

type SensitivePropertyValue

type SensitivePropertyValue struct {
	HasValue bool   `json:"HasValue"`
	NewValue string `json:"NewValue"`
}

type User

type User struct {
	ID                  string `json:"Id"`
	Username            string `json:"Username"`
	DisplayName         string `json:"DisplayName"`
	IsActive            bool   `json:"IsActive"`
	IsService           bool   `json:"IsService"`
	EmailAddress        string `json:"EmailAddress"`
	CanPasswordBeEdited bool   `json:"CanPasswordBeEdited"`
	IsRequestor         bool   `json:"IsRequestor"`
	Links               struct {
		Self        string `json:"Self"`
		Permissions string `json:"Permissions"`
		APIKeys     string `json:"ApiKeys"`
		Avatar      string `json:"Avatar"`
	} `json:"Links"`
}

type Variable

type Variable struct {
	ID          string                 `json:"Id"`
	Name        string                 `json:"Name"`
	Value       string                 `json:"Value"`
	Description string                 `json:"Description"`
	Scope       *VariableScope         `json:"Scope,omitempty"`
	IsEditable  bool                   `json:"IsEditable"`
	Prompt      *VariablePromptOptions `json:"Prompt"`
	Type        string                 `json:"Type"`
	IsSensitive bool                   `json:"IsSensitive"`
}

func NewVariable

func NewVariable(name, valuetype, value, description string, scope *VariableScope, sensitive bool) *Variable

func (*Variable) Validate

func (t *Variable) Validate() error

type VariablePromptOptions

type VariablePromptOptions struct {
	Label       string `json:"Label"`
	Description string `json:"Description"`
	Required    bool   `json:"Required"`
}

type VariableScope

type VariableScope struct {
	Project     []string `json:"Project,omitempty"`
	Environment []string `json:"Environment,omitempty"`
	Machine     []string `json:"Machine,omitempty"`
	Role        []string `json:"Role,omitempty"`
	TargetRole  []string `json:"TargetRole,omitempty"`
	Action      []string `json:"Action,omitempty"`
	User        []string `json:"User,omitempty"`
	Private     []string `json:"Private,omitempty"`
	Channel     []string `json:"Channel,omitempty"`
	TenantTag   []string `json:"TenantTag,omitempty"`
	Tenant      []string `json:"Tenant,omitempty"`
}

type VariableService

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

func NewVariableService

func NewVariableService(sling *sling.Sling) *VariableService

func (*VariableService) AddSingle

func (s *VariableService) AddSingle(projectid string, variable *Variable) (*Variables, error)

AddSingle adds a single variable to a project ID. This automates the act of fetching the variable set, adding a new item to it, and posting back to Octopus

func (*VariableService) DeleteSingle

func (s *VariableService) DeleteSingle(projectid string, variableID string) (*Variables, error)

DeleteSingle removes a single variable from a project ID. This automates the act of fetching the variable set, removing the existing item, and posting back to Octopus

func (*VariableService) GetAll

func (s *VariableService) GetAll(projectid string) (*Variables, error)

GetAll fetches an entire VariableSet from Octopus Deploy for a given Project ID.

func (*VariableService) GetByID

func (s *VariableService) GetByID(projectid, variableid string) (*Variable, error)

GetByID fetches a single variable, located by its ID, from Octopus Deploy for a given Project ID.

func (*VariableService) GetByName

func (s *VariableService) GetByName(projectid, variablename string, scope *VariableScope) ([]Variable, error)

GetByName fetches variables, located by their name, from Octopus Deploy for a given Project ID. As variable names can appear more than once under different scopes, a VariableScope must also be provided, which will be used to locate the appropriate variables.

func (*VariableService) MatchesScope

func (s *VariableService) MatchesScope(variableScope, definedScope *VariableScope) (bool, *VariableScope, error)

MatchesScope compares two different scopes to see if they match. Generally used for comparing the scope of an existing variable against a desired state. Only supports Environment, Role, Machine, Action and Channel for scope options. Returns true if definedScope is nil or all elements are empty. Also returns a VariableScope of all the scopes that were matched

func (*VariableService) Update

func (s *VariableService) Update(projectid string, variableSet *Variables) (*Variables, error)

Update takes an entire variable set and posts the entire set back to Octopus Deploy. There are individual functions like AddSingle and UpdateSingle that can make this process more of a "typical" CRUD Octopus command.

func (*VariableService) UpdateSingle

func (s *VariableService) UpdateSingle(projectid string, variable *Variable) (*Variables, error)

UpdateSingle adds a single variable to a project ID. This automates the act of fetching the variable set, updating the existing item, and posting back to Octopus

type VariableSetContentType

type VariableSetContentType string

type Variables

type Variables struct {
	ID          string      `json:"Id"`
	OwnerID     string      `json:"OwnerId"`
	Version     int         `json:"Version"`
	Variables   []Variable  `json:"Variables"`
	ScopeValues ScopeValues `json:"ScopeValues"`
	Links       map[string]string
}

type VersioningStrategy

type VersioningStrategy struct {
	DonorPackageStepID string `json:"DonorPackageStepId"`
	Template           string `json:"Template"`
}

Jump to

Keyboard shortcuts

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