runbooks

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

func List added in v2.6.1

func List(client newclient.Client, spaceID string, projectID string, filter string, limit int) (*resources.Resources[*Runbook], error)

List returns a list of runbooks from the server, in a standard Octopus paginated result structure. If you don't specify --limit the server will use a default limit (typically 30)

func ListEnvironments added in v2.6.1

func ListEnvironments(client newclient.Client, spaceID string, projectID string, runbookID string) ([]*environments.Environment, error)

ListEnvironments returns the list of valid environments for a given runbook

func ListSnapshots added in v2.6.1

func ListSnapshots(client newclient.Client, spaceID string, projectID string, runbookID string, limit int) (*resources.Resources[*RunbookSnapshot], error)

ListSnapshots returns a list of runbook snapshots from the server, in a standard Octopus paginated result structure. If you don't specify --limit the server will use a default limit (typically 30)

Types

type RunPreview added in v2.6.1

type RunPreview struct {
	StepsToExecute                []*deployments.DeploymentTemplateStep `json:"StepsToExecute,omitempty"`
	UseGuidedFailureModeByDefault bool                                  `json:"UseGuidedFailureModeByDefault,omitempty"`
}

func GetRunbookSnapshotRunPreview added in v2.6.1

func GetRunbookSnapshotRunPreview(client newclient.Client, spaceID string, snapshotID string, environmentID string, includeDisabledSteps bool) (*RunPreview, error)

GetRunbookSnapshotRunPreview gets a preview of a snapshot run for a given environment. This is used by the portal to show which machines would be deployed to, and other information about the deployment, before proceeding with it. The CLI uses it to build the selector for picking specific machines to deploy to

type Runbook

type Runbook struct {
	ConnectivityPolicy         *core.ConnectivityPolicy    `json:"ConnectivityPolicy,omitempty"`
	DefaultGuidedFailureMode   string                      `json:"DefaultGuidedFailureMode" validate:"required,oneof=EnvironmentDefault Off On"`
	Description                string                      `json:"Description,omitempty"`
	EnvironmentScope           string                      `json:"EnvironmentScope" validate:"required,oneof=All FromProjectLifecycles Specified"`
	Environments               []string                    `json:"Environments,omitempty"`
	MultiTenancyMode           core.TenantedDeploymentMode `json:"MultiTenancyMode" validate:"required,oneof=Untenanted TenantedOrUntenanted Tenanted"`
	Name                       string                      `json:"Name,omitempty"`
	ProjectID                  string                      `json:"ProjectId,omitempty"`
	PublishedRunbookSnapshotID string                      `json:"PublishedRunbookSnapshotId,omitempty"`
	RunRetentionPolicy         *RunbookRetentionPeriod     `json:"RunRetentionPolicy,omitempty"`
	RunbookProcessID           string                      `json:"RunbookProcessId,omitempty"`
	SpaceID                    string                      `json:"SpaceId,omitempty"`

	resources.Resource
}

func GetByName added in v2.6.1

func GetByName(client newclient.Client, spaceID string, projectID string, name string) (*Runbook, error)

GetByName searches for a single runbook with name of 'name'. If no such runbook can be found, will return nil, nil

func NewRunbook

func NewRunbook(name string, projectID string) *Runbook

NewRunbook creates and initializes a runbook.

func (*Runbook) Validate

func (r *Runbook) Validate() error

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

type RunbookProcess

type RunbookProcess struct {
	LastSnapshotID string                        `json:"LastSnapshotId,omitempty"`
	ProjectID      string                        `json:"ProjectId,omitempty"`
	RunbookID      string                        `json:"RunbookId,omitempty"`
	SpaceID        string                        `json:"SpaceId,omitempty"`
	Steps          []*deployments.DeploymentStep `json:"Steps"`
	Version        *int32                        `json:"Version"`

	resources.Resource
}

func GetProcess added in v2.6.1

func GetProcess(client newclient.Client, spaceID string, projectID string, ID string) (*RunbookProcess, error)

GetProcess fetches a runbook process. This may either be the project level process (template), or a snapshot, depending on the value of ID

func NewRunbookProcess

func NewRunbookProcess() *RunbookProcess

type RunbookProcessService

type RunbookProcessService struct {
	services.Service
}

func NewRunbookProcessService

func NewRunbookProcessService(sling *sling.Sling, uriTemplate string) *RunbookProcessService

func (*RunbookProcessService) GetByID

func (s *RunbookProcessService) GetByID(id string) (*RunbookProcess, error)

GetByID returns the runbook process that matches the input ID. If one cannot be found, it returns nil and an error.

type RunbookProcessesQuery

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

type RunbookRetentionPeriod

type RunbookRetentionPeriod struct {
	QuantityToKeep    int32 `json:"QuantityToKeep"`
	ShouldKeepForever bool  `json:"ShouldKeepForever"`
}

func NewRunbookRetentionPeriod

func NewRunbookRetentionPeriod() *RunbookRetentionPeriod

type RunbookRunCommandV1 added in v2.4.0

type RunbookRunCommandV1 struct {
	RunbookName      string   `json:"runbookName"` // required
	EnvironmentNames []string `json:"environmentNames,omitempty"`
	Tenants          []string `json:"tenants,omitempty"`
	TenantTags       []string `json:"tenantTags,omitempty"`
	Snapshot         string   `json:"snapshot,omitempty"`
	deployments.CreateExecutionAbstractCommandV1
}

func NewRunbookRunCommandV1 added in v2.4.0

func NewRunbookRunCommandV1(spaceID string, projectIDOrName string) *RunbookRunCommandV1

func (*RunbookRunCommandV1) MarshalJSON added in v2.4.0

func (r *RunbookRunCommandV1) MarshalJSON() ([]byte, error)

MarshalJSON adds the redundant 'spaceIdOrName' parameter which is required by the server

type RunbookRunResponseV1 added in v2.4.0

type RunbookRunResponseV1 struct {
	RunbookRunServerTasks []*RunbookRunServerTask `json:"RunbookRunServerTasks,omitempty"`
}

func RunbookRunV1 added in v2.4.0

func RunbookRunV1(client newclient.Client, command *RunbookRunCommandV1) (*RunbookRunResponseV1, error)

type RunbookRunServerTask added in v2.6.1

type RunbookRunServerTask struct {
	RunbookRunID string `json:"RunbookRunId"`
	ServerTaskID string `json:"ServerTaskId"`
}

type RunbookRunService

type RunbookRunService struct {
	services.CanDeleteService
}

func NewRunbookRunService

func NewRunbookRunService(sling *sling.Sling, uriTemplate string) *RunbookRunService

type RunbookRunsQuery

type RunbookRunsQuery struct {
	Environments []string `uri:"environments,omitempty" url:"environments,omitempty"`
	IDs          []string `uri:"ids,omitempty" url:"ids,omitempty"`
	PartialName  string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	Projects     []string `uri:"projects,omitempty" url:"projects,omitempty"`
	Runbooks     []string `uri:"runbooks,omitempty" url:"runbooks,omitempty"`
	Skip         int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Take         int      `uri:"take,omitempty" url:"take,omitempty"`
	TaskState    string   `uri:"taskState,omitempty" url:"taskState,omitempty"`
	Tenants      []string `uri:"tenants,omitempty" url:"tenants,omitempty"`
}

type RunbookService

type RunbookService struct {
	services.CanDeleteService
}

func NewRunbookService

func NewRunbookService(sling *sling.Sling, uriTemplate string) *RunbookService

func (*RunbookService) Add

func (s *RunbookService) Add(runbook *Runbook) (*Runbook, error)

Add returns the runbook that matches the input ID.

func (*RunbookService) GetAll

func (s *RunbookService) GetAll() ([]*Runbook, error)

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

func (*RunbookService) GetByID

func (s *RunbookService) GetByID(id string) (*Runbook, error)

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

func (*RunbookService) GetRunbookSnapshotTemplate

func (s *RunbookService) GetRunbookSnapshotTemplate(runbook *Runbook) (*RunbookSnapshotTemplate, error)

func (*RunbookService) Update

func (s *RunbookService) Update(runbook *Runbook) (*Runbook, error)

Update modifies a runbook based on the one provided as input.

type RunbookSnapshot

type RunbookSnapshot struct {
	Assembled                     *time.Time                  `json:"Assembled,omitempty"`
	FrozenProjectVariableSetID    string                      `json:"FrozenProjectVariableSetId,omitempty"`
	FrozenRunbookProcessID        string                      `json:"FrozenRunbookProcessId,omitempty"`
	LibraryVariableSetSnapshotIDs []string                    `json:"LibraryVariableSetSnapshotIds"`
	Name                          string                      `json:"Name,omitempty"`
	Notes                         string                      `json:"Notes,omitempty"`
	ProjectID                     string                      `json:"ProjectId" validate:"required,notblank"`
	ProjectVariableSetSnapshotID  string                      `json:"ProjectVariableSetSnapshotId,omitempty"`
	RunbookID                     string                      `json:"RunbookId" validate:"required,notblank"`
	SelectedPackages              []*packages.SelectedPackage `json:"SelectedPackages"`
	SpaceID                       string                      `json:"SpaceId,omitempty"`

	resources.Resource
}

RunbookSnapshot represents a runbook snapshot.

func GetSnapshot added in v2.6.1

func GetSnapshot(client newclient.Client, spaceID string, projectID string, snapshotIDorName string) (*RunbookSnapshot, error)

GetSnapshot loads a single runbook snapshot. You can supply either a name "Snapshot FWKMLUX" or an ID "RunbookSnapshots-41" for snapshotIDorName

func NewRunbookSnapshot

func NewRunbookSnapshot(name string, projectID string, runbookID string) *RunbookSnapshot

NewRunbookSnapshot creates and initializes a runbook snapshot.

func (RunbookSnapshot) Validate

func (c RunbookSnapshot) Validate() error

Validate checks the state of the runbook snapshot and returns an error if invalid.

type RunbookSnapshotService

type RunbookSnapshotService struct {
	services.CanDeleteService
}

func NewRunbookSnapshotService

func NewRunbookSnapshotService(sling *sling.Sling, uriTemplate string) *RunbookSnapshotService

func (*RunbookSnapshotService) Add

func (s *RunbookSnapshotService) Add(runbookSnapshot *RunbookSnapshot) (*RunbookSnapshot, error)

Add creates a new runbook snapshot.

func (*RunbookSnapshotService) GetByID

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

type RunbookSnapshotTemplate

type RunbookSnapshotTemplate struct {
	NextNameIncrement string                             `json:"NextNameIncrement,omitempty"`
	Packages          []*releases.ReleaseTemplatePackage `json:"Packages"`
	RunbookID         string                             `json:"RunbookId,omitempty"`
	RunbookProcessID  string                             `json:"RunbookProcessId,omitempty"`

	resources.Resource
}

type RunbookSnapshotUsage

type RunbookSnapshotUsage struct {
	ProjectID   string                       `json:"ProjectId,omitempty"`
	ProjectName string                       `json:"ProjectName,omitempty"`
	RunbookID   string                       `json:"RunbookId,omitempty"`
	RunbookName string                       `json:"RunbookName,omitempty"`
	Snapshots   []*RunbookSnapshotUsageEntry `json:"Snapshots"`
}

type RunbookSnapshotUsageEntry

type RunbookSnapshotUsageEntry struct {
	SnapshotID   string `json:"SnapshotId,omitempty"`
	SnapshotName string `json:"SnapshotName,omitempty"`
}

type RunbookSnapshotsQuery

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

type RunbookStepUsage

type RunbookStepUsage struct {
	ProcessID   string                        `json:"ProcessId,omitempty"`
	ProjectID   string                        `json:"ProjectId,omitempty"`
	ProjectName string                        `json:"ProjectName,omitempty"`
	ProjectSlug string                        `json:"ProjectSlug,omitempty"`
	RunbookID   string                        `json:"RunbookId,omitempty"`
	RunbookName string                        `json:"RunbookName,omitempty"`
	Steps       []*deployments.StepUsageEntry `json:"Steps"`
}

type RunbooksQuery

type RunbooksQuery struct {
	IDs         []string `uri:"ids,omitempty" url:"ids,omitempty"`
	IsClone     bool     `uri:"clone,omitempty" url:"clone,omitempty"`
	PartialName string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	ProjectIDs  []string `uri:"projectIds,omitempty" url:"projectIds,omitempty"`
	Skip        int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Take        int      `uri:"take,omitempty" url:"take,omitempty"`
}

Jump to

Keyboard shortcuts

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