Documentation ¶
Overview ¶
Package v2action contains the business logic for the commands/v2 package
Index ¶
- Constants
- Variables
- func ActorToCCRoute(route Route) ccv2.Route
- type Actor
- func (actor Actor) Authenticate(config Config, username string, password string) error
- func (actor Actor) BindRouteToApplication(routeGUID string, appGUID string) (Warnings, error)
- func (actor Actor) BindSecurityGroupToSpace(securityGroupGUID string, spaceGUID string, ...) (Warnings, error)
- func (actor Actor) BindServiceByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (Warnings, error)
- func (actor Actor) BindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string, ...) (Warnings, error)
- func (actor Actor) CheckRoute(route Route) (bool, Warnings, error)
- func (Actor) ClearOrganizationAndSpace(config Config)
- func (Actor) ClearTarget(config Config)
- func (actor Actor) CloudControllerAPIVersion() string
- func (actor Actor) CreateApplication(application Application) (Application, Warnings, error)
- func (actor Actor) CreateApplicationManifestByNameAndSpace(appName string, spaceGUID string, pathToFile string) (Warnings, error)
- func (actor Actor) CreateRoute(route Route, generatePort bool) (Route, Warnings, error)
- func (actor Actor) CreateRouteWithExistenceCheck(orgGUID string, spaceName string, route Route, generatePort bool) (Route, Warnings, error)
- func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error)
- func (actor Actor) DeleteOrganization(orgName string) (Warnings, error)
- func (actor Actor) DeleteRoute(routeGUID string) (Warnings, error)
- func (actor Actor) DeleteSpaceByNameAndOrganizationName(spaceName string, orgName string) (Warnings, error)
- func (actor Actor) FindRouteBoundToSpaceWithSettings(route Route) (Route, Warnings, error)
- func (actor Actor) GatherArchiveResources(archivePath string) ([]Resource, error)
- func (actor Actor) GatherDirectoryResources(sourceDir string) ([]Resource, error)
- func (actor Actor) GetApplication(guid string) (Application, Warnings, error)
- func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error)
- func (actor Actor) GetApplicationInstancesByApplication(guid string) (map[int]ApplicationInstance, Warnings, error)
- func (actor Actor) GetApplicationInstancesWithStatsByApplication(guid string) ([]ApplicationInstanceWithStats, Warnings, error)
- func (actor Actor) GetApplicationRoutes(applicationGUID string) (Routes, Warnings, error)
- func (actor Actor) GetApplicationSummaryByNameAndSpace(name string, spaceGUID string) (ApplicationSummary, Warnings, error)
- func (actor Actor) GetApplicationsBySpace(spaceGUID string) ([]Application, Warnings, error)
- func (actor Actor) GetDomain(domainGUID string) (Domain, Warnings, error)
- func (actor Actor) GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]Domain, Warnings, error)
- func (actor Actor) GetOrganization(guid string) (Organization, Warnings, error)
- func (actor Actor) GetOrganizationByName(orgName string) (Organization, Warnings, error)
- func (actor Actor) GetOrganizationDomains(orgGUID string) ([]Domain, Warnings, error)
- func (actor Actor) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error)
- func (actor Actor) GetOrganizationSpaces(orgGUID string) ([]Space, Warnings, error)
- func (actor Actor) GetOrganizationSummaryByName(orgName string) (OrganizationSummary, Warnings, error)
- func (actor Actor) GetOrganizations() ([]Organization, Warnings, error)
- func (actor Actor) GetOrphanedRoutesBySpace(spaceGUID string) ([]Route, Warnings, error)
- func (actor Actor) GetPrivateDomain(domainGUID string) (Domain, Warnings, error)
- func (actor Actor) GetRecentLogsForApplicationByNameAndSpace(appName string, spaceGUID string, client NOAAClient, config Config) ([]LogMessage, Warnings, error)
- func (actor Actor) GetRouteApplications(routeGUID string) ([]Application, Warnings, error)
- func (actor Actor) GetRouteByHostAndDomain(host string, domainGUID string) (Route, Warnings, error)
- func (actor Actor) GetSSHPasscode() (string, error)
- func (actor Actor) GetSecurityGroupByName(securityGroupName string) (SecurityGroup, Warnings, error)
- func (actor Actor) GetSecurityGroupsWithOrganizationSpaceAndLifecycle(includeStaging bool) ([]SecurityGroupWithOrganizationSpaceAndLifecycle, Warnings, error)
- func (actor Actor) GetServiceBindingByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (ServiceBinding, Warnings, error)
- func (actor Actor) GetServiceInstance(guid string) (ServiceInstance, Warnings, error)
- func (actor Actor) GetServiceInstanceByNameAndSpace(name string, spaceGUID string) (ServiceInstance, Warnings, error)
- func (actor Actor) GetServiceInstancesByApplication(appGUID string) ([]ServiceInstance, Warnings, error)
- func (actor Actor) GetServiceInstancesBySpace(spaceGUID string) ([]ServiceInstance, Warnings, error)
- func (actor Actor) GetSharedDomain(domainGUID string) (Domain, Warnings, error)
- func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error)
- func (actor Actor) GetSpaceQuota(guid string) (SpaceQuota, Warnings, error)
- func (actor Actor) GetSpaceRoutes(spaceGUID string) ([]Route, Warnings, error)
- func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error)
- func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error)
- func (actor Actor) GetSpaceSummaryByOrganizationAndName(orgGUID string, name string, includeStagingSecurityGroupsRules bool) (SpaceSummary, Warnings, error)
- func (actor Actor) GetStack(guid string) (Stack, Warnings, error)
- func (actor Actor) GetStackByName(stackName string) (Stack, Warnings, error)
- func (Actor) GetStreamingLogs(appGUID string, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error)
- func (actor Actor) GetStreamingLogsForApplicationByNameAndSpace(appName string, spaceGUID string, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, Warnings, error)
- func (actor Actor) PollJob(job Job) (Warnings, error)
- func (actor Actor) RefreshAccessToken(refreshToken string) (string, error)
- func (actor Actor) ResourceMatch(allResources []Resource) ([]Resource, []Resource, Warnings, error)
- func (actor Actor) RestageApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, ...)
- func (actor Actor) RestartApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, ...)
- func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType ApplicationHealthCheckType, ...) (Application, Warnings, error)
- func (actor Actor) SetTarget(config Config, settings TargetSettings) (Warnings, error)
- func (actor Actor) StartApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, ...)
- func (actor Actor) UnbindSecurityGroupByNameAndSpace(securityGroupName string, spaceGUID string, ...) (Warnings, error)
- func (actor Actor) UnbindSecurityGroupByNameOrganizationNameAndSpaceName(securityGroupName string, orgName string, spaceName string, ...) (Warnings, error)
- func (actor Actor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (Warnings, error)
- func (actor Actor) UpdateApplication(application Application) (Application, Warnings, error)
- func (actor Actor) UploadApplicationPackage(appGUID string, existingResources []Resource, newResources io.Reader, ...) (Job, Warnings, error)
- func (actor Actor) ZipArchiveResources(sourceArchivePath string, filesToInclude []Resource) (string, error)
- func (actor Actor) ZipDirectoryResources(sourceDir string, filesToInclude []Resource) (string, error)
- type Application
- func (application Application) CalculatedBuildpack() string
- func (application Application) CalculatedCommand() string
- func (application Application) CalculatedHealthCheckEndpoint() string
- func (application Application) StagingCompleted() bool
- func (application Application) StagingFailed() bool
- func (application Application) StagingFailedMessage() string
- func (application Application) StagingFailedNoAppDetected() bool
- func (application Application) Started() bool
- func (application Application) Stopped() bool
- func (application Application) String() string
- type ApplicationHealthCheckType
- type ApplicationInstance
- type ApplicationInstanceState
- type ApplicationInstanceWithStats
- type ApplicationInstancesNotFoundError
- type ApplicationStateChange
- type ApplicationSummary
- type CloudControllerClient
- type Config
- type Domain
- type DomainNotFoundError
- type EmptyDirectoryError
- type FileChangedError
- type InvalidLifecycleError
- type Job
- type LogMessage
- type MultipleOrganizationsFoundError
- type MultipleSpacesFoundError
- type NOAAClient
- type NOAATimeoutError
- type Organization
- type OrganizationNotFoundError
- type OrganizationQuota
- type OrganizationQuotaNotFoundError
- type OrganizationSummary
- type OrphanedRoutesNotFoundError
- type Resource
- type Route
- type RouteAlreadyExistsError
- type RouteInDifferentSpaceError
- type RouteNotFoundError
- type Routes
- type SecurityGroup
- type SecurityGroupNotBoundError
- type SecurityGroupNotFoundError
- type SecurityGroupRule
- type SecurityGroupWithOrganizationSpaceAndLifecycle
- type ServiceBinding
- type ServiceBindingNotFoundError
- type ServiceInstance
- type ServiceInstanceNotFoundError
- type Space
- type SpaceNotFoundError
- type SpaceQuota
- type SpaceQuotaNotFoundError
- type SpaceSummary
- type SpaceWithLifecycle
- type Stack
- type StackNotFoundError
- type TargetSettings
- type UAAClient
- type User
- type Warnings
Constants ¶
const ( DefaultFolderPermissions = 0755 DefaultArchiveFilePermissions = 0744 MaxResourceMatchChunkSize = 1000 )
const StagingLog = "STG"
Variables ¶
var DefaultIgnoreLines = []string{
".cfignore",
".DS_Store",
".git",
".gitignore",
".hg",
".svn",
"_darcs",
"manifest.yaml",
"manifest.yml",
}
Functions ¶
func ActorToCCRoute ¶
Types ¶
type Actor ¶
type Actor struct { CloudControllerClient CloudControllerClient Config Config UAAClient UAAClient // contains filtered or unexported fields }
Actor handles all business logic for Cloud Controller v2 operations.
func NewActor ¶
func NewActor(ccClient CloudControllerClient, uaaClient UAAClient, config Config) *Actor
NewActor returns a new actor.
func (Actor) Authenticate ¶
Authenticate authenticates the user in UAA and sets the returned tokens in the config.
It unsets the currently targeted org and space whether authentication succeeds or not.
func (Actor) BindRouteToApplication ¶
func (Actor) BindSecurityGroupToSpace ¶
func (Actor) BindServiceByApplicationAndServiceInstance ¶
func (actor Actor) BindServiceByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (Warnings, error)
BindServiceByApplicationAndServiceInstance binds the service instance to an application.
func (Actor) BindServiceBySpace ¶
func (actor Actor) BindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string, parameters map[string]interface{}) (Warnings, error)
BindServiceBySpace binds the service instance to an application for a given space.
func (Actor) ClearOrganizationAndSpace ¶
ClearTarget clears the targeted org and space in the config.
func (Actor) ClearTarget ¶
ClearTarget clears target information from the actor.
func (Actor) CloudControllerAPIVersion ¶
CloudControllerAPIVersion returns the Cloud Controller API version.
func (Actor) CreateApplication ¶
func (actor Actor) CreateApplication(application Application) (Application, Warnings, error)
CreateApplication creates an application.
func (Actor) CreateApplicationManifestByNameAndSpace ¶
func (Actor) CreateRoute ¶
func (Actor) CreateRouteWithExistenceCheck ¶
func (Actor) CreateUser ¶
func (actor Actor) CreateUser(username string, password string, origin string) (User, Warnings, error)
CreateUser creates a new user in UAA and registers it with cloud controller.
func (Actor) DeleteOrganization ¶
DeleteOrganization deletes the Organization associated with the provided GUID. Once the deletion request is sent, it polls the deletion job until it's finished.
func (Actor) DeleteRoute ¶
DeleteRoute deletes the Route associated with the provided Route GUID.
func (Actor) DeleteSpaceByNameAndOrganizationName ¶
func (Actor) FindRouteBoundToSpaceWithSettings ¶
FindRouteBoundToSpaceWithSettings finds the route with the given host, domain and space. If it is unable to find the route, it will check if it exists anywhere in the system. When the route exists in another space, RouteInDifferentSpaceError is returned.
func (Actor) GatherArchiveResources ¶
GatherArchiveResources returns a list of resources for an archive.
func (Actor) GatherDirectoryResources ¶
GatherDirectoryResources returns a list of resources for a directory.
func (Actor) GetApplication ¶
func (actor Actor) GetApplication(guid string) (Application, Warnings, error)
GetApplication returns the application.
func (Actor) GetApplicationByNameAndSpace ¶
func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error)
GetApplicationByNameAndSpace returns an application with matching name in the space.
func (Actor) GetApplicationInstancesByApplication ¶
func (Actor) GetApplicationInstancesWithStatsByApplication ¶
func (actor Actor) GetApplicationInstancesWithStatsByApplication(guid string) ([]ApplicationInstanceWithStats, Warnings, error)
func (Actor) GetApplicationRoutes ¶
GetApplicationRoutes returns a list of routes associated with the provided Application GUID.
func (Actor) GetApplicationSummaryByNameAndSpace ¶
func (Actor) GetApplicationsBySpace ¶
func (actor Actor) GetApplicationsBySpace(spaceGUID string) ([]Application, Warnings, error)
GetApplicationsBySpace returns all applications in a space.
func (Actor) GetDomain ¶
GetDomain returns the shared or private domain associated with the provided Domain GUID.
func (Actor) GetDomainsByNameAndOrganization ¶
func (actor Actor) GetDomainsByNameAndOrganization(domainNames []string, orgGUID string) ([]Domain, Warnings, error)
GetDomainsByNameAndOrganization returns back a list of domains given a list of domains and the organization GUID. If no domains are given, than this command will not lookup any domains.
func (Actor) GetOrganization ¶
func (actor Actor) GetOrganization(guid string) (Organization, Warnings, error)
GetOrganization returns an Organization based on the provided guid.
func (Actor) GetOrganizationByName ¶
func (actor Actor) GetOrganizationByName(orgName string) (Organization, Warnings, error)
GetOrganizationByName returns an Organization based off of the name given.
func (Actor) GetOrganizationDomains ¶
GetOrganizationDomains returns the shared and private domains associated with an organization.
func (Actor) GetOrganizationQuota ¶
func (actor Actor) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error)
func (Actor) GetOrganizationSpaces ¶
GetOrganizationSpaces returns a list of spaces in the specified org
func (Actor) GetOrganizationSummaryByName ¶
func (actor Actor) GetOrganizationSummaryByName(orgName string) (OrganizationSummary, Warnings, error)
func (Actor) GetOrganizations ¶
func (actor Actor) GetOrganizations() ([]Organization, Warnings, error)
func (Actor) GetOrphanedRoutesBySpace ¶
GetOrphanedRoutesBySpace returns a list of orphaned routes associated with the provided Space GUID.
func (Actor) GetPrivateDomain ¶
GetPrivateDomain returns the private domain associated with the provided Domain GUID.
func (Actor) GetRecentLogsForApplicationByNameAndSpace ¶
func (actor Actor) GetRecentLogsForApplicationByNameAndSpace(appName string, spaceGUID string, client NOAAClient, config Config) ([]LogMessage, Warnings, error)
func (Actor) GetRouteApplications ¶
func (actor Actor) GetRouteApplications(routeGUID string) ([]Application, Warnings, error)
GetRouteApplications returns a list of apps associated with the provided Route GUID.
func (Actor) GetRouteByHostAndDomain ¶
GetRouteByHostAndDomain returns the HTTP route with the matching host and the associate domain GUID.
func (Actor) GetSSHPasscode ¶
func (Actor) GetSecurityGroupByName ¶
func (actor Actor) GetSecurityGroupByName(securityGroupName string) (SecurityGroup, Warnings, error)
func (Actor) GetSecurityGroupsWithOrganizationSpaceAndLifecycle ¶
func (actor Actor) GetSecurityGroupsWithOrganizationSpaceAndLifecycle(includeStaging bool) ([]SecurityGroupWithOrganizationSpaceAndLifecycle, Warnings, error)
GetSecurityGroupsWithOrganizationSpaceAndLifecycle returns a list of security groups with org and space information, optionally including staging spaces.
func (Actor) GetServiceBindingByApplicationAndServiceInstance ¶
func (actor Actor) GetServiceBindingByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (ServiceBinding, Warnings, error)
GetServiceBindingByApplicationAndServiceInstance returns a service binding given an application GUID and and service instance GUID.
func (Actor) GetServiceInstance ¶
func (actor Actor) GetServiceInstance(guid string) (ServiceInstance, Warnings, error)
func (Actor) GetServiceInstanceByNameAndSpace ¶
func (Actor) GetServiceInstancesByApplication ¶
func (actor Actor) GetServiceInstancesByApplication(appGUID string) ([]ServiceInstance, Warnings, error)
func (Actor) GetServiceInstancesBySpace ¶
func (actor Actor) GetServiceInstancesBySpace(spaceGUID string) ([]ServiceInstance, Warnings, error)
func (Actor) GetSharedDomain ¶
GetSharedDomain returns the shared domain associated with the provided Domain GUID.
func (Actor) GetSpaceByOrganizationAndName ¶
func (actor Actor) GetSpaceByOrganizationAndName(orgGUID string, spaceName string) (Space, Warnings, error)
GetSpaceByOrganizationAndName returns an Space based on the org and name.
func (Actor) GetSpaceQuota ¶
func (actor Actor) GetSpaceQuota(guid string) (SpaceQuota, Warnings, error)
func (Actor) GetSpaceRoutes ¶
GetSpaceRoutes returns a list of routes associated with the provided Space GUID.
func (Actor) GetSpaceRunningSecurityGroupsBySpace ¶
func (actor Actor) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error)
GetSpaceRunningSecurityGroupsBySpace returns a list of all security groups bound to this space in the 'running' lifecycle phase.
func (Actor) GetSpaceStagingSecurityGroupsBySpace ¶
func (actor Actor) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string) ([]SecurityGroup, Warnings, error)
GetSpaceStagingSecurityGroupsBySpace returns a list of all security groups bound to this space in the 'staging' lifecycle phase. with an optional
func (Actor) GetSpaceSummaryByOrganizationAndName ¶
func (Actor) GetStack ¶
GetStack returns the stack information associated with the provided stack GUID.
func (Actor) GetStackByName ¶
GetStackByName returns the provided stack
func (Actor) GetStreamingLogs ¶
func (Actor) GetStreamingLogs(appGUID string, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error)
func (Actor) GetStreamingLogsForApplicationByNameAndSpace ¶
func (actor Actor) GetStreamingLogsForApplicationByNameAndSpace(appName string, spaceGUID string, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, Warnings, error)
func (Actor) RefreshAccessToken ¶
func (Actor) ResourceMatch ¶
ResourceMatch returns a set of matched resources and unmatched resources in the order they were given in allResources.
func (Actor) RestageApplication ¶
func (actor Actor) RestageApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error)
RestageApplication restarts a given application. If already stopped, no stop call will be sent.
func (Actor) RestartApplication ¶
func (actor Actor) RestartApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error)
RestartApplication restarts a given application. If already stopped, no stop call will be sent.
func (Actor) SetApplicationHealthCheckTypeByNameAndSpace ¶
func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType ApplicationHealthCheckType, httpEndpoint string) (Application, Warnings, error)
SetApplicationHealthCheckTypeByNameAndSpace updates an application's health check type if it is not already the desired type.
func (Actor) SetTarget ¶
func (actor Actor) SetTarget(config Config, settings TargetSettings) (Warnings, error)
SetTarget targets the Cloud Controller using the client and sets target information in the actor based on the response.
func (Actor) StartApplication ¶
func (actor Actor) StartApplication(app Application, client NOAAClient, config Config) (<-chan *LogMessage, <-chan error, <-chan ApplicationStateChange, <-chan string, <-chan error)
StartApplication restarts a given application. If already stopped, no stop call will be sent.
func (Actor) UnbindSecurityGroupByNameAndSpace ¶
func (Actor) UnbindSecurityGroupByNameOrganizationNameAndSpaceName ¶
func (Actor) UnbindServiceBySpace ¶
func (actor Actor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (Warnings, error)
UnbindServiceBySpace deletes the service binding between an application and service instance for a given space.
func (Actor) UpdateApplication ¶
func (actor Actor) UpdateApplication(application Application) (Application, Warnings, error)
UpdateApplication updates an application.
func (Actor) UploadApplicationPackage ¶
func (Actor) ZipArchiveResources ¶
func (actor Actor) ZipArchiveResources(sourceArchivePath string, filesToInclude []Resource) (string, error)
ZipArchiveResources zips an archive and a sorted (based on full path/filename) list of resources and returns the location. On Windows, the filemode for user is forced to be readable and executable.
func (Actor) ZipDirectoryResources ¶
func (actor Actor) ZipDirectoryResources(sourceDir string, filesToInclude []Resource) (string, error)
ZipDirectoryResources zips a directory and a sorted (based on full path/filename) list of resources and returns the location. On Windows, the filemode for user is forced to be readable and executable.
type Application ¶
type Application ccv2.Application
Application represents an application.
func (Application) CalculatedBuildpack ¶
func (application Application) CalculatedBuildpack() string
CalculatedBuildpack returns the buildpack that will be used.
func (Application) CalculatedCommand ¶
func (application Application) CalculatedCommand() string
CalculatedCommand returns the command that will be used.
func (Application) CalculatedHealthCheckEndpoint ¶
func (application Application) CalculatedHealthCheckEndpoint() string
CalculatedHealthCheckEndpoint returns the health check endpoint. If the health check type is not http it will return the empty string.
func (Application) StagingCompleted ¶
func (application Application) StagingCompleted() bool
StagingCompleted returns true if the application has been staged.
func (Application) StagingFailed ¶
func (application Application) StagingFailed() bool
StagingFailed returns true if staging the application failed.
func (Application) StagingFailedMessage ¶
func (application Application) StagingFailedMessage() string
StagingFailedMessage returns the verbose description of the failure or the reason if the verbose description is empty.
func (Application) StagingFailedNoAppDetected ¶
func (application Application) StagingFailedNoAppDetected() bool
StagingFailedNoAppDetected returns true when the staging failed due to a NoAppDetectedError.
func (Application) Started ¶
func (application Application) Started() bool
Started returns true when the application is started.
func (Application) Stopped ¶
func (application Application) Stopped() bool
Stopped returns true when the application is stopped.
func (Application) String ¶
func (application Application) String() string
type ApplicationHealthCheckType ¶
type ApplicationHealthCheckType ccv2.ApplicationHealthCheckType
type ApplicationInstance ¶
type ApplicationInstance ccv2.ApplicationInstance
func (ApplicationInstance) Crashed ¶
func (instance ApplicationInstance) Crashed() bool
func (ApplicationInstance) Flapping ¶
func (instance ApplicationInstance) Flapping() bool
func (ApplicationInstance) Running ¶
func (instance ApplicationInstance) Running() bool
type ApplicationInstanceState ¶
type ApplicationInstanceState ccv2.ApplicationInstanceState
type ApplicationInstanceWithStats ¶
type ApplicationInstanceWithStats struct { // CPU is the instance's CPU utilization percentage. CPU float64 // Details are arbitrary information about the instance. Details string // Disk is the instance's disk usage in bytes. Disk int // DiskQuota is the instance's allowed disk usage in bytes. DiskQuota int // ID is the instance ID. ID int // IsolationSegment that the app instance is currently running on. IsolationSegment string // Memory is the instance's memory usage in bytes. Memory int // MemoryQuota is the instance's allowed memory usage in bytes. MemoryQuota int // Since is the Unix time stamp that represents the time the instance was // created. Since float64 // State is the instance's state. State ApplicationInstanceState }
func (ApplicationInstanceWithStats) TimeSinceCreation ¶
func (instance ApplicationInstanceWithStats) TimeSinceCreation() time.Time
type ApplicationInstancesNotFoundError ¶
type ApplicationInstancesNotFoundError struct {
ApplicationGUID string
}
ApplicationInstancesNotFoundError is returned when the application does not have running instances.
func (ApplicationInstancesNotFoundError) Error ¶
func (e ApplicationInstancesNotFoundError) Error() string
type ApplicationStateChange ¶
type ApplicationStateChange string
const ( ApplicationStateStopping ApplicationStateChange = "stopping" ApplicationStateStaging ApplicationStateChange = "staging" ApplicationStateStarting ApplicationStateChange = "starting" )
type ApplicationSummary ¶
type ApplicationSummary struct { Application Stack Stack IsolationSegment string RunningInstances []ApplicationInstanceWithStats Routes []Route }
func (ApplicationSummary) StartingOrRunningInstanceCount ¶
func (app ApplicationSummary) StartingOrRunningInstanceCount() int
type CloudControllerClient ¶
type CloudControllerClient interface { AssociateSpaceWithRunningSecurityGroup(securityGroupGUID string, spaceGUID string) (ccv2.Warnings, error) AssociateSpaceWithStagingSecurityGroup(securityGroupGUID string, spaceGUID string) (ccv2.Warnings, error) BindRouteToApplication(routeGUID string, appGUID string) (ccv2.Route, ccv2.Warnings, error) CheckRoute(route ccv2.Route) (bool, ccv2.Warnings, error) CreateApplication(app ccv2.Application) (ccv2.Application, ccv2.Warnings, error) CreateRoute(route ccv2.Route, generatePort bool) (ccv2.Route, ccv2.Warnings, error) CreateServiceBinding(appGUID string, serviceBindingGUID string, parameters map[string]interface{}) (ccv2.ServiceBinding, ccv2.Warnings, error) CreateUser(uaaUserID string) (ccv2.User, ccv2.Warnings, error) DeleteOrganization(orgGUID string) (ccv2.Job, ccv2.Warnings, error) DeleteRoute(routeGUID string) (ccv2.Warnings, error) DeleteServiceBinding(serviceBindingGUID string) (ccv2.Warnings, error) DeleteSpace(spaceGUID string) (ccv2.Job, ccv2.Warnings, error) GetApplication(guid string) (ccv2.Application, ccv2.Warnings, error) GetApplicationInstancesByApplication(guid string) (map[int]ccv2.ApplicationInstance, ccv2.Warnings, error) GetApplicationInstanceStatusesByApplication(guid string) (map[int]ccv2.ApplicationInstanceStatus, ccv2.Warnings, error) GetApplicationRoutes(appGUID string, queries ...ccv2.Query) ([]ccv2.Route, ccv2.Warnings, error) GetApplications(queries ...ccv2.Query) ([]ccv2.Application, ccv2.Warnings, error) GetJob(jobGUID string) (ccv2.Job, ccv2.Warnings, error) GetOrganization(guid string) (ccv2.Organization, ccv2.Warnings, error) GetOrganizationPrivateDomains(orgGUID string, queries ...ccv2.Query) ([]ccv2.Domain, ccv2.Warnings, error) GetOrganizationQuota(guid string) (ccv2.OrganizationQuota, ccv2.Warnings, error) GetOrganizations(queries ...ccv2.Query) ([]ccv2.Organization, ccv2.Warnings, error) GetPrivateDomain(domainGUID string) (ccv2.Domain, ccv2.Warnings, error) GetRouteApplications(routeGUID string, queries ...ccv2.Query) ([]ccv2.Application, ccv2.Warnings, error) GetRoutes(queries ...ccv2.Query) ([]ccv2.Route, ccv2.Warnings, error) GetRunningSpacesBySecurityGroup(securityGroupGUID string) ([]ccv2.Space, ccv2.Warnings, error) GetSecurityGroups(queries ...ccv2.Query) ([]ccv2.SecurityGroup, ccv2.Warnings, error) GetServiceBindings(queries ...ccv2.Query) ([]ccv2.ServiceBinding, ccv2.Warnings, error) GetServiceInstance(serviceInstanceGUID string) (ccv2.ServiceInstance, ccv2.Warnings, error) GetServiceInstances(queries ...ccv2.Query) ([]ccv2.ServiceInstance, ccv2.Warnings, error) GetSpaceQuota(guid string) (ccv2.SpaceQuota, ccv2.Warnings, error) GetSpaceRoutes(spaceGUID string, queries ...ccv2.Query) ([]ccv2.Route, ccv2.Warnings, error) GetSpaceRunningSecurityGroupsBySpace(spaceGUID string, queries ...ccv2.Query) ([]ccv2.SecurityGroup, ccv2.Warnings, error) GetSpaces(queries ...ccv2.Query) ([]ccv2.Space, ccv2.Warnings, error) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, queries ...ccv2.Query) ([]ccv2.ServiceInstance, ccv2.Warnings, error) GetSpaceStagingSecurityGroupsBySpace(spaceGUID string, queries ...ccv2.Query) ([]ccv2.SecurityGroup, ccv2.Warnings, error) GetStack(guid string) (ccv2.Stack, ccv2.Warnings, error) GetStacks(queries ...ccv2.Query) ([]ccv2.Stack, ccv2.Warnings, error) GetStagingSpacesBySecurityGroup(securityGroupGUID string) ([]ccv2.Space, ccv2.Warnings, error) PollJob(job ccv2.Job) (ccv2.Warnings, error) RemoveSpaceFromRunningSecurityGroup(securityGroupGUID string, spaceGUID string) (ccv2.Warnings, error) RemoveSpaceFromStagingSecurityGroup(securityGroupGUID string, spaceGUID string) (ccv2.Warnings, error) ResourceMatch(resourcesToMatch []ccv2.Resource) ([]ccv2.Resource, ccv2.Warnings, error) RestageApplication(app ccv2.Application) (ccv2.Application, ccv2.Warnings, error) TargetCF(settings ccv2.TargetSettings) (ccv2.Warnings, error) UpdateApplication(app ccv2.Application) (ccv2.Application, ccv2.Warnings, error) UploadApplicationPackage(appGUID string, existingResources []ccv2.Resource, newResources ccv2.Reader, newResourcesLength int64) (ccv2.Job, ccv2.Warnings, error) API() string APIVersion() string AuthorizationEndpoint() string DopplerEndpoint() string MinCLIVersion() string RoutingEndpoint() string TokenEndpoint() string }
CloudControllerClient is a Cloud Controller V2 client.
type Config ¶
type Config interface { AccessToken() string PollingInterval() time.Duration RefreshToken() string SSHOAuthClient() string SetAccessToken(accessToken string) SetRefreshToken(refreshToken string) SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, routing string, skipSSLValidation bool) SetTokenInformation(accessToken string, refreshToken string, sshOAuthClient string) SkipSSLValidation() bool StagingTimeout() time.Duration StartupTimeout() time.Duration Target() string UnsetOrganizationInformation() UnsetSpaceInformation() Verbose() (bool, []string) }
type Domain ¶
Domain represents a CLI Domain.
type DomainNotFoundError ¶
DomainNotFoundError is an error wrapper that represents the case when the domain is not found.
func (DomainNotFoundError) Error ¶
func (e DomainNotFoundError) Error() string
Error method to display the error message.
type EmptyDirectoryError ¶
type EmptyDirectoryError struct {
Path string
}
func (EmptyDirectoryError) Error ¶
func (e EmptyDirectoryError) Error() string
type FileChangedError ¶
type FileChangedError struct {
Filename string
}
func (FileChangedError) Error ¶
func (e FileChangedError) Error() string
type InvalidLifecycleError ¶
type InvalidLifecycleError struct {
// contains filtered or unexported fields
}
InvalidLifecycleError is returned when the lifecycle specified is neither running nor staging.
func (InvalidLifecycleError) Error ¶
func (e InvalidLifecycleError) Error() string
type LogMessage ¶
type LogMessage struct {
// contains filtered or unexported fields
}
func NewLogMessage ¶
func (LogMessage) Message ¶
func (log LogMessage) Message() string
func (LogMessage) SourceInstance ¶
func (log LogMessage) SourceInstance() string
func (LogMessage) SourceType ¶
func (log LogMessage) SourceType() string
func (LogMessage) Staging ¶
func (log LogMessage) Staging() bool
func (LogMessage) Timestamp ¶
func (log LogMessage) Timestamp() time.Time
func (LogMessage) Type ¶
func (log LogMessage) Type() string
type MultipleOrganizationsFoundError ¶
MultipleOrganizationsFoundError represents the scenario when the cloud controller returns multiple organizations when filtering by name. This is a far out edge case and should not happen.
func (MultipleOrganizationsFoundError) Error ¶
func (e MultipleOrganizationsFoundError) Error() string
type MultipleSpacesFoundError ¶
MultipleSpacesFoundError represents the scenario when the cloud controller returns multiple spaces when filtering by name. This is a far out edge case and should not happen.
func (MultipleSpacesFoundError) Error ¶
func (e MultipleSpacesFoundError) Error() string
type NOAAClient ¶
type NOAAClient interface { Close() error RecentLogs(appGuid string, authToken string) ([]*events.LogMessage, error) TailingLogs(appGuid, authToken string) (<-chan *events.LogMessage, <-chan error) }
NOAAClient is a client for getting logs.
type NOAATimeoutError ¶
type NOAATimeoutError struct{}
func (NOAATimeoutError) Error ¶
func (NOAATimeoutError) Error() string
type OrganizationNotFoundError ¶
OrganizationNotFoundError represents the scenario when the organization searched for could not be found.
func (OrganizationNotFoundError) Error ¶
func (e OrganizationNotFoundError) Error() string
type OrganizationQuota ¶
type OrganizationQuota ccv2.OrganizationQuota
type OrganizationQuotaNotFoundError ¶
type OrganizationQuotaNotFoundError struct {
GUID string
}
func (OrganizationQuotaNotFoundError) Error ¶
func (e OrganizationQuotaNotFoundError) Error() string
type OrganizationSummary ¶
type OrganizationSummary struct { Organization QuotaName string DomainNames []string SpaceNames []string }
type OrphanedRoutesNotFoundError ¶
type OrphanedRoutesNotFoundError struct{}
OrphanedRoutesNotFoundError is an error wrapper that represents the case when no orphaned routes are found.
func (OrphanedRoutesNotFoundError) Error ¶
func (OrphanedRoutesNotFoundError) Error() string
Error method to display the error message.
type Route ¶
type Route struct { Domain Domain GUID string Host string Path string Port types.NullInt SpaceGUID string }
Route represents a CLI Route.
type RouteAlreadyExistsError ¶
type RouteAlreadyExistsError struct {
Route Route
}
RouteAlreadyExistsError is returned when a route already exists
func (RouteAlreadyExistsError) Error ¶
func (e RouteAlreadyExistsError) Error() string
type RouteInDifferentSpaceError ¶
type RouteInDifferentSpaceError struct {
Route string
}
RouteInDifferentSpaceError is returned when the route exists in a different space than the one requesting it.
func (RouteInDifferentSpaceError) Error ¶
func (RouteInDifferentSpaceError) Error() string
type RouteNotFoundError ¶
RouteNotFoundError is returned when a route cannot be found
func (RouteNotFoundError) Error ¶
func (e RouteNotFoundError) Error() string
type SecurityGroup ¶
type SecurityGroup ccv2.SecurityGroup
SecurityGroup represents a CF SecurityGroup.
type SecurityGroupNotBoundError ¶
type SecurityGroupNotBoundError struct { Lifecycle ccv2.SecurityGroupLifecycle Name string }
SecurityGroupNotBoundError is returned when a requested security group is not bound in the requested lifecycle phase to the requested space.
func (SecurityGroupNotBoundError) Error ¶
func (e SecurityGroupNotBoundError) Error() string
type SecurityGroupNotFoundError ¶
type SecurityGroupNotFoundError struct {
Name string
}
SecurityGroupNotFoundError is returned when a requested security group is not found.
func (SecurityGroupNotFoundError) Error ¶
func (e SecurityGroupNotFoundError) Error() string
type SecurityGroupRule ¶
type SecurityGroupWithOrganizationSpaceAndLifecycle ¶
type SecurityGroupWithOrganizationSpaceAndLifecycle struct { SecurityGroup *SecurityGroup Organization *Organization Space *Space Lifecycle ccv2.SecurityGroupLifecycle }
SecurityGroupWithOrganizationSpaceAndLifecycle represents a security group with organization and space information.
type ServiceBinding ¶
type ServiceBinding ccv2.ServiceBinding
ServiceBinding represents the link between a service instance and an application.
type ServiceBindingNotFoundError ¶
ServiceBindingNotFoundError is returned when a service binding cannot be found.
func (ServiceBindingNotFoundError) Error ¶
func (e ServiceBindingNotFoundError) Error() string
type ServiceInstance ¶
type ServiceInstance ccv2.ServiceInstance
ServiceInstance represents an instance of a service.
type ServiceInstanceNotFoundError ¶
func (ServiceInstanceNotFoundError) Error ¶
func (e ServiceInstanceNotFoundError) Error() string
type SpaceNotFoundError ¶
SpaceNotFoundError represents the scenario when the space searched for could not be found.
func (SpaceNotFoundError) Error ¶
func (e SpaceNotFoundError) Error() string
type SpaceQuota ¶
type SpaceQuota ccv2.SpaceQuota
type SpaceQuotaNotFoundError ¶
type SpaceQuotaNotFoundError struct {
GUID string
}
func (SpaceQuotaNotFoundError) Error ¶
func (e SpaceQuotaNotFoundError) Error() string
type SpaceSummary ¶
type SpaceWithLifecycle ¶
type SpaceWithLifecycle struct { ccv2.Space Lifecycle ccv2.SecurityGroupLifecycle }
type StackNotFoundError ¶
StackNotFoundError is returned when a requested stack is not found.
func (StackNotFoundError) Error ¶
func (e StackNotFoundError) Error() string
type TargetSettings ¶
type TargetSettings ccv2.TargetSettings
type UAAClient ¶
type UAAClient interface { Authenticate(username string, password string) (string, string, error) CreateUser(username string, password string, origin string) (uaa.User, error) GetSSHPasscode(accessToken string, sshOAuthClient string) (string, error) RefreshAccessToken(refreshToken string) (uaa.RefreshedTokens, error) }
Source Files ¶
- actor.go
- application.go
- application_instance.go
- application_instance_with_stats.go
- application_summary.go
- auth.go
- cloud_controller_client.go
- config.go
- domain.go
- fix_mode_unix.go
- job.go
- logging.go
- manifest.go
- noaa_client.go
- organization.go
- organization_quota.go
- organization_summary.go
- resource.go
- route.go
- security_group.go
- service_binding.go
- service_instance.go
- space.go
- space_quota.go
- space_summary.go
- ssh.go
- stack.go
- target.go
- token.go
- uaa_client.go
- user.go
- version.go