aiven

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstanceDoesNotExist = errors.New("Error: service instance does not exist")
View Source
var ErrInstanceUserDoesNotExist = errors.New("Error: service instance user does not exist")

Functions

This section is empty.

Types

type AivenErrorResponse

type AivenErrorResponse struct {
	Errors []struct {
		Message string `json:"message"`
		Status  int    `json:"status"`
	} `json:"errors"`
	Message string `json:"message"`
}

type Client

type Client interface {
	CreateService(params *CreateServiceInput) (string, error)
	GetService(params *GetServiceInput) (*Service, error)
	GetServiceTags(params *GetServiceTagsInput) (*ServiceTags, error)
	DeleteService(params *DeleteServiceInput) error
	CreateServiceUser(params *CreateServiceUserInput) (string, error)
	DeleteServiceUser(params *DeleteServiceUserInput) (string, error)
	UpdateService(params *UpdateServiceInput) (string, error)
	UpdateServiceTags(params *UpdateServiceTagsInput) (string, error)
	ForkService(params *ForkServiceInput) (string, error)
}

type CommonUserConfig added in v0.22.0

type CommonUserConfig struct {
	IPFilter          []string `json:"ip_filter,omitempty"`
	ForkProject       string   `json:"project_to_fork_from,omitempty"`
	BackupServiceName string   `json:"service_to_fork_from,omitempty"`
	BackupName        string   `json:"recovery_basebackup_name,omitempty"`
}

type CreateServiceInput

type CreateServiceInput struct {
	Cloud       string      `json:"cloud,omitempty"`
	GroupName   string      `json:"group_name,omitempty"`
	Plan        string      `json:"plan,omitempty"`
	ServiceName string      `json:"service_name"`
	ServiceType string      `json:"service_type"`
	UserConfig  UserConfig  `json:"user_config"`
	Tags        ServiceTags `json:"tags"`
}

type CreateServiceUserInput

type CreateServiceUserInput struct {
	ServiceName string `json:"-"`
	Username    string `json:"username"`
}

type CreateServiceUserResponse

type CreateServiceUserResponse struct {
	Message string `json:"message"`
	User    User   `json:"user"`
}

type DeleteServiceInput

type DeleteServiceInput struct {
	ServiceName string
}

type DeleteServiceUserInput

type DeleteServiceUserInput struct {
	ServiceName string
	Username    string
}

type ErrInvalidUpdate

type ErrInvalidUpdate struct {
	Message string
}

func (ErrInvalidUpdate) Error

func (p ErrInvalidUpdate) Error() string

type ForkServiceInput added in v0.38.0

type ForkServiceInput struct {
	Cloud       string      `json:"cloud,omitempty"`
	GroupName   string      `json:"group_name,omitempty"`
	Plan        string      `json:"plan,omitempty"`
	ServiceName string      `json:"service_name"`
	ServiceType string      `json:"service_type"`
	UserConfig  UserConfig  `json:"user_config"`
	Tags        ServiceTags `json:"tags"`
}

type GetServiceInput

type GetServiceInput struct {
	ServiceName string
}

type GetServiceResponse

type GetServiceResponse struct {
	Service Service `json:"service"`
}

type GetServiceTagsInput added in v0.38.0

type GetServiceTagsInput struct {
	ServiceName string
}

type GetServiceTagsResponse added in v0.38.0

type GetServiceTagsResponse struct {
	Tags ServiceTags `json:""`
}

type HttpClient

type HttpClient struct {
	BaseURL string
	Token   string
	Project string

	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(baseURL, token, project string, logger lager.Logger) *HttpClient

func (*HttpClient) CreateService

func (a *HttpClient) CreateService(params *CreateServiceInput) (string, error)

func (*HttpClient) CreateServiceUser

func (a *HttpClient) CreateServiceUser(params *CreateServiceUserInput) (string, error)

func (*HttpClient) DeleteService

func (a *HttpClient) DeleteService(params *DeleteServiceInput) error

func (*HttpClient) DeleteServiceUser

func (a *HttpClient) DeleteServiceUser(params *DeleteServiceUserInput) (string, error)

func (*HttpClient) ForkService added in v0.38.0

func (a *HttpClient) ForkService(params *ForkServiceInput) (string, error)

func (*HttpClient) GetService added in v0.22.0

func (a *HttpClient) GetService(params *GetServiceInput) (*Service, error)

func (*HttpClient) GetServiceTags added in v0.38.0

func (a *HttpClient) GetServiceTags(params *GetServiceTagsInput) (*ServiceTags, error)

func (*HttpClient) UpdateService

func (a *HttpClient) UpdateService(params *UpdateServiceInput) (string, error)

func (*HttpClient) UpdateServiceTags added in v0.38.0

func (a *HttpClient) UpdateServiceTags(params *UpdateServiceTagsInput) (string, error)

type InfluxDBUserConfig added in v0.22.0

type InfluxDBUserConfig struct{}

type OpenSearchUserConfig added in v0.38.0

type OpenSearchUserConfig struct {
	OpenSearchVersion string `json:"opensearch_version,omitempty"`
}

type Service

type Service struct {
	State            ServiceStatus    `json:"state"`
	UpdateTime       time.Time        `json:"update_time"`
	ServiceUriParams ServiceUriParams `json:"service_uri_params"`
	ServiceType      string           `json:"service_type"`
	Backups          []ServiceBackup  `json:"backups"`
	Plan             string           `json:"plan"`
}

type ServiceBackup added in v0.38.0

type ServiceBackup struct {
	Name string    `json:"backup_name"`
	Time time.Time `json:"backup_time"`
	Size int       `json:"data_size"`
}

type ServiceStatus

type ServiceStatus string
const (
	Running     ServiceStatus = "RUNNING"
	Rebuilding  ServiceStatus = "REBUILDING"
	Rebalancing ServiceStatus = "REBALANCING"
	PowerOff    ServiceStatus = "POWEROFF"
	Missing     ServiceStatus = "MISSING"
)

type ServiceTags added in v0.38.0

type ServiceTags struct {
	DeployEnv          string    `json:"deploy_env"`
	ServiceID          string    `json:"service_id"`
	PlanID             string    `json:"plan_id"`
	OrganizationID     string    `json:"organization_id"`
	SpaceID            string    `json:"space_id"`
	BrokerName         string    `json:"broker_name"`
	RestoredFromBackup string    `json:"restored_from_backup"`
	OriginServiceID    string    `json:"restored_from_service"`
	RestoredFromTime   time.Time `json:"restored_from_time"`
}

type ServiceUriParams

type ServiceUriParams struct {
	Host     string `json:"host"`
	Password string `json:"password"`
	Port     string `json:"port"`
	User     string `json:"user"`
}

type UpdateServiceInput

type UpdateServiceInput struct {
	ServiceName string     `json:"-"`
	Plan        string     `json:"plan,omitempty"`
	UserConfig  UserConfig `json:"user_config"`
}

type UpdateServiceTagsInput added in v0.38.0

type UpdateServiceTagsInput struct {
	ServiceName string      `json:"-"`
	Tags        ServiceTags `json:"tags"`
}

type User

type User struct {
	Password string `json:"password"`
	Type     string `json:"type"`
	Username string `json:"username"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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