api

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIVersion = "2.14"

Variables

View Source
var DefaultStorePath string

Functions

This section is empty.

Types

type BindSpec

type BindSpec struct {
	InstanceID string `json:"-"`
	BindingID  string `json:"-"`

	Context    map[string]interface{} `json:"context"`
	ServiceID  string                 `json:"service_id"`
	PlanID     string                 `json:"plan_id"`
	Parameters map[string]interface{} `json:"parameters"`
}

type BindStatus

type BindStatus struct {
	InstanceID string `json:"-"`
	BindingID  string `json:"-"`
	Status     string `json:"-"`

	Operation       string                 `json:"operation"`
	Credentials     map[string]interface{} `json:"credentials"`
	SyslogDrainURL  string                 `json:"syslog_drain_url"`
	RouteServiceURL string                 `json:"route_service_url"`
	VolumeMounts    []struct {
		Driver       string `json:"driver"`
		ContainerDir string `json:"container_dir"`
		Mode         string `json:"mode"`
		DeviceType   string `json:"device_type"`
		Device       struct {
			VolumeID    string                 `json:"volume_id"`
			MountConfig map[string]interface{} `json:"mount_config"`
		} `json:"device"`
	} `json:"volume_mounts"`
}

type Catalog

type Catalog struct {
	Services []struct {
		ID          string `json:"id"`
		Name        string `json:"name"`
		Description string `json:"description"`

		Tags     []string `json:"tags,omitempty"`
		Requires []string `json:"requires,omitempty"`

		Bindable             bool `json:"bindable"`
		InstancesRetrievable bool `json:"instances_retrievable"`
		BindingsRetrievable  bool `json:"bindings_retrievable"`
		PlanUpdateable       bool `json:"plan_updateable"`

		Metadata interface{} `json:"metadata,omitempty"`

		DashboardClient *struct {
			ID          string `json:"id"`
			Secret      string `json:"secret"`
			RedirectURI string `json:"redirect_uri"`
		} `json:"dashboard_client,omitempty"`

		Plans []struct {
			ID          string `json:"id"`
			Name        string `json:"name"`
			Description string `json:"description"`

			MaybeFree *bool `json:"free"`
			Free      bool  `json:"-"`

			MaybeBindable *bool `json:"bindable"`
			Bindable      bool  `json:"bindable"`

			Metadata interface{} `json:"metadata,omitempty"`

			Schemas struct {
				ServiceInstance struct {
					Create struct {
						Parameters map[string]interface{} `json:"parameters"`
					} `json:"create"`
					Update struct {
						Parameters map[string]interface{} `json:"parameters"`
					} `json:"update"`
				} `json:"service_instance"`
				ServiceBinding struct {
					Create struct {
						Parameters map[string]interface{} `json:"parameters"`
					} `json:"create"`
				} `json:"service_binding"`
			} `json:"schemas,omitempty"`
		} `json:"plans,omitempty"`
	} `json:"services,omitempty"`
}

func (Catalog) FindPlan

func (cat Catalog) FindPlan(service, plan string) (string, string, error)

type Client

type Client struct {
	URL        string
	Username   string
	Password   string
	SkipVerify bool
	Timeout    int

	Debug bool
	Trace bool

	APIVersion string
	// contains filtered or unexported fields
}

func (*Client) Bind

func (c *Client) Bind(spec BindSpec) (*BindStatus, error)

func (*Client) Deprovision

func (c *Client) Deprovision(spec DeprovisionSpec) (*DeprovisionStatus, error)

func (*Client) GetCatalog

func (c *Client) GetCatalog() (*Catalog, error)

func (*Client) Provision

func (c *Client) Provision(id string, spec ProvisionSpec) (*ProvisionStatus, error)

func (*Client) Unbind

func (c *Client) Unbind(spec UnbindSpec) (*UnbindStatus, error)

type DeprovisionSpec added in v0.1.1

type DeprovisionSpec struct {
	InstanceID string
	ServiceID  string
	PlanID     string
}

type DeprovisionStatus

type DeprovisionStatus struct {
	Status string `json:"-"`

	Operation string `json:"operation"`
}

type Error

type Error struct {
	HTTP        string
	Description string `json:"description"`
}

func (Error) Error

func (e Error) Error() string

type ProvisionSpec

type ProvisionSpec struct {
	ServiceID string `json:"service_id"`
	PlanID    string `json:"plan_id"`

	Context          map[string]interface{} `json:"context"`
	OrganizationGUID string                 `json:"organization_guid"`
	SpaceGUID        string                 `json:"space_guid"`

	Parameters map[string]interface{} `json:"parameters"`
}

type ProvisionStatus

type ProvisionStatus struct {
	InstanceID string `json:"-"`
	Status     string `json:"-"`

	DashboardURL string `json:"dashboard_url"`
	Operation    string `json:"operation"`
}

type Store

type Store struct {
	Data []broker `yaml:"data"`
}

func ReadStore

func ReadStore(path string) (*Store, error)

func (*Store) AddBinding

func (s *Store) AddBinding(url, id, bid string, creds map[string]interface{})

func (*Store) AddInstance

func (s *Store) AddInstance(url, id, service, plan string)

func (*Store) GetBindingDetails

func (s *Store) GetBindingDetails(url, id string) (string, string, string, error)

func (*Store) GetInstanceDetails

func (s *Store) GetInstanceDetails(url, id string) (string, string, error)

func (*Store) RemoveBinding

func (s *Store) RemoveBinding(url, id, bid string)

func (*Store) RemoveInstance

func (s *Store) RemoveInstance(url, id string)

func (*Store) Write

func (s *Store) Write(path string) error

type UnbindSpec

type UnbindSpec struct {
	InstanceID string `json:"-"`
	BindingID  string `json:"-"`

	Context    map[string]interface{} `json:"context"`
	ServiceID  string                 `json:"service_id"`
	PlanID     string                 `json:"plan_id"`
	Parameters map[string]interface{} `json:"parameters"`
}

type UnbindStatus

type UnbindStatus struct {
	InstanceID string `json:"-"`
	BindingID  string `json:"-"`
	Status     string `json:"-"`

	Operation string `json:"operation"`
}

Jump to

Keyboard shortcuts

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