cloud

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package cloud documents the request and response payloads for version 2 of the sifi API.

Index

Constants

View Source
const (
	PathPrefix = "cloud"

	AccessControlListPath = "acl"
	ClusterPath           = "cluster"
	DataCenterPath        = "datacenter"
	DatastorePath         = "datastore"
	DocumentPath          = "document"
	GroupPath             = "group"
	HookPath              = "hook"
	HostPath              = "host"
	ImagePath             = "image"
	InstanceGroupPath     = "instance-group"
	InstancePath          = "instance"
	MarketPath            = "market"
	NetworkPath           = "network"
	RouterPath            = "router"
	SecurityGroupPath     = "security-group"
	SystemPath            = "system"
	TemplatePath          = "template"
	UserPath              = "user"
	ZonePath              = "zone"
)

Root path for API endpoint.

Variables

This section is empty.

Functions

func DatastoreStateStrings

func DatastoreStateStrings() []string

DatastoreStateStrings returns a slice of all String values of the enum

func DatastoreTypeStrings

func DatastoreTypeStrings() []string

DatastoreTypeStrings returns a slice of all String values of the enum

func FilterStrings

func FilterStrings() []string

FilterStrings returns a slice of all String values of the enum

func ImageTypeStrings

func ImageTypeStrings() []string

ImageTypeStrings returns a slice of all String values of the enum

func InstanceRecoveryStrings

func InstanceRecoveryStrings() []string

InstanceRecoveryStrings returns a slice of all String values of the enum

func LCMStateStrings

func LCMStateStrings() []string

LCMStateStrings returns a slice of all String values of the enum

func LockLevelStrings

func LockLevelStrings() []string

LockLevelStrings returns a slice of all String values of the enum

func MigrationTypeStrings

func MigrationTypeStrings() []string

MigrationTypeStrings returns a slice of all String values of the enum

func NetworkRecoveryStrings

func NetworkRecoveryStrings() []string

NetworkRecoveryStrings returns a slice of all String values of the enum

func StatusStrings

func StatusStrings() []string

StatusStrings returns a slice of all String values of the enum

Types

type ACL

type ACL struct {
	ID int `json:"id" yaml:"id"`
	//           32 bits                 32 bits
	//  +-----------------------+-----------------------+
	//  | Type (user,group,all) | user/group ID         |
	//  +-----------------------+-----------------------+
	User int64 `json:"user" yaml:"user"`
	//           32 bits                 32 bits
	//  +-----------------------+-----------------------+
	//  | Type (VM, Host...)    | resource ID           |
	//  +-----------------------+-----------------------+
	Resource int64 `json:"resource" yaml:"resource"`
	//                      64 bits
	//  +-----------------------------------------------+
	//  | Actions (MANAGE, CREATE, USE...               |
	//  +-----------------------------------------------+
	Rights int64 `json:"rights" yaml:"rights"`
	//           32 bits                 32 bits
	//  +-----------------------+-----------------------+
	//  | Type (individual,all) | zone ID               |
	//  +-----------------------+-----------------------+
	Zone   int64  `json:"zone" yaml:"zone"`
	String string `json:"string" yaml:"string"`
}

ACL is the API payload based on the legacy xmlrpc backend.

type ACLService

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

ACLService owns the /cloud/acl methods.

func (ACLService) ACLs

func (s ACLService) ACLs(ctx context.Context) (*ACLsResponse, error)

ACLs returns a slice containing all of the Access Control Lists.

func (ACLService) CreateACL

CreateACL creates a new Access Control List and returns its id.

func (ACLService) DeleteACL

func (s ACLService) DeleteACL(ctx context.Context, id int) error

DeleteACL deletes the Access Control List specified by the id.

type ACLsResponse

type ACLsResponse struct {
	ACLs []ACL `json:"acls"`
}

ACLsResponse is the response body for GET /cloud/acl.

type AcctHistory

type AcctHistory struct {
	instance.History
	Instance Instance `json:"instance" yaml:"instance"`
}

AcctHistory is the API payload based on the legacy xmlrpc backend.

type AddClusterDatastoreResponse

type AddClusterDatastoreResponse struct {
	Datastore int `json:"datastore"`
}

AddClusterDatastoreResponse is the response body for PATCH /cloud/cluster/datastore.

type AddClusterHostResponse

type AddClusterHostResponse struct {
	Host int `json:"host"`
}

AddClusterHostResponse is the response body for PATCH /cloud/cluster/host.

type AddClusterNetworkResponse

type AddClusterNetworkResponse struct {
	VNet int `json:"vnet"`
}

AddClusterNetworkResponse is the response body for PATCH /cloud/cluster/vnet.

type AddDataCenterClusterResponse

type AddDataCenterClusterResponse struct {
	DataCenter int `json:"datacenter"`
}

AddDataCenterClusterResponse is the response body for PATCH /cloud/datacenter/cluster.

type AddDataCenterDatastoreResponse

type AddDataCenterDatastoreResponse struct {
	DataCenter int `json:"datacenter"`
}

AddDataCenterDatastoreResponse is the response body for PATCH /cloud/datacenter/datastore.

type AddDataCenterGroupResponse

type AddDataCenterGroupResponse struct {
	DataCenter int `json:"datacenter"`
}

AddDataCenterGroupResponse is the response body for PATCH /cloud/datacenter/group.

type AddDataCenterHostResponse

type AddDataCenterHostResponse struct {
	DataCenter int `json:"datacenter"`
}

AddDataCenterHostResponse is the response body for PATCH /cloud/datacenter/host.

type AddDataCenterNetworkResponse

type AddDataCenterNetworkResponse struct {
	DataCenter int `json:"datacenter"`
}

AddDataCenterNetworkResponse is the response body for PATCH /cloud/datacenter/network.

type AddGroupAdminRequest

type AddGroupAdminRequest struct {
	User int `json:"user"`
}

AddGroupAdminRequest is the request body for POST /cloud/group/admin.

type AddGroupAdminResponse

type AddGroupAdminResponse struct {
	Group int `json:"group"`
}

AddGroupAdminResponse is the response body for POST /cloud/group/admin.

type AddInstanceScheduleRequest

type AddInstanceScheduleRequest struct {
	Template string `json:"template"`
}

AddInstanceScheduleRequest is the request body for POST /cloud/instance/schedule.

type AddInstanceScheduleResponse

type AddInstanceScheduleResponse struct {
	Instance int `json:"instance"`
}

AddInstanceScheduleResponse is the response body for POST /cloud/instance/schedule.

type AddInstanceSecurityGroupResponse

type AddInstanceSecurityGroupResponse struct {
	Instance int `json:"instance"`
}

AddInstanceSecurityGroupResponse is the response body for POST /cloud/instance/security-group.

type AddNetworkAddressRangeRequest

type AddNetworkAddressRangeRequest struct {
	Template string `json:"template"`
}

AddNetworkAddressRangeRequest is the request body for POST /cloud/network/{network}/address-range.

type AddNetworkAddressRangeResponse

type AddNetworkAddressRangeResponse struct {
	Network int `json:"network"`
}

AddNetworkAddressRangeResponse is the response body for POST /cloud/network/address-range.

type AddUserGroupResponse

type AddUserGroupResponse struct {
	User int `json:"user"`
}

AddUserGroupResponse is the response body for POST /cloud/user/group.

type AllocateDocumentRequest

type AllocateDocumentRequest struct {
	Template string `json:"template"`
	Type     int    `json:"type"`
}

AllocateDocumentRequest is the request body for POST /cloud/document.

type AllocateDocumentResponse

type AllocateDocumentResponse struct {
	Document int `json:"document"`
}

AllocateDocumentResponse is the response body for POST /cloud/document.

type CalculateInstancesShowbackRequest

type CalculateInstancesShowbackRequest struct {
	Month Period `json:"month"`
	Year  Period `json:"year"`
}

CalculateInstancesShowbackRequest is the request body for POST /cloud/instance/showback.

type Capacity

type Capacity struct {
	FreeCPU    int `json:"free_cpu" yaml:"free_cpu"`
	FreeMemory int `json:"free_memory" yaml:"free_memory"`
	UsedCPU    int `json:"used_cpu" yaml:"used_cpu"`
	UsedMemory int `json:"used_memory" yaml:"used_memory"`
}

Capacity is the API payload based on the legacy xmlrpc backend.

type ChangeDatastoreOwnershipRequest

type ChangeDatastoreOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeDatastoreOwnershipRequest is the request body for PATCH /cloud/datastore/{datastore}/ownership.

type ChangeDatastoreOwnershipResponse

type ChangeDatastoreOwnershipResponse struct {
	Datastore int `json:"datastore"`
}

ChangeDatastoreOwnershipResponse is the response body for PATCH /cloud/datastore/ownership.

type ChangeDatastorePermissionsRequest

type ChangeDatastorePermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeDatastorePermissionsRequest is the request body for PATCH /cloud/datastore/{datastore}/permissions.

type ChangeDatastorePermissionsResponse

type ChangeDatastorePermissionsResponse struct {
	Datastore int `json:"datastore"`
}

ChangeDatastorePermissionsResponse is the response body for PATCH /cloud/datastore/permissions.

type ChangeDocumentOwnershipRequest

type ChangeDocumentOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeDocumentOwnershipRequest is the request body for PATCH /cloud/document/{document}/ownership.

type ChangeDocumentOwnershipResponse

type ChangeDocumentOwnershipResponse struct {
	Document int `json:"document"`
}

ChangeDocumentOwnershipResponse is the response body for PATCH /cloud/document/ownership.

type ChangeDocumentPermissionsRequest

type ChangeDocumentPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeDocumentPermissionsRequest is the request body for PATCH /cloud/document/{document}/permissions.

type ChangeDocumentPermissionsResponse

type ChangeDocumentPermissionsResponse struct {
	Document int `json:"document"`
}

ChangeDocumentPermissionsResponse is the response body for PATCH /cloud/document/permissions.

type ChangeImageOwnershipRequest

type ChangeImageOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeImageOwnershipRequest is the request body for PATCH /cloud/image/{image}/ownership.

type ChangeImageOwnershipResponse

type ChangeImageOwnershipResponse struct {
	Image int `json:"image"`
}

ChangeImageOwnershipResponse is the response body for PATCH /cloud/image/ownership.

type ChangeImagePermissionsRequest

type ChangeImagePermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeImagePermissionsRequest is the request body for PATCH /cloud/image/{image}/permissions.

type ChangeImagePermissionsResponse

type ChangeImagePermissionsResponse struct {
	Image int `json:"image"`
}

ChangeImagePermissionsResponse is the response body for PATCH /cloud/image/permissions.

type ChangeImageTypeRequest

type ChangeImageTypeRequest struct {
	Type string `json:"type"`
}

ChangeImageTypeRequest is the request body for PATCH /cloud/image/{image}/type.

type ChangeImageTypeResponse

type ChangeImageTypeResponse struct {
	Image int `json:"image"`
}

ChangeImageTypeResponse is the response body for PATCH /cloud/image/type.

type ChangeInstanceGroupOwnershipRequest

type ChangeInstanceGroupOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeInstanceGroupOwnershipRequest is the request body for PATCH /cloud/instance-group/{group}/ownership.

type ChangeInstanceGroupOwnershipResponse

type ChangeInstanceGroupOwnershipResponse struct {
	Group int `json:"group"`
}

ChangeInstanceGroupOwnershipResponse is the response body for PATCH /cloud/instance-group/ownership.

type ChangeInstanceGroupPermissionsRequest

type ChangeInstanceGroupPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeInstanceGroupPermissionsRequest is the request body for PATCH /cloud/instance-group/{group}/permissions.

type ChangeInstanceGroupPermissionsResponse

type ChangeInstanceGroupPermissionsResponse struct {
	Group int `json:"group"`
}

ChangeInstanceGroupPermissionsResponse is the response body for PATCH /cloud/instance-group/permissions.

type ChangeInstanceOwnershipRequest

type ChangeInstanceOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeInstanceOwnershipRequest is the request body for PATCH /cloud/instance/{instance}/ownership.

type ChangeInstanceOwnershipResponse

type ChangeInstanceOwnershipResponse struct {
	Instance int `json:"instance"`
}

ChangeInstanceOwnershipResponse is the response body for PATCH /cloud/instance/ownership.

type ChangeInstancePermissionsRequest

type ChangeInstancePermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeInstancePermissionsRequest is the request body for PATCH /cloud/instance/{instance}/permissions.

type ChangeInstancePermissionsResponse

type ChangeInstancePermissionsResponse struct {
	Instance int `json:"instance"`
}

ChangeInstancePermissionsResponse is the response body for PATCH /cloud/instance/permissions.

type ChangeMarketAppOwnershipRequest

type ChangeMarketAppOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeMarketAppOwnershipRequest is the request body for PATCH /cloud/market/app/{app}/ownership.

type ChangeMarketAppOwnershipResponse

type ChangeMarketAppOwnershipResponse struct {
	MarketApp int `json:"market_app"`
}

ChangeMarketAppOwnershipResponse is the response body for PATCH /cloud/market/app/ownership.

type ChangeMarketAppPermissionsRequest

type ChangeMarketAppPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeMarketAppPermissionsRequest is the request body for PATCH /cloud/market/app/{app}/permissions.

type ChangeMarketAppPermissionsResponse

type ChangeMarketAppPermissionsResponse struct {
	MarketApp int `json:"market_app"`
}

ChangeMarketAppPermissionsResponse is the response body for PATCH /cloud/market/app/permissions.

type ChangeMarketOwnershipRequest

type ChangeMarketOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeMarketOwnershipRequest is the request body for PATCH /cloud/market/{market}/ownership.

type ChangeMarketOwnershipResponse

type ChangeMarketOwnershipResponse struct {
	Market int `json:"market"`
}

ChangeMarketOwnershipResponse is the response body for PATCH /cloud/market/ownership.

type ChangeMarketPermissionsRequest

type ChangeMarketPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeMarketPermissionsRequest is the request body for PATCH /cloud/market/{market}/permissions.

type ChangeMarketPermissionsResponse

type ChangeMarketPermissionsResponse struct {
	Market int `json:"market"`
}

ChangeMarketPermissionsResponse is the response body for PATCH /cloud/market/permissions.

type ChangeNetworkOwnershipRequest

type ChangeNetworkOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeNetworkOwnershipRequest is the request body for PATCH /cloud/network/{network}/ownership.

type ChangeNetworkOwnershipResponse

type ChangeNetworkOwnershipResponse struct {
	Network int `json:"network"`
}

ChangeNetworkOwnershipResponse is the response body for PATCH /cloud/network/ownership.

type ChangeNetworkPermissionsRequest

type ChangeNetworkPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeNetworkPermissionsRequest is the request body for PATCH /cloud/network/{network}/permissions.

type ChangeNetworkPermissionsResponse

type ChangeNetworkPermissionsResponse struct {
	Network int `json:"network"`
}

ChangeNetworkPermissionsResponse is the response body for PATCH /cloud/network/permissions.

type ChangeNetworkTemplateOwnershipRequest

type ChangeNetworkTemplateOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeNetworkTemplateOwnershipRequest is the request body for PATCH /cloud/network/template/{template}/ownership.

type ChangeNetworkTemplateOwnershipResponse

type ChangeNetworkTemplateOwnershipResponse struct {
	Template int `json:"template"`
}

ChangeNetworkTemplateOwnershipResponse is the response body for PATCH /cloud/network/template/ownership.

type ChangeNetworkTemplatePermissionsRequest

type ChangeNetworkTemplatePermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeNetworkTemplatePermissionsRequest is the request body for PATCH /cloud/network/template/{template}/permissions.

type ChangeNetworkTemplatePermissionsResponse

type ChangeNetworkTemplatePermissionsResponse struct {
	Template int `json:"template"`
}

ChangeNetworkTemplatePermissionsResponse is the response body for PATCH /cloud/network/template/permissions.

type ChangeRouterOwnershipRequest

type ChangeRouterOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeRouterOwnershipRequest is the request body for PATCH /cloud/router/{router}/ownership.

type ChangeRouterOwnershipResponse

type ChangeRouterOwnershipResponse struct {
	Router int `json:"router"`
}

ChangeRouterOwnershipResponse is the response body for PATCH /cloud/router/ownership.

type ChangeRouterPermissionsRequest

type ChangeRouterPermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
}

ChangeRouterPermissionsRequest is the request body for PATCH /cloud/router/{router}/permissions.

type ChangeRouterPermissionsResponse

type ChangeRouterPermissionsResponse struct {
	Router int `json:"router"`
}

ChangeRouterPermissionsResponse is the response body for PATCH /cloud/router/permissions.

type ChangeSecurityGroupOwnershipRequest

type ChangeSecurityGroupOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeSecurityGroupOwnershipRequest is the request body for PATCH /cloud/security-group/{sg}/chown.

type ChangeSecurityGroupOwnershipResponse

type ChangeSecurityGroupOwnershipResponse struct {
	SecurityGroup int `json:"security_group"`
}

ChangeSecurityGroupOwnershipResponse is the response body for PATCH /cloud/security-group/chown.

type ChangeSecurityGroupPermissionsRequest

type ChangeSecurityGroupPermissionsRequest struct {
	Permissions hc.Perms `json:"perms"`
}

ChangeSecurityGroupPermissionsRequest is the request body for PATCH /cloud/security-group/{sg}/chmod.

type ChangeSecurityGroupPermissionsResponse

type ChangeSecurityGroupPermissionsResponse struct {
	SecurityGroup int `json:"security_group"`
}

ChangeSecurityGroupPermissionsResponse is the response body for PATCH /cloud/security-group/chmod.

type ChangeTemplateOwnershipRequest

type ChangeTemplateOwnershipRequest struct {
	User  *int `json:"user"`
	Group *int `json:"group"`
}

ChangeTemplateOwnershipRequest is the response body for PATCH /cloud/template/{template}/ownership.

type ChangeTemplateOwnershipResponse

type ChangeTemplateOwnershipResponse struct {
	Template int `json:"template"`
}

ChangeTemplateOwnershipResponse is the response body for PATCH /cloud/template/ownership.

type ChangeTemplatePermissionsRequest

type ChangeTemplatePermissionsRequest struct {
	Permissions hc.Perms `json:"permissions"`
	Disk        bool     `json:"disk"`
}

ChangeTemplatePermissionsRequest is the response body for PATCH /cloud/template/{template}/permissions.

type ChangeTemplatePermissionsResponse

type ChangeTemplatePermissionsResponse struct {
	Template int `json:"template"`
}

ChangeTemplatePermissionsResponse is the response body for PATCH /cloud/template/permissions.

type ChangeUserAuthRequest

type ChangeUserAuthRequest struct {
	Driver   string `json:"driver"`
	Password string `json:"password"`
}

ChangeUserAuthRequest is the request body for PATCH /cloud/user/{user}/auth.

type ChangeUserAuthResponse

type ChangeUserAuthResponse struct {
	User int `json:"user"`
}

ChangeUserAuthResponse is the response body for PATCH /cloud/user/auth.

type ChangeUserGroupResponse

type ChangeUserGroupResponse struct {
	User int `json:"user"`
}

ChangeUserGroupResponse is the response body for PATCH /cloud/user/group.

type ChangeUserPasswordRequest

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

ChangeUserPasswordRequest is the request body for PATCH /cloud/user/{user}/password.

type ChangeUserPasswordResponse

type ChangeUserPasswordResponse struct {
	User int `json:"user"`
}

ChangeUserPasswordResponse is the response body for PATCH /cloud/user/password.

type CloneDocumentRequest

type CloneDocumentRequest struct {
	Name string `json:"name"`
}

CloneDocumentRequest is the request body for POST /cloud/document/{document}/clone.

type CloneDocumentResponse

type CloneDocumentResponse struct {
	Document int `json:"document"`
}

CloneDocumentResponse is the response body for POST /cloud/document/clone.

type CloneImageRequest

type CloneImageRequest struct {
	Name      string `json:"name"`
	Datastore *int   `json:"datastore"`
}

CloneImageRequest is the request body for POST /cloud/image/clone.

type CloneImageResponse

type CloneImageResponse struct {
	Image int `json:"image"`
}

CloneImageResponse is the response body for POST /cloud/image/clone.

type CloneNetworkTemplateRequest

type CloneNetworkTemplateRequest struct {
	Name string `json:"name"`
}

CloneNetworkTemplateRequest is the request body for POST /cloud/network/template/clone.

type CloneNetworkTemplateResponse

type CloneNetworkTemplateResponse struct {
	Template int `json:"template"`
}

CloneNetworkTemplateResponse is the response body for POST /cloud/network/template/clone.

type CloneSecurityGroupRequest

type CloneSecurityGroupRequest struct {
	Name string `json:"name"`
}

CloneSecurityGroupRequest is the request body for POST /cloud/security-group/{sg}/clone.

type CloneSecurityGroupResponse

type CloneSecurityGroupResponse struct {
	SecurityGroup int `json:"security_group"`
}

CloneSecurityGroupResponse is the response body for POST /cloud/security-group/clone.

type CloneTemplateRequest

type CloneTemplateRequest struct {
	Name string `json:"name"`
	Disk bool   `json:"disk"`
}

CloneTemplateRequest is the response body for POST /cloud/template/{template}/clone.

type CloneTemplateResponse

type CloneTemplateResponse struct {
	Template int `json:"template"`
}

CloneTemplateResponse is the response body for POST /cloud/template/clone.

type Cluster

type Cluster struct {
	ID           int             `json:"id" yaml:"id"`
	Name         string          `json:"name" yaml:"name"`
	Hosts        []int           `json:"hosts" yaml:"hosts"`
	Datastores   []int           `json:"datastores" yaml:"datastores"`
	Networks     []int           `json:"networks" yaml:"networks"`
	Template     ClusterTemplate `json:"template" yaml:"template"`
	TemplateText string          `json:"template_text" yaml:"template_text"`
}

Cluster is the API payload based on the legacy xmlrpc backend.

type ClusterResponse

type ClusterResponse struct {
	Cluster Cluster `json:"cluster"`
}

ClusterResponse is the response body for GET /cloud/cluster.

type ClusterService

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

ClusterService owns the /cloud/cluster methods.

func (ClusterService) AddClusterDatastore

func (s ClusterService) AddClusterDatastore(ctx context.Context, id, datastore int) (*AddClusterDatastoreResponse, error)

AddClusterDatastore adds the datastore to the cluster.

func (ClusterService) AddClusterHost

func (s ClusterService) AddClusterHost(ctx context.Context, id, host int) (*AddClusterHostResponse, error)

AddClusterHost adds the host to the cluster.

func (ClusterService) AddClusterNetwork

func (s ClusterService) AddClusterNetwork(ctx context.Context, id, network int) (*AddClusterNetworkResponse, error)

AddClusterNetwork adds the network to the cluster.

func (ClusterService) Cluster

func (s ClusterService) Cluster(ctx context.Context, id int) (*ClusterResponse, error)

Cluster returns information about a cluster.

func (ClusterService) Clusters

func (s ClusterService) Clusters(ctx context.Context) (*ClustersResponse, error)

Clusters returns information about all clusters.

func (ClusterService) CreateCluster

CreateCluster creates a cluster.

func (ClusterService) DeleteCluster

func (s ClusterService) DeleteCluster(ctx context.Context, id int) error

DeleteCluster deletes the cluster with the given ID.

func (ClusterService) DeleteClusterDatastore

func (s ClusterService) DeleteClusterDatastore(ctx context.Context, id, datastore int) error

DeleteClusterDatastore deletes the datastore from the cluster.

func (ClusterService) DeleteClusterHost

func (s ClusterService) DeleteClusterHost(ctx context.Context, id, host int) error

DeleteClusterHost deletes the host from the cluster.

func (ClusterService) DeleteClusterNetwork

func (s ClusterService) DeleteClusterNetwork(ctx context.Context, id, network int) error

DeleteClusterNetwork deletes the network from the cluster.

func (ClusterService) RenameCluster

RenameCluster updates the name of the cluster.

func (ClusterService) UpdateCluster

UpdateCluster updates the cluster.

type ClusterTemplate

type ClusterTemplate struct {
	Values         map[string]string `json:"values" yaml:"values"`
	ReservedCPU    string            `json:"reserved_cpu" yaml:"reserved_cpu"`
	ReservedMemory string            `json:"reserved_mem" yaml:"reserved_mem"`
}

ClusterTemplate is the API payload based on the legacy xmlrpc backend.

type ClustersResponse

type ClustersResponse struct {
	Clusters []Cluster `json:"cluster"`
}

ClustersResponse is the response body for GET /cloud/cluster.

type CommitSecurityGroupRequest

type CommitSecurityGroupRequest struct {
	All bool `json:"all"`
}

CommitSecurityGroupRequest is the request body for PATCH /cloud/security-group/{sg}/commit.

type CommitSecurityGroupResponse

type CommitSecurityGroupResponse struct {
	SecurityGroup int `json:"security_group"`
}

CommitSecurityGroupResponse is the response body for PATCH /cloud/security-group/commit.

type Core

type Core struct {
	CPUs      string `json:"cpus" yaml:"cpus"`
	Dedicated bool   `json:"dedicated" yaml:"dedicated"`
	Free      int    `json:"free" yaml:"free"`
	ID        int    `json:"id" yaml:"id"`
}

Core is the API payload based on the legacy xmlrpc backend.

type CreateACLRequest

type CreateACLRequest struct {
	User     int  `json:"user"`
	Resource int  `json:"resource"`
	Rights   int  `json:"rights"`
	Zone     *int `json:"zone"`
}

CreateACLRequest is the request body for POST /cloud/acl.

type CreateACLResponse

type CreateACLResponse struct {
	ACL int `json:"acl"`
}

CreateACLResponse is the response body for POST /cloud/acl.

type CreateClusterRequest

type CreateClusterRequest struct {
	Name string `json:"name"`
}

CreateClusterRequest is request body for POST /cloud/cluster.

type CreateClusterResponse

type CreateClusterResponse struct {
	Cluster int `json:"cluster"`
}

CreateClusterResponse is response body for POST /cloud/cluster.

type CreateDataCenterRequest

type CreateDataCenterRequest struct {
	Template string `json:"template"`
}

CreateDataCenterRequest is the request body for POST /cloud/datacenter.

type CreateDataCenterResponse

type CreateDataCenterResponse struct {
	DataCenter int `json:"datacenter"`
}

CreateDataCenterResponse is the response body for POST /cloud/datacenter.

type CreateDatastoreRequest

type CreateDatastoreRequest struct {
	Template string `json:"template"`
	Cluster  *int   `json:"cluster"`
}

CreateDatastoreRequest is the request body for POST /cloud/datastore.

type CreateDatastoreResponse

type CreateDatastoreResponse struct {
	Datastore int `json:"datastore"`
}

CreateDatastoreResponse is the response body for POST /cloud/datastore.

type CreateGroupRequest

type CreateGroupRequest struct {
	Name string `json:"name"`
}

CreateGroupRequest is the request body for POST /cloud/group.

type CreateGroupResponse

type CreateGroupResponse struct {
	Group int `json:"group"`
}

CreateGroupResponse is the response body for POST /cloud/group.

type CreateHookRequest

type CreateHookRequest struct {
	Template string `json:"template"`
}

CreateHookRequest is the request body for POST /cloud/hook.

type CreateHookResponse

type CreateHookResponse struct {
	Hook int `json:"hook"`
}

CreateHookResponse is the response body for POST /cloud/hook.

type CreateHostRequest

type CreateHostRequest struct {
	Hostname    string `json:"hostname"`
	InfoManager string `json:"info_manager"`
	VMManager   string `json:"vm_manager"`
	Cluster     *int   `json:"cluster"`
}

CreateHostRequest is the request body for POST /cloud/host.

type CreateHostResponse

type CreateHostResponse struct {
	Host int `json:"host"`
}

CreateHostResponse is the response body for POST /cloud/host.

type CreateImageRequest

type CreateImageRequest struct {
	Template        string `json:"template"`
	Datastore       int    `json:"datastore"`
	EnforceCapacity bool   `json:"enforce_capacity"`
}

CreateImageRequest is the request body for POST /cloud/image.

type CreateImageResponse

type CreateImageResponse struct {
	Image int `json:"image"`
}

CreateImageResponse is the response body for POST /cloud/image.

type CreateInstanceDiskImageRequest

type CreateInstanceDiskImageRequest struct {
	Name      string `json:"name"`
	ImageType string `json:"image_type"`
	Snapshot  *int   `json:"snapshot"`
}

CreateInstanceDiskImageRequest is the request body for POST /cloud/instance/disk/image.

type CreateInstanceDiskImageResponse

type CreateInstanceDiskImageResponse struct {
	Image int `json:"image"`
}

CreateInstanceDiskImageResponse is the response body for POST /cloud/instance/disk/image.

type CreateInstanceDiskRequest

type CreateInstanceDiskRequest struct {
	DiskTemplate string `json:"disk"`
}

CreateInstanceDiskRequest is the request body for POST /cloud/instance/disk.

type CreateInstanceDiskResponse

type CreateInstanceDiskResponse struct {
	Instance int `json:"instance"`
}

CreateInstanceDiskResponse is the response body for POST /cloud/instance/disk.

type CreateInstanceDiskSnapshotRequest

type CreateInstanceDiskSnapshotRequest struct {
	Description string `json:"description"`
}

CreateInstanceDiskSnapshotRequest is the request body for POST /cloud/instance/disk/snapshot.

type CreateInstanceDiskSnapshotResponse

type CreateInstanceDiskSnapshotResponse struct {
	Instance int `json:"instance"`
}

CreateInstanceDiskSnapshotResponse is the response body for POST /cloud/instance/disk/snapshot.

type CreateInstanceGroupRequest

type CreateInstanceGroupRequest struct {
	Template string `json:"template"`
}

CreateInstanceGroupRequest is the request body for POST /cloud/instance-group.

type CreateInstanceGroupResponse

type CreateInstanceGroupResponse struct {
	Group int `json:"group"`
}

CreateInstanceGroupResponse is the response body for POST /cloud/instance-group.

type CreateInstanceNICRequest

type CreateInstanceNICRequest struct {
	NICTemplate string `json:"nic"`
}

CreateInstanceNICRequest is the request body for POST /cloud/instance/nic.

type CreateInstanceNICResponse

type CreateInstanceNICResponse struct {
	Instance int `json:"instance"` // TODO: would make more sense as NIC ID, maybe docs are wrong
}

CreateInstanceNICResponse is the response body for POST /cloud/instance/nic.

type CreateInstanceRequest

type CreateInstanceRequest struct {
	Template string `json:"template"`
	Pending  bool   `json:"pending"`
}

CreateInstanceRequest is the request body for POST /cloud/instance.

type CreateInstanceResponse

type CreateInstanceResponse struct {
	Instance int `json:"instance"`
}

CreateInstanceResponse is the response body for POST /cloud/instance.

type CreateInstanceSnapshotRequest

type CreateInstanceSnapshotRequest struct {
	Snapshot string `json:"snapshot"`
}

CreateInstanceSnapshotRequest is the request body for POST /cloud/instance/snapshot.

type CreateInstanceSnapshotResponse

type CreateInstanceSnapshotResponse struct {
	Snapshot int `json:"snapshot"`
}

CreateInstanceSnapshotResponse is the response body for POST /cloud/instance/snapshot.

type CreateMarketAppRequest

type CreateMarketAppRequest struct {
	Template string `json:"template"`
}

CreateMarketAppRequest is the request body for POST /cloud/market/{market}/app/{app}.

type CreateMarketAppResponse

type CreateMarketAppResponse struct {
	MarketApp int `json:"market_app"`
}

CreateMarketAppResponse is the response body for POST /cloud/market/app.

type CreateMarketRequest

type CreateMarketRequest struct {
	Template string `json:"template"`
}

CreateMarketRequest is the request body for POST /cloud/market.

type CreateMarketResponse

type CreateMarketResponse struct {
	Market int `json:"market"`
}

CreateMarketResponse is the response body for POST /cloud/market.

type CreateNetworkRequest

type CreateNetworkRequest struct {
	Template string `json:"template"`
	Cluster  *int   `json:"cluster"`
}

CreateNetworkRequest is the request body for POST /cloud/network.

type CreateNetworkResponse

type CreateNetworkResponse struct {
	Network int `json:"network"`
}

CreateNetworkResponse is the response body for POST /cloud/network.

type CreateNetworkTemplateRequest

type CreateNetworkTemplateRequest struct {
	Template string `json:"template"`
}

CreateNetworkTemplateRequest is the request body for POST /cloud/network/template.

type CreateNetworkTemplateResponse

type CreateNetworkTemplateResponse struct {
	Template int `json:"template"`
}

CreateNetworkTemplateResponse is the response body for POST /cloud/network/template.

type CreateRouterNICRequest

type CreateRouterNICRequest struct {
	Template string `json:"template"`
}

CreateRouterNICRequest is the request body for PATCH /cloud/router/nic.

type CreateRouterNICResponse

type CreateRouterNICResponse struct {
	Router int `json:"router"`
}

CreateRouterNICResponse is the response body for PATCH /cloud/router/nic.

type CreateRouterRequest

type CreateRouterRequest struct {
	Template string `json:"template"`
}

CreateRouterRequest is the request body for POST /cloud/router.

type CreateRouterResponse

type CreateRouterResponse struct {
	Router int `json:"router"`
}

CreateRouterResponse is the response body for POST /cloud/router.

type CreateSecurityGroupRequest

type CreateSecurityGroupRequest struct {
	Template string `json:"template"`
}

CreateSecurityGroupRequest is the request body for POST /cloud/security-group.

type CreateSecurityGroupResponse

type CreateSecurityGroupResponse struct {
	SecurityGroup int `json:"security_group"`
}

CreateSecurityGroupResponse is the response body for POST /cloud/security-group.

type CreateTemplateRequest

type CreateTemplateRequest struct {
	Data string `json:"data"`
}

CreateTemplateRequest is the response body for POST /cloud/template.

type CreateTemplateResponse

type CreateTemplateResponse struct {
	Template int `json:"template"`
}

CreateTemplateResponse is the response body for POST /cloud/template.

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Auth     string `json:"auth"`
	Gids     []int  `json:"gids"`
}

CreateUserRequest is the request body for POST /cloud/user.

type CreateUserResponse

type CreateUserResponse struct {
	User int `json:"user"`
}

CreateUserResponse is the response body for POST /cloud/user.

type CreateVNCProxyRequest

type CreateVNCProxyRequest struct {
	Zone int `json:"zone"`
}

CreateVNCProxyRequest is the request body for POST /cloud/instance/{instance}/vnc.

type CreateVNCProxyResponse

type CreateVNCProxyResponse struct {
	Password string `json:"password"`
	Token    string `json:"token"`
	Name     string `json:"name"`
}

CreateVNCProxyResponse is the response body for POST /cloud/instance/{instance}/vnc.

type CreateZoneRequest

type CreateZoneRequest struct {
	Template string `json:"template"`
}

CreateZoneRequest is the request body for POST /cloud/zone.

type CreateZoneResponse

type CreateZoneResponse struct {
	Zone int `json:"zone"`
}

CreateZoneResponse is the response body for POST /cloud/zone.

type DataCenter

type DataCenter struct {
	ID           int                    `json:"id" yaml:"id"`
	Name         string                 `json:"name" yaml:"name"`
	Groups       []int                  `json:"groups" yaml:"groups"`
	Clusters     []datacenter.Cluster   `json:"clusters" yaml:"clusters"`
	Hosts        []datacenter.Host      `json:"hosts" yaml:"hosts"`
	Datastores   []datacenter.Datastore `json:"datastores" yaml:"datastores"`
	Networks     []datacenter.Network   `json:"networks" yaml:"networks"`
	Template     DataCenterTemplate     `json:"template" yaml:"template"`
	TemplateText string                 `json:"template_text" yaml:"template_text"`
}

DataCenter is the API payload based on the legacy xmlrpc backend.

type DataCenterResponse

type DataCenterResponse struct {
	DataCenter DataCenter `json:"datacenter"`
}

DataCenterResponse is the response body for GET /cloud/datacenter.

type DataCenterService

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

DataCenterService owns the /cloud/datacenter methods.

func (DataCenterService) AddDataCenterCluster

func (s DataCenterService) AddDataCenterCluster(ctx context.Context, id, zone, cluster int) (*AddDataCenterClusterResponse, error)

AddDataCenterCluster adds a cluster to the Data Center with the given ID.

func (DataCenterService) AddDataCenterDatastore

func (s DataCenterService) AddDataCenterDatastore(ctx context.Context, id, zone, datastore int) (*AddDataCenterDatastoreResponse, error)

AddDataCenterDatastore adds a datastore to the Data Center with the given ID.

func (DataCenterService) AddDataCenterGroup

func (s DataCenterService) AddDataCenterGroup(ctx context.Context, id int) (*AddDataCenterGroupResponse, error)

AddDataCenterGroup adds a group to the Data Center with the given ID.

func (DataCenterService) AddDataCenterHost

func (s DataCenterService) AddDataCenterHost(ctx context.Context, id, zone, host int) (*AddDataCenterHostResponse, error)

AddDataCenterHost adds a host to the Data Center with the given ID.

func (DataCenterService) AddDataCenterNetwork

func (s DataCenterService) AddDataCenterNetwork(ctx context.Context, id, zone, network int) (*AddDataCenterNetworkResponse, error)

AddDataCenterNetwork adds a network to the Data Center with the given ID.

func (DataCenterService) CreateDataCenter

CreateDataCenter creates a new Data Center.

func (DataCenterService) DataCenter

func (s DataCenterService) DataCenter(ctx context.Context, id int) (*DataCenterResponse, error)

DataCenter returns information about a vdc.

func (DataCenterService) DataCenters

DataCenters returns information about all vdcs.

func (DataCenterService) DeleteDataCenter

func (s DataCenterService) DeleteDataCenter(ctx context.Context, id int) error

DeleteDataCenter deletes the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterCluster

func (s DataCenterService) RemoveDataCenterCluster(ctx context.Context, id, zone, cluster int) error

RemoveDataCenterCluster removes a cluster from the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterDatastore

func (s DataCenterService) RemoveDataCenterDatastore(ctx context.Context, id, zone, datastore int) error

RemoveDataCenterDatastore removes a datastore from the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterGroup

func (s DataCenterService) RemoveDataCenterGroup(ctx context.Context, id, group int) error

RemoveDataCenterGroup removes a group from the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterHost

func (s DataCenterService) RemoveDataCenterHost(ctx context.Context, id, zone, host int) error

RemoveDataCenterHost removes a host from the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterNetwork

func (s DataCenterService) RemoveDataCenterNetwork(ctx context.Context, id, zone, network int) error

RemoveDataCenterNetwork removes a network from the Data Center with the given ID.

func (DataCenterService) RenameDataCenter

RenameDataCenter renames the Data Center with the given ID.

func (DataCenterService) UpdateDataCenter

UpdateDataCenter updates the Data Center with the given ID.

type DataCenterTemplate

type DataCenterTemplate struct {
	Values      map[string]string `json:"values" yaml:"values"`
	Description string            `json:"description" yaml:"description"`
}

DataCenterTemplate is the API payload based on the legacy xmlrpc backend.

type DataCentersResponse

type DataCentersResponse struct {
	DataCenters []DataCenter `json:"datacenters"`
}

DataCentersResponse is the response body for GET /cloud/datacenter.

type Datastore

type Datastore struct {
	ID                 int               `json:"id" yaml:"id"`
	UserID             int               `json:"user_id" yaml:"user_id"`
	GroupID            int               `json:"group_id" yaml:"group_id"`
	UserName           string            `json:"user_name" yaml:"user_name"`
	GroupName          string            `json:"group_name" yaml:"group_name"`
	Name               string            `json:"name" yaml:"name"`
	Permissions        Permissions       `json:"permissions" yaml:"permissions"`
	DatastoreMAD       string            `json:"datastore_mad" yaml:"datastore_mad"`
	TransferManagerMAD string            `json:"transfer_manager_mad" yaml:"transfer_manager_mad"`
	BasePath           string            `json:"base_path" yaml:"base_path"`
	Type               DatastoreType     `json:"type" yaml:"type" swaggertype:"string" enum:"image,system,file"`
	DiskType           int               `json:"disk_type" yaml:"disk_type"`
	State              DatastoreState    `json:"state" yaml:"state" swaggertype:"string" enum:"ready,disabled"`
	Clusters           []int             `json:"clusters" yaml:"clusters"`
	TotalMB            int               `json:"total_mb" yaml:"total_mb"`
	FreeMB             int               `json:"free_mb" yaml:"free_mb"`
	UsedMB             int               `json:"used_mb" yaml:"used_mb"`
	Images             []int             `json:"images" yaml:"images"`
	Template           DatastoreTemplate `json:"template" yaml:"template"`
	TemplateText       string            `json:"template_text" yaml:"template_text"`
}

Datastore is the API payload based on the legacy xmlrpc backend.

type DatastoreResponse

type DatastoreResponse struct {
	Datastore Datastore `json:"datastore"`
}

DatastoreResponse is the response body for GET /cloud/datastore.

type DatastoreService

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

DatastoreService owns the /cloud/datastore methods.

func (DatastoreService) ChangeDatastoreOwnership

ChangeDatastoreOwnership changes the datastore ownership with the given ID.

func (DatastoreService) ChangeDatastorePermissions

ChangeDatastorePermissions changes the datastore permissions with the given ID.

func (DatastoreService) CreateDatastore

CreateDatastore creates a new datastore.

func (DatastoreService) Datastore

func (s DatastoreService) Datastore(ctx context.Context, id int) (*DatastoreResponse, error)

Datastore returns information about a datastore.

func (DatastoreService) Datastores

Datastores returns information about all datastores.

func (DatastoreService) DeleteDatastore

func (s DatastoreService) DeleteDatastore(ctx context.Context, id string) error

DeleteDatastore deletes the datastore with the given ID.

func (DatastoreService) EnableDatastore

EnableDatastore enables the datastore with the given ID.

func (DatastoreService) RenameDatastore

RenameDatastore renames the datastore with the given ID.

func (DatastoreService) UpdateDatastore

UpdateDatastore updates the datastore with the given ID.

type DatastoreState

type DatastoreState int

DatastoreState is the state of datastore.

const (
	DatastoreReady    DatastoreState = iota // ready
	DatastoreDisabled                       // disabled
)

State values.

func DatastoreStateString

func DatastoreStateString(s string) (DatastoreState, error)

DatastoreStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func DatastoreStateValues

func DatastoreStateValues() []DatastoreState

DatastoreStateValues returns all values of the enum

func (DatastoreState) IsADatastoreState

func (i DatastoreState) IsADatastoreState() bool

IsADatastoreState returns "true" if the value is listed in the enum definition. "false" otherwise

func (DatastoreState) MarshalText

func (i DatastoreState) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for DatastoreState

func (DatastoreState) String

func (i DatastoreState) String() string

func (*DatastoreState) UnmarshalText

func (i *DatastoreState) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for DatastoreState

type DatastoreTemplate

type DatastoreTemplate struct {
	Values                   map[string]string `json:"values" yaml:"values"`
	AllowOrphans             string            `json:"allow_orphans" yaml:"allow_orphans"`
	BridgeList               string            `json:"bridge_list" yaml:"bridge_list"`
	CloneTarget              string            `json:"clone_target" yaml:"clone_target"`
	CloneTargetShared        string            `json:"clone_target_shared" yaml:"clone_target_shared"`
	CloneTargetSSH           string            `json:"clone_target_ssh" yaml:"clone_target_ssh"`
	DiskType                 string            `json:"disk_type" yaml:"disk_type"`
	DiskTypeShared           string            `json:"disk_type_shared" yaml:"disk_type_shared"`
	DiskTypeSSH              string            `json:"disk_type_ssh" yaml:"disk_type_ssh"`
	Driver                   string            `json:"driver" yaml:"driver"`
	DatastoreMAD             string            `json:"ds_mad" yaml:"ds_mad"`
	DatastoreMigrate         bool              `json:"ds_migrate" yaml:"ds_migrate"`
	LNTarget                 string            `json:"ln_target" yaml:"ln_target"`
	LNTargetShared           string            `json:"ln_target_shared" yaml:"ln_target_shared"`
	LNTargetSSH              string            `json:"ln_target_ssh" yaml:"ln_target_ssh"`
	PoolName                 string            `json:"pool_name" yaml:"pool_name"`
	RestrictedDirs           string            `json:"restricted_dirs" yaml:"restricted_dirs"`
	SafeDirs                 string            `json:"safe_dirs" yaml:"safe_dirs"`
	Shared                   bool              `json:"shared" yaml:"shared"`
	StagingDir               string            `json:"staging_dir" yaml:"staging_dir"`
	TransferManagerMAD       string            `json:"tm_mad" yaml:"tm_mad"`
	TransferManagerMADSystem []string          `json:"tm_mad_system" yaml:"tm_mad_system"`
	Type                     string            `json:"type" yaml:"type"`
	VCenterDCName            string            `json:"vcenter_dc_name" yaml:"vcenter_dc_name"`
	VCenterDCRef             string            `json:"vcenter_dc_ref" yaml:"vcenter_dc_ref"`
	VCenterDSName            string            `json:"vcenter_ds_name" yaml:"vcenter_ds_name"`
	VCenterDSRef             string            `json:"vcenter_ds_ref" yaml:"vcenter_ds_ref"`
	VCenterHost              string            `json:"vcenter_host" yaml:"vcenter_host"`
	VCenterInstanceID        string            `json:"vcenter_instance_id" yaml:"vcenter_instance_id"`
}

DatastoreTemplate is the API payload based on the legacy xmlrpc backend.

type DatastoreType

type DatastoreType int

DatastoreType is the type of datastore.

const (
	DatastoreImage  DatastoreType = iota // image
	DatastoreSystem                      // system
	DatastoreFile                        // file
)

Type values.

func DatastoreTypeString

func DatastoreTypeString(s string) (DatastoreType, error)

DatastoreTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func DatastoreTypeValues

func DatastoreTypeValues() []DatastoreType

DatastoreTypeValues returns all values of the enum

func (DatastoreType) IsADatastoreType

func (i DatastoreType) IsADatastoreType() bool

IsADatastoreType returns "true" if the value is listed in the enum definition. "false" otherwise

func (DatastoreType) MarshalText

func (i DatastoreType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for DatastoreType

func (DatastoreType) String

func (i DatastoreType) String() string

func (*DatastoreType) UnmarshalText

func (i *DatastoreType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for DatastoreType

type Datastores

type Datastores struct {
	DiskUsage int `json:"disk_usage" yaml:"disk_usage"`
	FreeDisk  int `json:"free_disk" yaml:"free_disk"`
	MaxDisk   int `json:"max_disk" yaml:"max_disk"`
	UsedDisk  int `json:"used_disk" yaml:"used_disk"`
}

Datastores is the API payload based on the legacy xmlrpc backend.

type DatastoresResponse

type DatastoresResponse struct {
	Datastores []Datastore `json:"datastore"`
}

DatastoresResponse is the response body for GET /cloud/datastore.

type DeleteTemplateResponse

type DeleteTemplateResponse struct {
	Template int `json:"template"`
}

DeleteTemplateResponse is the response body for DELETE /cloud/template/{template}.

type DeployInstanceRequest

type DeployInstanceRequest struct {
	Host      int    `json:"host"`
	Enforce   bool   `json:"enforce"`
	Datastore *int   `json:"datastore"`
	Template  string `json:"template"`
}

DeployInstanceRequest is the request body for POST /cloud/instance/{instance}/deploy.

type DeployInstanceResponse

type DeployInstanceResponse struct {
	Instance int `json:"instance"`
}

DeployInstanceResponse is the response body for PATCH /cloud/instance/deploy.

type Document

type Document struct {
	ID           int              `json:"id" yaml:"id"`
	UserID       int              `json:"user_id" yaml:"user_id"`
	GroupID      int              `json:"group_id" yaml:"group_id"`
	UserName     string           `json:"user_name" yaml:"user_name"`
	GroupName    string           `json:"group_name" yaml:"group_name"`
	Name         string           `json:"name" yaml:"name"`
	Type         string           `json:"type" yaml:"type"`
	Permissions  Permissions      `json:"permissions" yaml:"permissions"`
	Lock         Lock             `json:"lock" yaml:"lock"`
	Template     DocumentTemplate `json:"template" yaml:"template"`
	TemplateText string           `json:"template_text" yaml:"template_text"`
}

Document is the API payload based on the legacy xmlrpc backend.

type DocumentResponse

type DocumentResponse struct {
	Document Document `json:"document"`
}

DocumentResponse is the response body for GET /cloud/document.

type DocumentService

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

DocumentService owns the /cloud/document methods.

func (DocumentService) AllocateDocument

AllocateDocument allocates a document.

func (DocumentService) ChangeDocumentOwnership

ChangeDocumentOwnership changes the ownership of the document with the given ID.

func (DocumentService) ChangeDocumentPermissions

ChangeDocumentPermissions changes the permissions of the document with the given ID.

func (DocumentService) CloneDocument

CloneDocument clones the document with the given ID.

func (DocumentService) DeleteDocument

func (s DocumentService) DeleteDocument(ctx context.Context, id int) error

DeleteDocument deletes a document with the given ID.

func (DocumentService) Document

func (s DocumentService) Document(ctx context.Context, id int) (*DocumentResponse, error)

Document returns information about the document with the given ID.

func (DocumentService) Documents

func (s DocumentService) Documents(ctx context.Context) (*DocumentsResponse, error)

Documents returns information about all documents.

func (DocumentService) LockDocument

LockDocument locks the document with the given ID.

func (DocumentService) RenameDocument

RenameDocument renames the document with the given ID.

func (DocumentService) UnlockDocument

func (s DocumentService) UnlockDocument(ctx context.Context, id int) (*UnlockDocumentResponse, error)

UnlockDocument unlocks the document with the given ID.

func (DocumentService) UpdateDocument

UpdateDocument updates the document with the given ID.

type DocumentTemplate

type DocumentTemplate struct {
	Values map[string]string `json:"values" yaml:"values"`
}

DocumentTemplate is the API payload based on the legacy xmlrpc backend.

type DocumentsResponse

type DocumentsResponse struct {
	Documents []Document `json:"document"`
}

DocumentsResponse is the response body for GET /cloud/document.

type EnableDatastoreRequest

type EnableDatastoreRequest struct {
	Enable bool `json:"enable"`
}

EnableDatastoreRequest is the request body for PATCH /cloud/datastore/{datastore}/enable.

type EnableDatastoreResponse

type EnableDatastoreResponse struct {
	Datastore int `json:"datastore"`
}

EnableDatastoreResponse is the response body for PATCH /cloud/datastore/enable.

type EnableImageRequest

type EnableImageRequest struct {
	Enable bool `json:"enable"`
}

EnableImageRequest is the request body for PATCH /cloud/image/{image}/enable.

type EnableImageResponse

type EnableImageResponse struct {
	Image int `json:"image"`
}

EnableImageResponse is the response body for PATCH /cloud/image/enable.

type EnableMarketAppRequest

type EnableMarketAppRequest struct {
	Enable bool `json:"enable"`
}

EnableMarketAppRequest is the request body for PATCH /cloud/market/app/enable.

type EnableMarketAppResponse

type EnableMarketAppResponse struct {
	Market int `json:"market"`
}

EnableMarketAppResponse is the response body for PATCH /cloud/market/app/enable.

type EnableMarketRequest

type EnableMarketRequest struct {
	Enable bool `json:"enable"`
}

EnableMarketRequest is the request body for PATCH /cloud/market/{market}/enable.

type EnableMarketResponse

type EnableMarketResponse struct {
	Market int `json:"market"`
}

EnableMarketResponse is the response body for PATCH /cloud/market/enable.

type EnableUserRequest

type EnableUserRequest struct {
	Enable bool `json:"enable"`
}

EnableUserRequest is the request body for PATCH /cloud/user/{user}/enable.

type EnableUserResponse

type EnableUserResponse struct {
	User int `json:"user"`
}

EnableUserResponse is the response body for PATCH /cloud/user/enable.

type EnableZoneRequest

type EnableZoneRequest struct {
	Enable bool `json:"enable"`
}

EnableZoneRequest is the request body for PATCH /cloud/zone/{zone}/enable.

type EnableZoneResponse

type EnableZoneResponse struct {
	Zone int `json:"zone"`
}

EnableZoneResponse is the response body for PATCH /cloud/zone/enable.

type Filter

type Filter int

Filter is to filter list of object by user and group ownership.

const (
	GroupFilter        Filter = -4 // group
	UserFilter         Filter = -3 // user
	AllFilter          Filter = -2 // all
	UserAndGroupFilter Filter = -1 // user_group
)

Filter type values.

func FilterString

func FilterString(s string) (Filter, error)

FilterString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func FilterValues

func FilterValues() []Filter

FilterValues returns all values of the enum

func (Filter) IsAFilter

func (i Filter) IsAFilter() bool

IsAFilter returns "true" if the value is listed in the enum definition. "false" otherwise

func (Filter) MarshalText

func (i Filter) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Filter

func (Filter) String

func (i Filter) String() string

func (*Filter) UnmarshalText

func (i *Filter) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Filter

func (Filter) V1

func (f Filter) V1() hc.Filter

V1 returns the v1 hc.Filter that corresponds to the Filter.

type FlattenImageSnapshotResponse

type FlattenImageSnapshotResponse struct {
	Image int `json:"image"`
}

FlattenImageSnapshotResponse is the response body for PATCH /cloud/image/snapshot/flatten.

type Group

type Group struct {
	ID                 int               `json:"id" yaml:"id"`
	Name               string            `json:"name" yaml:"name"`
	Template           GroupTemplate     `json:"template" yaml:"template"`
	TemplateText       string            `json:"template_text" yaml:"template_text"`
	Users              []int             `json:"users" yaml:"users"`
	Admins             []int             `json:"admins" yaml:"admins"`
	DatastoreQuota     []UserDatastore   `json:"datastore_quota" yaml:"datastore_quota"`
	NetworkQuota       []UserNetwork     `json:"network_quota" yaml:"network_quota"`
	InstanceQuota      UserInstance      `json:"instance_quota" yaml:"instance_quota"`
	ImageQuota         []UserImage       `json:"image_quota" yaml:"image_quota"`
	DefaultGroupQuotas UserDefaultQuotas `json:"default_group_quotas" yaml:"default_group_quotas"`
}

Group is the API payload based on the legacy xmlrpc backend.

type GroupQuotaResponse

type GroupQuotaResponse struct {
	Quota UserDefaultQuotas `json:"quota"`
}

GroupQuotaResponse is the response body for GET /cloud/group/quota.

type GroupResponse

type GroupResponse struct {
	Group Group `json:"group"`
}

GroupResponse is the response body for GET /cloud/group.

type GroupService

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

GroupService owns the /cloud/group methods.

func (GroupService) AddGroupAdmin

AddGroupAdmin adds a group admin to the group with the given ID.

func (GroupService) CreateGroup

CreateGroup creates a new group.

func (GroupService) DeleteGroup

func (s GroupService) DeleteGroup(ctx context.Context, id int) error

DeleteGroup deletes the group with the given ID.

func (GroupService) DeleteGroupAdmin

func (s GroupService) DeleteGroupAdmin(ctx context.Context, id, user int) error

DeleteGroupAdmin deletes the group admin from the group with the given ID.

func (GroupService) Group

func (s GroupService) Group(ctx context.Context, id int) (*GroupResponse, error)

Group returns information about a group.

func (GroupService) GroupQuota

func (s GroupService) GroupQuota(ctx context.Context) (*GroupQuotaResponse, error)

GroupQuota returns the default group quota.

func (GroupService) Groups

func (s GroupService) Groups(ctx context.Context) (*GroupsResponse, error)

Groups returns information about all groups.

func (GroupService) SetGroupQuota

SetGroupQuota sets the quota for the group with the given ID.

func (GroupService) UpdateGroup

UpdateGroup updates the group with the given ID.

func (GroupService) UpdateGroupQuota

UpdateGroupQuota updates the default group quota.

type GroupTemplate

type GroupTemplate struct {
	Values   map[string]string `json:"values" yaml:"values"`
	Sunstone *SunstoneTemplate `json:"sunstone" yaml:"sunstone"`
}

GroupTemplate is the API payload based on the legacy xmlrpc backend.

type GroupsResponse

type GroupsResponse struct {
	Groups []Group `json:"groups"`
}

GroupsResponse is the response body for GET /cloud/group.

type HoldNetworkRequest

type HoldNetworkRequest struct {
	Template string `json:"template"`
}

HoldNetworkRequest is the request body for PATCH /cloud/network/{network}/hold.

type HoldNetworkResponse

type HoldNetworkResponse struct {
	Network int `json:"network"`
}

HoldNetworkResponse is the response body for PATCH /cloud/network/hold.

type Hook

type Hook struct {
	ID           int          `json:"id" yaml:"id"`
	Name         string       `json:"name" yaml:"name"`
	Type         string       `json:"type" yaml:"type"`
	Template     HookTemplate `json:"template" yaml:"template"`
	TemplateText string       `json:"template_text" yaml:"template_text"`
	HookLog      HookLog      `json:"hook_log" yaml:"hook_log"`
}

Hook is the API payload based on the legacy xmlrpc backend.

type HookExecutionRecord

type HookExecutionRecord struct {
	Values          map[string]string   `json:"values" yaml:"values"`
	HookID          int                 `json:"hook_id" yaml:"hook_id"`
	ExecutionID     int                 `json:"execution_id" yaml:"execution_id"`
	Timestamp       int                 `json:"timestamp" yaml:"timestamp"`
	Arguments       string              `json:"arguments" yaml:"arguments"`
	ExecutionResult HookExecutionResult `json:"execution_result" yaml:"execution_result"`
	RemoteHost      string              `json:"remote_host" yaml:"remote_host"`
	Retry           string              `json:"retry" yaml:"retry"`
}

HookExecutionRecord is the API payload based on the legacy xmlrpc backend.

type HookExecutionResult

type HookExecutionResult struct {
	Command string `json:"command" yaml:"command"`
	Stdout  string `json:"stdout" yaml:"stdout"`
	Stderr  string `json:"stderr" yaml:"stderr"`
	Code    string `json:"code" yaml:"code"`
}

HookExecutionResult is the API payload based on the legacy xmlrpc backend.

type HookLog

type HookLog struct {
	HookExecutionRecord []HookExecutionRecord `json:"execution_record" yaml:"execution_record"`
}

HookLog is the API payload based on the legacy xmlrpc backend.

type HookLogResponse

type HookLogResponse struct {
	HookLogs []HookLog `json:"hook_log"`
}

HookLogResponse is the response body for GET /cloud/hook/log.

type HookResponse

type HookResponse struct {
	Hook Hook `json:"hook"`
}

HookResponse is the response body for GET /cloud/hook.

type HookService

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

HookService own the /cloud/hook methods.

func (HookService) CreateHook

CreateHook creates a new hook.

func (HookService) DeleteHook

func (s HookService) DeleteHook(ctx context.Context, id int) error

DeleteHook deletes the hook with the given id.

func (HookService) Hook

func (s HookService) Hook(ctx context.Context, id int) (*HookResponse, error)

Hook returns information about a hook.

func (HookService) HookLog

func (s HookService) HookLog(ctx context.Context, id int, start, end string) (*HookLogResponse, error)

HookLog returns the logs for a hook.

func (HookService) Hooks

func (s HookService) Hooks(ctx context.Context) (*HooksResponse, error)

Hooks returns information about all hooks.

func (HookService) LockHook

func (s HookService) LockHook(ctx context.Context, id int, req LockHookRequest) (*LockHookResponse, error)

LockHook locks the hook with the given id.

func (HookService) RenameHook

func (s HookService) RenameHook(ctx context.Context, id int, req RenameHookRequest) (*RenameHookResponse, error)

RenameHook renames the hook with the given id.

func (HookService) RetryHook

func (s HookService) RetryHook(ctx context.Context, id int, req RetryHookRequest) (*RetryHookResponse, error)

RetryHook retries the hook with the given id.

func (HookService) UnlockHook

func (s HookService) UnlockHook(ctx context.Context, id int, req UnlockHookRequest) (*UnlockHookResponse, error)

UnlockHook unlocks the hook with the given id.

func (HookService) UpdateHook

func (s HookService) UpdateHook(ctx context.Context, id int, req UpdateHookRequest) (*UpdateHookResponse, error)

UpdateHook updates the hook with the given id.

type HookTemplate

type HookTemplate struct {
	Values         map[string]string `json:"values" yaml:"values"`
	Arguments      string            `json:"arguments" yaml:"arguments"`
	ArgumentsStdin string            `json:"arguments_stdin" yaml:"arguments_stdin"`
	Call           string            `json:"call" yaml:"call"`
	Command        string            `json:"command" yaml:"command"`
	Remote         string            `json:"remote" yaml:"remote"`
	Resource       string            `json:"resource" yaml:"resource"`
	State          string            `json:"state" yaml:"state"`
	LcmState       string            `json:"lcm_state" yaml:"lcm_state"`
}

HookTemplate is the API payload based on the legacy xmlrpc backend.

type HooksResponse

type HooksResponse struct {
	Hooks []Hook `json:"hook"`
}

HooksResponse is the response body for GET /cloud/hook.

type Host

type Host struct {
	ID                    int            `json:"id" yaml:"id"`
	Name                  string         `json:"name" yaml:"name"`
	State                 int            `json:"state" yaml:"state"`
	PrevState             int            `json:"prev_state" yaml:"prev_state"`
	InformationManagerMAD string         `json:"information_manager_mad" yaml:"information_manager_mad"`
	InstanceMAD           string         `json:"instance_mad" yaml:"instance_mad"`
	ClusterID             int            `json:"cluster_id" yaml:"cluster_id"`
	Cluster               string         `json:"cluster" yaml:"cluster"`
	HostShare             HostShare      `json:"host_share" yaml:"host_share"`
	Instances             []int          `json:"instances" yaml:"instances"`
	Template              HostTemplate   `json:"template" yaml:"template"`
	TemplateText          string         `json:"template_text" yaml:"template_text"`
	Monitoring            HostMonitoring `json:"monitoring" yaml:"monitoring"`
}

Host is the API payload based on the legacy xmlrpc backend.

type HostMonitoring

type HostMonitoring struct {
	Timestamp int      `json:"timestamp" yaml:"timestamp"`
	ID        int      `json:"id" yaml:"id"`
	Capacity  Capacity `json:"capacity" yaml:"capacity"`
	System    System   `json:"system" yaml:"system"`
}

HostMonitoring is the API payload based on the legacy xmlrpc backend.

type HostMonitoringResponse

type HostMonitoringResponse struct {
	Monitoring []HostMonitoring `json:"monitoring"`
}

HostMonitoringResponse is the response body for GET /cloud/host/monitoring.

type HostResponse

type HostResponse struct {
	Host Host `json:"host"`
}

HostResponse is the response body for GET /cloud/host.

type HostService

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

HostService owns the /cloud/compute methods.

func (HostService) CreateHost

CreateHost creates a new compute host.

func (HostService) DeleteHost

func (s HostService) DeleteHost(ctx context.Context, id int) error

DeleteHost deletes the compute host with the given ID.

func (HostService) Host

func (s HostService) Host(ctx context.Context, id int) (*HostResponse, error)

Host returns information about a compute host.

func (HostService) HostMonitoring

func (s HostService) HostMonitoring(ctx context.Context, id int) (*HostMonitoringResponse, error)

HostMonitoring returns monitoring data for a compute host.

func (HostService) Hosts

func (s HostService) Hosts(ctx context.Context) (*HostsResponse, error)

Hosts returns information about all compute hosts.

func (HostService) HostsMonitoring

func (s HostService) HostsMonitoring(ctx context.Context, interval time.Duration) (*HostsMonitoringResponse, error)

HostsMonitoring returns monitoring data for all compute hosts.

func (HostService) RenameHost

func (s HostService) RenameHost(ctx context.Context, id int, req RenameHostRequest) (*RenameHostResponse, error)

RenameHost renames the compute host with the given ID.

func (HostService) SetHostStatus

SetHostStatus sets the status of the compute host with the given ID.

func (HostService) UpdateComputeHost

func (s HostService) UpdateComputeHost(ctx context.Context, id int, req UpdateHostRequest) (*UpdateHostResponse, error)

UpdateComputeHost updates the compute host with the given ID.

type HostShare

type HostShare struct {
	MemUsage         int        `json:"mem_usage" yaml:"mem_usage"`
	CPUUsage         int        `json:"cpuusage" yaml:"cpuusage"`
	TotalMem         int        `json:"total_mem" yaml:"total_mem"`
	TotalCPU         int        `json:"total_cpu" yaml:"total_cpu"`
	MaxMem           int        `json:"max_mem" yaml:"max_mem"`
	MaxCPU           int        `json:"max_cpu" yaml:"max_cpu"`
	RunningInstances int        `json:"running_instances" yaml:"running_instances"`
	InstancessThread int        `json:"instances_thread" yaml:"instances_thread"`
	Datastores       Datastores `json:"datastores" yaml:"datastores"`
	PCIDevices       []PCI      `json:"pcidevices" yaml:"pcidevices"`
	NumaNodes        []Node     `json:"numa_nodes" yaml:"numa_nodes"`
}

HostShare is the API payload based on the legacy xmlrpc backend.

type HostTemplate

type HostTemplate struct {
	Values                  map[string]string      `json:"values" yaml:"values"`
	Arch                    string                 `json:"arch" yaml:"arch"`
	CGroupsVersion          string                 `json:"cgroups_version" yaml:"cgroups_version"`
	CPUSpeed                int                    `json:"cpuspeed" yaml:"cpuspeed"`
	Hostname                string                 `json:"hostname" yaml:"hostname"`
	Hypervisor              string                 `json:"hypervisor" yaml:"hypervisor"`
	IMMAD                   string                 `json:"im_mad" yaml:"im_mad"`
	KVMCPUModel             string                 `json:"kvm_cpumodel" yaml:"kvm_cpumodel"`
	KVMCPUModels            []string               `json:"kvm_cpumodels" yaml:"kvm_cpumodels"`
	KVMMachines             []string               `json:"kvm_machines" yaml:"kvm_machines"`
	ModelName               string                 `json:"modelname" yaml:"modelname"`
	ReservedCPU             string                 `json:"reserved_cpu" yaml:"reserved_cpu"`
	ReservedMem             string                 `json:"reserved_mem" yaml:"reserved_mem"`
	TotalWilds              int                    `json:"total_wilds" yaml:"total_wilds"`
	Version                 string                 `json:"version" yaml:"version"`
	Instance                []HostTemplateInstance `json:"instance" yaml:"instance"`
	InstanceMAD             string                 `json:"instance_mad" yaml:"instance_mad"`
	Wilds                   string                 `json:"wilds" yaml:"wilds"`
	VCenterCCRRef           string                 `json:"vcenter_ccrref" yaml:"vcenter_ccrref"`
	VCenterDSRef            []string               `json:"vcenter_dsref" yaml:"vcenter_dsref"`
	VCenterHost             string                 `json:"vcenter_host" yaml:"vcenter_host"`
	VCenterInstanceID       string                 `json:"vcenter_instance_id" yaml:"vcenter_instance_id"`
	VCenterName             string                 `json:"vcenter_name" yaml:"vcenter_name"`
	VCenterPassword         string                 `json:"vcenter_password" yaml:"vcenter_password"`
	VCenterResourcePoolInfo []string               `json:"vcenter_resource_pool_info" yaml:"vcenter_resource_pool_info"`
	VCenterUser             string                 `json:"vcenter_user" yaml:"vcenter_user"`
	VCenterVersion          string                 `json:"vcenter_version" yaml:"vcenter_version"`
}

HostTemplate is the API payload based on the legacy xmlrpc backend.

type HostTemplateInstance

type HostTemplateInstance struct {
	Values   map[string]string `json:"values" yaml:"values"`
	DeployID string            `json:"deploy_id" yaml:"deploy_id"`
	ID       int               `json:"id" yaml:"id"`
	Monitor  string            `json:"monitor" yaml:"monitor"`
}

HostTemplateInstance is the API payload based on the legacy xmlrpc backend.

type HostsMonitoringResponse

type HostsMonitoringResponse struct {
	Monitoring []HostMonitoring `json:"monitoring"`
}

HostsMonitoringResponse is the response body for GET /cloud/host/monitoring.

type HostsResponse

type HostsResponse struct {
	Hosts []Host `json:"hosts"`
}

HostsResponse is the response body for GET /cloud/host.

type HugePage

type HugePage struct {
	Free  int `json:"free" yaml:"free"`
	Pages int `json:"pages" yaml:"pages"`
	Size  int `json:"size" yaml:"size"`
	Usage int `json:"usage" yaml:"usage"`
}

HugePage is the API payload based on the legacy xmlrpc backend.

type HyperCloudConfiguration

type HyperCloudConfiguration struct {
	APIListOrder                     []string               `json:"api_list_order" yaml:"api_list_order"`
	AuthMAD                          []config.AuthMAD       `json:"auth_mad" yaml:"auth_mad"`
	AuthMADConf                      []config.AuthMADConf   `json:"auth_madconf" yaml:"auth_madconf"`
	ClusterEncryptedAttr             []string               `json:"cluster_encrypted_attr" yaml:"cluster_encrypted_attr"`
	DatastoreCapacityCheck           []string               `json:"datastore_capacity_check" yaml:"datastore_capacity_check"`
	DatastoreEncryptedAttr           []string               `json:"datastore_encrypted_attr" yaml:"datastore_encrypted_attr"`
	DatastoreLocation                []string               `json:"datastore_location" yaml:"datastore_location"`
	DatastoreMAD                     []config.DatastoreMAD  `json:"datastore_mad" yaml:"datastore_mad"`
	DB                               config.DB              `json:"db" yaml:"db"`
	DefaultAuth                      []string               `json:"default_auth" yaml:"default_auth"`
	DefaultCdromDevicePrefix         []string               `json:"default_cdrom_device_prefix" yaml:"default_cdrom_device_prefix"`
	DefaultCost                      []config.DefaultCost   `json:"default_cost" yaml:"default_cost"`
	DefaultDevicePrefix              []string               `json:"default_device_prefix" yaml:"default_device_prefix"`
	DefaultImagePersistent           []string               `json:"default_image_persistent" yaml:"default_image_persistent"`
	DefaultImagePersistentNew        []string               `json:"default_image_persistent_new" yaml:"default_image_persistent_new"`
	DefaultImageType                 []string               `json:"default_image_type" yaml:"default_image_type"`
	DefaultUmask                     []string               `json:"default_umask" yaml:"default_umask"`
	DefaultVDCClusterDatastoreACL    []string               `json:"default_vdccluster_datastore_acl" yaml:"default_vdccluster_datastore_acl"`
	DefaultVDCClusterHostACL         []string               `json:"default_vdccluster_host_acl" yaml:"default_vdccluster_host_acl"`
	DefaultVDCClusterNetACL          []string               `json:"default_vdccluster_net_acl" yaml:"default_vdccluster_net_acl"`
	DefaultVDCDatastoreACL           []string               `json:"default_vdcdatastore_acl" yaml:"default_vdcdatastore_acl"`
	DefaultVDCHostACL                []string               `json:"default_vdchost_acl" yaml:"default_vdchost_acl"`
	DefaultVDCVnetACL                []string               `json:"default_vdcvnet_acl" yaml:"default_vdcvnet_acl"`
	DocumentEncryptedAttr            []string               `json:"document_encrypted_attr" yaml:"document_encrypted_attr"`
	DSMADConf                        []config.DSMADConf     `json:"dsmadconf" yaml:"dsmadconf"`
	DSMonitorInstanceDisk            int                    `json:"dsmonitor_instance_disk" yaml:"dsmonitor_instance_disk"`
	EnableOtherPermissions           string                 `json:"enable_other_permissions" yaml:"enable_other_permissions"`
	Federation                       config.Federation      `json:"federation" yaml:"federation"`
	GroupRestrictedAttr              []string               `json:"group_restricted_attr" yaml:"group_restricted_attr"`
	HookManagerMAD                   config.HookManagerMAD  `json:"hook_manager_mad" yaml:"hook_manager_mad"`
	HookLogConf                      config.HookLogConf     `json:"hook_log_conf" yaml:"hook_log_conf"`
	HostEncryptedAttr                []string               `json:"host_encrypted_attr" yaml:"host_encrypted_attr"`
	ImageEncryptedAttr               []string               `json:"image_encrypted_attr" yaml:"image_encrypted_attr"`
	ImageRestrictedAttr              []string               `json:"image_restricted_attr" yaml:"image_restricted_attr"`
	ImMAD                            []config.ImMAD         `json:"im_mad" yaml:"im_mad"`
	InheritDatastoreAttr             []string               `json:"inherit_datastore_attr" yaml:"inherit_datastore_attr"`
	InheritImageAttr                 []string               `json:"inherit_image_attr" yaml:"inherit_image_attr"`
	InheritVnetAttr                  []string               `json:"inherit_vnet_attr" yaml:"inherit_vnet_attr"`
	IpamMAD                          []config.IpamMAD       `json:"ipam_mad" yaml:"ipam_mad"`
	KeepaliveMaxConn                 []int                  `json:"keepalive_max_conn" yaml:"keepalive_max_conn"`
	KeepaliveTimeout                 []int                  `json:"keepalive_timeout" yaml:"keepalive_timeout"`
	ListenAddress                    []string               `json:"listen_address" yaml:"listen_address"`
	Log                              []config.Log           `json:"log" yaml:"log"`
	LogCallFormat                    []string               `json:"log_call_format" yaml:"log_call_format"`
	MACPrefix                        []string               `json:"macprefix" yaml:"macprefix"`
	ManagerTimer                     []int                  `json:"manager_timer" yaml:"manager_timer"`
	MarketMAD                        []config.MarketMAD     `json:"market_mad" yaml:"market_mad"`
	MarketMADConf                    []config.MarketMADConf `json:"market_madconf" yaml:"market_madconf"`
	MaxConn                          int                    `json:"max_conn" yaml:"max_conn"`
	MaxConnBacklog                   int                    `json:"max_conn_backlog" yaml:"max_conn_backlog"`
	MessageSize                      int                    `json:"message_size" yaml:"message_size"`
	MonitoringIntervalDatastore      int                    `json:"monitoring_interval_datastore" yaml:"monitoring_interval_datastore"`
	MonitoringIntervalDBUpdate       int                    `json:"monitoring_interval_dbupdate" yaml:"monitoring_interval_dbupdate"`
	MonitoringIntervalHost           int                    `json:"monitoring_interval_host" yaml:"monitoring_interval_host"`
	MonitoringIntervalMarket         int                    `json:"monitoring_interval_market" yaml:"monitoring_interval_market"`
	MonitoringIntervalInstance       int                    `json:"monitoring_interval_instance" yaml:"monitoring_interval_instance"`
	NetworkSize                      int                    `json:"network_size" yaml:"network_size"`
	Key                              []string               `json:"one_key" yaml:"one_key"`
	PCIPassthroughBus                string                 `json:"pcipassthrough_bus" yaml:"pcipassthrough_bus"`
	Port                             int                    `json:"port" yaml:"port"`
	Raft                             config.Raft            `json:"raft" yaml:"raft"`
	RPCLog                           string                 `json:"rpclog" yaml:"rpclog"`
	ScriptsRemoteDir                 string                 `json:"scripts_remote_dir" yaml:"scripts_remote_dir"`
	SessionExpirationTime            int                    `json:"session_expiration_time" yaml:"session_expiration_time"`
	ShowbackOnlyRunning              string                 `json:"showback_only_running" yaml:"showback_only_running"`
	Timeout                          int                    `json:"timeout" yaml:"timeout"`
	TmMAD                            []config.TmMAD         `json:"tm_mad" yaml:"tm_mad"`
	TmMADConf                        []config.TmMADConf     `json:"tm_madconf" yaml:"tm_madconf"`
	UserEncryptedAttr                []string               `json:"user_encrypted_attr" yaml:"user_encrypted_attr"`
	UserRestrictedAttr               []string               `json:"user_restricted_attr" yaml:"user_restricted_attr"`
	VLANIDs                          config.VLANIDs         `json:"vlanids" yaml:"vlanids"`
	InstanceAdminOperations          string                 `json:"instance_admin_operations" yaml:"instance_admin_operations"`
	InstanceEncryptedAttr            []string               `json:"instance_encrypted_attr" yaml:"instance_encrypted_attr"`
	InstanceMAD                      []config.InstanceMAD   `json:"instance_mad" yaml:"instance_mad"`
	InstanceManageOperations         string                 `json:"instance_manage_operations" yaml:"instance_manage_operations"`
	InstanceMonitoringExpirationTime []string               `json:"instance_monitoring_expiration_time" yaml:"instance_monitoring_expiration_time"`
	InstanceRestrictedAttr           []string               `json:"instance_restricted_attr" yaml:"instance_restricted_attr"`
	InstanceSnapshotFactor           string                 `json:"instance_snapshot_factor" yaml:"instance_snapshot_factor"`
	InstanceSubmitOnHold             string                 `json:"instance_submit_on_hold" yaml:"instance_submit_on_hold"`
	InstanceUseOperations            []string               `json:"instance_use_operations" yaml:"instance_use_operations"`
	VNCPorts                         config.VNCPorts        `json:"vncports" yaml:"vncports"`
	VNetEncryptedAttr                []string               `json:"vnet_encrypted_attr" yaml:"vnet_encrypted_attr"`
	VNetRestrictedAttr               []string               `json:"vnet_restricted_attr" yaml:"vnet_restricted_attr"`
	VNMADConf                        []config.VNetMADConf   `json:"vnmadconf" yaml:"vnmadconf"`
	VxlanIDs                         config.VxlanIDs        `json:"vxlan_ids" yaml:"vxlan_ids"`
}

HyperCloudConfiguration is the API payload based on the legacy xmlrpc backend.

type Image

type Image struct {
	ID               int                `json:"id" yaml:"id"`
	UserID           int                `json:"user_id" yaml:"user_id"`
	GroupID          int                `json:"group_id" yaml:"group_id"`
	UserName         string             `json:"user_name" yaml:"user_name"`
	GroupName        string             `json:"group_name" yaml:"group_name"`
	Name             string             `json:"name" yaml:"name"`
	Lock             Lock               `json:"lock" yaml:"lock"`
	Permissions      Permissions        `json:"permissions" yaml:"permissions"`
	Type             int                `json:"type" yaml:"type"`
	DiskType         int                `json:"disk_type" yaml:"disk_type"`
	Persistent       int                `json:"persistent" yaml:"persistent"`
	RegistrationTime time.Time          `json:"registration_time" yaml:"registration_time"`
	Source           string             `json:"source" yaml:"source"`
	Path             string             `json:"path" yaml:"path"`
	Format           string             `json:"format" yaml:"format"`
	Filesystem       string             `json:"filesystem" yaml:"filesystem"`
	Size             int                `json:"size" yaml:"size"`
	State            int                `json:"state" yaml:"state"`
	PrevState        int                `json:"prev_state" yaml:"prev_state"`
	RunningInstances int                `json:"running_instances" yaml:"running_instances"`
	CloningOps       int                `json:"cloning_ops" yaml:"cloning_ops"`
	CloningID        int                `json:"cloning_id" yaml:"cloning_id"`
	TargetSnapshot   int                `json:"target_snapshot" yaml:"target_snapshot"`
	DatastoreID      int                `json:"datastore_id" yaml:"datastore_id"`
	Datastore        string             `json:"datastore" yaml:"datastore"`
	Instances        []int              `json:"instances" yaml:"instances"`
	Clones           []int              `json:"clones" yaml:"clones"`
	AppClones        []int              `json:"app_clones" yaml:"app_clones"`
	Template         ImageTemplate      `json:"template" yaml:"template"`
	TemplateText     string             `json:"template_text" yaml:"template_text"`
	Snapshots        instance.Snapshots `json:"snapshots" yaml:"snapshots"`
}

Image is the API payload based on the legacy xmlrpc backend.

type ImageResponse

type ImageResponse struct {
	Image Image `json:"image"`
}

ImageResponse is the response body for GET /cloud/image.

type ImageService

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

ImageService owns the /cloud/image methods.

func (ImageService) ChangeImageOwnership

ChangeImageOwnership changes the ownership of the image with the given ID.

func (ImageService) ChangeImagePermissions

ChangeImagePermissions changes the permissions of the image with the given ID.

func (ImageService) ChangeImageType

ChangeImageType changes the type of the image with the given ID.

func (ImageService) CloneImage

func (s ImageService) CloneImage(ctx context.Context, id int, req CloneImageRequest) (*CloneImageResponse, error)

CloneImage clones the image with the given ID.

func (ImageService) CreateImage

CreateImage creates a new image.

func (ImageService) DeleteImage

func (s ImageService) DeleteImage(ctx context.Context, id int) error

DeleteImage deletes the image with the given ID.

func (ImageService) DeleteImageSnapshot

func (s ImageService) DeleteImageSnapshot(ctx context.Context, id, snapshot int) error

DeleteImageSnapshot deletes a snapshot for the image with the given ID.

func (ImageService) EnableImage

EnableImage enables the image with the given ID.

func (ImageService) FlattenImageSnapshot

func (s ImageService) FlattenImageSnapshot(ctx context.Context, id, snapshot int) (*FlattenImageSnapshotResponse, error)

FlattenImageSnapshot flattens the snapshot of the image with the given ID.

func (ImageService) Image

func (s ImageService) Image(ctx context.Context, id int) (*ImageResponse, error)

Image returns information about a image.

func (ImageService) Images

func (s ImageService) Images(ctx context.Context) (*ImagesResponse, error)

Images returns information about all images.

func (ImageService) LockImage

func (s ImageService) LockImage(ctx context.Context, id int, req LockImageRequest) (*LockImageResponse, error)

LockImage locks the image with the given ID.

func (ImageService) RenameImage

RenameImage renames the image with the given ID.

func (ImageService) RevertImageSnapshot

func (s ImageService) RevertImageSnapshot(ctx context.Context, id, snapshot int) (*RevertImageSnapshotResponse, error)

RevertImageSnapshot reverts the snapshot of the image with the given ID.

func (ImageService) SetImagePersistent

SetImagePersistent sets the image with the given ID to be persistent.

func (ImageService) UnlockImage

func (s ImageService) UnlockImage(ctx context.Context, id int) (*UnlockImageResponse, error)

UnlockImage unlocks the image with the given ID.

func (ImageService) UpdateImage

UpdateImage updates the image with the given ID.

type ImageTemplate

type ImageTemplate struct {
	Values          map[string]string `json:"values" yaml:"values"`
	DevPrefix       string            `json:"dev_prefix" yaml:"dev_prefix"`
	Driver          string            `json:"driver" yaml:"driver"`
	FromApp         string            `json:"from_app" yaml:"from_app"`
	FromAppMD5      string            `json:"from_app_md5" yaml:"from_app_md5"`
	FromAppName     string            `json:"from_app_name" yaml:"from_app_name"`
	Size            int               `json:"size" yaml:"size"`
	VCenterImported string            `json:"vcenter_imported" yaml:"vcenter_imported"`
}

ImageTemplate is the API payload based on the legacy xmlrpc backend.

type ImageType

type ImageType int

ImageType is the type of image.

const (
	OS ImageType
	CDROM
	DataBlock
	Kernel
	RAMDisk
	Context
)

ImageType values.

func ImageTypeString

func ImageTypeString(s string) (ImageType, error)

ImageTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ImageTypeValues

func ImageTypeValues() []ImageType

ImageTypeValues returns all values of the enum

func (ImageType) IsAImageType

func (i ImageType) IsAImageType() bool

IsAImageType returns "true" if the value is listed in the enum definition. "false" otherwise

func (ImageType) MarshalText

func (i ImageType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ImageType

func (ImageType) String

func (i ImageType) String() string

func (*ImageType) UnmarshalText

func (i *ImageType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ImageType

func (ImageType) V1

func (i ImageType) V1() hc.ImageType

V1 returns the v1 hc.ImageType that corresponds to the ImageType.

type ImagesResponse

type ImagesResponse struct {
	Images []Image `json:"images"`
}

ImagesResponse is the response body for GET /cloud/image.

type Instance

type Instance struct {
	ID               int                      `json:"id" yaml:"id"`
	UserID           int                      `json:"user_id" yaml:"user_id"`
	GroupID          int                      `json:"group_id" yaml:"group_id"`
	UserName         string                   `json:"user_name" yaml:"user_name"`
	GroupName        string                   `json:"group_name" yaml:"group_name"`
	Name             string                   `json:"name" yaml:"name"`
	Permissions      Permissions              `json:"permissions" yaml:"permissions"`
	LastPoll         api.Time                 `json:"last_poll" yaml:"last_poll"`
	State            instance.State           `json:"state" yaml:"state"`
	LCMState         LCMState                 `json:"lcm_state" yaml:"lcm_state"`
	PrevState        instance.State           `json:"prev_state" yaml:"prev_state"`
	PrevLCMState     LCMState                 `json:"prev_lcm_state" yaml:"prev_lcm_state"`
	Reschedule       bool                     `json:"reschedule" yaml:"reschedule"`
	StartTime        api.Time                 `json:"start_time" yaml:"start_time"`
	EndTime          api.Time                 `json:"end_time" yaml:"end_time"`
	DeployID         string                   `json:"deploy_id" yaml:"deploy_id"`
	Monitoring       instance.Monitoring      `json:"monitoring" yaml:"monitoring"`
	Template         instance.Template        `json:"template" yaml:"template"`
	TemplateText     string                   `json:"template_text" yaml:"template_text"`
	UserTemplate     instance.UserTemplate    `json:"user_template" yaml:"user_template"`
	UserTemplateText string                   `json:"user_template_text" yaml:"user_template_text"`
	HistoryRecords   []instance.History       `json:"history_records" yaml:"history_records"`
	Snapshots        []instance.DiskSnapshots `json:"snapshots" yaml:"snapshots"`
}

Instance is the API payload based on the legacy xmlrpc backend.

func (*Instance) Hostname

func (i *Instance) Hostname() string

Hostname returns the hostname of the instance.

type InstanceGroup

type InstanceGroup struct {
	ID           int                   `json:"id" yaml:"id"`
	UID          int                   `json:"uid" yaml:"uid"`
	GID          int                   `json:"gid" yaml:"gid"`
	UserName     string                `json:"user_name" yaml:"user_name"`
	GroupName    string                `json:"group_name" yaml:"group_name"`
	Name         string                `json:"name" yaml:"name"`
	Permissions  Permissions           `json:"permissions" yaml:"permissions"`
	Lock         Lock                  `json:"lock" yaml:"lock"`
	Roles        []instance.GroupRole  `json:"roles" yaml:"roles"`
	Template     InstanceGroupTemplate `json:"template" yaml:"template"`
	TemplateText string                `json:"template_text" yaml:"template_text"`
}

InstanceGroup is the API payload based on the legacy xmlrpc backend.

type InstanceGroupResponse

type InstanceGroupResponse struct {
	InstanceGroup InstanceGroup `json:"instance_group"`
}

InstanceGroupResponse is the response body for GET /cloud/instance-group.

type InstanceGroupTemplate

type InstanceGroupTemplate struct {
	Values map[string]string `json:"values" yaml:"values"`
}

InstanceGroupTemplate is the API payload based on the legacy xmlrpc backend.

type InstanceGroupsResponse

type InstanceGroupsResponse struct {
	InstanceGroups []InstanceGroup `json:"instance_groups"`
}

InstanceGroupsResponse is the response body for GET /cloud/instance-group.

type InstanceMonitoringResponse

type InstanceMonitoringResponse struct {
	Monitoring []instance.Monitoring `json:"monitoring"`
}

InstanceMonitoringResponse is the response body for GET /cloud/instance/monitoring/{id}.

type InstanceRecovery

type InstanceRecovery int

InstanceRecovery is the recovery action to take when an instance is in error.

const (
	FailureRecovery        InstanceRecovery = iota // failure
	SuccessRecovery                                // success
	RetryRecovery                                  // retry
	DeleteRecovery                                 // delete
	DeleteRecreateRecovery                         // delete_recreate
	DeleteDBVNRecovery                             // delete_dbvn
)

InstanceRecovery values.

func InstanceRecoveryString

func InstanceRecoveryString(s string) (InstanceRecovery, error)

InstanceRecoveryString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func InstanceRecoveryValues

func InstanceRecoveryValues() []InstanceRecovery

InstanceRecoveryValues returns all values of the enum

func (InstanceRecovery) IsAInstanceRecovery

func (i InstanceRecovery) IsAInstanceRecovery() bool

IsAInstanceRecovery returns "true" if the value is listed in the enum definition. "false" otherwise

func (InstanceRecovery) MarshalText

func (i InstanceRecovery) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for InstanceRecovery

func (InstanceRecovery) String

func (i InstanceRecovery) String() string

func (*InstanceRecovery) UnmarshalText

func (i *InstanceRecovery) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for InstanceRecovery

func (InstanceRecovery) V1

V1 returns the v1 hc.InstanceRecovery that corresponds to the InstanceRecovery.

type InstanceResponse

type InstanceResponse struct {
	Instance LockedInstance `json:"instance"`
}

InstanceResponse is the response body for GET /cloud/instance/{instance}.

type InstanceService

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

InstanceService owns the /cloud/instance and /cloud/instance-group methods.

func (InstanceService) AddInstanceSchedule

AddInstanceSchedule adds a schedule to the instance with the given id.

func (InstanceService) AddInstanceSecurityGroup

func (s InstanceService) AddInstanceSecurityGroup(ctx context.Context, id, nic, sg int) (*AddInstanceSecurityGroupResponse, error)

AddInstanceSecurityGroup adds a security group to the instance with the given id.

func (InstanceService) CalculateInstancesShowback

func (s InstanceService) CalculateInstancesShowback(ctx context.Context, req CalculateInstancesShowbackRequest) error

CalculateInstancesShowback calculates the showback for all the instances.

func (InstanceService) ChangeInstanceGroupOwnership

ChangeInstanceGroupOwnership changes the ownership of the instance group with the given ID.

func (InstanceService) ChangeInstanceGroupPermissions

ChangeInstanceGroupPermissions changes the permissions of the instance group with the given ID.

func (InstanceService) ChangeInstanceOwnership

ChangeInstanceOwnership changes the ownership of the instance with the given id.

func (InstanceService) ChangeInstancePermissions

ChangeInstancePermissions changes the permissions of the instance with the given id.

func (InstanceService) CreateInstance

CreateInstance creates a new instance.

func (InstanceService) CreateInstanceDisk

CreateInstanceDisk creates a new disk for the instance with the given id.

func (InstanceService) CreateInstanceDiskImage

CreateInstanceDiskImage creates a new disk image for the instance with the given id.

func (InstanceService) CreateInstanceDiskSnapshot

CreateInstanceDiskSnapshot creates a new disk snapshot for the instance with the given id.

func (InstanceService) CreateInstanceNIC

CreateInstanceNIC creates a new NIC for the instance with the given id.

func (InstanceService) CreateInstanceSnapshot

CreateInstanceSnapshot creates a new snapshot for the instance with the given id.

func (InstanceService) CreateVNCProxy

CreateVNCProxy creates a new VNC proxy on the server for a specific VM.

func (InstanceService) DeleteInstanceDisk

func (s InstanceService) DeleteInstanceDisk(ctx context.Context, id, disk int) error

DeleteInstanceDisk deletes a disk from the instance with the given id.

func (InstanceService) DeleteInstanceDiskSnapshot

func (s InstanceService) DeleteInstanceDiskSnapshot(ctx context.Context, id, disk, snapshot int) error

DeleteInstanceDiskSnapshot deletes a snapshot from the instance with the given id.

func (InstanceService) DeleteInstanceGroup

func (s InstanceService) DeleteInstanceGroup(ctx context.Context, id int) error

DeleteInstanceGroup deletes the instance group with the given ID.

func (InstanceService) DeleteInstanceNIC

func (s InstanceService) DeleteInstanceNIC(ctx context.Context, id, nic int) error

DeleteInstanceNIC deletes a NIC from the instance with the given id.

func (InstanceService) DeleteInstanceSchedule

func (s InstanceService) DeleteInstanceSchedule(ctx context.Context, id, schedule int) error

DeleteInstanceSchedule deletes a schedule from the instance with the given id.

func (InstanceService) DeleteInstanceSecurityGroup

func (s InstanceService) DeleteInstanceSecurityGroup(ctx context.Context, id, nic int) error

DeleteInstanceSecurityGroup deletes a security group from the instance with the given id.

func (InstanceService) DeleteInstanceSnapshot

func (s InstanceService) DeleteInstanceSnapshot(ctx context.Context, id, snapshot int) error

DeleteInstanceSnapshot deletes a snapshot from the instance with the given id.

func (InstanceService) DeployInstance

DeployInstance deploys the instance with the given id.

func (InstanceService) Instance

func (s InstanceService) Instance(ctx context.Context, id int) (*InstanceResponse, error)

Instance returns the Instance for the given id.

func (InstanceService) InstanceGroup

func (s InstanceService) InstanceGroup(ctx context.Context, id int) (*InstanceGroupResponse, error)

InstanceGroup returns information about an instance group.

func (InstanceService) InstanceGroups

func (s InstanceService) InstanceGroups(ctx context.Context) (*InstanceGroupsResponse, error)

InstanceGroups returns information about all instance groups.

func (InstanceService) InstanceMonitoringData

func (s InstanceService) InstanceMonitoringData(ctx context.Context, id int) (*InstanceMonitoringResponse, error)

InstanceMonitoringData returns monitoring data for id.

func (InstanceService) InstanceShowback

func (s InstanceService) InstanceShowback(ctx context.Context, filter Filter, monthStart, monthEnd time.Month, yearStart, yearEnd int) (*InstancesShowbackResponse, error)

InstanceShowback returns showback data for a set of instances.

func (InstanceService) Instances

func (s InstanceService) Instances(ctx context.Context, state instance.State, extended bool) (*InstancesResponse, error)

Instances returns a slice of all the Instances in the given state.

func (InstanceService) InstancesAccountingData

func (s InstanceService) InstancesAccountingData(ctx context.Context, filter Filter, start, end time.Time) (*InstancesAccountingResponse, error)

InstancesAccountingData returns accounting data for a set of instances.

func (InstanceService) InstancesMonitoringData

func (s InstanceService) InstancesMonitoringData(ctx context.Context, filter Filter, seconds int) (*InstancesMonitoringResponse, error)

InstancesMonitoringData returns monitoring data for a set of instances.

func (InstanceService) InstancesSet

func (s InstanceService) InstancesSet(ctx context.Context, ids ...int) (*InstancesResponse, error)

InstancesSet returns a slice of Instances.

func (InstanceService) LockInstance

LockInstance locks the instance with the given id.

func (InstanceService) LockInstanceGroup

LockInstanceGroup locks the instance group with the given ID.

func (InstanceService) MoveInstance

MoveInstance moves the instance with the given id.

func (InstanceService) RecoverInstance

RecoverInstance recovers the instance with the given id.

func (InstanceService) RenameInstance

RenameInstance renames the instance with the given id.

func (InstanceService) RenameInstanceDiskSnapshot

func (s InstanceService) RenameInstanceDiskSnapshot(ctx context.Context, id, disk, snapshot int, req RenameInstanceDiskSnapshotRequest) (*RenameInstanceDiskSnapshotResponse, error)

RenameInstanceDiskSnapshot renames the disk snapshot for the instance with the given id.

func (InstanceService) RenameInstanceGroup

RenameInstanceGroup renames the instance group with the given ID.

func (InstanceService) ResizeInstance

ResizeInstance resizes the instance with the given id.

func (InstanceService) ResizeInstanceDisk

func (s InstanceService) ResizeInstanceDisk(ctx context.Context, id, disk int, req ResizeInstanceDiskRequest) (*ResizeInstanceDiskResponse, error)

ResizeInstanceDisk resizes the disk for the instance with the given id.

func (InstanceService) RevertInstanceDiskSnapshot

func (s InstanceService) RevertInstanceDiskSnapshot(ctx context.Context, id, disk, snapshot int) (*RevertInstanceDiskSnapshotResponse, error)

RevertInstanceDiskSnapshot reverts the disk snapshot for the instance with the given id.

func (InstanceService) RevertInstanceSnapshot

func (s InstanceService) RevertInstanceSnapshot(ctx context.Context, id, snapshot int) (*RevertInstanceSnapshotResponse, error)

RevertInstanceSnapshot reverts the snapshot for the instance with the given id.

func (InstanceService) SetInstanceAction

SetInstanceAction sets the action for the instance with the given id.

func (InstanceService) UnlockInstance

func (s InstanceService) UnlockInstance(ctx context.Context, id int) (*UnlockInstanceResponse, error)

UnlockInstance unlocks the instance with the given id.

func (InstanceService) UnlockInstanceGroup

func (s InstanceService) UnlockInstanceGroup(ctx context.Context, id int) (*UnlockInstanceGroupResponse, error)

UnlockInstanceGroup unlocks the instance group with the given ID.

func (InstanceService) UpdateInstanceConfig

UpdateInstanceConfig updates the config for the instance with the given id.

func (InstanceService) UpdateInstanceGroup

UpdateInstanceGroup updates the instance group with the given ID.

func (InstanceService) UpdateInstanceSchedule

UpdateInstanceSchedule updates the schedule for the instance with the given id.

func (InstanceService) UpdateInstanceTemplate

UpdateInstanceTemplate updates the template for the instance with the given id.

type InstanceTemplate

type InstanceTemplate struct {
	ID           int               `json:"id" yaml:"id"`
	UID          int               `json:"uid" yaml:"uid"`
	GID          int               `json:"gid" yaml:"gid"`
	Uname        string            `json:"uname" yaml:"uname"`
	Gname        string            `json:"gname" yaml:"gname"`
	Name         string            `json:"name" yaml:"name"`
	Lock         Lock              `json:"lock" yaml:"lock"`
	Permissions  Permissions       `json:"permissions" yaml:"permissions"`
	Regtime      int               `json:"regtime" yaml:"regtime"`
	Template     insttmpl.Template `json:"template" yaml:"template"`
	TemplateText string            `json:"template_text" yaml:"template_text"`
}

InstanceTemplate is the API payload based on the legacy xmlrpc backend.

type InstancesAccountingResponse

type InstancesAccountingResponse struct {
	Accounting []AcctHistory `json:"accounting"`
}

InstancesAccountingResponse is the response body for GET /cloud/instance/accounting.

type InstancesMonitoringResponse

type InstancesMonitoringResponse struct {
	Monitoring []instance.Monitoring `json:"monitoring"`
}

InstancesMonitoringResponse is the response body for GET /cloud/instance/monitoring.

type InstancesResponse

type InstancesResponse struct {
	Instances []LockedInstance `json:"instances"`
}

InstancesResponse is the response body for GET /cloud/instance.

type InstancesShowbackResponse

type InstancesShowbackResponse struct {
	Showback []Showback `json:"showback"`
}

InstancesShowbackResponse is the response body for GET /cloud/instance/showback.

type InstantiateNetworkTemplateRequest

type InstantiateNetworkTemplateRequest struct {
	Name  string `json:"name"`
	Extra string `json:"extra"`
}

InstantiateNetworkTemplateRequest is the request body for PATCH /cloud/network/template/{template}/instantiate.

type InstantiateNetworkTemplateResponse

type InstantiateNetworkTemplateResponse struct {
	Template int `json:"network"`
}

InstantiateNetworkTemplateResponse is the response body for PATCH /cloud/network/template/instantiate.

type InstantiateRouterRequest

type InstantiateRouterRequest struct {
	Instances        int    `json:"instances"`
	InstanceTemplate int    `json:"instance_template"`
	Name             string `json:"name"`
	Pending          bool   `json:"pending"`
	Extra            string `json:"extra"`
}

InstantiateRouterRequest is the request body for PATCH /cloud/router/{router}/instantiate.

type InstantiateRouterResponse

type InstantiateRouterResponse struct {
	Router int `json:"router"`
}

InstantiateRouterResponse is the response body for PATCH /cloud/router/instantiate.

type InstantiateTemplateRequest

type InstantiateTemplateRequest struct {
	Name     string `json:"name"`
	Data     string `json:"data"`
	Hold     bool   `json:"hold"`
	DiskCopy bool   `json:"disk_copy"`
}

InstantiateTemplateRequest is the response body for PATCH /cloud/template/{template}/instantiate.

type InstantiateTemplateResponse

type InstantiateTemplateResponse struct {
	Template int `json:"template"`
}

InstantiateTemplateResponse is the response body for DELETE /cloud/template/{template}.

type LCMState

type LCMState int

LCMState is the Life Cycle Manager state of an instance.

const (
	InitLCMState          LCMState = iota // init
	PrologLCMState                        // prolog
	BootLCMState                          // boot
	RunningLCMState                       // running
	MigrateLCMState                       // migrate
	SaveStopLCMState                      // save_stop
	SaveSuspendLCMState                   // save_suspend
	SaveMigrateLCMState                   // save_migrate
	PrologMigrateLCMState                 // prolog_migrate
	PrologResumeLCMState                  // prolog_resume
	EpilogStopLCMState                    // epilog_stop
	EpilogLCMState                        // epilog
	ShutdownLCMState                      // shutdown

	CleanupResubmitLCMState              // cleanup_resubmit
	UnknownLCMState                      // unknown
	HotplugLCMState                      // hotplug
	ShutdownPowerOffLCMState             // shutdown_poweroff
	BootUnknownLCMState                  // boot_unknown
	BootPowerOffLCMState                 // boot_poweroff
	BootSuspendedLCMState                // boot_suspended
	BootStoppedLCMState                  // boot_stopped
	CleanupDeleteLCMState                // cleanup_delete
	HotplugSnapshotLCMState              // hotplug_snapshot
	HotplugNICLCMState                   // hotplug_nic
	HotplugSaveAsLCMState                // hotplug_saveas
	HotplugSaveAsPowerOffLCMState        // hotplug_saveas_poweroff
	HotplutSaveAsSuspendedLCMState       // hotplug_saveas_suspended
	ShutdownUndeployLCMState             // shutdown_undeploy
	EpilogUndeployLCMState               // epilog_undeploy
	PrologUndeployLCMState               // prolog_undeploy
	BootUndeployLCMState                 // boot_undeploy
	HotplugPrologPowerOffLCMState        // hotplug_prolog_poweroff
	HotplugEpilogPowerOffLCMState        // hotplug_epilog_poweroff
	BootMigrateLCMState                  // boot_migrate
	BootFailureLCMState                  // boot_failure
	BootMigrateFailureLCMState           // boot_migrate_failure
	PrologMigrateFailureLCMState         // prolog_migrate_failure
	PrologFailureLCMState                // prolog_failure
	EpilogFailureLCMState                // epilog_failure
	EpilogStopFailureLCMState            // epilog_stop_failure
	EpilogUndeployFailureLCMState        // epilog_undeploy_failure
	PrologMigratePowerOffLCMState        // prolog_migrate_poweroff
	PrologMigratePowerOffFailureLCMState // prolog_migrate_poweroff_failure
	PrologMigrageSuspendLCMState         // prolog_migrate_suspend
	PrologMigrageSuspendFailureLCMState  // prolog_migrate_suspend_failure
	BootUndeployFailureLCMState          // boot_undeploy_failure
	BootStoppedFailureLCMState           // boot_stopped_failure
	PrologResumeFailureLCMState          // prolog_resume_failure
	PrologUndeployFailureLCMState        // prolog_undeploy_failure
	DiskSnapshotPowerOffLCMState         // disk_snapshot_poweroff
	DiskSnapshotRevertPowerOffLCMState   // disk_snapshot_revert_poweroff
	DiskSnapshotDeletePowerOffLCMState   // disk_snapshot_delete_poweroff
	DiskSnapshotSuspendLCMState          // disk_snapshot_suspend
	DiskSnapshotRevertSuspendedLCMState  // disk_snapshot_revert_suspended
	DiskSnapshotDeleteSuspendedLCMState  // disk_snapshot_delete_suspended
	DiskSnapshotLCMState                 // disk_snapshot

	DiskSnapshotDeleteLCMState          // disk_snapshot_delete
	PrologMigrateUnknownLCMState        // prolog_migrate_unknown
	PrologMigrateUnknownFailureLCMState // prolog_migrate_unknown_failure
)

LCMState values.

func LCMStateString

func LCMStateString(s string) (LCMState, error)

LCMStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func LCMStateValues

func LCMStateValues() []LCMState

LCMStateValues returns all values of the enum

func (LCMState) IsALCMState

func (i LCMState) IsALCMState() bool

IsALCMState returns "true" if the value is listed in the enum definition. "false" otherwise

func (LCMState) MarshalText

func (i LCMState) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for LCMState

func (LCMState) String

func (i LCMState) String() string

func (*LCMState) UnmarshalText

func (i *LCMState) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for LCMState

type Lock

type Lock struct {
	Locked bool     `json:"locked" yaml:"locked"`
	Owner  int      `json:"owner" yaml:"owner"`
	Time   api.Time `json:"time" yaml:"time"`
	ReqID  int      `json:"req_id" yaml:"req_id"`
}

Lock is the API payload based on the legacy xmlrpc backend.

type LockDocumentRequest

type LockDocumentRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockDocumentRequest is the request body for PATCH /cloud/document/{document}/lock.

type LockDocumentResponse

type LockDocumentResponse struct {
	Document int      `json:"document"`
	Time     api.Time `json:"time"`
}

LockDocumentResponse is the response body for PATCH /cloud/document/lock.

type LockHookRequest

type LockHookRequest struct {
	Level LockLevel `json:"level"`
	Test  bool      `json:"test"`
}

LockHookRequest is the request body for PATCH /cloud/hook/{hook}/lock.

type LockHookResponse

type LockHookResponse struct {
	Hook int      `json:"hook"`
	Time api.Time `json:"time"`
}

LockHookResponse is the response body for PATCH /cloud/hook/lock.

type LockImageRequest

type LockImageRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockImageRequest is the request body for PATCH /cloud/image/{image}/lock.

type LockImageResponse

type LockImageResponse struct {
	Image int      `json:"image"`
	Time  api.Time `json:"time"`
}

LockImageResponse is the response body for PATCH /cloud/image/lock.

type LockInstanceGroupRequest

type LockInstanceGroupRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockInstanceGroupRequest is the request body for PATCH /cloud/instance-group/lock.

type LockInstanceGroupResponse

type LockInstanceGroupResponse struct {
	Group int      `json:"group"`
	Time  api.Time `json:"time"`
}

LockInstanceGroupResponse is the response body for PATCH /cloud/instance-group/lock.

type LockInstanceRequest

type LockInstanceRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockInstanceRequest is the request body for PATCH /cloud/instance/{instance}/lock.

type LockInstanceResponse

type LockInstanceResponse struct {
	Instance int      `json:"instance"`
	Time     api.Time `json:"time"`
}

LockInstanceResponse is the response body for PATCH /cloud/instance/lock.

type LockLevel

type LockLevel int

LockLevel is the level of lock.

const (
	UseLockLevel    LockLevel // use
	ManageLockLevel           // manage
	AdminLockLevel            // admin
	AllLockLevel              // all
)

Lock levels.

func LockLevelString

func LockLevelString(s string) (LockLevel, error)

LockLevelString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func LockLevelValues

func LockLevelValues() []LockLevel

LockLevelValues returns all values of the enum

func (LockLevel) IsALockLevel

func (i LockLevel) IsALockLevel() bool

IsALockLevel returns "true" if the value is listed in the enum definition. "false" otherwise

func (LockLevel) MarshalText

func (i LockLevel) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for LockLevel

func (LockLevel) String

func (i LockLevel) String() string

func (*LockLevel) UnmarshalText

func (i *LockLevel) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for LockLevel

func (LockLevel) V1

func (l LockLevel) V1() hc.LockLevel

V1 returns the v1 hc.LockLevel that corresponds to the LockLevel.

type LockMarketAppRequest

type LockMarketAppRequest struct {
	Level LockLevel `json:"level"`
	Test  bool      `json:"test"`
}

LockMarketAppRequest is the request body for PATCH /cloud/market/app/{app}/lock.

type LockMarketAppResponse

type LockMarketAppResponse struct {
	MarketApp int `json:"market_app"`
}

LockMarketAppResponse is the response body for PATCH /cloud/market/app/lock.

type LockNetworkRequest

type LockNetworkRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockNetworkRequest is the request body for PATCH /cloud/network/{network}/lock.

type LockNetworkResponse

type LockNetworkResponse struct {
	Network int      `json:"network"`
	Time    api.Time `json:"time"`
}

LockNetworkResponse is the response body for PATCH /cloud/network/lock.

type LockNetworkTemplateRequest

type LockNetworkTemplateRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockNetworkTemplateRequest is the request body for PATCH /cloud/network/template/{template}/lock.

type LockNetworkTemplateResponse

type LockNetworkTemplateResponse struct {
	Template int      `json:"template"`
	Time     api.Time `json:"time"`
}

LockNetworkTemplateResponse is the response body for PATCH /cloud/network/template/lock.

type LockRouterRequest

type LockRouterRequest struct {
	Level string `json:"level"`
	Test  bool   `json:"test"`
}

LockRouterRequest is the request body for PATCH /cloud/router/{router}/lock.

type LockRouterResponse

type LockRouterResponse struct {
	Router int      `json:"router"`
	Time   api.Time `json:"time"`
}

LockRouterResponse is the response body for PATCH /cloud/router/lock.

type LockTemplateRequest

type LockTemplateRequest struct {
	Level LockLevel `json:"level"`
	Test  bool      `json:"test"`
}

LockTemplateRequest is the response body for PATCH /cloud/template/{template}/lock.

type LockTemplateResponse

type LockTemplateResponse struct {
	Template int `json:"template"`
}

LockTemplateResponse is the response body for PATCH /cloud/template/lock.

type LockedInstance

type LockedInstance struct {
	Instance
	Lock Lock `json:"lock" yaml:"lock"`
}

LockedInstance is an Instance with a Lock.

type MarketAppResponse

type MarketAppResponse struct {
	App MarketplaceApp `json:"application"`
}

MarketAppResponse is the response body for GET /cloud/market/app.

type MarketAppsResponse

type MarketAppsResponse struct {
	Apps []MarketplaceApp `json:"applications"`
}

MarketAppsResponse is the response body for GET /cloud/market/app.

type MarketResponse

type MarketResponse struct {
	Market Marketplace `json:"market"`
}

MarketResponse is the response body for GET /cloud/market.

type MarketService

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

MarketService owns the /cloud/market methods.

func (MarketService) ChangeMarketAppOwnership

ChangeMarketAppOwnership changes the ownership of the marketplace application with the given ID.

func (MarketService) ChangeMarketAppPermissions

ChangeMarketAppPermissions changes the permissions of the marketplace application with the given ID.

func (MarketService) ChangeMarketOwnership

ChangeMarketOwnership changes the ownership of the marketplace with the given ID.

func (MarketService) ChangeMarketPermissions

ChangeMarketPermissions changes the permissions of the marketplace with the given ID.

func (MarketService) CreateMarket

CreateMarket creates a new marketplace.

func (MarketService) CreateMarketApp

CreateMarketApp creates a new marketplace application.

func (MarketService) DeleteMarket

func (s MarketService) DeleteMarket(ctx context.Context, id int) error

DeleteMarket deletes the market with the given ID.

func (MarketService) DeleteMarketApp

func (s MarketService) DeleteMarketApp(ctx context.Context, id, app int) error

DeleteMarketApp deletes the marketplace application with the given ID.

func (MarketService) EnableMarket

EnableMarket enables the marketplace with the given ID.

func (MarketService) EnableMarketApp

func (s MarketService) EnableMarketApp(ctx context.Context, id, app int, req EnableMarketAppRequest) (*EnableMarketAppResponse, error)

EnableMarketApp enables the marketplace application with the given ID.

func (MarketService) LockMarketApp

func (s MarketService) LockMarketApp(ctx context.Context, id, app int, req LockMarketAppRequest) (*LockMarketAppResponse, error)

LockMarketApp locks the marketplace application with the given ID.

func (MarketService) Market

func (s MarketService) Market(ctx context.Context, id int) (*MarketResponse, error)

Market returns information about a marketplace.

func (MarketService) MarketApp

func (s MarketService) MarketApp(ctx context.Context, id int) (*MarketAppResponse, error)

MarketApp returns information about a marketplace application.

func (MarketService) MarketApps

func (s MarketService) MarketApps(ctx context.Context) (*MarketAppsResponse, error)

MarketApps returns information about all marketplace applications.

func (MarketService) Markets

func (s MarketService) Markets(ctx context.Context) (*MarketsResponse, error)

Markets returns information about all marketplaces.

func (MarketService) RenameMarket

RenameMarket renames the marketplace with the given ID.

func (MarketService) RenameMarketApp

func (s MarketService) RenameMarketApp(ctx context.Context, id, app int, req RenameMarketAppRequest) (*RenameMarketAppResponse, error)

RenameMarketApp renames the marketplace application with the given ID.

func (MarketService) UnlockMarketApp

func (s MarketService) UnlockMarketApp(ctx context.Context, id, app int) (*UnlockMarketAppResponse, error)

UnlockMarketApp unlocks the marketplace application with the given ID.

func (MarketService) UpdateMarket

UpdateMarket updates the marketplace with the given ID.

func (MarketService) UpdateMarketApp

func (s MarketService) UpdateMarketApp(ctx context.Context, id, app int, req UpdateMarketAppRequest) (*UpdateMarketAppResponse, error)

UpdateMarketApp updates the marketplace application with the given ID.

type Marketplace

type Marketplace struct {
	ID              int         `json:"id" yaml:"id"`
	UID             int         `json:"uid" yaml:"uid"`
	GID             int         `json:"gid" yaml:"gid"`
	UserName        string      `json:"user_name" yaml:"user_name"`
	GroupName       string      `json:"group_name" yaml:"group_name"`
	Name            string      `json:"name" yaml:"name"`
	State           int         `json:"state" yaml:"state"`
	MarketMAD       string      `json:"market_mad" yaml:"market_mad"`
	ZoneID          string      `json:"zone_id" yaml:"zone_id"`
	TotalMB         int         `json:"total_mb" yaml:"total_mb"`
	FreeMB          int         `json:"free_mb" yaml:"free_mb"`
	UsedMB          int         `json:"used_mb" yaml:"used_mb"`
	MarketplaceApps []int       `json:"marketplace_apps" yaml:"marketplace_apps"`
	Permissions     Permissions `json:"permissions" yaml:"permissions"`
	TemplateText    string      `json:"template_text" yaml:"template_text"`
}

Marketplace is the API payload based on the legacy xmlrpc backend.

type MarketplaceApp

type MarketplaceApp struct {
	ID            int                    `json:"id" yaml:"id"`
	UID           int                    `json:"uid" yaml:"uid"`
	GID           int                    `json:"gid" yaml:"gid"`
	UserName      string                 `json:"user_name" yaml:"user_name"`
	GroupName     string                 `json:"group_name" yaml:"group_name"`
	Lock          Lock                   `json:"lock" yaml:"lock"`
	Regtime       int                    `json:"regtime" yaml:"regtime"`
	Name          string                 `json:"name" yaml:"name"`
	ZoneID        string                 `json:"zone_id" yaml:"zone_id"`
	OriginID      string                 `json:"origin_id" yaml:"origin_id"`
	Source        string                 `json:"source" yaml:"source"`
	MD5           string                 `json:"md5" yaml:"md5"`
	Size          int                    `json:"size" yaml:"size"`
	Description   string                 `json:"description" yaml:"description"`
	Version       string                 `json:"version" yaml:"version"`
	Format        string                 `json:"format" yaml:"format"`
	AppTemplate64 string                 `json:"apptemplate64" yaml:"apptemplate64"`
	MarketplaceID int                    `json:"marketplace_id" yaml:"marketplace_id"`
	Marketplace   string                 `json:"marketplace" yaml:"marketplace"`
	State         int                    `json:"state" yaml:"state"`
	Type          int                    `json:"type" yaml:"type"`
	Permissions   Permissions            `json:"permissions" yaml:"permissions"`
	Template      MarketplaceAppTemplate `json:"template" yaml:"template"`
	TemplateText  string                 `json:"template_text" yaml:"template_text"`
}

MarketplaceApp is the API payload based on the legacy xmlrpc backend.

type MarketplaceAppTemplate

type MarketplaceAppTemplate struct {
	Values map[string]string `json:"values" yaml:"values"`
}

MarketplaceAppTemplate is the API payload based on the legacy xmlrpc backend.

type MarketsResponse

type MarketsResponse struct {
	Markets []Marketplace `json:"market"`
}

MarketsResponse is the response body for GET /cloud/market.

type Memory

type Memory struct {
	Distance string `json:"distance" yaml:"distance"`
	Free     int    `json:"free" yaml:"free"`
	Total    int    `json:"total" yaml:"total"`
	Usage    int    `json:"usage" yaml:"usage"`
	Used     int    `json:"used" yaml:"used"`
}

Memory is the API payload based on the legacy xmlrpc backend.

type MigrationType

type MigrationType int

MigrationType is the type of migration.

const (
	SaveMigrationType         MigrationType // save
	PowerOffMigrationType                   // poweroff
	PowerOffHardMigrationType               // poweroff_hard
)

MigrationTypes values.

func MigrationTypeString

func MigrationTypeString(s string) (MigrationType, error)

MigrationTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func MigrationTypeValues

func MigrationTypeValues() []MigrationType

MigrationTypeValues returns all values of the enum

func (MigrationType) IsAMigrationType

func (i MigrationType) IsAMigrationType() bool

IsAMigrationType returns "true" if the value is listed in the enum definition. "false" otherwise

func (MigrationType) MarshalText

func (i MigrationType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for MigrationType

func (MigrationType) String

func (i MigrationType) String() string

func (*MigrationType) UnmarshalText

func (i *MigrationType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for MigrationType

func (MigrationType) V1

V1 returns the v1 hc.MigrationType that corresponds to the MigrationType.

type MoveInstanceRequest

type MoveInstanceRequest struct {
	Host            int    `json:"host"`
	LiveMigrate     bool   `json:"live_migrate"`
	EnforceCapacity bool   `json:"enforce_capacity"` // TODO: probably should reverse this logic
	MigrationType   string `json:"migration_type"`
}

MoveInstanceRequest is the request body for PATCH /cloud/instance/{instance}/move.

type MoveInstanceResponse

type MoveInstanceResponse struct {
	Instance int `json:"instance"`
}

MoveInstanceResponse is the response body for PATCH /cloud/instance/move.

type Network

type Network struct {
	ID                   int                    `json:"id" yaml:"id"`
	UID                  int                    `json:"uid" yaml:"uid"`
	GID                  int                    `json:"gid" yaml:"gid"`
	UserName             string                 `json:"user_name" yaml:"user_name"`
	GroupName            string                 `json:"group_name" yaml:"group_name"`
	Name                 string                 `json:"name" yaml:"name"`
	Lock                 Lock                   `json:"lock" yaml:"lock"`
	Permissions          Permissions            `json:"permissions" yaml:"permissions"`
	Clusters             []int                  `json:"clusters" yaml:"clusters"`
	Bridge               string                 `json:"bridge" yaml:"bridge"`
	BridgeType           string                 `json:"bridge_type" yaml:"bridge_type"`
	State                int                    `json:"state" yaml:"state"`
	PrevState            int                    `json:"prev_state" yaml:"prev_state"`
	ParentNetworkID      string                 `json:"parent_network_id" yaml:"parent_network_id"`
	VNMAD                string                 `json:"vnmad" yaml:"vnmad"`
	Phydev               string                 `json:"phydev" yaml:"phydev"`
	VLANID               string                 `json:"vlanid" yaml:"vlanid"`
	OuterVLANID          string                 `json:"outer_vlanid" yaml:"outer_vlanid"`
	VLANIDAutomatic      string                 `json:"vlanidautomatic" yaml:"vlanidautomatic"`
	OuterVLANIDAutomatic string                 `json:"outer_vlanidautomatic" yaml:"outer_vlanidautomatic"`
	UsedLeases           int                    `json:"used_leases" yaml:"used_leases"`
	VRouters             []int                  `json:"vrouters" yaml:"vrouters"`
	Template             network.Template       `json:"template" yaml:"template"`
	TemplateText         string                 `json:"template_text" yaml:"template_text"`
	AddressRanges        []network.AddressRange `json:"arpool" yaml:"arpool"`
}

Network is the API payload based on the legacy xmlrpc backend.

type NetworkRecovery

type NetworkRecovery int

NetworkRecovery is the recovery action to take when a vnet is in error.

const (
	FailureNetworkRecovery NetworkRecovery = iota // failure
	SuccessNetworkRecovery                        // success
	RetryNetworkRecovery                          // retry_vnet
	DeleteNetworkRecovery                         // delete_vnet
)

VNetRecovery values.

func NetworkRecoveryString

func NetworkRecoveryString(s string) (NetworkRecovery, error)

NetworkRecoveryString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func NetworkRecoveryValues

func NetworkRecoveryValues() []NetworkRecovery

NetworkRecoveryValues returns all values of the enum

func (NetworkRecovery) IsANetworkRecovery

func (i NetworkRecovery) IsANetworkRecovery() bool

IsANetworkRecovery returns "true" if the value is listed in the enum definition. "false" otherwise

func (NetworkRecovery) MarshalText

func (i NetworkRecovery) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for NetworkRecovery

func (NetworkRecovery) String

func (i NetworkRecovery) String() string

func (*NetworkRecovery) UnmarshalText

func (i *NetworkRecovery) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for NetworkRecovery

func (NetworkRecovery) V1

V1 returns the v1 hc.VNetRecovery that corresponds to the NetworkRecovery.

type NetworkResponse

type NetworkResponse struct {
	Network Network `json:"network"`
}

NetworkResponse is the response body for GET /cloud/network.

type NetworkService

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

NetworkService owns the /cloud/network methods.

func (NetworkService) AddNetworkAddressRange

AddNetworkAddressRange adds an address range to the network with the given ID.

func (NetworkService) ChangeNetworkOwnership

ChangeNetworkOwnership changes the ownership of the network with the given ID.

func (NetworkService) ChangeNetworkPermissions

ChangeNetworkPermissions changes the permissions of the network with the given ID.

func (NetworkService) ChangeNetworkTemplateOwnership

ChangeNetworkTemplateOwnership changes the ownership of the network template with the given ID.

func (NetworkService) ChangeNetworkTemplatePermissions

ChangeNetworkTemplatePermissions changes the permissions of the network template with the given ID.

func (NetworkService) CloneNetworkTemplate

CloneNetworkTemplate clones the network template with the given ID.

func (NetworkService) CreateNetwork

CreateNetwork creates a new network.

func (NetworkService) CreateNetworkTemplate

CreateNetworkTemplate creates a new network template.

func (NetworkService) DeleteNetwork

func (s NetworkService) DeleteNetwork(ctx context.Context, id int) error

DeleteNetwork deletes the network with the given ID.

func (NetworkService) DeleteNetworkAddressRange

func (s NetworkService) DeleteNetworkAddressRange(ctx context.Context, id, ar int) error

DeleteNetworkAddressRange deletes an address range from the network with the given ID.

func (NetworkService) DeleteNetworkTemplate

func (s NetworkService) DeleteNetworkTemplate(ctx context.Context, id int) error

DeleteNetworkTemplate deletes the network template with the given ID.

func (NetworkService) FreeNetworkAddressRange

func (s NetworkService) FreeNetworkAddressRange(ctx context.Context, id, ar int) error

FreeNetworkAddressRange free an address range from the network with the given ID.

func (NetworkService) HoldNetwork

HoldNetwork holds the network with the given ID.

func (NetworkService) InstantiateNetworkTemplate

InstantiateNetworkTemplate instantiates the network template with the given ID.

func (NetworkService) LockNetwork

LockNetwork locks the network with the given ID.

func (NetworkService) LockNetworkTemplate

LockNetworkTemplate locks the network template with the given ID.

func (NetworkService) Network

func (s NetworkService) Network(ctx context.Context, id int) (*NetworkResponse, error)

Network returns information about a network.

func (NetworkService) NetworkTemplate

func (s NetworkService) NetworkTemplate(ctx context.Context, id int) (*NetworkTemplateResponse, error)

NetworkTemplate returns information about a networks.

func (NetworkService) NetworkTemplates

func (s NetworkService) NetworkTemplates(ctx context.Context) (*NetworkTemplatesResponse, error)

NetworkTemplates returns information about all networkss.

func (NetworkService) Networks

func (s NetworkService) Networks(ctx context.Context) (*NetworksResponse, error)

Networks returns information about all networks.

func (NetworkService) RecoverNetworks

RecoverNetworks recovers the network with the given ID.

func (NetworkService) ReleaseNetwork

ReleaseNetwork releases the network with the given ID.

func (NetworkService) RenameNetwork

RenameNetwork renames the network with the given ID.

func (NetworkService) RenameNetworkTemplate

RenameNetworkTemplate renames the network template with the given ID.

func (NetworkService) ReserveNetwork

ReserveNetwork reserves the network with the given ID.

func (NetworkService) UnlockNetwork

func (s NetworkService) UnlockNetwork(ctx context.Context, id int) (*UnlockNetworkResponse, error)

UnlockNetwork unlocks the network with the given ID.

func (NetworkService) UnlockNetworkTemplate

func (s NetworkService) UnlockNetworkTemplate(ctx context.Context, id int) (*UnlockNetworkTemplateResponse, error)

UnlockNetworkTemplate unlocks the network template with the given ID.

func (NetworkService) UpdateNetwork

UpdateNetwork updates the network with the given ID.

func (NetworkService) UpdateNetworkAddressRange

UpdateNetworkAddressRange updates an address range from the network with the given ID.

func (NetworkService) UpdateNetworkTemplate

UpdateNetworkTemplate updates the network template with the given ID.

type NetworkTemplate

type NetworkTemplate struct {
	ID           int              `json:"id" yaml:"id"`
	UID          int              `json:"uid" yaml:"uid"`
	GID          int              `json:"gid" yaml:"gid"`
	UserName     string           `json:"user_name" yaml:"user_name"`
	GroupName    string           `json:"group_name" yaml:"group_name"`
	Name         string           `json:"name" yaml:"name"`
	Lock         Lock             `json:"lock" yaml:"lock"`
	Permissions  Permissions      `json:"permissions" yaml:"permissions"`
	Regtime      int              `json:"regtime" yaml:"regtime"`
	Template     nettmpl.Template `json:"template" yaml:"template"`
	TemplateText string           `json:"template_text" yaml:"template_text"`
}

NetworkTemplate is the API payload based on the legacy xmlrpc backend.

type NetworkTemplateResponse

type NetworkTemplateResponse struct {
	Template nettmpl.Template `json:"template"`
}

NetworkTemplateResponse is the response body for GET /cloud/network.

type NetworkTemplatesResponse

type NetworkTemplatesResponse struct {
	Templates []nettmpl.Template `json:"template"`
}

NetworkTemplatesResponse is the response body for GET /cloud/network.

type NetworksResponse

type NetworksResponse struct {
	VNets []Network `json:"networks"`
}

NetworksResponse is the response body for GET /cloud/network.

type Node

type Node struct {
	Core     []Core     `json:"core" yaml:"core"`
	Hugepage []HugePage `json:"hugepage" yaml:"hugepage"`
	Memory   Memory     `json:"memory" yaml:"memory"`
	NodeID   int        `json:"node_id" yaml:"node_id"`
}

Node is the API payload based on the legacy xmlrpc backend.

type PCI

type PCI struct {
	Address      string `json:"address" yaml:"address"`
	Bus          string `json:"bus" yaml:"bus"`
	Class        string `json:"class" yaml:"class"`
	ClassName    string `json:"class_name" yaml:"class_name"`
	Device       string `json:"device" yaml:"device"`
	DeviceName   string `json:"device_name" yaml:"device_name"`
	Domain       string `json:"domain" yaml:"domain"`
	Function     string `json:"function" yaml:"function"`
	NumaNode     string `json:"numa_node" yaml:"numa_node"`
	ShortAddress string `json:"short_address" yaml:"short_address"`
	Slot         string `json:"slot" yaml:"slot"`
	Type         string `json:"type" yaml:"type"`
	Vendor       string `json:"vendor" yaml:"vendor"`
	VendorName   string `json:"vendor_name" yaml:"vendor_name"`
	InstanceID   int    `json:"instance_id" yaml:"instance_id"`
}

PCI is the API payload based on the legacy xmlrpc backend.

type Period

type Period struct {
	Start *int `json:"start"`
	End   *int `json:"end"`
}

Period is a time interval with optional start and end times.

type Permissions

type Permissions struct {
	Owner perms `json:"owner" yaml:"owner"`
	Group perms `json:"group" yaml:"group"`
	Other perms `json:"other" yaml:"other"`
}

Permissions is the API payload based on the legacy xmlrpc backend.

type Perms

type Perms struct {
	OwnerUse    *bool `json:"owner_use"`
	OwnerManage *bool `json:"owner_manage"`
	OwnerAdmin  *bool `json:"owner_admin"`
	GroupUse    *bool `json:"group_use"`
	GroupManage *bool `json:"group_manage"`
	GroupAdmin  *bool `json:"group_admin"`
	OtherUse    *bool `json:"other_use"`
	OtherManage *bool `json:"other_manage"`
	OtherAdmin  *bool `json:"other_admin"`
}

Perms is a set of owner (user), group, and other permissions. Think UNIX.

type RaftStatus

type RaftStatus struct {
	ServerID    int `json:"server_id" yaml:"server_id"`
	State       int `json:"state" yaml:"state"`
	Term        int `json:"term" yaml:"term"`
	VotedFor    int `json:"voted_for" yaml:"voted_for"`
	Commit      int `json:"commit" yaml:"commit"`
	LogIndex    int `json:"log_index" yaml:"log_index"`
	LogTerm     int `json:"log_term" yaml:"log_term"`
	FedLogIndex int `json:"fed_log_index" yaml:"fed_log_index"`
}

RaftStatus is the API payload based on the legacy xmlrpc backend.

type RecoverInstanceRequest

type RecoverInstanceRequest struct {
	Operation string `json:"operation"`
}

RecoverInstanceRequest is the request body for PATCH /cloud/instance/{instance}/recover.

type RecoverInstanceResponse

type RecoverInstanceResponse struct {
	Instance int `json:"instance"`
}

RecoverInstanceResponse is the response body for PATCH /cloud/instance/recover.

type RecoverNetworkRequest

type RecoverNetworkRequest struct {
	Recovery string `json:"recovery"`
}

RecoverNetworkRequest is the request body for PATCH /cloud/network/{network}/recover.

type RecoverNetworkResponse

type RecoverNetworkResponse struct {
	Network int `json:"network"`
}

RecoverNetworkResponse is the response body for PATCH /cloud/network/recover.

type ReleaseNetworkRequest

type ReleaseNetworkRequest struct {
	Template string `json:"template"`
}

ReleaseNetworkRequest is the request body for PATCH /cloud/network/{network}/release.

type ReleaseNetworkResponse

type ReleaseNetworkResponse struct {
	Network int `json:"network"`
}

ReleaseNetworkResponse is the response body for PATCH /cloud/network/release.

type RenameClusterRequest

type RenameClusterRequest struct {
	Name string `json:"name"`
}

RenameClusterRequest is the request body for PATCH /cloud/cluster/{cluster}/name.

type RenameClusterResponse

type RenameClusterResponse struct {
	Cluster int `json:"cluster"`
}

RenameClusterResponse is the response body for PATCH /cloud/cluster/name.

type RenameDataCenterRequest

type RenameDataCenterRequest struct {
	Name string `json:"name"`
}

RenameDataCenterRequest is the request body for PATCH /cloud/datacenter/{datacenter}/name.

type RenameDataCenterResponse

type RenameDataCenterResponse struct {
	DataCenter int `json:"datacenter"`
}

RenameDataCenterResponse is the response body for PATCH /cloud/datacenter/name.

type RenameDatastoreRequest

type RenameDatastoreRequest struct {
	Name string `json:"name"`
}

RenameDatastoreRequest is the request body for PATCH /cloud/datastore/{datastore}/name.

type RenameDatastoreResponse

type RenameDatastoreResponse struct {
	Datastore int `json:"datastore"`
}

RenameDatastoreResponse is the response body for PATCH /cloud/datastore/name.

type RenameDocumentRequest

type RenameDocumentRequest struct {
	Name string `json:"name"`
}

RenameDocumentRequest is the request body for PATCH /cloud/document/{document}/name.

type RenameDocumentResponse

type RenameDocumentResponse struct {
	Document int `json:"document"`
}

RenameDocumentResponse is the response body for PATCH /cloud/document/name.

type RenameHookRequest

type RenameHookRequest struct {
	Name string `json:"name"`
}

RenameHookRequest is the request body for PATCH /cloud/hook/{hook}/name.

type RenameHookResponse

type RenameHookResponse struct {
	Hook int `json:"hook"`
}

RenameHookResponse is the response body for PATCH /cloud/hook/name.

type RenameHostRequest

type RenameHostRequest struct {
	Hostname string `json:"hostname"`
}

RenameHostRequest is the request body for PATCH /cloud/host/{host}/name.

type RenameHostResponse

type RenameHostResponse struct {
	Host int `json:"host"`
}

RenameHostResponse is the response body for PATCH /cloud/host/name.

type RenameImageRequest

type RenameImageRequest struct {
	Name string `json:"name"`
}

RenameImageRequest is the request body for PATCH /cloud/image/{image}/name.

type RenameImageResponse

type RenameImageResponse struct {
	Image int `json:"image"`
}

RenameImageResponse is the response body for PATCH /cloud/image/name.

type RenameInstanceDiskSnapshotRequest

type RenameInstanceDiskSnapshotRequest struct {
	Name string `json:"name"`
}

RenameInstanceDiskSnapshotRequest is the request body for PATCH /cloud/instance/{instance}/disk/{disk}/snapshot/{snapshot}/name.

type RenameInstanceDiskSnapshotResponse

type RenameInstanceDiskSnapshotResponse struct {
	Instance int `json:"instance"`
}

RenameInstanceDiskSnapshotResponse is the response body for PATCH /cloud/instance/disk/snapshot/name.

type RenameInstanceGroupRequest

type RenameInstanceGroupRequest struct {
	Name string `json:"name"`
}

RenameInstanceGroupRequest is the request body for PATCH /cloud/instance-group/name.

type RenameInstanceGroupResponse

type RenameInstanceGroupResponse struct {
	Group int `json:"group"`
}

RenameInstanceGroupResponse is the response body for PATCH /cloud/instance-group/name.

type RenameInstanceRequest

type RenameInstanceRequest struct {
	Name string `json:"name"`
}

RenameInstanceRequest is the request body for PATCH /cloud/instance/{instance}/name.

type RenameInstanceResponse

type RenameInstanceResponse struct {
	Instance int `json:"instance"`
}

RenameInstanceResponse is the response body for PATCH /cloud/instance/name.

type RenameMarketAppRequest

type RenameMarketAppRequest struct {
	Name string `json:"name"`
}

RenameMarketAppRequest is the request body for PATCH /cloud/market/app/{app}/name.

type RenameMarketAppResponse

type RenameMarketAppResponse struct {
	MarketApp int `json:"market_app"`
}

RenameMarketAppResponse is the response body for PATCH /cloud/market/app/name.

type RenameMarketRequest

type RenameMarketRequest struct {
	Name string `json:"name"`
}

RenameMarketRequest is the request body for PATCH /cloud/market/{market}/name.

type RenameMarketResponse

type RenameMarketResponse struct {
	Market int `json:"market"`
}

RenameMarketResponse is the response body for PATCH /cloud/market/name.

type RenameNetworkRequest

type RenameNetworkRequest struct {
	Name string `json:"name"`
}

RenameNetworkRequest is the request body for PATCH /cloud/network/{network}/name.

type RenameNetworkResponse

type RenameNetworkResponse struct {
	Network int `json:"network"`
}

RenameNetworkResponse is the response body for PATCH /cloud/network/name.

type RenameNetworkTemplateRequest

type RenameNetworkTemplateRequest struct {
	Name string `json:"name"`
}

RenameNetworkTemplateRequest is the request body for PATCH /cloud/network/template/{template}/name.

type RenameNetworkTemplateResponse

type RenameNetworkTemplateResponse struct {
	Template int `json:"template"`
}

RenameNetworkTemplateResponse is the response body for PATCH /cloud/network/template/name.

type RenameRouterRequest

type RenameRouterRequest struct {
	Name string `json:"name"`
}

RenameRouterRequest is the request body for PATCH /cloud/router/{router}/name.

type RenameRouterResponse

type RenameRouterResponse struct {
	Router int `json:"router"`
}

RenameRouterResponse is the response body for PATCH /cloud/router/name.

type RenameSecurityGroupRequest

type RenameSecurityGroupRequest struct {
	Name string `json:"name"`
}

RenameSecurityGroupRequest is the request body for PATCH /cloud/security-group/{sg}/rename.

type RenameSecurityGroupResponse

type RenameSecurityGroupResponse struct {
	SecurityGroup int `json:"security_group"`
}

RenameSecurityGroupResponse is the response body for PATCH /cloud/security-group/rename.

type RenameTemplateRequest

type RenameTemplateRequest struct {
	Name string `json:"name"`
}

RenameTemplateRequest is the response body for PATCH /cloud/template/{template}/name.

type RenameTemplateResponse

type RenameTemplateResponse struct {
	Template int `json:"template"`
}

RenameTemplateResponse is the response body for PATCH /cloud/template/name.

type RenameZoneRequest

type RenameZoneRequest struct {
	Name string `json:"name"`
}

RenameZoneRequest is the request body for PATCH /cloud/zone/{zone}/name.

type RenameZoneResponse

type RenameZoneResponse struct {
	Zone int `json:"zone"`
}

RenameZoneResponse is the response body for PATCH /cloud/zone/name.

type ReserveNetworkRequest

type ReserveNetworkRequest struct {
	Template string `json:"template"`
}

ReserveNetworkRequest is the request body for POST /cloud/network/{network}/reserve.

type ReserveNetworkResponse

type ReserveNetworkResponse struct {
	Network int `json:"network"`
}

ReserveNetworkResponse is the response body for POST /cloud/network/reserve.

type ResizeInstanceDiskRequest

type ResizeInstanceDiskRequest struct {
	Size int `json:"size"`
}

ResizeInstanceDiskRequest is the request body for POST /cloud/instance/{instance}/disk/{disk}/size.

type ResizeInstanceDiskResponse

type ResizeInstanceDiskResponse struct {
	Instance int `json:"instance"`
}

ResizeInstanceDiskResponse is the response body for PATCH /cloud/instance/disk/size.

type ResizeInstanceRequest

type ResizeInstanceRequest struct {
	Template        string `json:"template"`
	EnforceCapacity bool   `json:"enforce_capacity"` // TODO: probably should reverse this logic
}

ResizeInstanceRequest is the request body for PATCH /cloud/instance/{instance}/size.

type ResizeInstanceResponse

type ResizeInstanceResponse struct {
	Instance int `json:"instance"`
}

ResizeInstanceResponse is the response body for PATCH /cloud/instance/size.

type RetryHookRequest

type RetryHookRequest struct {
	Execution int `json:"execution"`
}

RetryHookRequest is the request body for PATCH /cloud/hook/{hook}/retry.

type RetryHookResponse

type RetryHookResponse struct {
	Hook int `json:"hook"`
}

RetryHookResponse is the response body for PATCH /cloud/hook/retry.

type RevertImageSnapshotResponse

type RevertImageSnapshotResponse struct {
	Image int `json:"image"`
}

RevertImageSnapshotResponse is the response body for PATCH /cloud/image/snapshot/revert.

type RevertInstanceDiskSnapshotResponse

type RevertInstanceDiskSnapshotResponse struct {
	Snapshot int `json:"snapshot"`
}

RevertInstanceDiskSnapshotResponse is the response body for PATCH /cloud/instance/disk/snapshot/revert.

type RevertInstanceSnapshotResponse

type RevertInstanceSnapshotResponse struct {
	Instance int `json:"instance"`
}

RevertInstanceSnapshotResponse is the response body for PATCH /cloud/instance/snapshot/revert.

type Router

type Router struct {
	ID           int            `json:"id" yaml:"id"`
	UID          int            `json:"uid" yaml:"uid"`
	GID          int            `json:"gid" yaml:"gid"`
	UserName     string         `json:"user_name" yaml:"user_name"`
	GroupName    string         `json:"group_name" yaml:"group_name"`
	Name         string         `json:"name" yaml:"name"`
	Permissions  Permissions    `json:"permissions" yaml:"permissions"`
	Lock         Lock           `json:"lock" yaml:"lock"`
	Instances    []int          `json:"instances" yaml:"instances"`
	Template     RouterTemplate `json:"template" yaml:"template"`
	TemplateText string         `json:"template_text" yaml:"template_text"`
}

Router is the API payload based on the legacy xmlrpc backend.

type RouterResponse

type RouterResponse struct {
	Router Router `json:"router"`
}

RouterResponse is the response body for GET /cloud/router.

type RouterService

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

RouterService own the /cloud/router methods.

func (RouterService) ChangeRouterOwnership

ChangeRouterOwnership changes the ownership of a Router with the given ID.

func (RouterService) ChangeRouterPermissions

ChangeRouterPermissions changes the permissions of a Router with the given ID.

func (RouterService) CreateRouter

CreateRouter creates a new Router.

func (RouterService) CreateRouterNIC

CreateRouterNIC creates a new NIC for the Router with the given ID.

func (RouterService) DeleteRouter

func (s RouterService) DeleteRouter(ctx context.Context, id int) error

DeleteRouter deletes a Router with the given ID.

func (RouterService) DeleteRouterNIC

func (s RouterService) DeleteRouterNIC(ctx context.Context, id int) error

DeleteRouterNIC deletes a NIC from the Router with the given ID.

func (RouterService) InstantiateRouter

InstantiateRouter instantiates a Router with the given ID.

func (RouterService) LockRouter

LockRouter locks a Router with the given ID.

func (RouterService) RenameRouter

RenameRouter renames a Router with the given ID.

func (RouterService) Router

func (s RouterService) Router(ctx context.Context, id int) (*RouterResponse, error)

Router returns information about a router.

func (RouterService) Routers

func (s RouterService) Routers(ctx context.Context) (*RoutersResponse, error)

Routers returns information about all routers.

func (RouterService) UnlockRouter

func (s RouterService) UnlockRouter(ctx context.Context, id int) (*UnlockRouterResponse, error)

UnlockRouter unlocks a Router with the given ID.

func (RouterService) UpdateRouter

UpdateRouter updates a Router with the given ID.

type RouterTemplate

type RouterTemplate struct {
	Values map[string]string `json:"values" yaml:"values"`
}

RouterTemplate is the API payload based on the legacy xmlrpc backend.

type RoutersResponse

type RoutersResponse struct {
	Routers []Router `json:"routers"`
}

RoutersResponse is the response body for GET /cloud/router.

type SecurityGroup

type SecurityGroup struct {
	ID                int                   `json:"id" yaml:"id"`
	UserID            int                   `json:"user_id" yaml:"user_id"`
	GroupID           int                   `json:"group_id" yaml:"group_id"`
	UserName          string                `json:"user_name" yaml:"user_name"`
	GroupName         string                `json:"group_name" yaml:"group_name"`
	Name              string                `json:"name" yaml:"name"`
	Permissions       Permissions           `json:"permissions" yaml:"permissions"`
	UpdatedInstances  []int                 `json:"updated_instances" yaml:"updated_instances"`
	OutdatedInstances []int                 `json:"outdated_instances" yaml:"outdated_instances"`
	UpdatingInstances []int                 `json:"updating_instances" yaml:"updating_instances"`
	ErrorInstances    []int                 `json:"error_instances" yaml:"error_instances"`
	Template          SecurityGroupTemplate `json:"template" yaml:"template"`
	TemplateText      string                `json:"template_text" yaml:"template_text"`
}

SecurityGroup is the API payload based on the legacy xmlrpc backend.

type SecurityGroupResponse

type SecurityGroupResponse struct {
	SecurityGroup SecurityGroup `json:"security_group"`
}

SecurityGroupResponse is the response body for GET /cloud/security-group.

type SecurityGroupRule

type SecurityGroupRule struct {
	Protocol string `json:"protocol" yaml:"protocol"`
	RuleType string `json:"rule_type" yaml:"rule_type"`
}

SecurityGroupRule is the API payload based on the legacy xmlrpc backend.

type SecurityGroupService

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

SecurityGroupService owns the /cloud/security-group methods.

func (SecurityGroupService) ChangeSecurityGroupOwnership

ChangeSecurityGroupOwnership changes the ownership of the security group with the given ID.

func (SecurityGroupService) ChangeSecurityGroupPermissions

ChangeSecurityGroupPermissions changes the permissions of the security group with the given ID.

func (SecurityGroupService) CloneSecurityGroup

CloneSecurityGroup clones the security group with the given ID.

func (SecurityGroupService) CommitSecurityGroup

CommitSecurityGroup commits the security group with the given ID.

func (SecurityGroupService) CreateSecurityGroup

CreateSecurityGroup creates a new security group.

func (SecurityGroupService) DeleteSecurityGroup

func (s SecurityGroupService) DeleteSecurityGroup(ctx context.Context, id int) error

DeleteSecurityGroup deletes the security group with the given ID.

func (SecurityGroupService) RenameSecurityGroup

RenameSecurityGroup renames the security group with the given ID.

func (SecurityGroupService) SecurityGroup

func (s SecurityGroupService) SecurityGroup(ctx context.Context, id int) (*SecurityGroupResponse, error)

SecurityGroup returns information about a image.

func (SecurityGroupService) SecurityGroups

SecurityGroups returns information about all images.

func (SecurityGroupService) UpdateSecurityGroup

UpdateSecurityGroup updates the security group with the given ID.

type SecurityGroupTemplate

type SecurityGroupTemplate struct {
	Values      map[string]string   `json:"values" yaml:"values"`
	Description string              `json:"description" yaml:"description"`
	Rule        []SecurityGroupRule `json:"rule" yaml:"rule"`
}

SecurityGroupTemplate is the API payload based on the legacy xmlrpc backend.

type SecurityGroupsResponse

type SecurityGroupsResponse struct {
	SecurityGroups []SecurityGroup `json:"security_group"`
}

SecurityGroupsResponse is the response body for GET /cloud/security-group.

type Server

type Server struct {
	Endpoint    string `json:"endpoint" yaml:"endpoint"`
	ID          int    `json:"id" yaml:"id"`
	Name        string `json:"name" yaml:"name"`
	State       int    `json:"state" yaml:"state"`
	Term        int    `json:"term" yaml:"term"`
	VotedFor    int    `json:"voted_for" yaml:"voted_for"`
	Commit      int    `json:"commit" yaml:"commit"`
	LogIndex    int    `json:"log_index" yaml:"log_index"`
	FedLogIndex int    `json:"fed_log_index" yaml:"fed_log_index"`
}

Server is the API payload based on the legacy xmlrpc backend.

type Service

Service owns the /cloud methods.

func NewService

func NewService(c *client.Client, path string) *Service

NewService returns a new Service for bare-metal operations.

type SetGroupQuotaRequest

type SetGroupQuotaRequest struct {
	Template string `json:"template"`
}

SetGroupQuotaRequest is the request body for POST /cloud/group/quota.

type SetGroupQuotaResponse

type SetGroupQuotaResponse struct {
	Group int `json:"group"`
}

SetGroupQuotaResponse is the response body for POST /cloud/group/quota.

type SetHostStatusRequest

type SetHostStatusRequest struct {
	Status string `json:"status"`
}

SetHostStatusRequest is the request body for PATCH /cloud/host/{host}/status.

type SetHostStatusResponse

type SetHostStatusResponse struct {
	Host int `json:"host"`
}

SetHostStatusResponse is the response body for PATCH /cloud/host/status.

type SetImagePersistentRequest

type SetImagePersistentRequest struct {
	Persistent bool `json:"persistent"`
}

SetImagePersistentRequest is the request body for PATCH /cloud/image/{image}/persistent.

type SetImagePersistentResponse

type SetImagePersistentResponse struct {
	Image int `json:"image"`
}

SetImagePersistentResponse is the response body for PATCH /cloud/image/persistent.

type SetInstanceActionRequest

type SetInstanceActionRequest struct {
	// Action to perform
	Action string `` /* 152-byte string literal not displayed */
}

SetInstanceActionRequest is the request body for PATCH /cloud/instance/{instance}/action.

type SetInstanceActionResponse

type SetInstanceActionResponse struct {
	Instance int `json:"instance"`
}

SetInstanceActionResponse is the response body for POST /cloud/instance/action.

type SetUserQuotaRequest

type SetUserQuotaRequest struct {
	Template string `json:"template"`
}

SetUserQuotaRequest is the request body for PATCH /cloud/user/{user}/quota.

type SetUserQuotaResponse

type SetUserQuotaResponse struct {
	User int `json:"user"`
}

SetUserQuotaResponse is the response body for PATCH /cloud/user/quota.

type Showback

type Showback struct {
	InstanceID   int     `json:"instance" yaml:"instance"`
	InstanceName string  `json:"instance_name" yaml:"instance_name"`
	UID          int     `json:"uid" yaml:"uid"`
	GID          int     `json:"gid" yaml:"gid"`
	UserName     string  `json:"user_name" yaml:"user_name"`
	GroupName    string  `json:"group_name" yaml:"group_name"`
	Year         int     `json:"year" yaml:"year"`
	Month        int     `json:"month" yaml:"month"`
	CPUCost      float32 `json:"cpucost" yaml:"cpucost"`
	MemoryCost   float32 `json:"memory_cost" yaml:"memory_cost"`
	DiskCost     float32 `json:"disk_cost" yaml:"disk_cost"`
	TotalCost    float32 `json:"total_cost" yaml:"total_cost"`
	Hours        float32 `json:"hours" yaml:"hours"`
	Rhours       float32 `json:"rhours" yaml:"rhours"`
}

Showback is the API payload based on the legacy xmlrpc backend.

type Status

type Status int

Status is the status of an object (usually an Instance).

const (
	EnabledStatus  Status = iota // enabled
	DisabledStatus               // disabled
	OfflineStatus                // offline
)

Status values.

func StatusString

func StatusString(s string) (Status, error)

StatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StatusValues

func StatusValues() []Status

StatusValues returns all values of the enum

func (Status) IsAStatus

func (i Status) IsAStatus() bool

IsAStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (Status) MarshalText

func (i Status) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Status

func (Status) String

func (i Status) String() string

func (*Status) UnmarshalText

func (i *Status) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Status

func (Status) V1

func (s Status) V1() hc.Status

V1 returns the v1 hc.Status that corresponds to the Status.

type SunstoneTemplate

type SunstoneTemplate struct {
	Values                map[string]string `json:"values" yaml:"values"`
	DefaultView           string            `json:"default_view" yaml:"default_view"`
	GroupAdminDefaultView string            `json:"group_admin_default_view" yaml:"group_admin_default_view"`
	GroupAdminViews       []string          `json:"group_admin_views" yaml:"group_admin_views"`
	Views                 []string          `json:"views" yaml:"views"`
}

SunstoneTemplate is the API payload based on the legacy xmlrpc backend.

type System

type System struct {
	Netrx int `json:"netrx" yaml:"netrx"`
	Nettx int `json:"nettx" yaml:"nettx"`
}

System is the API payload based on the legacy xmlrpc backend.

type SystemConfigResponse

type SystemConfigResponse struct {
	Config HyperCloudConfiguration `json:"config"`
}

SystemConfigResponse is the response body for GET /cloud/system/config.

type SystemService

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

SystemService owns the /cloud/system methods.

func (SystemService) SystemConfig

func (s SystemService) SystemConfig(ctx context.Context) (*SystemConfigResponse, error)

SystemConfig returns HC config.

func (SystemService) SystemVersion

func (s SystemService) SystemVersion(ctx context.Context) (*SystemVersionResponse, error)

SystemVersion returns the version of HC.

type SystemVersionResponse

type SystemVersionResponse struct {
	Version string `json:"version"`
}

SystemVersionResponse is the response body for GET /cloud/system/version.

type Template

type Template map[string]any

Template is nested map of string key x value pairs.

func (Template) String

func (t Template) String() string

String implements the Stringer interface for t. Example output:

FOO = "bar"
BAZ = [
 QUX = "quux",
 CORGE = "grault"
]
BAZ = [
 GARPLY = "waldo"
]
GARPLY = "waldo"

func (Template) Template

func (t Template) Template() (*instance.Template, error)

Template returns a structured subset of the nested key x value pair map.

func (*Template) UnmarshalJSON

func (t *Template) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for t.

type TemplateResponse

type TemplateResponse struct {
	Template InstanceTemplate `json:"template"`
}

TemplateResponse is the response body for GET /cloud/template.

type TemplateService

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

TemplateService own the /cloud/template methods.

func (TemplateService) ChangeTemplateOwnership

ChangeTemplateOwnership changes the ownership of the template with the given ID.

func (TemplateService) ChangeTemplatePermissions

ChangeTemplatePermissions changes the permissions of the template with the given ID.

func (TemplateService) CloneTemplate

CloneTemplate clones the template with the given ID.

func (TemplateService) CreateTemplate

CreateTemplate creates a new template.

func (TemplateService) DeleteTemplate

func (s TemplateService) DeleteTemplate(ctx context.Context, id int) error

DeleteTemplate deletes the template with the given ID.

func (TemplateService) InstantiateTemplate

InstantiateTemplate instantiates the template with the given ID.

func (TemplateService) LockTemplate

LockTemplate locks the template with the given ID.

func (TemplateService) RenameTemplate

RenameTemplate renames the template with the given ID.

func (TemplateService) Template

func (s TemplateService) Template(ctx context.Context, id int) (*TemplateResponse, error)

Template returns information about a template.

func (TemplateService) Templates

func (s TemplateService) Templates(ctx context.Context) (*TemplatesResponse, error)

Templates returns information about all templates.

func (TemplateService) UnlockTemplate

func (s TemplateService) UnlockTemplate(ctx context.Context, id int) (*UnlockTemplateResponse, error)

UnlockTemplate unlocks the template with the given ID.

func (TemplateService) UpdateTemplate

UpdateTemplate updates the template with the given ID.

type TemplatesResponse

type TemplatesResponse struct {
	Templates []InstanceTemplate `json:"template"`
}

TemplatesResponse is the response body for GET /cloud/template.

type UnlockDocumentResponse

type UnlockDocumentResponse struct {
	Document int `json:"document"`
}

UnlockDocumentResponse is the response body for PATCH /cloud/document/unlock.

type UnlockHookRequest

type UnlockHookRequest struct {
	Lock int `json:"lock"`
}

UnlockHookRequest is the request body for PATCH /cloud/hook/{hook}/unlock.

type UnlockHookResponse

type UnlockHookResponse struct {
	Hook int `json:"hook"`
}

UnlockHookResponse is the response body for PATCH /cloud/hook/unlock.

type UnlockImageResponse

type UnlockImageResponse struct {
	Image int `json:"image"`
}

UnlockImageResponse is the response body for PATCH /cloud/image/unlock.

type UnlockInstanceGroupResponse

type UnlockInstanceGroupResponse struct {
	Group int `json:"group"`
}

UnlockInstanceGroupResponse is the response body for PATCH /cloud/instance-group/unlock.

type UnlockInstanceResponse

type UnlockInstanceResponse struct {
	Instance int `json:"instance"`
}

UnlockInstanceResponse is the response body for PATCH /cloud/instance/unlock.

type UnlockMarketAppResponse

type UnlockMarketAppResponse struct {
	MarketApp int `json:"market_app"`
}

UnlockMarketAppResponse is the response body for PATCH /cloud/market/app/unlock.

type UnlockNetworkResponse

type UnlockNetworkResponse struct {
	Network int `json:"network"`
}

UnlockNetworkResponse is the response body for PATCH /cloud/network/unlock.

type UnlockNetworkTemplateResponse

type UnlockNetworkTemplateResponse struct {
	Template int `json:"template"`
}

UnlockNetworkTemplateResponse is the response body for PATCH /cloud/network/template/unlock.

type UnlockRouterResponse

type UnlockRouterResponse struct {
	Router int `json:"router"`
}

UnlockRouterResponse is the response body for PATCH /cloud/router/unlock.

type UnlockTemplateResponse

type UnlockTemplateResponse struct {
	Template int `json:"template"`
}

UnlockTemplateResponse is the response body for PATCH /cloud/template/unlock.

type UpdateClusterRequest

type UpdateClusterRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateClusterRequest is request body for PATCH /cloud/cluster/{cluster}.

type UpdateClusterResponse

type UpdateClusterResponse struct {
	Cluster int `json:"cluster"`
}

UpdateClusterResponse is response body for PATCH /cloud/cluster.

type UpdateDataCenterRequest

type UpdateDataCenterRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateDataCenterRequest is the request body for PATCH /cloud/datacenter/{datacenter}.

type UpdateDataCenterResponse

type UpdateDataCenterResponse struct {
	DataCenter int `json:"datacenter"`
}

UpdateDataCenterResponse is the response body for PATCH /cloud/datacenter.

type UpdateDatastoreRequest

type UpdateDatastoreRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateDatastoreRequest is the request body for PATCH /cloud/datastore/{datastore}.

type UpdateDatastoreResponse

type UpdateDatastoreResponse struct {
	Datastore int `json:"datastore"`
}

UpdateDatastoreResponse is the response body for PATCH /cloud/datastore.

type UpdateDefaultUserQuotaRequest

type UpdateDefaultUserQuotaRequest struct {
	Template string `json:"template"`
}

UpdateDefaultUserQuotaRequest is the request body for POST /cloud/user/quota.

type UpdateDefaultUserQuotaResponse

type UpdateDefaultUserQuotaResponse struct {
	Quota UserDefaultQuotas `json:"quota"`
}

UpdateDefaultUserQuotaResponse is the response body for POST /cloud/user/quota.

type UpdateDocumentRequest

type UpdateDocumentRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateDocumentRequest is the request body for PATCH /cloud/document/{document}.

type UpdateDocumentResponse

type UpdateDocumentResponse struct {
	Document int `json:"document"`
}

UpdateDocumentResponse is the response body for PATCH /cloud/document.

type UpdateGroupQuotaRequest

type UpdateGroupQuotaRequest struct {
	Template string `json:"template"`
}

UpdateGroupQuotaRequest is the request body for PATCH /cloud/group/{group}/quota.

type UpdateGroupQuotaResponse

type UpdateGroupQuotaResponse struct {
	Quota UserDefaultQuotas `json:"quotas"`
}

UpdateGroupQuotaResponse is the response body for PATCH /cloud/group/{group}/quota.

type UpdateGroupRequest

type UpdateGroupRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateGroupRequest is the request body for PATCH /cloud/group.

type UpdateGroupResponse

type UpdateGroupResponse struct {
	Group int `json:"group"`
}

UpdateGroupResponse is the response body for PATCH /cloud/group.

type UpdateHookRequest

type UpdateHookRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateHookRequest is the request body for PATCH /cloud/hook/{hook}.

type UpdateHookResponse

type UpdateHookResponse struct {
	Hook int `json:"hook"`
}

UpdateHookResponse is the response body for PATCH /cloud/hook.

type UpdateHostRequest

type UpdateHostRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateHostRequest is the request body for PATCH /cloud/host/{host}.

type UpdateHostResponse

type UpdateHostResponse struct {
	Host int `json:"host"`
}

UpdateHostResponse is the response body for PATCH /cloud/host.

type UpdateImageRequest

type UpdateImageRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateImageRequest is the request body for PATCH /cloud/image/{image}.

type UpdateImageResponse

type UpdateImageResponse struct {
	Image int `json:"image"`
}

UpdateImageResponse is the response body for PATCH /cloud/image.

type UpdateInstanceConfigRequest

type UpdateInstanceConfigRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateInstanceConfigRequest is the request body for PATCH /cloud/instance/{instance}/config.

type UpdateInstanceConfigResponse

type UpdateInstanceConfigResponse struct {
	Instance int `json:"instance"`
}

UpdateInstanceConfigResponse is the response body for PATCH /cloud/instance/config.

type UpdateInstanceGroupRequest

type UpdateInstanceGroupRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateInstanceGroupRequest is the request body for PATCH /cloud/instance-group/{group}.

type UpdateInstanceGroupResponse

type UpdateInstanceGroupResponse struct {
	Group int `json:"group"`
}

UpdateInstanceGroupResponse is the response body for PATCH /cloud/instance-group.

type UpdateInstanceScheduleRequest

type UpdateInstanceScheduleRequest struct {
	Action   int    `json:"action"`
	Template string `json:"template"`
}

UpdateInstanceScheduleRequest is the request body for PATCH /cloud/instance/{instance}/schedule.

type UpdateInstanceScheduleResponse

type UpdateInstanceScheduleResponse struct {
	Instance int `json:"instance"`
}

UpdateInstanceScheduleResponse is the response body for PATCH /cloud/instance/schedule.

type UpdateInstanceTemplateRequest

type UpdateInstanceTemplateRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateInstanceTemplateRequest is the request body for PATCH /cloud/instance/{instance}/template.

type UpdateInstanceTemplateResponse

type UpdateInstanceTemplateResponse struct {
	Instance int `json:"instance"`
}

UpdateInstanceTemplateResponse is the response body for PATCH /cloud/instance/template.

type UpdateMarketAppRequest

type UpdateMarketAppRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateMarketAppRequest is the request body for PATCH /cloud/market/app/{app}.

type UpdateMarketAppResponse

type UpdateMarketAppResponse struct {
	MarketApp int `json:"market_app"`
}

UpdateMarketAppResponse is the response body for PATCH /cloud/market/app.

type UpdateMarketRequest

type UpdateMarketRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateMarketRequest is the request body for PATCH /cloud/market/{market}.

type UpdateMarketResponse

type UpdateMarketResponse struct {
	Market int `json:"market"`
}

UpdateMarketResponse is the response body for PATCH /cloud/market.

type UpdateNetworkAddressRangeRequest

type UpdateNetworkAddressRangeRequest struct {
	Template string `json:"template"`
}

UpdateNetworkAddressRangeRequest is the request body for PATCH /cloud/network/{network}/address-range.

type UpdateNetworkAddressRangeResponse

type UpdateNetworkAddressRangeResponse struct {
	Network int `json:"network"`
}

UpdateNetworkAddressRangeResponse is the response body for PATCH /cloud/network/address-range.

type UpdateNetworkRequest

type UpdateNetworkRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateNetworkRequest is the request body for PATCH /cloud/network/{network}.

type UpdateNetworkResponse

type UpdateNetworkResponse struct {
	Network int `json:"network"`
}

UpdateNetworkResponse is the response body for PATCH /cloud/network.

type UpdateNetworkTemplateRequest

type UpdateNetworkTemplateRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateNetworkTemplateRequest is the request body for PATCH /cloud/network/{network}/template.

type UpdateNetworkTemplateResponse

type UpdateNetworkTemplateResponse struct {
	Template int `json:"template"`
}

UpdateNetworkTemplateResponse is the response body for PATCH /cloud/network/template.

type UpdateRouterRequest

type UpdateRouterRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateRouterRequest is the request body for PATCH /cloud/router/{router}.

type UpdateRouterResponse

type UpdateRouterResponse struct {
	Router int `json:"router"`
}

UpdateRouterResponse is the response body for PATCH /cloud/router.

type UpdateSecurityGroupRequest

type UpdateSecurityGroupRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateSecurityGroupRequest is the request body for PATCH /cloud/security-group/{sg}.

type UpdateSecurityGroupResponse

type UpdateSecurityGroupResponse struct {
	SecurityGroup int `json:"security_group"`
}

UpdateSecurityGroupResponse is the response body for PATCH /cloud/security-group.

type UpdateTemplateRequest

type UpdateTemplateRequest struct {
	Data  string `json:"data"`
	Merge bool   `json:"merge"`
}

UpdateTemplateRequest is the response body for PATCH /cloud/template/{template}.

type UpdateTemplateResponse

type UpdateTemplateResponse struct {
	Template int `json:"template"`
}

UpdateTemplateResponse is the response body for PATCH /cloud/template.

type UpdateUserRequest

type UpdateUserRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateUserRequest is the request body for PATCH /cloud/user/{user}.

type UpdateUserResponse

type UpdateUserResponse struct {
	User int `json:"user"`
}

UpdateUserResponse is the response body for PATCH /cloud/user.

type UpdateZoneRequest

type UpdateZoneRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateZoneRequest is the request body for PATCH /cloud/zone/{zone}.

type UpdateZoneResponse

type UpdateZoneResponse struct {
	Zone int `json:"zone"`
}

UpdateZoneResponse is the response body for PATCH /cloud/zone.

type User

type User struct {
	ID                int               `json:"id" yaml:"id"`
	GroupID           int               `json:"group_id" yaml:"group_id"`
	Groups            []int             `json:"groups" yaml:"groups"`
	GroupName         string            `json:"group_name" yaml:"group_name"`
	Name              string            `json:"name" yaml:"name"`
	Password          string            `json:"password" yaml:"password"`
	AuthDriver        string            `json:"auth_driver" yaml:"auth_driver"`
	Enabled           bool              `json:"enabled" yaml:"enabled"`
	LoginToken        []UserLoginToken  `json:"login_token" yaml:"login_token"`
	Template          UserTemplate      `json:"template" yaml:"template"`
	TemplateText      string            `json:"template_text" yaml:"template_text"`
	DatastoreQuota    []UserDatastore   `json:"datastore_quota" yaml:"datastore_quota"`
	NetworkQuota      []UserNetwork     `json:"network_quota" yaml:"network_quota"`
	InstanceQuota     UserInstance      `json:"instance_quota" yaml:"instance_quota"`
	ImageQuota        []UserImage       `json:"image_quota" yaml:"image_quota"`
	DefaultUserQuotas UserDefaultQuotas `json:"default_user_quotas" yaml:"default_user_quotas"`
}

User is the API payload based on the legacy xmlrpc backend.

type UserDatastore

type UserDatastore struct {
	ID         string `json:"id" yaml:"id"`
	Images     string `json:"images" yaml:"images"`
	ImagesUsed string `json:"images_used" yaml:"images_used"`
	Size       string `json:"size" yaml:"size"`
	SizeUsed   string `json:"size_used" yaml:"size_used"`
}

UserDatastore is the API payload based on the legacy xmlrpc backend.

type UserDefaultQuotas

type UserDefaultQuotas struct {
	DatastoreQuota []UserDatastore `json:"datastore_quota" yaml:"datastore_quota"`
	NetworkQuota   []UserNetwork   `json:"network_quota" yaml:"network_quota"`
	InstanceQuota  UserInstance    `json:"instance_quota" yaml:"instance_quota"`
	ImageQuota     []UserImage     `json:"image_quota" yaml:"image_quota"`
}

UserDefaultQuotas is the API payload based on the legacy xmlrpc backend.

type UserImage

type UserImage struct {
	ID                   string `json:"id" yaml:"id"`
	RunningInstances     string `json:"running_instances" yaml:"running_instances"`
	RunningInstancesUsed string `json:"running_instances_used" yaml:"running_instances_used"`
}

UserImage is the API payload based on the legacy xmlrpc backend.

type UserInstance

type UserInstance struct {
	CPU                  float32 `json:"cpu" yaml:"cpu"`
	CPUUsed              float32 `json:"cpu_used" yaml:"cpu_used"`
	Memory               int     `json:"memory" yaml:"memory"`
	MemoryUsed           int     `json:"memory_used" yaml:"memory_used"`
	RunningCPU           float32 `json:"running_cpu" yaml:"running_cpu"`
	RunningCPUUsed       float32 `json:"running_cpu_used" yaml:"running_cpu_used"`
	RunningMemory        int     `json:"running_memory" yaml:"running_memory"`
	RunningMemoryUsed    int     `json:"running_memory_used" yaml:"running_memory_used"`
	RunningInstances     int     `json:"running_instances" yaml:"running_instances"`
	RunningInstancesUsed int     `json:"running_instances_used" yaml:"running_instances_used"`
	SystemDiskSize       int64   `json:"system_disk_size" yaml:"system_disk_size"`
	SystemDiskSizeUsed   int64   `json:"system_disk_size_used" yaml:"system_disk_size_used"`
	Instances            int     `json:"instances" yaml:"instances"`
	InstancesUsed        int     `json:"instances_used" yaml:"instances_used"`
}

UserInstance is the API payload based on the legacy xmlrpc backend.

type UserLoginRequest

type UserLoginRequest struct {
	Username string `json:"username"`
	Token    string `json:"token"`
	Duration int    `json:"duration"`
	Group    int    `json:"group"`
}

UserLoginRequest is the request body for POST /cloud/user/login.

type UserLoginResponse

type UserLoginResponse struct {
	Token string `json:"token"`
}

UserLoginResponse is the response body for POST /cloud/user/login.

type UserLoginToken

type UserLoginToken struct {
	Token            string    `json:"token" yaml:"token"`
	ExpirationTime   time.Time `json:"expiration_time" yaml:"expiration_time"`
	EffectiveGroupID int       `json:"effective_group_id" yaml:"effective_group_id"`
}

UserLoginToken is the API payload based on the legacy xmlrpc backend.

type UserNetwork

type UserNetwork struct {
	ID         string `json:"id" yaml:"id"`
	Leases     string `json:"leases" yaml:"leases"`
	LeasesUsed string `json:"leases_used" yaml:"leases_used"`
}

UserNetwork is the API payload based on the legacy xmlrpc backend.

type UserQuotaResponse

type UserQuotaResponse struct {
	Quota UserDefaultQuotas `json:"quota"`
}

UserQuotaResponse is the response body for GET /cloud/user/quota.

type UserResponse

type UserResponse struct {
	User User `json:"user"`
}

UserResponse is the response body for GET /cloud/user.

type UserService

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

UserService owns the /cloud/user methods.

func (UserService) AddUserGroup

func (s UserService) AddUserGroup(ctx context.Context, id, group int) (*AddUserGroupResponse, error)

AddUserGroup adds the user to the group with the given ID.

func (UserService) ChangeUserAuth

ChangeUserAuth changes the user's authentication method.

func (UserService) ChangeUserGroup

func (s UserService) ChangeUserGroup(ctx context.Context, id, group int) (*ChangeUserGroupResponse, error)

ChangeUserGroup changes the user's group.

func (UserService) ChangeUserPassword

ChangeUserPassword changes the user's password.

func (UserService) CreateUser

CreateUser creates a new user.

func (UserService) DeleteUser

func (s UserService) DeleteUser(ctx context.Context, id int) error

DeleteUser deletes the user with the given ID.

func (UserService) DeleteUserGroup

func (s UserService) DeleteUserGroup(ctx context.Context, id, group int) error

DeleteUserGroup deletes the user from the group with the given ID.

func (UserService) EnableUser

func (s UserService) EnableUser(ctx context.Context, id int, req EnableUserRequest) (*EnableUserResponse, error)

EnableUser enables the user with the given ID.

func (UserService) SetUserQuota

func (s UserService) SetUserQuota(ctx context.Context, id int, req SetUserQuotaRequest) (*SetUserQuotaResponse, error)

SetUserQuota sets the user's quota.

func (UserService) UpdateDefaultUserQuota

UpdateDefaultUserQuota updates the default user quota.

func (UserService) UpdateUser

func (s UserService) UpdateUser(ctx context.Context, id int, req UpdateUserRequest) (*UpdateUserResponse, error)

UpdateUser updates the user with the given ID.

func (UserService) User

func (s UserService) User(ctx context.Context, id int) (*UserResponse, error)

User returns information about a user.

func (UserService) UserQuota

func (s UserService) UserQuota(ctx context.Context) (*UserQuotaResponse, error)

UserQuota returns the default user quota.

func (UserService) Users

func (s UserService) Users(ctx context.Context) (*UsersResponse, error)

Users returns information about all users.

type UserTemplate

type UserTemplate struct {
	Values           map[string]string `json:"values" yaml:"values"`
	RadosGW          bool              `json:"rados_gw" yaml:"rados_gw"`
	RadosGWAccessKey string            `json:"rados_gw_access_key" yaml:"rados_gw_access_key"`
	RadosGWSecretKey string            `json:"rados_gw_secret_key" yaml:"rados_gw_secret_key"`
	SSHPublicKey     string            `json:"ssh_public_key" yaml:"ssh_public_key"`
	TokenPassword    string            `json:"token_password" yaml:"token_password"`
}

UserTemplate is the API payload based on the legacy xmlrpc backend.

type UsersResponse

type UsersResponse struct {
	Users []User `json:"users"`
}

UsersResponse is the response body for GET /cloud/user.

type Zone

type Zone struct {
	ID           int          `json:"id" yaml:"id"`
	Name         string       `json:"name" yaml:"name"`
	State        int          `json:"state" yaml:"state"`
	Template     ZoneTemplate `json:"template" yaml:"template"`
	TemplateText string       `json:"template_text" yaml:"template_text"`
	Servers      []Server     `json:"servers" yaml:"servers"`
}

Zone is the API payload based on the legacy xmlrpc backend.

type ZoneResponse

type ZoneResponse struct {
	Zone Zone `json:"zone"`
}

ZoneResponse is the response body for GET /cloud/zone.

type ZoneService

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

ZoneService owns the /cloud/zone methods.

func (ZoneService) CreateZone

CreateZone creates a new zone.

func (ZoneService) DeleteZone

func (s ZoneService) DeleteZone(ctx context.Context, id int) error

DeleteZone deletes the zone with the given ID.

func (ZoneService) EnableZone

func (s ZoneService) EnableZone(ctx context.Context, id int, req EnableZoneRequest) (*EnableZoneResponse, error)

EnableZone enables the zone with the given ID.

func (ZoneService) RenameZone

func (s ZoneService) RenameZone(ctx context.Context, id int, req RenameZoneRequest) (*RenameZoneResponse, error)

RenameZone renames the zone with the given ID.

func (ZoneService) UpdateZone

func (s ZoneService) UpdateZone(ctx context.Context, id int, req UpdateZoneRequest) (*UpdateZoneResponse, error)

UpdateZone updates the zone with the given ID.

func (ZoneService) Zone

func (s ZoneService) Zone(ctx context.Context, id int) (*ZoneResponse, error)

Zone returns information about a zone.

func (ZoneService) Zones

func (s ZoneService) Zones(ctx context.Context) (*ZonesResponse, error)

Zones returns information about all zones.

func (ZoneService) ZonesRaftStatus

func (s ZoneService) ZonesRaftStatus(ctx context.Context) (*ZonesRaftStatusResponse, error)

ZonesRaftStatus returns the raft status for all zones.

type ZoneTemplate

type ZoneTemplate struct {
	Values   map[string]string `json:"values" yaml:"values"`
	Endpoint string            `json:"endpoint" yaml:"endpoint"`
}

ZoneTemplate is the API payload based on the legacy xmlrpc backend.

type ZonesRaftStatusResponse

type ZonesRaftStatusResponse struct {
	Status RaftStatus `json:"status"`
}

ZonesRaftStatusResponse is the response body for GET /cloud/zone/raft.

type ZonesResponse

type ZonesResponse struct {
	Zones []Zone `json:"zones"`
}

ZonesResponse is the response body for GET /cloud/zone.

Directories

Path Synopsis
Package config contains struct for the HyperCloudConfiguration payload.
Package config contains struct for the HyperCloudConfiguration payload.
Package datacenter provides structs for the Datacenter payload.
Package datacenter provides structs for the Datacenter payload.
Package instance contains structs for the Instance payload.
Package instance contains structs for the Instance payload.
Package insttmpl provides structs for the InstanceTemplate payload.
Package insttmpl provides structs for the InstanceTemplate payload.
Package nettmpl provides strcuts for the VNetTemplate payload.
Package nettmpl provides strcuts for the VNetTemplate payload.
Package network provides structs for the VNet payload.
Package network provides structs for the VNet payload.

Jump to

Keyboard shortcuts

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