apis

package
v0.0.0-...-1c213c1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppsPath                          = "/v3/apps"
	AppPath                           = "/v3/apps/{guid}"
	AppCurrentDropletRelationshipPath = "/v3/apps/{guid}/relationships/current_droplet"
	AppCurrentDropletPath             = "/v3/apps/{guid}/droplets/current"
	AppProcessesPath                  = "/v3/apps/{guid}/processes"
	AppProcessByTypePath              = "/v3/apps/{guid}/processes/{type}"
	AppProcessScalePath               = "/v3/apps/{guid}/processes/{processType}/actions/scale"
	AppRoutesPath                     = "/v3/apps/{guid}/routes"
	AppStartPath                      = "/v3/apps/{guid}/actions/start"
	AppStopPath                       = "/v3/apps/{guid}/actions/stop"
	AppRestartPath                    = "/v3/apps/{guid}/actions/restart"
	AppEnvVarsPath                    = "/v3/apps/{guid}/environment_variables"
	AppEnvPath                        = "/v3/apps/{guid}/env"

	AppStartedState = "STARTED"
	AppStoppedState = "STOPPED"
)
View Source
const (
	BuildPath  = "/v3/builds/{guid}"
	BuildsPath = "/v3/builds"
)
View Source
const (
	LogCacheInfoPath = "/api/v1/info"
	LogCacheReadPath = "/api/v1/read/{guid}"
)
View Source
const (
	OrgsPath       = "/v3/organizations"
	OrgPath        = "/v3/organizations/{guid}"
	OrgDomainsPath = "/v3/organizations/{guid}/domains"
)
View Source
const (
	PackagePath         = "/v3/packages/{guid}"
	PackagesPath        = "/v3/packages"
	PackageUploadPath   = "/v3/packages/{guid}/upload"
	PackageDropletsPath = "/v3/packages/{guid}/droplets"
)
View Source
const (
	ProcessPath         = "/v3/processes/{guid}"
	ProcessSidecarsPath = "/v3/processes/{guid}/sidecars"
	ProcessScalePath    = "/v3/processes/{guid}/actions/scale"
	ProcessStatsPath    = "/v3/processes/{guid}/stats"
	ProcessesPath       = "/v3/processes"
)
View Source
const (
	RoutePath             = "/v3/routes/{guid}"
	RoutesPath            = "/v3/routes"
	RouteDestinationsPath = "/v3/routes/{guid}/destinations"
)
View Source
const (
	ServiceBindingsPath = "/v3/service_credential_bindings"
	ServiceBindingPath  = "/v3/service_credential_bindings/{guid}"
)
View Source
const (
	ServiceInstancesPath = "/v3/service_instances"
	ServiceInstancePath  = "/v3/service_instances/{guid}"
)
View Source
const (
	SpacesPath = "/v3/spaces"
	SpacePath  = "/v3/spaces/{guid}"
)
View Source
const (
	SpaceManifestApplyPath = "/v3/spaces/{spaceGUID}/actions/apply_manifest"
	SpaceManifestDiffPath  = "/v3/spaces/{spaceGUID}/manifest_diff"
)
View Source
const (
	BuildpacksPath = "/v3/buildpacks"
)
View Source
const (
	DomainsPath = "/v3/domains"
)
View Source
const (
	DropletPath = "/v3/droplets/{guid}"
)
View Source
const (
	JobPath = "/v3/jobs/{guid}"
)
View Source
const JobResourceType = "Job"
View Source
const (
	ResourceMatchesPath = "/v3/resource_matches"
)
View Source
const (
	RolesPath = "/v3/roles"
)
View Source
const (
	RootPath = "/"
)
View Source
const (
	RootV3Path = "/v3"
)
View Source
const (
	ServiceRouteBindingsPath = "/v3/service_route_bindings"
)
View Source
const (
	WhoAmIPath = "/whoami"
)

Variables

View Source
var Logger = ctrl.Log.WithName("Shared Handler Functions")

Functions

This section is empty.

Types

type AppHandler

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

func NewAppHandler

func NewAppHandler(
	logger logr.Logger,
	serverURL url.URL,
	appRepo CFAppRepository,
	dropletRepo CFDropletRepository,
	processRepo CFProcessRepository,
	routeRepo CFRouteRepository,
	domainRepo CFDomainRepository,
	spaceRepo SpaceRepository,
	scaleAppProcessFunc ScaleAppProcess,
	decoderValidator *DecoderValidator,
) *AppHandler

func (*AppHandler) RegisterRoutes

func (h *AppHandler) RegisterRoutes(router *mux.Router)

type ApplyManifestAction

type ApplyManifestAction func(ctx context.Context, authInfo authorization.Info, spaceGUID string, defaultDomainName string, manifest payloads.Manifest) error

type AuthAwareHandlerFunc

type AuthAwareHandlerFunc func(authInfo authorization.Info, r *http.Request) (*HandlerResponse, error)

type AuthAwareHandlerFuncWrapper

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

func NewAuthAwareHandlerFuncWrapper

func NewAuthAwareHandlerFuncWrapper(logger logr.Logger) *AuthAwareHandlerFuncWrapper

func (*AuthAwareHandlerFuncWrapper) Wrap

type AuthInfoParser

type AuthInfoParser interface {
	Parse(authHeader string) (authorization.Info, error)
}

type AuthenticationMiddleware

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

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware(logger logr.Logger, authInfoParser AuthInfoParser, identityProvider IdentityProvider) *AuthenticationMiddleware

func (*AuthenticationMiddleware) Middleware

func (a *AuthenticationMiddleware) Middleware(next http.Handler) http.Handler

type BuildHandler

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

func NewBuildHandler

func NewBuildHandler(
	logger logr.Logger,
	serverURL url.URL,
	buildRepo CFBuildRepository,
	packageRepo CFPackageRepository,
	decoderValidator *DecoderValidator,
) *BuildHandler

func (*BuildHandler) RegisterRoutes

func (h *BuildHandler) RegisterRoutes(router *mux.Router)

type BuildpackHandler

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

func NewBuildpackHandler

func NewBuildpackHandler(
	logger logr.Logger,
	serverURL url.URL,
	buildpackRepo BuildpackRepository,
	clusterBuilderName string,
) *BuildpackHandler

func (*BuildpackHandler) RegisterRoutes

func (h *BuildpackHandler) RegisterRoutes(router *mux.Router)

type BuildpackRepository

type BuildpackRepository interface {
	GetBuildpacksForBuilder(ctx context.Context, authInfo authorization.Info, builderName string) ([]repositories.BuildpackRecord, error)
}

type CFRoleRepository

type CFRoleRepository interface {
	CreateRole(context.Context, authorization.Info, repositories.CreateRoleMessage) (repositories.RoleRecord, error)
}

type CFServiceBindingRepository

type CFServiceBindingRepository interface {
	CreateServiceBinding(context.Context, authorization.Info, repositories.CreateServiceBindingMessage) (repositories.ServiceBindingRecord, error)
	DeleteServiceBinding(context.Context, authorization.Info, string) error
	ServiceBindingExists(ctx context.Context, info authorization.Info, spaceGUID, appGUID, serviceInsanceGUID string) (bool, error)
	ListServiceBindings(context.Context, authorization.Info, repositories.ListServiceBindingsMessage) ([]repositories.ServiceBindingRecord, error)
}

type DecoderValidator

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

func NewDefaultDecoderValidator

func NewDefaultDecoderValidator() (*DecoderValidator, error)

func (*DecoderValidator) DecodeAndValidateJSONPayload

func (dv *DecoderValidator) DecodeAndValidateJSONPayload(r *http.Request, object interface{}) error

func (*DecoderValidator) DecodeAndValidateYAMLPayload

func (dv *DecoderValidator) DecodeAndValidateYAMLPayload(r *http.Request, object interface{}) error

type DomainHandler

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

func NewDomainHandler

func NewDomainHandler(
	logger logr.Logger,
	serverURL url.URL,
	domainRepo CFDomainRepository,
) *DomainHandler

func (*DomainHandler) DomainListHandler

func (h *DomainHandler) DomainListHandler(authInfo authorization.Info, r *http.Request) (*HandlerResponse, error)

func (*DomainHandler) RegisterRoutes

func (h *DomainHandler) RegisterRoutes(router *mux.Router)

type DropletHandler

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

func NewDropletHandler

func NewDropletHandler(
	logger logr.Logger,
	serverURL url.URL,
	dropletRepo CFDropletRepository,
) *DropletHandler

func (*DropletHandler) RegisterRoutes

func (h *DropletHandler) RegisterRoutes(router *mux.Router)

type HandlerResponse

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

func NewHandlerResponse

func NewHandlerResponse(httpStatus int) *HandlerResponse

func (*HandlerResponse) WithBody

func (r *HandlerResponse) WithBody(body interface{}) *HandlerResponse

func (*HandlerResponse) WithHeader

func (r *HandlerResponse) WithHeader(key, value string) *HandlerResponse

type IdentityProvider

type IdentityProvider interface {
	GetIdentity(context.Context, authorization.Info) (authorization.Identity, error)
}

type ImageRepository

type ImageRepository interface {
	UploadSourceImage(ctx context.Context, authInfo authorization.Info, imageRef string, srcReader io.Reader, spaceGUID string) (imageRefWithDigest string, err error)
}

type JobHandler

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

func NewJobHandler

func NewJobHandler(logger logr.Logger, serverURL url.URL) *JobHandler

func (*JobHandler) RegisterRoutes

func (h *JobHandler) RegisterRoutes(router *mux.Router)

type LogCacheHandler

type LogCacheHandler struct{}

LogCacheHandler implements the minimal set of log-cache API endpoints/features necessary to support the "cf push" workflow. It does not support actually fetching and returning application logs at this time

func NewLogCacheHandler

func NewLogCacheHandler() *LogCacheHandler

func (*LogCacheHandler) RegisterRoutes

func (h *LogCacheHandler) RegisterRoutes(router *mux.Router)

type OrgHandler

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

func NewOrgHandler

func NewOrgHandler(apiBaseURL url.URL, orgRepo CFOrgRepository, domainRepo CFDomainRepository, decoderValidator *DecoderValidator) *OrgHandler

func (*OrgHandler) RegisterRoutes

func (h *OrgHandler) RegisterRoutes(router *mux.Router)

type PackageHandler

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

func NewPackageHandler

func NewPackageHandler(
	logger logr.Logger,
	serverURL url.URL,
	packageRepo CFPackageRepository,
	appRepo CFAppRepository,
	dropletRepo CFDropletRepository,
	imageRepo ImageRepository,
	decoderValidator *DecoderValidator,
	registryBase string,
	registrySecretName string,
) *PackageHandler

func (*PackageHandler) RegisterRoutes

func (h *PackageHandler) RegisterRoutes(router *mux.Router)

type ProcessHandler

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

func NewProcessHandler

func NewProcessHandler(
	logger logr.Logger,
	serverURL url.URL,
	processRepo CFProcessRepository,
	fetchProcessStats FetchProcessStats,
	scaleProcessFunc ScaleProcess,
	decoderValidator *DecoderValidator,
) *ProcessHandler

func (*ProcessHandler) RegisterRoutes

func (h *ProcessHandler) RegisterRoutes(router *mux.Router)

type ResourceMatchesHandler

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

func NewResourceMatchesHandler

func NewResourceMatchesHandler(logger logr.Logger) *ResourceMatchesHandler

func (*ResourceMatchesHandler) RegisterRoutes

func (h *ResourceMatchesHandler) RegisterRoutes(router *mux.Router)

type RoleHandler

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

func NewRoleHandler

func NewRoleHandler(apiBaseURL url.URL, roleRepo CFRoleRepository, decoderValidator *DecoderValidator) *RoleHandler

func (*RoleHandler) RegisterRoutes

func (h *RoleHandler) RegisterRoutes(router *mux.Router)

type RoleName

type RoleName string
const (
	RoleAdmin                      RoleName = "admin"
	RoleAdminReadOnly              RoleName = "admin_read_only"
	RoleGlobalAuditor              RoleName = "global_auditor"
	RoleOrganizationAuditor        RoleName = "organization_auditor"
	RoleOrganizationBillingManager RoleName = "organization_billing_manager"
	RoleOrganizationManager        RoleName = "organization_manager"
	RoleOrganizationUser           RoleName = "organization_user"
	RoleSpaceAuditor               RoleName = "space_auditor"
	RoleSpaceDeveloper             RoleName = "space_developer"
	RoleSpaceManager               RoleName = "space_manager"
	RoleSpaceSupporter             RoleName = "space_supporter"
)

type RootHandler

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

func NewRootHandler

func NewRootHandler(serverURL string) *RootHandler

func (*RootHandler) RegisterRoutes

func (h *RootHandler) RegisterRoutes(router *mux.Router)

type RootV3Handler

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

func NewRootV3Handler

func NewRootV3Handler(serverURL string) *RootV3Handler

func (*RootV3Handler) RegisterRoutes

func (h *RootV3Handler) RegisterRoutes(router *mux.Router)

type RouteHandler

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

func NewRouteHandler

func NewRouteHandler(
	logger logr.Logger,
	serverURL url.URL,
	routeRepo CFRouteRepository,
	domainRepo CFDomainRepository,
	appRepo CFAppRepository,
	spaceRepo SpaceRepository,
	decoderValidator *DecoderValidator,
) *RouteHandler

func (*RouteHandler) RegisterRoutes

func (h *RouteHandler) RegisterRoutes(router *mux.Router)

type ScaleAppProcess

type ScaleAppProcess func(ctx context.Context, authInfo authorization.Info, appGUID string, processType string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)

type ScaleProcess

type ScaleProcess func(ctx context.Context, authInfo authorization.Info, processGUID string, scale repositories.ProcessScaleValues) (repositories.ProcessRecord, error)

type ServiceBindingHandler

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

func NewServiceBindingHandler

func NewServiceBindingHandler(logger logr.Logger, serverURL url.URL, serviceBindingRepo CFServiceBindingRepository, appRepo CFAppRepository, serviceInstanceRepo CFServiceInstanceRepository, decoderValidator *DecoderValidator) *ServiceBindingHandler

func (*ServiceBindingHandler) RegisterRoutes

func (h *ServiceBindingHandler) RegisterRoutes(router *mux.Router)

type ServiceInstanceHandler

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

func NewServiceInstanceHandler

func NewServiceInstanceHandler(
	logger logr.Logger,
	serverURL url.URL,
	serviceInstanceRepo CFServiceInstanceRepository,
	spaceRepo SpaceRepository,
	decoderValidator *DecoderValidator,
) *ServiceInstanceHandler

func (*ServiceInstanceHandler) RegisterRoutes

func (h *ServiceInstanceHandler) RegisterRoutes(router *mux.Router)

type ServiceRouteBindingHandler

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

func NewServiceRouteBindingHandler

func NewServiceRouteBindingHandler(
	logger logr.Logger,
	serverURL url.URL,
) *ServiceRouteBindingHandler

func (*ServiceRouteBindingHandler) RegisterRoutes

func (h *ServiceRouteBindingHandler) RegisterRoutes(router *mux.Router)

type SpaceHandler

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

func NewSpaceHandler

func NewSpaceHandler(apiBaseURL url.URL, imageRegistrySecretName string, spaceRepo SpaceRepository, decoderValidator *DecoderValidator) *SpaceHandler

func (*SpaceHandler) RegisterRoutes

func (h *SpaceHandler) RegisterRoutes(router *mux.Router)

type SpaceManifestHandler

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

func NewSpaceManifestHandler

func NewSpaceManifestHandler(
	logger logr.Logger,
	serverURL url.URL,
	defaultDomainName string,
	applyManifestAction ApplyManifestAction,
	spaceRepo repositories.CFSpaceRepository,
	decoderValidator *DecoderValidator,
) *SpaceManifestHandler

func (*SpaceManifestHandler) RegisterRoutes

func (h *SpaceManifestHandler) RegisterRoutes(router *mux.Router)

type WhoAmIHandler

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

func NewWhoAmI

func NewWhoAmI(identityProvider IdentityProvider, apiBaseURL url.URL) *WhoAmIHandler

func (*WhoAmIHandler) RegisterRoutes

func (h *WhoAmIHandler) RegisterRoutes(router *mux.Router)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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