cloud

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 18 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 added in v0.4.0

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 added in v0.4.0

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

ACLService owns the /cloud/acl methods.

func (ACLService) ACLs added in v0.4.0

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

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

func (ACLService) CreateACL added in v0.4.0

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

func (ACLService) DeleteACL added in v0.4.0

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

DeleteACL deletes the Access Control List specified by the id.

type ACLsResponse added in v0.4.0

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 added in v0.4.0

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

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

type AddDataCenterDatastoreResponse added in v0.4.0

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

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

type AddDataCenterGroupResponse added in v0.4.0

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

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

type AddDataCenterHostResponse added in v0.4.0

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

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

type AddDataCenterNetworkResponse added in v0.4.0

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 added in v0.4.0

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

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

type AddNetworkAddressRangeResponse added in v0.4.0

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 added in v0.4.0

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

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

type ChangeNetworkOwnershipResponse added in v0.4.0

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

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

type ChangeNetworkPermissionsRequest added in v0.4.0

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

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

type ChangeNetworkPermissionsResponse added in v0.4.0

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

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

type ChangeNetworkTemplateOwnershipRequest added in v0.4.0

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 added in v0.4.0

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

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

type ChangeNetworkTemplatePermissionsRequest added in v0.4.0

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

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

type ChangeNetworkTemplatePermissionsResponse added in v0.4.0

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

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

type ChangeRouterOwnershipRequest added in v0.4.0

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

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

type ChangeRouterOwnershipResponse added in v0.4.0

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

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

type ChangeRouterPermissionsRequest added in v0.4.0

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

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

type ChangeRouterPermissionsResponse added in v0.4.0

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 added in v0.4.0

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

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

type CloneNetworkTemplateResponse added in v0.4.0

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   Template `json:"template" yaml:"template"`
}

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

func (*Cluster) ParseTemplate added in v0.14.0

func (c *Cluster) ParseTemplate() (*ClusterTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type ClusterResponse added in v0.4.0

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

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

type ClusterService added in v0.4.0

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

ClusterService owns the /cloud/cluster methods.

func (ClusterService) AddClusterDatastore added in v0.4.0

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

AddClusterDatastore adds the datastore to the cluster.

func (ClusterService) AddClusterHost added in v0.4.0

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

AddClusterHost adds the host to the cluster.

func (ClusterService) AddClusterNetwork added in v0.4.0

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

AddClusterNetwork adds the network to the cluster.

func (ClusterService) Cluster added in v0.4.0

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

Cluster returns information about a cluster.

func (ClusterService) Clusters added in v0.4.0

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

Clusters returns information about all clusters.

func (ClusterService) CreateCluster added in v0.4.0

CreateCluster creates a cluster.

func (ClusterService) DeleteCluster added in v0.4.0

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

DeleteCluster deletes the cluster with the given ID.

func (ClusterService) DeleteClusterDatastore added in v0.4.0

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

DeleteClusterDatastore deletes the datastore from the cluster.

func (ClusterService) DeleteClusterHost added in v0.4.0

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

DeleteClusterHost deletes the host from the cluster.

func (ClusterService) DeleteClusterNetwork added in v0.4.0

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

DeleteClusterNetwork deletes the network from the cluster.

func (ClusterService) RenameCluster added in v0.4.0

RenameCluster updates the name of the cluster.

func (ClusterService) UpdateCluster added in v0.4.0

UpdateCluster updates the cluster.

type ClusterTemplate

type ClusterTemplate struct {
	ReservedCPU    string
	ReservedMemory string
}

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

type ClustersResponse added in v0.4.0

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 added in v0.4.0

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

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

type CreateDataCenterResponse added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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.

func (*CreateImageRequest) SetTemplate added in v0.17.0

func (r *CreateImageRequest) SetTemplate(t ImageTemplate)

SetTemplate sets r.Template from its structured representation. Either call this of set the template string directly.

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.

func (*CreateInstanceRequest) SetTemplate added in v0.17.0

func (r *CreateInstanceRequest) SetTemplate(t InstanceTemplate)

SetTemplate sets r.Template from its structured representation. Either call this of set the template string directly.

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 added in v0.4.0

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

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

type CreateNetworkResponse added in v0.4.0

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

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

type CreateNetworkTemplateRequest added in v0.4.0

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

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

type CreateNetworkTemplateResponse added in v0.4.0

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

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

type CreateRouterNICRequest added in v0.4.0

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

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

type CreateRouterNICResponse added in v0.4.0

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

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

type CreateRouterRequest added in v0.4.0

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

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

type CreateRouterResponse added in v0.4.0

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 added in v0.4.0

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   Template               `json:"template" yaml:"template"`
}

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

func (*DataCenter) ParseTemplate added in v0.14.0

func (d *DataCenter) ParseTemplate() (*DataCenterTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type DataCenterResponse added in v0.4.0

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

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

type DataCenterService added in v0.4.0

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

DataCenterService owns the /cloud/datacenter methods.

func (DataCenterService) AddDataCenterCluster added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

CreateDataCenter creates a new Data Center.

func (DataCenterService) DataCenter added in v0.4.0

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

DataCenter returns information about a vdc.

func (DataCenterService) DataCenters added in v0.4.0

DataCenters returns information about all vdcs.

func (DataCenterService) DeleteDataCenter added in v0.4.0

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

DeleteDataCenter deletes the Data Center with the given ID.

func (DataCenterService) RemoveDataCenterCluster added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

RenameDataCenter renames the Data Center with the given ID.

func (DataCenterService) UpdateDataCenter added in v0.4.0

UpdateDataCenter updates the Data Center with the given ID.

type DataCenterTemplate added in v0.4.0

type DataCenterTemplate struct {
	Description string
}

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

type DataCentersResponse added in v0.4.0

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"`
	DiskType           int            `json:"disk_type" yaml:"disk_type"`
	State              DatastoreState `json:"state" yaml:"state"`
	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           Template       `json:"template" yaml:"template"`
}

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

type DatastoreResponse added in v0.4.0

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

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

type DatastoreService added in v0.4.0

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

DatastoreService owns the /cloud/datastore methods.

func (DatastoreService) ChangeDatastoreOwnership added in v0.4.0

ChangeDatastoreOwnership changes the datastore ownership with the given ID.

func (DatastoreService) ChangeDatastorePermissions added in v0.4.0

ChangeDatastorePermissions changes the datastore permissions with the given ID.

func (DatastoreService) CreateDatastore added in v0.4.0

CreateDatastore creates a new datastore.

func (DatastoreService) Datastore added in v0.4.0

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

Datastore returns information about a datastore.

func (DatastoreService) Datastores added in v0.4.0

Datastores returns information about all datastores.

func (DatastoreService) DeleteDatastore added in v0.4.0

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

DeleteDatastore deletes the datastore with the given ID.

func (DatastoreService) EnableDatastore added in v0.4.0

EnableDatastore enables the datastore with the given ID.

func (DatastoreService) RenameDatastore added in v0.4.0

RenameDatastore renames the datastore with the given ID.

func (DatastoreService) UpdateDatastore added in v0.4.0

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 {
	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 added in v0.4.0

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    Template    `json:"template" yaml:"template"`
}

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

type DocumentResponse added in v0.4.0

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

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

type DocumentService added in v0.4.0

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

DocumentService owns the /cloud/document methods.

func (DocumentService) AllocateDocument added in v0.4.0

AllocateDocument allocates a document.

func (DocumentService) ChangeDocumentOwnership added in v0.4.0

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

func (DocumentService) ChangeDocumentPermissions added in v0.4.0

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

func (DocumentService) CloneDocument added in v0.4.0

CloneDocument clones the document with the given ID.

func (DocumentService) DeleteDocument added in v0.4.0

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

DeleteDocument deletes a document with the given ID.

func (DocumentService) Document added in v0.4.0

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

Document returns information about the document with the given ID.

func (DocumentService) Documents added in v0.4.0

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

Documents returns information about all documents.

func (DocumentService) LockDocument added in v0.4.0

LockDocument locks the document with the given ID.

func (DocumentService) RenameDocument added in v0.4.0

RenameDocument renames the document with the given ID.

func (DocumentService) UnlockDocument added in v0.4.0

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

UnlockDocument unlocks the document with the given ID.

func (DocumentService) UpdateDocument added in v0.4.0

UpdateDocument updates the document with the given ID.

type DocumentsResponse added in v0.4.0

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 added in v0.8.0

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           Template          `json:"template" yaml:"template"`
	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.

func (*Group) ParseTemplate added in v0.14.0

func (g *Group) ParseTemplate() (*GroupTemplate, error)

ParseTemplate return a structured Template based on the given map.

type GroupQuotaResponse added in v0.4.0

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

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

type GroupResponse added in v0.4.0

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

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

type GroupService added in v0.4.0

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

GroupService owns the /cloud/group methods.

func (GroupService) AddGroupAdmin added in v0.4.0

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

func (GroupService) CreateGroup added in v0.4.0

CreateGroup creates a new group.

func (GroupService) DeleteGroup added in v0.4.0

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

DeleteGroup deletes the group with the given ID.

func (GroupService) DeleteGroupAdmin added in v0.4.0

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 added in v0.4.0

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

Group returns information about a group.

func (GroupService) GroupQuota added in v0.4.0

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

GroupQuota returns the default group quota.

func (GroupService) Groups added in v0.4.0

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

Groups returns information about all groups.

func (GroupService) SetGroupQuota added in v0.4.0

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

func (GroupService) UpdateGroup added in v0.4.0

UpdateGroup updates the group with the given ID.

func (GroupService) UpdateGroupQuota added in v0.4.0

UpdateGroupQuota updates the default group quota.

type GroupTemplate

type GroupTemplate struct {
	Sunstone *SunstoneTemplate
}

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

type GroupsResponse added in v0.4.0

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

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

type HoldNetworkRequest added in v0.4.0

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

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

type HoldNetworkResponse added in v0.4.0

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 Template `json:"template" yaml:"template"`
	HookLog  HookLog  `json:"hook_log" yaml:"hook_log"`
}

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

func (*Hook) ParseTemplate added in v0.14.0

func (h *Hook) ParseTemplate() (*HookTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

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 added in v0.4.0

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

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

type HookResponse added in v0.4.0

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

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

type HookService added in v0.4.0

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

HookService own the /cloud/hook methods.

func (HookService) CreateHook added in v0.4.0

CreateHook creates a new hook.

func (HookService) DeleteHook added in v0.4.0

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

DeleteHook deletes the hook with the given id.

func (HookService) Hook added in v0.4.0

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

Hook returns information about a hook.

func (HookService) HookLog added in v0.4.0

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

HookLog returns the logs for a hook.

func (HookService) Hooks added in v0.4.0

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

Hooks returns information about all hooks.

func (HookService) LockHook added in v0.4.0

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

LockHook locks the hook with the given id.

func (HookService) RenameHook added in v0.4.0

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

RenameHook renames the hook with the given id.

func (HookService) RetryHook added in v0.4.0

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

RetryHook retries the hook with the given id.

func (HookService) UnlockHook added in v0.4.0

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

UnlockHook unlocks the hook with the given id.

func (HookService) UpdateHook added in v0.4.0

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 {
	Arguments      string
	ArgumentsStdin string
	Call           string
	Command        string
	Remote         string
	Resource       string
	State          string
	LCMState       LCMState
}

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

type HooksResponse added in v0.4.0

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              Template       `json:"template" yaml:"template"`
	Monitoring            HostMonitoring `json:"monitoring" yaml:"monitoring"`
}

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

func (*Host) ParseTemplate added in v0.14.0

func (h *Host) ParseTemplate() (*HostTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

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 added in v0.4.0

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

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

type HostResponse added in v0.4.0

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

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

type HostService added in v0.4.0

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

HostService owns the /cloud/compute methods.

func (HostService) CreateHost added in v0.4.0

CreateHost creates a new compute host.

func (HostService) DeleteHost added in v0.4.0

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

DeleteHost deletes the compute host with the given ID.

func (HostService) Host added in v0.4.0

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

Host returns information about a compute host.

func (HostService) HostMonitoring added in v0.4.0

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

HostMonitoring returns monitoring data for a compute host.

func (HostService) Hosts added in v0.4.0

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

Hosts returns information about all compute hosts.

func (HostService) HostsMonitoring added in v0.4.0

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

HostsMonitoring returns monitoring data for all compute hosts.

func (HostService) RenameHost added in v0.4.0

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 added in v0.4.0

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

func (HostService) UpdateComputeHost added in v0.4.0

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 {
	Arch           string
	CGroupsVersion string
	CPUSpeed       int
	Hostname       string
	Hypervisor     string
	IMMAD          string
	KVMCPUModel    string
	KVMCPUModels   []string
	KVMMachines    []string
	ModelName      string
	ReservedCPU    string
	ReservedMem    string
	TotalWilds     int
	Version        string
	Instance       []HostTemplateInstance
	InstanceMAD    string
	Wilds          string
}

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

type HostTemplateInstance

type HostTemplateInstance struct {
	DeployID string
	ID       int
	Monitor  string
}

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

type HostsMonitoringResponse added in v0.4.0

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

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

type HostsResponse added in v0.4.0

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         Template           `json:"template" yaml:"template"`
	Snapshots        instance.Snapshots `json:"snapshots" yaml:"snapshots"`
}

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

func (*Image) ParseTemplate added in v0.14.0

func (i *Image) ParseTemplate() (*ImageTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type ImageResponse added in v0.4.0

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

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

type ImageService added in v0.4.0

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

ImageService owns the /cloud/image methods.

func (ImageService) ChangeImageOwnership added in v0.4.0

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

func (ImageService) ChangeImagePermissions added in v0.4.0

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

func (ImageService) ChangeImageType added in v0.4.0

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

func (ImageService) CloneImage added in v0.4.0

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

CloneImage clones the image with the given ID.

func (ImageService) CreateImage added in v0.4.0

CreateImage creates a new image.

func (ImageService) DeleteImage added in v0.4.0

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

DeleteImage deletes the image with the given ID.

func (ImageService) DeleteImageSnapshot added in v0.4.0

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 added in v0.4.0

EnableImage enables the image with the given ID.

func (ImageService) FlattenImageSnapshot added in v0.4.0

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 added in v0.4.0

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

Image returns information about a image.

func (ImageService) Images added in v0.4.0

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

Images returns information about all images.

func (ImageService) LockImage added in v0.4.0

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

LockImage locks the image with the given ID.

func (ImageService) RenameImage added in v0.4.0

RenameImage renames the image with the given ID.

func (ImageService) RevertImageSnapshot added in v0.4.0

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 added in v0.4.0

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

func (ImageService) UnlockImage added in v0.4.0

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

UnlockImage unlocks the image with the given ID.

func (ImageService) UpdateImage added in v0.4.0

UpdateImage updates the image with the given ID.

type ImageTemplate

type ImageTemplate struct {
	DevPrefix   string
	Driver      string
	FromApp     string
	FromAppMD5  string
	FromAppName string
	Size        int
}

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 added in v0.8.0

func (i ImageType) V1() hc.ImageType

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

type ImagesResponse added in v0.4.0

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       Template                 `json:"template" yaml:"template"`
	UserTemplate   Template                 `json:"user_template" yaml:"user_template"`
	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.

func (*Instance) ParseTemplate added in v0.14.0

func (i *Instance) ParseTemplate() (*instance.Template, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

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    Template             `json:"template" yaml:"template"`
}

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

type InstanceGroupResponse added in v0.4.0

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

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

type InstanceGroupsResponse added in v0.4.0

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

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

type InstanceMonitoringResponse added in v0.4.0

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 added in v0.8.0

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

type InstanceResponse added in v0.4.0

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

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

type InstanceService added in v0.4.0

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

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

func (InstanceService) AddInstanceSchedule added in v0.4.0

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

func (InstanceService) AddInstanceSecurityGroup added in v0.4.0

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 added in v0.4.0

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

CalculateInstancesShowback calculates the showback for all the instances.

func (InstanceService) ChangeInstanceGroupOwnership added in v0.4.0

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

func (InstanceService) ChangeInstanceGroupPermissions added in v0.4.0

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

func (InstanceService) ChangeInstanceOwnership added in v0.4.0

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

func (InstanceService) ChangeInstancePermissions added in v0.4.0

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

func (InstanceService) CreateInstance added in v0.4.0

CreateInstance creates a new instance.

func (InstanceService) CreateInstanceDisk added in v0.4.0

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

func (InstanceService) CreateInstanceDiskImage added in v0.4.0

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

func (InstanceService) CreateInstanceDiskSnapshot added in v0.4.0

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

func (InstanceService) CreateInstanceNIC added in v0.4.0

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

func (InstanceService) CreateInstanceSnapshot added in v0.4.0

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

func (InstanceService) CreateVNCProxy added in v0.4.0

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

func (InstanceService) DeleteInstanceDisk added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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

DeleteInstanceGroup deletes the instance group with the given ID.

func (InstanceService) DeleteInstanceNIC added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

DeployInstance deploys the instance with the given id.

func (InstanceService) Instance added in v0.4.0

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

Instance returns the Instance for the given id.

func (InstanceService) InstanceGroup added in v0.4.0

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

InstanceGroup returns information about an instance group.

func (InstanceService) InstanceGroups added in v0.4.0

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

InstanceGroups returns information about all instance groups.

func (InstanceService) InstanceMonitoringData added in v0.4.0

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

InstanceMonitoringData returns monitoring data for id.

func (InstanceService) InstanceShowback added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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

InstancesSet returns a slice of Instances.

func (InstanceService) LockInstance added in v0.4.0

LockInstance locks the instance with the given id.

func (InstanceService) LockInstanceGroup added in v0.4.0

LockInstanceGroup locks the instance group with the given ID.

func (InstanceService) MoveInstance added in v0.4.0

MoveInstance moves the instance with the given id.

func (InstanceService) RecoverInstance added in v0.4.0

RecoverInstance recovers the instance with the given id.

func (InstanceService) RenameInstance added in v0.4.0

RenameInstance renames the instance with the given id.

func (InstanceService) RenameInstanceDiskSnapshot added in v0.4.0

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 added in v0.4.0

RenameInstanceGroup renames the instance group with the given ID.

func (InstanceService) ResizeInstance added in v0.4.0

ResizeInstance resizes the instance with the given id.

func (InstanceService) ResizeInstanceDisk added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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

func (InstanceService) UnlockInstance added in v0.4.0

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

UnlockInstance unlocks the instance with the given id.

func (InstanceService) UnlockInstanceGroup added in v0.4.0

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

UnlockInstanceGroup unlocks the instance group with the given ID.

func (InstanceService) UpdateInstanceConfig added in v0.4.0

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

func (InstanceService) UpdateInstanceGroup added in v0.4.0

UpdateInstanceGroup updates the instance group with the given ID.

func (InstanceService) UpdateInstanceSchedule added in v0.4.0

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

func (InstanceService) UpdateInstanceTemplate added in v0.4.0

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    Template    `json:"template" yaml:"template"`
}

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

type InstancesAccountingResponse added in v0.4.0

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

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

type InstancesMonitoringResponse added in v0.4.0

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

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

type InstancesResponse added in v0.4.0

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

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

type InstancesShowbackResponse added in v0.4.0

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

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

type InstantiateNetworkTemplateRequest added in v0.4.0

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 added in v0.4.0

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

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

type InstantiateRouterRequest added in v0.4.0

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 added in v0.4.0

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 added in v0.8.0

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 added in v0.4.0

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

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

type LockNetworkResponse added in v0.4.0

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

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

type LockNetworkTemplateRequest added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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

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

type LockRouterResponse added in v0.4.0

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 added in v0.4.0

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

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

type MarketAppsResponse added in v0.4.0

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

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

type MarketResponse added in v0.4.0

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

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

type MarketService added in v0.4.0

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

MarketService owns the /cloud/market methods.

func (MarketService) ChangeMarketAppOwnership added in v0.4.0

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

func (MarketService) ChangeMarketAppPermissions added in v0.4.0

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

func (MarketService) ChangeMarketOwnership added in v0.4.0

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

func (MarketService) ChangeMarketPermissions added in v0.4.0

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

func (MarketService) CreateMarket added in v0.4.0

CreateMarket creates a new marketplace.

func (MarketService) CreateMarketApp added in v0.4.0

CreateMarketApp creates a new marketplace application.

func (MarketService) DeleteMarket added in v0.4.0

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

DeleteMarket deletes the market with the given ID.

func (MarketService) DeleteMarketApp added in v0.4.0

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

DeleteMarketApp deletes the marketplace application with the given ID.

func (MarketService) EnableMarket added in v0.4.0

EnableMarket enables the marketplace with the given ID.

func (MarketService) EnableMarketApp added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

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

Market returns information about a marketplace.

func (MarketService) MarketApp added in v0.4.0

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

MarketApp returns information about a marketplace application.

func (MarketService) MarketApps added in v0.4.0

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

MarketApps returns information about all marketplace applications.

func (MarketService) Markets added in v0.4.0

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

Markets returns information about all marketplaces.

func (MarketService) RenameMarket added in v0.4.0

RenameMarket renames the marketplace with the given ID.

func (MarketService) RenameMarketApp added in v0.4.0

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 added in v0.4.0

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

UnlockMarketApp unlocks the marketplace application with the given ID.

func (MarketService) UpdateMarket added in v0.4.0

UpdateMarket updates the marketplace with the given ID.

func (MarketService) UpdateMarketApp added in v0.4.0

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"`
	Template        Template    `json:"template" yaml:"template"`
}

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      Template    `json:"template" yaml:"template"`
}

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

type MarketsResponse added in v0.4.0

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 added in v0.8.0

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 added in v0.4.0

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             Template               `json:"template" yaml:"template"`
	AddressRanges        []network.AddressRange `json:"arpool" yaml:"arpool"`
}

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

func (*Network) ParseTemplate added in v0.14.0

func (n *Network) ParseTemplate() (*network.Template, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type NetworkRecovery added in v0.4.0

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 added in v0.4.0

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 added in v0.4.0

func NetworkRecoveryValues() []NetworkRecovery

NetworkRecoveryValues returns all values of the enum

func (NetworkRecovery) IsANetworkRecovery added in v0.4.0

func (i NetworkRecovery) IsANetworkRecovery() bool

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

func (NetworkRecovery) MarshalText added in v0.4.0

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

MarshalText implements the encoding.TextMarshaler interface for NetworkRecovery

func (NetworkRecovery) String added in v0.4.0

func (i NetworkRecovery) String() string

func (*NetworkRecovery) UnmarshalText added in v0.4.0

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

UnmarshalText implements the encoding.TextUnmarshaler interface for NetworkRecovery

func (NetworkRecovery) V1 added in v0.8.0

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

type NetworkResponse added in v0.4.0

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

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

type NetworkService added in v0.4.0

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

NetworkService owns the /cloud/network methods.

func (NetworkService) AddNetworkAddressRange added in v0.4.0

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

func (NetworkService) ChangeNetworkOwnership added in v0.4.0

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

func (NetworkService) ChangeNetworkPermissions added in v0.4.0

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

func (NetworkService) ChangeNetworkTemplateOwnership added in v0.4.0

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

func (NetworkService) ChangeNetworkTemplatePermissions added in v0.4.0

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

func (NetworkService) CloneNetworkTemplate added in v0.4.0

CloneNetworkTemplate clones the network template with the given ID.

func (NetworkService) CreateNetwork added in v0.4.0

CreateNetwork creates a new network.

func (NetworkService) CreateNetworkTemplate added in v0.4.0

CreateNetworkTemplate creates a new network template.

func (NetworkService) DeleteNetwork added in v0.4.0

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

DeleteNetwork deletes the network with the given ID.

func (NetworkService) DeleteNetworkAddressRange added in v0.4.0

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 added in v0.4.0

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

DeleteNetworkTemplate deletes the network template with the given ID.

func (NetworkService) FreeNetworkAddressRange added in v0.4.0

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 added in v0.4.0

HoldNetwork holds the network with the given ID.

func (NetworkService) InstantiateNetworkTemplate added in v0.4.0

InstantiateNetworkTemplate instantiates the network template with the given ID.

func (NetworkService) LockNetwork added in v0.4.0

LockNetwork locks the network with the given ID.

func (NetworkService) LockNetworkTemplate added in v0.4.0

LockNetworkTemplate locks the network template with the given ID.

func (NetworkService) Network added in v0.4.0

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

Network returns information about a network.

func (NetworkService) NetworkTemplate added in v0.4.0

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

NetworkTemplate returns information about a networks.

func (NetworkService) NetworkTemplates added in v0.4.0

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

NetworkTemplates returns information about all networkss.

func (NetworkService) Networks added in v0.4.0

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

Networks returns information about all networks.

func (NetworkService) RecoverNetworks added in v0.4.0

RecoverNetworks recovers the network with the given ID.

func (NetworkService) ReleaseNetwork added in v0.4.0

ReleaseNetwork releases the network with the given ID.

func (NetworkService) RenameNetwork added in v0.4.0

RenameNetwork renames the network with the given ID.

func (NetworkService) RenameNetworkTemplate added in v0.4.0

RenameNetworkTemplate renames the network template with the given ID.

func (NetworkService) ReserveNetwork added in v0.4.0

ReserveNetwork reserves the network with the given ID.

func (NetworkService) UnlockNetwork added in v0.4.0

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

UnlockNetwork unlocks the network with the given ID.

func (NetworkService) UnlockNetworkTemplate added in v0.4.0

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

UnlockNetworkTemplate unlocks the network template with the given ID.

func (NetworkService) UpdateNetwork added in v0.4.0

UpdateNetwork updates the network with the given ID.

func (NetworkService) UpdateNetworkAddressRange added in v0.4.0

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

func (NetworkService) UpdateNetworkTemplate added in v0.4.0

UpdateNetworkTemplate updates the network template with the given ID.

type NetworkTemplate added in v0.4.0

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    Template    `json:"template" yaml:"template"`
}

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

type NetworkTemplateResponse added in v0.4.0

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

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

type NetworkTemplatesResponse added in v0.4.0

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

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

type NetworksResponse added in v0.4.0

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 added in v0.4.0

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

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

type RecoverNetworkResponse added in v0.4.0

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

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

type ReleaseNetworkRequest added in v0.4.0

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

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

type ReleaseNetworkResponse added in v0.4.0

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 added in v0.4.0

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

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

type RenameDataCenterResponse added in v0.4.0

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 added in v0.4.0

type RenameHostRequest struct {
	Hostname string `json:"hostname"`
}

RenameHostRequest is the request body for PATCH /cloud/host/{host}/name.

type RenameHostResponse added in v0.4.0

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 added in v0.4.0

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

RenameNetworkRequest is the request body for PATCH /cloud/network/{network}/name.

type RenameNetworkResponse added in v0.4.0

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

RenameNetworkResponse is the response body for PATCH /cloud/network/name.

type RenameNetworkTemplateRequest added in v0.4.0

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

RenameNetworkTemplateRequest is the request body for PATCH /cloud/network/template/{template}/name.

type RenameNetworkTemplateResponse added in v0.4.0

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

RenameNetworkTemplateResponse is the response body for PATCH /cloud/network/template/name.

type RenameRouterRequest added in v0.4.0

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

RenameRouterRequest is the request body for PATCH /cloud/router/{router}/name.

type RenameRouterResponse added in v0.4.0

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 added in v0.4.0

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

ReserveNetworkRequest is the request body for POST /cloud/network/{network}/reserve.

type ReserveNetworkResponse added in v0.4.0

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 added in v0.4.0

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    Template    `json:"template" yaml:"template"`
}

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

type RouterResponse added in v0.4.0

type RouterResponse struct {
	Router Router `json:"router"`
}

RouterResponse is the response body for GET /cloud/router.

type RouterService added in v0.4.0

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

RouterService own the /cloud/router methods.

func (RouterService) ChangeRouterOwnership added in v0.4.0

ChangeRouterOwnership changes the ownership of a Router with the given ID.

func (RouterService) ChangeRouterPermissions added in v0.4.0

ChangeRouterPermissions changes the permissions of a Router with the given ID.

func (RouterService) CreateRouter added in v0.4.0

CreateRouter creates a new Router.

func (RouterService) CreateRouterNIC added in v0.4.0

CreateRouterNIC creates a new NIC for the Router with the given ID.

func (RouterService) DeleteRouter added in v0.4.0

func (s RouterService) DeleteRouter(ctx context.Context, id int) error

DeleteRouter deletes a Router with the given ID.

func (RouterService) DeleteRouterNIC added in v0.4.0

func (s RouterService) DeleteRouterNIC(ctx context.Context, id int) error

DeleteRouterNIC deletes a NIC from the Router with the given ID.

func (RouterService) InstantiateRouter added in v0.4.0

InstantiateRouter instantiates a Router with the given ID.

func (RouterService) LockRouter added in v0.4.0

LockRouter locks a Router with the given ID.

func (RouterService) RenameRouter added in v0.4.0

RenameRouter renames a Router with the given ID.

func (RouterService) Router added in v0.4.0

func (s RouterService) Router(ctx context.Context, id int) (*RouterResponse, error)

Router returns information about a router.

func (RouterService) Routers added in v0.4.0

func (s RouterService) Routers(ctx context.Context) (*RoutersResponse, error)

Routers returns information about all routers.

func (RouterService) UnlockRouter added in v0.4.0

func (s RouterService) UnlockRouter(ctx context.Context, id int) (*UnlockRouterResponse, error)

UnlockRouter unlocks a Router with the given ID.

func (RouterService) UpdateRouter added in v0.4.0

UpdateRouter updates a Router with the given ID.

type RoutersResponse added in v0.4.0

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          Template    `json:"template" yaml:"template"`
}

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

func (*SecurityGroup) ParseTemplate added in v0.14.0

func (g *SecurityGroup) ParseTemplate() (*SecurityGroupTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type SecurityGroupResponse added in v0.4.0

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 added in v0.4.0

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

SecurityGroupService owns the /cloud/security-group methods.

func (SecurityGroupService) ChangeSecurityGroupOwnership added in v0.4.0

ChangeSecurityGroupOwnership changes the ownership of the security group with the given ID.

func (SecurityGroupService) ChangeSecurityGroupPermissions added in v0.4.0

ChangeSecurityGroupPermissions changes the permissions of the security group with the given ID.

func (SecurityGroupService) CloneSecurityGroup added in v0.4.0

CloneSecurityGroup clones the security group with the given ID.

func (SecurityGroupService) CommitSecurityGroup added in v0.4.0

CommitSecurityGroup commits the security group with the given ID.

func (SecurityGroupService) CreateSecurityGroup added in v0.4.0

CreateSecurityGroup creates a new security group.

func (SecurityGroupService) DeleteSecurityGroup added in v0.4.0

func (s SecurityGroupService) DeleteSecurityGroup(ctx context.Context, id int) error

DeleteSecurityGroup deletes the security group with the given ID.

func (SecurityGroupService) RenameSecurityGroup added in v0.4.0

RenameSecurityGroup renames the security group with the given ID.

func (SecurityGroupService) SecurityGroup added in v0.4.0

func (s SecurityGroupService) SecurityGroup(ctx context.Context, id int) (*SecurityGroupResponse, error)

SecurityGroup returns information about a image.

func (SecurityGroupService) SecurityGroups added in v0.4.0

SecurityGroups returns information about all images.

func (SecurityGroupService) UpdateSecurityGroup added in v0.4.0

UpdateSecurityGroup updates the security group with the given ID.

type SecurityGroupTemplate

type SecurityGroupTemplate struct {
	Description string
	Rule        []SecurityGroupRule
}

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

type SecurityGroupsResponse added in v0.4.0

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 added in v0.4.0

Service owns the /cloud methods.

func NewService added in v0.4.0

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 added in v0.4.0

type SetHostStatusRequest struct {
	Status string `json:"status"`
}

SetHostStatusRequest is the request body for PATCH /cloud/host/{host}/status.

type SetHostStatusResponse added in v0.4.0

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 added in v0.8.0

func (s Status) V1() hc.Status

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

type SunstoneTemplate

type SunstoneTemplate struct {
	DefaultView           string
	GroupAdminDefaultView string
	GroupAdminViews       []string
	Views                 []string
}

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 added in v0.4.0

type SystemConfigResponse struct {
	Config HyperCloudConfiguration `json:"config"`
}

SystemConfigResponse is the response body for GET /cloud/system/config.

type SystemService added in v0.4.0

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

SystemService owns the /cloud/system methods.

func (SystemService) SystemConfig added in v0.4.0

func (s SystemService) SystemConfig(ctx context.Context) (*SystemConfigResponse, error)

SystemConfig returns HC config.

func (SystemService) SystemVersion added in v0.4.0

func (s SystemService) SystemVersion(ctx context.Context) (*SystemVersionResponse, error)

SystemVersion returns the version of HC.

type SystemVersionResponse added in v0.4.0

type SystemVersionResponse struct {
	Version string `json:"version"`
}

SystemVersionResponse is the response body for GET /cloud/system/version.

type Template added in v0.13.0

type Template map[string]any

Template is nested map of string key x value pairs.

func NewTemplate added in v0.17.0

func NewTemplate(t any) Template

NewTemplate returns a new Template from the struct t. If t is not a struct (or a pointer to one) it panics.

func (Template) String added in v0.13.0

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) UnmarshalJSON added in v0.13.0

func (t *Template) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for t.

type TemplateResponse added in v0.4.0

type TemplateResponse struct {
	Template InstanceTemplate `json:"template"`
}

TemplateResponse is the response body for GET /cloud/template.

type TemplateService added in v0.4.0

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

TemplateService own the /cloud/template methods.

func (TemplateService) ChangeTemplateOwnership added in v0.4.0

ChangeTemplateOwnership changes the ownership of the template with the given ID.

func (TemplateService) ChangeTemplatePermissions added in v0.4.0

ChangeTemplatePermissions changes the permissions of the template with the given ID.

func (TemplateService) CloneTemplate added in v0.4.0

CloneTemplate clones the template with the given ID.

func (TemplateService) CreateTemplate added in v0.4.0

CreateTemplate creates a new template.

func (TemplateService) DeleteTemplate added in v0.4.0

func (s TemplateService) DeleteTemplate(ctx context.Context, id int) error

DeleteTemplate deletes the template with the given ID.

func (TemplateService) InstantiateTemplate added in v0.4.0

InstantiateTemplate instantiates the template with the given ID.

func (TemplateService) LockTemplate added in v0.4.0

LockTemplate locks the template with the given ID.

func (TemplateService) RenameTemplate added in v0.4.0

RenameTemplate renames the template with the given ID.

func (TemplateService) Template added in v0.4.0

func (s TemplateService) Template(ctx context.Context, id int) (*TemplateResponse, error)

Template returns information about a template.

func (TemplateService) Templates added in v0.4.0

func (s TemplateService) Templates(ctx context.Context) (*TemplatesResponse, error)

Templates returns information about all templates.

func (TemplateService) UnlockTemplate added in v0.4.0

func (s TemplateService) UnlockTemplate(ctx context.Context, id int) (*UnlockTemplateResponse, error)

UnlockTemplate unlocks the template with the given ID.

func (TemplateService) UpdateTemplate added in v0.4.0

UpdateTemplate updates the template with the given ID.

type TemplatesResponse added in v0.4.0

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 added in v0.4.0

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

UnlockNetworkResponse is the response body for PATCH /cloud/network/unlock.

type UnlockNetworkTemplateResponse added in v0.4.0

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

UnlockNetworkTemplateResponse is the response body for PATCH /cloud/network/template/unlock.

type UnlockRouterResponse added in v0.4.0

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 added in v0.4.0

type UpdateDataCenterRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

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

type UpdateDataCenterResponse added in v0.4.0

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.

func (*UpdateGroupRequest) SetTemplate added in v0.17.0

func (r *UpdateGroupRequest) SetTemplate(t GroupTemplate)

SetTemplate sets r.Template from its structured representation. Either call this of set the template string directly.

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 added in v0.4.0

type UpdateHostRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

UpdateHostRequest is the request body for PATCH /cloud/host/{host}.

type UpdateHostResponse added in v0.4.0

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}.

func (*UpdateImageRequest) SetTemplate added in v0.17.0

func (r *UpdateImageRequest) SetTemplate(t ImageTemplate)

SetTemplate sets r.Template from its structured representation. Either call this of set the template string directly.

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 added in v0.4.0

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

UpdateNetworkAddressRangeRequest is the request body for PATCH /cloud/network/{network}/address-range.

type UpdateNetworkAddressRangeResponse added in v0.4.0

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

UpdateNetworkAddressRangeResponse is the response body for PATCH /cloud/network/address-range.

type UpdateNetworkRequest added in v0.4.0

type UpdateNetworkRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

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

type UpdateNetworkResponse added in v0.4.0

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

UpdateNetworkResponse is the response body for PATCH /cloud/network.

type UpdateNetworkTemplateRequest added in v0.4.0

type UpdateNetworkTemplateRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

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

type UpdateNetworkTemplateResponse added in v0.4.0

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

UpdateNetworkTemplateResponse is the response body for PATCH /cloud/network/template.

type UpdateRouterRequest added in v0.4.0

type UpdateRouterRequest struct {
	Template string `json:"template"`
	Merge    bool   `json:"merge"`
}

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

type UpdateRouterResponse added in v0.4.0

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}.

func (*UpdateUserRequest) SetTemplate added in v0.17.0

func (r *UpdateUserRequest) SetTemplate(t UserTemplate)

SetTemplate sets r.Template from its structured representation. Either call this of set the template string directly.

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          Template          `json:"template" yaml:"template"`
	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 added in v0.4.0

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

UserQuotaResponse is the response body for GET /cloud/user/quota.

type UserResponse added in v0.4.0

type UserResponse struct {
	User User `json:"user"`
}

UserResponse is the response body for GET /cloud/user.

type UserService added in v0.4.0

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

UserService owns the /cloud/user methods.

func (UserService) AddUserGroup added in v0.4.0

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 added in v0.4.0

ChangeUserAuth changes the user's authentication method.

func (UserService) ChangeUserGroup added in v0.4.0

func (s UserService) ChangeUserGroup(ctx context.Context, id, group int) (*ChangeUserGroupResponse, error)

ChangeUserGroup changes the user's group.

func (UserService) ChangeUserPassword added in v0.4.0

ChangeUserPassword changes the user's password.

func (UserService) CreateUser added in v0.4.0

CreateUser creates a new user.

func (UserService) DeleteUser added in v0.4.0

func (s UserService) DeleteUser(ctx context.Context, id int) error

DeleteUser deletes the user with the given ID.

func (UserService) DeleteUserGroup added in v0.4.0

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 added in v0.4.0

func (s UserService) EnableUser(ctx context.Context, id int, req EnableUserRequest) (*EnableUserResponse, error)

EnableUser enables the user with the given ID.

func (UserService) SetUserQuota added in v0.4.0

func (s UserService) SetUserQuota(ctx context.Context, id int, req SetUserQuotaRequest) (*SetUserQuotaResponse, error)

SetUserQuota sets the user's quota.

func (UserService) UpdateDefaultUserQuota added in v0.4.0

UpdateDefaultUserQuota updates the default user quota.

func (UserService) UpdateUser added in v0.4.0

func (s UserService) UpdateUser(ctx context.Context, id int, req UpdateUserRequest) (*UpdateUserResponse, error)

UpdateUser updates the user with the given ID.

func (UserService) User added in v0.4.0

func (s UserService) User(ctx context.Context, id int) (*UserResponse, error)

User returns information about a user.

func (UserService) UserQuota added in v0.4.0

func (s UserService) UserQuota(ctx context.Context) (*UserQuotaResponse, error)

UserQuota returns the default user quota.

func (UserService) Users added in v0.4.0

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 added in v0.4.0

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 Template `json:"template" yaml:"template"`
	Servers  []Server `json:"servers" yaml:"servers"`
}

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

func (*Zone) ParseTemplate added in v0.14.0

func (z *Zone) ParseTemplate() (*ZoneTemplate, error)

ParseTemplate returns a structured subset of the nested key x value pair map.

type ZoneResponse added in v0.4.0

type ZoneResponse struct {
	Zone Zone `json:"zone"`
}

ZoneResponse is the response body for GET /cloud/zone.

type ZoneService added in v0.4.0

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

ZoneService owns the /cloud/zone methods.

func (ZoneService) CreateZone added in v0.4.0

CreateZone creates a new zone.

func (ZoneService) DeleteZone added in v0.4.0

func (s ZoneService) DeleteZone(ctx context.Context, id int) error

DeleteZone deletes the zone with the given ID.

func (ZoneService) EnableZone added in v0.4.0

func (s ZoneService) EnableZone(ctx context.Context, id int, req EnableZoneRequest) (*EnableZoneResponse, error)

EnableZone enables the zone with the given ID.

func (ZoneService) RenameZone added in v0.4.0

func (s ZoneService) RenameZone(ctx context.Context, id int, req RenameZoneRequest) (*RenameZoneResponse, error)

RenameZone renames the zone with the given ID.

func (ZoneService) UpdateZone added in v0.4.0

func (s ZoneService) UpdateZone(ctx context.Context, id int, req UpdateZoneRequest) (*UpdateZoneResponse, error)

UpdateZone updates the zone with the given ID.

func (ZoneService) Zone added in v0.4.0

func (s ZoneService) Zone(ctx context.Context, id int) (*ZoneResponse, error)

Zone returns information about a zone.

func (ZoneService) Zones added in v0.4.0

func (s ZoneService) Zones(ctx context.Context) (*ZonesResponse, error)

Zones returns information about all zones.

func (ZoneService) ZonesRaftStatus added in v0.4.0

func (s ZoneService) ZonesRaftStatus(ctx context.Context) (*ZonesRaftStatusResponse, error)

ZonesRaftStatus returns the raft status for all zones.

type ZoneTemplate

type ZoneTemplate struct {
	Endpoint string
}

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

type ZonesRaftStatusResponse added in v0.4.0

type ZonesRaftStatusResponse struct {
	Status RaftStatus `json:"status"`
}

ZonesRaftStatusResponse is the response body for GET /cloud/zone/raft.

type ZonesResponse added in v0.4.0

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 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