api

package
v3.6.92-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XBrokerAPIVersion = "X-Broker-Api-Version"
	APIVersion        = "2.11"
)
View Source
const (
	ServiceMetadataDisplayName         = "displayName"
	ServiceMetadataImageURL            = "imageUrl"
	ServiceMetadataLongDescription     = "longDescription"
	ServiceMetadataProviderDisplayName = "providerDisplayName"
	ServiceMetadataDocumentationURL    = "documentationUrl"
	ServiceMetadataSupportURL          = "supportUrl"
)

Variables

View Source
var AsyncRequired = asyncRequiredResponse{
	Error:       "AsyncRequired",
	Description: "This service plan requires client support for asynchronous service operations.",
}

Functions

func ValidateBindRequest

func ValidateBindRequest(breq *BindRequest) field.ErrorList

func ValidateProvisionRequest

func ValidateProvisionRequest(preq *ProvisionRequest) field.ErrorList

func ValidateUUID

func ValidateUUID(path *field.Path, uuid string) field.ErrorList

Types

type BindRequest

type BindRequest struct {
	ServiceID    string `json:"service_id"`
	PlanID       string `json:"plan_id"`
	AppGUID      string `json:"app_guid,omitempty"`
	BindResource struct {
		AppGUID string `json:"app_guid,omitempty"`
		Route   string `json:"route,omitempty"`
	} `json:"bind_resource,omitempty"`
	Parameters map[string]string `json:"parameters,omitempty"`
}

type BindResponse

type BindResponse struct {
	Credentials     map[string]interface{} `json:"credentials,omitempty"`
	SyslogDrainURL  string                 `json:"syslog_drain_url,omitempty"`
	RouteServiceURL string                 `json:"route_service_url,omitempty"`
	VolumeMounts    []interface{}          `json:"volume_mounts,omitempty"`
}

type Broker

type Broker interface {
	WaitForReady() error
	Catalog() *Response
	Provision(instanceID string, preq *ProvisionRequest) *Response
	Deprovision(instanceID string) *Response
	Bind(instanceID string, bindingID string, breq *BindRequest) *Response
	Unbind(instanceID string, bindingID string) *Response
	LastOperation(instanceID string, operation Operation) *Response
}

type CatalogResponse

type CatalogResponse struct {
	Services []*Service `json:"services"`
}

type DashboardClient

type DashboardClient struct {
	ID          string `json:"id"`
	Secret      string `json:"secret"`
	RedirectURI string `json:"redirect_uri"`
}

type DeprovisionResponse

type DeprovisionResponse struct {
	Operation Operation `json:"operation,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Description string `json:"description"`
}

type LastOperationResponse

type LastOperationResponse struct {
	State       LastOperationState `json:"state"`
	Description string             `json:"description,omitempty"`
}

type LastOperationState

type LastOperationState string
const (
	LastOperationStateInProgress LastOperationState = "in progress"
	LastOperationStateSucceeded  LastOperationState = "succeeded"
	LastOperationStateFailed     LastOperationState = "failed"
)

type Operation

type Operation string
const (
	OperationProvisioning   Operation = "provisioning"
	OperationUpdating       Operation = "updating"
	OperationDeprovisioning Operation = "deprovisioning"
)

type Plan

type Plan struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Free        bool                   `json:"free,omitempty"`
	Bindable    bool                   `json:"bindable,omitempty"`
	Schemas     Schema                 `json:"schemas,omitempty"`
}

type ProvisionRequest

type ProvisionRequest struct {
	ServiceID         string            `json:"service_id"`
	PlanID            string            `json:"plan_id"`
	Parameters        map[string]string `json:"parameters,omitempty"`
	AcceptsIncomplete bool              `json:"accepts_incomplete,omitempty"`
	OrganizationID    string            `json:"organization_guid"`
	SpaceID           string            `json:"space_guid"`
}

type ProvisionResponse

type ProvisionResponse struct {
	DashboardURL string    `json:"dashboard_url,omitempty"`
	Operation    Operation `json:"operation,omitempty"`
}

type Response

type Response struct {
	Code int
	Body interface{}
	Err  error
}

func BadRequest

func BadRequest(err error) *Response

func Forbidden

func Forbidden(err error) *Response

func InternalServerError

func InternalServerError(err error) *Response

func NewResponse

func NewResponse(code int, body interface{}, err error) *Response

type Schema

type Schema struct {
	ServiceInstances ServiceInstances `json:"service-instances,omitempty"`
	ServiceBindings  ServiceBindings  `json:"service-bindings,omitempty"`
}

type Service

type Service struct {
	Name            string                 `json:"name"`
	ID              string                 `json:"id"`
	Description     string                 `json:"description"`
	Tags            []string               `json:"tags,omitempty"`
	Requires        []string               `json:"requires,omitempty"`
	Bindable        bool                   `json:"bindable"`
	Metadata        map[string]interface{} `json:"metadata,omitempty"`
	DashboardClient *DashboardClient       `json:"dashboard_client,omitempty"`
	PlanUpdatable   bool                   `json:"plan_updateable,omitempty"`
	Plans           []Plan                 `json:"plans"`
}

type ServiceBindings

type ServiceBindings struct {
	Create map[string]*jsschema.Schema `json:"create,omitempty"`
}

type ServiceInstances

type ServiceInstances struct {
	Create map[string]*jsschema.Schema `json:"create,omitempty"`
	Update map[string]*jsschema.Schema `json:"update,omitempty"`
}

type UnbindResponse

type UnbindResponse struct {
}

type UpdateRequest

type UpdateRequest struct {
	ServiceID         string            `json:"service_id"`
	PlanID            string            `json:"plan_id,omitempty"`
	Parameters        map[string]string `json:"parameters,omitempty"`
	AcceptsIncomplete bool              `json:"accepts_incomplete,omitempty"`
	PreviousValues    struct {
		ServiceID      string `json:"service_id,omitempty"`
		PlanID         string `json:"plan_id,omitempty"`
		OrganizationID string `json:"organization_id,omitempty"`
		SpaceID        string `json:"space_id,omitempty"`
	} `json:"previous_values,omitempty"`
}

type UpdateResponse

type UpdateResponse struct {
	Operation Operation `json:"operation,omitempty"`
}

Jump to

Keyboard shortcuts

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