draas

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupResource

type BackupResource struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Quota in DB
	Quota int `json:"quota"`
	// Used quota in DB
	UsedQuota float32 `json:"used_quota"`
}

BackupResource represents backup resources for a solution

type BackupService

type BackupService struct {
	Service     string `json:"service"`
	AccountName string `json:"account_name"`
	Gateway     string `json:"gateway"`
	Port        int    `json:"port"`
}

BackupService represents the backup service for a solution

type BillingType

type BillingType struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

BillingType represents a billing type

type BillingTypeNotFoundError

type BillingTypeNotFoundError struct {
	ID string
}

BillingTypeNotFoundError indicates billing type was not found

func (*BillingTypeNotFoundError) Error

func (e *BillingTypeNotFoundError) Error() string

type ComputeResource

type ComputeResource struct {
	ID             string `json:"id"`
	HardwarePlanID string `json:"hardware_plan_id"`
	Memory         struct {
		// Used memory in GB
		Used float32 `json:"used"`
		// Memory limit in GB
		Limit float32 `json:"limit"`
	} `json:"memory"`
	CPU struct {
		Used int `json:"used"`
	} `json:"cpu"`
	Storage []struct {
		Name string `json:"name"`
		// Used storage in GB
		Used int `json:"used"`
		// Storage limit in GB
		Limit int `json:"limit"`
	} `json:"storage"`
}

ComputeResource represents compute resources for a solution

type ComputeResourceNotFoundError

type ComputeResourceNotFoundError struct {
	ID string
}

ComputeResourceNotFoundError indicates compute resources was not found

func (*ComputeResourceNotFoundError) Error

type DRaaSService

type DRaaSService interface {
	GetSolutions(parameters connection.APIRequestParameters) ([]Solution, error)
	GetSolutionsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Solution], error)
	GetSolution(solutionID string) (Solution, error)
	PatchSolution(solutionID string, req PatchSolutionRequest) error

	GetSolutionBackupResources(solutionID string, parameters connection.APIRequestParameters) ([]BackupResource, error)
	GetSolutionBackupResourcesPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[BackupResource], error)

	GetSolutionBackupService(solutionID string) (BackupService, error)
	ResetSolutionBackupServiceCredentials(solutionID string, req ResetBackupServiceCredentialsRequest) error

	GetSolutionFailoverPlans(solutionID string, parameters connection.APIRequestParameters) ([]FailoverPlan, error)
	GetSolutionFailoverPlansPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[FailoverPlan], error)
	GetSolutionFailoverPlan(solutionID string, failoverPlanID string) (FailoverPlan, error)
	StartSolutionFailoverPlan(solutionID string, failoverPlanID string, req StartFailoverPlanRequest) error
	StopSolutionFailoverPlan(solutionID string, failoverPlanID string) error

	GetSolutionComputeResources(solutionID string, parameters connection.APIRequestParameters) ([]ComputeResource, error)
	GetSolutionComputeResourcesPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[ComputeResource], error)
	GetSolutionComputeResource(solutionID string, computeResourcesID string) (ComputeResource, error)

	GetSolutionHardwarePlans(solutionID string, parameters connection.APIRequestParameters) ([]HardwarePlan, error)
	GetSolutionHardwarePlansPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[HardwarePlan], error)
	GetSolutionHardwarePlan(solutionID string, hardwarePlanID string) (HardwarePlan, error)
	GetSolutionHardwarePlanReplicas(solutionID string, hardwarePlanID string, parameters connection.APIRequestParameters) ([]Replica, error)

	UpdateSolutionReplicaIOPS(solutionID string, replicaID string, req UpdateReplicaIOPSRequest) error

	GetIOPSTiers(parameters connection.APIRequestParameters) ([]IOPSTier, error)
	GetIOPSTier(iopsTierID string) (IOPSTier, error)

	GetBillingTypes(parameters connection.APIRequestParameters) ([]BillingType, error)
	GetBillingTypesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[BillingType], error)
	GetBillingType(billingTypeID string) (BillingType, error)
}

DRaaSService is an interface for managing the DRaaS service

type FailoverPlan

type FailoverPlan struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Status      string `json:"status"`
	VMs         []struct {
		Name string `json:"name"`
	} `json:"vms"`
}

FailoverPlan represents a failover plan

type FailoverPlanNotFoundError

type FailoverPlanNotFoundError struct {
	ID string
}

FailoverPlanNotFoundError indicates a failover plan was not found

func (*FailoverPlanNotFoundError) Error

func (e *FailoverPlanNotFoundError) Error() string

type HardwarePlan

type HardwarePlan struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Limits      struct {
		Processor int `json:"processor"`
		Memory    int `json:"memory"`
	} `json:"limits"`
	Networks struct {
		Public  int `json:"public"`
		Private int `json:"private"`
	} `json:"networks"`
	Storage []struct {
		ID    string `json:"id"`
		Name  string `json:"name"`
		Type  string `json:"Type"`
		Quota int    `json:"quota"`
	} `json:"storage"`
}

HardwarePlan represents a hardware plan

type HardwarePlanNotFoundError

type HardwarePlanNotFoundError struct {
	ID string
}

HardwarePlanNotFoundError indicates hardware plan was not found

func (*HardwarePlanNotFoundError) Error

func (e *HardwarePlanNotFoundError) Error() string

type IOPSTier

type IOPSTier struct {
	ID        string `json:"id"`
	IOPSLimit int    `json:"iops_limit"`
}

IOPSTier represents an IOPS tier

type IOPSTierNotFoundError

type IOPSTierNotFoundError struct {
	ID string
}

IOPSTierNotFoundError indicates an IOPS tier was not found

func (*IOPSTierNotFoundError) Error

func (e *IOPSTierNotFoundError) Error() string

type PatchSolutionRequest

type PatchSolutionRequest struct {
	Name       string `json:"name,omitempty"`
	IOPSTierID string `json:"iops_tier_id,omitempty"`
}

PatchSolutionRequest represents a request to patch a solution

type Replica

type Replica struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Platform string `json:"platform"`
	CPU      int    `json:"cpu"`
	RAM      int    `json:"ram"`
	Disk     int    `json:"disk"`
	IOPS     int    `json:"iops"`
	Power    bool   `json:"power"`
}

Replica represents a replica

type ReplicaNotFoundError

type ReplicaNotFoundError struct {
	ID string
}

ReplicaNotFoundError indicates a replica was not found

func (*ReplicaNotFoundError) Error

func (e *ReplicaNotFoundError) Error() string

type ResetBackupServiceCredentialsRequest

type ResetBackupServiceCredentialsRequest struct {
	Password string `json:"password"`
}

ResetBackupServiceCredentialsRequest represents a request to reset backup service credentials

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements DRaaSService for managing DRaaS certificates via the UKFast API

func NewService

func NewService(connection connection.Connection) *Service

NewService returns a new instance of DRaaSService

func (*Service) GetBillingType

func (s *Service) GetBillingType(billingTypeID string) (BillingType, error)

GetBillingType retrieves a single solution by id

func (*Service) GetBillingTypes

func (s *Service) GetBillingTypes(parameters connection.APIRequestParameters) ([]BillingType, error)

GetBillingTypes retrieves a list of solutions

func (*Service) GetBillingTypesPaginated

func (s *Service) GetBillingTypesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[BillingType], error)

GetBillingTypesPaginated retrieves a paginated list of solutions

func (*Service) GetIOPSTier

func (s *Service) GetIOPSTier(iopsTierID string) (IOPSTier, error)

GetIOPSTier retrieves a single solution by id

func (*Service) GetIOPSTiers

func (s *Service) GetIOPSTiers(parameters connection.APIRequestParameters) ([]IOPSTier, error)

GetIOPSTiers retrieves a list of solutions

func (*Service) GetIOPSTiersPaginated

func (s *Service) GetIOPSTiersPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[IOPSTier], error)

GetIOPSTiersPaginated retrieves a paginated list of solutions

func (*Service) GetSolution

func (s *Service) GetSolution(solutionID string) (Solution, error)

GetSolution retrieves a single solution by id

func (*Service) GetSolutionBackupResources

func (s *Service) GetSolutionBackupResources(solutionID string, parameters connection.APIRequestParameters) ([]BackupResource, error)

GetSolutionBackupResources retrieves a collection of backup resources for specified solution

func (*Service) GetSolutionBackupResourcesPaginated

func (s *Service) GetSolutionBackupResourcesPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[BackupResource], error)

GetSolutionsPaginated retrieves a paginated list of solutions

func (*Service) GetSolutionBackupService

func (s *Service) GetSolutionBackupService(solutionID string) (BackupService, error)

GetSolutionBackupService retrieves the backup service for the specified solution

func (*Service) GetSolutionComputeResource

func (s *Service) GetSolutionComputeResource(solutionID string, computeResourceID string) (ComputeResource, error)

GetSolutionComputeResource retrieves compute resources by id

func (*Service) GetSolutionComputeResources

func (s *Service) GetSolutionComputeResources(solutionID string, parameters connection.APIRequestParameters) ([]ComputeResource, error)

GetSolutionComputeResources retrieves a collection of compute resources for specified solution

func (*Service) GetSolutionComputeResourcesPaginated

func (s *Service) GetSolutionComputeResourcesPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[ComputeResource], error)

GetSolutionComputeResourcesPaginated retrieves a paginated list of solution compute resources

func (*Service) GetSolutionFailoverPlan

func (s *Service) GetSolutionFailoverPlan(solutionID string, failoverPlanID string) (FailoverPlan, error)

GetSolutionFailoverPlan retrieves a single solution failover plan by id

func (*Service) GetSolutionFailoverPlans

func (s *Service) GetSolutionFailoverPlans(solutionID string, parameters connection.APIRequestParameters) ([]FailoverPlan, error)

GetSolutionFailoverPlans retrieves a collection of failover plans for specified solution

func (*Service) GetSolutionFailoverPlansPaginated

func (s *Service) GetSolutionFailoverPlansPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[FailoverPlan], error)

GetSolutionsPaginated retrieves a paginated list of solution failover plans

func (*Service) GetSolutionHardwarePlan

func (s *Service) GetSolutionHardwarePlan(solutionID string, hardwarePlanID string) (HardwarePlan, error)

GetSolutionHardwarePlan retrieves hardware plans by id

func (*Service) GetSolutionHardwarePlanReplicas

func (s *Service) GetSolutionHardwarePlanReplicas(solutionID string, hardwarePlanID string, parameters connection.APIRequestParameters) ([]Replica, error)

GetSolutionHardwarePlanReplicas retrieves a collection of hardware plans for specified solution

func (*Service) GetSolutionHardwarePlanReplicasPaginated

func (s *Service) GetSolutionHardwarePlanReplicasPaginated(solutionID string, hardwarePlanID string, parameters connection.APIRequestParameters) (*connection.Paginated[Replica], error)

GetSolutionHardwarePlanReplicasPaginated retrieves a paginated list of solution hardware plans

func (*Service) GetSolutionHardwarePlans

func (s *Service) GetSolutionHardwarePlans(solutionID string, parameters connection.APIRequestParameters) ([]HardwarePlan, error)

GetSolutionHardwarePlans retrieves a collection of hardware plans for specified solution

func (*Service) GetSolutionHardwarePlansPaginated

func (s *Service) GetSolutionHardwarePlansPaginated(solutionID string, parameters connection.APIRequestParameters) (*connection.Paginated[HardwarePlan], error)

GetSolutionHardwarePlansPaginated retrieves a paginated list of solution hardware plans

func (*Service) GetSolutions

func (s *Service) GetSolutions(parameters connection.APIRequestParameters) ([]Solution, error)

GetSolutions retrieves a list of solutions

func (*Service) GetSolutionsPaginated

func (s *Service) GetSolutionsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Solution], error)

GetSolutionsPaginated retrieves a paginated list of solutions

func (*Service) PatchSolution

func (s *Service) PatchSolution(solutionID string, req PatchSolutionRequest) error

PatchSolution patches a solution by ID

func (*Service) ResetSolutionBackupServiceCredentials

func (s *Service) ResetSolutionBackupServiceCredentials(solutionID string, req ResetBackupServiceCredentialsRequest) error

ResetSolutionBackupServiceCredentials resets the credentials for the solution backup service

func (*Service) StartSolutionFailoverPlan

func (s *Service) StartSolutionFailoverPlan(solutionID string, failoverPlanID string, req StartFailoverPlanRequest) error

StartSolutionFailoverPlan starts the specified failover plan

func (*Service) StopSolutionFailoverPlan

func (s *Service) StopSolutionFailoverPlan(solutionID string, failoverPlanID string) error

StopSolutionFailoverPlan stops the specified failover plan

func (*Service) UpdateSolutionReplicaIOPS

func (s *Service) UpdateSolutionReplicaIOPS(solutionID string, replicaID string, req UpdateReplicaIOPSRequest) error

UpdateSolutionReplicaIOPS updates a solution replica by ID

type Solution

type Solution struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	IOPSTierID    string `json:"iops_tier_id"`
	BillingTypeID string `json:"billing_type_id"`
}

Solution represents a solution

type SolutionNotFoundError

type SolutionNotFoundError struct {
	ID string
}

SolutionNotFoundError indicates a solution was not found

func (*SolutionNotFoundError) Error

func (e *SolutionNotFoundError) Error() string

type StartFailoverPlanRequest

type StartFailoverPlanRequest struct {
	StartDate connection.DateTime `json:"start_date,omitempty"`
}

StartFailoverPlanRequest represents a request to start a failover plan

type UpdateReplicaIOPSRequest

type UpdateReplicaIOPSRequest struct {
	IOPSTierID string `json:"iops_tier_id"`
}

UpdateReplicaIOPSRequest represents a request to update the IOPS for a replica

Jump to

Keyboard shortcuts

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