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.
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 GET -> Get PUT -> Update DELETE -> Delete PATCH -> Patch
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 individaul operation should exist at the top of that operation's file.
Index ¶
- func FormatQueryParameters(queries []Query) url.Values
- type APIInfo
- func (info APIInfo) AppSSHEndpoint() string
- func (info APIInfo) AppSSHHostKeyFingerprint() string
- func (info APIInfo) CloudControllerAPIVersion() string
- func (info APIInfo) Logging() string
- func (info APIInfo) NetworkPolicyV1() string
- func (info APIInfo) OAuthClient() string
- func (info APIInfo) UAA() string
- type APILink
- type APILinks
- type Application
- type Build
- type Client
- func (client *Client) AssignSpaceToIsolationSegment(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error)
- func (client *Client) CreateApplication(app Application) (Application, Warnings, error)
- func (client *Client) CreateApplicationActionsApplyManifestByApplication(rawManifest []byte, appGUID string) (string, Warnings, error)
- func (client *Client) CreateApplicationProcessScale(appGUID string, process Process) (Process, Warnings, error)
- func (client *Client) CreateApplicationTask(appGUID string, task Task) (Task, Warnings, error)
- func (client *Client) CreateBuild(build Build) (Build, Warnings, error)
- func (client *Client) CreateIsolationSegment(isolationSegment IsolationSegment) (IsolationSegment, Warnings, error)
- func (client *Client) CreatePackage(pkg Package) (Package, Warnings, error)
- func (client *Client) DeleteApplication(appGUID string) (string, Warnings, error)
- func (client *Client) DeleteApplicationProcessInstance(appGUID string, processType string, instanceIndex int) (Warnings, error)
- func (client *Client) DeleteIsolationSegment(guid string) (Warnings, error)
- func (client *Client) DeleteServiceInstanceRelationshipsSharedSpace(serviceInstanceGUID string, spaceGUID string) (Warnings, error)
- func (client *Client) EntitleIsolationSegmentToOrganizations(isolationSegmentGUID string, organizationGUIDs []string) (RelationshipList, Warnings, error)
- func (client *Client) GetApplicationDropletCurrent(appGUID string) (Droplet, Warnings, error)
- func (client *Client) GetApplicationEnvironmentVariables(appGUID string) (EnvironmentVariableGroups, Warnings, error)
- func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error)
- func (client *Client) GetApplicationProcesses(appGUID string) ([]Process, Warnings, error)
- func (client *Client) GetApplicationTasks(appGUID string, query ...Query) ([]Task, Warnings, error)
- func (client *Client) GetApplications(query ...Query) ([]Application, Warnings, error)
- func (client *Client) GetBuild(guid string) (Build, Warnings, error)
- func (client *Client) GetDroplet(dropletGUID string) (Droplet, Warnings, error)
- func (client *Client) GetDroplets(query ...Query) ([]Droplet, Warnings, error)
- func (client *Client) GetIsolationSegment(guid string) (IsolationSegment, Warnings, error)
- func (client *Client) GetIsolationSegmentOrganizationsByIsolationSegment(isolationSegmentGUID string) ([]Organization, Warnings, error)
- func (client *Client) GetIsolationSegments(query ...Query) ([]IsolationSegment, Warnings, error)
- func (client *Client) GetJob(jobURL string) (Job, Warnings, error)
- func (client *Client) GetOrganizationDefaultIsolationSegment(orgGUID string) (Relationship, Warnings, error)
- func (client *Client) GetOrganizations(query ...Query) ([]Organization, Warnings, error)
- func (client *Client) GetPackage(packageGUID string) (Package, Warnings, error)
- func (client *Client) GetPackages(query ...Query) ([]Package, Warnings, error)
- func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error)
- func (client *Client) GetServiceInstances(query ...Query) ([]ServiceInstance, Warnings, error)
- func (client *Client) GetSpaceIsolationSegment(spaceGUID string) (Relationship, Warnings, error)
- func (client *Client) GetSpaces(query ...Query) ([]Space, Warnings, error)
- func (client *Client) Info() (APIInfo, ResourceLinks, Warnings, error)
- func (client *Client) PatchApplicationProcessHealthCheck(processGUID string, processHealthCheckType string, ...) (Process, Warnings, error)
- func (client *Client) PatchApplicationUserProvidedEnvironmentVariables(appGUID string, envVars EnvironmentVariables) (EnvironmentVariables, Warnings, error)
- func (client *Client) PatchOrganizationDefaultIsolationSegment(orgGUID string, isoSegGUID string) (Relationship, Warnings, error)
- func (client *Client) PollJob(jobURL string) (Warnings, error)
- func (client *Client) RevokeIsolationSegmentFromOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error)
- func (client *Client) SetApplicationDroplet(appGUID string, dropletGUID string) (Relationship, Warnings, error)
- func (client *Client) ShareServiceInstanceToSpaces(serviceInstanceGUID string, spaceGUIDs []string) (RelationshipList, Warnings, error)
- func (client *Client) StartApplication(appGUID string) (Application, Warnings, error)
- func (client *Client) StopApplication(appGUID string) (Application, Warnings, error)
- func (client *Client) TargetCF(settings TargetSettings) (Warnings, error)
- func (client *Client) UpdateApplication(app Application) (Application, Warnings, error)
- func (client *Client) UpdateTask(taskGUID string) (Task, Warnings, error)
- func (client *Client) UploadPackage(pkg Package, fileToUpload string) (Package, Warnings, error)
- func (client *Client) WrapConnection(wrapper ConnectionWrapper)
- type Config
- type ConnectionWrapper
- type Droplet
- type DropletBuildpack
- type EnvironmentVariableGroups
- type EnvironmentVariables
- type ErrorDetails
- type IsolationSegment
- type Job
- type Organization
- type Package
- type PaginatedResources
- type Process
- type ProcessInstance
- type Query
- type QueryKey
- type Relationship
- type RelationshipList
- type Relationships
- type ResourceLinks
- type ServiceInstance
- type Space
- type TargetSettings
- type Task
- 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 APIInfo ¶
type APIInfo struct { // Links is a list of top level Cloud Controller APIs. Links 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"` NetworkPolicyV1 APILink `json:"network_policy_v1"` // UAA is the link to the UAA API UAA APILink `json:"uaa"` } `json:"links"` }
APIInfo represents a GET response from the '/' endpoint of the cloud controller API.
func (APIInfo) AppSSHEndpoint ¶
func (APIInfo) AppSSHHostKeyFingerprint ¶
func (APIInfo) CloudControllerAPIVersion ¶
CloudControllerAPIVersion returns the version for the CloudController.
func (APIInfo) NetworkPolicyV1 ¶
func (APIInfo) OAuthClient ¶
type APILink ¶
type APILink struct { // HREF is the fully qualified URL for the link. HREF string `json:"href"` 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 Application ¶
type Application struct { Name string `json:"name,omitempty"` Relationships Relationships `json:"relationships,omitempty"` GUID string `json:"guid,omitempty"` State constant.ApplicationState `json:"state,omitempty"` LifecycleType constant.AppLifecycleType `json:"-"` LifecycleBuildpacks []string `json:"-"` }
Application represents a Cloud Controller V3 Application.
func (Application) MarshalJSON ¶
func (a Application) MarshalJSON() ([]byte, error)
func (*Application) UnmarshalJSON ¶
func (a *Application) UnmarshalJSON(data []byte) error
type Build ¶
type Build struct { CreatedAt string GUID string Error string PackageGUID string State constant.BuildState DropletGUID string }
func (Build) MarshalJSON ¶
func (*Build) UnmarshalJSON ¶
type Client ¶
type Client struct { APIInfo // contains filtered or unexported fields }
Client can be used to talk to a Cloud Controller's V3 Endpoints.
func (*Client) AssignSpaceToIsolationSegment ¶
func (client *Client) AssignSpaceToIsolationSegment(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error)
AssignSpaceToIsolationSegment assigns an isolation segment to a space and returns the relationship.
func (*Client) CreateApplication ¶
func (client *Client) CreateApplication(app Application) (Application, Warnings, error)
CreateApplication creates an application with the given settings.
func (*Client) CreateApplicationActionsApplyManifestByApplication ¶
func (client *Client) CreateApplicationActionsApplyManifestByApplication(rawManifest []byte, appGUID string) (string, Warnings, error)
CreateApplicationActionsApplyManifestByApplication applies the manifest to the given application.
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 ¶
CreateApplicationTask 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) 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) CreatePackage ¶
CreatePackage creates a package with the given settings, Type and the ApplicationRelationship must be set.
func (*Client) DeleteApplication ¶
DeleteApplication deletes the app with the given app GUID.
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) 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) 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) 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) GetApplicationDropletCurrent ¶
GetApplicationDropletCurrent returns the current droplet for a given application.
func (*Client) GetApplicationEnvironmentVariables ¶
func (client *Client) GetApplicationEnvironmentVariables(appGUID string) (EnvironmentVariableGroups, Warnings, error)
GetApplicationEnvironmentVariables fetches all the environment variables on an application by groups.
func (*Client) GetApplicationProcessByType ¶
func (client *Client) GetApplicationProcessByType(appGUID string, processType string) (Process, Warnings, error)
GetApplicationProcessByType returns application process of specified type
func (*Client) GetApplicationProcesses ¶
GetApplicationProcesses lists processes for a given app
func (*Client) GetApplicationTasks ¶
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 filters.
func (*Client) GetDroplet ¶
GetDroplet returns a droplet with the given GUID.
func (*Client) GetDroplets ¶
GetDroplets lists droplets with optional filters.
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) GetIsolationSegmentOrganizationsByIsolationSegment ¶
func (client *Client) GetIsolationSegmentOrganizationsByIsolationSegment(isolationSegmentGUID string) ([]Organization, Warnings, error)
GetIsolationSegmentOrganizationsByIsolationSegment 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) 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) GetOrganizations ¶
func (client *Client) GetOrganizations(query ...Query) ([]Organization, Warnings, error)
GetOrganizations lists organizations with optional filters.
func (*Client) GetPackage ¶
GetPackage returns the package with the given GUID.
func (*Client) GetPackages ¶
GetPackages returns the list of packages.
func (*Client) GetProcessInstances ¶
func (client *Client) GetProcessInstances(processGUID string) ([]ProcessInstance, Warnings, error)
GetProcessInstances lists instance stats for a given process.
func (*Client) GetServiceInstances ¶
func (client *Client) GetServiceInstances(query ...Query) ([]ServiceInstance, Warnings, error)
GetServiceInstances lists ServiceInstances 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) Info ¶
func (client *Client) Info() (APIInfo, ResourceLinks, Warnings, error)
Info returns endpoint and API information from /v3.
func (*Client) PatchApplicationProcessHealthCheck ¶
func (client *Client) PatchApplicationProcessHealthCheck(processGUID string, processHealthCheckType string, processHealthCheckEndpoint string) (Process, Warnings, error)
PatchApplicationProcessHealthCheck updates application health check type
func (*Client) PatchApplicationUserProvidedEnvironmentVariables ¶
func (client *Client) PatchApplicationUserProvidedEnvironmentVariables(appGUID string, envVars EnvironmentVariables) (EnvironmentVariables, Warnings, error)
PatchApplicationUserProvidedEnvironmentVariables updates the user provided environment variables on an applicaiton. A restart is required for changes to take effect.
func (*Client) PatchOrganizationDefaultIsolationSegment ¶
func (client *Client) PatchOrganizationDefaultIsolationSegment(orgGUID string, isoSegGUID string) (Relationship, Warnings, error)
PatchOrganizationDefaultIsolationSegment sets the default isolation segment for an organization on the controller. If isoSegGuid is empty it will reset the default isolation segment.
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) RevokeIsolationSegmentFromOrganization ¶
func (client *Client) RevokeIsolationSegmentFromOrganization(isolationSegmentGUID string, orgGUID string) (Warnings, error)
RevokeIsolationSegmentFromOrganization will delete the relationship between the isolation segment and the organization provided.
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) 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) StartApplication ¶
func (client *Client) StartApplication(appGUID string) (Application, Warnings, error)
StartApplication starts the given application.
func (*Client) StopApplication ¶
func (client *Client) StopApplication(appGUID string) (Application, Warnings, error)
StopApplication stops the given application.
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) UpdateApplication ¶
func (client *Client) UpdateApplication(app Application) (Application, Warnings, error)
UpdateApplication updates an application with the given settings.
func (*Client) UpdateTask ¶
UpdateTask cancels a task.
func (*Client) UploadPackage ¶
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 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 Droplet ¶
type Droplet struct { GUID string `json:"guid"` State constant.DropletState `json:"state"` CreatedAt string `json:"created_at"` Stack string `json:"stack,omitempty"` Buildpacks []DropletBuildpack `json:"buildpacks,omitempty"` Image string `json:"image"` }
Droplet represents a cloud controller droplet's metadata. A droplet is a set of compiled bits for a given application.
type DropletBuildpack ¶
type EnvironmentVariableGroups ¶
type EnvironmentVariableGroups struct { SystemProvided map[string]interface{} `json:"system_env_json"` ApplicationProvided map[string]interface{} `json:"application_env_json"` UserProvided map[string]interface{} `json:"environment_variables"` RunningGroup map[string]interface{} `json:"running_env_json"` StagingGroup map[string]interface{} `json:"staging_env_json"` }
EnvironmentVariableGroups represents all environment variables on an application
type EnvironmentVariables ¶
type EnvironmentVariables struct {
Variables map[string]types.FilteredString `json:"var"`
}
EnvironmentVariables represents the environment variables that can be set on application by user
type ErrorDetails ¶
type IsolationSegment ¶
IsolationSegment represents a Cloud Controller Isolation Segment.
type Job ¶
type Job struct { Errors []ErrorDetails `json:"errors"` GUID string `json:"guid"` State constant.JobState `json:"state"` }
Job represents a Cloud Controller Job.
type Organization ¶
Organization represents a Cloud Controller V3 Organization.
type Package ¶
type Package struct { GUID string CreatedAt string Links APILinks Relationships Relationships State constant.PackageState Type constant.PackageType DockerImage string DockerUsername string DockerPassword string }
func (Package) MarshalJSON ¶
func (*Package) UnmarshalJSON ¶
type PaginatedResources ¶
type PaginatedResources struct { Pagination struct { Next struct { HREF string `json:"href"` } `json:"next"` } `json:"pagination"` ResourcesBytes json.RawMessage `json:"resources"` // 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 `json:"guid"` Type string `json:"type"` HealthCheckType string `json:"-"` HealthCheckEndpoint string `json:"-"` Instances types.NullInt `json:"instances"` MemoryInMB types.NullUint64 `json:"memory_in_mb"` DiskInMB types.NullUint64 `json:"disk_in_mb"` }
func (Process) MarshalJSON ¶
func (*Process) UnmarshalJSON ¶
type ProcessInstance ¶
type ProcessInstance struct { Index int State constant.ProcessInstanceState Uptime int CPU float64 MemoryUsage uint64 MemoryQuota uint64 DiskUsage uint64 DiskQuota uint64 }
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" // GUIDFilter is a query parameter for listing objects by GUID. GUIDFilter QueryKey = "guids" // NameFilter is a query parameter for listing objects by name. NameFilter QueryKey = "names" // 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" // 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" // NameOrder is a query value for ordering by name. This value is used in // conjunction with the OrderBy QueryKey. NameOrder = "name" )
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 is a map of RelationshipTypes to Relationship.
type ResourceLinks ¶
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 ServiceInstance ¶
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 { GUID string `json:"guid,omitempty"` SequenceID int `json:"sequence_id,omitempty"` Name string `json:"name,omitempty"` Command string `json:"command"` State constant.TaskState `json:"state,omitempty"` CreatedAt string `json:"created_at,omitempty"` MemoryInMB uint64 `json:"memory_in_mb,omitempty"` DiskInMB uint64 `json:"disk_in_mb,omitempty"` }
Task represents a Cloud Controller V3 Task.
Source Files ¶
- api_links.go
- application.go
- build.go
- client.go
- connection_wrapper.go
- droplet.go
- environment_variables.go
- errors.go
- info.go
- instance.go
- isolation_segment.go
- job.go
- organization.go
- package.go
- paginate.go
- paginated_resources.go
- process.go
- query.go
- relationship.go
- relationship_list.go
- relationships.go
- request.go
- service_instance.go
- space.go
- target.go
- task.go