v3action

package
v6.26.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package v3action contains the business logic for the commands/v3 package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	CloudControllerClient CloudControllerClient
	Config                Config
}

Actor represents a V3 actor.

func NewActor

func NewActor(client CloudControllerClient, config Config) Actor

NewActor returns a new V3 actor.

func (Actor) AssignIsolationSegmentToSpaceByNameAndSpace

func (actor Actor) AssignIsolationSegmentToSpaceByNameAndSpace(isolationSegmentName string, spaceGUID string) (Warnings, error)

func (Actor) CloudControllerAPIVersion

func (actor Actor) CloudControllerAPIVersion() string

CloudControllerAPIVersion returns back the Cloud Controller API version.

func (Actor) CreateAndUploadPackageByApplicationNameAndSpace

func (actor Actor) CreateAndUploadPackageByApplicationNameAndSpace(appName string, spaceGUID string, bitsPath string) (Package, Warnings, error)

func (Actor) CreateApplicationByNameAndSpace

func (actor Actor) CreateApplicationByNameAndSpace(appName string, spaceGUID string) (Application, Warnings, error)

CreateApplicationByNameAndSpace creates and returns the application with the given name in the given space.

func (Actor) CreateIsolationSegmentByName

func (actor Actor) CreateIsolationSegmentByName(isolationSegment IsolationSegment) (Warnings, error)

CreateIsolationSegmentByName creates a given isolation segment.

func (Actor) DeleteIsolationSegmentByName

func (actor Actor) DeleteIsolationSegmentByName(name string) (Warnings, error)

DeleteIsolationSegmentByName deletes the given isolation segment.

func (Actor) EntitleIsolationSegmentToOrganizationByName

func (actor Actor) EntitleIsolationSegmentToOrganizationByName(isolationSegmentName string, orgName string) (Warnings, error)

EntitleIsolationSegmentToOrganizationByName entitles the given organization to use the specified isolation segment

func (Actor) GetApplicationByNameAndSpace

func (actor Actor) GetApplicationByNameAndSpace(appName string, spaceGUID string) (Application, Warnings, error)

GetApplicationByNameAndSpace returns the application with the given name in the given space.

func (Actor) GetApplicationTasks

func (actor Actor) GetApplicationTasks(appGUID string, sortOrder SortOrder) ([]Task, Warnings, error)

GetApplicationTasks returns a list of tasks associated with the provided appplication GUID.

func (Actor) GetEffectiveIsolationSegmentBySpace

func (actor Actor) GetEffectiveIsolationSegmentBySpace(spaceGUID string, orgDefaultIsolationSegmentGUID string) (IsolationSegment, Warnings, error)

GetEffectiveIsolationSegmentBySpace returns the space's effective isolation segment.

If the space has its own isolation segment, that will be returned.

If the space does not have one, the organization's default isolation segment (GUID passed in) will be returned.

If the space does not have one and the passed in organization default isolation segment GUID is empty, a NoRelationshipError will be returned.

func (Actor) GetIsolationSegmentByName

func (actor Actor) GetIsolationSegmentByName(name string) (IsolationSegment, Warnings, error)

GetIsolationSegmentByName returns the requested isolation segment.

func (Actor) GetIsolationSegmentSummaries

func (actor Actor) GetIsolationSegmentSummaries() ([]IsolationSegmentSummary, Warnings, error)

GetIsolationSegmentSummaries returns all isolation segments and their entitled orgs

func (Actor) GetIsolationSegmentsByOrganization

func (actor Actor) GetIsolationSegmentsByOrganization(orgGUID string) ([]IsolationSegment, Warnings, error)

func (Actor) GetOrganizationByName

func (actor Actor) GetOrganizationByName(name string) (Organization, Warnings, error)

GetOrganizationByName returns the organization with the given name.

func (Actor) GetTaskBySequenceIDAndApplication

func (actor Actor) GetTaskBySequenceIDAndApplication(sequenceID int, appGUID string) (Task, Warnings, error)

func (Actor) ResetSpaceIsolationSegment

func (actor Actor) ResetSpaceIsolationSegment(orgGUID string, spaceGUID string) (string, Warnings, error)

ResetSpaceIsolationSegment disassociates a space from an isolation segment.

If the space's organization has a default isolation segment, return its name. Otherwise return the empty string.

func (Actor) RevokeIsolationSegmentFromOrganizationByName

func (actor Actor) RevokeIsolationSegmentFromOrganizationByName(isolationSegmentName string, orgName string) (Warnings, error)

func (Actor) RunTask

func (actor Actor) RunTask(appGUID string, task Task) (Task, Warnings, error)

RunTask runs the provided command in the application environment associated with the provided application GUID.

func (Actor) TerminateTask

func (actor Actor) TerminateTask(taskGUID string) (Task, Warnings, error)

type Application

type Application ccv3.Application

Application represents a V3 actor application.

type ApplicationAlreadyExistsError

type ApplicationAlreadyExistsError struct {
	Name string
}

ApplicationAlreadyExistsError represents the error that occurs when the application already exists.

func (ApplicationAlreadyExistsError) Error

type ApplicationNotFoundError

type ApplicationNotFoundError struct {
	Name string
}

ApplicationNotFoundError represents the error that occurs when the application is not found.

func (ApplicationNotFoundError) Error

func (e ApplicationNotFoundError) Error() string

type CloudControllerClient

type CloudControllerClient interface {
	AssignSpaceToIsolationSegment(spaceGUID string, isolationSegmentGUID string) (ccv3.Relationship, ccv3.Warnings, error)
	CloudControllerAPIVersion() string
	CreateApplication(app ccv3.Application) (ccv3.Application, ccv3.Warnings, error)
	CreateApplicationTask(appGUID string, task ccv3.Task) (ccv3.Task, ccv3.Warnings, error)
	CreateIsolationSegment(isolationSegment ccv3.IsolationSegment) (ccv3.IsolationSegment, ccv3.Warnings, error)
	CreatePackage(pkg ccv3.Package) (ccv3.Package, ccv3.Warnings, error)
	DeleteIsolationSegment(guid string) (ccv3.Warnings, error)
	EntitleIsolationSegmentToOrganizations(isoGUID string, orgGUIDs []string) (ccv3.RelationshipList, ccv3.Warnings, error)
	GetApplications(query url.Values) ([]ccv3.Application, ccv3.Warnings, error)
	GetApplicationTasks(appGUID string, query url.Values) ([]ccv3.Task, ccv3.Warnings, error)
	GetIsolationSegment(guid string) (ccv3.IsolationSegment, ccv3.Warnings, error)
	GetIsolationSegmentOrganizationsByIsolationSegment(isolationSegmentGUID string) ([]ccv3.Organization, ccv3.Warnings, error)
	GetIsolationSegments(query url.Values) ([]ccv3.IsolationSegment, ccv3.Warnings, error)
	GetOrganizationDefaultIsolationSegment(orgGUID string) (ccv3.Relationship, ccv3.Warnings, error)
	GetOrganizations(query url.Values) ([]ccv3.Organization, ccv3.Warnings, error)
	GetPackage(guid string) (ccv3.Package, ccv3.Warnings, error)
	GetSpaceIsolationSegment(spaceGUID string) (ccv3.Relationship, ccv3.Warnings, error)
	RevokeIsolationSegmentFromOrganization(isolationSegmentGUID string, organizationGUID string) (ccv3.Warnings, error)
	UpdateTask(taskGUID string) (ccv3.Task, ccv3.Warnings, error)
	UploadPackage(pkg ccv3.Package, zipFilepath string) (ccv3.Package, ccv3.Warnings, error)
}

CloudControllerClient is the interface to the cloud controller V3 API.

type Config

type Config interface {
	PollingInterval() time.Duration
}

type IsolationSegment

type IsolationSegment ccv3.IsolationSegment

IsolationSegment represents a V3 actor IsolationSegment.

type IsolationSegmentAlreadyExistsError

type IsolationSegmentAlreadyExistsError struct {
	Name string
}

IsolationSegmentAlreadyExistsError gets returned when an isolation segment already exists.

func (IsolationSegmentAlreadyExistsError) Error

type IsolationSegmentNotFoundError

type IsolationSegmentNotFoundError struct {
	Name string
}

IsolationSegmentNotFoundError represents the error that occurs when the isolation segment is not found.

func (IsolationSegmentNotFoundError) Error

type IsolationSegmentSummary

type IsolationSegmentSummary struct {
	Name         string
	EntitledOrgs []string
}

type NoRelationshipError

type NoRelationshipError struct {
}

func (NoRelationshipError) Error

func (e NoRelationshipError) Error() string

type Organization

type Organization ccv3.Organization

Organization represents a V3 actor organization.

type OrganizationNotFoundError

type OrganizationNotFoundError struct {
	Name string
}

OrganizationNotFoundError represents the error that occurs when the organization is not found.

func (OrganizationNotFoundError) Error

type Package

type Package ccv3.Package

type PackageProcessingExpiredError

type PackageProcessingExpiredError struct{}

func (PackageProcessingExpiredError) Error

type PackageProcessingFailedError

type PackageProcessingFailedError struct{}

func (PackageProcessingFailedError) Error

type SortOrder

type SortOrder string

This is used for sorting.

const (
	Ascending  SortOrder = "Ascending"
	Descending SortOrder = "Descending"
)

type Task

type Task ccv3.Task

Task represents a V3 actor Task.

type TaskNotFoundError

type TaskNotFoundError struct {
	SequenceID int
}

TaskNotFoundError is returned when no tasks matching the filters are found.

func (TaskNotFoundError) Error

func (e TaskNotFoundError) Error() string

type TaskWorkersUnavailableError

type TaskWorkersUnavailableError struct {
	Message string
}

TaskWorkersUnavailableError is returned when there are no workers to run a given task.

func (TaskWorkersUnavailableError) Error

type Warnings

type Warnings []string

Warnings is a list of warnings returned back from the cloud controller

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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