sbcli

package
v0.0.0-...-d4ea20e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFile = ".sb"
)
View Source
const (
	UsageText = "NAME:\n" +
		"   sb - A command line tool to interact with a9s Service Broker\n" +
		"USAGE:\n" +
		"   sb [global options] command [arguments...] [command options]\n"
)

Variables

This section is empty.

Functions

func Api

func Api(cmd *Commandline)

func Auth

func Auth(cmd *Commandline)

func CheckErr

func CheckErr(err error, helpTexts ...string)

func CleanTargetURI

func CleanTargetURI(uri string) string

func CreateService

func CreateService(cmd *Commandline)

func CreateServiceKey

func CreateServiceKey(cmd *Commandline)

func DeleteService

func DeleteService(cmd *Commandline)

func DeleteServiceKey

func DeleteServiceKey(cmd *Commandline)

func FindService

func FindService(cmd *Commandline)

func GetHelpText

func GetHelpText(command string) string

func GetUUID

func GetUUID() string

func Login

func Login(cmd *Commandline)

func Logout

func Logout(cmd *Commandline)

retreieves all service instances from the service broker

func Marketplace

func Marketplace(cmd *Commandline)

retrieves the available service plans from the service broker

func Service

func Service(cmd *Commandline)

func ServiceKeys

func ServiceKeys(cmd *Commandline)

func Services

func Services(cmd *Commandline)

retreieves all service instances from the service broker

func UpdateService

func UpdateService(cmd *Commandline)

Types

type BindPayload

type BindPayload struct {
	ServiceID  string      `json:"service_id"`
	PlanID     string      `json:"plan_id"`
	Parameters interface{} `json:"parameters"`
}

type Catalog

type Catalog struct {
	Services        []CatalogService `json:"services"`
	DashboardClient interface{}      `json:"dashboard_client"`
}

type CatalogService

type CatalogService struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Bindable    bool          `json:"bindable"`
	Tags        []string      `json:"tags"`
	Plans       []ServicePlan `json:"plans"`
	Metadata    struct {
	} `json:"metadata"`
	Requires       []interface{} `json:"requires"`
	PlanUpdateable bool          `json:"plan_updateable"`
}

type Commandline

type Commandline struct {
	Executable        string
	Command           string
	Options           []string
	NoOptions         bool
	Force             bool
	Plan              string
	Tags              string
	Custom            string
	JSON              bool
	NoFilter          bool
	SkipSslValidation bool
	Api               string
	Username          string
}

func NewCommandline

func NewCommandline(options []string) *Commandline

func (*Commandline) Parse

func (c *Commandline) Parse(options []string) (err error)

type Config

type Config struct {
	Credentials
}

func LoadConfig

func LoadConfig() *Config

type ContextPaylod

type ContextPaylod struct {
	OrganizationID string `json:"organization_id"`
	SpaceID        string `json:"space_id"`
}

type Credential

type Credential struct {
	ID           int    `json:"id"`
	InstanceID   int    `json:"instance_id"`
	GUIDAtTenant string `json:"guid_at_tenant"`
}

type Credentials

type Credentials struct {
	Host              string `json:"host"`
	Username          string `json:"username"`
	Password          string `json:"password"`
	SkipSslValidation bool   `json:"skip_ssl_validation"`
}

type CustomPaylod

type CustomPaylod struct {
	Parameters interface{} `json:"parameters"`
}

type InstanceResource

type InstanceResource struct {
	ID             int          `json:"id"`
	PlanGUID       string       `json:"plan_guid"`
	ServiceGUID    string       `json:"service_guid"`
	Metadata       Metadata     `json:"metadata"`
	DashboardURL   interface{}  `json:"dashboard_url"`
	DeploymentName interface{}  `json:"deployment_name"`
	State          string       `json:"state"`
	GUIDAtTenant   string       `json:"guid_at_tenant"`
	TenantID       string       `json:"tenant_id"`
	ProvisionedAt  string       `json:"provisioned_at"`
	DeletedAt      string       `json:"deleted_at"`
	CreatedAt      string       `json:"created_at"`
	UpdatedAt      string       `json:"updated_at"`
	Credentials    []Credential `json:"credentials"`
	VMDetails      interface{}  `json:"vm_details"`
}

type Instances

type Instances struct {
	TotalResults int                `json:"total_results"`
	TotalPages   int                `json:"total_pages"`
	CurrentPage  int                `json:"current_page"`
	PrevURL      interface{}        `json:"prev_url"`
	NextURL      interface{}        `json:"next_url"`
	Resources    []InstanceResource `json:"resources"`
}

type LastState

type LastState struct {
	State       string `json:"state"`
	Description string `json:"description"`
}

type Metadata

type Metadata struct {
	InstanceGUIDAtTenant string      `json:"instance_guid_at_tenant"`
	UserParams           interface{} `json:"user_params"`
	PlanGUID             string      `json:"plan_guid"`
	TenantID             string      `json:"tenant_id"`
	OrganizationGUID     string      `json:"organization_guid"`
	SpaceGUID            string      `json:"space_guid"`
}

type PreviousUpdateValues

type PreviousUpdateValues struct {
	PlanID         string `json:"plan_id"`
	ServiceID      string `json:"service_id"`
	OrganizationID string `json:"organization_id"`
	SpaceID        string `json:"space_id"`
}

type ProvisonPayload

type ProvisonPayload struct {
	OrganizationGUID string        `json:"organization_guid"`
	PlanID           string        `json:"plan_id"`
	ServiceID        string        `json:"service_id"`
	SpaceGUID        string        `json:"space_guid"`
	Parameters       interface{}   `json:"parameters"`
	Context          ContextPaylod `json:"context"`
}

type SBClient

type SBClient struct {
	Credentials
}

func NewSBClient

func NewSBClient(cred ...*Credentials) *SBClient

creates the Servicebroker client, in later version the user credentials should be read out of a file

func (*SBClient) Bind

func (s *SBClient) Bind(data *BindPayload, instanceID string, bindID string) (string, error)

func (*SBClient) Catalog

func (s *SBClient) Catalog() (*Catalog, error)

func (*SBClient) Deprovision

func (s *SBClient) Deprovision(data *BindPayload, instanceID string) error

func (*SBClient) Instance

func (s *SBClient) Instance(instanceId string) (*InstanceResource, error)

func (*SBClient) Instances

func (s *SBClient) Instances() (*Instances, error)

func (*SBClient) Provision

func (s *SBClient) Provision(data *ProvisonPayload, instanceID string) error

func (*SBClient) SetCredentials

func (s *SBClient) SetCredentials(c Credentials)

func (*SBClient) TestConnection

func (s *SBClient) TestConnection() error

func (*SBClient) UnBind

func (s *SBClient) UnBind(data *BindPayload, instanceID string, bindID string) error

func (*SBClient) UpdateService

func (s *SBClient) UpdateService(data *UpdatePayload, instanceID string) error

type SBCommand

type SBCommand struct {
	Name     string
	Shortcut string
	Helptext string
	Function SBFunction
}

type SBError

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

type SBFunction

type SBFunction func(*Commandline)

type ServicePlan

type ServicePlan struct {
	ID          string      `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Metadata    interface{} `json:"metadata"`
	Free        bool        `json:"free"`
}

type UpdatePayload

type UpdatePayload struct {
	ServiceID      string               `json:"service_id"`
	PlanID         string               `json:"plan_id"`
	Parameters     interface{}          `json:"parameters"`
	PreviousValues PreviousUpdateValues `json:"previous_values"`
	Context        ContextPaylod        `json:"context"`
}

type VMDetails

type VMDetails struct {
	VMIdentifier   string      `json:"vm_identifier"`
	CPU            interface{} `json:"cpu"`
	EphemeralDisk  interface{} `json:"ephemeral_disk"`
	PersistentDisk interface{} `json:"persistent_disk"`
	Memory         interface{} `json:"memory"`
	InstanceType   string      `json:"instance_type"`
	Hostname       string      `json:"hostname"`
	Role           interface{} `json:"role"`
}

Jump to

Keyboard shortcuts

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