instances

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 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 CreateRequest

type CreateRequest struct {
	PlanID       string            `json:"planId,omitempty"`
	InstanceName string            `json:"instanceName,omitempty"`
	Parameters   map[string]string `json:"parameters,omitempty"`
}

CreateRequest holds data for creating instance

type CreateResponse

type CreateResponse struct {
	InstanceID string `json:"instanceId,omitempty"`
}

CreateResponse is the server response for a creation call

type DSAInstancesService

type DSAInstancesService common.Service

DSAInstancesService is the service that manages DSA instances

func New

New returns a new handler for the service

func (*DSAInstancesService) Create

func (svc *DSAInstancesService) Create(ctx context.Context, projectID, instanceName, planID string, parameters map[string]string) (res CreateResponse, w *wait.Handler, err error)

Create creates a new DSA 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/data-services/openapi.v1.html#operation/Instance.provision

func (*DSAInstancesService) Delete

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

Delete deletes a DSA instance and returns a wait handler and error if occurred `Wait()` will wait until the instance is successfully deleted Wait() returns nil on success or Instance if failed and error if it occurred See also https://api.stackit.schwarz/data-services/openapi.v1.html#operation/Instance.deprovision

func (*DSAInstancesService) Get

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

Get returns the instance information by project and instance IDs See also https://api.stackit.schwarz/data-services/openapi.v1.html#operation/Instance.get

func (*DSAInstancesService) List

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

List returns a list of DSA instances in project See also https://api.stackit.schwarz/data-services/openapi.v1.html#operation/Instance.list

func (*DSAInstancesService) Update

func (svc *DSAInstancesService) Update(ctx context.Context, projectID, instanceID, planID string, parameters map[string]string) (res UpdateResponse, w *wait.Handler, err error)

Update updates a DSA 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/data-services/openapi.v1.html#operation/Instance.update

type Instance

type Instance struct {
	InstanceID         string            `json:"instanceId,omitempty"`
	Name               string            `json:"name,omitempty"`
	PlanID             string            `json:"planId,omitempty"`
	DashboardURL       string            `json:"dashboardUrl,omitempty"`
	CFGUID             string            `json:"cfGuid,omitempty"`
	CFSpaceGUID        string            `json:"cfSpaceGuid,omitempty"`
	CFOrganizationGUID string            `json:"cfOrganizationGuid,omitempty"`
	ImageURL           string            `json:"imageUrl,omitempty"`
	Parameters         map[string]string `json:"parameters,omitempty"`
	LastOperation      LastOperation     `json:"lastOperation,omitempty"`
}

Instance is a struct representing an instance

type LastOperation

type LastOperation struct {
	Type        string `json:"type,omitempty"`
	State       string `json:"state,omitempty"`
	Description string `json:"description,omitempty"`
}

LastOperation is a struct representing instance last operation

type ListResponse

type ListResponse struct {
	Instances []Instance `json:"instances,omitempty"`
}

ListResponse represents a list of instances returned from the server

type UpdateRequest

type UpdateRequest struct {
	PlanID     string            `json:"planId,omitempty"`
	Parameters map[string]string `json:"parameters,omitempty"`
}

UpdateRequest holds data for updating instance

type UpdateResponse

type UpdateResponse struct {
	Error       string `json:"error,omitempty"`
	Description string `json:"description,omitempty"`
}

UpdateResponse is the server response for an Update call

Jump to

Keyboard shortcuts

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