v3action

package
v6.23.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2016 License: Apache-2.0 Imports: 5 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
}

Actor represents a V3 actor.

func NewActor

func NewActor(client CloudControllerClient) Actor

NewActor returns a new V3 actor.

func (Actor) CloudControllerAPIVersion

func (actor Actor) CloudControllerAPIVersion() string

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) GetTaskBySequenceIDAndApplication

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

func (Actor) RunTask

func (actor Actor) RunTask(appGUID string, command string, name string) (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 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 {
	CloudControllerAPIVersion() string
	GetApplicationTasks(appGUID string, query url.Values) ([]ccv3.Task, ccv3.Warnings, error)
	GetApplications(query url.Values) ([]ccv3.Application, ccv3.Warnings, error)
	NewTask(appGUID string, command string, name string) (ccv3.Task, ccv3.Warnings, error)
	UpdateTask(taskGUID string) (ccv3.Task, ccv3.Warnings, error)
}

CloudControllerClient is the interface to the cloud controller V3 API.

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

Jump to

Keyboard shortcuts

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