Documentation
¶
Index ¶
- Constants
- Variables
- func APIErrorChecker(urlPath string, resp *http.Response, wantedResponseCode int, slingError error, ...) error
- func LoadNextPage(pagedResults PagedResults) (string, bool)
- type APIError
- type ActionTemplateParameter
- type AutoDeployReleaseOverride
- type Client
- type DeploymentAction
- type DeploymentItem
- type DeploymentProcess
- type DeploymentProcessService
- type DeploymentProcesses
- type DeploymentService
- type DeploymentStep
- type DeploymentStepCondition
- type DeploymentStepPackageRequirement
- type DeploymentStepStartTrigger
- type Deployments
- type Environment
- type EnvironmentService
- func (s *EnvironmentService) Add(environment *Environment) (*Environment, error)
- func (s *EnvironmentService) Delete(environmentid string) error
- func (s *EnvironmentService) Get(environmentid string) (*Environment, error)
- func (s *EnvironmentService) GetAll() (*[]Environment, error)
- func (s *EnvironmentService) GetByName(environmentName string) (*Environment, error)
- func (s *EnvironmentService) Update(environment *Environment) (*Environment, error)
- type Environments
- type Interruption
- type InterruptionLinks
- type InterruptionSubmitRequest
- type Interruptions
- type InterruptionsService
- func (s *InterruptionsService) Get(id string) (*Interruption, error)
- func (s *InterruptionsService) GetAll() ([]Interruption, error)
- func (s *InterruptionsService) GetResponsability(i *Interruption) (*User, error)
- func (s *InterruptionsService) Submit(i *Interruption, r *InterruptionSubmitRequest) (*Interruption, error)
- func (s *InterruptionsService) TakeResponsability(i *Interruption) (*User, error)
- type LibraryVariable
- type LibraryVariableSet
- type LibraryVariableSetService
- func (s *LibraryVariableSetService) Add(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) Delete(libraryVariableSetid string) error
- func (s *LibraryVariableSetService) Get(libraryVariableSetID string) (*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) GetAll() (*[]LibraryVariableSet, error)
- func (s *LibraryVariableSetService) GetByName(name string) (*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) Update(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
- type LibraryVariableSets
- type Lifecycle
- type LifecycleService
- func (s *LifecycleService) Add(lifecycle *Lifecycle) (*Lifecycle, error)
- func (s *LifecycleService) Delete(lifecycleid string) error
- func (s *LifecycleService) Get(LifecycleID string) (*Lifecycle, error)
- func (s *LifecycleService) GetAll() (*[]Lifecycle, error)
- func (s *LifecycleService) GetByName(lifecycleName string) (*Lifecycle, error)
- func (s *LifecycleService) Update(lifecycle *Lifecycle) (*Lifecycle, error)
- type Lifecycles
- type Links
- type Machine
- type MachineEndpoint
- type MachineHealthCheckPolicy
- type MachinePolicies
- type MachinePolicy
- type MachinePolicyService
- type MachineService
- func (s *MachineService) Add(machine *Machine) (*Machine, error)
- func (s *MachineService) Delete(MachineID string) error
- func (s *MachineService) Get(MachineID string) (*Machine, error)
- func (s *MachineService) GetAll() (*[]Machine, error)
- func (s *MachineService) Update(machine *Machine) (*Machine, error)
- type MachineTentacleVersionDetails
- type Machines
- type PackageReference
- type PagedResults
- type Phase
- type Project
- type ProjectConnectivityPolicy
- type ProjectGroup
- type ProjectGroupService
- func (s *ProjectGroupService) Add(projectGroup *ProjectGroup) (*ProjectGroup, error)
- func (s *ProjectGroupService) Delete(projectGroupID string) error
- func (s *ProjectGroupService) Get(projectGroupID string) (*ProjectGroup, error)
- func (s *ProjectGroupService) GetAll() (*[]ProjectGroup, error)
- func (s *ProjectGroupService) Update(projectGroup *ProjectGroup) (*ProjectGroup, error)
- type ProjectGroups
- type ProjectService
- func (s *ProjectService) Add(project *Project) (*Project, error)
- func (s *ProjectService) Delete(projectid string) error
- func (s *ProjectService) Get(projectid string) (*Project, error)
- func (s *ProjectService) GetAll() (*[]Project, error)
- func (s *ProjectService) GetByName(projectName string) (*Project, error)
- func (s *ProjectService) Update(project *Project) (*Project, error)
- type ProjectTrigger
- type ProjectTriggerAction
- type ProjectTriggerFilter
- type ProjectTriggerService
- func (s *ProjectTriggerService) Add(projectTrigger *ProjectTrigger) (*ProjectTrigger, error)
- func (s *ProjectTriggerService) Delete(projectTriggerID string) error
- func (s *ProjectTriggerService) Get(projectTriggerID string) (*ProjectTrigger, error)
- func (s *ProjectTriggerService) GetAll() (*[]ProjectTrigger, error)
- func (s *ProjectTriggerService) GetByProjectID(projectID string) (*[]ProjectTrigger, error)
- func (s *ProjectTriggerService) Update(projectTrigger *ProjectTrigger) (*ProjectTrigger, error)
- type ProjectTriggers
- type ProjectVariable
- type Projects
- type PropertyValue
- type ReleaseCreationStrategy
- type RetentionPeriod
- type RetentionUnit
- type ScopeValue
- type ScopeValues
- type SensitiveValue
- type Tenant
- type TenantService
- type TenantVariableService
- type TenantVariables
- type Tenants
- type User
- type Variable
- type VariablePromptOptions
- type VariableScope
- type VariableService
- func (s *VariableService) AddSingle(projectid string, variable *Variable) (*Variables, error)
- func (s *VariableService) DeleteSingle(projectid string, variableID string) (*Variables, error)
- func (s *VariableService) GetAll(projectid string) (*Variables, error)
- func (s *VariableService) GetByID(projectid, variableid string) (*Variable, error)
- func (s *VariableService) GetByName(projectid, variablename string, scope *VariableScope) ([]Variable, error)
- func (s *VariableService) GetVariableSet(variableSetID string) (*Variables, error)
- func (s *VariableService) MatchesScope(variableScope, definedScope *VariableScope) (bool, *VariableScope, error)
- func (s *VariableService) Update(projectid string, variableSet *Variables) (*Variables, error)
- func (s *VariableService) UpdateSingle(projectid string, variable *Variable) (*Variables, error)
- type VariableSetContentType
- type Variables
- type VersioningStrategy
Constants ¶
const ( DeploymentStepPackageRequirement_LetOctopusDecide = DeploymentStepPackageRequirement("LetOctopusDecide") DeploymentStepPackageRequirement_BeforePackageAcquisition = DeploymentStepPackageRequirement("BeforePackageAcquisition") DeploymentStepPackageRequirement_AfterPackageAcquisition = DeploymentStepPackageRequirement("AfterPackageAcquisition") )
const ( DeploymentStepCondition_Success = DeploymentStepCondition("Success") DeploymentStepCondition_Failure = DeploymentStepCondition("Failure") DeploymentStepCondition_Always = DeploymentStepCondition("Always") DeploymentStepCondition_Variable = DeploymentStepCondition("Variable") )
const ( DeploymentStepStartTrigger_StartAfterPrevious = DeploymentStepStartTrigger("StartAfterPrevious") DeploymentStepStartTrigger_StartWithPrevious = DeploymentStepStartTrigger("StartWithPrevious") )
const ( PackageAcquisitionLocation_Server = "Server" PackageAcquisitionLocation_ExecutionTarget = "ExecutionTarget" PackageAcquisitionLocation_NotAcquired = "NotAcquired" )
const ( VariableSetContentType_Variables = VariableSetContentType("Variables") VariableSetContentType_ScriptModule = VariableSetContentType("ScriptModule") )
const ( RetentionUnit_Days = RetentionUnit("Days") RetentionUnit_Items = RetentionUnit("Items") )
const ManualInterventionDecline = "Abort"
const ManualInterverventionApprove = "Proceed"
Variables ¶
var ErrItemNotFound = errors.New("cannot find the item")
ErrItemNotFound is an OctopusDeploy error returned an item cannot be found.
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.
Types ¶
type APIError ¶
type ActionTemplateParameter ¶
type ActionTemplateParameter struct {
DefaultValue PropertyValue `json:"DefaultValue,omitempty"`
DisplaySettings map[string]string `json:"DisplaySettings,omitempty"`
HelpText string `json:"HelpText,omitempty"`
ID string `json:"Id,omitempty"`
Label string `json:"Label,omitempty"`
LastModifiedBy string `json:"LastModifiedBy,omitempty"`
LastModifiedOn string `json:"LastModifiedOn,omitempty"`
Links Links `json:"Links,omitempty"`
Name string `json:"Name,omitempty"`
}
type Client ¶
type Client struct {
// Octopus Deploy API Services
DeploymentProcess *DeploymentProcessService
Deployment *DeploymentService
ProjectGroup *ProjectGroupService
Project *ProjectService
ProjectTrigger *ProjectTriggerService
Environment *EnvironmentService
Variable *VariableService
MachinePolicy *MachinePolicyService
Machine *MachineService
Lifecycle *LifecycleService
LibraryVariableSet *LibraryVariableSetService
Interruption *InterruptionsService
Tenant *TenantService
TenantVariable *TenantVariableService
// contains filtered or unexported fields
}
Client is an OctopusDeploy for making OctpusDeploy API requests.
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 DeploymentItem ¶
type DeploymentItem struct {
ID string `json:"Id"`
RealeaseID string `json:"ReleaseId"`
EnvironmentID string `json:"EnvironmentId"`
TenantID string `json:"TenantId"`
ForcePackageDownload bool `json:"ForcePackageDownload"`
ForcePackageRedeployment bool `json:"ForcePackageRedeployment"`
SkipActions []string `json:"SkipActions"`
SpecificMachineIds []string `json:"SpecificMachineIds"`
ExcludedMachineIds []string `json:"ExcludedMachineIds"`
DeploymentProcessID string `json:"DeploymentProcessId"`
ManifestVariableSetID string `json:"ManifestVariableSetId"`
TaskID string `json:"TaskId"`
ProjectID string `json:"ProjectId"`
ChannelID string `json:"ChannelId"`
UseGuidedFailure bool `json:"UseGuidedFailure"`
Comments string `json:"Comments"`
FormValues map[string]string `json:"FormValues"`
QueueTime time.Time `json:"QueueTime"`
QueueTimeExpiry time.Time `json:"QueueTimeExpiry"`
Name string `json:"Name"`
LastModifiedOn time.Time `json:"LastModifiedOn,omitempty"`
LastModifiedBy time.Time `json:"LastModifiedBy,omitempty"`
Links map[string]string `json:"Links,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"`
}
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 (s *DeploymentProcessService) GetAll() (*[]DeploymentProcess, error)
func (*DeploymentProcessService) Update ¶
func (s *DeploymentProcessService) Update(deploymentProcess *DeploymentProcess) (*DeploymentProcess, error)
type DeploymentProcesses ¶
type DeploymentProcesses struct {
Items []DeploymentProcess `json:"Items"`
PagedResults
}
type DeploymentService ¶
type DeploymentService struct {
// contains filtered or unexported fields
}
func NewDeploymentService ¶
func NewDeploymentService(sling *sling.Sling) *DeploymentService
func (*DeploymentService) All ¶
func (s *DeploymentService) All() (*Deployments, error)
func (*DeploymentService) FindLatestForTenant ¶
func (s *DeploymentService) FindLatestForTenant(tenantID string, terminateAt ...int) (*DeploymentItem, error)
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"` // variable option adds a Property "Octopus.Action.ConditionVariableExpression"
StartTrigger DeploymentStepStartTrigger `json:"StartTrigger,omitempty"`
Actions []DeploymentAction `json:"Actions,omitempty"`
}
type DeploymentStepCondition ¶
type DeploymentStepCondition string
type DeploymentStepPackageRequirement ¶
type DeploymentStepPackageRequirement string
type DeploymentStepStartTrigger ¶
type DeploymentStepStartTrigger string
type Deployments ¶
type Deployments struct {
ID string `json:"Id"`
ItemType string `json:"ItemType"`
TotalResults int64 `json:"TotalResults"`
ItemsPerPage int64 `json:"ItemsPerPage"`
NumberOfPages int64 `json:"NumberOfPages"`
LastPageNumber int64 `json:"LastPageNumber"`
Items []DeploymentItem `json:"Items"`
TenantID string `json:"TenantId"`
LastModifiedOn string `json:"LastModifiedOn,omitempty"`
LastModifiedBy string `json:"LastModifiedBy,omitempty"`
Links map[string]string `json:"Links,omitempty"`
}
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
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 ¶
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 ¶
func (s *InterruptionsService) Get(id string) (*Interruption, error)
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 ¶
func (s *InterruptionsService) Submit(i *Interruption, r *InterruptionSubmitRequest) (*Interruption, error)
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 LibraryVariable ¶
type LibraryVariable struct {
LibraryVariableSetID string `json:"LibraryVariableSetId"`
LibraryVariableSetName string `json:"LibraryVariableSetName"`
Templates []ActionTemplateParameter `json:"Templates"`
Variables map[string]PropertyValue `json:"Variables"`
Links map[string]string `json:"Links"`
}
type LibraryVariableSet ¶
type LibraryVariableSet struct {
ID string `json:"Id,omitempty"`
Name string `json:"Name"`
Description string `json:"Description,omitempty"`
VariableSetId string `json:"VariableSetId,omitempty"`
ContentType VariableSetContentType `json:"ContentType"`
}
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 ¶
func (s *LibraryVariableSetService) GetAll() (*[]LibraryVariableSet, error)
GetAll returns all libraryVariableSets in Octopus Deploy
func (*LibraryVariableSetService) GetByName ¶
func (s *LibraryVariableSetService) GetByName(name string) (*LibraryVariableSet, error)
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"`
Description string `json:"Description,omitempty"`
ReleaseRetentionPolicy RetentionPeriod `json:"ReleaseRetentionPolicy,omitempty"`
TentacleRetentionPolicy RetentionPeriod `json:"TentacleRetentionPolicy,omitempty"`
Phases []Phase `json:"Phases"`
}
func NewLifecycle ¶
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
type Lifecycles ¶
type Lifecycles struct {
Items []Lifecycle `json:"Items"`
PagedResults
}
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"`
}
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 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
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 Phase ¶
type Phase struct {
ID string `json:"Id,omitempty"`
Name string `json:"Name"`
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 ¶
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"`
RetentionPolicyID string `json:"RetentionPolicyId,omitempty"`
}
func NewProjectGroup ¶
func NewProjectGroup(name string) *ProjectGroup
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
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 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 ProjectVariable ¶
type ProjectVariable struct {
ProjectID string `json:"ProjectId"`
ProjectName string `json:"ProjectName"`
Templates []ActionTemplateParameter `json:"Templates"`
Variables map[string]map[string]PropertyValue `json:"Variables"`
Links map[string]string `json:"Links"`
}
type Projects ¶
type Projects struct {
Items []Project `json:"Items"`
PagedResults
}
type PropertyValue ¶
type PropertyValue struct {
IsSensitive bool `json:"IsSensitive,omitempty"`
Value string `json:"Value,omitempty"`
SensitiveValue SensitiveValue `json:"SensitiveValue,omitempty"`
}
func (*PropertyValue) UnmarshalJSON ¶
func (propertyValue *PropertyValue) UnmarshalJSON(b []byte) error
type ReleaseCreationStrategy ¶
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 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 SensitiveValue ¶
type Tenant ¶
type Tenant struct {
ID string `json:"Id"`
Name string `json:"Name"`
TenantTags []string `json:"TenantTags"`
ProjectEnvironments map[string][]string `json:"ProjectEnvironments"`
SpaceID string `json:"SpaceId"`
LastModifiedOn *time.Time `json:"LastModifiedOn,omitempty"`
LastModifiedBy *time.Time `json:"LastModifiedBy,omitempty"`
Links map[string]string `json:"Links"`
}
type TenantService ¶
type TenantService struct {
// contains filtered or unexported fields
}
func NewTenantService ¶
func NewTenantService(sling *sling.Sling) *TenantService
func (*TenantService) Get ¶
func (s *TenantService) Get(TenantID string) (*Tenant, error)
Get returns a single machine with a given MachineID
func (*TenantService) GetAll ¶
func (s *TenantService) GetAll() (*[]Tenant, error)
GetAll returns all registered machines
type TenantVariableService ¶
type TenantVariableService struct {
// contains filtered or unexported fields
}
func NewTenantVariableService ¶
func NewTenantVariableService(sling *sling.Sling) *TenantVariableService
func (*TenantVariableService) GetTenant ¶
func (s *TenantVariableService) GetTenant(tenantID string) (*TenantVariables, error)
type TenantVariables ¶
type TenantVariables struct {
ID string `json:"Id"`
TenantID string `json:"TenantId"`
TenantName string `json:"TenantName"`
ProjectVariables map[string]ProjectVariable `json:"ProjectVariables"`
LibraryVariables map[string]LibraryVariable `json:"LibraryVariables"`
SpaceID string `json:"SpaceId"`
LastModifiedOn string `json:"LastModifiedOn,omitempty"`
Links map[string]string `json:"Links,omitempty"`
}
type Tenants ¶
type Tenants struct {
Items []Tenant `json:"Items"`
PagedResults
}
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
type VariablePromptOptions ¶
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) GetVariableSet ¶
func (s *VariableService) GetVariableSet(variableSetID string) (*Variables, error)
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 VersioningStrategy ¶
Source Files
¶
- action_template_parameter.go
- auto_deploy_release_override.go
- common_models.go
- deployment_process.go
- deployments.go
- environment.go
- interruptions.go
- library_variable_set.go
- lifecycles.go
- machinepolicy.go
- machines.go
- octopusdeploy.go
- project.go
- project_connectivity_policy.go
- project_group.go
- project_triggers.go
- release_creation_strategy.go
- tenant_variable.go
- tenants.go
- variables.go
- versioning_strategy.go