instances

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Items []string `json:"items"`
}

ACL is the access list

type CreateRequest

type CreateRequest struct {
	ACL            ACL               `json:"acl"`
	BackupSchedule string            `json:"backupSchedule"`
	FlavorID       string            `json:"flavorId"`
	Labels         map[string]string `json:"labels"`
	Name           string            `json:"name"`
	Options        map[string]string `json:"options"`
	Replicas       int               `json:"replicas"`
	Storage        Storage           `json:"storage"`
	Version        string            `json:"version"`
}

CreateRequest holds data for requesting new instance

type CreateResponse

type CreateResponse struct {
	ID string `json:"id,omitempty"`
}

CreateResponse is the server response when creating a new Instance

type Flavor

type Flavor struct {
	ID          string   `json:"id,omitempty"`
	Description string   `json:"description,omitempty"`
	Categories  []string `json:"categories,omitempty"`
	CPU         int      `json:"cpu,omitempty"`
	Memory      int      `json:"memory,omitempty"`
}

Flavor is a signle falvor struct

type GetResponse

type GetResponse struct {
	Item Instance `json:"item,omitempty"`
}

GetResponse is the server response for Get call

type Instance

type Instance struct {
	ACL            ACL     `json:"acl,omitempty"`
	BackupSchedule string  `json:"backupSchedule,omitempty"`
	Flavor         Flavor  `json:"flavor,omitempty"`
	ID             string  `json:"id,omitempty"`
	Name           string  `json:"name,omitempty"`
	ProjectID      string  `json:"projectId,omitempty"`
	Replicas       int     `json:"replicas,omitempty"`
	Status         string  `json:"status,omitempty"`
	Storage        Storage `json:"storage,omitempty"`
	Users          []User  `json:"users,omitempty"`
	Version        string  `json:"version,omitempty"`
}

Instance is a struct representing an instance item

type ListResponse

type ListResponse struct {
	Count int                `json:"count,omitempty"`
	Items []ListResponseItem `json:"items,omitempty"`
}

ListResponse represents a list of instances returned from the server

type ListResponseItem

type ListResponseItem struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	ProjectID string `json:"projectId,omitempty"`
}

ListResponseItem is an item in the response item list

type MongoDBInstancesService

type MongoDBInstancesService common.Service

MongoDBInstancesService is the service that manages MongoDB Flex instances

func New

New returns a new handler for the service

func (*MongoDBInstancesService) Create

func (svc *MongoDBInstancesService) Create(ctx context.Context, projectID, instanceName, flavorID string,
	storage Storage, version string, replicas int,
	backupSchedule string, labels, options map[string]string, acl ACL,
) (res CreateResponse, w *wait.Handler, err error)

Create creates a new MongoDB instance and returns the server response (CreateResponse) and a wait handler which upon call to `Wait()` will wait until the instance is successfully created Wait() returns the full instance details (Instance) and error if it occurred See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances/post

func (*MongoDBInstancesService) Delete

func (svc *MongoDBInstancesService) Delete(ctx context.Context, projectID, instanceID string) (w *wait.Handler, err error)

Delete deletes a MongoDB instance and returns a wait handler and error if occurred `Wait()` will wait until the instance is successfully deleted Wait() returns nil (empty response from server) and error if it occurred See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances~1{instanceId}/put

func (*MongoDBInstancesService) Get

func (svc *MongoDBInstancesService) Get(ctx context.Context, projectID, instanceID string) (res GetResponse, err error)

Get returns the instance information by project and instance IDs See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances~1{instanceId}/get

func (*MongoDBInstancesService) List

func (svc *MongoDBInstancesService) List(ctx context.Context, projectID string) (res ListResponse, err error)

List returns a list of MongoDB Flex instances in project See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances/get

func (*MongoDBInstancesService) Update

func (svc *MongoDBInstancesService) Update(ctx context.Context, projectID, instanceID, flavorID string,
	backupSchedule string, labels, options map[string]string, acl ACL,
) (res UpdateResponse, w *wait.Handler, err error)

Update updates a MongoDB instance and returns the server response (UpdateResponse) and a wait handler which upon call to `Wait()` will wait until the instance is successfully updated Wait() returns the full instance details (Instance) and error if it occurred See also https://api.stackit.schwarz/mongo-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances~1{instanceId}/put

type Storage

type Storage struct {
	Class string `json:"class"`
	Size  int    `json:"size"`
}

Storage represents the instance storage configuration

type UpdateRequest

type UpdateRequest struct {
	ACL            ACL               `json:"acl"`
	BackupSchedule string            `json:"backupSchedule"`
	FlavorID       string            `json:"flavorId"`
	Labels         map[string]string `json:"labels"`
	Options        map[string]string `json:"options"`
}

UpdateRequest holds data for updating instance

type UpdateResponse

type UpdateResponse struct {
	Item Instance `json:"item,omitempty"`
}

UpdateResponse is the server response for an Update call

type User

type User struct {
	Database string   `json:"database,omitempty"`
	Hostname string   `json:"hostname,omitempty"`
	ID       string   `json:"id,omitempty"`
	Password string   `json:"password,omitempty"`
	Port     int      `json:"port,omitempty"`
	Roles    []string `json:"roles,omitempty"`
	URI      string   `json:"uri,omitempty"`
	Username string   `json:"username,omitempty"`
}

User represents a user with access to the database

Jump to

Keyboard shortcuts

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