Documentation ¶
Overview ¶
Package ccv3 represents a Cloud Controller V3 client.
These sets of packages are still under development/pre-pre-pre...alpha. Use at your own risk! Functionality and design may change without warning.
It is currently designed to support Cloud Controller API 3.0.0. However, it may include features and endpoints of later API versions.
For more information on the Cloud Controller API see https://apidocs.cloudfoundry.org/
Method Naming Conventions ¶
The client takes a '<Action Name><Top Level Endpoint><Return Value>' approach to method names. If the <Top Level Endpoint> and <Return Value> are similar, they do not need to be repeated. If a GUID is required for the <Top Level Endpoint>, the pluralization is removed from said endpoint in the method name.
Additionally, if the endpoint is an "action" endpoint, do not include the word "Action" in the method name.
For Example:
Method Name: GetApplication Endpoint: /v3/applications/:guid Action Name: Get Top Level Endpoint: applications Return Value: Application Method Name: GetServiceInstances Endpoint: /v3/service_instances Action Name: Get Top Level Endpoint: service_instances Return Value: []ServiceInstance Method Name: GetSpaceServiceInstances Endpoint: /v3/spaces/:guid/service_instances Action Name: Get Top Level Endpoint: spaces Return Value: []ServiceInstance Method Name: CreateApplicationTask Endpoint: /v3/apps/:application_guid/task Action Name: Post Top Level Endpoint: apps Return Value: Task
Use the following table to determine which HTTP Command equates to which Action Name:
HTTP Command -> Action Name POST -> Create OR Update* GET -> Get PUT -> Update DELETE -> Delete PATCH -> Update
* - In some cases POSTs are updating resources, in these cases the method should be called Update, not Create.
Method Locations ¶
Methods exist in the same file as their return type, regardless of which endpoint they use.
Error Handling ¶
All error handling that requires parsing the error_code/code returned back from the Cloud Controller should be placed in the errorWrapper. Everything else can be handled in the individual operations. All parsed cloud controller errors should exist in errors.go, all generic HTTP errors should exist in the cloudcontroller's errors.go. Errors related to the individual operation should exist at the top of that operation's file.
Index ¶
- func FormatQueryParameters(queries []Query) url.Values
- type Checksum
- type Client
- func (client *Client) ApplyOrganizationQuota(quotaGuid, orgGuid string) (resources.RelationshipList, Warnings, error)
- func (client Client) ApplySpaceQuota(quotaGUID string, spaceGUID string) (resources.RelationshipList, Warnings, error)
- func (client *Client) CancelDeployment(deploymentGUID string) (Warnings, error)
- func (client Client) CheckRoute(domainGUID string, hostname string, path string, port int) (bool, Warnings, error)
- func (client *Client) CopyPackage(sourcePkgGUID string, targetAppGUID string) (resources.Package, Warnings, error)
- func (client *Client) CreateApplication(app resources.Application) (resources.Application, Warnings, error)
- func (client *Client) CreateApplicationDeployment(appGUID string, dropletGUID string) (string, Warnings, error)
- func (client *Client) CreateApplicationDeploymentByRevision(appGUID string, revisionGUID string) (string, Warnings, error)
- func (client *Client) CreateApplicationProcessScale(appGUID string, process resources.Process) (resources.Process, Warnings, error)
- func (client *Client) CreateApplicationTask(appGUID string, task resources.Task) (resources.Task, Warnings, error)
- func (client *Client) CreateBuild(build resources.Build) (resources.Build, Warnings, error)
- func (client *Client) CreateBuildpack(bp resources.Buildpack) (resources.Buildpack, Warnings, error)
- func (client Client) CreateDomain(domain resources.Domain) (resources.Domain, Warnings, error)
- func (client *Client) CreateDroplet(appGUID string) (resources.Droplet, Warnings, error)
- func (client *Client) CreateIsolationSegment(isolationSegment resources.IsolationSegment) (resources.IsolationSegment, Warnings, error)
- func (client *Client) CreateOrganization(orgName string) (resources.Organization, Warnings, error)
- func (client *Client) CreateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, Warnings, error)
- func (client *Client) CreatePackage(pkg resources.Package) (resources.Package, Warnings, error)
- func (client *Client) CreateRole(roleSpec resources.Role) (resources.Role, Warnings, error)
- func (client Client) CreateRoute(route resources.Route) (resources.Route, Warnings, error)
- func (client *Client) CreateRouteBinding(binding resources.RouteBinding) (JobURL, Warnings, error)
- func (client *Client) CreateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, Warnings, error)
- func (client *Client) CreateServiceBroker(serviceBroker resources.ServiceBroker) (JobURL, Warnings, error)
- func (client *Client) CreateServiceCredentialBinding(binding resources.ServiceCredentialBinding) (JobURL, Warnings, error)
- func (client *Client) CreateServiceInstance(serviceInstance resources.ServiceInstance) (JobURL, Warnings, error)
- func (client *Client) CreateSpace(space resources.Space) (resources.Space, Warnings, error)
- func (client Client) CreateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, Warnings, error)
- func (client *Client) CreateUser(uaaUserID string) (resources.User, Warnings, error)
- func (client *Client) DeleteApplication(appGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteApplicationProcessInstance(appGUID string, processType string, instanceIndex int) (Warnings, error)
- func (client Client) DeleteBuildpack(buildpackGUID string) (JobURL, Warnings, error)
- func (client Client) DeleteDomain(domainGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteIsolationSegment(guid string) (Warnings, error)
- func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error)
- func (client *Client) DeleteOrganization(orgGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteOrganizationQuota(quotaGUID string) (JobURL, Warnings, error)
- func (client Client) DeleteOrphanedRoutes(spaceGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteRole(roleGUID string) (JobURL, Warnings, error)
- func (client Client) DeleteRoute(routeGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteRouteBinding(guid string) (JobURL, Warnings, error)
- func (client *Client) DeleteSecurityGroup(securityGroupGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteServiceBroker(serviceBrokerGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteServiceCredentialBinding(guid string) (JobURL, Warnings, error)
- func (client *Client) DeleteServiceInstance(serviceInstanceGUID string, query ...Query) (JobURL, Warnings, error)
- func (client *Client) DeleteServicePlanVisibility(servicePlanGUID, organizationGUID string) (Warnings, error)
- func (client *Client) DeleteSpace(spaceGUID string) (JobURL, Warnings, error)
- func (client Client) DeleteSpaceQuota(spaceQuotaGUID string) (JobURL, Warnings, error)
- func (client *Client) DeleteUser(uaaUserID string) (JobURL, Warnings, error)
- func (client *Client) DownloadDroplet(dropletGUID string) ([]byte, Warnings, error)
- func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (resources.RelationshipList, Warnings, error)
- func (client *Client) GetAppFeature(appGUID string, featureName string) (resources.ApplicationFeature, Warnings, error)
- func (client *Client) GetApplicationByNameAndSpace(appName string, spaceGUID string) (resources.Application, Warnings, error)
- func (client *Client) GetApplicationDropletCurrent(appGUID string) (resources.Droplet, Warnings, error)
- func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error)
- func (client *Client) GetApplicationManifest(appGUID string) ([]byte, Warnings, error)
- func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (resources.Process, Warnings, error)
- func (client *Client) GetApplicationProcesses(appGUID string) ([]resources.Process, Warnings, error)
- func (client *Client) GetApplicationRevisions(appGUID string, query ...Query) ([]resources.Revision, Warnings, error)
- func (client *Client) GetApplicationRevisionsDeployed(appGUID string) ([]resources.Revision, Warnings, error)
- func (client Client) GetApplicationRoutes(appGUID string) ([]resources.Route, Warnings, error)
- func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]resources.Task, Warnings, error)
- func (client *Client) GetApplications(query ...Query) ([]resources.Application, Warnings, error)
- func (client *Client) GetBuild(guid string) (resources.Build, Warnings, error)
- func (client *Client) GetBuildpacks(query ...Query) ([]resources.Buildpack, Warnings, error)
- func (client *Client) GetDefaultDomain(orgGUID string) (resources.Domain, Warnings, error)
- func (client *Client) GetDeployment(deploymentGUID string) (resources.Deployment, Warnings, error)
- func (client *Client) GetDeployments(query ...Query) ([]resources.Deployment, Warnings, error)
- func (client *Client) GetDomain(domainGUID string) (resources.Domain, Warnings, error)
- func (client Client) GetDomains(query ...Query) ([]resources.Domain, Warnings, error)
- func (client *Client) GetDroplet(dropletGUID string) (resources.Droplet, Warnings, error)
- func (client *Client) GetDroplets(query ...Query) ([]resources.Droplet, Warnings, error)
- func (client *Client) GetEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName) (resources.EnvironmentVariables, Warnings, error)
- func (client *Client) GetEvents(query ...Query) ([]Event, Warnings, error)
- func (client *Client) GetFeatureFlag(flagName string) (resources.FeatureFlag, Warnings, error)
- func (client *Client) GetFeatureFlags() ([]resources.FeatureFlag, Warnings, error)
- func (client *Client) GetInfo() (Info, Warnings, error)
- func (client *Client) GetIsolationSegment(guid string) (resources.IsolationSegment, Warnings, error)
- func (client *Client) GetIsolationSegmentOrganizations(isolationSegmentGUID string) ([]resources.Organization, Warnings, error)
- func (client *Client) GetIsolationSegments(query ...Query) ([]resources.IsolationSegment, Warnings, error)
- func (client *Client) GetJob(jobURL JobURL) (Job, Warnings, error)
- func (client *Client) GetNewApplicationProcesses(appGUID string, deploymentGUID string) ([]resources.Process, Warnings, error)
- func (client *Client) GetOrganization(orgGUID string) (resources.Organization, Warnings, error)
- func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (resources.Relationship, Warnings, error)
- func (client Client) GetOrganizationDomains(orgGUID string, query ...Query) ([]resources.Domain, Warnings, error)
- func (client *Client) GetOrganizationQuota(quotaGUID string) (resources.OrganizationQuota, Warnings, error)
- func (client *Client) GetOrganizationQuotas(query ...Query) ([]resources.OrganizationQuota, Warnings, error)
- func (client *Client) GetOrganizations(query ...Query) ([]resources.Organization, Warnings, error)
- func (client *Client) GetPackage(packageGUID string) (resources.Package, Warnings, error)
- func (client *Client) GetPackageDroplets(packageGUID string, query ...Query) ([]resources.Droplet, Warnings, error)
- func (client *Client) GetPackages(query ...Query) ([]resources.Package, Warnings, error)
- func (client *Client) GetProcess(processGUID string) (resources.Process, Warnings, error)
- func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error)
- func (client *Client) GetProcessSidecars(processGuid string) ([]resources.Sidecar, Warnings, error)
- func (client Client) GetProcesses(query ...Query) ([]resources.Process, Warnings, error)
- func (client *Client) GetRoles(query ...Query) ([]resources.Role, IncludedResources, Warnings, error)
- func (client *Client) GetRouteBindings(query ...Query) ([]resources.RouteBinding, IncludedResources, Warnings, error)
- func (client Client) GetRouteDestinations(routeGUID string) ([]resources.RouteDestination, Warnings, error)
- func (client Client) GetRoutes(query ...Query) ([]resources.Route, Warnings, error)
- func (client *Client) GetRunningSecurityGroups(spaceGUID string, queries ...Query) ([]resources.SecurityGroup, Warnings, error)
- func (client *Client) GetSSHEnabled(appGUID string) (SSHEnabled, Warnings, error)
- func (client *Client) GetSecurityGroups(queries ...Query) ([]resources.SecurityGroup, Warnings, error)
- func (client *Client) GetServiceBrokers(query ...Query) ([]resources.ServiceBroker, Warnings, error)
- func (client *Client) GetServiceCredentialBindingDetails(guid string) (details resources.ServiceCredentialBindingDetails, warnings Warnings, ...)
- func (client *Client) GetServiceCredentialBindings(query ...Query) ([]resources.ServiceCredentialBinding, Warnings, error)
- func (client *Client) GetServiceInstanceByNameAndSpace(name, spaceGUID string, query ...Query) (resources.ServiceInstance, IncludedResources, Warnings, error)
- func (client *Client) GetServiceInstanceParameters(serviceInstanceGUID string) (parameters types.JSONObject, warnings Warnings, err error)
- func (client *Client) GetServiceInstanceSharedSpaces(serviceInstanceGUID string) ([]SpaceWithOrganization, Warnings, error)
- func (client *Client) GetServiceInstanceUsageSummary(serviceInstanceGUID string) ([]resources.ServiceInstanceUsageSummary, Warnings, error)
- func (client *Client) GetServiceInstances(query ...Query) ([]resources.ServiceInstance, IncludedResources, Warnings, error)
- func (client *Client) GetServiceOfferingByGUID(guid string) (resources.ServiceOffering, Warnings, error)
- func (client *Client) GetServiceOfferingByNameAndBroker(serviceOfferingName, serviceBrokerName string) (resources.ServiceOffering, Warnings, error)
- func (client *Client) GetServiceOfferings(query ...Query) ([]resources.ServiceOffering, Warnings, error)
- func (client *Client) GetServicePlanByGUID(guid string) (resources.ServicePlan, Warnings, error)
- func (client *Client) GetServicePlanVisibility(servicePlanGUID string) (resources.ServicePlanVisibility, Warnings, error)
- func (client *Client) GetServicePlans(query ...Query) ([]resources.ServicePlan, Warnings, error)
- func (client *Client) GetServicePlansWithOfferings(query ...Query) ([]ServiceOfferingWithPlans, Warnings, error)
- func (client *Client) GetServicePlansWithSpaceAndOrganization(query ...Query) ([]ServicePlanWithSpaceAndOrganization, Warnings, error)
- func (client *Client) GetSpaceFeature(spaceGUID string, featureName string) (bool, Warnings, error)
- func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (resources.Relationship, Warnings, error)
- func (client *Client) GetSpaceManifestDiff(spaceGUID string, rawManifest []byte) (resources.ManifestDiff, Warnings, error)
- func (client Client) GetSpaceQuota(spaceQuotaGUID string) (resources.SpaceQuota, Warnings, error)
- func (client *Client) GetSpaceQuotas(query ...Query) ([]resources.SpaceQuota, Warnings, error)
- func (client *Client) GetSpaces(query ...Query) ([]resources.Space, IncludedResources, Warnings, error)
- func (client *Client) GetStacks(query ...Query) ([]resources.Stack, Warnings, error)
- func (client *Client) GetStagingSecurityGroups(spaceGUID string, queries ...Query) ([]resources.SecurityGroup, Warnings, error)
- func (client *Client) GetUser(userGUID string) (resources.User, Warnings, error)
- func (client *Client) GetUsers(query ...Query) ([]resources.User, Warnings, error)
- func (client Client) MapRoute(routeGUID string, appGUID string, destinationProtocol string) (Warnings, error)
- func (client *Client) PollJob(jobURL JobURL) (Warnings, error)
- func (client *Client) PollJobForState(jobURL JobURL, state constant.JobState) (Warnings, error)
- func (client *Client) PollJobToEventStream(jobURL JobURL) chan PollJobEvent
- func (client *Client) PurgeServiceOffering(serviceOfferingGUID string) (Warnings, error)
- func (client Client) ResourceMatch(resources []Resource) ([]Resource, Warnings, error)
- func (client *Client) RootResponse() (Info, Warnings, error)
- func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (resources.Relationship, Warnings, error)
- func (client Client) SharePrivateDomainToOrgs(domainGuid string, sharedOrgs SharedOrgs) (Warnings, error)
- func (client Client) ShareRoute(routeGUID string, spaceGUID string) (Warnings, error)
- func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (resources.RelationshipList, Warnings, error)
- func (client *Client) TargetCF(settings TargetSettings)
- func (client *Client) UnbindSecurityGroupRunningSpace(securityGroupGUID string, spaceGUID string) (Warnings, error)
- func (client *Client) UnbindSecurityGroupStagingSpace(securityGroupGUID string, spaceGUID string) (Warnings, error)
- func (client Client) UnmapRoute(routeGUID string, destinationGUID string) (Warnings, error)
- func (client *Client) UnsetSpaceQuota(spaceQuotaGUID, spaceGUID string) (Warnings, error)
- func (client Client) UnsharePrivateDomainFromOrg(domainGuid string, orgGUID string) (Warnings, error)
- func (client *Client) UnshareServiceInstanceFromSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error)
- func (client *Client) UpdateAppFeature(appGUID string, enabled bool, featureName string) (Warnings, error)
- func (client *Client) UpdateApplication(app resources.Application) (resources.Application, Warnings, error)
- func (client *Client) UpdateApplicationApplyManifest(appGUID string, rawManifest []byte) (JobURL, Warnings, error)
- func (client *Client) UpdateApplicationEnvironmentVariables(appGUID string, envVars resources.EnvironmentVariables) (resources.EnvironmentVariables, Warnings, error)
- func (client *Client) UpdateApplicationRestart(appGUID string) (resources.Application, Warnings, error)
- func (client *Client) UpdateApplicationStart(appGUID string) (resources.Application, Warnings, error)
- func (client *Client) UpdateApplicationStop(appGUID string) (resources.Application, Warnings, error)
- func (client Client) UpdateBuildpack(buildpack resources.Buildpack) (resources.Buildpack, Warnings, error)
- func (client Client) UpdateDestination(routeGUID string, destinationGUID string, protocol string) (Warnings, error)
- func (client *Client) UpdateEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName, ...) (resources.EnvironmentVariables, Warnings, error)
- func (client *Client) UpdateFeatureFlag(flag resources.FeatureFlag) (resources.FeatureFlag, Warnings, error)
- func (client *Client) UpdateOrganization(org resources.Organization) (resources.Organization, Warnings, error)
- func (client *Client) UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isoSegGUID string) (resources.Relationship, Warnings, error)
- func (client *Client) UpdateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, Warnings, error)
- func (client *Client) UpdateProcess(process resources.Process) (resources.Process, Warnings, error)
- func (client *Client) UpdateResourceMetadata(resource string, resourceGUID string, metadata resources.Metadata) (JobURL, Warnings, error)
- func (client *Client) UpdateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, Warnings, error)
- func (client *Client) UpdateSecurityGroupRunningSpace(securityGroupGUID string, spaceGUIDs []string) (Warnings, error)
- func (client *Client) UpdateSecurityGroupStagingSpace(securityGroupGUID string, spaceGUIDs []string) (Warnings, error)
- func (client *Client) UpdateServiceBroker(serviceBrokerGUID string, serviceBroker resources.ServiceBroker) (JobURL, Warnings, error)
- func (client *Client) UpdateServiceInstance(serviceInstanceGUID string, serviceInstanceUpdates resources.ServiceInstance) (JobURL, Warnings, error)
- func (client *Client) UpdateServicePlanVisibility(servicePlanGUID string, planVisibility resources.ServicePlanVisibility) (resources.ServicePlanVisibility, Warnings, error)
- func (client *Client) UpdateSpace(space resources.Space) (resources.Space, Warnings, error)
- func (client *Client) UpdateSpaceApplyManifest(spaceGUID string, rawManifest []byte) (JobURL, Warnings, error)
- func (client *Client) UpdateSpaceFeature(spaceGUID string, enabled bool, featureName string) (Warnings, error)
- func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (resources.Relationship, Warnings, error)
- func (client *Client) UpdateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, Warnings, error)
- func (client *Client) UpdateTaskCancel(taskGUID string) (resources.Task, Warnings, error)
- func (client *Client) UploadBitsPackage(pkg resources.Package, matchedResources []Resource, newResources io.Reader, ...) (resources.Package, Warnings, error)
- func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, ...) (JobURL, Warnings, error)
- func (client *Client) UploadDropletBits(dropletGUID string, dropletPath string, droplet io.Reader, dropletLength int64) (JobURL, Warnings, error)
- func (client *Client) UploadPackage(pkg resources.Package, fileToUpload string) (resources.Package, Warnings, error)
- func (client *Client) WhoAmI() (resources.K8sUser, Warnings, error)
- type Clock
- type Config
- type ConnectionWrapper
- type DropletCreateRequest
- type Environment
- type Event
- type IncludedResources
- type Info
- func (info Info) AppSSHEndpoint() string
- func (info Info) AppSSHHostKeyFingerprint() string
- func (info Info) CloudControllerAPIVersion() string
- func (info Info) LogCache() string
- func (info Info) Logging() string
- func (info Info) Login() string
- func (info Info) NetworkPolicyV1() string
- func (info Info) OAuthClient() string
- func (info Info) Routing() string
- func (info Info) UAA() string
- type InfoLinks
- type Job
- type JobErrorDetails
- type JobURL
- type PaginatedResources
- type PollJobEvent
- type ProcessInstance
- type Query
- type QueryKey
- type RealRequester
- func (requester *RealRequester) InitializeConnection(settings TargetSettings)
- func (requester *RealRequester) InitializeRouter(baseURL string)
- func (requester *RealRequester) MakeListRequest(requestParams RequestParams) (IncludedResources, Warnings, error)
- func (requester *RealRequester) MakeRequest(requestParams RequestParams) (JobURL, Warnings, error)
- func (requester *RealRequester) MakeRequestReceiveRaw(requestName string, uriParams internal.Params, responseBodyMimeType string) ([]byte, Warnings, error)
- func (requester *RealRequester) MakeRequestSendRaw(requestName string, uriParams internal.Params, requestBody []byte, ...) (string, Warnings, error)
- func (requester *RealRequester) MakeRequestSendReceiveRaw(Method string, URL string, headers http.Header, requestBody []byte) ([]byte, *http.Response, error)
- func (requester *RealRequester) MakeRequestUploadAsync(requestName string, uriParams internal.Params, requestBodyMimeType string, ...) (string, Warnings, error)
- func (requester *RealRequester) WrapConnection(wrapper ConnectionWrapper)
- type RequestParams
- type Requester
- type Resource
- type ResourceLinks
- type SSHEnabled
- type ServiceOfferingWithPlans
- type ServicePlanWithSpaceAndOrganization
- type SharedOrgs
- type SpaceWithOrganization
- type TargetSettings
- type V2FormattedResourcedeprecated
- type Warnings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatQueryParameters ¶
FormatQueryParameters converts a Query object into a collection that cloudcontroller.Request can accept.
Types ¶
type Client ¶
type Client struct { Info CloudControllerURL string Requester // contains filtered or unexported fields }
Client can be used to talk to a Cloud Controller's V3 Endpoints.
func TestClient ¶
TestClient returns a new client explicitly meant for internal testing. This should not be used for production code.
func (*Client) ApplyOrganizationQuota ¶
func (Client) ApplySpaceQuota ¶
func (*Client) CancelDeployment ¶
func (Client) CheckRoute ¶
func (client Client) CheckRoute(domainGUID string, hostname string, path string, port int) (bool, Warnings, error)
CheckRoute checks whether the route with the given domain GUID, hostname, and path exists in the foundation.
func (*Client) CopyPackage ¶
func (client *Client) CopyPackage(sourcePkgGUID string, targetAppGUID string) (resources.Package, Warnings, error)
CopyPackage copies a package from a source package to a destination package Note: source app guid is in URL; dest app guid is in body
func (*Client) CreateApplication ¶
func (client *Client) CreateApplication(app resources.Application) (resources.Application, Warnings, error)
CreateApplication creates an application with the given settings.
func (*Client) CreateApplicationDeployment ¶
func (*Client) CreateApplicationDeploymentByRevision ¶
func (*Client) CreateApplicationProcessScale ¶
func (client *Client) CreateApplicationProcessScale(appGUID string, process resources.Process) (resources.Process, Warnings, error)
CreateApplicationProcessScale updates process instances count, memory or disk
func (*Client) CreateApplicationTask ¶
func (client *Client) CreateApplicationTask(appGUID string, task resources.Task) (resources.Task, Warnings, error)
CreateApplication resources.Task runs a command in the Application environment associated with the provided Application GUID.
func (*Client) CreateBuild ¶
CreateBuild creates the given build, requires Package GUID to be set on the build.
func (*Client) CreateBuildpack ¶
func (client *Client) CreateBuildpack(bp resources.Buildpack) (resources.Buildpack, Warnings, error)
CreateBuildpack creates a buildpack with the given settings, Type and the ApplicationRelationship must be set.
func (Client) CreateDomain ¶
func (*Client) CreateDroplet ¶
CreateDroplet creates a new droplet without a package for the app with the given guid.
func (*Client) CreateIsolationSegment ¶
func (client *Client) CreateIsolationSegment(isolationSegment resources.IsolationSegment) (resources.IsolationSegment, Warnings, error)
CreateIsolationSegment will create an Isolation Segment on the Cloud Controller. Note: This will not validate that the placement tag exists in the diego cluster.
func (*Client) CreateOrganization ¶
func (*Client) CreateOrganizationQuota ¶
func (client *Client) CreateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, Warnings, error)
func (*Client) CreatePackage ¶
CreatePackage creates a package with the given settings, Type and the ApplicationRelationship must be set.
func (*Client) CreateRole ¶
func (Client) CreateRoute ¶
func (*Client) CreateRouteBinding ¶
func (*Client) CreateSecurityGroup ¶
func (client *Client) CreateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, Warnings, error)
func (*Client) CreateServiceBroker ¶
func (client *Client) CreateServiceBroker(serviceBroker resources.ServiceBroker) (JobURL, Warnings, error)
CreateServiceBroker registers a new service broker.
func (*Client) CreateServiceCredentialBinding ¶
func (*Client) CreateServiceInstance ¶
func (*Client) CreateSpace ¶
func (Client) CreateSpaceQuota ¶
func (client Client) CreateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, Warnings, error)
func (*Client) CreateUser ¶
CreateUser creates a new Cloud Controller User from the provided UAA user ID.
func (*Client) DeleteApplication ¶
DeleteApplication deletes the app with the given app GUID. Returns back a resulting job URL to poll.
func (*Client) DeleteApplicationProcessInstance ¶
func (client *Client) DeleteApplicationProcessInstance(appGUID string, processType string, instanceIndex int) (Warnings, error)
DeleteApplicationProcessInstance deletes/stops a particular application's process instance.
func (Client) DeleteBuildpack ¶
DeleteBuildpack deletes the buildpack with the provided guid.
func (Client) DeleteDomain ¶
func (*Client) DeleteIsolationSegment ¶
DeleteIsolationSegment removes an isolation segment from the cloud controller. Note: This will only remove it from the cloud controller database. It will not remove it from diego.
func (*Client) DeleteIsolationSegmentOrganization ¶
func (client *Client) DeleteIsolationSegmentOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error)
DeleteIsolationSegmentOrganization will delete the relationship between the isolation segment and the organization provided.
func (*Client) DeleteOrganization ¶
DeleteOrganization deletes the organization with the given GUID.
func (*Client) DeleteOrganizationQuota ¶
func (Client) DeleteOrphanedRoutes ¶
func (*Client) DeleteRole ¶
func (Client) DeleteRoute ¶
func (*Client) DeleteRouteBinding ¶
func (*Client) DeleteSecurityGroup ¶
func (*Client) DeleteServiceBroker ¶
DeleteServiceBroker deletes a named service broker
func (*Client) DeleteServiceCredentialBinding ¶
func (*Client) DeleteServiceInstance ¶
func (*Client) DeleteServicePlanVisibility ¶
func (*Client) DeleteSpace ¶
func (Client) DeleteSpaceQuota ¶
func (*Client) DeleteUser ¶
func (*Client) DownloadDroplet ¶
func (*Client) EntitleIsolationSegmentToOrganizations ¶
func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (resources.RelationshipList, Warnings, error)
EntitleIsolationSegmentToOrganizations will create a link between the isolation segment and the list of organizations provided.
func (*Client) GetAppFeature ¶
func (*Client) GetApplicationByNameAndSpace ¶
func (*Client) GetApplicationDropletCurrent ¶
func (client *Client) GetApplicationDropletCurrent(appGUID string) (resources.Droplet, Warnings, error)
GetApplicationDropletCurrent returns the current droplet for a given application.
func (*Client) GetApplicationEnvironment ¶
func (client *Client) GetApplicationEnvironment(appGUID string) (Environment, Warnings, error)
GetApplicationEnvironment fetches all the environment variables on an application by groups.
func (*Client) GetApplicationManifest ¶
GetApplicationManifest returns a (YAML) manifest for an application and its underlying processes.
func (*Client) GetApplicationProcessByType ¶
func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (resources.Process, Warnings, error)
GetApplicationProcessByType returns application process of specified type
func (*Client) GetApplicationProcesses ¶
func (client *Client) GetApplicationProcesses(appGUID string) ([]resources.Process, Warnings, error)
GetApplicationProcesses lists processes for a given application. **Note**: Due to security, the API obfuscates certain values such as `command`.
func (*Client) GetApplicationRevisions ¶
func (*Client) GetApplicationRevisionsDeployed ¶
func (Client) GetApplicationRoutes ¶
func (*Client) GetApplicationTasks ¶
func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]resources.Task, Warnings, error)
GetApplicationTasks returns a list of tasks associated with the provided application GUID. Results can be filtered by providing URL queries.
func (*Client) GetApplications ¶
GetApplications lists applications with optional queries.
func (*Client) GetBuildpacks ¶
GetBuildpacks lists buildpacks with optional filters.
func (*Client) GetDefaultDomain ¶
GetDefaultDomain gets the default domain for the organization with the given GUID.
func (*Client) GetDeployment ¶
func (*Client) GetDeployments ¶
func (Client) GetDomains ¶
func (*Client) GetDroplet ¶
GetDroplet returns a droplet with the given GUID.
func (*Client) GetDroplets ¶
GetDroplets lists droplets with optional filters.
func (*Client) GetEnvironmentVariableGroup ¶
func (client *Client) GetEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName) (resources.EnvironmentVariables, Warnings, error)
GetEnvironmentVariableGroup gets the values of a particular environment variable group.
func (*Client) GetEvents ¶
GetEvents uses the /v3/audit_events endpoint to retrieve a list of audit events. NOTE: This only returns the first page of results. We are intentionally not using the paginate helper to fetch all pages here because we only needed the first page for the `cf events` output. If we need to, we can refactor this later to fetch all pages and make `cf events` only filter down to the first page.
func (*Client) GetFeatureFlag ¶
func (*Client) GetFeatureFlags ¶
func (client *Client) GetFeatureFlags() ([]resources.FeatureFlag, Warnings, error)
GetFeatureFlags lists feature flags.
func (*Client) GetIsolationSegment ¶
func (client *Client) GetIsolationSegment(guid string) (resources.IsolationSegment, Warnings, error)
GetIsolationSegment returns back the requested isolation segment that matches the GUID.
func (*Client) GetIsolationSegmentOrganizations ¶
func (client *Client) GetIsolationSegmentOrganizations(isolationSegmentGUID string) ([]resources.Organization, Warnings, error)
GetIsolationSegmentOrganizations lists organizations entitled to an isolation segment.
func (*Client) GetIsolationSegments ¶
func (client *Client) GetIsolationSegments(query ...Query) ([]resources.IsolationSegment, Warnings, error)
GetIsolationSegments lists isolation segments with optional filters.
func (*Client) GetNewApplicationProcesses ¶
func (client *Client) GetNewApplicationProcesses(appGUID string, deploymentGUID string) ([]resources.Process, Warnings, error)
GetNewApplicationProcesses gets processes for an application in the middle of a deployment. The app's processes will include a web process that will be removed when the deployment completes, so exclude that soon-to-be-removed process from the result.
func (*Client) GetOrganization ¶
GetOrganization gets an organization by the given guid.
func (*Client) GetOrganizationDefaultIsolationSegment ¶
func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (resources.Relationship, Warnings, error)
GetOrganizationDefaultIsolationSegment returns the relationship between an organization and it's default isolation segment.
func (Client) GetOrganizationDomains ¶
func (*Client) GetOrganizationQuota ¶
func (*Client) GetOrganizationQuotas ¶
func (*Client) GetOrganizations ¶
GetOrganizations lists organizations with optional filters.
func (*Client) GetPackage ¶
GetPackage returns the package with the given GUID.
func (*Client) GetPackageDroplets ¶
func (client *Client) GetPackageDroplets(packageGUID string, query ...Query) ([]resources.Droplet, Warnings, error)
GetPackageDroplets returns the droplets that run the specified packages
func (*Client) GetPackages ¶
GetPackages returns the list of packages.
func (*Client) GetProcess ¶
GetProcess returns a process with the given guid
func (*Client) GetProcessInstances ¶
func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error)
GetProcessInstances lists instance stats for a given process.
func (*Client) GetProcessSidecars ¶
func (Client) GetProcesses ¶
func (*Client) GetRoles ¶
func (client *Client) GetRoles(query ...Query) ([]resources.Role, IncludedResources, Warnings, error)
GetRoles lists roles with optional filters & includes.
func (*Client) GetRouteBindings ¶
func (client *Client) GetRouteBindings(query ...Query) ([]resources.RouteBinding, IncludedResources, Warnings, error)
func (Client) GetRouteDestinations ¶
func (*Client) GetRunningSecurityGroups ¶
func (*Client) GetSSHEnabled ¶
func (client *Client) GetSSHEnabled(appGUID string) (SSHEnabled, Warnings, error)
func (*Client) GetSecurityGroups ¶
func (*Client) GetServiceBrokers ¶
func (client *Client) GetServiceBrokers(query ...Query) ([]resources.ServiceBroker, Warnings, error)
GetServiceBrokers lists service brokers.
func (*Client) GetServiceCredentialBindingDetails ¶
func (*Client) GetServiceCredentialBindings ¶
func (client *Client) GetServiceCredentialBindings(query ...Query) ([]resources.ServiceCredentialBinding, Warnings, error)
GetServiceCredentialBindings queries the CC API with the specified query and returns a slice of ServiceCredentialBindings. Additionally if Apps are included in the API response (by having `include=app` in the query) then the App names will be added into each ServiceCredentialBinding for app bindings
func (*Client) GetServiceInstanceByNameAndSpace ¶
func (client *Client) GetServiceInstanceByNameAndSpace(name, spaceGUID string, query ...Query) (resources.ServiceInstance, IncludedResources, Warnings, error)
func (*Client) GetServiceInstanceParameters ¶
func (*Client) GetServiceInstanceSharedSpaces ¶
func (client *Client) GetServiceInstanceSharedSpaces(serviceInstanceGUID string) ([]SpaceWithOrganization, Warnings, error)
GetServiceInstanceSharedSpaces will fetch relationships between a service instance and the shared-to spaces for that service.
func (*Client) GetServiceInstanceUsageSummary ¶
func (*Client) GetServiceInstances ¶
func (client *Client) GetServiceInstances(query ...Query) ([]resources.ServiceInstance, IncludedResources, Warnings, error)
GetServiceInstances lists service instances with optional filters.
func (*Client) GetServiceOfferingByGUID ¶
func (*Client) GetServiceOfferingByNameAndBroker ¶
func (*Client) GetServiceOfferings ¶
func (client *Client) GetServiceOfferings(query ...Query) ([]resources.ServiceOffering, Warnings, error)
GetServiceOffering lists service offering with optional filters.
func (*Client) GetServicePlanByGUID ¶
func (*Client) GetServicePlanVisibility ¶
func (*Client) GetServicePlans ¶
GetServicePlans lists service plan with optional filters.
func (*Client) GetServicePlansWithOfferings ¶
func (client *Client) GetServicePlansWithOfferings(query ...Query) ([]ServiceOfferingWithPlans, Warnings, error)
func (*Client) GetServicePlansWithSpaceAndOrganization ¶
func (client *Client) GetServicePlansWithSpaceAndOrganization(query ...Query) ([]ServicePlanWithSpaceAndOrganization, Warnings, error)
func (*Client) GetSpaceFeature ¶
func (*Client) GetSpaceIsolationSegment ¶
func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (resources.Relationship, Warnings, error)
GetSpaceIsolationSegment returns the relationship between a space and it's isolation segment.
func (*Client) GetSpaceManifestDiff ¶
func (Client) GetSpaceQuota ¶
func (*Client) GetSpaceQuotas ¶
func (*Client) GetSpaces ¶
func (client *Client) GetSpaces(query ...Query) ([]resources.Space, IncludedResources, Warnings, error)
GetSpaces lists spaces with optional filters.
func (*Client) GetStagingSecurityGroups ¶
func (*Client) PollJob ¶
PollJob will keep polling the given job until the job has terminated, an error is encountered, or config.OverallPollingTimeout is reached. In the last case, a JobTimeoutError is returned.
func (*Client) PollJobForState ¶
func (*Client) PollJobToEventStream ¶
func (client *Client) PollJobToEventStream(jobURL JobURL) chan PollJobEvent
func (*Client) PurgeServiceOffering ¶
func (Client) ResourceMatch ¶
func (*Client) RootResponse ¶
rootResponse returns the CC API root document.
func (*Client) SetApplicationDroplet ¶
func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (resources.Relationship, Warnings, error)
SetApplicationDroplet sets the specified droplet on the given application.
func (Client) SharePrivateDomainToOrgs ¶
func (client Client) SharePrivateDomainToOrgs(domainGuid string, sharedOrgs SharedOrgs) (Warnings, error)
func (Client) ShareRoute ¶
func (*Client) ShareServiceInstanceToSpaces ¶
func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (resources.RelationshipList, Warnings, error)
ShareServiceInstanceToSpaces will create a sharing relationship between the service instance and the shared-to space for each space provided.
func (*Client) TargetCF ¶
func (client *Client) TargetCF(settings TargetSettings)
TargetCF sets the client to use the Cloud Controller specified in the configuration. Any other configuration is also applied to the client.
func (*Client) UnbindSecurityGroupRunningSpace ¶
func (*Client) UnbindSecurityGroupStagingSpace ¶
func (Client) UnmapRoute ¶
func (*Client) UnsetSpaceQuota ¶
func (Client) UnsharePrivateDomainFromOrg ¶
func (*Client) UnshareServiceInstanceFromSpace ¶
func (client *Client) UnshareServiceInstanceFromSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error)
UnshareServiceInstanceFromSpace will delete the sharing relationship between the service instance and the shared-to space provided.
func (*Client) UpdateAppFeature ¶
func (client *Client) UpdateAppFeature(appGUID string, enabled bool, featureName string) (Warnings, error)
UpdateAppFeature enables/disables the ability to ssh for a given application.
func (*Client) UpdateApplication ¶
func (client *Client) UpdateApplication(app resources.Application) (resources.Application, Warnings, error)
UpdateApplication updates an application with the given settings.
func (*Client) UpdateApplicationApplyManifest ¶
func (client *Client) UpdateApplicationApplyManifest(appGUID string, rawManifest []byte) (JobURL, Warnings, error)
UpdateApplicationApplyManifest applies the manifest to the given application. Returns back a resulting job URL to poll.
func (*Client) UpdateApplicationEnvironmentVariables ¶
func (client *Client) UpdateApplicationEnvironmentVariables(appGUID string, envVars resources.EnvironmentVariables) (resources.EnvironmentVariables, Warnings, error)
UpdateApplicationEnvironmentVariables adds/updates the user provided environment variables on an application. A restart is required for changes to take effect.
func (*Client) UpdateApplicationRestart ¶
func (client *Client) UpdateApplicationRestart(appGUID string) (resources.Application, Warnings, error)
UpdateApplicationRestart restarts the given application.
func (*Client) UpdateApplicationStart ¶
func (client *Client) UpdateApplicationStart(appGUID string) (resources.Application, Warnings, error)
UpdateApplicationStart starts the given application.
func (*Client) UpdateApplicationStop ¶
func (client *Client) UpdateApplicationStop(appGUID string) (resources.Application, Warnings, error)
UpdateApplicationStop stops the given application.
func (Client) UpdateBuildpack ¶
func (Client) UpdateDestination ¶
func (*Client) UpdateEnvironmentVariableGroup ¶
func (client *Client) UpdateEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName, envVars resources.EnvironmentVariables) (resources.EnvironmentVariables, Warnings, error)
func (*Client) UpdateFeatureFlag ¶
func (client *Client) UpdateFeatureFlag(flag resources.FeatureFlag) (resources.FeatureFlag, Warnings, error)
func (*Client) UpdateOrganization ¶
func (client *Client) UpdateOrganization(org resources.Organization) (resources.Organization, Warnings, error)
UpdateOrganization updates an organization with the given properties.
func (*Client) UpdateOrganizationDefaultIsolationSegmentRelationship ¶
func (client *Client) UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isoSegGUID string) (resources.Relationship, Warnings, error)
UpdateOrganizationDefaultIsolationSegmentRelationship sets the default isolation segment for an organization on the controller. If isoSegGuid is empty it will reset the default isolation segment.
func (*Client) UpdateOrganizationQuota ¶
func (client *Client) UpdateOrganizationQuota(orgQuota resources.OrganizationQuota) (resources.OrganizationQuota, Warnings, error)
func (*Client) UpdateProcess ¶
UpdateProcess updates the process's command or health check settings. GUID is always required; HealthCheckType is only required when updating health check settings.
func (*Client) UpdateResourceMetadata ¶
func (*Client) UpdateSecurityGroup ¶
func (client *Client) UpdateSecurityGroup(securityGroup resources.SecurityGroup) (resources.SecurityGroup, Warnings, error)
func (*Client) UpdateSecurityGroupRunningSpace ¶
func (*Client) UpdateSecurityGroupStagingSpace ¶
func (*Client) UpdateServiceBroker ¶
func (client *Client) UpdateServiceBroker(serviceBrokerGUID string, serviceBroker resources.ServiceBroker) (JobURL, Warnings, error)
UpdateServiceBroker updates an existing service broker.
func (*Client) UpdateServiceInstance ¶
func (*Client) UpdateServicePlanVisibility ¶
func (client *Client) UpdateServicePlanVisibility(servicePlanGUID string, planVisibility resources.ServicePlanVisibility) (resources.ServicePlanVisibility, Warnings, error)
func (*Client) UpdateSpace ¶
func (*Client) UpdateSpaceApplyManifest ¶
func (*Client) UpdateSpaceFeature ¶
func (*Client) UpdateSpaceIsolationSegmentRelationship ¶
func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (resources.Relationship, Warnings, error)
UpdateSpaceIsolationSegmentRelationship assigns an isolation segment to a space and returns the relationship.
func (*Client) UpdateSpaceQuota ¶
func (client *Client) UpdateSpaceQuota(spaceQuota resources.SpaceQuota) (resources.SpaceQuota, Warnings, error)
func (*Client) UpdateTaskCancel ¶
UpdateTaskCancel cancels a task.
func (*Client) UploadBitsPackage ¶
func (client *Client) UploadBitsPackage(pkg resources.Package, matchedResources []Resource, newResources io.Reader, newResourcesLength int64) (resources.Package, Warnings, error)
UploadBitsPackage uploads the newResources and a list of existing resources to the cloud controller. An updated package is returned. The function will act differently given the following Readers:
- io.ReadSeeker: Will function properly on retry.
- io.Reader: Will return a ccerror.PipeSeekError on retry.
- nil: Will not add the "application" section to the request. The newResourcesLength is ignored in this case.
Note: In order to determine if package creation is successful, poll the Package's state field for more information.
func (*Client) UploadBuildpack ¶
func (client *Client) UploadBuildpack(buildpackGUID string, buildpackPath string, buildpack io.Reader, buildpackLength int64) (JobURL, Warnings, error)
UploadBuildpack uploads the contents of a buildpack zip to the server.
func (*Client) UploadDropletBits ¶
func (client *Client) UploadDropletBits(dropletGUID string, dropletPath string, droplet io.Reader, dropletLength int64) (JobURL, Warnings, error)
UploadDropletBits asynchronously uploads bits from a .tgz file located at dropletPath to the droplet with guid dropletGUID. It returns a job URL pointing to the asynchronous upload job.
type Config ¶
type Config struct { // AppName is the name of the application/process using the client. AppName string // AppVersion is the version of the application/process using the client. AppVersion string // JobPollingTimeout is the maximum amount of time a job polls for. JobPollingTimeout time.Duration // JobPollingInterval is the wait time between job polls. JobPollingInterval time.Duration // Wrappers that apply to the client connection. Wrappers []ConnectionWrapper }
Config allows the Client to be configured
type ConnectionWrapper ¶
type ConnectionWrapper interface { cloudcontroller.Connection Wrap(innerconnection cloudcontroller.Connection) cloudcontroller.Connection }
ConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.
type DropletCreateRequest ¶
type DropletCreateRequest struct {
Relationships resources.Relationships `json:"relationships"`
}
type Environment ¶
type Environment struct { // Application contains basic application settings set by the user and CF // instance. Application map[string]interface{} `json:"application_env_json"` // EnvironmentVariables are user provided environment variables. EnvironmentVariables map[string]interface{} `json:"environment_variables"` //Running is the set of default environment variables available to running //apps. Running map[string]interface{} `json:"running_env_json"` //Staging is the set of default environment variables available during //staging. Staging map[string]interface{} `json:"staging_env_json"` // System contains information about bound services for the application. AKA // VCAP_SERVICES. System map[string]interface{} `json:"system_env_json"` }
Environment variables that will be provided to an app at runtime. It will include environment variables for Environment Variable Groups and Service Bindings.
type Event ¶
type Event struct { GUID string CreatedAt time.Time Type string ActorName string Data map[string]interface{} }
func (*Event) UnmarshalJSON ¶
type IncludedResources ¶
type IncludedResources struct { Users []resources.User `json:"users,omitempty"` Organizations []resources.Organization `json:"organizations,omitempty"` Spaces []resources.Space `json:"spaces,omitempty"` ServiceInstances []resources.ServiceInstance `json:"service_instances,omitempty"` ServiceOfferings []resources.ServiceOffering `json:"service_offerings,omitempty"` ServiceBrokers []resources.ServiceBroker `json:"service_brokers,omitempty"` ServicePlans []resources.ServicePlan `json:"service_plans,omitempty"` Apps []resources.Application `json:"apps,omitempty"` }
type Info ¶
type Info struct { // Links is a list of top level Cloud Controller APIs. Links InfoLinks `json:"links"` CFOnK8s bool `json:"cf_on_k8s"` }
Info represents a GET response from the '/' endpoint of the cloud controller API.
func (Info) AppSSHEndpoint ¶
AppSSHEndpoint returns the HREF for SSHing into an app container.
func (Info) AppSSHHostKeyFingerprint ¶
AppSSHHostKeyFingerprint returns the SSH key fingerprint of the SSH proxy that brokers connections to application instances.
func (Info) CloudControllerAPIVersion ¶
CloudControllerAPIVersion returns the version of the CloudController.
func (Info) NetworkPolicyV1 ¶
NetworkPolicyV1 returns the HREF of the Container Networking v1 Policy API
func (Info) OAuthClient ¶
OAuthClient returns the oauth client ID of the SSH proxy that brokers connections to application instances.
type InfoLinks ¶
type InfoLinks struct { // AppSSH is the link for application ssh info. AppSSH resources.APILink `json:"app_ssh"` // CCV3 is the link to the Cloud Controller V3 API. CCV3 resources.APILink `json:"cloud_controller_v3"` // Logging is the link to the Logging API. Logging resources.APILink `json:"logging"` // Logging is the link to the Logging API. LogCache resources.APILink `json:"log_cache"` // NetworkPolicyV1 is the link to the Container to Container Networking // API. NetworkPolicyV1 resources.APILink `json:"network_policy_v1"` // Routing is the link to the routing API Routing resources.APILink `json:"routing"` // UAA is the link to the UAA API. UAA resources.APILink `json:"uaa"` // Login is the link to the Login API. Login resources.APILink `json:"login"` }
type Job ¶
type Job struct { // RawErrors is a list of errors that occurred while processing the job. RawErrors []JobErrorDetails `json:"errors"` // GUID is a unique identifier for the job. GUID string `json:"guid"` // State is the state of the job. State constant.JobState `json:"state"` // Warnings are the warnings emitted by the job during its processing. Warnings []jobWarning `json:"warnings"` }
Job represents a Cloud Controller Job.
func (Job) IsComplete ¶
IsComplete returns true when the job has completed successfully.
type JobErrorDetails ¶
type JobErrorDetails struct { // Code is a numeric code for this error. Code constant.JobErrorCode `json:"code"` // Detail is a verbose description of the error. Detail string `json:"detail"` // Title is a short description of the error. Title string `json:"title"` }
JobErrorDetails provides information regarding a job's error.
type PaginatedResources ¶
type PaginatedResources struct { // Pagination represents information about the paginated resource. Pagination struct { // Next represents a link to the next page. Next struct { // HREF is the HREF of the next page. HREF string `json:"href"` } `json:"next"` } `json:"pagination"` // ResourceBytes is the list of resources for the current page. ResourcesBytes json.RawMessage `json:"resources"` IncludedResources IncludedResources `json:"included"` // contains filtered or unexported fields }
PaginatedResources represents a page of resources returned by the Cloud Controller.
func NewPaginatedResources ¶
func NewPaginatedResources(exampleResource interface{}) *PaginatedResources
NewPaginatedResources returns a new PaginatedResources struct with the given resource type.
func (PaginatedResources) NextPage ¶
func (pr PaginatedResources) NextPage() string
NextPage returns the HREF of the next page of results.
func (PaginatedResources) Resources ¶
func (pr PaginatedResources) Resources() ([]interface{}, error)
Resources unmarshals JSON representing a page of resources and returns a slice of the given resource type.
type PollJobEvent ¶
type ProcessInstance ¶
type ProcessInstance struct { // CPU is the current CPU usage of the instance. CPU float64 // Details is information about errors placing the instance. Details string // DiskQuota is the maximum disk the instance is allowed to use. DiskQuota uint64 // DiskUsage is the current disk usage of the instance. DiskUsage uint64 // Index is the index of the instance. Index int64 // Isolation segment is the current isolation segment that the instance is // running on. The value is empty when the instance is not placed on a // particular isolation segment. IsolationSegment string // MemoryQuota is the maximum memory the instance is allowed to use. MemoryQuota uint64 // DiskUsage is the current memory usage of the instance. MemoryUsage uint64 // State is the state of the instance. State constant.ProcessInstanceState // Type is the process type for the instance. Type string // Uptime is the duration that the instance has been running. Uptime time.Duration }
ProcessInstance represents a single process instance for a particular application.
func (*ProcessInstance) UnmarshalJSON ¶
func (instance *ProcessInstance) UnmarshalJSON(data []byte) error
UnmarshalJSON helps unmarshal a V3 Cloud Controller Instance response.
type Query ¶
Query is additional settings that can be passed to some requests that can filter, sort, etc. the results.
type QueryKey ¶
type QueryKey string
QueryKey is the type of query that is being selected on.
const ( // AppGUIDFilter is a query parameter for listing objects by app GUID. AppGUIDFilter QueryKey = "app_guids" // AvailableFilter is a query parameter for listing available resources AvailableFilter QueryKey = "available" // GUIDFilter is a query parameter for listing objects by GUID. GUIDFilter QueryKey = "guids" // LabelSelectorFilter is a query parameter for listing objects by label LabelSelectorFilter QueryKey = "label_selector" // NameFilter is a query parameter for listing objects by name. NameFilter QueryKey = "names" // NoRouteFilter is a query parameter for skipping route creation and unmapping existing routes. NoRouteFilter QueryKey = "no_route" // OrganizationGUIDFilter is a query parameter for listing objects by Organization GUID. OrganizationGUIDFilter QueryKey = "organization_guids" // SequenceIDFilter is a query parameter for listing objects by sequence ID. SequenceIDFilter QueryKey = "sequence_ids" // RouteGUIDFilter is a query parameter for listing objects by Route GUID. RouteGUIDFilter QueryKey = "route_guids" // ServiceInstanceGUIDFilter is a query parameter for listing objects by Service Instance GUID. ServiceInstanceGUIDFilter QueryKey = "service_instance_guids" // SpaceGUIDFilter is a query parameter for listing objects by Space GUID. SpaceGUIDFilter QueryKey = "space_guids" // StatusValueFilter is a query parameter for listing deployments by status.value StatusValueFilter QueryKey = "status_values" // DomainGUIDFilter is a query param for listing events by target_guid TargetGUIDFilter QueryKey = "target_guids" // DomainGUIDFilter is a query param for listing objects by domain_guid DomainGUIDFilter QueryKey = "domain_guids" // HostsFilter is a query param for listing objects by hostname HostsFilter QueryKey = "hosts" // HostFilter is a query param for getting an object with the given host HostFilter QueryKey = "host" // Origins filter is a query parameter when getting a user by origin (Note: CAPI will return an error if usernames filter is not also provided) OriginsFilter QueryKey = "origins" // PathsFilter is a query param for listing objects by path PathsFilter QueryKey = "paths" // PathFilter is a query param for getting an object with the given host PathFilter QueryKey = "path" // PortFilter is a query param for getting an object with the given port (TCP routes) PortFilter QueryKey = "port" // PortsFilter is a query param for getting an object with the given ports (TCP routes) PortsFilter QueryKey = "ports" // RoleTypesFilter is a query param for getting a role by type RoleTypesFilter QueryKey = "types" // StackFilter is a query parameter for listing objects by stack name StackFilter QueryKey = "stacks" // TypeFiler is a query parameter for selecting binding type TypeFilter QueryKey = "type" // UnmappedFilter is a query parameter specifying unmapped routes UnmappedFilter QueryKey = "unmapped" // UserGUIDFilter is a query parameter when getting a user by GUID UserGUIDFilter QueryKey = "user_guids" // UsernamesFilter is a query parameter when getting a user by username UsernamesFilter QueryKey = "usernames" // StatesFilter is a query parameter when getting a package's droplets by state VersionsFilter QueryKey = "versions" // VersionsFilter is a query parameter when getting an apps revisions by version StatesFilter QueryKey = "states" // ServiceBrokerNamesFilter is a query parameter when getting plans or offerings according to the Service Brokers that it relates to ServiceBrokerNamesFilter QueryKey = "service_broker_names" // ServiceBrokerGUIDsFilter is a query parameter for getting resources according to the service broker GUID ServiceBrokerGUIDsFilter QueryKey = "service_broker_guids" // ServiceOfferingNamesFilter is a query parameter when getting a plan according to the Service Offerings that it relates to ServiceOfferingNamesFilter QueryKey = "service_offering_names" // ServiceOfferingGUIDsFilter is a query parameter when getting resources according to service offering GUIDs ServiceOfferingGUIDsFilter QueryKey = "service_offering_guids" // FieldsServiceOfferingServiceBroker is a query parameter to include specific fields from a service broker in a plan response FieldsServiceOfferingServiceBroker QueryKey = "fields[service_offering.service_broker]" // FieldsServiceBroker is a query parameter to include specific fields from a service broker in an offering response FieldsServiceBroker QueryKey = "fields[service_broker]" // FieldsServicePlan is a query parameter to include specific fields from a service plan FieldsServicePlan QueryKey = "fields[service_plan]" // FieldsServicePlanServiceOffering is a query parameter to include specific fields from a service offering FieldsServicePlanServiceOffering QueryKey = "fields[service_plan.service_offering]" // FieldsServicePlanServiceOfferingServiceBroker is a query parameter to include specific fields from a service broker FieldsServicePlanServiceOfferingServiceBroker QueryKey = "fields[service_plan.service_offering.service_broker]" // FieldsSpace is a query parameter to include specific fields from a space FieldsSpace QueryKey = "fields[space]" // FieldsSpaceOrganization is a query parameter to include specific fields from a organization FieldsSpaceOrganization QueryKey = "fields[space.organization]" // OrderBy is a query parameter to specify how to order objects. OrderBy QueryKey = "order_by" // PerPage is a query parameter for specifying the number of results per page. PerPage QueryKey = "per_page" // Include is a query parameter for specifying other resources associated with the // resource returned by the endpoint Include QueryKey = "include" // GloballyEnabledStaging is the query parameter for getting only security groups that are globally enabled for staging GloballyEnabledStaging QueryKey = "globally_enabled_staging" // GloballyEnabledRunning is the query parameter for getting only security groups that are globally enabled for running GloballyEnabledRunning QueryKey = "globally_enabled_running" // NameOrder is a query value for ordering by name. This value is used in // conjunction with the OrderBy QueryKey. NameOrder = "name" // PositionOrder is a query value for ordering by position. This value is // used in conjunction with the OrderBy QueryKey. PositionOrder = "position" // CreatedAtDescendingOrder is a query value for ordering by created_at timestamp, // in descending order. CreatedAtDescendingOrder = "-created_at" // SourceGUID is the query parameter for getting an object. Currently it's used as a package GUID // to retrieve a package to later copy it to an app (CopyPackage()) SourceGUID = "source_guid" // Purge is a query parameter used on a Delete request to indicate that dependent resources should also be deleted Purge = "purge" // MaxPerPage is the largest value of "per_page" that should be used MaxPerPage = "5000" )
type RealRequester ¶
type RealRequester struct {
// contains filtered or unexported fields
}
func NewRequester ¶
func NewRequester(config Config) *RealRequester
func (*RealRequester) InitializeConnection ¶
func (requester *RealRequester) InitializeConnection(settings TargetSettings)
func (*RealRequester) InitializeRouter ¶
func (requester *RealRequester) InitializeRouter(baseURL string)
func (*RealRequester) MakeListRequest ¶
func (requester *RealRequester) MakeListRequest(requestParams RequestParams) (IncludedResources, Warnings, error)
func (*RealRequester) MakeRequest ¶
func (requester *RealRequester) MakeRequest(requestParams RequestParams) (JobURL, Warnings, error)
func (*RealRequester) MakeRequestReceiveRaw ¶
func (*RealRequester) MakeRequestSendRaw ¶
func (*RealRequester) MakeRequestSendReceiveRaw ¶
func (*RealRequester) MakeRequestUploadAsync ¶
func (*RealRequester) WrapConnection ¶
func (requester *RealRequester) WrapConnection(wrapper ConnectionWrapper)
WrapConnection wraps the current Client connection in the wrapper.
type RequestParams ¶
type Requester ¶
type Requester interface { InitializeConnection(settings TargetSettings) InitializeRouter(baseURL string) MakeListRequest(requestParams RequestParams) (IncludedResources, Warnings, error) MakeRequest(requestParams RequestParams) (JobURL, Warnings, error) MakeRequestReceiveRaw( requestName string, uriParams internal.Params, responseBodyMimeType string, ) ([]byte, Warnings, error) MakeRequestSendRaw( requestName string, uriParams internal.Params, requestBody []byte, requestBodyMimeType string, responseBody interface{}, ) (string, Warnings, error) MakeRequestSendReceiveRaw( Method string, URL string, headers http.Header, requestBody []byte, ) ([]byte, *http.Response, error) MakeRequestUploadAsync( requestName string, uriParams internal.Params, requestBodyMimeType string, requestBody io.ReadSeeker, dataLength int64, responseBody interface{}, writeErrors <-chan error, ) (string, Warnings, error) WrapConnection(wrapper ConnectionWrapper) }
type Resource ¶
type Resource struct { // FilePath is the path of the resource. FilePath string `json:"path"` // Mode is the operating system file mode (aka file permissions) of the // resource. Mode os.FileMode `json:"mode"` // SHA1 represents the SHA-1 hash of the resource. Checksum Checksum `json:"checksum"` // Size represents the file size of the resource. SizeInBytes int64 `json:"size_in_bytes"` }
func (Resource) MarshalJSON ¶
MarshalJSON converts a resource into a Cloud Controller Resource.
func (Resource) ToV2FormattedResource ¶
func (r Resource) ToV2FormattedResource() V2FormattedResource
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON helps unmarshal a Cloud Controller Resource response.
type ResourceLinks ¶
ResourceLinks represents the information returned back from /v3.
func (ResourceLinks) UnmarshalJSON ¶
func (links ResourceLinks) UnmarshalJSON(data []byte) error
UnmarshalJSON helps unmarshal a Cloud Controller /v3 response.
type SSHEnabled ¶
type ServiceOfferingWithPlans ¶
type ServiceOfferingWithPlans struct { // GUID is a unique service offering identifier. GUID string // Name is the name of the service offering. Name string // Description of the service offering Description string // ServiceBrokerName is the name of the service broker ServiceBrokerName string // List of service plans that this service offering provides Plans []resources.ServicePlan }
type ServicePlanWithSpaceAndOrganization ¶
type ServicePlanWithSpaceAndOrganization struct { // GUID is a unique service plan identifier. GUID string // Name is the name of the service plan. Name string // VisibilityType can be "public", "admin", "organization" or "space" VisibilityType resources.ServicePlanVisibilityType // ServicePlanGUID is the GUID of the service offering ServiceOfferingGUID string SpaceGUID string SpaceName string OrganizationName string }
type SharedOrgs ¶
type SharedOrgs struct {
}func (SharedOrgs) MarshalJSON ¶
func (sharedOrgs SharedOrgs) MarshalJSON() ([]byte, error)
func (*SharedOrgs) UnmarshalJSON ¶
func (sharedOrgs *SharedOrgs) UnmarshalJSON(data []byte) error
type SpaceWithOrganization ¶
type TargetSettings ¶
type TargetSettings struct { // DialTimeout is the DNS timeout used to make all requests to the Cloud // Controller. DialTimeout time.Duration // SkipSSLValidation controls whether a client verifies the server's // certificate chain and host name. If SkipSSLValidation is true, TLS accepts // any certificate presented by the server and any host name in that // certificate for *all* client requests going forward. // // In this mode, TLS is susceptible to man-in-the-middle attacks. This should // be used only for testing. SkipSSLValidation bool // URL is a fully qualified URL to the Cloud Controller API. URL string }
TargetSettings represents configuration for establishing a connection to the Cloud Controller server.
type V2FormattedResource
deprecated
type V2FormattedResource struct { // Filename is the name of the resource. Filename string `json:"fn"` // Mode is the operating system file mode (aka file permissions) of the // resource. Mode os.FileMode `json:"mode"` // SHA1 represents the SHA-1 hash of the resource. SHA1 string `json:"sha1"` // Size represents the file size of the resource. Size int64 `json:"size"` }
V2FormattedResource represents a Cloud Controller Resource that still has the same shape as the V2 Resource. The v3 package upload endpoint understands both the V2 shape and the new V3 shape. The v3 resource matching endpoint only understands the new V3 shape.
Deprecated: Use Resource going forward. We anticipate that this struct will only be used by the v6 cli's v3-push command, which is experimental.
func (V2FormattedResource) MarshalJSON ¶
func (r V2FormattedResource) MarshalJSON() ([]byte, error)
MarshalJSON converts a resource into a Cloud Controller V2FormattedResource.
func (*V2FormattedResource) UnmarshalJSON ¶
func (r *V2FormattedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON helps unmarshal a Cloud Controller V2FormattedResource response.
Source Files ¶
- application.go
- application_feature.go
- build.go
- buildpack.go
- client.go
- clock.go
- connection_wrapper.go
- deployment.go
- domain.go
- droplet.go
- environment.go
- environment_variables.go
- errors.go
- event.go
- feature_flag.go
- included_resources.go
- info.go
- isolation_segment.go
- job.go
- job_url.go
- manifest.go
- metadata.go
- organization.go
- organization_quota.go
- package.go
- paginate.go
- paginated_resources.go
- process.go
- process_instance.go
- query.go
- relationship.go
- relationship_list.go
- request.go
- requester.go
- resource.go
- revisions.go
- role.go
- route.go
- route_binding.go
- security_group.go
- service_broker.go
- service_credential_binding.go
- service_instance.go
- service_offering.go
- service_plan.go
- service_plan_visibility.go
- sidecar.go
- space.go
- space_feature.go
- space_quota.go
- stack.go
- target.go
- task.go
- user.go
- v2_formatted_resource.go