client

package
v3.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPage     = 1
	DefaultPageSize = 50

	PageField    = "page"
	PerPageField = "per_page"
)

Variables

View Source
var AsyncProcessFailedError = errors.New("received state FAILED while waiting for async process")
View Source
var AsyncProcessTimeoutError = errors.New("timed out after waiting for async process")
View Source
var ErrExactlyOneResultNotReturned = errors.New("expected exactly 1 result, but got less or more than 1")
View Source
var ErrNoResultsReturned = errors.New("expected 1 or more results, but got 0")

Functions

func AutoPage

func AutoPage[T ListOptioner, R any](opts T, list ListFunc[T, R]) ([]R, error)

func ExecuteTests

func ExecuteTests(tests []RouteTest, t *testing.T)

func First

func First[T ListOptioner, R any](opts T, list ListFunc[T, R]) (R, error)

First returns the first object from the call to list or an error if matches < 1

func PollForStateOrTimeout

func PollForStateOrTimeout(getState getStateFunc, successState string, opts *PollingOptions) error

func Single

func Single[T ListOptioner, R any](opts T, list ListFunc[T, R]) (R, error)

Single returns a single object from the call to list or an error if matches > 1 or matches < 1

Types

type AdminClient

type AdminClient commonClient

func (*AdminClient) ClearBuildpackCache

func (c *AdminClient) ClearBuildpackCache(ctx context.Context) (string, error)

ClearBuildpackCache will delete all the existing buildpack caches in the blobstore. Success returns a JobID.

The buildpack cache is used during staging by buildpacks as a way to cache certain resources, e.g. downloaded Ruby gems. An admin who wants to decrease the size of their blobstore could use this endpoint to delete unnecessary blobs.

type AppClient

type AppClient commonClient

func (*AppClient) Create

func (c *AppClient) Create(ctx context.Context, r *resource.AppCreate) (*resource.App, error)

Create a new app

func (*AppClient) Delete

func (c *AppClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified app asynchronously and return a jobGUID.

func (*AppClient) First

func (c *AppClient) First(ctx context.Context, opts *AppListOptions) (*resource.App, error)

First returns the first app matching the options or an error when less than 1 match

func (*AppClient) Get

func (c *AppClient) Get(ctx context.Context, guid string) (*resource.App, error)

Get the specified app

func (*AppClient) GetEnvironment

func (c *AppClient) GetEnvironment(ctx context.Context, guid string) (*resource.AppEnvironment, error)

GetEnvironment retrieves the environment variables that will be provided to an app at runtime. It will include environment variables for Environment Variable Groups and Service Bindings.

func (*AppClient) GetEnvironmentVariables

func (c *AppClient) GetEnvironmentVariables(ctx context.Context, guid string) (map[string]*string, error)

GetEnvironmentVariables retrieves the environment variables that are associated with the given app

func (*AppClient) GetIncludeSpace

func (c *AppClient) GetIncludeSpace(ctx context.Context, guid string) (*resource.App, *resource.Space, error)

GetIncludeSpace allows callers to fetch an app and include the parent space

func (*AppClient) GetIncludeSpaceAndOrganization

func (c *AppClient) GetIncludeSpaceAndOrganization(ctx context.Context, guid string) (*resource.App, *resource.Space, *resource.Organization, error)

GetIncludeSpaceAndOrganization allows callers to fetch an app and include the parent space and organizations

func (*AppClient) List

func (c *AppClient) List(ctx context.Context, opts *AppListOptions) ([]*resource.App, *Pager, error)

List pages all the apps the user has access to

func (*AppClient) ListAll

func (c *AppClient) ListAll(ctx context.Context, opts *AppListOptions) ([]*resource.App, error)

ListAll retrieves all apps the user has access to

func (*AppClient) ListIncludeSpaces

func (c *AppClient) ListIncludeSpaces(ctx context.Context, opts *AppListOptions) ([]*resource.App, []*resource.Space, *Pager, error)

ListIncludeSpaces page all apps the user has access to and include the associated spaces

func (*AppClient) ListIncludeSpacesAll

func (c *AppClient) ListIncludeSpacesAll(ctx context.Context, opts *AppListOptions) ([]*resource.App, []*resource.Space, error)

ListIncludeSpacesAll retrieves all apps the user has access to and include the associated spaces

func (*AppClient) ListIncludeSpacesAndOrganizations

func (c *AppClient) ListIncludeSpacesAndOrganizations(ctx context.Context, opts *AppListOptions) ([]*resource.App, []*resource.Space, []*resource.Organization, *Pager, error)

ListIncludeSpacesAndOrganizations page all apps the user has access to and include the associated spaces and organizations

func (*AppClient) ListIncludeSpacesAndOrganizationsAll

func (c *AppClient) ListIncludeSpacesAndOrganizationsAll(ctx context.Context, opts *AppListOptions) ([]*resource.App, []*resource.Space, []*resource.Organization, error)

ListIncludeSpacesAndOrganizationsAll retrieves all apps the user has access to and include the associated spaces and organizations

func (*AppClient) Permissions

func (c *AppClient) Permissions(ctx context.Context, guid string) (*resource.AppPermissions, error)

Permissions gets the current user’s permissions for the given app. If a user can see an app, then they can see its basic data. Only admin, read-only admins, and space developers can read sensitive data.

func (*AppClient) Restart

func (c *AppClient) Restart(ctx context.Context, guid string) (*resource.App, error)

Restart will synchronously stop and start an application. Unlike the start and stop actions, this endpoint will error if the app is not successfully stopped in the runtime. For restarting applications without downtime, see the Deployments resource.

func (*AppClient) SSHEnabled

func (c *AppClient) SSHEnabled(ctx context.Context, guid string) (*resource.AppSSHEnabled, error)

SSHEnabled returns if an application’s runtime environment will accept ssh connections. If ssh is disabled, the reason field will describe whether it is disabled globally, at the space level, or at the app level.

func (*AppClient) SetEnvironmentVariables

func (c *AppClient) SetEnvironmentVariables(ctx context.Context, guid string, envRequest map[string]*string) (map[string]*string, error)

SetEnvironmentVariables updates the environment variables associated with the given app. The variables given in the request will be merged with the existing app environment variables. Any requested variables with a value of null will be removed from the app.

Environment variable names may not start with VCAP_ PORT is not a valid environment variable.

func (*AppClient) Single

func (c *AppClient) Single(ctx context.Context, opts *AppListOptions) (*resource.App, error)

Single returns a single app matching the options or an error if not exactly 1 match

func (*AppClient) Start

func (c *AppClient) Start(ctx context.Context, guid string) (*resource.App, error)

Start the app if not already started

func (*AppClient) Stop

func (c *AppClient) Stop(ctx context.Context, guid string) (*resource.App, error)

Stop the app if not already stopped

func (*AppClient) Update

func (c *AppClient) Update(ctx context.Context, guid string, r *resource.AppUpdate) (*resource.App, error)

Update the specified attributes of the app

type AppFeatureClient

type AppFeatureClient commonClient

func (*AppFeatureClient) Get

func (c *AppFeatureClient) Get(ctx context.Context, appGUID, featureName string) (*resource.AppFeature, error)

Get retrieves the named app feature

func (*AppFeatureClient) GetRevisions

func (c *AppFeatureClient) GetRevisions(ctx context.Context, appGUID string) (*resource.AppFeature, error)

GetRevisions retrieves the revisions app feature

func (*AppFeatureClient) GetSSH

func (c *AppFeatureClient) GetSSH(ctx context.Context, appGUID string) (*resource.AppFeature, error)

GetSSH retrieves the SSH app feature

func (*AppFeatureClient) List

func (c *AppFeatureClient) List(ctx context.Context, appGUID string) ([]*resource.AppFeature, *Pager, error)

List pages all app features

func (*AppFeatureClient) Update

func (c *AppFeatureClient) Update(ctx context.Context, appGUID, featureName string, enabled bool) (*resource.AppFeature, error)

Update the enabled attribute of the named app feature

func (*AppFeatureClient) UpdateRevisions

func (c *AppFeatureClient) UpdateRevisions(ctx context.Context, appGUID string, enabled bool) (*resource.AppFeature, error)

UpdateRevisions updated the enabled attribute of the revisions app feature

func (*AppFeatureClient) UpdateSSH

func (c *AppFeatureClient) UpdateSSH(ctx context.Context, appGUID string, enabled bool) (*resource.AppFeature, error)

UpdateSSH updated the enabled attribute of the SSH app feature

type AppListOptions

type AppListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
	SpaceGUIDs        Filter `qs:"space_guids"`
	Stacks            Filter `qs:"stacks"`

	LifecycleType resource.LifecycleType  `qs:"lifecycle_type"`
	Include       resource.AppIncludeType `qs:"include"`
}

AppListOptions list filters

func NewAppListOptions

func NewAppListOptions() *AppListOptions

NewAppListOptions creates new options to pass to list

func (AppListOptions) ToQueryString

func (o AppListOptions) ToQueryString() (url.Values, error)

type AppUsageClient

type AppUsageClient commonClient

func (*AppUsageClient) Get

func (c *AppUsageClient) Get(ctx context.Context, guid string) (*resource.AppUsage, error)

Get retrieves the specified app event

func (*AppUsageClient) List

List pages all app usage events

func (*AppUsageClient) ListAll

ListAll retrieves all app usage events

func (*AppUsageClient) Purge

func (c *AppUsageClient) Purge(ctx context.Context) error

Purge destroys all existing events. Populates new usage events, one for each started app. All populated events will have a created_at value of current time.

There is the potential race condition if apps are currently being started, stopped, or scaled. The seeded usage events will have the same guid as the app.

type AppUsageListOptions

type AppUsageListOptions struct {
	*ListOptions
}

AppUsageListOptions list filters

func NewAppUsageOptions

func NewAppUsageOptions() *AppUsageListOptions

NewAppUsageOptions creates new options to pass to list

func (AppUsageListOptions) ToQueryString

func (o AppUsageListOptions) ToQueryString() (url.Values, error)

type AuditEventClient

type AuditEventClient commonClient

func (*AuditEventClient) First

First returns the first audit event matching the options or an error when less than 1 match

func (*AuditEventClient) Get

Get retrieves the specified audit event

func (*AuditEventClient) List

List pages all audit events the user has access to

func (*AuditEventClient) ListAll

ListAll retrieves all audit events the user has access to

func (*AuditEventClient) Single

Single returns a single audit event matching the options or an error if not exactly 1 match

type AuditEventListOptions

type AuditEventListOptions struct {
	*ListOptions

	Types             Filter          `qs:"types"`        //  list of event types to filter by
	TargetGUIDs       ExclusionFilter `qs:"target_guids"` // list of target guids to filter by
	OrganizationGUIDs Filter          `qs:"organization_guids"`
	SpaceGUIDs        Filter          `qs:"space_guids"`
}

AuditEventListOptions list filters

func NewAuditEventListOptions

func NewAuditEventListOptions() *AuditEventListOptions

NewAuditEventListOptions creates new options to pass to list

func (AuditEventListOptions) ToQueryString

func (o AuditEventListOptions) ToQueryString() (url.Values, error)

type BuildAppListOptions

type BuildAppListOptions struct {
	*ListOptions

	States Filter `qs:"states"`
}

BuildAppListOptions list filters

func NewBuildAppListOptions

func NewBuildAppListOptions() *BuildAppListOptions

NewBuildAppListOptions creates new options to pass to list

func (BuildAppListOptions) ToQueryString

func (o BuildAppListOptions) ToQueryString() (url.Values, error)

type BuildClient

type BuildClient commonClient

func (*BuildClient) Create

Create a new build

func (*BuildClient) Delete

func (c *BuildClient) Delete(ctx context.Context, guid string) error

Delete the specified build

func (*BuildClient) First

func (c *BuildClient) First(ctx context.Context, opts *BuildListOptions) (*resource.Build, error)

First returns the first build matching the options or an error when less than 1 match

func (*BuildClient) FirstForApp

func (c *BuildClient) FirstForApp(ctx context.Context, appGUID string, opts *BuildAppListOptions) (*resource.Build, error)

FirstForApp returns the first build matching the options and app or an error when less than 1 match

func (*BuildClient) Get

func (c *BuildClient) Get(ctx context.Context, guid string) (*resource.Build, error)

Get the specified build

func (*BuildClient) List

func (c *BuildClient) List(ctx context.Context, opts *BuildListOptions) ([]*resource.Build, *Pager, error)

List pages all builds the user has access to

func (*BuildClient) ListAll

func (c *BuildClient) ListAll(ctx context.Context, opts *BuildListOptions) ([]*resource.Build, error)

ListAll retrieves all builds the user has access to

func (*BuildClient) ListForApp

func (c *BuildClient) ListForApp(ctx context.Context, appGUID string, opts *BuildAppListOptions) ([]*resource.Build, *Pager, error)

ListForApp pages all builds for the app the user has access to

func (*BuildClient) ListForAppAll

func (c *BuildClient) ListForAppAll(ctx context.Context, appGUID string, opts *BuildAppListOptions) ([]*resource.Build, error)

ListForAppAll retrieves all builds for the app the user has access to

func (*BuildClient) PollStaged

func (c *BuildClient) PollStaged(ctx context.Context, guid string, opts *PollingOptions) error

PollStaged waits until the build is staged, fails, or times out

func (*BuildClient) Single

func (c *BuildClient) Single(ctx context.Context, opts *BuildListOptions) (*resource.Build, error)

Single returns a single build matching the options or an error if not exactly 1 match

func (*BuildClient) SingleForApp

func (c *BuildClient) SingleForApp(ctx context.Context, appGUID string, opts *BuildAppListOptions) (*resource.Build, error)

SingleForApp returns a single build matching the options and app or an error if not exactly 1 match

func (*BuildClient) Update

func (c *BuildClient) Update(ctx context.Context, guid string, r *resource.BuildUpdate) (*resource.Build, error)

Update the specified attributes of the build

type BuildListOptions

type BuildListOptions struct {
	*ListOptions

	States       Filter `qs:"states"`
	AppGUIDs     Filter `qs:"app_guids"`
	PackageGUIDs Filter `qs:"package_guids"`
}

BuildListOptions list filters

func NewBuildListOptions

func NewBuildListOptions() *BuildListOptions

NewBuildListOptions creates new options to pass to list

func (BuildListOptions) ToQueryString

func (o BuildListOptions) ToQueryString() (url.Values, error)

type BuildpackClient

type BuildpackClient commonClient

func (*BuildpackClient) Create

Create a new buildpack

func (*BuildpackClient) Delete

func (c *BuildpackClient) Delete(ctx context.Context, guid string) error

Delete the specified buildpack

func (*BuildpackClient) First

First returns the first buildpack matching the options or an error when less than 1 match

func (*BuildpackClient) Get

Get retrieves the specified buildpack

func (*BuildpackClient) List

List pages all buildpacks the user has access to

func (*BuildpackClient) ListAll

ListAll retrieves all buildpacks the user has access to

func (*BuildpackClient) Single

Single returns a single buildpack matching the options or an error if not exactly 1 match

func (*BuildpackClient) Update

Update the specified attributes of the buildpack

func (*BuildpackClient) Upload

func (c *BuildpackClient) Upload(ctx context.Context, guid string, zipFile io.Reader) (string, *resource.Buildpack, error)

Upload a gzip compressed (zip) file containing a Cloud Foundry compatible buildpack

type BuildpackListOptions

type BuildpackListOptions struct {
	*ListOptions

	Names  Filter `qs:"names"`  // list of buildpack names to filter by
	Stacks Filter `qs:"stacks"` // list of stack names to filter by
}

BuildpackListOptions list filters

func NewBuildpackListOptions

func NewBuildpackListOptions() *BuildpackListOptions

NewBuildpackListOptions creates new options to pass to list

func (BuildpackListOptions) ToQueryString

func (o BuildpackListOptions) ToQueryString() (url.Values, error)

type Client

type Client struct {
	Admin                     *AdminClient
	Applications              *AppClient
	AppFeatures               *AppFeatureClient
	AppUsageEvents            *AppUsageClient
	AuditEvents               *AuditEventClient
	Buildpacks                *BuildpackClient
	Builds                    *BuildClient
	Deployments               *DeploymentClient
	Domains                   *DomainClient
	Droplets                  *DropletClient
	EnvVarGroups              *EnvVarGroupClient
	FeatureFlags              *FeatureFlagClient
	IsolationSegments         *IsolationSegmentClient
	Jobs                      *JobClient
	Manifests                 *ManifestClient
	Organizations             *OrganizationClient
	OrganizationQuotas        *OrganizationQuotaClient
	Packages                  *PackageClient
	Processes                 *ProcessClient
	Revisions                 *RevisionClient
	ResourceMatches           *ResourceMatchClient
	Roles                     *RoleClient
	Root                      *RootClient
	Routes                    *RouteClient
	SecurityGroups            *SecurityGroupClient
	ServiceBrokers            *ServiceBrokerClient
	ServiceCredentialBindings *ServiceCredentialBindingClient
	ServiceInstances          *ServiceInstanceClient
	ServiceOfferings          *ServiceOfferingClient
	ServicePlans              *ServicePlanClient
	ServicePlansVisibility    *ServicePlanVisibilityClient
	ServiceRouteBindings      *ServiceRouteBindingClient
	ServiceUsageEvents        *ServiceUsageClient
	Sidecars                  *SidecarClient
	Spaces                    *SpaceClient
	SpaceFeatures             *SpaceFeatureClient
	SpaceQuotas               *SpaceQuotaClient
	Stacks                    *StackClient
	Tasks                     *TaskClient
	Users                     *UserClient
	// contains filtered or unexported fields
}

Client used to communicate with Cloud Foundry

func New

func New(config *config.Config) (*Client, error)

New returns a new CF client

func (*Client) AccessToken

func (c *Client) AccessToken(ctx context.Context) (string, error)

AccessToken returns the raw encoded OAuth access token without the bearer prefix

func (*Client) SSHCode

func (c *Client) SSHCode(ctx context.Context) (string, error)

SSHCode generates an SSH code that can be used by generic SSH clients to SSH into app instances

type CloudFoundryHTTPError

type CloudFoundryHTTPError struct {
	StatusCode int
	Status     string
	Body       []byte
}

func (CloudFoundryHTTPError) Error

func (e CloudFoundryHTTPError) Error() string

type DeploymentClient

type DeploymentClient commonClient

func (*DeploymentClient) Cancel

func (c *DeploymentClient) Cancel(ctx context.Context, guid string) error

Cancel the ongoing deployment

func (*DeploymentClient) Create

Create a new deployment

func (*DeploymentClient) First

First returns the first deployment matching the options or an error when less than 1 match

func (*DeploymentClient) Get

Get the specified deployment

func (*DeploymentClient) List

List pages deployments the user has access to

func (*DeploymentClient) ListAll

ListAll retrieves all deployments the user has access to

func (*DeploymentClient) Single

Single returns a single deployment matching the options or an error if not exactly 1 match

func (*DeploymentClient) Update

Update the specified attributes of the deployment

type DeploymentListOptions

type DeploymentListOptions struct {
	*ListOptions

	AppGUIDs      Filter `qs:"app_guids"`
	States        Filter `qs:"states"`
	StatusReasons Filter `qs:"status_reasons"`
	StatusValues  Filter `qs:"status_values"`
}

DeploymentListOptions list filters

func NewDeploymentListOptions

func NewDeploymentListOptions() *DeploymentListOptions

NewDeploymentListOptions creates new options to pass to list

func (DeploymentListOptions) ToQueryString

func (o DeploymentListOptions) ToQueryString() (url.Values, error)

type DomainClient

type DomainClient commonClient

func (*DomainClient) Create

Create a new domain

func (*DomainClient) Delete

func (c *DomainClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified domain asynchronously and return a jobGUID.

func (*DomainClient) First

First returns the first domain matching the options or an error when less than 1 match

func (*DomainClient) FirstForOrganization

func (c *DomainClient) FirstForOrganization(ctx context.Context, organizationGUID string, opts *DomainListOptions) (*resource.Domain, error)

FirstForOrganization returns the first domain matching the options and organization or an error when less than 1 match

func (*DomainClient) Get

func (c *DomainClient) Get(ctx context.Context, guid string) (*resource.Domain, error)

Get the specified domain

func (*DomainClient) List

List pages Domains the user has access to

func (*DomainClient) ListAll

func (c *DomainClient) ListAll(ctx context.Context, opts *DomainListOptions) ([]*resource.Domain, error)

ListAll retrieves all domains the user has access to

func (*DomainClient) ListForOrganization

func (c *DomainClient) ListForOrganization(ctx context.Context, organizationGUID string, opts *DomainListOptions) ([]*resource.Domain, *Pager, error)

ListForOrganization pages all domains for the specified org that the user has access to

func (*DomainClient) ListForOrganizationAll

func (c *DomainClient) ListForOrganizationAll(ctx context.Context, organizationGUID string, opts *DomainListOptions) ([]*resource.Domain, error)

ListForOrganizationAll retrieves all domains for the specified org that the user has access to

func (*DomainClient) Share

func (c *DomainClient) Share(ctx context.Context, domainGUID, organizationGUID string) (*resource.ToManyRelationships, error)

Share an organization-scoped domain to the organization specified by the org guid This will allow the organization to use the organization-scoped domain

func (*DomainClient) ShareMany

ShareMany shares an organization-scoped domain to other organizations specified by a list of organization guids This will allow any of the other organizations to use the organization-scoped domain.

func (*DomainClient) Single

Single returns a single domain matching the options or an error if not exactly 1 match

func (*DomainClient) SingleForOrganization

func (c *DomainClient) SingleForOrganization(ctx context.Context, organizationGUID string, opts *DomainListOptions) (*resource.Domain, error)

SingleForOrganization returns a single domain matching the options and org or an error if not exactly 1 match

func (*DomainClient) UnShare

func (c *DomainClient) UnShare(ctx context.Context, domainGUID, organizationGUID string) error

UnShare an organization-scoped domain to other organizations specified by a list of organization guids This will allow any of the other organizations to use the organization-scoped domain.

func (*DomainClient) Update

Update the specified attributes of the domain

type DomainListOptions

type DomainListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
}

DomainListOptions list filters

func NewDomainListOptions

func NewDomainListOptions() *DomainListOptions

NewDomainListOptions creates new options to pass to list

func (DomainListOptions) ToQueryString

func (o DomainListOptions) ToQueryString() (url.Values, error)

type DropletAppListOptions

type DropletAppListOptions struct {
	*ListOptions

	GUIDs   Filter `qs:"guids"`   // list of droplet guids to filter by
	States  Filter `qs:"states"`  // list of droplet states to filter by
	Current bool   `qs:"current"` // If true, only include the droplet currently assigned to the app
}

DropletAppListOptions list filters

func NewDropletAppListOptions

func NewDropletAppListOptions() *DropletAppListOptions

NewDropletAppListOptions creates new options to pass to list droplets by package

func (DropletAppListOptions) ToQueryString

func (o DropletAppListOptions) ToQueryString() (url.Values, error)

type DropletClient

type DropletClient commonClient

func (*DropletClient) Copy

func (c *DropletClient) Copy(ctx context.Context, srcDropletGUID string, destAppGUID string) (any, error)

Copy a droplet to a different app. The copied droplet excludes the environment variables listed on the source droplet

func (*DropletClient) Create

Create a droplet without a package. To create a droplet based on a package, see Create a build

func (*DropletClient) Delete

func (c *DropletClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified droplet asynchronously and return a jobGUID.

func (*DropletClient) Download

func (c *DropletClient) Download(ctx context.Context, guid string) (io.ReadCloser, error)

Download a gzip compressed tarball file containing a Cloud Foundry compatible droplet It is the caller's responsibility to close the io.ReadCloser

func (*DropletClient) First

First returns the first droplet matching the options or an error when less than 1 match

func (*DropletClient) FirstForApp

func (c *DropletClient) FirstForApp(ctx context.Context, appGUID string, opts *DropletAppListOptions) (*resource.Droplet, error)

FirstForApp returns the first droplet matching the options and app or an error when less than 1 match

func (*DropletClient) FirstForPackage

func (c *DropletClient) FirstForPackage(ctx context.Context, packageGUID string, opts *DropletPackageListOptions) (*resource.Droplet, error)

FirstForPackage returns the first droplet matching the options and package or an error when less than 1 match

func (*DropletClient) Get

func (c *DropletClient) Get(ctx context.Context, guid string) (*resource.Droplet, error)

Get retrieves the droplet by ID

func (*DropletClient) GetCurrentAssociationForApp

func (c *DropletClient) GetCurrentAssociationForApp(ctx context.Context, appGUID string) (*resource.DropletCurrent, error)

GetCurrentAssociationForApp retrieves the current droplet relationship for an app

func (*DropletClient) GetCurrentForApp

func (c *DropletClient) GetCurrentForApp(ctx context.Context, appGUID string) (*resource.Droplet, error)

GetCurrentForApp retrieves the current droplet for an app

func (*DropletClient) List

List pages all droplets the user has access to

func (*DropletClient) ListAll

func (c *DropletClient) ListAll(ctx context.Context, opts *DropletListOptions) ([]*resource.Droplet, error)

ListAll retrieves all droplets the user has access to

func (*DropletClient) ListForApp

func (c *DropletClient) ListForApp(ctx context.Context, appGUID string, opts *DropletAppListOptions) ([]*resource.Droplet, *Pager, error)

ListForApp pages all droplets for the specified app

func (*DropletClient) ListForAppAll

func (c *DropletClient) ListForAppAll(ctx context.Context, appGUID string, opts *DropletAppListOptions) ([]*resource.Droplet, error)

ListForAppAll retrieves all droplets for the specified app

func (*DropletClient) ListForPackage

func (c *DropletClient) ListForPackage(ctx context.Context, packageGUID string, opts *DropletPackageListOptions) ([]*resource.Droplet, *Pager, error)

ListForPackage pages all droplets for the specified package

func (*DropletClient) ListForPackageAll

func (c *DropletClient) ListForPackageAll(ctx context.Context, packageGUID string, opts *DropletPackageListOptions) ([]*resource.Droplet, error)

ListForPackageAll retrieves all droplets for the specified package

func (*DropletClient) SetCurrentAssociationForApp

func (c *DropletClient) SetCurrentAssociationForApp(ctx context.Context, appGUID, dropletGUID string) (*resource.DropletCurrent, error)

SetCurrentAssociationForApp sets the current droplet for an app. The current droplet is the droplet that the app will use when running

func (*DropletClient) Single

Single returns a single droplet matching the options or an error if not exactly 1 match

func (*DropletClient) SingleForApp

func (c *DropletClient) SingleForApp(ctx context.Context, appGUID string, opts *DropletAppListOptions) (*resource.Droplet, error)

SingleForApp returns a single droplet matching the options and app or an error if not exactly 1 match

func (*DropletClient) SingleForPackage

func (c *DropletClient) SingleForPackage(ctx context.Context, packageGUID string, opts *DropletPackageListOptions) (*resource.Droplet, error)

SingleForPackage returns a single droplet matching the options and package or an error if not exactly 1 match

func (*DropletClient) Update

Update an existing droplet

func (*DropletClient) Upload

func (c *DropletClient) Upload(ctx context.Context, guid string, tgzDroplet io.Reader) (string, *resource.Droplet, error)

Upload a gzip compressed tarball (tgz) file containing a Cloud Foundry compatible droplet

type DropletListOptions

type DropletListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`              // list of droplet guids to filter by
	States            Filter `qs:"states"`             // list of droplet states to filter by
	AppGUIDs          Filter `qs:"app_guids"`          // list of app guids to filter by
	SpaceGUIDs        Filter `qs:"space_guids"`        // list of space guids to filter by
	OrganizationGUIDs Filter `qs:"organization_guids"` // list of organization guids to filter by
}

DropletListOptions list filters

func NewDropletListOptions

func NewDropletListOptions() *DropletListOptions

NewDropletListOptions creates new options to pass to list

func (DropletListOptions) ToQueryString

func (o DropletListOptions) ToQueryString() (url.Values, error)

type DropletPackageListOptions

type DropletPackageListOptions struct {
	*ListOptions

	GUIDs  Filter `qs:"guids"`  // list of droplet guids to filter by
	States Filter `qs:"states"` // list of droplet states to filter by
}

DropletPackageListOptions list filters

func NewDropletPackageListOptions

func NewDropletPackageListOptions() *DropletPackageListOptions

NewDropletPackageListOptions creates new options to pass to list droplets by package

func (DropletPackageListOptions) ToQueryString

func (o DropletPackageListOptions) ToQueryString() (url.Values, error)

type EnvVarGroupClient

type EnvVarGroupClient commonClient

func (*EnvVarGroupClient) Get

Get retrieves the specified envvar group

func (*EnvVarGroupClient) GetRunning

func (c *EnvVarGroupClient) GetRunning(ctx context.Context) (*resource.EnvVarGroup, error)

GetRunning retrieves the running envvar group

func (*EnvVarGroupClient) GetStaging

func (c *EnvVarGroupClient) GetStaging(ctx context.Context) (*resource.EnvVarGroup, error)

GetStaging retrieves the running envvar group

func (*EnvVarGroupClient) Update

Update the specified attributes of the envar group

func (*EnvVarGroupClient) UpdateRunning

UpdateRunning updates the specified attributes of the running envar group

func (*EnvVarGroupClient) UpdateStaging

UpdateStaging updates the specified attributes of the staging envar group

type ExclusionFilter

type ExclusionFilter struct {
	Filter
	Not bool
}

func (*ExclusionFilter) NotEqualTo

func (e *ExclusionFilter) NotEqualTo(v ...string)

func (ExclusionFilter) Serialize

func (e ExclusionFilter) Serialize(values url.Values, tag string) error

type FeatureFlagClient

type FeatureFlagClient commonClient

func (*FeatureFlagClient) Get

Get the specified feature flag

func (*FeatureFlagClient) List

List pages feature flags

func (*FeatureFlagClient) ListAll

ListAll retrieves all feature flags

func (*FeatureFlagClient) Update

Update the specified attributes of the feature flag

type FeatureFlagListOptions

type FeatureFlagListOptions struct {
	*ListOptions
}

FeatureFlagListOptions list filters

func NewFeatureFlagListOptions

func NewFeatureFlagListOptions() *FeatureFlagListOptions

NewFeatureFlagListOptions creates new options to pass to list

func (FeatureFlagListOptions) ToQueryString

func (o FeatureFlagListOptions) ToQueryString() (url.Values, error)

type Filter

type Filter struct {
	Values []string
}

func (*Filter) EqualTo

func (f *Filter) EqualTo(v ...string)

func (Filter) Serialize

func (f Filter) Serialize(values url.Values, tag string) error

type FilterModifier

type FilterModifier int
const (
	FilterModifierNone FilterModifier = iota
	FilterModifierGreaterThan
	FilterModifierLessThan
	FilterModifierGreaterThanOrEqual
	FilterModifierLessThanOrEqual
)

func (FilterModifier) String

func (r FilterModifier) String() string

type IsolationSegmentClient

type IsolationSegmentClient commonClient

func (*IsolationSegmentClient) Create

Create a new isolation segment

func (*IsolationSegmentClient) Delete

func (c *IsolationSegmentClient) Delete(ctx context.Context, guid string) error

Delete the specified isolation segments

An isolation segment cannot be deleted if it is entitled to any organization.

func (*IsolationSegmentClient) EntitleOrganization

func (c *IsolationSegmentClient) EntitleOrganization(ctx context.Context, guid string, organizationGUID string) (*resource.IsolationSegmentRelationship, error)

EntitleOrganization entitles the specified organization for the isolation segment.

In the case where the specified isolation segment is the system-wide shared segment, and if an organization is not already entitled for any other isolation segment, then the shared isolation segment automatically gets assigned as the default for that organization.

func (*IsolationSegmentClient) EntitleOrganizations

func (c *IsolationSegmentClient) EntitleOrganizations(ctx context.Context, guid string, organizationGUIDs []string) (*resource.IsolationSegmentRelationship, error)

EntitleOrganizations entitles the specified organizations for the isolation segment.

In the case where the specified isolation segment is the system-wide shared segment, and if an organization is not already entitled for any other isolation segment, then the shared isolation segment automatically gets assigned as the default for that organization.

func (*IsolationSegmentClient) First

First returns the first isolation segment matching the options or an error when less than 1 match

func (*IsolationSegmentClient) Get

Get the specified isolation segment

func (*IsolationSegmentClient) List

List all isolation segments the user has access to in paged results

For admin, this is all the isolation segments in the system. For anyone else, this is the isolation segments in the allowed list for any organization to which the user belongs.

func (*IsolationSegmentClient) ListAll

ListAll retrieves all isolation segments the user has access to

For admin, this is all the isolation segments in the system. For anyone else, this is the isolation segments in the allowed list for any organization to which the user belongs.

func (*IsolationSegmentClient) ListOrganizationRelationships

func (c *IsolationSegmentClient) ListOrganizationRelationships(ctx context.Context, guid string) ([]string, error)

ListOrganizationRelationships lists the organizations entitled for the isolation segment.

For an Admin, this will list all entitled organizations in the system. For any other user, this will list only the entitled organizations to which the user belongs.

func (*IsolationSegmentClient) ListSpaceRelationships

func (c *IsolationSegmentClient) ListSpaceRelationships(ctx context.Context, guid string) ([]string, error)

ListSpaceRelationships lists the spaces to which the isolation segment is assigned.

For an Admin, this will list all associated spaces in the system. For an organization manager, this will list only those associated spaces belonging to orgs for which the user is a manager. For any other user, this will list only those associated spaces to which the user has access.

func (*IsolationSegmentClient) RevokeOrganization

func (c *IsolationSegmentClient) RevokeOrganization(ctx context.Context, guid string, organizationGUID string) error

RevokeOrganization revokes the entitlement for the specified organization to the isolation segment

If the isolation segment is assigned to a space within an organization, the entitlement cannot be revoked. If the isolation segment is the organization’s default, the entitlement cannot be revoked.

func (*IsolationSegmentClient) RevokeOrganizations

func (c *IsolationSegmentClient) RevokeOrganizations(ctx context.Context, guid string, organizationGUIDs []string) error

RevokeOrganizations revokes the entitlement for all the specified organizations to the isolation segment

If the isolation segment is assigned to a space within an organization, the entitlement cannot be revoked. If the isolation segment is the organization’s default, the entitlement cannot be revoked.

func (*IsolationSegmentClient) Single

Single returns a single iso segment matching the options or an error if not exactly 1 match

func (*IsolationSegmentClient) Update

Update the specified attributes of the isolation segments

type IsolationSegmentListOptions

type IsolationSegmentListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
}

IsolationSegmentListOptions list filters

func NewIsolationSegmentOptions

func NewIsolationSegmentOptions() *IsolationSegmentListOptions

NewIsolationSegmentOptions creates new options to pass to list

func (IsolationSegmentListOptions) ToQueryString

func (o IsolationSegmentListOptions) ToQueryString() (url.Values, error)

type JobClient

type JobClient commonClient

func (*JobClient) Get

func (c *JobClient) Get(ctx context.Context, guid string) (*resource.Job, error)

Get the specified job

func (*JobClient) PollComplete

func (c *JobClient) PollComplete(ctx context.Context, jobGUID string, opts *PollingOptions) error

PollComplete waits until the job completes, fails, or times out

type LabelSelector

type LabelSelector map[string]ExclusionFilter

func (LabelSelector) EqualTo

func (l LabelSelector) EqualTo(key string, values ...string)

func (LabelSelector) Existence

func (l LabelSelector) Existence(key string)

func (LabelSelector) NotEqualTo

func (l LabelSelector) NotEqualTo(key string, values ...string)

func (LabelSelector) NotExistence

func (l LabelSelector) NotExistence(key string)

func (LabelSelector) Serialize

func (l LabelSelector) Serialize(values url.Values, tag string) error

type ListFunc

type ListFunc[T ListOptioner, R any] func(opts T) ([]R, *Pager, error)

type ListOptioner

type ListOptioner interface {
	CurrentPage(page, perPage int)
	ToQueryString() (url.Values, error)
}

type ListOptions

type ListOptions struct {
	Page       int             `qs:"page"`
	PerPage    int             `qs:"per_page"`
	OrderBy    string          `qs:"order_by"`
	LabelSel   LabelSelector   `qs:"label_selector"`
	CreateAts  TimestampFilter `qs:"created_ats"`
	UpdatedAts TimestampFilter `qs:"updated_ats"`
}

ListOptions is the shared common type for all other list option types

func NewListOptions

func NewListOptions() *ListOptions

NewListOptions creates a default list options with page and page size set

func (*ListOptions) CurrentPage

func (lo *ListOptions) CurrentPage(page, perPage int)

func (ListOptions) Serialize

func (lo ListOptions) Serialize(values url.Values, _ string) error

func (*ListOptions) ToQueryString

func (lo *ListOptions) ToQueryString(subOptionsPtr any) (url.Values, error)

type ListOptionsSerializer

type ListOptionsSerializer interface {
	Serialize(values url.Values, tag string) error
}

type ManifestClient

type ManifestClient commonClient

func (*ManifestClient) ApplyManifest

func (c *ManifestClient) ApplyManifest(ctx context.Context, spaceGUID string, manifest string) (string, error)

ApplyManifest applies the changes specified in a manifest to the named apps and their underlying processes asynchronously and returns a jobGUID.

The apps must reside in the space. These changes are additive and will not modify any unspecified properties or remove any existing environment variables, routes, or services.

func (*ManifestClient) Generate

func (c *ManifestClient) Generate(ctx context.Context, appGUID string) (string, error)

Generate the specified app manifest as a yaml text string

type OrganizationClient

type OrganizationClient commonClient

func (*OrganizationClient) AssignDefaultIsolationSegment

func (c *OrganizationClient) AssignDefaultIsolationSegment(ctx context.Context, guid, isolationSegmentGUID string) error

AssignDefaultIsolationSegment assigns a default iso segment to the specified organization

Apps will not run in the new default isolation segment until they are restarted An empty isolationSegmentGUID will un-assign the default isolation segment

func (*OrganizationClient) Create

Create an organization

func (*OrganizationClient) Delete

func (c *OrganizationClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified organization asynchronously and return a jobGUID

func (*OrganizationClient) First

First returns the first organization matching the options or an error when less than 1 match

func (*OrganizationClient) FirstForIsolationSegment

func (c *OrganizationClient) FirstForIsolationSegment(ctx context.Context, isolationSegmentGUID string, opts *OrganizationListOptions) (*resource.Organization, error)

FirstForIsolationSegment returns the first organization matching the options and iso segment or an error when less than 1 match

func (*OrganizationClient) Get

Get the specified organization

func (*OrganizationClient) GetDefaultDomain

func (c *OrganizationClient) GetDefaultDomain(ctx context.Context, guid string) (*resource.Domain, error)

GetDefaultDomain gets the specified organization's default domain if any

func (*OrganizationClient) GetDefaultIsolationSegment

func (c *OrganizationClient) GetDefaultIsolationSegment(ctx context.Context, guid string) (string, error)

GetDefaultIsolationSegment gets the specified organization's default iso segment GUID if any

func (*OrganizationClient) GetUsageSummary

GetUsageSummary gets the specified organization's usage summary

func (*OrganizationClient) List

List pages all organizations the user has access to

func (*OrganizationClient) ListAll

ListAll retrieves all organizations the user has access to

func (*OrganizationClient) ListForIsolationSegment

func (c *OrganizationClient) ListForIsolationSegment(ctx context.Context, isolationSegmentGUID string, opts *OrganizationListOptions) ([]*resource.Organization, *Pager, error)

ListForIsolationSegment pages all organizations for the specified isolation segment

func (*OrganizationClient) ListForIsolationSegmentAll

func (c *OrganizationClient) ListForIsolationSegmentAll(ctx context.Context, isolationSegmentGUID string, opts *OrganizationListOptions) ([]*resource.Organization, error)

ListForIsolationSegmentAll retrieves all organizations for the specified isolation segment

func (*OrganizationClient) ListUsers

func (c *OrganizationClient) ListUsers(ctx context.Context, guid string, opts *UserListOptions) ([]*resource.User, *Pager, error)

ListUsers pages of all users that are members of the specified organization

func (*OrganizationClient) ListUsersAll

func (c *OrganizationClient) ListUsersAll(ctx context.Context, guid string, opts *UserListOptions) ([]*resource.User, error)

ListUsersAll retrieves all users that are members of the specified organization

func (*OrganizationClient) Single

Single returns a single organization matching the options or an error if not exactly 1 match

func (*OrganizationClient) SingleForIsolationSegment

func (c *OrganizationClient) SingleForIsolationSegment(ctx context.Context, isolationSegmentGUID string, opts *OrganizationListOptions) (*resource.Organization, error)

SingleForIsolationSegment returns a single organization matching the options and iso segment or an error if not exactly 1 match

func (*OrganizationClient) Update

Update the organization's specified attributes

type OrganizationListOptions

type OrganizationListOptions struct {
	*ListOptions

	GUIDs Filter `qs:"guids"` // list of organization guids to filter by
	Names Filter `qs:"names"` // list of organization names to filter by
}

func NewOrganizationListOptions

func NewOrganizationListOptions() *OrganizationListOptions

NewOrganizationListOptions creates new options to pass to list

func (OrganizationListOptions) ToQueryString

func (o OrganizationListOptions) ToQueryString() (url.Values, error)

type OrganizationQuotaClient

type OrganizationQuotaClient commonClient

func (*OrganizationQuotaClient) Apply

func (c *OrganizationQuotaClient) Apply(ctx context.Context, guid string, organizationGUIDs []string) ([]string, error)

Apply the specified organization quota to the organizations

func (*OrganizationQuotaClient) Create

Create a new organization quota

func (*OrganizationQuotaClient) Delete

func (c *OrganizationQuotaClient) Delete(ctx context.Context, guid string) error

Delete the specified organization quota

func (*OrganizationQuotaClient) First

First returns the first organization quota matching the options or an error when less than 1 match

func (*OrganizationQuotaClient) Get

Get the specified organization quota

func (*OrganizationQuotaClient) List

List pages all organization quotas the user has access to

func (*OrganizationQuotaClient) ListAll

ListAll retrieves all organization quotas the user has access to

func (*OrganizationQuotaClient) Single

Single returns a single organization quota matching the options or an error if not exactly 1 match

func (*OrganizationQuotaClient) Update

Update the specified attributes of the organization quota

type OrganizationQuotaListOptions

type OrganizationQuotaListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
}

OrganizationQuotaListOptions list filters

func NewOrganizationQuotaListOptions

func NewOrganizationQuotaListOptions() *OrganizationQuotaListOptions

NewOrganizationQuotaListOptions creates new options to pass to list

func (OrganizationQuotaListOptions) ToQueryString

func (o OrganizationQuotaListOptions) ToQueryString() (url.Values, error)

type PackageClient

type PackageClient commonClient

func (*PackageClient) Copy

func (c *PackageClient) Copy(ctx context.Context, srcPackageGUID string, destAppGUID string) (*resource.Package, error)

Copy the bits of a source package to a target package

func (*PackageClient) Create

Create a new package

func (*PackageClient) Delete

func (c *PackageClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified package asynchronously and return a jobGUID

func (*PackageClient) Download

func (c *PackageClient) Download(ctx context.Context, guid string) (io.ReadCloser, error)

Download the bits of an existing package It is the caller's responsibility to close the io.ReadCloser

func (*PackageClient) First

First returns the first package matching the options or an error when less than 1 match

func (*PackageClient) FirstForApp

func (c *PackageClient) FirstForApp(ctx context.Context, appGUID string, opts *PackageListOptions) (*resource.Package, error)

FirstForApp returns the first package matching the options and app or an error when less than 1 match

func (*PackageClient) Get

func (c *PackageClient) Get(ctx context.Context, guid string) (*resource.Package, error)

Get the specified build

func (*PackageClient) List

List pages all the packages the user has access to

func (*PackageClient) ListAll

func (c *PackageClient) ListAll(ctx context.Context, opts *PackageListOptions) ([]*resource.Package, error)

ListAll retrieves all the packages the user has access to

func (*PackageClient) ListForApp

func (c *PackageClient) ListForApp(ctx context.Context, appGUID string, opts *PackageListOptions) ([]*resource.Package, *Pager, error)

ListForApp pages all the packages the user has access to

func (*PackageClient) ListForAppAll

func (c *PackageClient) ListForAppAll(ctx context.Context, appGUID string, opts *PackageListOptions) ([]*resource.Package, error)

ListForAppAll retrieves all the packages the user has access to

func (*PackageClient) PollReady

func (c *PackageClient) PollReady(ctx context.Context, guid string, opts *PollingOptions) error

PollReady waits until the package is ready, fails, or times out

func (*PackageClient) Single

Single returns a single package matching the options or an error if not exactly 1 match

func (*PackageClient) SingleForApp

func (c *PackageClient) SingleForApp(ctx context.Context, appGUID string, opts *PackageListOptions) (*resource.Package, error)

SingleForApp returns a single package matching the options for the app or an error if not exactly 1 match

func (*PackageClient) Update

Update the specified attributes of the package

func (*PackageClient) Upload

func (c *PackageClient) Upload(ctx context.Context, guid string, zipFile io.Reader) (*resource.Package, error)

Upload an app's zip file contents

type PackageListOptions

type PackageListOptions struct {
	*ListOptions

	GUIDs  Filter `qs:"guids"`  // list of package guids to filter by
	States Filter `qs:"states"` // list of package states to filter by
	Types  Filter `qs:"types"`  // list of package types to filter by, docker or bits
}

PackageListOptions list filters

func NewPackageListOptions

func NewPackageListOptions() *PackageListOptions

NewPackageListOptions creates new options to pass to list

func (PackageListOptions) ToQueryString

func (o PackageListOptions) ToQueryString() (url.Values, error)

type Pager

type Pager struct {
	NextPageReader     *path.QuerystringReader
	PreviousPageReader *path.QuerystringReader

	TotalResults int
	TotalPages   int
}

func NewPager

func NewPager(pagination resource.Pagination) *Pager

func (*Pager) HasNextPage

func (p *Pager) HasNextPage() bool

func (*Pager) HasPreviousPage

func (p *Pager) HasPreviousPage() bool

func (*Pager) NextPage

func (p *Pager) NextPage(opts ListOptioner)

func (*Pager) PreviousPage

func (p *Pager) PreviousPage(opts ListOptioner)

type PollingOptions

type PollingOptions struct {
	Timeout       time.Duration
	CheckInterval time.Duration
	FailedState   string
}

func NewPollingOptions

func NewPollingOptions() *PollingOptions

type ProcessClient

type ProcessClient commonClient

func (*ProcessClient) First

First returns the first process matching the options or an error when less than 1 match

func (*ProcessClient) FirstForApp

func (c *ProcessClient) FirstForApp(ctx context.Context, appGUID string, opts *ProcessListOptions) (*resource.Process, error)

FirstForApp returns the first process matching the options and app or an error when less than 1 match

func (*ProcessClient) Get

func (c *ProcessClient) Get(ctx context.Context, guid string) (*resource.Process, error)

Get the specified process

func (*ProcessClient) GetStats

func (c *ProcessClient) GetStats(ctx context.Context, guid string) (*resource.ProcessStats, error)

GetStats for the specified process

func (*ProcessClient) GetStatsForApp

func (c *ProcessClient) GetStatsForApp(ctx context.Context, appGUID, processType string) (*resource.ProcessStats, error)

GetStatsForApp for the specified app

func (*ProcessClient) List

List pages all processes

func (*ProcessClient) ListAll

func (c *ProcessClient) ListAll(ctx context.Context, opts *ProcessListOptions) ([]*resource.Process, error)

ListAll retrieves all processes

func (*ProcessClient) ListForApp

func (c *ProcessClient) ListForApp(ctx context.Context, appGUID string, opts *ProcessListOptions) ([]*resource.Process, *Pager, error)

ListForApp pages all processes for the specified app

func (*ProcessClient) ListForAppAll

func (c *ProcessClient) ListForAppAll(ctx context.Context, appGUID string, opts *ProcessListOptions) ([]*resource.Process, error)

ListForAppAll retrieves all processes for the specified app

func (*ProcessClient) Scale

func (c *ProcessClient) Scale(ctx context.Context, guid string, scale *resource.ProcessScale) (*resource.Process, error)

Scale the process using the specified scaling requirements

func (*ProcessClient) Single

Single returns a single package matching the options or an error if not exactly 1 match

func (*ProcessClient) SingleForApp

func (c *ProcessClient) SingleForApp(ctx context.Context, appGUID string, opts *ProcessListOptions) (*resource.Process, error)

SingleForApp returns a single package matching the options for the app or an error if not exactly 1 match

func (*ProcessClient) Terminate

func (c *ProcessClient) Terminate(ctx context.Context, guid string, index int) error

Terminate an instance of a specific process. Health management will eventually restart the instance.

func (*ProcessClient) Update

Update the specified attributes of the process

type ProcessListOptions

type ProcessListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Types             Filter `qs:"types"`
	Names             Filter `qs:"names"`
	AppGUIDs          Filter `qs:"app_guids"`
	SpaceGUIDs        Filter `qs:"space_guids"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
}

ProcessListOptions list filters

func NewProcessOptions

func NewProcessOptions() *ProcessListOptions

NewProcessOptions creates new options to pass to list

func (ProcessListOptions) ToQueryString

func (o ProcessListOptions) ToQueryString() (url.Values, error)

type ResourceMatchClient

type ResourceMatchClient commonClient

func (*ResourceMatchClient) Create

Create a list of cached resources from the input list

type RevisionClient

type RevisionClient commonClient

func (*RevisionClient) FirstForApp

func (c *RevisionClient) FirstForApp(ctx context.Context, appGUID string, opts *RevisionListOptions) (*resource.Revision, error)

FirstForApp returns the first revision matching the options and app or an error when less than 1 match

func (*RevisionClient) Get

func (c *RevisionClient) Get(ctx context.Context, guid string) (*resource.Revision, error)

Get the specified revision

func (*RevisionClient) GetEnvironmentVariables

func (c *RevisionClient) GetEnvironmentVariables(ctx context.Context, guid string) (map[string]*string, error)

GetEnvironmentVariables retrieves the specified revision's environment variables

func (*RevisionClient) ListForApp

func (c *RevisionClient) ListForApp(ctx context.Context, appGUID string, opts *RevisionListOptions) ([]*resource.Revision, *Pager, error)

ListForApp pages revisions that are associated with the specified app

func (*RevisionClient) ListForAppAll

func (c *RevisionClient) ListForAppAll(ctx context.Context, appGUID string, opts *RevisionListOptions) ([]*resource.Revision, error)

ListForAppAll retrieves all revisions that are associated with the specified app

func (*RevisionClient) ListForAppDeployed

func (c *RevisionClient) ListForAppDeployed(ctx context.Context, appGUID string, opts *RevisionListOptions) ([]*resource.Revision, *Pager, error)

ListForAppDeployed pages deployed revisions that are associated with the specified app

func (*RevisionClient) ListForAppDeployedAll

func (c *RevisionClient) ListForAppDeployedAll(ctx context.Context, appGUID string, opts *RevisionListOptions) ([]*resource.Revision, error)

ListForAppDeployedAll pages deployed revisions that are associated with the specified app

func (*RevisionClient) SingleForApp

func (c *RevisionClient) SingleForApp(ctx context.Context, appGUID string, opts *RevisionListOptions) (*resource.Revision, error)

SingleForApp returns a single revision matching the options and app or an error if not exactly 1 match

func (*RevisionClient) SingleForAppDeployed

func (c *RevisionClient) SingleForAppDeployed(ctx context.Context, appGUID string, opts *RevisionListOptions) (*resource.Revision, error)

SingleForAppDeployed returns a single deployed revision matching the options and app or an error if not exactly 1 match

func (*RevisionClient) Update

Update the specified attributes of the deployment

type RevisionListOptions

type RevisionListOptions struct {
	*ListOptions

	Versions Filter `qs:"versions"`
}

RevisionListOptions list filters

func NewRevisionListOptions

func NewRevisionListOptions() *RevisionListOptions

NewRevisionListOptions creates new options to pass to list

func (RevisionListOptions) ToQueryString

func (o RevisionListOptions) ToQueryString() (url.Values, error)

type RoleClient

type RoleClient commonClient

func (*RoleClient) CreateOrganizationRole

func (c *RoleClient) CreateOrganizationRole(ctx context.Context, organizationGUID, userGUID string, roleType resource.OrganizationRoleType) (*resource.Role, error)

CreateOrganizationRole creates a new role for a user in the organization

To create an organization role you must be an admin or organization manager in the organization associated with the role.

func (*RoleClient) CreateSpaceRole

func (c *RoleClient) CreateSpaceRole(ctx context.Context, spaceGUID, userGUID string, roleType resource.SpaceRoleType) (*resource.Role, error)

CreateSpaceRole creates a new role for a user in the space

To create a space role you must be an admin, an organization manager in the parent organization of the space associated with the role, or a space manager in the space associated with the role.

For a user to be assigned a space role, the user must already have an organization role in the parent organization.

func (*RoleClient) Delete

func (c *RoleClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified role asynchronously and return a jobGUID

func (*RoleClient) First

func (c *RoleClient) First(ctx context.Context, opts *RoleListOptions) (*resource.Role, error)

First returns the first role matching the options or an error when less than 1 match

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, guid string) (*resource.Role, error)

Get the specified role

func (*RoleClient) GetIncludeOrganizations

func (c *RoleClient) GetIncludeOrganizations(ctx context.Context, guid string) (*resource.Role, []*resource.Organization, error)

GetIncludeOrganizations allows callers to fetch a role and include any assigned organizations

func (*RoleClient) GetIncludeSpaces

func (c *RoleClient) GetIncludeSpaces(ctx context.Context, guid string) (*resource.Role, []*resource.Space, error)

GetIncludeSpaces allows callers to fetch a role and include any assigned spaces

func (*RoleClient) GetIncludeUsers

func (c *RoleClient) GetIncludeUsers(ctx context.Context, guid string) (*resource.Role, []*resource.User, error)

GetIncludeUsers allows callers to fetch a role and include any assigned users

func (*RoleClient) List

func (c *RoleClient) List(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, *Pager, error)

List all roles the user has access to in paged results

func (*RoleClient) ListAll

func (c *RoleClient) ListAll(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, error)

ListAll retrieves all roles the user has access to

func (*RoleClient) ListIncludeOrganizations

func (c *RoleClient) ListIncludeOrganizations(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.Organization, *Pager, error)

ListIncludeOrganizations pages all roles and specified and includes organizations that have the roles

func (*RoleClient) ListIncludeOrganizationsAll

func (c *RoleClient) ListIncludeOrganizationsAll(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.Organization, error)

ListIncludeOrganizationsAll retrieves all roles and specified and includes organizations that have the roles

func (*RoleClient) ListIncludeSpaces

func (c *RoleClient) ListIncludeSpaces(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.Space, *Pager, error)

ListIncludeSpaces pages all roles and specified and includes spaces that have the roles

func (*RoleClient) ListIncludeSpacesAll

func (c *RoleClient) ListIncludeSpacesAll(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.Space, error)

ListIncludeSpacesAll retrieves all roles and specified and includes spaces that have the roles

func (*RoleClient) ListIncludeUsers

func (c *RoleClient) ListIncludeUsers(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.User, *Pager, error)

ListIncludeUsers pages all roles and specified and includes users that belong to the roles

func (*RoleClient) ListIncludeUsersAll

func (c *RoleClient) ListIncludeUsersAll(ctx context.Context, opts *RoleListOptions) ([]*resource.Role, []*resource.User, error)

ListIncludeUsersAll retrieves all roles and all the users that belong to those roles

func (*RoleClient) Single

func (c *RoleClient) Single(ctx context.Context, opts *RoleListOptions) (*resource.Role, error)

Single returns a single role matching the options or an error if not exactly 1 match

type RoleListOptions

type RoleListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`              // list of role guids to filter by
	Types             Filter `qs:"types"`              // list of role types to filter by
	OrganizationGUIDs Filter `qs:"organization_guids"` // list of organization guids to filter by
	SpaceGUIDs        Filter `qs:"space_guids"`        // list of space guids to filter by
	UserGUIDs         Filter `qs:"user_guids"`         // list of user guids to filter by

	Include resource.RoleIncludeType `qs:"include"`
}

RoleListOptions list filters

func NewRoleListOptions

func NewRoleListOptions() *RoleListOptions

NewRoleListOptions creates new options to pass to list

func (*RoleListOptions) ToQueryString

func (o *RoleListOptions) ToQueryString() (url.Values, error)

func (*RoleListOptions) WithOrganizationRoleType

func (o *RoleListOptions) WithOrganizationRoleType(roleType ...resource.OrganizationRoleType)

WithOrganizationRoleType returns only roles with the specified organization roles type

func (*RoleListOptions) WithSpaceRoleType

func (o *RoleListOptions) WithSpaceRoleType(roleType ...resource.SpaceRoleType)

WithSpaceRoleType returns only roles with the specified space roles type

type RootClient

type RootClient struct {
	// contains filtered or unexported fields
}

RootClient queries the global API root /

func NewRootClient

func NewRootClient(httpExecutor *http.Executor) *RootClient

NewRootClient creates an initialized root client

func (*RootClient) Get

func (c *RootClient) Get(ctx context.Context) (*resource.Root, error)

Get queries the global API root /

These endpoints link to other resources, endpoints, and external services that are relevant to authenticated API clients.

type RouteClient

type RouteClient commonClient

func (*RouteClient) Create

Create a new route

func (*RouteClient) Delete

func (c *RouteClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified route asynchronously and return a jobGUID

func (*RouteClient) DeleteUnmappedRoutesForSpace

func (c *RouteClient) DeleteUnmappedRoutesForSpace(ctx context.Context, spaceGUID string) (string, error)

DeleteUnmappedRoutesForSpace deletes all routes in a space that are not mapped to any applications and not bound to any service instances and returns the async JobGUID

func (*RouteClient) First

func (c *RouteClient) First(ctx context.Context, opts *RouteListOptions) (*resource.Route, error)

First returns the first route matching the options or an error when less than 1 match

func (*RouteClient) FirstForApp

func (c *RouteClient) FirstForApp(ctx context.Context, appGUID string, opts *RouteListOptions) (*resource.Route, error)

FirstForApp returns the first route matching the options and app or an error when less than 1 match

func (*RouteClient) Get

func (c *RouteClient) Get(ctx context.Context, guid string) (*resource.Route, error)

Get the specified route

func (*RouteClient) GetDestinations

func (c *RouteClient) GetDestinations(ctx context.Context, guid string) (*resource.RouteDestinations, error)

GetDestinations retrieves all destinations associated with a route

func (*RouteClient) GetIncludeDomain

func (c *RouteClient) GetIncludeDomain(ctx context.Context, guid string) (*resource.Route, *resource.Domain, error)

GetIncludeDomain allows callers to fetch a route and include the parent domain

func (*RouteClient) GetIncludeSpace

func (c *RouteClient) GetIncludeSpace(ctx context.Context, guid string) (*resource.Route, *resource.Space, error)

GetIncludeSpace allows callers to fetch a route and include the parent space

func (*RouteClient) GetIncludeSpaceAndOrganization

func (c *RouteClient) GetIncludeSpaceAndOrganization(ctx context.Context, guid string) (*resource.Route, *resource.Space, *resource.Organization, error)

GetIncludeSpaceAndOrganization allows callers to fetch a route and include the parent space and organization

func (*RouteClient) GetSharedSpacesRelationships

func (c *RouteClient) GetSharedSpacesRelationships(ctx context.Context, guid string) (*resource.RouteSharedSpaceRelationships, error)

GetSharedSpacesRelationships retrieves the spaces that the route has been shared to

func (*RouteClient) InsertDestinations

InsertDestinations add one or more destinations to a route, preserving any existing destinations

Note that weighted destinations cannot be added with this endpoint. To add weighted destinations, replace all destinations for a route at once using the replace destinations endpoint.

func (*RouteClient) IsRouteReserved

func (c *RouteClient) IsRouteReserved(ctx context.Context, domainGUID string, opts *RouteReservationListOptions) (bool, error)

IsRouteReserved checks if a specific route for a domain exists, regardless of the user’s visibility for the route in case the route belongs to a space the user does not belong to

func (*RouteClient) List

func (c *RouteClient) List(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, *Pager, error)

List pages routes the user has access to

func (*RouteClient) ListAll

func (c *RouteClient) ListAll(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, error)

ListAll retrieves all routes the user has access to

func (*RouteClient) ListForApp

func (c *RouteClient) ListForApp(ctx context.Context, appGUID string, opts *RouteListOptions) ([]*resource.Route, *Pager, error)

ListForApp pages routes for the specified app the user has access to

func (*RouteClient) ListForAppAll

func (c *RouteClient) ListForAppAll(ctx context.Context, appGUID string, opts *RouteListOptions) ([]*resource.Route, error)

ListForAppAll retrieves all routes for the specified app the user has access to

func (*RouteClient) ListIncludeDomains

func (c *RouteClient) ListIncludeDomains(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Domain, *Pager, error)

ListIncludeDomains page all routes the user has access to and include the parent domains

func (*RouteClient) ListIncludeDomainsAll

func (c *RouteClient) ListIncludeDomainsAll(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Domain, error)

ListIncludeDomainsAll retrieves all routes the user has access to and includes the parent domains

func (*RouteClient) ListIncludeSpaces

func (c *RouteClient) ListIncludeSpaces(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Space, *Pager, error)

ListIncludeSpaces page all routes the user has access to and include the parent spaces

func (*RouteClient) ListIncludeSpacesAll

func (c *RouteClient) ListIncludeSpacesAll(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Space, error)

ListIncludeSpacesAll retrieves all routes the user has access to and includes the parent spaces

func (*RouteClient) ListIncludeSpacesAndOrganizations

func (c *RouteClient) ListIncludeSpacesAndOrganizations(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Space, []*resource.Organization, *Pager, error)

ListIncludeSpacesAndOrganizations page all routes the user has access to and include the parent spaces and organizations

func (*RouteClient) ListIncludeSpacesAndOrganizationsAll

func (c *RouteClient) ListIncludeSpacesAndOrganizationsAll(ctx context.Context, opts *RouteListOptions) ([]*resource.Route, []*resource.Space, []*resource.Organization, error)

ListIncludeSpacesAndOrganizationsAll retrieves all routes the user has access to and includes the parent spaces and organization

func (*RouteClient) RemoveDestination

func (c *RouteClient) RemoveDestination(ctx context.Context, guid, destinationGUID string) error

RemoveDestination removes a destination from a route

func (*RouteClient) ReplaceDestinations

ReplaceDestinations replaces all destinations for a route, removing any destinations not included in the provided list

If using weighted destinations, all destinations provided here must have a weight specified, and all weights for this route must sum to 100. If not, all provided destinations must not have a weight. Mixing weighted and unweighted destinations for a route is not allowed.

func (*RouteClient) ShareWithSpace

func (c *RouteClient) ShareWithSpace(ctx context.Context, guid string, spaceGUID string) (*resource.RouteSharedSpaceRelationships, error)

ShareWithSpace shares the route with the specified space

In order to share into a space the requesting user must be a space developer in the target space

func (*RouteClient) ShareWithSpaces

func (c *RouteClient) ShareWithSpaces(ctx context.Context, guid string, spaceGUIDs []string) (*resource.RouteSharedSpaceRelationships, error)

ShareWithSpaces shares the route with the specified spaces

In order to share into a space the requesting user must be a space developer in the target space

func (*RouteClient) Single

func (c *RouteClient) Single(ctx context.Context, opts *RouteListOptions) (*resource.Route, error)

Single returns a single route matching the options or an error if not exactly 1 match

func (*RouteClient) SingleForApp

func (c *RouteClient) SingleForApp(ctx context.Context, appGUID string, opts *RouteListOptions) (*resource.Route, error)

SingleForApp returns a single route matching the options and app or an error if not exactly 1 match

func (*RouteClient) TransferOwnership

func (c *RouteClient) TransferOwnership(ctx context.Context, guid string, spaceGUID string) error

TransferOwnership transfers the ownership of a route to another space

Users must have write access for both spaces to perform this action. The original owning space will still retain access to the route as a shared space. To completely remove a space from a route, users will have to un-share the route.

func (*RouteClient) UnShareWithSpace

func (c *RouteClient) UnShareWithSpace(ctx context.Context, guid string, spaceGUID string) error

UnShareWithSpace un-shares the route with the specified space

This will automatically unbind any applications bound to this route in the specified space Un-sharing a route from a space will not delete any service keys

func (*RouteClient) UnShareWithSpaces

func (c *RouteClient) UnShareWithSpaces(ctx context.Context, guid string, spaceGUIDs []string) error

UnShareWithSpaces un-shares the route with the specified spaces

This will automatically unbind any applications bound to this route in the specified space Un-sharing a route from a space will not delete any service keys

func (*RouteClient) Update

func (c *RouteClient) Update(ctx context.Context, guid string, r *resource.RouteUpdate) (*resource.Route, error)

Update the specified attributes of the app

func (*RouteClient) UpdateDestinationProtocol

func (c *RouteClient) UpdateDestinationProtocol(ctx context.Context, guid, destinationGUID, protocol string) (*resource.RouteDestinationWithLinks, error)

UpdateDestinationProtocol updates the protocol of a route destination (app, port and weight cannot be updated)

Protocol the destination will use. Valid protocols are http1 or http2 if route protocol is http, tcp if route protocol is tcp. An empty string will set it to either http1 or tcp based on the route protocol

type RouteListOptions

type RouteListOptions struct {
	*ListOptions

	AppGUIDs             Filter `qs:"app_guids"`
	SpaceGUIDs           Filter `qs:"space_guids"`
	DomainGUIDs          Filter `qs:"domain_guids"`
	OrganizationGUIDs    Filter `qs:"organization_guids"`
	ServiceInstanceGUIDs Filter `qs:"service_instance_guids"`

	Hosts Filter `qs:"hosts"`
	Paths Filter `qs:"paths"`
	Ports Filter `qs:"ports"`

	Include resource.RouteIncludeType `qs:"include"`
}

RouteListOptions list filters

func NewRouteListOptions

func NewRouteListOptions() *RouteListOptions

NewRouteListOptions creates new options to pass to list

func (RouteListOptions) ToQueryString

func (o RouteListOptions) ToQueryString() (url.Values, error)

type RouteReservationListOptions

type RouteReservationListOptions struct {
	*ListOptions

	Hosts string `qs:"host"`
	Paths string `qs:"path"`
	Ports int    `qs:"port"`
}

RouteReservationListOptions list filters

func NewRouteReservationListOptions

func NewRouteReservationListOptions() *RouteReservationListOptions

NewRouteReservationListOptions creates new options to pass to IsRouteReserved

func (RouteReservationListOptions) ToQueryString

func (o RouteReservationListOptions) ToQueryString() (url.Values, error)

type RouteTest

type RouteTest struct {
	Description string
	Route       testutil.MockRoute
	Expected    string
	Expected2   string
	Expected3   string
	Action      func(c *Client, t *testing.T) (any, error)
	Action2     func(c *Client, t *testing.T) (any, any, error)
	Action3     func(c *Client, t *testing.T) (any, any, any, error)
}

type SecurityGroupClient

type SecurityGroupClient commonClient

func (*SecurityGroupClient) BindRunningSecurityGroup

func (c *SecurityGroupClient) BindRunningSecurityGroup(ctx context.Context, guid string, spaceGUIDs []string) ([]string, error)

BindRunningSecurityGroup binds one or more spaces to a security group with the running lifecycle and returns the space GUIDs bound to the security group

Running app containers within these spaces will inherit the rules specified by this security group. Apps within these spaces must be restarted for these changes to take effect. Unless a security group is globally-enabled, an admin must add it to a space for it to be visible for the org and space managers. Once it’s visible, org and space managers can add it to additional spaces.

func (*SecurityGroupClient) BindStagingSecurityGroup

func (c *SecurityGroupClient) BindStagingSecurityGroup(ctx context.Context, guid string, spaceGUIDs []string) ([]string, error)

BindStagingSecurityGroup binds one or more spaces to a security group with the staging lifecycle and returns the space GUIDs bound to the security group

Staging app containers within these spaces will inherit the rules specified by this security group. Apps within these spaces must be restaged for these changes to take effect. Unless a security group is globally-enabled, an admin must add it to a space for it to be visible for the org and space managers. Once it’s visible, org and space managers can add it to additional spaces.

func (*SecurityGroupClient) Create

Create a new domain

func (*SecurityGroupClient) Delete

func (c *SecurityGroupClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified security group asynchronously and return a jobGUID

func (*SecurityGroupClient) First

First returns the first security group matching the options or an error when less than 1 match

func (*SecurityGroupClient) Get

Get the specified security group

func (*SecurityGroupClient) List

List pages SecurityGroups the user has access to

func (*SecurityGroupClient) ListAll

ListAll retrieves all SecurityGroups the user has access to

func (*SecurityGroupClient) ListRunningForSpace

func (c *SecurityGroupClient) ListRunningForSpace(ctx context.Context, spaceGUID string, opts *SecurityGroupSpaceListOptions) ([]*resource.SecurityGroup, *Pager, error)

ListRunningForSpace pages security groups that are enabled for running globally or at the space level for the given space

func (*SecurityGroupClient) ListRunningForSpaceAll

func (c *SecurityGroupClient) ListRunningForSpaceAll(ctx context.Context, spaceGUID string, opts *SecurityGroupSpaceListOptions) ([]*resource.SecurityGroup, error)

ListRunningForSpaceAll retrieves all security groups that are enabled for running globally or at the space level for the given space

func (*SecurityGroupClient) ListStagingForSpace

func (c *SecurityGroupClient) ListStagingForSpace(ctx context.Context, spaceGUID string, opts *SecurityGroupSpaceListOptions) ([]*resource.SecurityGroup, *Pager, error)

ListStagingForSpace pages security groups that are enabled for staging globally or at the space level for the given space

func (*SecurityGroupClient) ListStagingForSpaceAll

func (c *SecurityGroupClient) ListStagingForSpaceAll(ctx context.Context, spaceGUID string, opts *SecurityGroupSpaceListOptions) ([]*resource.SecurityGroup, error)

ListStagingForSpaceAll retrieves all security groups that are enabled for staging globally or at the space level for the given space

func (*SecurityGroupClient) Single

Single returns a single security group matching the options or an error if not exactly 1 match

func (*SecurityGroupClient) UnBindRunningSecurityGroup

func (c *SecurityGroupClient) UnBindRunningSecurityGroup(ctx context.Context, guid string, spaceGUID string) error

UnBindRunningSecurityGroup removes a space from a security group with the running lifecycle

Apps within this space must be restarted for these changes to take effect.

func (*SecurityGroupClient) UnBindStagingSecurityGroup

func (c *SecurityGroupClient) UnBindStagingSecurityGroup(ctx context.Context, guid string, spaceGUID string) error

UnBindStagingSecurityGroup removes a space from a security group with the staging lifecycle

Apps within this space must be restarted for these changes to take effect.

func (*SecurityGroupClient) Update

Update the specified attributes of the app

type SecurityGroupListOptions

type SecurityGroupListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`               // list of security group guids to filter by
	Names             Filter `qs:"names"`               // list of security group names to filter by
	RunningSpaceGUIDs Filter `qs:"running_space_guids"` // list of space guids to filter by
	StagingSpaceGUIDs Filter `qs:"staging_space_guids"` // list of space guids to filter by

	GloballyEnabledRunning *bool `qs:"globally_enabled_running"` // If true, only include the security groups that are enabled for running
	GloballyEnabledStaging *bool `qs:"globally_enabled_staging"` // If true, only include the security groups that are enabled for staging
}

SecurityGroupListOptions list filters

func NewSecurityGroupListOptions

func NewSecurityGroupListOptions() *SecurityGroupListOptions

NewSecurityGroupListOptions creates new options to pass to list

func (SecurityGroupListOptions) ToQueryString

func (o SecurityGroupListOptions) ToQueryString() (url.Values, error)

type SecurityGroupSpaceListOptions

type SecurityGroupSpaceListOptions struct {
	*ListOptions

	GUIDs Filter `qs:"guids"` // list of security group guids to filter by
	Names Filter `qs:"names"` // list of security group names to filter by
}

SecurityGroupSpaceListOptions list filters

func NewSecurityGroupSpaceListOptions

func NewSecurityGroupSpaceListOptions() *SecurityGroupSpaceListOptions

NewSecurityGroupSpaceListOptions creates new options to pass to list

func (SecurityGroupSpaceListOptions) ToQueryString

func (o SecurityGroupSpaceListOptions) ToQueryString() (url.Values, error)

type ServiceBrokerClient

type ServiceBrokerClient commonClient

func (*ServiceBrokerClient) Create

Create a new service broker asynchronously and return a jobGUID

func (*ServiceBrokerClient) Delete

func (c *ServiceBrokerClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified service broker asynchronously and return a jobGUID

func (*ServiceBrokerClient) First

First returns the first service broker matching the options or an error when less than 1 match

func (*ServiceBrokerClient) Get

Get the specified service broker

func (*ServiceBrokerClient) List

List pages all the service brokers the user has access to

func (*ServiceBrokerClient) ListAll

ListAll retrieves all service brokers the user has access to

func (*ServiceBrokerClient) Single

Single returns a single service broker matching the options or an error if not exactly 1 match

func (*ServiceBrokerClient) Update

Update the specified attributes of the service broker returning either a jobGUID or a service broker instance. Only metadata updates synchronously and return a service broker instance, all other updates return a jobGUID

type ServiceBrokerListOptions

type ServiceBrokerListOptions struct {
	*ListOptions

	SpaceGUIDs Filter `qs:"space_guids"`
	Names      Filter `qs:"names"`
}

ServiceBrokerListOptions list filters

func NewServiceBrokerListOptions

func NewServiceBrokerListOptions() *ServiceBrokerListOptions

NewServiceBrokerListOptions creates new options to pass to list

func (ServiceBrokerListOptions) ToQueryString

func (o ServiceBrokerListOptions) ToQueryString() (url.Values, error)

type ServiceCredentialBindingClient

type ServiceCredentialBindingClient commonClient

func (*ServiceCredentialBindingClient) Create

Create a new service credential binding

func (*ServiceCredentialBindingClient) Delete

Delete the specified service credential binding

func (*ServiceCredentialBindingClient) First

First returns the first service credential binding matching the options or an error when less than 1 match

func (*ServiceCredentialBindingClient) Get

Get the specified service credential binding

func (*ServiceCredentialBindingClient) GetDetails

GetDetails the specified service credential binding details

func (*ServiceCredentialBindingClient) GetIncludeApp

GetIncludeApp allows callers to fetch a service credential binding and include the associated app

func (*ServiceCredentialBindingClient) GetIncludeServiceInstance

GetIncludeServiceInstance allows callers to fetch a service credential binding and include the associated service instance

func (*ServiceCredentialBindingClient) GetParameters

func (c *ServiceCredentialBindingClient) GetParameters(ctx context.Context, guid string) (map[string]string, error)

GetParameters the specified service credential binding details

func (*ServiceCredentialBindingClient) List

List pages ServiceCredentialBindings the user has access to

func (*ServiceCredentialBindingClient) ListAll

ListAll retrieves all ServiceCredentialBindings the user has access to

func (*ServiceCredentialBindingClient) ListIncludeApps

ListIncludeApps pages all service credential bindings the user has access to and include the associated apps

func (*ServiceCredentialBindingClient) ListIncludeAppsAll

ListIncludeAppsAll retrieves all service credential bindings the user has access to and include the associated apps

func (*ServiceCredentialBindingClient) ListIncludeServiceInstances

ListIncludeServiceInstances pages all service credential bindings the user has access to and include the associated SIs

func (*ServiceCredentialBindingClient) ListIncludeServiceInstancesAll

ListIncludeServiceInstancesAll retrieves all service credential bindings the user has access to and include the associated SIs

func (*ServiceCredentialBindingClient) Single

Single returns a single service credential binding matching the options or an error if not exactly 1 match

func (*ServiceCredentialBindingClient) Update

Update the specified attributes of the app

type ServiceCredentialBindingListOptions

type ServiceCredentialBindingListOptions struct {
	*ListOptions

	Names                Filter `qs:"names"`                  // list of service credential binding names to filter by
	ServiceInstanceGUIDs Filter `qs:"service_instance_guids"` // list of SI guids to filter by
	ServiceInstanceNames Filter `qs:"service_instance_names"` // list of SI names to filter by
	AppGUIDs             Filter `qs:"app_guids"`              // list of app guids to filter by
	AppNames             Filter `qs:"app_names"`              // list of app names to filter by
	ServicePlanGUIDs     Filter `qs:"service_plan_guids"`     // list of service plan guids to filter by
	ServicePlanNames     Filter `qs:"service_plan_names"`     // list of service plan names to filter by
	ServiceOfferingGUIDs Filter `qs:"service_offering_guids"` // list of service offering guids to filter by
	ServiceOfferingNames Filter `qs:"service_offering_names"` // list of service offering names to filter by
	Type                 Filter `qs:"type"`                   // list of service credential binding types to filter by, app or key
	GUIDs                Filter `qs:"guids"`                  // list of service route binding guids to filter by

	Include resource.ServiceCredentialBindingIncludeType `qs:"include"`
}

ServiceCredentialBindingListOptions list filters

func NewServiceCredentialBindingListOptions

func NewServiceCredentialBindingListOptions() *ServiceCredentialBindingListOptions

NewServiceCredentialBindingListOptions creates new options to pass to list

func (ServiceCredentialBindingListOptions) ToQueryString

func (o ServiceCredentialBindingListOptions) ToQueryString() (url.Values, error)

type ServiceInstanceClient

type ServiceInstanceClient commonClient

func (*ServiceInstanceClient) CreateManaged

CreateManaged requests a new service instance asynchronously from a broker. The result of this call is an error or the jobGUID.

func (*ServiceInstanceClient) CreateUserProvided

CreateUserProvided creates a new user provided service instance. User provided service instances do not require interactions with service brokers.

func (*ServiceInstanceClient) Delete

func (c *ServiceInstanceClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified service instance returning the async deletion jobGUID

func (*ServiceInstanceClient) First

First returns the first service instance matching the options or an error when less than 1 match

func (*ServiceInstanceClient) Get

Get the specified service instance

func (*ServiceInstanceClient) GetManagedParameters

func (c *ServiceInstanceClient) GetManagedParameters(ctx context.Context, guid string) (*json.RawMessage, error)

GetManagedParameters queries the service broker for the parameters associated with this managed service instance

The broker catalog must have enabled the instances_retrievable feature for the Service Offering. Check the Service Offering object for the value of this feature flag.

func (*ServiceInstanceClient) GetSharedSpaceRelationships

GetSharedSpaceRelationships lists the spaces that the service instance has been shared to

func (*ServiceInstanceClient) GetSharedSpaceUsageSummary

func (c *ServiceInstanceClient) GetSharedSpaceUsageSummary(ctx context.Context, guid string) (*resource.ServiceInstanceUsageSummary, error)

GetSharedSpaceUsageSummary retrieves the number of bound apps in spaces where the service instance has been shared to

func (*ServiceInstanceClient) GetUserPermissions

GetUserPermissions retrieves the current user’s permissions for the given service instance

If a user can get a service instance then they can ‘read’ it. Users who can update a service instance can ‘manage’ it.

This endpoint’s primary purpose is to enable third-party service dashboards to determine the permissions of a given Cloud Foundry user that has authenticated with the dashboard via single sign-on (SSO). For more information, see the Cloud Foundry documentation on Dashboard Single Sign-On.

func (*ServiceInstanceClient) GetUserProvidedCredentials

func (c *ServiceInstanceClient) GetUserProvidedCredentials(ctx context.Context, guid string) (*json.RawMessage, error)

GetUserProvidedCredentials the specified user provided service instance credentials

func (*ServiceInstanceClient) List

List pages all service instances the user has access to

func (*ServiceInstanceClient) ListAll

ListAll retrieves all service instances the user has access to

func (*ServiceInstanceClient) ShareWithSpace

ShareWithSpace shares the service instance with the specified space

In order to share into a space the requesting user must be a space developer in the target space

func (*ServiceInstanceClient) ShareWithSpaces

ShareWithSpaces shares the service instance with the specified spaces

In order to share into a space the requesting user must be a space developer in the target space

func (*ServiceInstanceClient) Single

Single returns a single service instance matching the options or an error if not exactly 1 match

func (*ServiceInstanceClient) UnShareWithSpace

func (c *ServiceInstanceClient) UnShareWithSpace(ctx context.Context, guid string, spaceGUID string) error

UnShareWithSpace un=shares the service instance with the specified space

This will automatically unbind any applications bound to this service instance in the specified space Un-sharing a service instance from a space will not delete any service keys

func (*ServiceInstanceClient) UnShareWithSpaces

func (c *ServiceInstanceClient) UnShareWithSpaces(ctx context.Context, guid string, spaceGUIDs []string) error

UnShareWithSpaces un-shares the service instance with the specified spaces

This will automatically unbind any applications bound to this service instance in the specified space Un-sharing a service instance from a space will not delete any service keys

func (*ServiceInstanceClient) UpdateManaged

UpdateManaged updates the specified attributes of the managed service instance returning either a jobGUID or a service instance object

Only metadata, tags, and name (when allow_context_updates feature disabled) updates synchronously and return a service instance object, all other updates return a jobGUID

func (*ServiceInstanceClient) UpdateUserProvided

UpdateUserProvided updates the specified attributes of the user-provided service instance returning a service instance object

type ServiceInstanceListOptions

type ServiceInstanceListOptions struct {
	*ListOptions

	Names             Filter `qs:"names"` // list of service instance names to filter by
	GUIDs             Filter `qs:"guids"` // list of service instance guids to filter by
	Type              string `qs:"type"`  // Filter by type; valid values are managed and user-provided
	SpaceGUIDs        Filter `qs:"space_guids"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
	ServicePlanGUIDs  Filter `qs:"service_plan_guids"`
	ServicePlanNames  Filter `qs:"service_plan_names"`
}

ServiceInstanceListOptions list filters

func NewServiceInstanceListOptions

func NewServiceInstanceListOptions() *ServiceInstanceListOptions

NewServiceInstanceListOptions creates new options to pass to list

func (ServiceInstanceListOptions) ToQueryString

func (o ServiceInstanceListOptions) ToQueryString() (url.Values, error)

type ServiceOfferingClient

type ServiceOfferingClient commonClient

func (*ServiceOfferingClient) Delete

func (c *ServiceOfferingClient) Delete(ctx context.Context, guid string) error

Delete the specified service offering

func (*ServiceOfferingClient) First

First returns the first service offering matching the options or an error when less than 1 match

func (*ServiceOfferingClient) Get

Get the specified service offering

func (*ServiceOfferingClient) List

List pages service offerings the user has access to

func (*ServiceOfferingClient) ListAll

ListAll retrieves all service offerings the user has access to

func (*ServiceOfferingClient) Single

Single returns a single service offering matching the options or an error if not exactly 1 match

func (*ServiceOfferingClient) Update

Update the specified attributes of the service offering

type ServiceOfferingListOptions

type ServiceOfferingListOptions struct {
	*ListOptions

	Names              Filter `qs:"names"`
	ServiceBrokerGUIDs Filter `qs:"service_broker_guids"`
	ServiceBrokerNames Filter `qs:"service_broker_names"`
	SpaceGUIDs         Filter `qs:"space_guids"`
	OrganizationGUIDs  Filter `qs:"organization_guids"`
	Available          *bool  `qs:"available"`
}

ServiceOfferingListOptions list filters

func NewServiceOfferingListOptions

func NewServiceOfferingListOptions() *ServiceOfferingListOptions

NewServiceOfferingListOptions creates new options to pass to list

func (ServiceOfferingListOptions) ToQueryString

func (o ServiceOfferingListOptions) ToQueryString() (url.Values, error)

type ServicePlanClient

type ServicePlanClient commonClient

func (*ServicePlanClient) Delete

func (c *ServicePlanClient) Delete(ctx context.Context, guid string) error

Delete the specified service plan

func (*ServicePlanClient) First

First returns the first service plan matching the options or an error when less than 1 match

func (*ServicePlanClient) Get

Get the specified service plan

func (*ServicePlanClient) GetIncludeServicePlan

func (c *ServicePlanClient) GetIncludeServicePlan(ctx context.Context, guid string) (*resource.ServicePlan, *resource.ServiceOffering, error)

GetIncludeServicePlan allows callers to fetch a service plan and include the associated service offering

func (*ServicePlanClient) GetIncludeSpaceAndOrganization

func (c *ServicePlanClient) GetIncludeSpaceAndOrganization(ctx context.Context, guid string) (*resource.ServicePlan, *resource.Space, *resource.Organization, error)

GetIncludeSpaceAndOrganization allows callers to fetch a service plan and include the parent space and organization

func (*ServicePlanClient) List

List pages service plans the user has access to

func (*ServicePlanClient) ListAll

ListAll retrieves all service plans the user has access to

func (*ServicePlanClient) ListIncludeServiceOffering

func (c *ServicePlanClient) ListIncludeServiceOffering(ctx context.Context, opts *ServicePlanListOptions) ([]*resource.ServicePlan, []*resource.ServiceOffering, *Pager, error)

ListIncludeServiceOffering page all service plans the user has access to and include the associated service offerings

func (*ServicePlanClient) ListIncludeServiceOfferingAll

func (c *ServicePlanClient) ListIncludeServiceOfferingAll(ctx context.Context, opts *ServicePlanListOptions) ([]*resource.ServicePlan, []*resource.ServiceOffering, error)

ListIncludeServiceOfferingAll retrieves all service plans the user has access to and include the associated service offerings

func (*ServicePlanClient) ListIncludeSpacesAndOrganizations

func (c *ServicePlanClient) ListIncludeSpacesAndOrganizations(ctx context.Context, opts *ServicePlanListOptions) ([]*resource.ServicePlan, []*resource.Space, []*resource.Organization, *Pager, error)

ListIncludeSpacesAndOrganizations page all service plans the user has access to and include the associated spaces and organizations

func (*ServicePlanClient) ListIncludeSpacesAndOrganizationsAll

func (c *ServicePlanClient) ListIncludeSpacesAndOrganizationsAll(ctx context.Context, opts *ServicePlanListOptions) ([]*resource.ServicePlan, []*resource.Space, []*resource.Organization, error)

ListIncludeSpacesAndOrganizationsAll retrieves all service plans the user has access to and include the associated spaces and organizations

func (*ServicePlanClient) Single

Single returns a single service plan matching the options or an error if not exactly 1 match

func (*ServicePlanClient) Update

Update the specified attributes of the service plan

type ServicePlanListOptions

type ServicePlanListOptions struct {
	*ListOptions

	Names                Filter `qs:"names"`
	BrokerCatalogIDs     Filter `qs:"broker_catalog_ids"`
	SpaceGUIDs           Filter `qs:"space_guids"`
	OrganizationGUIDs    Filter `qs:"organization_guids"`
	ServiceBrokerGUIDs   Filter `qs:"service_broker_guids"`
	ServiceBrokerNames   Filter `qs:"service_broker_names"`
	ServiceOfferingGUIDs Filter `qs:"service_offering_guids"`
	ServiceOfferingNames Filter `qs:"service_offering_names"`
	ServiceInstanceGUIDs Filter `qs:"service_instance_guids"`
	Available            *bool  `qs:"available"`

	Include resource.ServicePlanIncludeType `qs:"include"`
}

ServicePlanListOptions list filters

func NewServicePlanListOptions

func NewServicePlanListOptions() *ServicePlanListOptions

NewServicePlanListOptions creates new options to pass to list

func (ServicePlanListOptions) ToQueryString

func (o ServicePlanListOptions) ToQueryString() (url.Values, error)

type ServicePlanVisibilityClient

type ServicePlanVisibilityClient commonClient

func (*ServicePlanVisibilityClient) Apply

Apply a service plan visibility. It behaves similar to the Update service plan visibility endpoint but this endpoint will append to the existing list of organizations when the service plan is organization visible

func (*ServicePlanVisibilityClient) Delete

func (c *ServicePlanVisibilityClient) Delete(ctx context.Context, servicePlanGUID, organizationGUID string) error

Delete an organization from a service plan visibility list of organizations It is only defined for service plans which are organization restricted

func (*ServicePlanVisibilityClient) Get

Get the specified service plan visibility

func (*ServicePlanVisibilityClient) Update

Update a service plan visibility. It behaves similar to Apply service plan visibility endpoint but this endpoint will replace the existing list of organizations when the service plan is organization visible

type ServiceRouteBindingClient

type ServiceRouteBindingClient commonClient

func (*ServiceRouteBindingClient) Create

Create a new service route binding returning the jobGUID for managed service instances or the service route binding object for user provided service instances

func (*ServiceRouteBindingClient) Delete

func (c *ServiceRouteBindingClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified service route binding returning the jobGUID for managed service instances or empty string for user provided service instances

func (*ServiceRouteBindingClient) First

First returns the first service route binding matching the options or an error when less than 1 match

func (*ServiceRouteBindingClient) Get

Get the specified service route binding

func (*ServiceRouteBindingClient) GetIncludeRoute

GetIncludeRoute allows callers to fetch a service route binding and include the associated route

func (*ServiceRouteBindingClient) GetIncludeServiceInstance

GetIncludeServiceInstance allows callers to fetch a service route binding and include the associated service instance

func (*ServiceRouteBindingClient) GetParameters

func (c *ServiceRouteBindingClient) GetParameters(ctx context.Context, guid string) (map[string]string, error)

GetParameters queries the Service Broker for the parameters associated with this service route binding

func (*ServiceRouteBindingClient) List

List pages all the service route bindings the user has access to

func (*ServiceRouteBindingClient) ListAll

ListAll retrieves all service route bindings the user has access to

func (*ServiceRouteBindingClient) ListIncludeRoutes

ListIncludeRoutes page all service route bindings the user has access to and include the associated routes

func (*ServiceRouteBindingClient) ListIncludeRoutesAll

ListIncludeRoutesAll retrieves all service route bindings the user has access to and include the associated routes

func (*ServiceRouteBindingClient) ListIncludeServiceInstances

ListIncludeServiceInstances page all service route bindings the user has access to and include the associated service instances

func (*ServiceRouteBindingClient) ListIncludeServiceInstancesAll

ListIncludeServiceInstancesAll retrieves all service route bindings the user has access to and include the associated service instances

func (*ServiceRouteBindingClient) Single

Single returns a single service route binding matching the options or an error if not exactly 1 match

func (*ServiceRouteBindingClient) Update

Update the specified attributes of the service route binding

type ServiceRouteBindingListOptions

type ServiceRouteBindingListOptions struct {
	*ListOptions

	GUIDs                Filter `qs:"guids"`
	RouteGUIDs           Filter `qs:"route_guids"`
	ServiceInstanceGUIDs Filter `qs:"service_instance_guids"`
	ServiceInstanceNames Filter `qs:"service_instance_names"`

	Include resource.ServiceRouteBindingIncludeType `qs:"include"`
}

ServiceRouteBindingListOptions list filters

func NewServiceRouteBindingListOptions

func NewServiceRouteBindingListOptions() *ServiceRouteBindingListOptions

NewServiceRouteBindingListOptions creates new options to pass to list

func (ServiceRouteBindingListOptions) ToQueryString

func (o ServiceRouteBindingListOptions) ToQueryString() (url.Values, error)

type ServiceUsageClient

type ServiceUsageClient commonClient

func (*ServiceUsageClient) First

First returns the first space matching the options or an error when less than 1 match

func (*ServiceUsageClient) Get

Get retrieves the specified service event

func (*ServiceUsageClient) List

List pages all service usage events

func (*ServiceUsageClient) ListAll

ListAll retrieves all service usage events

func (*ServiceUsageClient) Purge

func (c *ServiceUsageClient) Purge(ctx context.Context) error

Purge destroys all existing events. Populates new usage events, one for each existing service instance. All populated events will have a created_at value of current time.

There is the potential race condition if service instances are currently being created or deleted. The seeded usage events will have the same guid as the service instance.

func (*ServiceUsageClient) Single

Single returns a single service usage matching the options or an error if not exactly 1 match

type ServiceUsageListOptions

type ServiceUsageListOptions struct {
	*ListOptions

	AfterGUID            string `qs:"after_guid"`
	GUIDs                Filter `qs:"guids"`
	ServiceInstanceTypes Filter `qs:"service_instance_types"`
	ServiceOfferingGUIDs Filter `qs:"service_offering_guids"`
}

ServiceUsageListOptions list filters

func NewServiceUsageOptions

func NewServiceUsageOptions() *ServiceUsageListOptions

NewServiceUsageOptions creates new options to pass to list

func (ServiceUsageListOptions) ToQueryString

func (o ServiceUsageListOptions) ToQueryString() (url.Values, error)

type SidecarClient

type SidecarClient commonClient

func (*SidecarClient) Create

Create a new app sidecar

func (*SidecarClient) Delete

func (c *SidecarClient) Delete(ctx context.Context, guid string) error

Delete the specified sidecar

func (*SidecarClient) FirstForApp

func (c *SidecarClient) FirstForApp(ctx context.Context, appGUID string, opts *SidecarListOptions) (*resource.Sidecar, error)

FirstForApp returns the first sidecar matching the options and app or an error when less than 1 match

func (*SidecarClient) FirstForProcess

func (c *SidecarClient) FirstForProcess(ctx context.Context, processGUID string, opts *SidecarListOptions) (*resource.Sidecar, error)

FirstForProcess returns the first sidecar matching the options and process or an error when less than 1 match

func (*SidecarClient) Get

func (c *SidecarClient) Get(ctx context.Context, guid string) (*resource.Sidecar, error)

Get the specified app

func (*SidecarClient) ListForApp

func (c *SidecarClient) ListForApp(ctx context.Context, appGUID string, opts *SidecarListOptions) ([]*resource.Sidecar, *Pager, error)

ListForApp pages all sidecars associated with the specified app

func (*SidecarClient) ListForAppAll

func (c *SidecarClient) ListForAppAll(ctx context.Context, appGUID string, opts *SidecarListOptions) ([]*resource.Sidecar, error)

ListForAppAll retrieves all sidecars associated with the specified app

func (*SidecarClient) ListForProcess

func (c *SidecarClient) ListForProcess(ctx context.Context, processGUID string, opts *SidecarListOptions) ([]*resource.Sidecar, *Pager, error)

ListForProcess pages all sidecars associated with the specified process

func (*SidecarClient) ListForProcessAll

func (c *SidecarClient) ListForProcessAll(ctx context.Context, processGUID string, opts *SidecarListOptions) ([]*resource.Sidecar, error)

ListForProcessAll retrieves all sidecars associated with the specified process

func (*SidecarClient) SingleForApp

func (c *SidecarClient) SingleForApp(ctx context.Context, appGUID string, opts *SidecarListOptions) (*resource.Sidecar, error)

SingleForApp returns a single sidecar matching the options and app or an error if not exactly 1 match

func (*SidecarClient) SingleForProcess

func (c *SidecarClient) SingleForProcess(ctx context.Context, processGUID string, opts *SidecarListOptions) (*resource.Sidecar, error)

SingleForProcess returns a single sidecar matching the options and process or an error if not exactly 1 match

func (*SidecarClient) Update

Update the specified attributes of the app

type SidecarListOptions

type SidecarListOptions struct {
	*ListOptions
}

SidecarListOptions list filters

func NewSidecarListOptions

func NewSidecarListOptions() *SidecarListOptions

NewSidecarListOptions creates new options to pass to list

func (SidecarListOptions) ToQueryString

func (o SidecarListOptions) ToQueryString() (url.Values, error)

type SpaceClient

type SpaceClient commonClient

func (*SpaceClient) AssignIsolationSegment

func (c *SpaceClient) AssignIsolationSegment(ctx context.Context, guid, isolationSegmentGUID string) error

AssignIsolationSegment assigns an isolation segment to the space

Apps will not run in the isolation segment until they are restarted An empty isolationSegmentGUID will un-assign the isolation segment

func (*SpaceClient) Create

Create a new space

func (*SpaceClient) Delete

func (c *SpaceClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified space asynchronously and return a jobGUID

func (*SpaceClient) First

func (c *SpaceClient) First(ctx context.Context, opts *SpaceListOptions) (*resource.Space, error)

First returns the first space matching the options or an error when less than 1 match

func (*SpaceClient) Get

func (c *SpaceClient) Get(ctx context.Context, guid string) (*resource.Space, error)

Get the specified space

func (*SpaceClient) GetAssignedIsolationSegment

func (c *SpaceClient) GetAssignedIsolationSegment(ctx context.Context, guid string) (string, error)

GetAssignedIsolationSegment gets the space's assigned isolation segment, if any

func (*SpaceClient) GetIncludeOrganization

func (c *SpaceClient) GetIncludeOrganization(ctx context.Context, guid string) (*resource.Space, *resource.Organization, error)

GetIncludeOrganization allows callers to fetch a space and include the parent organization

func (*SpaceClient) List

func (c *SpaceClient) List(ctx context.Context, opts *SpaceListOptions) ([]*resource.Space, *Pager, error)

List pages all spaces the user has access to

func (*SpaceClient) ListAll

func (c *SpaceClient) ListAll(ctx context.Context, opts *SpaceListOptions) ([]*resource.Space, error)

ListAll retrieves all spaces the user has access to

func (*SpaceClient) ListIncludeOrganizations

func (c *SpaceClient) ListIncludeOrganizations(ctx context.Context, opts *SpaceListOptions) ([]*resource.Space, []*resource.Organization, *Pager, error)

ListIncludeOrganizations page all spaces the user has access to and include the parent organizations

func (*SpaceClient) ListIncludeOrganizationsAll

func (c *SpaceClient) ListIncludeOrganizationsAll(ctx context.Context, opts *SpaceListOptions) ([]*resource.Space, []*resource.Organization, error)

ListIncludeOrganizationsAll retrieves all spaces the user has access to and include the parent organizations

func (*SpaceClient) ListUsers

func (c *SpaceClient) ListUsers(ctx context.Context, spaceGUID string, opts *UserListOptions) ([]*resource.User, *Pager, error)

ListUsers pages users by space GUID

func (*SpaceClient) ListUsersAll

func (c *SpaceClient) ListUsersAll(ctx context.Context, spaceGUID string, opts *UserListOptions) ([]*resource.User, error)

ListUsersAll retrieves all users by space GUID

func (*SpaceClient) Single

func (c *SpaceClient) Single(ctx context.Context, opts *SpaceListOptions) (*resource.Space, error)

Single returns a single space matching the options or an error if not exactly 1 match

func (*SpaceClient) Update

func (c *SpaceClient) Update(ctx context.Context, guid string, r *resource.SpaceUpdate) (*resource.Space, error)

Update the specified attributes of a space

type SpaceFeatureClient

type SpaceFeatureClient commonClient

func (*SpaceFeatureClient) EnableSSH

func (c *SpaceFeatureClient) EnableSSH(ctx context.Context, spaceGUID string, enable bool) error

EnableSSH toggles the SSH feature for a space

func (*SpaceFeatureClient) IsSSHEnabled

func (c *SpaceFeatureClient) IsSSHEnabled(ctx context.Context, spaceGUID string) (bool, error)

IsSSHEnabled returns true if SSH is enabled for the specified space

type SpaceListOptions

type SpaceListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`              // list of space guids to filter by
	Names             Filter `qs:"names"`              // list of space names to filter by
	OrganizationGUIDs Filter `qs:"organization_guids"` // list of organization guids to filter by

	Include resource.SpaceIncludeType `qs:"include"` // include parent objects if any
}

SpaceListOptions list filters

func NewSpaceListOptions

func NewSpaceListOptions() *SpaceListOptions

NewSpaceListOptions creates new options to pass to list

func (SpaceListOptions) ToQueryString

func (o SpaceListOptions) ToQueryString() (url.Values, error)

type SpaceQuotaClient

type SpaceQuotaClient commonClient

func (*SpaceQuotaClient) Apply

func (c *SpaceQuotaClient) Apply(ctx context.Context, guid string, spaceGUIDs []string) ([]string, error)

Apply the quota to the specified spaces

func (*SpaceQuotaClient) Create

Create a new space quota

func (*SpaceQuotaClient) Delete

func (c *SpaceQuotaClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified space quota asynchronously and return a jobGUID

func (*SpaceQuotaClient) First

First returns the first space quota matching the options or an error when less than 1 match

func (*SpaceQuotaClient) Get

Get the specified space quota

func (*SpaceQuotaClient) List

List pages all space quotas the user has access to

func (*SpaceQuotaClient) ListAll

ListAll retrieves all space quotas the user has access to

func (*SpaceQuotaClient) Remove

func (c *SpaceQuotaClient) Remove(ctx context.Context, guid, spaceGUID string) error

Remove the space quota from the specified space

func (*SpaceQuotaClient) Single

Single returns a single space quota matching the options or an error if not exactly 1 match

func (*SpaceQuotaClient) Update

Update the specified attributes of the organization quota

type SpaceQuotaListOptions

type SpaceQuotaListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
	SpaceGUIDs        Filter `qs:"space_guids"`
}

SpaceQuotaListOptions list filters

func NewSpaceQuotaListOptions

func NewSpaceQuotaListOptions() *SpaceQuotaListOptions

NewSpaceQuotaListOptions creates new options to pass to list

func (SpaceQuotaListOptions) ToQueryString

func (o SpaceQuotaListOptions) ToQueryString() (url.Values, error)

type StackClient

type StackClient commonClient

func (*StackClient) Create

Create a new stack

func (*StackClient) Delete

func (c *StackClient) Delete(ctx context.Context, guid string) error

Delete the specified stack

func (*StackClient) First

func (c *StackClient) First(ctx context.Context, opts *StackListOptions) (*resource.Stack, error)

First returns the first stack matching the options or an error when less than 1 match

func (*StackClient) Get

func (c *StackClient) Get(ctx context.Context, guid string) (*resource.Stack, error)

Get the specified stack

func (*StackClient) List

func (c *StackClient) List(ctx context.Context, opts *StackListOptions) ([]*resource.Stack, *Pager, error)

List pages all stacks the user has access to

func (*StackClient) ListAll

func (c *StackClient) ListAll(ctx context.Context, opts *StackListOptions) ([]*resource.Stack, error)

ListAll retrieves all stacks the user has access to

func (*StackClient) ListAppsOnStack

func (c *StackClient) ListAppsOnStack(ctx context.Context, guid string, opts *StackListOptions) ([]*resource.App, *Pager, error)

ListAppsOnStack pages all apps using a given stack

func (*StackClient) ListAppsOnStackAll

func (c *StackClient) ListAppsOnStackAll(ctx context.Context, guid string, opts *StackListOptions) ([]*resource.App, error)

ListAppsOnStackAll retrieves all apps using a given stack

func (*StackClient) Single

func (c *StackClient) Single(ctx context.Context, opts *StackListOptions) (*resource.Stack, error)

Single returns a single stack matching the options or an error if not exactly 1 match

func (*StackClient) Update

func (c *StackClient) Update(ctx context.Context, guid string, r *resource.StackUpdate) (*resource.Stack, error)

Update the specified attributes of a stack

type StackListOptions

type StackListOptions struct {
	*ListOptions

	Names Filter `qs:"names"` // list of stack names to filter by
}

StackListOptions list filters

func NewStackListOptions

func NewStackListOptions() *StackListOptions

NewStackListOptions creates new options to pass to list

func (StackListOptions) ToQueryString

func (o StackListOptions) ToQueryString() (url.Values, error)

type TaskClient

type TaskClient commonClient

func (*TaskClient) Cancel

func (c *TaskClient) Cancel(ctx context.Context, guid string) (*resource.Task, error)

Cancel the specified task

Canceled tasks will initially be in state CANCELING and will move to state FAILED once the cancel request has been processed. Cancel requests are idempotent and will be processed according to the state of the task when the request is executed. Canceling a task that is in SUCCEEDED or FAILED state will return an error.

func (*TaskClient) Create

func (c *TaskClient) Create(ctx context.Context, appGUID string, r *resource.TaskCreate) (*resource.Task, error)

Create a new task for the specified app

func (*TaskClient) First

func (c *TaskClient) First(ctx context.Context, opts *TaskListOptions) (*resource.Task, error)

First returns the first task matching the options or an error when less than 1 match

func (*TaskClient) FirstForApp

func (c *TaskClient) FirstForApp(ctx context.Context, appGUID string, opts *TaskListOptions) (*resource.Task, error)

FirstForApp returns the first task matching the options and app or an error when less than 1 match

func (*TaskClient) Get

func (c *TaskClient) Get(ctx context.Context, guid string) (*resource.Task, error)

Get the specified task

func (*TaskClient) List

func (c *TaskClient) List(ctx context.Context, opts *TaskListOptions) ([]*resource.Task, *Pager, error)

List pages all the tasks the user has access to. The command field is excluded in the response.

func (*TaskClient) ListAll

func (c *TaskClient) ListAll(ctx context.Context, opts *TaskListOptions) ([]*resource.Task, error)

ListAll retrieves all tasks the user has access to. The command field is excluded in the response.

func (*TaskClient) ListForApp

func (c *TaskClient) ListForApp(ctx context.Context, appGUID string, opts *TaskListOptions) ([]*resource.Task, *Pager, error)

ListForApp pages all the tasks for the specified app that the user has access to. The command field may be excluded in the response based on the user’s role.

func (*TaskClient) ListForAppAll

func (c *TaskClient) ListForAppAll(ctx context.Context, appGUID string, opts *TaskListOptions) ([]*resource.Task, error)

ListForAppAll retrieves all the tasks for the specified app that the user has access to. The command field may be excluded in the response based on the user’s role.

func (*TaskClient) Single

func (c *TaskClient) Single(ctx context.Context, opts *TaskListOptions) (*resource.Task, error)

Single returns a single task matching the options or an error if not exactly 1 match

func (*TaskClient) SingleForApp

func (c *TaskClient) SingleForApp(ctx context.Context, appGUID string, opts *TaskListOptions) (*resource.Task, error)

SingleForApp returns a single task matching the options or an error if not exactly 1 match

func (*TaskClient) Update

func (c *TaskClient) Update(ctx context.Context, guid string, r *resource.TaskUpdate) (*resource.Task, error)

Update the specified attributes of the task

type TaskListOptions

type TaskListOptions struct {
	*ListOptions

	GUIDs             Filter `qs:"guids"`
	Names             Filter `qs:"names"`
	States            Filter `qs:"states"`
	SpaceGUIDs        Filter `qs:"space_guids"`
	OrganizationGUIDs Filter `qs:"organization_guids"`
}

TaskListOptions list filters

func NewTaskListOptions

func NewTaskListOptions() *TaskListOptions

NewTaskListOptions creates new options to pass to list

func (TaskListOptions) ToQueryString

func (o TaskListOptions) ToQueryString() (url.Values, error)

type TimestampFilter

type TimestampFilter struct {
	Timestamp []time.Time
	Operator  FilterModifier
}

func (*TimestampFilter) After

func (t *TimestampFilter) After(createdAt time.Time)

func (*TimestampFilter) AfterOrEqualTo

func (t *TimestampFilter) AfterOrEqualTo(createdAt time.Time)

func (*TimestampFilter) Before

func (t *TimestampFilter) Before(createdAt time.Time)

func (*TimestampFilter) BeforeOrEqualTo

func (t *TimestampFilter) BeforeOrEqualTo(createdAt time.Time)

func (*TimestampFilter) EqualTo

func (t *TimestampFilter) EqualTo(createdAt ...time.Time)

func (TimestampFilter) Serialize

func (t TimestampFilter) Serialize(values url.Values, tag string) error

type UserClient

type UserClient commonClient

func (*UserClient) Create

Create a new user

func (*UserClient) Delete

func (c *UserClient) Delete(ctx context.Context, guid string) (string, error)

Delete the specified user

func (*UserClient) First

func (c *UserClient) First(ctx context.Context, opts *UserListOptions) (*resource.User, error)

First returns the first user matching the options or an error when less than 1 match

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, guid string) (*resource.User, error)

Get the specified user

func (*UserClient) List

func (c *UserClient) List(ctx context.Context, opts *UserListOptions) ([]*resource.User, *Pager, error)

List pages all users the user has access to

func (*UserClient) ListAll

func (c *UserClient) ListAll(ctx context.Context, opts *UserListOptions) ([]*resource.User, error)

ListAll retrieves all users the user has access to

func (*UserClient) Single

func (c *UserClient) Single(ctx context.Context, opts *UserListOptions) (*resource.User, error)

Single returns a single user matching the options or an error if not exactly 1 match

func (*UserClient) Update

func (c *UserClient) Update(ctx context.Context, guid string, r *resource.UserUpdate) (*resource.User, error)

Update the specified attributes of a user

type UserListOptions

type UserListOptions struct {
	*ListOptions

	// list of user guids to filter by
	GUIDs Filter `qs:"guids"`

	// list of usernames to filter by. Mutually exclusive with partial_usernames
	UserNames Filter `qs:"usernames"`

	// list of strings to search by. When using this query parameter, all the users that
	// contain the string provided in their username will be returned. Mutually exclusive with usernames
	PartialUsernames Filter `qs:"partial_usernames"`

	// list of user origins (user stores) to filter by, for example, users authenticated by
	// UAA have the origin “uaa”; users authenticated by an LDAP provider have the
	// origin ldap when filtering by origins, usernames must be included
	Origins Filter `qs:"origins"`
}

UserListOptions list filters

func NewUserListOptions

func NewUserListOptions() *UserListOptions

NewUserListOptions creates new options to pass to list

func (UserListOptions) ToQueryString

func (o UserListOptions) ToQueryString() (url.Values, error)

Jump to

Keyboard shortcuts

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