workerpools

package
v2.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 15 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

Types

type DynamicWorkerPool

type DynamicWorkerPool struct {
	WorkerType string `json:"WorkerType"`
	// contains filtered or unexported fields
}

func NewDynamicWorkerPool

func NewDynamicWorkerPool(name string, workerType string) *DynamicWorkerPool

NewDynamicWorkerPool creates and initializes a dynamic worker pool.

func (*DynamicWorkerPool) GetCanAddWorkers

func (w *DynamicWorkerPool) GetCanAddWorkers() bool

func (*DynamicWorkerPool) GetDescription

func (w *DynamicWorkerPool) GetDescription() string

func (*DynamicWorkerPool) GetIsDefault

func (w *DynamicWorkerPool) GetIsDefault() bool

func (*DynamicWorkerPool) GetName

func (w *DynamicWorkerPool) GetName() string

GetName returns the name of the worker pool resource.

func (*DynamicWorkerPool) GetSortOrder

func (w *DynamicWorkerPool) GetSortOrder() int

func (*DynamicWorkerPool) GetSpaceID

func (w *DynamicWorkerPool) GetSpaceID() string

func (*DynamicWorkerPool) GetWorkerPoolType

func (w *DynamicWorkerPool) GetWorkerPoolType() WorkerPoolType

GetWorkerPoolType returns the worker type for this worker pool.

func (*DynamicWorkerPool) GetWorkerType

func (d *DynamicWorkerPool) GetWorkerType() string

GetWorkerType returns the worker type for this worker pool.

func (*DynamicWorkerPool) SetCanAddWorkers

func (w *DynamicWorkerPool) SetCanAddWorkers(canAddWorkers bool)

func (*DynamicWorkerPool) SetDescription

func (w *DynamicWorkerPool) SetDescription(description string)

func (*DynamicWorkerPool) SetIsDefault

func (w *DynamicWorkerPool) SetIsDefault(isDefault bool)

func (*DynamicWorkerPool) SetName

func (w *DynamicWorkerPool) SetName(name string)

SetName sets the name of the worker pool.

func (*DynamicWorkerPool) SetSortOrder

func (w *DynamicWorkerPool) SetSortOrder(sortOrder int)

func (*DynamicWorkerPool) SetSpaceID

func (w *DynamicWorkerPool) SetSpaceID(spaceID string)

func (*DynamicWorkerPool) SetWorkerPoolType

func (w *DynamicWorkerPool) SetWorkerPoolType(workerPoolType WorkerPoolType)

func (*DynamicWorkerPool) Validate

func (d *DynamicWorkerPool) Validate() error

Validate checks the state of the dynamic worker pool and returns an error if invalid.

type DynamicWorkerPoolType added in v2.17.4

type DynamicWorkerPoolType struct {
	ID                 string     `json:"Id"`
	Type               string     `json:"Type"`
	Description        string     `json:"Description"`
	DeprecationDateUtc *time.Time `json:"DeprecationDateUtc"`
	EndOfLifeDateUtc   *time.Time `json:"EndOfLifeDateUtc"`
	StartDateUtc       *time.Time `json:"StartDateUtc"`
}

type DynamicWorkerPoolTypes added in v2.17.4

type DynamicWorkerPoolTypes struct {
	ID          string                   `json:"Id"`
	WorkerTypes []*DynamicWorkerPoolType `json:"WorkerTypes"`
}

type IDynamicWorkerPool

type IDynamicWorkerPool interface {
	GetWorkerType() string

	IWorkerPool
}

type IWorkerPool

type IWorkerPool interface {
	GetCanAddWorkers() bool
	GetDescription() string
	GetIsDefault() bool
	GetName() string
	GetSpaceID() string
	GetSortOrder() int
	GetWorkerPoolType() WorkerPoolType
	SetCanAddWorkers(bool)
	SetDescription(string)
	SetIsDefault(bool)
	SetName(string)
	SetSpaceID(string)
	SetSortOrder(int)
	SetWorkerPoolType(WorkerPoolType)

	resources.IHasName
	resources.IResource
}

IWorkerPool defines the interface for worker pools.

func ToWorkerPool

func ToWorkerPool(workerPoolResource *WorkerPoolResource) (IWorkerPool, error)

func ToWorkerPoolArray

func ToWorkerPoolArray(workerPoolResources []*WorkerPoolResource) []IWorkerPool

type StaticWorkerPool

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

func NewStaticWorkerPool

func NewStaticWorkerPool(name string) *StaticWorkerPool

NewStaticWorkerPool creates and initializes a static worker pool.

func (*StaticWorkerPool) GetCanAddWorkers

func (w *StaticWorkerPool) GetCanAddWorkers() bool

func (*StaticWorkerPool) GetDescription

func (w *StaticWorkerPool) GetDescription() string

func (*StaticWorkerPool) GetIsDefault

func (w *StaticWorkerPool) GetIsDefault() bool

func (*StaticWorkerPool) GetName

func (w *StaticWorkerPool) GetName() string

GetName returns the name of the worker pool resource.

func (*StaticWorkerPool) GetSortOrder

func (w *StaticWorkerPool) GetSortOrder() int

func (*StaticWorkerPool) GetSpaceID

func (w *StaticWorkerPool) GetSpaceID() string

func (*StaticWorkerPool) GetWorkerPoolType

func (w *StaticWorkerPool) GetWorkerPoolType() WorkerPoolType

GetWorkerPoolType returns the worker type for this worker pool.

func (*StaticWorkerPool) SetCanAddWorkers

func (w *StaticWorkerPool) SetCanAddWorkers(canAddWorkers bool)

func (*StaticWorkerPool) SetDescription

func (w *StaticWorkerPool) SetDescription(description string)

func (*StaticWorkerPool) SetIsDefault

func (w *StaticWorkerPool) SetIsDefault(isDefault bool)

func (*StaticWorkerPool) SetName

func (w *StaticWorkerPool) SetName(name string)

SetName sets the name of the worker pool.

func (*StaticWorkerPool) SetSortOrder

func (w *StaticWorkerPool) SetSortOrder(sortOrder int)

func (*StaticWorkerPool) SetSpaceID

func (w *StaticWorkerPool) SetSpaceID(spaceID string)

func (*StaticWorkerPool) SetWorkerPoolType

func (w *StaticWorkerPool) SetWorkerPoolType(workerPoolType WorkerPoolType)

func (*StaticWorkerPool) Validate

func (s *StaticWorkerPool) Validate() error

Validate checks the state of the static worker pool and returns an error if invalid.

type WorkerPoolListResult added in v2.14.0

type WorkerPoolListResult struct {
	ID             string         `json:"Id,omitempty"`
	Name           string         `json:"Name" validate:"required,notblank"`
	WorkerPoolType WorkerPoolType `json:"WorkerPoolType"`
	IsDefault      bool           `json:"IsDefault"`
	CanAddWorkers  bool           `json:"CanAddWorkers"`
	Slug           string         `json:"Slug"`
}

type WorkerPoolResource

type WorkerPoolResource struct {
	CanAddWorkers  bool           `json:"CanAddWorkers"`
	Description    string         `json:"Description,omitempty"`
	IsDefault      bool           `json:"IsDefault"`
	Name           string         `json:"Name" validate:"required,notblank"`
	SpaceID        string         `json:"SpaceId,omitempty" validate:"omitempty,notblank"`
	SortOrder      int            `json:"SortOrder"`
	WorkerPoolType WorkerPoolType `json:"WorkerPoolType"`
	WorkerType     string         `json:"WorkerType,omitempty"`

	resources.Resource
}

func NewWorkerPoolResource

func NewWorkerPoolResource(name string, workerPoolType WorkerPoolType) *WorkerPoolResource

NewWorkerPoolResource creates and initializes a worker pool resource.

func ToWorkerPoolResource

func ToWorkerPoolResource(workerPool IWorkerPool) (*WorkerPoolResource, error)

func (*WorkerPoolResource) GetCanAddWorkers

func (w *WorkerPoolResource) GetCanAddWorkers() bool

func (*WorkerPoolResource) GetDescription

func (w *WorkerPoolResource) GetDescription() string

func (*WorkerPoolResource) GetIsDefault

func (w *WorkerPoolResource) GetIsDefault() bool

func (*WorkerPoolResource) GetName

func (w *WorkerPoolResource) GetName() string

GetName returns the name of the worker pool resource.

func (*WorkerPoolResource) GetSortOrder

func (w *WorkerPoolResource) GetSortOrder() int

func (*WorkerPoolResource) GetSpaceID

func (w *WorkerPoolResource) GetSpaceID() string

func (*WorkerPoolResource) GetWorkerPoolType

func (w *WorkerPoolResource) GetWorkerPoolType() WorkerPoolType

GetWorkerPoolType returns the worker type for this worker pool resource.

func (*WorkerPoolResource) GetWorkerType

func (w *WorkerPoolResource) GetWorkerType() string

GetWorkerType returns the worker type for this worker pool resource.

func (*WorkerPoolResource) SetCanAddWorkers

func (w *WorkerPoolResource) SetCanAddWorkers(canAddWorkers bool)

func (*WorkerPoolResource) SetDescription

func (w *WorkerPoolResource) SetDescription(description string)

func (*WorkerPoolResource) SetIsDefault

func (w *WorkerPoolResource) SetIsDefault(isDefault bool)

func (*WorkerPoolResource) SetName

func (w *WorkerPoolResource) SetName(name string)

SetName sets the name of the worker pool resource.

func (*WorkerPoolResource) SetSortOrder

func (w *WorkerPoolResource) SetSortOrder(sortOrder int)

func (*WorkerPoolResource) SetSpaceID

func (w *WorkerPoolResource) SetSpaceID(spaceID string)

func (*WorkerPoolResource) SetWorkerPoolType

func (w *WorkerPoolResource) SetWorkerPoolType(workerPoolType WorkerPoolType)

func (*WorkerPoolResource) SetWorkerType

func (w *WorkerPoolResource) SetWorkerType(workerType string)

func (*WorkerPoolResource) Validate

func (w *WorkerPoolResource) Validate() error

Validate checks the state of the worker pool resource and returns an error if invalid.

type WorkerPoolService

type WorkerPoolService struct {
	services.CanDeleteService
	// contains filtered or unexported fields
}

func NewWorkerPoolService

func NewWorkerPoolService(sling *sling.Sling, uriTemplate string, dynamicWorkerTypesPath string, sortOrderPath string, summaryPath string, supportedTypesPath string) *WorkerPoolService

func (*WorkerPoolService) Add

func (s *WorkerPoolService) Add(workerPool IWorkerPool) (IWorkerPool, error)

Add creates a new worker pool.

func (*WorkerPoolService) Get

func (s *WorkerPoolService) Get(workerPoolsQuery WorkerPoolsQuery) (*WorkerPools, error)

Get returns a collection of worker pools 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 (*WorkerPoolService) GetAll

func (s *WorkerPoolService) GetAll() ([]*WorkerPoolListResult, error)

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

func (*WorkerPoolService) GetByID

func (s *WorkerPoolService) GetByID(id string) (IWorkerPool, error)

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

func (*WorkerPoolService) GetByIdentifier added in v2.17.0

func (s *WorkerPoolService) GetByIdentifier(identifier string) (IWorkerPool, error)

func (*WorkerPoolService) GetByName added in v2.17.0

func (s *WorkerPoolService) GetByName(name string) ([]IWorkerPool, error)

func (*WorkerPoolService) GetDynamicWorkerTypes added in v2.17.4

func (s *WorkerPoolService) GetDynamicWorkerTypes() ([]*DynamicWorkerPoolType, error)

func (*WorkerPoolService) GetWorkers added in v2.17.2

func (s *WorkerPoolService) GetWorkers(workerPool IWorkerPool) ([]*machines.Worker, error)

func (*WorkerPoolService) Update

func (s *WorkerPoolService) Update(workerPool IWorkerPool) (IWorkerPool, error)

Update modifies a worker pool based on the one provided as input.

type WorkerPoolType

type WorkerPoolType string
const (
	WorkerPoolTypeDynamic WorkerPoolType = "DynamicWorkerPool"
	WorkerPoolTypeStatic  WorkerPoolType = "StaticWorkerPool"
)

type WorkerPools

type WorkerPools struct {
	Items []IWorkerPool `json:"Items"`
	resources.PagedResults
}

func ToWorkerPools

func ToWorkerPools(workerPoolResources *resources.Resources[*WorkerPoolResource]) *WorkerPools

type WorkerPoolsQuery

type WorkerPoolsQuery struct {
	IDs         []string `uri:"ids,omitempty" url:"ids,omitempty"`
	Name        string   `uri:"name,omitempty" url:"name,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 WorkerPoolsSummaryQuery

type WorkerPoolsSummaryQuery struct {
	CommunicationStyles  []string `uri:"commStyles,omitempty" url:"commStyles,omitempty"`
	HealthStatuses       []string `uri:"healthStatuses,omitempty" url:"healthStatuses,omitempty"`
	HideEmptyWorkerPools bool     `uri:"hideEmptyWorkerPools,omitempty" url:"hideEmptyWorkerPools,omitempty"`
	IDs                  []string `uri:"ids,omitempty" url:"ids,omitempty"`
	IsDisabled           bool     `uri:"isDisabled,omitempty" url:"isDisabled,omitempty"`
	MachinePartialName   string   `uri:"machinePartialName,omitempty" url:"machinePartialName,omitempty"`
	PartialName          string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	ShellNames           []string `uri:"shellNames,omitempty" url:"shellNames,omitempty"`
}

Jump to

Keyboard shortcuts

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