api

package
v3.9.0-alpha.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XBrokerAPIVersion                   = "X-Broker-Api-Version"
	APIVersion                          = "2.11"
	XBrokerAPIOriginatingIdentity       = "X-Broker-API-Originating-Identity"
	OriginatingIdentitySchemeKubernetes = "kubernetes"
)
View Source
const (
	ServiceMetadataDisplayName         = "displayName"
	ServiceMetadataImageURL            = "imageUrl"
	ServiceMetadataLongDescription     = "longDescription"
	ServiceMetadataProviderDisplayName = "providerDisplayName"
	ServiceMetadataDocumentationURL    = "documentationUrl"
	ServiceMetadataSupportURL          = "supportUrl"
)
View Source
const ContextPlatformKubernetes = "kubernetes"
View Source
const OpenServiceBrokerInstanceExternalID = "openservicebroker.openshift.io/instance-external-id"

OpenServiceBrokerInstanceExternalID is a common, optional annotation that stores the OSBAPI instance (UU)ID associated with an object.

Variables

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

Functions

func ConvertTemplateInstanceRequesterToUser

func ConvertTemplateInstanceRequesterToUser(templateReq *templateapi.TemplateInstanceRequester) user.Info

ConvertTemplateInstanceRequesterToUser copies analogous fields from TemplateInstanceRequester to user.Info

func ConvertUserToTemplateInstanceRequester

func ConvertUserToTemplateInstanceRequester(u user.Info) templateapi.TemplateInstanceRequester

ConvertUserToTemplateInstanceRequester copies analogous fields from user.Info to TemplateInstanceRequester

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 {
	Catalog() *Response
	Provision(u user.Info, instanceID string, preq *ProvisionRequest) *Response
	Deprovision(u user.Info, instanceID string) *Response
	Bind(u user.Info, instanceID string, bindingID string, breq *BindRequest) *Response
	Unbind(u user.Info, instanceID string, bindingID string) *Response
	LastOperation(u user.Info, 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 KubernetesContext

type KubernetesContext struct {
	Platform  string `json:"platform"`
	Namespace string `json:"namespace"`
}

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 OpenShiftMetadata

type OpenShiftMetadata struct {
	OpenShiftFormDefinition []string `json:"openshift_form_definition,omitempty"`
}

type Operation

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

type ParameterSchema

type ParameterSchema struct {
	Create OpenShiftMetadata `json:"create,omitempty"`
}

type ParameterSchemas

type ParameterSchemas struct {
	ServiceInstance ParameterSchema `json:"service_instance,omitempty"`
}

ParameterSchemas is an OpenShift extension to allow for form building for provision/bind parameters.

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"`
	Context        KubernetesContext `json:"context,omitempty"`
	OrganizationID string            `json:"organization_guid"`
	SpaceID        string            `json:"space_guid"`
	Parameters     map[string]string `json:"parameters,omitempty"`
}

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 {
	ServiceInstance ServiceInstances `json:"service_instance,omitempty"`
	ServiceBinding  ServiceBindings  `json:"service_binding,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 {
	Context        KubernetesContext `json:"context,omitempty"`
	ServiceID      string            `json:"service_id"`
	PlanID         string            `json:"plan_id,omitempty"`
	Parameters     map[string]string `json:"parameters,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