internal

package
v6.44.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppsResource              = "apps"
	BuildpacksResource        = "buildpacks"
	BuildsResource            = "builds"
	DeploymentsResource       = "deployments"
	DomainsResource           = "domains"
	DropletsResource          = "droplets"
	FeatureFlagsResource      = "feature_flags"
	IsolationSegmentsResource = "isolation_segments"
	OrgsResource              = "organizations"
	PackagesResource          = "packages"
	ProcessesResource         = "processes"
	ResourceMatches           = "resource_matches"
	ServiceInstancesResource  = "service_instances"
	SpacesResource            = "spaces"
	StacksResource            = "stacks"
	TasksResource             = "tasks"

	ServiceOfferingsResource = "service_offerings"

	ServicePlansResource = "service_plans"

	RoutesResource = "routes"

	//v3 service credential binding
	ServiceCredentialBindingsResource = "service_credential_bindings"

	//v3 environment variable
	EnvironmentVariableGroupsResource = "environment_variable_groups"

	// v3 organization quota
	OrgQuotasResource = "organization_quotas"
)

When adding a resource, also add it to the api/cloudcontroller/ccv3/ccv3_suite_test.go resources response

View Source
const (
	DeleteApplicationProcessInstanceRequest                     = "DeleteApplicationProcessInstance"
	DeleteApplicationRequest                                    = "DeleteApplication"
	DeleteSharedOrgFromDomainRequest                            = "DeleteSharedOrgFromDomain"
	DeleteBuildpackRequest                                      = "DeleteBuildpack"
	DeleteDomainRequest                                         = "DeleteDomainRequest"
	DeleteIsolationSegmentRelationshipOrganizationRequest       = "DeleteIsolationSegmentRelationshipOrganization"
	DeleteIsolationSegmentRequest                               = "DeleteIsolationSegment"
	DeleteServiceInstanceRelationshipsSharedSpaceRequest        = "DeleteServiceInstanceRelationshipsSharedSpace"
	GetApplicationDropletCurrentRequest                         = "GetApplicationDropletCurrent"
	GetApplicationEnvRequest                                    = "GetApplicationEnv"
	GetApplicationManifestRequest                               = "GetApplicationManifest"
	GetApplicationProcessesRequest                              = "GetApplicationProcesses"
	GetApplicationProcessRequest                                = "GetApplicationProcess"
	GetApplicationsRequest                                      = "GetApplications"
	GetApplicationTasksRequest                                  = "GetApplicationTasks"
	GetBuildpacksRequest                                        = "GetBuildpacks"
	GetBuildRequest                                             = "GetBuild"
	GetDeploymentRequest                                        = "GetDeployment"
	GetDeploymentsRequest                                       = "GetDeployments"
	GetDomainsRequest                                           = "GetDomains"
	GetDropletRequest                                           = "GetDroplet"
	GetDropletsRequest                                          = "GetDroplets"
	GetFeatureFlagRequest                                       = "GetFeatureFlag"
	GetFeatureFlagsRequest                                      = "GetFeatureFlags"
	GetIsolationSegmentOrganizationsRequest                     = "GetIsolationSegmentOrganizations"
	GetIsolationSegmentRequest                                  = "GetIsolationSegment"
	GetIsolationSegmentsRequest                                 = "GetIsolationSegments"
	GetOrganizationDomainsRequest                               = "GetOrganizationDomains"
	GetOrganizationRelationshipDefaultIsolationSegmentRequest   = "GetOrganizationRelationshipDefaultIsolationSegment"
	GetOrganizationsRequest                                     = "GetOrganizations"
	GetPackageRequest                                           = "GetPackage"
	GetPackagesRequest                                          = "GetPackages"
	GetProcessStatsRequest                                      = "GetProcessStats"
	GetServiceInstancesRequest                                  = "GetServiceInstances"
	GetSpaceRelationshipIsolationSegmentRequest                 = "GetSpaceRelationshipIsolationSegment"
	GetSpacesRequest                                            = "GetSpaces"
	GetStacksRequest                                            = "GetStacks"
	PatchApplicationCurrentDropletRequest                       = "PatchApplicationCurrentDroplet"
	PatchApplicationEnvironmentVariablesRequest                 = "PatchApplicationEnvironmentVariables"
	PatchApplicationRequest                                     = "PatchApplication"
	PatchBuildpackRequest                                       = "PatchBuildpack"
	PatchFeatureFlagRequest                                     = "PatchFeatureFlag"
	PatchOrganizationRequest                                    = "PatchOrganization"
	PatchOrganizationRelationshipDefaultIsolationSegmentRequest = "PatchOrganizationRelationshipDefaultIsolationSegment"
	PatchProcessRequest                                         = "PatchProcess"
	PatchSpaceRelationshipIsolationSegmentRequest               = "PatchSpaceRelationshipIsolationSegment"
	PostApplicationActionApplyManifest                          = "PostApplicationActionApplyM"
	PostApplicationActionRestartRequest                         = "PostApplicationActionRestart"
	PostApplicationActionStartRequest                           = "PostApplicationActionStart"
	PostApplicationActionStopRequest                            = "PostApplicationActionStop"
	PostApplicationDeploymentActionCancelRequest                = "PostApplicationDeploymentActionCancel"
	PostApplicationDeploymentRequest                            = "PostApplicationDeployment"
	PostApplicationProcessActionScaleRequest                    = "PostApplicationProcessActionScale"
	PostApplicationRequest                                      = "PostApplication"
	PostApplicationTasksRequest                                 = "PostApplicationTasks"
	PostBuildRequest                                            = "PostBuild"
	PostBuildpackBitsRequest                                    = "PostBuildpackBits"
	PostBuildpackRequest                                        = "PostBuildpack"
	PostDomainRequest                                           = "PostDomain"
	PostIsolationSegmentRelationshipOrganizationsRequest        = "PostIsolationSegmentRelationshipOrganizations"
	PostIsolationSegmentsRequest                                = "PostIsolationSegments"
	PostPackageRequest                                          = "PostPackage"
	PostResourceMatchesRequest                                  = "PostResourceMatches"
	PostServiceInstanceRelationshipsSharedSpacesRequest         = "PostServiceInstanceRelationshipsSharedSpaces"
	PostSpaceActionApplyManifestRequest                         = "PostSpaceActionApplyManifest"
	PutTaskCancelRequest                                        = "PutTaskCancel"
	SharePrivateDomainRequest                                   = "SharePrivateDomainRequest"

	GetOrganizationRequest    = "GetOrganization"
	DeleteOrganizationRequest = "DeleteOrganization"
	PostOrganizationRequest   = "PostOrganization"
	GetDefaultDomainRequest   = "GetDefaultDomain"

	GetServiceOfferingsRequest   = "GetServiceOfferings"
	DeleteServiceOfferingRequest = "DeleteServiceOffering"

	GetServicePlansRequest = "GetServicePlans"

	PostRouteRequest   = "PostRoute"
	DeleteRouteRequest = "DeleteRouteRequest"
	PatchRouteRequest  = "PatchRoute"

	DeleteOrphanedRoutesRequest = "DeleteOrphanedRoutes"
	GetApplicationRoutesRequest = "GetApplicationRoutes"
	GetRouteDestinationsRequest = "GetRouteDestinations"
	GetRoutesRequest            = "GetRoutes"
	MapRouteRequest             = "MapRoute"
	UnmapRouteRequest           = "UnmapRoute"

	// v3 droplet
	PostDropletRequest        = "PostDroplet"
	GetPackageDropletsRequest = "GetPackageDroplets"
	PostDropletBitsRequest    = "PostDropletBits"
	GetDropletBitsRequest     = "GetDropletBits"

	// v3 package
	PostPackageBitsRequest = "PostPackageBits"

	// v3 service credential binding
	PostServiceCredentialBindingRequest       = "PostServiceCredentialBinding"
	GetServiceCredentialBindingsRequest       = "GetServiceCredentialBindings"
	DeleteServiceCredentialBindingRequest     = "DeleteServiceCredentialBinding"
	GetServiceCredentialBindingDetailsRequest = "GetServiceCredentialBindingDetails"

	// service_instance
	GetServiceInstanceParametersRequest                = "GetServiceInstanceParameters"
	GetServiceInstanceCredentialsRequest               = "GetServiceInstanceCredentails"
	PostServiceInstanceRequest                         = "PostServiceInstance"
	PatchServiceInstanceRequest                        = "PatchServiceInstance"
	DeleteServiceInstanceRequest                       = "DeleteServiceInstance"
	GetServiceInstanceRelationshipsSharedSpacesRequest = "GetServiceInstanceRelationshipSharedSpacesRequest"
	GetServiceInstanceSharedSpacesUsageSummaryRequest  = "GetServiceInstanceSharedSpacesUsageSummaryRequest"

	// v3 process add missing endpoints
	GetProcessRequest   = "GetProcess"
	GetProcessesRequest = "GetProcesses"

	// v3 application feature
	GetApplicationFeaturesRequest   = "GetApplicationFeatures"
	GetSSHEnabled                   = "GetSSHEnabled"
	PatchApplicationFeaturesRequest = "PatchApplicationFeatures"

	// v3 environment variable
	GetEnvironmentVariableGroupRequest   = "GetEnvironmentVariableGroup"
	PatchEnvironmentVariableGroupRequest = "PatchEnvironmentVariableGroup"

	// v3 domain add missing endpoints
	GetDomainRouteReservationsRequest = "GetDomainRouteReservations"
	GetDomainRequest                  = "GetDomain"

	// v3 space add missing
	PostSpaceRequest   = "PostSpace"
	DeleteSpaceRequest = "DeleteSpace"
	PatchSpaceRequest  = "PatchSpace"

	// v3 revision
	GetApplicationRevisionsRequest         = "GetApplicationRevisions"
	GetApplicationRevisionsDeployedRequest = "GetApplicationRevisionsDeployed"

	// v3 organization quota
	PostOrganizationQuotaApplyRequest = "PostOrganizationQuotaApply"
	PostOrganizationQuotaRequest      = "PostOrganizationQuota"
	DeleteOrganizationQuotaRequest    = "DeleteOrganizationQuota"
	GetOrganizationQuotaRequest       = "GetOrganizationQuota"
	GetOrganizationQuotasRequest      = "GetOrganizationQuotas"
	PatchOrganizationQuotaRequest     = "PatchOrganizationQuota"
)

Naming convention:

HTTP method + non-parameter parts of the path + "Request"

If the request returns a single entity by GUID, use the singular (for example /v2/organizations/:organization_guid is GetOrganization).

Variables

View Source
var APIRoutes = []Route{}/* 120 elements not displayed */

APIRoutes is a list of routes used by the router to construct request URLs.

Functions

This section is empty.

Types

type Params

type Params map[string]string

Params map path keys to values. For example, if your route has the path pattern:

/person/:person_id/pets/:pet_type

Then a correct Params map would lool like:

router.Params{
  "person_id": "123",
  "pet_type": "cats",
}

type RealTime

type RealTime struct{}

func (RealTime) Now

func (RealTime) Now() time.Time

type Route

type Route struct {
	// Name is a key specifying which HTTP route the router should associate with
	// the endpoint at runtime.
	Name string
	// Method is any valid HTTP method
	Method string
	// Path contains a path pattern
	Path string
	// Resource is a key specifying which resource root the router should
	// associate with the endpoint at runtime.
	Resource string
}

Route defines the property of a Cloud Controller V3 endpoint.

Method can be one of the following:

GET HEAD POST PUT PATCH DELETE CONNECT OPTIONS TRACE

Path conforms to Pat-style pattern matching. The following docs are taken from http://godoc.org/github.com/bmizerany/pat#PatternServeMux

Path Patterns may contain literals or captures. Capture names start with a colon and consist of letters A-Z, a-z, _, and 0-9. The rest of the pattern matches literally. The portion of the URL matching each name ends with an occurrence of the character in the pattern immediately following the name, or a /, whichever comes first. It is possible for a name to match the empty string.

Example pattern with one capture:

/hello/:name

Will match:

/hello/blake
/hello/keith

Will not match:

/hello/blake/
/hello/blake/foo
/foo
/foo/bar

Example 2:

/hello/:name/

Will match:

/hello/blake/
/hello/keith/foo
/hello/blake
/hello/keith

Will not match:

/foo
/foo/bar

func (Route) CreatePath

func (r Route) CreatePath(params Params) (string, error)

CreatePath combines the route's path pattern with a Params map to produce a valid path.

type Router

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

Router combines route and resource information in order to generate HTTP requests.

func NewRouter

func NewRouter(routes []Route, resources map[string]string) *Router

NewRouter returns a pointer to a new Router.

func (Router) CreateRequest

func (router Router) CreateRequest(name string, params Params, body io.Reader) (*http.Request, error)

CreateRequest returns a request key'd off of the name given. The params are merged into the URL and body is set as the request body.

Jump to

Keyboard shortcuts

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