api

package
v0.0.0-...-b80afe7 Latest Latest
Warning

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

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

Documentation

Overview

Package api provides an interface for the open service broker API. For further information see https://github.com/openservicebrokerapi/servicebroker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingMetadata

type BindingMetadata struct {
	ExpiresAt string `json:"expires_at,omitempty"`
}

BindingMetadata describes attributes about a binding.

type CreateServiceBindingRequest

type CreateServiceBindingRequest struct {
	Context      *runtime.RawExtension `json:"context"`
	ServiceID    string                `json:"service_id"`
	PlanID       string                `json:"plan_id"`
	AppGUID      string                `json:"app_guid"`
	BindResource *runtime.RawExtension `json:"bind_resource"`
	Parameters   *runtime.RawExtension `json:"parameters"`
}

CreateServiceBindingRequest is provided by the client when it wishes to bind to the service instance and get credentials.

func (*CreateServiceBindingRequest) DeepCopy

DeepCopy clones a CreateServiceBindingRequest.

type CreateServiceBindingResponse

type CreateServiceBindingResponse struct {
	Operation string `json:"operation"`
}

CreateServiceBindingResponse is returned to the client when an aysnc request to create a binding is made.

type CreateServiceInstanceRequest

type CreateServiceInstanceRequest struct {
	ServiceID        string                `json:"service_id"`
	PlanID           string                `json:"plan_id"`
	Context          *runtime.RawExtension `json:"context"`
	OrganizationGUID string                `json:"organization_guid"`
	SpaceGUID        string                `json:"space_guid"`
	Parameters       *runtime.RawExtension `json:"parameters"`
	MaintenanceInfo  *MaintenanceInfo      `json:"maintenance_info"`
}

CreateServiceInstanceRequest is submitted by the client when creating a service instance.

func (*CreateServiceInstanceRequest) DeepCopy

DeepCopy clones a CreateServiceInstanceRequest.

type CreateServiceInstanceResponse

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

CreateServiceInstanceResponse is returned by the server when creating a service instance.

type DashboardClient

type DashboardClient struct {
	ID            string `json:"id"`
	Secret        string `json:"secret"`
	RedirectedURI string `json:"redirected_uri,omitempty"`
}

DashboardClient may be provided by a service offering.

type DeleteServiceBindingResponse

type DeleteServiceBindingResponse struct {
}

DeleteServiceBindingResponse is returned when a binding is deleted.

type Device

type Device struct {
	VolumeID    string                `json:"volume_id"`
	MountConfig *runtime.RawExtension `json:"mount_config,omitempty"`
}

Device defines a volume device.

type Endpoint

type Endpoint struct {
	Host     string   `json:"host"`
	Ports    []string `json:"ports"`
	Protocol string   `json:"protocol,omitempty"`
}

Endpoint defines a service endpoint.

type Error

type Error struct {
	// A single word in camel case that uniquely identifies the error condition.
	// If present, MUST be a non-empty string.
	Error ErrorType `json:"error,omitempty"`

	// A user-facing error message explaining why the request failed.
	// If present, MUST be a non-empty string.
	Description string `json:"description,omitempty"`

	// If an update or deprovisioning operation failed, this flag indicates
	// whether or not the Service Instance is still usable. If true, the
	// Service Instance can still be used, false otherwise. This field MUST NOT
	// be present for errors of other operations. Defaults to true.
	InstanceUsable *bool `json:"instance_usable,omitempty"`
}

Error is the structured JSON response to send to a client on an error condition.

type ErrorType

type ErrorType string

ErrorType is returned when a service broker error is encountered.

const (
	// ErrorAsyncRequired meand this request requires client support for asynchronous
	// service operations.
	ErrorAsyncRequired ErrorType = "AsyncRequired"

	// ErrorConcurrencyError means the Service Broker does not support concurrent
	// requests that mutate the same resource.
	ErrorConcurrencyError ErrorType = "ConcurrencyError"

	// ErrorRequiresApp means the request body is missing the app_guid field.
	ErrorRequiresApp ErrorType = "RequiresApp"

	// ErrorMaintenanceInfoConflict means the maintenance_info.version field provided
	// in the request does not match the maintenance_info.version field provided in
	// the Service Broker's Catalog.
	ErrorMaintenanceInfoConflict ErrorType = "MaintenanceInfoConflict"

	// ErrorInternalServerError means that something that shouldn't ever break has.
	ErrorInternalServerError ErrorType = "InternalServerError"

	// ErrorConfigurationError means that the broker has been misconfigured.
	ErrorConfigurationError ErrorType = "ConfigurationError"

	// ErrorQueryError means that the user specified query is inavlid.
	ErrorQueryError ErrorType = "QueryError"

	// ErrorParameterError means that the user specified parameters are
	// invalid.
	ErrorParameterError ErrorType = "ParameterError"

	// ErrorValidationError means that the supplied parameters failed JSON schema
	// validation.
	ErrorValidationError ErrorType = "ValidationError"

	// ErrorResourceConflict means that an attempt to create a resource has resulted
	// in a conflict with an existing one.
	ErrorResourceConflict ErrorType = "ResourceConflict"

	// ErrorResourceNotFound means that an attempt has been made to access a resource
	// that does not extst.
	ErrorResourceNotFound ErrorType = "ResourceNotFound"

	// ErrorResourceGone means that a delete request has failed because the
	// requested resource does not exist.
	ErrorResourceGone ErrorType = "ResourceGone"
)

type GetServiceBindingResponse

type GetServiceBindingResponse struct {
	Metadata        *BindingMetadata      `json:"metadata,omitempty"`
	Credentials     *runtime.RawExtension `json:"credentials,omitempty"`
	SyslogDrainURL  string                `json:"syslog_drain_url,omitempty"`
	RouteServiceURL string                `json:"route_service_url,omitempty"`
	VolumeMounts    []VolumeMount         `json:"volume_mounts,omitempty"`
	Parameters      *runtime.RawExtension `json:"parameters,omitempty"`
	Endpoints       []Endpoint            `json:"endpoints,omitempty"`
}

GetServiceBindingResponse is returned by the server when a service binding is read.

type GetServiceInstanceResponse

type GetServiceInstanceResponse struct {
	ServiceID    string                `json:"service_id,omitempty"`
	PlanID       string                `json:"plan_id,omitempty"`
	DashboardURL string                `json:"dashboard_url,omitempty"`
	Parameters   *runtime.RawExtension `json:"parameters,omitempty"`
}

GetServiceInstanceResponse is returned by the server when a service instance is read.

type InputParamtersSchema

type InputParamtersSchema struct {
	Parameters interface{} `json:"parameters,omitempty"`
}

InputParamtersSchema may be provided for a service plan.

type MaintenanceInfo

type MaintenanceInfo struct {
	Version string `json:"version,omitempty"`
}

MaintenanceInfo is submitted by the client to provide versioning information.

func (*MaintenanceInfo) DeepCopy

func (in *MaintenanceInfo) DeepCopy() *MaintenanceInfo

DeepCopy clones a MaintenanceInfo.

type PollServiceInstanceResponse

type PollServiceInstanceResponse struct {
	State       PollState `json:"state"`
	Description string    `json:"description,omitempty"`
}

PollServiceInstanceResponse is returned by the server when an operation is being polled.

type PollState

type PollState string

PollState is returned when an asynchronous request is polled.

const (
	// PollStateInProgress means the async request is still being done.
	PollStateInProgress PollState = "in progress"

	// PollStateInProgress means the async request completed successfully.
	PollStateSucceeded PollState = "succeeded"

	// PollStateFailed means the async request failed.
	PollStateFailed PollState = "failed"
)

type Schemas

type Schemas struct {
	ServiceInstance *ServiceInstanceSchema `json:"service_instance,omitempty"`
	ServiceBinding  *ServiceBindingSchema  `json:"service_binding,omitempty"`
}

Schemas may be provided for a service plan.

type ServiceBindingSchema

type ServiceBindingSchema struct {
	Create *InputParamtersSchema `json:"create,omitempty"`
}

ServiceBindingSchema may be provided for a service plan.

type ServiceCatalog

type ServiceCatalog struct {
	Services []ServiceOffering `json:"services"`
}

ServiceCatalog is returned from /v2/catalog.

type ServiceInstanceSchema

type ServiceInstanceSchema struct {
	Create *InputParamtersSchema `json:"create,omitempty"`
	Update *InputParamtersSchema `json:"update,omitempty"`
}

ServiceInstanceSchema may be provided for a service plan.

type ServiceOffering

type ServiceOffering 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        interface{}      `json:"metadata,omitempty"`
	DashboardClient *DashboardClient `json:"dashboard_client,omitempty"`
	PlanUpdatable   bool             `json:"plan_updatable,omitempty"`
	Plans           []ServicePlan    `json:"plans"`
}

ServiceOffering must be provided by a service catalog.

type ServicePlan

type ServicePlan struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Metadata    interface{} `json:"metadata,omitempty"`
	Free        bool        `json:"free,omitempty"`
	Bindable    *bool       `json:"bindable,omitempty"`
	Schemas     *Schemas    `json:"schemas,omitempty"`
}

ServicePlan must be provided by a service offering.

type UpdateServiceInstanceRequest

type UpdateServiceInstanceRequest struct {
	Context         *runtime.RawExtension                       `json:"context,omitempty"`
	ServiceID       string                                      `json:"service_id"`
	PlanID          string                                      `json:"plan_id,omitempty"`
	Parameters      *runtime.RawExtension                       `json:"parameters,omitempty"`
	PreviousValues  *UpdateServiceInstanceRequestPreviousValues `json:"previous_values,omitempty"`
	MaintenanceInfo *MaintenanceInfo                            `json:"maintenance_info,omitempty"`
}

UpdateServiceInstanceRequest is submitted by the client when updating a service instance.

func (*UpdateServiceInstanceRequest) DeepCopy

DeepCopy clones a UpdateServiceInstanceRequest.

type UpdateServiceInstanceRequestPreviousValues

type UpdateServiceInstanceRequestPreviousValues 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"`
	MaintenanceInfo *MaintenanceInfo `json:"maintenance_info,omitempty"`
}

UpdateServiceInstanceRequestPreviousValues is additional information about the instance prior to an update.

func (*UpdateServiceInstanceRequestPreviousValues) DeepCopy

DeepCopy clones a UpdateServiceInstanceRequestPreviousValues.

type UpdateServiceInstanceResponse

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

UpdateServiceInstanceResponse is returned by the server when updating a service instance.

type VolumeMount

type VolumeMount struct {
	Driver       string `json:"driver"`
	ContainerDir string `json:"container_dir"`
	Mode         string `json:"mode"`
	DeviceType   string `json:"device_type"`
	Device       Device `json:"device"`
}

VolumeMount defines a volume that can be consumed by a client.

Jump to

Keyboard shortcuts

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