Documentation ¶
Overview ¶
Package v2action contains the business logic for the commands/v2 package
Index ¶
- type Actor
- func (actor Actor) ClearOrganizationAndSpace(config Config)
- func (actor Actor) ClearTarget(config Config)
- func (actor Actor) DeleteOrganization(orgName string) (Warnings, error)
- func (actor Actor) DeleteRoute(routeGUID string) (Warnings, error)
- func (actor Actor) GetApplicationByNameAndSpace(name string, spaceGUID string) (Application, Warnings, error)
- func (actor Actor) GetApplicationInstancesByApplication(guid string) ([]ApplicationInstance, Warnings, error)
- func (actor Actor) GetApplicationRoutes(applicationGUID string, query []ccv2.Query) ([]Route, Warnings, error)
- func (actor Actor) GetApplicationSummaryByNameAndSpace(name string, spaceGUID string) (ApplicationSummary, Warnings, error)
- func (actor Actor) GetDomain(domainGUID string) (Domain, Warnings, error)
- func (actor Actor) GetOrganizationByName(orgName string) (Organization, Warnings, error)
- func (actor Actor) GetOrganizationSpaces(orgGUID string) ([]Space, Warnings, error)
- func (actor Actor) GetOrphanedRoutesBySpace(spaceGUID string) ([]Route, Warnings, error)
- func (actor Actor) GetPrivateDomain(domainGUID string) (Domain, Warnings, error)
- func (actor Actor) GetRouteApplications(routeGUID string, query []ccv2.Query) ([]Application, Warnings, error)
- func (actor Actor) GetServiceBindingByApplicationAndServiceInstance(appGUID string, serviceInstanceGUID string) (ServiceBinding, Warnings, error)
- func (actor Actor) GetServiceInstanceByNameAndSpace(name string, 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) GetSpaceRoutes(spaceGUID string, query []ccv2.Query) ([]Route, Warnings, error)
- func (actor Actor) GetStack(guid string) (Stack, Warnings, error)
- func (actor Actor) NewUser(username string, password string, origin string) (User, Warnings, error)
- func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType string, httpEndpoint string) (Application, Warnings, error)
- func (actor Actor) SetTarget(config Config, settings TargetSettings) (Warnings, error)
- func (actor Actor) UnbindServiceBySpace(appName string, serviceInstanceName string, spaceGUID string) (Warnings, error)
- type Application
- type ApplicationInstance
- type ApplicationInstanceState
- type ApplicationInstancesNotFoundError
- type ApplicationNotFoundError
- type ApplicationSummary
- type CloudControllerClient
- type Config
- type Domain
- type DomainNotFoundError
- type HTTPHealthCheckInvalidError
- type MultipleOrganizationsFoundError
- type MultipleSpacesFoundError
- type Organization
- type OrganizationNotFoundError
- type OrphanedRoutesNotFoundError
- type Route
- type ServiceBinding
- type ServiceBindingNotFoundError
- type ServiceInstance
- type ServiceInstanceNotFoundError
- type Space
- type SpaceNotFoundError
- type Stack
- type StackNotFoundError
- type TargetSettings
- type UAAClient
- type User
- type Warnings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { CloudControllerClient CloudControllerClient UAAClient UAAClient }
Actor handles all business logic for Cloud Controller v2 operations.
func NewActor ¶
func NewActor(ccClient CloudControllerClient, uaaClient UAAClient) Actor
NewActor returns a new actor.
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) 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) 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 Actor) GetApplicationInstancesByApplication(guid string) ([]ApplicationInstance, Warnings, error)
func (Actor) GetApplicationRoutes ¶
func (actor Actor) GetApplicationRoutes(applicationGUID string, query []ccv2.Query) ([]Route, Warnings, error)
GetApplicationRoutes returns a list of routes associated with the provided Application GUID
func (Actor) GetApplicationSummaryByNameAndSpace ¶
func (Actor) GetDomain ¶
GetDomain returns the shared or private domain associated with the provided Domain 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) GetOrganizationSpaces ¶
GetOrganizationSpaces returns a list of spaces in the specified org
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) GetRouteApplications ¶
func (actor Actor) GetRouteApplications(routeGUID string, query []ccv2.Query) ([]Application, Warnings, error)
GetRouteApplications returns a list of apps associated with the provided Route GUID.
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) GetServiceInstanceByNameAndSpace ¶
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) GetSpaceRoutes ¶
GetSpaceRoutes returns a list of routes associated with the provided Space GUID
func (Actor) GetStack ¶
GetStack returns the stack information associated with the provided stack GUID.
func (Actor) SetApplicationHealthCheckTypeByNameAndSpace ¶
func (actor Actor) SetApplicationHealthCheckTypeByNameAndSpace(name string, spaceGUID string, healthCheckType string, httpEndpoint string) (Application, Warnings, error)
SetApplicationHealthCheckTypeByNameAndSpace updates an application's health check type if it is not already the desired type.
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) 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) Started ¶
func (application Application) Started() bool
Started returns true when the application is started.
type ApplicationInstance ¶
type ApplicationInstance 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 // 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 (ApplicationInstance) TimeSinceCreation ¶
func (instance ApplicationInstance) TimeSinceCreation() time.Time
type ApplicationInstanceState ¶
type ApplicationInstanceState ccv2.ApplicationInstanceState
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 ApplicationNotFoundError ¶
type ApplicationNotFoundError struct {
Name string
}
ApplicationNotFoundError is returned when a requested application is not found.
func (ApplicationNotFoundError) Error ¶
func (e ApplicationNotFoundError) Error() string
type ApplicationSummary ¶
type ApplicationSummary struct { Application Stack Stack RunningInstances []ApplicationInstance Routes []Route }
type CloudControllerClient ¶
type CloudControllerClient interface { DeleteOrganization(orgGUID string) (ccv2.Job, ccv2.Warnings, error) DeleteRoute(routeGUID string) (ccv2.Warnings, error) DeleteServiceBinding(serviceBindingGUID string) (ccv2.Warnings, error) GetApplicationInstanceStatusesByApplication(guid string) (map[int]ccv2.ApplicationInstanceStatus, ccv2.Warnings, error) GetApplicationInstancesByApplication(guid string) (map[int]ccv2.ApplicationInstance, 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) 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) GetServiceBindings(queries []ccv2.Query) ([]ccv2.ServiceBinding, ccv2.Warnings, error) GetServiceInstances(queries []ccv2.Query) ([]ccv2.ServiceInstance, ccv2.Warnings, error) GetSpaceRoutes(spaceGUID string, queries []ccv2.Query) ([]ccv2.Route, ccv2.Warnings, error) GetSpaceServiceInstances(spaceGUID string, includeUserProvidedServices bool, queries []ccv2.Query) ([]ccv2.ServiceInstance, ccv2.Warnings, error) GetSpaces(queries []ccv2.Query) ([]ccv2.Space, ccv2.Warnings, error) GetStack(guid string) (ccv2.Stack, ccv2.Warnings, error) NewUser(uaaUserID string) (ccv2.User, ccv2.Warnings, error) PollJob(job ccv2.Job) (ccv2.Warnings, error) TargetCF(settings ccv2.TargetSettings) (ccv2.Warnings, error) UpdateApplication(app ccv2.Application) (ccv2.Application, 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 { UnsetOrganizationInformation() UnsetSpaceInformation() SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, uaa string, routing string, skipSSLValidation bool) SetTokenInformation(accessToken string, refreshToken string, sshOAuthClient string) SkipSSLValidation() bool Target() string }
type DomainNotFoundError ¶
type DomainNotFoundError struct{}
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 HTTPHealthCheckInvalidError ¶
type HTTPHealthCheckInvalidError struct { }
HTTPHealthCheckInvalidError is returned when an HTTP endpoint is used with a health check type that is not HTTP.
func (HTTPHealthCheckInvalidError) Error ¶
func (e HTTPHealthCheckInvalidError) Error() 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 OrganizationNotFoundError ¶
type OrganizationNotFoundError struct {
Name string
}
OrganizationNotFoundError represents the scenario when the organization searched for could not be found.
func (OrganizationNotFoundError) Error ¶
func (e OrganizationNotFoundError) Error() 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 (e OrphanedRoutesNotFoundError) Error() string
Error method to display the error message.
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 ¶
type ServiceInstanceNotFoundError struct {
Name string
}
func (ServiceInstanceNotFoundError) Error ¶
func (e ServiceInstanceNotFoundError) Error() string
type SpaceNotFoundError ¶
type SpaceNotFoundError struct {
Name string
}
SpaceFoundError represents the scenario when the space searched for could not be found.
func (SpaceNotFoundError) Error ¶
func (e SpaceNotFoundError) Error() string
type StackNotFoundError ¶
type StackNotFoundError struct {
GUID string
}
StackNotFoundError is returned when a requested stack is not found.
func (StackNotFoundError) Error ¶
func (e StackNotFoundError) Error() string
type TargetSettings ¶
type TargetSettings ccv2.TargetSettings
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter
|
This file was generated by counterfeiter |