Documentation ¶
Index ¶
- func BuildOperationURL(operationID, resourceID, resourceURL string) string
- func BuildURL(baseURL string, q *Parameters) string
- func ExtractBindingID(operationURL string) string
- func ExtractInstanceID(operationURL string) string
- type Client
- type ClientConfig
- type Parameters
- type ProvisionResponse
- type ServiceManagerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOperationURL ¶
func BuildURL ¶
func BuildURL(baseURL string, q *Parameters) string
BuildURL builds the url with provided query parameters
func ExtractBindingID ¶
func ExtractInstanceID ¶
Types ¶
type Client ¶
type Client interface { ListInstances(*Parameters) (*types.ServiceInstances, error) GetInstanceByID(string, *Parameters) (*types.ServiceInstance, error) UpdateInstance(id string, updatedInstance *types.ServiceInstance, serviceName string, planName string, q *Parameters, user string, dataCenter string) (*types.ServiceInstance, string, error) Provision(instance *types.ServiceInstance, serviceName string, planName string, q *Parameters, user string, dataCenter string) (*ProvisionResponse, error) Deprovision(id string, q *Parameters, user string) (string, error) ListBindings(*Parameters) (*types.ServiceBindings, error) GetBindingByID(string, *Parameters) (*types.ServiceBinding, error) Bind(binding *types.ServiceBinding, q *Parameters, user string) (*types.ServiceBinding, string, error) Unbind(id string, q *Parameters, user string) (string, error) RenameBinding(id, newName, newK8SName string) (*types.ServiceBinding, error) ListOfferings(*Parameters) (*types.ServiceOfferings, error) ListPlans(*Parameters) (*types.ServicePlans, error) Status(string, *Parameters) (*types.Operation, error) // Call makes HTTP request to the Service Manager server with authentication. // It should be used only in case there is no already implemented method for such an operation Call(method string, smpath string, body io.Reader, q *Parameters) (*http.Response, error) }
Client should be implemented by SM clients
func NewClient ¶
func NewClient(ctx context.Context, config *ClientConfig, httpClient auth.HTTPClient) (Client, error)
NewClient NewClientWithAuth returns new SM Client configured with the provided configuration
type ClientConfig ¶
type ClientConfig struct { URL string TokenURL string ClientID string ClientSecret string TokenURLSuffix string TLSCertKey string TLSPrivateKey string SSLDisabled bool }
ClientConfig contains the configuration of the Service Manager client
func (ClientConfig) IsValid ¶ added in v0.6.0
func (c ClientConfig) IsValid() bool
type Parameters ¶
Parameters holds common query parameters
func (*Parameters) Encode ¶
func (p *Parameters) Encode() string
Encode encodes the parameters as URL query parameters
type ProvisionResponse ¶ added in v0.1.12
type ServiceManagerError ¶
type ServiceManagerError struct { ErrorType string `json:"error,omitempty"` Description string `json:"description,omitempty"` StatusCode int `json:"-"` BrokerError *common.HTTPStatusCodeError `json:"broker_error,omitempty"` ResponseHeaders http.Header `json:"-"` }
func (*ServiceManagerError) Error ¶
func (e *ServiceManagerError) Error() string
func (*ServiceManagerError) GetStatusCode ¶ added in v0.5.2
func (e *ServiceManagerError) GetStatusCode() int
Click to show internal directories.
Click to hide internal directories.