ccv3

package
v6.48.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0 Imports: 22 Imported by: 316

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatQueryParameters

func FormatQueryParameters(queries []Query) url.Values

FormatQueryParameters converts a Query object into a collection that cloudcontroller.Request can accept.

Types

type APILink struct {
	// HREF is the fully qualified URL for the link.
	HREF string `json:"href"`
	// Method indicate the desired action to be performed on the identified
	// resource.
	Method string `json:"method"`

	// Meta contains additional metadata about the API.
	Meta struct {
		// Version of the API
		Version string `json:"version"`

		// Fingerprint to authenticate api with
		HostKeyFingerprint string `json:"host_key_fingerprint"`

		// Identifier for UAA queries
		OAuthClient string `json:"oath_client"`
	} `json:"meta"`
}

APILink represents a generic link from a response object.

type APILinks map[string]APILink

APILinks is a directory of follow-up urls for the resource.

type Application

type Application struct {
	// GUID is the unique application identifier.
	GUID string
	// StackName is the name of the stack on which the application runs.
	StackName string
	// LifecycleBuildpacks is a list of the names of buildpacks.
	LifecycleBuildpacks []string
	// LifecycleType is the type of the lifecycle.
	LifecycleType constant.AppLifecycleType
	// Metadata is used for custom tagging of API resources
	Metadata *Metadata
	// Name is the name given to the application.
	Name string
	// Relationships list the relationships to the application.
	Relationships Relationships
	// State is the desired state of the application.
	State constant.ApplicationState
}

Application represents a Cloud Controller V3 Application.

func (Application) MarshalJSON

func (a Application) MarshalJSON() ([]byte, error)

MarshalJSON converts an Application into a Cloud Controller Application.

func (*Application) UnmarshalJSON

func (a *Application) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Application response.

type ApplicationFeature

type ApplicationFeature struct {
	// Name of the application feature
	Name    string
	Enabled bool
}

type Build

type Build struct {
	// CreatedAt is the time with zone when the build was created.
	CreatedAt string
	// DropletGUID is the unique identifier for the resulting droplet from the
	// staging process.
	DropletGUID string
	// Error describes errors during the build process.
	Error string
	// GUID is the unique build identifier.
	GUID string
	// PackageGUID is the unique identifier for package that is the input to the
	// staging process.
	PackageGUID string
	// State is the state of the build.
	State constant.BuildState
}

Build represent the process of staging an application package.

func (Build) MarshalJSON

func (b Build) MarshalJSON() ([]byte, error)

MarshalJSON converts a Build into a Cloud Controller Application.

func (*Build) UnmarshalJSON

func (b *Build) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Build response.

type Buildpack

type Buildpack struct {
	// Enabled is true when the buildpack can be used for staging.
	Enabled types.NullBool
	// Filename is the uploaded filename of the buildpack.
	Filename string
	// GUID is the unique identifier for the buildpack.
	GUID string
	// Locked is true when the buildpack cannot be updated.
	Locked types.NullBool
	// Name is the name of the buildpack. To be used by app buildpack field.
	// (only alphanumeric characters)
	Name string
	// Position is the order in which the buildpacks are checked during buildpack
	// auto-detection.
	Position types.NullInt
	// Stack is the name of the stack that the buildpack will use.
	Stack string
	// State is the current state of the buildpack.
	State string
	// Links are links to related resources.
	Links APILinks
	// Metadata is used for custom tagging of API resources
	Metadata *Metadata
}

Buildpack represents a Cloud Controller V3 buildpack.

func (Buildpack) MarshalJSON

func (buildpack Buildpack) MarshalJSON() ([]byte, error)

MarshalJSON converts a Package into a Cloud Controller Package.

func (*Buildpack) UnmarshalJSON

func (buildpack *Buildpack) UnmarshalJSON(data []byte) error

type Checksum

type Checksum struct {
	Value string `json:"value"`
}

type Client

type Client struct {
	Info
	// contains filtered or unexported fields
}

Client can be used to talk to a Cloud Controller's V3 Endpoints.

func NewClient

func NewClient(config Config) *Client

NewClient returns a new Client.

func TestClient

func TestClient(config Config, clock Clock) *Client

TestClient returns a new client explicitly meant for internal testing. This should not be used for production code.

func (*Client) CancelDeployment

func (client *Client) CancelDeployment(deploymentGUID string) (Warnings, error)

func (Client) CheckRoute

func (client Client) CheckRoute(domainGUID string, hostname string, path string) (bool, Warnings, error)

CheckRoute checks whether the route with the given domain GUID, hostname, and path exists in the foundation.

func (*Client) CreateApplication

func (client *Client) CreateApplication(app Application) (Application, Warnings, error)

CreateApplication creates an application with the given settings.

func (*Client) CreateApplicationDeployment

func (client *Client) CreateApplicationDeployment(appGUID string, dropletGUID string) (string, Warnings, error)

func (*Client) CreateApplicationProcessScale

func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error)

CreateApplicationProcessScale updates process instances count, memory or disk

func (*Client) CreateApplicationTask

func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error)

CreateApplicationTask runs a command in the Application environment associated with the provided Application GUID.

func (*Client) CreateBuild

func (client *Client) CreateBuild(build Build) (Build, Warnings, error)

CreateBuild creates the given build, requires Package GUID to be set on the build.

func (*Client) CreateBuildpack

func (client *Client) CreateBuildpack(bp Buildpack) (Buildpack, Warnings, error)

CreateBuildpack creates a buildpack with the given settings, Type and the ApplicationRelationship must be set.

func (Client) CreateDomain

func (client Client) CreateDomain(domain Domain) (Domain, Warnings, error)

func (*Client) CreateDroplet

func (client *Client) CreateDroplet(appGUID string) (Droplet, Warnings, error)

CreateDroplet creates a new droplet without a package for the app with the given guid.

func (*Client) CreateIsolationSegment

func (client *Client) CreateIsolationSegment(isolationSegment IsolationSegment) (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 *Client) CreateOrganization(orgName string) (Organization, Warnings, error)

CreateOrganization creates an organization with the given name.

func (*Client) CreatePackage

func (client *Client) CreatePackage(pkg Package) (Package, Warnings, error)

CreatePackage creates a package with the given settings, Type and the ApplicationRelationship must be set.

func (*Client) CreateRole

func (client *Client) CreateRole(roleSpec Role) (Role, Warnings, error)

func (Client) CreateRoute

func (client Client) CreateRoute(route Route) (Route, Warnings, error)

func (*Client) CreateServiceBroker

func (client *Client) CreateServiceBroker(serviceBroker ServiceBrokerModel) (JobURL, Warnings, error)

CreateServiceBroker registers a new service broker.

func (*Client) CreateSpace

func (client *Client) CreateSpace(space Space) (Space, Warnings, error)

func (*Client) CreateUser

func (client *Client) CreateUser(uaaUserID string) (User, Warnings, error)

CreateUser creates a new Cloud Controller User from the provided UAA user ID.

func (*Client) DeleteApplication

func (client *Client) DeleteApplication(appGUID string) (JobURL, Warnings, error)

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

func (client Client) DeleteBuildpack(buildpackGUID string) (JobURL, Warnings, error)

DeleteBuildpack deletes the buildpack with the provided guid.

func (Client) DeleteDomain

func (client Client) DeleteDomain(domainGUID string) (JobURL, Warnings, error)

func (*Client) DeleteIsolationSegment

func (client *Client) DeleteIsolationSegment(guid string) (Warnings, error)

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

func (client *Client) DeleteOrganization(orgGUID string) (JobURL, Warnings, error)

DeleteOrganization deletes the organization with the given GUID.

func (Client) DeleteOrphanedRoutes

func (client Client) DeleteOrphanedRoutes(spaceGUID string) (JobURL, Warnings, error)

func (Client) DeleteRoute

func (client Client) DeleteRoute(routeGUID string) (JobURL, Warnings, error)

func (*Client) DeleteServiceBroker

func (client *Client) DeleteServiceBroker(serviceBrokerGUID string) (JobURL, Warnings, error)

DeleteServiceBroker deletes a named service broker

func (*Client) DeleteServiceInstanceRelationshipsSharedSpace

func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error)

DeleteServiceInstanceRelationshipsSharedSpace will delete the sharing relationship between the service instance and the shared-to space provided.

func (*Client) DeleteSpace

func (client *Client) DeleteSpace(spaceGUID string) (JobURL, Warnings, error)

func (*Client) DeleteUser

func (client *Client) DeleteUser(uaaUserID string) (JobURL, Warnings, error)

func (*Client) EntitleIsolationSegmentToOrganizations

func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error)

EntitleIsolationSegmentToOrganizations will create a link between the isolation segment and the list of organizations provided.

func (*Client) GetAppFeature

func (client *Client) GetAppFeature(appGUID string, featureName string) (ApplicationFeature, Warnings, error)

func (*Client) GetApplicationDropletCurrent

func (client *Client) GetApplicationDropletCurrent(appGUID string) (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

func (client *Client) GetApplicationManifest(appGUID string) ([]byte, Warnings, error)

GetApplicationManifest returns a (YAML) manifest for an application and its underlying processes.

func (*Client) GetApplicationProcessByType

func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error)

GetApplicationProcessByType returns application process of specified type

func (*Client) GetApplicationProcesses

func (client *Client) GetApplicationProcesses(appGUID string) ([]Process, Warnings, error)

GetApplicationProcesses lists processes for a given application. **Note**: Due to security, the API obfuscates certain values such as `command`.

func (Client) GetApplicationRoutes

func (client Client) GetApplicationRoutes(appGUID string) ([]Route, Warnings, error)

func (*Client) GetApplicationTasks

func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]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

func (client *Client) GetApplications(query ...Query) ([]Application, Warnings, error)

GetApplications lists applications with optional queries.

func (*Client) GetBuild

func (client *Client) GetBuild(guid string) (Build, Warnings, error)

GetBuild gets the build with the given GUID.

func (*Client) GetBuildpacks

func (client *Client) GetBuildpacks(query ...Query) ([]Buildpack, Warnings, error)

GetBuildpacks lists buildpacks with optional filters.

func (*Client) GetDefaultDomain

func (client *Client) GetDefaultDomain(orgGUID string) (Domain, Warnings, error)

GetDefaultDomain gets the default domain for the organization with the given GUID.

func (*Client) GetDeployment

func (client *Client) GetDeployment(deploymentGUID string) (Deployment, Warnings, error)

func (*Client) GetDeployments

func (client *Client) GetDeployments(query ...Query) ([]Deployment, Warnings, error)

func (*Client) GetDomain

func (client *Client) GetDomain(domainGUID string) (Domain, Warnings, error)

GetDomain returns a domain with the given GUID.

func (Client) GetDomains

func (client Client) GetDomains(query ...Query) ([]Domain, Warnings, error)

func (*Client) GetDroplet

func (client *Client) GetDroplet(dropletGUID string) (Droplet, Warnings, error)

GetDroplet returns a droplet with the given GUID.

func (*Client) GetDroplets

func (client *Client) GetDroplets(query ...Query) ([]Droplet, Warnings, error)

GetDroplets lists droplets with optional filters.

func (*Client) GetEnvironmentVariableGroup

func (client *Client) GetEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName) (EnvironmentVariables, Warnings, error)

GetEnvironmentVariableGroup gets the values of a particular environment variable group.

func (*Client) GetEvents

func (client *Client) GetEvents(query ...Query) ([]Event, Warnings, error)

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 *Client) GetFeatureFlag(flagName string) (FeatureFlag, Warnings, error)

func (*Client) GetFeatureFlags

func (client *Client) GetFeatureFlags() ([]FeatureFlag, Warnings, error)

GetFeatureFlags lists feature flags.

func (*Client) GetInfo

func (client *Client) GetInfo() (Info, ResourceLinks, Warnings, error)

GetInfo returns endpoint and API information from /v3.

func (*Client) GetIsolationSegment

func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error)

GetIsolationSegment returns back the requested isolation segment that matches the GUID.

func (*Client) GetIsolationSegmentOrganizations

func (client *Client) GetIsolationSegmentOrganizations(isolationSegmentGUID string) ([]Organization, Warnings, error)

GetIsolationSegmentOrganizations lists organizations entitled to an isolation segment.

func (*Client) GetIsolationSegments

func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error)

GetIsolationSegments lists isolation segments with optional filters.

func (*Client) GetJob

func (client *Client) GetJob(jobURL JobURL) (Job, Warnings, error)

GetJob returns a job for the provided GUID.

func (*Client) GetNewApplicationProcesses

func (client *Client) GetNewApplicationProcesses(appGUID string, deploymentGUID string) ([]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

func (client *Client) GetOrganization(orgGUID string) (Organization, Warnings, error)

GetOrganization gets an organization by the given guid.

func (*Client) GetOrganizationDefaultIsolationSegment

func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (Relationship, Warnings, error)

GetOrganizationDefaultIsolationSegment returns the relationship between an organization and it's default isolation segment.

func (Client) GetOrganizationDomains

func (client Client) GetOrganizationDomains(orgGUID string, query ...Query) ([]Domain, Warnings, error)

func (*Client) GetOrganizations

func (client *Client) GetOrganizations(query ...Query) ([]Organization, Warnings, error)

GetOrganizations lists organizations with optional filters.

func (*Client) GetPackage

func (client *Client) GetPackage(packageGUID string) (Package, Warnings, error)

GetPackage returns the package with the given GUID.

func (*Client) GetPackageDroplets

func (client *Client) GetPackageDroplets(packageGUID string, query ...Query) ([]Droplet, Warnings, error)

GetPackageDroplets returns the droplets that run the specified packages

func (*Client) GetPackages

func (client *Client) GetPackages(query ...Query) ([]Package, Warnings, error)

GetPackages returns the list of packages.

func (*Client) GetProcess

func (client *Client) GetProcess(processGUID string) (Process, Warnings, error)

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 *Client) GetProcessSidecars(processGuid string) ([]Sidecar, Warnings, error)

func (*Client) GetRoles

func (client *Client) GetRoles(query ...Query) ([]Role, IncludedResources, Warnings, error)

GetRoles lists roles with optional filters & includes.

func (Client) GetRouteDestinations

func (client Client) GetRouteDestinations(routeGUID string) ([]RouteDestination, Warnings, error)

func (Client) GetRoutes

func (client Client) GetRoutes(query ...Query) ([]Route, Warnings, error)

func (*Client) GetSSHEnabled

func (client *Client) GetSSHEnabled(appGUID string) (SSHEnabled, Warnings, error)

func (*Client) GetServiceBrokers

func (client *Client) GetServiceBrokers() ([]ServiceBroker, Warnings, error)

GetServiceBrokers lists service brokers.

func (*Client) GetServiceInstances

func (client *Client) GetServiceInstances(query ...Query) ([]ServiceInstance, Warnings, error)

GetServiceInstances lists service instances with optional filters.

func (*Client) GetSpaceIsolationSegment

func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (Relationship, Warnings, error)

GetSpaceIsolationSegment returns the relationship between a space and it's isolation segment.

func (*Client) GetSpaces

func (client *Client) GetSpaces(query ...Query) ([]Space, Warnings, error)

GetSpaces lists spaces with optional filters.

func (*Client) GetStacks

func (client *Client) GetStacks(query ...Query) ([]Stack, Warnings, error)

GetStacks lists stacks with optional filters.

func (Client) MapRoute

func (client Client) MapRoute(routeGUID string, appGUID string) (Warnings, error)

func (*Client) PollJob

func (client *Client) PollJob(jobURL JobURL) (Warnings, error)

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

func (client Client) ResourceMatch(resources []Resource) ([]Resource, Warnings, error)

func (*Client) SetApplicationDroplet

func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (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) ShareServiceInstanceToSpaces

func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (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) (Warnings, error)

TargetCF sets the client to use the Cloud Controller specified in the configuration. Any other configuration is also applied to the client.

func (Client) UnmapRoute

func (client Client) UnmapRoute(routeGUID string, destinationGUID string) (Warnings, error)

func (Client) UnsharePrivateDomainFromOrg

func (client Client) UnsharePrivateDomainFromOrg(domainGuid string, orgGUID string) (Warnings, error)

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 Application) (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 EnvironmentVariables) (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) (Application, Warnings, error)

UpdateApplicationRestart restarts the given application.

func (*Client) UpdateApplicationStart

func (client *Client) UpdateApplicationStart(appGUID string) (Application, Warnings, error)

UpdateApplicationStart starts the given application.

func (*Client) UpdateApplicationStop

func (client *Client) UpdateApplicationStop(appGUID string) (Application, Warnings, error)

UpdateApplicationStop stops the given application.

func (Client) UpdateBuildpack

func (client Client) UpdateBuildpack(buildpack Buildpack) (Buildpack, Warnings, error)

func (*Client) UpdateEnvironmentVariableGroup

func (client *Client) UpdateEnvironmentVariableGroup(group constant.EnvironmentVariableGroupName, envVars EnvironmentVariables) (EnvironmentVariables, Warnings, error)

func (*Client) UpdateFeatureFlag

func (client *Client) UpdateFeatureFlag(flag FeatureFlag) (FeatureFlag, Warnings, error)

func (*Client) UpdateOrganization

func (client *Client) UpdateOrganization(org Organization) (Organization, Warnings, error)

UpdateOrganization updates an organization with the given properties.

func (*Client) UpdateOrganizationDefaultIsolationSegmentRelationship

func (client *Client) UpdateOrganizationDefaultIsolationSegmentRelationship(orgGUID string, isoSegGUID string) (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) UpdateProcess

func (client *Client) UpdateProcess(process Process) (Process, Warnings, error)

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 *Client) UpdateResourceMetadata(resource string, resourceGUID string, metadata Metadata) (ResourceMetadata, Warnings, error)

func (*Client) UpdateServiceBroker

func (client *Client) UpdateServiceBroker(serviceBrokerGUID string, serviceBroker ServiceBrokerModel) (JobURL, Warnings, error)

UpdateServiceBroker updates an existing service broker.

func (*Client) UpdateSpace

func (client *Client) UpdateSpace(space Space) (Space, Warnings, error)

func (*Client) UpdateSpaceApplyManifest

func (client *Client) UpdateSpaceApplyManifest(spaceGUID string, rawManifest []byte, query ...Query) (JobURL, Warnings, error)

func (*Client) UpdateSpaceIsolationSegmentRelationship

func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error)

UpdateSpaceIsolationSegmentRelationship assigns an isolation segment to a space and returns the relationship.

func (*Client) UpdateTaskCancel

func (client *Client) UpdateTaskCancel(taskGUID string) (Task, Warnings, error)

UpdateTaskCancel cancels a task.

func (*Client) UploadBitsPackage

func (client *Client) UploadBitsPackage(pkg Package, matchedResources []Resource, newResources io.Reader, newResourcesLength int64) (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.

func (*Client) UploadPackage

func (client *Client) UploadPackage(pkg Package, fileToUpload string) (Package, Warnings, error)

UploadPackage uploads a file to a given package's Upload resource. Note: fileToUpload is read entirely into memory prior to sending data to CC.

func (*Client) WrapConnection

func (client *Client) WrapConnection(wrapper ConnectionWrapper)

WrapConnection wraps the current Client connection in the wrapper.

type Clock

type Clock interface {
	Now() time.Time
}

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 Deployment

type Deployment struct {
	GUID          string
	State         constant.DeploymentState
	StatusValue   constant.DeploymentStatusValue
	StatusReason  constant.DeploymentStatusReason
	DropletGUID   string
	CreatedAt     string
	UpdatedAt     string
	Relationships Relationships
	NewProcesses  []Process
}

func (Deployment) MarshalJSON

func (d Deployment) MarshalJSON() ([]byte, error)

MarshalJSON converts a Deployment into a Cloud Controller Deployment.

func (*Deployment) UnmarshalJSON

func (d *Deployment) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Deployment response.

type Domain

type Domain struct {
	GUID             string         `json:"guid,omitempty"`
	Name             string         `json:"name"`
	Internal         types.NullBool `json:"internal,omitempty"`
	OrganizationGUID string         `json:"orgguid,omitempty"`

	// Metadata is used for custom tagging of API resources
	Metadata *Metadata `json:"metadata,omitempty"`
}

func (Domain) MarshalJSON

func (d Domain) MarshalJSON() ([]byte, error)

func (*Domain) UnmarshalJSON

func (d *Domain) UnmarshalJSON(data []byte) error

type Droplet

type Droplet struct {
	//Buildpacks are the detected buildpacks from the staging process.
	Buildpacks []DropletBuildpack `json:"buildpacks,omitempty"`
	// CreatedAt is the timestamp that the Cloud Controller created the droplet.
	CreatedAt string `json:"created_at"`
	// GUID is the unique droplet identifier.
	GUID string `json:"guid"`
	// Image is the Docker image name.
	Image string `json:"image"`
	// Stack is the root filesystem to use with the buildpack.
	Stack string `json:"stack,omitempty"`
	// State is the current state of the droplet.
	State constant.DropletState `json:"state"`
}

Droplet represents a Cloud Controller droplet's metadata. A droplet is a set of compiled bits for a given application.

type DropletBuildpack

type DropletBuildpack struct {
	// Name is the buildpack name.
	Name string `json:"name"`
	//DetectOutput is the output during buildpack detect process.
	DetectOutput string `json:"detect_output"`
}

DropletBuildpack is the name and output of a buildpack used to create a droplet.

type DropletCreateRequest

type DropletCreateRequest struct {
	Relationships 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 EnvironmentVariables

type EnvironmentVariables map[string]types.FilteredString

EnvironmentVariables represents the environment variables that can be set on an application by the user.

func (EnvironmentVariables) MarshalJSON

func (variables EnvironmentVariables) MarshalJSON() ([]byte, error)

func (*EnvironmentVariables) UnmarshalJSON

func (variables *EnvironmentVariables) UnmarshalJSON(data []byte) error

type Event

type Event struct {
	GUID      string
	CreatedAt time.Time
	Type      string
	ActorName string
	Data      map[string]interface{}
}

func (*Event) UnmarshalJSON

func (e *Event) UnmarshalJSON(data []byte) error

type FeatureFlag

type FeatureFlag struct {
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
}

FeatureFlag represents a Cloud Controller V3 Feature Flag.

func (FeatureFlag) MarshalJSON

func (f FeatureFlag) MarshalJSON() ([]byte, error)

type IncludedResources

type IncludedResources struct {
	Users []User
}

type IncludedUsers

type IncludedUsers map[constant.IncludedType]User

IncludedUsers represent a set of users included on an API response.

type Info

type Info struct {
	// Links is a list of top level Cloud Controller APIs.
	Links InfoLinks `json:"links"`
}

Info represents a GET response from the '/' endpoint of the cloud controller API.

func (Info) AppSSHEndpoint

func (info Info) AppSSHEndpoint() string

AppSSHEndpoint returns the HREF for SSHing into an app container.

func (Info) AppSSHHostKeyFingerprint

func (info Info) AppSSHHostKeyFingerprint() string

AppSSHHostKeyFingerprint returns the SSH key fingerprint of the SSH proxy that brokers connections to application instances.

func (Info) CloudControllerAPIVersion

func (info Info) CloudControllerAPIVersion() string

CloudControllerAPIVersion returns the version of the CloudController.

func (Info) LogCache

func (info Info) LogCache() string

LogCache returns the HREF of the Loggregator Traffic Controller.

func (Info) Logging

func (info Info) Logging() string

Logging returns the HREF of the Loggregator Traffic Controller.

func (Info) NetworkPolicyV1

func (info Info) NetworkPolicyV1() string

NetworkPolicyV1 returns the HREF of the Container Networking v1 Policy API

func (Info) OAuthClient

func (info Info) OAuthClient() string

OAuthClient returns the oauth client ID of the SSH proxy that brokers connections to application instances.

func (Info) Routing

func (info Info) Routing() string

func (Info) UAA

func (info Info) UAA() string

UAA returns the HREF of the UAA server.

type InfoLinks struct {
	// AppSSH is the link for application ssh info.
	AppSSH APILink `json:"app_ssh"`

	// CCV3 is the link to the Cloud Controller V3 API.
	CCV3 APILink `json:"cloud_controller_v3"`

	// Logging is the link to the Logging API.
	Logging APILink `json:"logging"`

	// Logging is the link to the Logging API.
	LogCache APILink `json:"log_cache"`

	// NetworkPolicyV1 is the link to the Container to Container Networking
	// API.
	NetworkPolicyV1 APILink `json:"network_policy_v1"`

	// Routing is the link to the routing API
	Routing APILink `json:"routing"`

	// UAA is the link to the UAA API.
	UAA APILink `json:"uaa"`
}

type IsolationSegment

type IsolationSegment struct {
	//GUID is the unique ID of the isolation segment.
	GUID string `json:"guid,omitempty"`
	//Name is the name of the isolation segment.
	Name string `json:"name"`
}

IsolationSegment represents a Cloud Controller Isolation Segment.

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

func (job Job) Errors() []error

Errors returns back a list of

func (Job) HasFailed

func (job Job) HasFailed() bool

HasFailed returns true when the job has completed with an error/failure.

func (Job) IsComplete

func (job Job) IsComplete() bool

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 JobURL

type JobURL string

JobURL is the URL to a given Job.

type Metadata

type Metadata struct {
	Labels map[string]types.NullString `json:"labels,omitempty"`
}

Metadata is used for custom tagging of API resources

type Organization

type Organization struct {
	// GUID is the unique organization identifier.
	GUID string `json:"guid,omitempty"`
	// Name is the name of the organization.
	Name string `json:"name"`

	// Metadata is used for custom tagging of API resources
	Metadata *Metadata `json:"metadata,omitempty"`
}

Organization represents a Cloud Controller V3 Organization.

type Package

type Package struct {
	// CreatedAt is the time with zone when the object was created.
	CreatedAt string

	// DockerImage is the registry address of the docker image.
	DockerImage string

	// DockerPassword is the password for the docker image's registry.
	DockerPassword string

	// DockerUsername is the username for the docker image's registry.
	DockerUsername string

	// GUID is the unique identifier of the package.
	GUID string

	// Links are links to related resources.
	Links APILinks

	// Relationships are a list of relationships to other resources.
	Relationships Relationships

	// State is the state of the package.
	State constant.PackageState

	// Type is the package type.
	Type constant.PackageType
}

Package represents a Cloud Controller V3 Package.

func (Package) MarshalJSON

func (p Package) MarshalJSON() ([]byte, error)

MarshalJSON converts a Package into a Cloud Controller Package.

func (*Package) UnmarshalJSON

func (p *Package) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Package response.

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 struct {
		UserResource []User `json:"users"`
	} `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 Process

type Process struct {
	GUID string
	Type string
	// Command is the process start command. Note: This value will be obfuscated when obtained from listing.
	Command                      types.FilteredString
	HealthCheckType              constant.HealthCheckType
	HealthCheckEndpoint          string
	HealthCheckInvocationTimeout int64
	HealthCheckTimeout           int64
	Instances                    types.NullInt
	MemoryInMB                   types.NullUint64
	DiskInMB                     types.NullUint64
}

func (Process) MarshalJSON

func (p Process) MarshalJSON() ([]byte, error)

func (*Process) UnmarshalJSON

func (p *Process) UnmarshalJSON(data []byte) error

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

type Query struct {
	Key    QueryKey
	Values []string
}

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"
	// 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"
	// 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"
	// 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"
	// StackFilter is a query parameter for listing objects by stack name
	StackFilter QueryKey = "stacks"
	// Unmapped filter is a query parameter specifying unmapped routes
	UnmappedFilter QueryKey = "unmapped"
	// States filter is a query parameter when getting a package's droplets by state
	StatesFilter QueryKey = "states"

	// 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"

	// 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"
)

type Relationship

type Relationship struct {
	GUID string
}

Relationship represents a one to one relationship. An empty GUID will be marshaled as `null`.

func (Relationship) MarshalJSON

func (r Relationship) MarshalJSON() ([]byte, error)

func (*Relationship) UnmarshalJSON

func (r *Relationship) UnmarshalJSON(data []byte) error

type RelationshipList

type RelationshipList struct {
	GUIDs []string
}

RelationshipList represents a one to many relationship.

func (RelationshipList) MarshalJSON

func (r RelationshipList) MarshalJSON() ([]byte, error)

func (*RelationshipList) UnmarshalJSON

func (r *RelationshipList) UnmarshalJSON(data []byte) error

type Relationships

type Relationships map[constant.RelationshipType]Relationship

Relationships represent associations between resources. Relationships is a map of RelationshipTypes to Relationship.

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

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON converts a resource into a Cloud Controller Resource.

func (Resource) ToV2FormattedResource

func (r Resource) ToV2FormattedResource() V2FormattedResource

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Resource response.

type ResourceLinks map[string]APILink

ResourceLinks represents the information returned back from /v3.

func (ResourceLinks) UnmarshalJSON

func (resources ResourceLinks) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller /v3 response.

type ResourceMetadata

type ResourceMetadata struct {
	Metadata *Metadata `json:"metadata,omitempty"`
}

type Role

type Role struct {
	// GUID is the unique identifier for the role.
	GUID string `json:"guid"`
	// Type is the type of the role.
	Type constant.RoleType `json:"type"`
	// UserGUID is the unique identifier of the user who has this role.
	UserGUID string
	// Username is the name of the user who has this role, e.g. "admin", "user@example.com"
	Username string
	// Origin is the identity server, default "uaa". Active Directory can also be an origin
	Origin string
	// OrgGUID is the unique identifier of the org where this role applies,
	// if it is an org role.
	OrgGUID string
	// SpaceGUID is the unique identifier of the space where this role applies,
	// if it is a space role.
	SpaceGUID string
}

func (Role) MarshalJSON

func (r Role) MarshalJSON() ([]byte, error)

MarshalJSON converts a Role into a Cloud Controller Application.

func (*Role) UnmarshalJSON

func (r *Role) UnmarshalJSON(data []byte) error

UnmarshalJSON helps unmarshal a Cloud Controller Role response.

type Route

type Route struct {
	GUID       string
	SpaceGUID  string
	DomainGUID string
	Host       string
	Path       string
	URL        string
	Metadata   *Metadata
}

func (Route) MarshalJSON

func (r Route) MarshalJSON() ([]byte, error)

func (*Route) UnmarshalJSON

func (r *Route) UnmarshalJSON(data []byte) error

type RouteDestination

type RouteDestination struct {
	GUID string
	App  RouteDestinationApp
}

type RouteDestinationApp

type RouteDestinationApp struct {
	GUID    string
	Process struct {
		Type string
	}
}

type SSHEnabled

type SSHEnabled struct {
	Enabled bool
	Reason  string
}

type ServiceBroker

type ServiceBroker struct {
	// GUID is a unique service broker identifier.
	GUID string
	// Name is the name of the service broker.
	Name string
	// URL is the url of the service broker.
	URL string
	// Status is the state of the service broker.
	Status string
}

ServiceBroker represents Service Broker data

type ServiceBrokerModel

type ServiceBrokerModel struct {
	// Name is the name of the service broker.
	Name string
	// URL is the url of the service broker.
	URL string
	// Username is the Basic Auth username for the service broker.
	Username string
	// Password is the Basic Auth password for the service broker.
	Password string
	// Space GUID for the space that the broker is in. Empty when not a space-scoped service broker.
	SpaceGUID string
}

type ServiceInstance

type ServiceInstance struct {
	// GUID is a unique service instance identifier.
	GUID string `json:"guid"`
	// Name is the name of the service instance.
	Name string `json:"name"`
}

ServiceInstance represents a Cloud Controller V3 Service Instance.

type SharedOrgs

type SharedOrgs struct {
	GUIDs []string
}

func (SharedOrgs) MarshalJSON

func (sharedOrgs SharedOrgs) MarshalJSON() ([]byte, error)

func (*SharedOrgs) UnmarshalJSON

func (sharedOrgs *SharedOrgs) UnmarshalJSON(data []byte) error

type Sidecar

type Sidecar struct {
	GUID    string               `json:"guid"`
	Name    string               `json:"name"`
	Command types.FilteredString `json:"command"`
}

type Space

type Space struct {
	// GUID is a unique space identifier.
	GUID string `json:"guid,omitempty"`
	// Name is the name of the space.
	Name string `json:"name"`
	// Relationships list the relationships to the space.
	Relationships Relationships `json:"relationships,omitempty"`
	// Metadata is used for custom tagging of API resources
	Metadata *Metadata `json:"metadata,omitempty"`
}

Space represents a Cloud Controller V3 Space.

type Stack

type Stack struct {
	// GUID is a unique stack identifier.
	GUID string `json:"guid"`
	// Name is the name of the stack.
	Name string `json:"name"`
	// Description is the description for the stack
	Description string `json:"description"`

	// Metadata is used for custom tagging of API resources
	Metadata *Metadata `json:"metadata,omitempty"`
}

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 Task

type Task struct {
	// Command represents the command that will be executed. May be excluded
	// based on the user's role.
	Command string `json:"command,omitempty"`
	// CreatedAt represents the time with zone when the object was created.
	CreatedAt string `json:"created_at,omitempty"`
	// DiskInMB represents the disk in MB allocated for the task.
	DiskInMB uint64 `json:"disk_in_mb,omitempty"`
	// GUID represents the unique task identifier.
	GUID string `json:"guid,omitempty"`
	// MemoryInMB represents the memory in MB allocated for the task.
	MemoryInMB uint64 `json:"memory_in_mb,omitempty"`
	// Name represents the name of the task.
	Name string `json:"name,omitempty"`
	// SequenceID represents the user-facing id of the task. This number is
	// unique for every task associated with a given app.
	SequenceID int64 `json:"sequence_id,omitempty"`
	// State represents the task state.
	State constant.TaskState `json:"state,omitempty"`
	// Tasks can use a process as a template to fill in
	// command, memory, disk values
	//
	// Using a pointer so that it can be set to nil to prevent
	// json serialization when no template is used
	Template *TaskTemplate `json:"template,omitempty"`
}

Task represents a Cloud Controller V3 Task.

type TaskProcessTemplate

type TaskProcessTemplate struct {
	Guid string `json:"guid,omitempty"`
}

type TaskTemplate

type TaskTemplate struct {
	Process TaskProcessTemplate `json:"process,omitempty"`
}

type User

type User struct {
	// GUID is the unique user identifier.
	GUID             string `json:"guid"`
	Username         string `json:"username"`
	PresentationName string `json:"presentation_name"`
	Origin           string `json:"origin"`
}

User represents a Cloud Controller User.

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.

type Warnings

type Warnings []string

Warnings are a collection of warnings that the Cloud Controller can return back from an API request.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
Package constant contains types and constants used by the ccv3 package.
Package constant contains types and constants used by the ccv3 package.

Jump to

Keyboard shortcuts

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