environments

package
v2.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

Types

type Environment

type Environment struct {
	AllowDynamicInfrastructure bool   `json:"AllowDynamicInfrastructure"`
	Description                string `json:"Description,omitempty"`
	Name                       string `json:"Name" validate:"required"`
	SortOrder                  int    `json:"SortOrder"`
	UseGuidedFailure           bool   `json:"UseGuidedFailure"`
	SpaceID                    string `json:"SpaceId"`
	Slug                       string `json:"Slug"` // deliberately send empty string

	resources.Resource
}

func NewEnvironment

func NewEnvironment(name string) *Environment

func (*Environment) GetName added in v2.2.0

func (e *Environment) GetName() string

GetName returns the name of the environment.

func (*Environment) SetName added in v2.3.0

func (e *Environment) SetName(name string)

SetName sets the name of the environment.

func (*Environment) Validate

func (e *Environment) Validate() error

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

type EnvironmentService

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

func NewEnvironmentService

func NewEnvironmentService(sling *sling.Sling, uriTemplate string, sortOrderPath string, summaryPath string) *EnvironmentService

NewEnvironmentService returns an EnvironmentService with a preconfigured client.

func (*EnvironmentService) Add

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

Add creates a new environment.

func (*EnvironmentService) Get

func (s *EnvironmentService) Get(environmentsQuery EnvironmentsQuery) (*resources.Resources[*Environment], error)

Get returns a collection of environments 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 (*EnvironmentService) GetAll

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

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

func (*EnvironmentService) GetByID

func (s *EnvironmentService) GetByID(id string) (*Environment, error)

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

func (*EnvironmentService) GetByIDs

func (s *EnvironmentService) GetByIDs(ids []string) ([]*Environment, error)

GetByIDs returns the environments that match the input IDs.

func (*EnvironmentService) GetByName

func (s *EnvironmentService) GetByName(name string) ([]*Environment, error)

GetByName returns the environments with a matching partial name.

func (*EnvironmentService) GetByPartialName

func (s *EnvironmentService) GetByPartialName(partialName string) ([]*Environment, error)

GetByPartialName performs a lookup and returns enironments with a matching partial name.

func (*EnvironmentService) Update

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

Update modifies an environment based on the one provided as input.

type EnvironmentsQuery

type EnvironmentsQuery 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 EnvironmentsSummaryQuery

type EnvironmentsSummaryQuery struct {
	CommunicationStyles   []string `uri:"commStyles,omitempty" url:"commStyles,omitempty"`
	HealthStatuses        []string `uri:"healthStatuses,omitempty" url:"healthStatuses,omitempty"`
	HideEmptyEnvironments bool     `uri:"hideEmptyEnvironments,omitempty" url:"hideEmptyEnvironments,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"`
	Roles                 []string `uri:"roles,omitempty" url:"roles,omitempty"`
	ShellNames            []string `uri:"shellNames,omitempty" url:"shellNames,omitempty"`
	TenantIDs             []string `uri:"tenantIds,omitempty" url:"tenantIds,omitempty"`
	TenantTags            []string `uri:"tenantTags,omitempty" url:"tenantTags,omitempty"`
}

Jump to

Keyboard shortcuts

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