client

package
v4.2.0-rc+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// ClientsBrokerApiVersion is the minimum supported version of the client.
	// Note: This may need to be changed in the future as we use newer versions
	// of the OSB API, but should be kept near the lower end of the systems we
	// expect to be compatible with to ensure any reverse-compatibility measures
	// put in place work.
	ClientsBrokerApiVersion = "2.13"
)

Variables

This section is empty.

Functions

func RunExample

func RunExample(client *Client, example broker.ServiceExample, service *broker.ServiceDefinition) error

RunExample runs a single example against the given service on the broker pointed to by client.

func RunExamplesForService

func RunExamplesForService(registry broker.BrokerRegistry, client *Client, serviceName string) error

RunExamplesForService runs all the exmaples for a given service name against the service broker pointed to by client. All examples in the registry get run if serviceName is blank.

Types

type BrokerResponse

type BrokerResponse struct {
	// WARNING: BrokerResponse is exposed to users and automated tooling
	// so DO NOT remove or rename fields unless strictly necessary.
	// You MAY add new fields.
	Error        error           `json:"error,omitempty"`
	Url          string          `json:"url,omitempty"`
	Method       string          `json:"http_method,omitempty"`
	StatusCode   int             `json:"status_code,omitempty"`
	ResponseBody json.RawMessage `json:"response,omitempty"`
}

BrokerResponse encodes an OSB HTTP response in a (technical) human and machine readable way.

func (*BrokerResponse) InError

func (br *BrokerResponse) InError() bool

func (*BrokerResponse) String

func (br *BrokerResponse) String() string

func (*BrokerResponse) UpdateError

func (br *BrokerResponse) UpdateError(err error)

func (*BrokerResponse) UpdateRequest

func (br *BrokerResponse) UpdateRequest(req *http.Request)

func (*BrokerResponse) UpdateResponse

func (br *BrokerResponse) UpdateResponse(res *http.Response)

type Client

type Client struct {
	BaseUrl *url.URL
}

func New

func New(username, password, hostname string, port int) (*Client, error)

New creates a new OSB Client connected to the given resource.

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv creates a new client from the client configuration properties.

func (*Client) Bind

func (client *Client) Bind(instanceId, bindingId, serviceId, planId string, parameters json.RawMessage) *BrokerResponse

Bind creates an account identified by bindingId and gives it access to instanceId

func (*Client) Catalog

func (client *Client) Catalog() *BrokerResponse

Catalog fetches the service catalog

func (*Client) Deprovision

func (client *Client) Deprovision(instanceId, serviceId, planId string) *BrokerResponse

Deprovision destroys a service instance of type instanceId

func (*Client) LastOperation

func (client *Client) LastOperation(instanceId string) *BrokerResponse

LastOperation queries the status of a long-running job on the server

func (*Client) Provision

func (client *Client) Provision(instanceId, serviceId, planId string, provisioningDetails json.RawMessage) *BrokerResponse

Provision creates a new service with the given instanceId, of type serviceId, from the plan planId, with additional details provisioningDetails

func (*Client) Unbind

func (client *Client) Unbind(instanceId, bindingId, serviceId, planId string) *BrokerResponse

Unbind destroys an account identified by bindingId

func (*Client) Update

func (client *Client) Update(instanceId, serviceId, planId string, parameters json.RawMessage) *BrokerResponse

Update sends a patch request to change the plan

Jump to

Keyboard shortcuts

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