Documentation ¶
Index ¶
- type ACL
- type CreateRequest
- type CreateResponse
- type Flavor
- type GetResponse
- type Instance
- type ListResponse
- type ListResponseItem
- type PostgresInstancesService
- func (svc *PostgresInstancesService) Create(ctx context.Context, projectID, instanceName, flavorID string, storage Storage, ...) (res CreateResponse, w *wait.Handler, err error)
- func (svc *PostgresInstancesService) Delete(ctx context.Context, projectID, instanceID string) (w *wait.Handler, err error)
- func (svc *PostgresInstancesService) Get(ctx context.Context, projectID, instanceID string) (res GetResponse, err error)
- func (svc *PostgresInstancesService) List(ctx context.Context, projectID string) (res ListResponse, err error)
- func (svc *PostgresInstancesService) Update(ctx context.Context, projectID, instanceID, flavorID string, ...) (res UpdateResponse, w *wait.Handler, err error)
- type Storage
- type UpdateRequest
- type UpdateResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 PostgresInstancesService ¶
PostgresInstancesService is the service that manages Postgres Flex instances
func New ¶
func New(c common.Client) *PostgresInstancesService
New returns a new handler for the service
func (*PostgresInstancesService) Create ¶
func (svc *PostgresInstancesService) 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 Postgres 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 (*PostgresInstancesService) Delete ¶
func (svc *PostgresInstancesService) Delete(ctx context.Context, projectID, instanceID string) (w *wait.Handler, err error)
Delete deletes a Postgres 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 (*PostgresInstancesService) Get ¶
func (svc *PostgresInstancesService) 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 (*PostgresInstancesService) List ¶
func (svc *PostgresInstancesService) List(ctx context.Context, projectID string) (res ListResponse, err error)
List returns a list of Postgres Flex instances in project See also https://api.stackit.schwarz/postgres-flex-service/openapi.html#tag/instance/paths/~1projects~1{projectId}~1instances/get
func (*PostgresInstancesService) Update ¶
func (svc *PostgresInstancesService) 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 Postgres 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 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