Documentation ¶
Index ¶
- Constants
- func IsNil(i interface{}) bool
- func ValidateLibraryVariableSetValues(LibraryVariableSet *LibraryVariableSet) error
- type ControlType
- type DisplaySettings
- type Library
- type LibraryVariable
- type LibraryVariableSet
- type LibraryVariableSetService
- func (s *LibraryVariableSetService) Add(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) Get(libraryVariablesQuery LibraryVariablesQuery) (*resources.Resources[*LibraryVariableSet], error)
- func (s *LibraryVariableSetService) GetAll() ([]*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) GetByID(id string) (*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) GetByPartialName(partialName string) ([]*LibraryVariableSet, error)
- func (s *LibraryVariableSetService) Update(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
- type LibraryVariableSetUsageEntry
- type LibraryVariablesQuery
- type MissingVariable
- type MissingVariablesQuery
- type ProjectVariable
- type ProjectVariableSetUsage
- type ScriptModule
- type ScriptModuleService
- func (s *ScriptModuleService) Add(scriptModule *ScriptModule) (*ScriptModule, error)
- func (s *ScriptModuleService) Get(libraryVariablesQuery LibraryVariablesQuery) (*resources.Resources[*ScriptModule], error)
- func (s *ScriptModuleService) GetAll() (*resources.Resources[*ScriptModule], error)
- func (s *ScriptModuleService) GetByID(id string) (*ScriptModule, error)
- func (s *ScriptModuleService) GetByPartialName(partialName string) ([]*ScriptModule, error)
- func (s *ScriptModuleService) Update(scriptModule *ScriptModule) (*ScriptModule, error)
- type SelectOption
- type TenantVariableService
- type TenantVariables
- type TenantsMissingVariables
- type Variable
- type VariableNamesQuery
- type VariablePreviewQuery
- type VariablePromptOptions
- type VariableScope
- type VariableScopeValues
- type VariableService
- func (s *VariableService) AddSingle(ownerID string, variable *Variable) (VariableSet, error)
- func (s *VariableService) DeleteSingle(ownerID string, variableID string) (VariableSet, error)
- func (s *VariableService) GetAll(ownerID string) (VariableSet, error)
- func (s *VariableService) GetByID(ownerID string, variableID string) (*Variable, error)
- func (s *VariableService) GetByName(ownerID string, name string, scope *VariableScope) ([]*Variable, error)
- func (s *VariableService) MatchesScope(variableScope VariableScope, definedScope *VariableScope) (bool, *VariableScope, error)
- func (s *VariableService) Update(ownerID string, variableSet VariableSet) (VariableSet, error)
- func (s *VariableService) UpdateSingle(ownerID string, variable *Variable) (VariableSet, error)
- type VariableSet
- type VariablesQuery
Constants ¶
const ( ControlTypeSingleLineText = ControlType("SingleLineText") ControlTypeMultiLineText = ControlType("MultiLineText") ControlTypeSelect = ControlType("Select") ControlTypeCheckbox = ControlType("Checkbox") ControlTypeSensitive = ControlType("Sensitive") ControlTypeStepName = ControlType("StepName") ControlTypeCertificate = ControlType("Certificate") ControlTypeWorkerPool = ControlType("WorkerPool") ControlTypeAzureAccount = ControlType("AzureAccount") ControlTypeGoogleCloudAccount = ControlType("GoogleCloudAccount") ControlTypeAwsAccount = ControlType("AmazonWebServicesAccount") )
Variables ¶
This section is empty.
Functions ¶
func ValidateLibraryVariableSetValues ¶
func ValidateLibraryVariableSetValues(LibraryVariableSet *LibraryVariableSet) error
ValidateLibraryVariableSetValues checks the values of a library variable set to see if they are suitable for sending to Octopus Deploy. Used when adding or updating library variable sets.
Types ¶
type ControlType ¶ added in v2.4.0
type ControlType string
type DisplaySettings ¶
type DisplaySettings struct { ControlType ControlType `json:"Octopus.ControlType"` SelectOptions []*SelectOption `json:"Octopus.SelectOptions,omitempty"` }
func NewDisplaySettings ¶
func NewDisplaySettings(controlType ControlType, selectOptions []*SelectOption) *DisplaySettings
func (*DisplaySettings) MarshalJSON ¶
func (d *DisplaySettings) MarshalJSON() ([]byte, error)
MarshalJSON returns display settings as its JSON encoding.
func (*DisplaySettings) UnmarshalJSON ¶
func (d *DisplaySettings) UnmarshalJSON(b []byte) error
UnmarshalJSON sets display settings from its representation in JSON.
type Library ¶
type Library struct { LibraryVariableSetID string `json:"LibraryVariableSetId,omitempty"` LibraryVariableSetName string `json:"LibraryVariableSetName,omitempty"` Links map[string]string `json:"Links,omitempty"` Templates []*actiontemplates.ActionTemplateParameter `json:"Templates"` Variables map[string]core.PropertyValue `json:"Variables,omitempty"` }
type LibraryVariable ¶
type LibraryVariable struct { LibraryVariableSetID string `json:"LibraryVariableSetId,omitempty"` LibraryVariableSetName string `json:"LibraryVariableSetName,omitempty"` Links map[string]string `json:"Links,omitempty"` Templates []*actiontemplates.ActionTemplateParameter `json:"Templates"` Variables map[string]core.PropertyValue `json:"Variables,omitempty"` }
func NewLibraryVariable ¶
func NewLibraryVariable() *LibraryVariable
type LibraryVariableSet ¶
type LibraryVariableSet struct { ContentType string `json:"ContentType" validate:"required,oneof=ScriptModule Variables"` Description string `json:"Description,omitempty"` Name string `json:"Name" validate:"required"` SpaceID string `json:"SpaceId,omitempty"` Templates []actiontemplates.ActionTemplateParameter `json:"Templates,omitempty"` VariableSetID string `json:"VariableSetId,omitempty"` resources.Resource }
func NewLibraryVariableSet ¶
func NewLibraryVariableSet(name string) *LibraryVariableSet
func (LibraryVariableSet) Validate ¶
func (l LibraryVariableSet) Validate() error
Validate checks the state of the library variable set and returns an error if invalid.
type LibraryVariableSetService ¶
type LibraryVariableSetService struct {
services.CanDeleteService
}
func NewLibraryVariableSetService ¶
func NewLibraryVariableSetService(sling *sling.Sling, uriTemplate string) *LibraryVariableSetService
func (*LibraryVariableSetService) Add ¶
func (s *LibraryVariableSetService) Add(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
Add creates a new library variable set.
func (*LibraryVariableSetService) Get ¶
func (s *LibraryVariableSetService) Get(libraryVariablesQuery LibraryVariablesQuery) (*resources.Resources[*LibraryVariableSet], error)
Get returns a collection of library variable sets 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 (*LibraryVariableSetService) GetAll ¶
func (s *LibraryVariableSetService) GetAll() ([]*LibraryVariableSet, error)
GetAll returns all library variable sets. If none can be found or an error occurs, it returns an empty collection.
func (*LibraryVariableSetService) GetByID ¶
func (s *LibraryVariableSetService) GetByID(id string) (*LibraryVariableSet, error)
GetByID returns the library variable set that matches the input ID. If one cannot be found, it returns nil and an error.
func (*LibraryVariableSetService) GetByPartialName ¶
func (s *LibraryVariableSetService) GetByPartialName(partialName string) ([]*LibraryVariableSet, error)
GetByPartialName performs a lookup and returns a list of library variable sets with a matching partial name.
func (*LibraryVariableSetService) Update ¶
func (s *LibraryVariableSetService) Update(libraryVariableSet *LibraryVariableSet) (*LibraryVariableSet, error)
Update modifies a library variable set based on the one provided as input.
type LibraryVariableSetUsageEntry ¶
type LibraryVariableSetUsageEntry struct { LibraryVariableSetID string `json:"LibraryVariableSetId,omitempty"` LibraryVariableSetName string `json:"LibraryVariableSetName,omitempty"` resources.Resource }
func NewLibraryVariableSetUsageEntry ¶
func NewLibraryVariableSetUsageEntry() *LibraryVariableSetUsageEntry
type LibraryVariablesQuery ¶
type LibraryVariablesQuery struct { ContentType string `uri:"contentType,omitempty" url:"contentType,omitempty"` IDs []string `uri:"ids,omitempty" url:"ids,omitempty"` PartialName string `uri:"partialName,omitempty" url:"partialName,omitempty"` Skip int `uri:"skip,omitempty" url:"skip,omitempty"` Take int `uri:"take,omitempty" url:"take,omitempty"` }
type MissingVariable ¶
type MissingVariable struct { EnvironmentID string `json:"EnvironmentId,omitempty"` LibraryVariableSetID string `json:"LibraryVariableSetId,omitempty"` Links map[string]string `json:"Links,omitempty"` ProjectID string `json:"ProjectId,omitempty"` VariableTemplateID string `json:"VariableTemplateId,omitempty"` VariableTemplateName string `json:"VariableTemplateName,omitempty"` }
type MissingVariablesQuery ¶
type MissingVariablesQuery struct { EnvironmentID string `uri:"environmentId,omitempty" url:"environmentId,omitempty"` IncludeDetails bool `uri:"includeDetails,omitempty" url:"includeDetails,omitempty"` ProjectID string `uri:"projectId,omitempty" url:"projectId,omitempty"` TenantID string `uri:"tenantId,omitempty" url:"tenantId,omitempty"` }
type ProjectVariable ¶
type ProjectVariable struct { Links map[string]string `json:"Links,omitempty"` ProjectID string `json:"ProjectId,omitempty"` ProjectName string `json:"ProjectName,omitempty"` Templates []*actiontemplates.ActionTemplateParameter `json:"Templates"` Variables map[string]map[string]core.PropertyValue `json:"Variables,omitempty"` }
type ProjectVariableSetUsage ¶
type ProjectVariableSetUsage struct { IsCurrentlyBeingUsedInProject bool `json:"IsCurrentlyBeingUsedInProject"` ProjectID string `json:"ProjectId,omitempty"` ProjectName string `json:"ProjectName,omitempty"` ProjectSlug string `json:"ProjectSlug,omitempty"` Releases []*releases.ReleaseUsageEntry `json:"Releases"` RunbookSnapshots []*runbooks.RunbookSnapshotUsageEntry `json:"RunbookSnapshots"` }
type ScriptModule ¶
type ScriptModule struct { Description string `json:"Description,omitempty"` Name string `json:"Name" validate:"required"` ScriptBody string `json:"scriptBody" validate:"required"` SpaceID string `json:"SpaceId,omitempty"` Syntax string `json:"syntax" validate:"required"` VariableSetID string `json:"VariableSetId,omitempty"` resources.Resource }
func NewScriptModule ¶
func NewScriptModule(name string) *ScriptModule
NewScriptModule creates and initializes a script module.
func (*ScriptModule) MarshalJSON ¶
func (s *ScriptModule) MarshalJSON() ([]byte, error)
MarshalJSON returns a script module as its JSON encoding.
func (*ScriptModule) Validate ¶
func (s *ScriptModule) Validate() error
Validate checks the state of the script module and returns an error if invalid.
type ScriptModuleService ¶
type ScriptModuleService struct {
services.CanDeleteService
}
func NewScriptModuleService ¶
func NewScriptModuleService(sling *sling.Sling, uriTemplate string) *ScriptModuleService
func (*ScriptModuleService) Add ¶
func (s *ScriptModuleService) Add(scriptModule *ScriptModule) (*ScriptModule, error)
Add creates a new script module.
func (*ScriptModuleService) Get ¶
func (s *ScriptModuleService) Get(libraryVariablesQuery LibraryVariablesQuery) (*resources.Resources[*ScriptModule], error)
Get returns a collection of script modules 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 (*ScriptModuleService) GetAll ¶
func (s *ScriptModuleService) GetAll() (*resources.Resources[*ScriptModule], error)
GetAll returns all script modules. If none can be found or an error occurs, it returns an empty collection.
func (*ScriptModuleService) GetByID ¶
func (s *ScriptModuleService) GetByID(id string) (*ScriptModule, error)
GetByID returns the script module that matches the input ID. If one cannot be found, it returns nil and an error.
func (*ScriptModuleService) GetByPartialName ¶
func (s *ScriptModuleService) GetByPartialName(partialName string) ([]*ScriptModule, error)
GetByPartialName performs a lookup and returns a list of script modules with a matching partial name.
func (*ScriptModuleService) Update ¶
func (s *ScriptModuleService) Update(scriptModule *ScriptModule) (*ScriptModule, error)
Update modifies a script module based on the one provided as input.
type SelectOption ¶ added in v2.4.0
type TenantVariableService ¶
func NewTenantVariableService ¶
func NewTenantVariableService(sling *sling.Sling, uriTemplate string) *TenantVariableService
func (*TenantVariableService) GetAll ¶
func (s *TenantVariableService) GetAll() ([]TenantVariables, error)
type TenantVariables ¶
type TenantVariables struct { LibraryVariables map[string]LibraryVariable `json:"LibraryVariables,omitempty"` ProjectVariables map[string]ProjectVariable `json:"ProjectVariables,omitempty"` SpaceID string `json:"SpaceId,omitempty"` TenantID string `json:"TenantId,omitempty"` TenantName string `json:"TenantName,omitempty"` resources.Resource }
func NewTenantVariables ¶
func NewTenantVariables(tenantID string) *TenantVariables
type TenantsMissingVariables ¶
type TenantsMissingVariables struct { Links map[string]string `json:"Links,omitempty"` MissingVariables []MissingVariable `json:"MissingVariables,omitempty"` TenantID string `json:"TenantId,omitempty"` }
type Variable ¶
type Variable struct { Description string `json:"Description"` IsEditable bool `json:"IsEditable"` IsSensitive bool `json:"IsSensitive"` Name string `json:"Name"` Prompt *VariablePromptOptions `json:"Prompt,omitempty"` Scope VariableScope `json:"Scope"` Type string `json:"Type"` Value string `json:"Value"` resources.Resource }
func NewVariable ¶
type VariableNamesQuery ¶
type VariablePreviewQuery ¶
type VariablePreviewQuery struct { Action string `uri:"action,omitempty" url:"action,omitempty"` Channel string `uri:"channel,omitempty" url:"channel,omitempty"` Environment string `uri:"environment,omitempty" url:"environment,omitempty"` Machine string `uri:"machine,omitempty" url:"machine,omitempty"` Project string `uri:"project,omitempty" url:"project,omitempty"` Role string `uri:"role,omitempty" url:"role,omitempty"` Runbook string `uri:"runbook,omitempty" url:"runbook,omitempty"` Tenant string `uri:"tenant,omitempty" url:"tenant,omitempty"` }
type VariablePromptOptions ¶
type VariablePromptOptions struct { Description string `json:"Description"` DisplaySettings *DisplaySettings `json:"DisplaySettings,omitempty"` IsRequired bool `json:"Required"` Label string `json:"Label"` }
type VariableScope ¶
type VariableScope struct { Environments []string `json:"Environment,omitempty"` Machines []string `json:"Machine,omitempty"` Actions []string `json:"Action,omitempty"` Roles []string `json:"Role,omitempty"` Channels []string `json:"Channel,omitempty"` TenantTags []string `json:"TenantTag,omitempty"` ProcessOwners []string `json:"ProcessOwner,omitempty"` }
func (VariableScope) IsEmpty ¶
func (scope VariableScope) IsEmpty() bool
type VariableScopeValues ¶
type VariableScopeValues struct { Actions []*resources.ReferenceDataItem `json:"Actions"` Channels []*resources.ReferenceDataItem `json:"Channels"` Environments []*resources.ReferenceDataItem `json:"Environments"` Machines []*resources.ReferenceDataItem `json:"Machines"` Processes []*resources.ProcessReferenceDataItem `json:"Processes"` Roles []*resources.ReferenceDataItem `json:"Roles"` TenantTags []*resources.ReferenceDataItem `json:"TenantTags"` }
type VariableService ¶
func NewVariableService ¶
func (*VariableService) AddSingle ¶
func (s *VariableService) AddSingle(ownerID string, variable *Variable) (VariableSet, error)
AddSingle adds a single variable to a owner 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(ownerID string, variableID string) (VariableSet, error)
DeleteSingle removes a single variable from a owner 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(ownerID string) (VariableSet, error)
GetAll fetches a collection of variables for a owner ID.
func (*VariableService) GetByID ¶
func (s *VariableService) GetByID(ownerID string, variableID string) (*Variable, error)
GetByID fetches a single variable, located by its ID, from Octopus Deploy for a given owner ID.
func (*VariableService) GetByName ¶
func (s *VariableService) GetByName(ownerID string, name string, scope *VariableScope) ([]*Variable, error)
GetByName fetches variables, located by their name, from Octopus Deploy for a given owner 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 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(ownerID string, variableSet VariableSet) (VariableSet, 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(ownerID string, variable *Variable) (VariableSet, error)
UpdateSingle adds a single variable to a owner ID. This automates the act of fetching the variable set, updating the existing item, and posting back to Octopus
type VariableSet ¶
type VariableSet struct { OwnerID string `json:"OwnerId,omitempty"` ScopeValues *VariableScopeValues `json:"ScopeValues,omitempty"` SpaceID string `json:"SpaceId,omitempty"` Variables []*Variable `json:"Variables"` Version int32 `json:"Version"` resources.Resource }
func GetVariableSet ¶ added in v2.4.0
GetVariableSet returns the variable set with matching ID. This might be a project level variable set (ID might be 'variableset-Projects-314') or it might be a release snapshot variable set (ID might be 'variableset-Projects-314-s-2-XM74V')
func NewVariableSet ¶
func NewVariableSet() *VariableSet
type VariablesQuery ¶
type VariablesQuery struct {
IDs []string `uri:"ids,omitempty" url:"ids,omitempty"`
}
Source Files ¶
- display_settings.go
- is_nil.go
- library.go
- library_variable.go
- library_variable_set.go
- library_variable_set_service.go
- library_variable_set_usage_entry.go
- library_variables_query.go
- missing_variable.go
- missing_variables_query.go
- project_variable.go
- project_variable_set_usage.go
- script_module.go
- script_module_service.go
- tenant_variable.go
- tenant_variable_service.go
- tenants_missing_variables.go
- variable.go
- variable_name_query.go
- variable_preview_query.go
- variable_prompt_options.go
- variable_scope.go
- variable_scope_values.go
- variable_service.go
- variable_set.go
- variables_query.go