Documentation ¶
Index ¶
- Constants
- type Addons
- type Backup
- type BackupStatus
- type BigStorage
- type BigStorageBackup
- type BigStorageOrder
- type BigStorageRepository
- func (r *BigStorageRepository) AttachToVps(vpsName string, bigStorage BigStorage) error
- func (r *BigStorageRepository) Cancel(bigStorageName string, endTime gotransip.CancellationTime) errordeprecated
- func (r *BigStorageRepository) DetachFromVps(bigStorage BigStorage) error
- func (r *BigStorageRepository) GetAll() ([]BigStorage, error)
- func (r *BigStorageRepository) GetBackups(bigStorageName string) ([]BigStorageBackup, error)
- func (r *BigStorageRepository) GetByName(bigStorageName string) (BigStorage, error)
- func (r *BigStorageRepository) GetSelection(page int, itemsPerPage int) ([]BigStorage, error)
- func (r *BigStorageRepository) GetUsage(bigStorageName string, period UsagePeriod) ([]UsageDataDisk, error)
- func (r *BigStorageRepository) GetUsageLast24Hours(bigStorageName string) ([]UsageDataDisk, error)
- func (r *BigStorageRepository) Order(order BigStorageOrder) error
- func (r *BigStorageRepository) OrderWithResponse(order BigStorageOrder) (rest.Response, error)
- func (r *BigStorageRepository) RevertBackup(bigStorageName string, backupID int64) error
- func (r *BigStorageRepository) RevertBackupToOtherBigStorage(bigStorageName string, backupID int64, destinationBigStorageName string) error
- func (r *BigStorageRepository) RevertBackupToOtherBigStorageWithResponse(bigStorageName string, backupID int64, destinationBigStorageName string) (rest.Response, error)
- func (r *BigStorageRepository) RevertBackupWithResponse(bigStorageName string, backupID int64) (rest.Response, error)
- func (r *BigStorageRepository) Update(bigStorage BigStorage) errordeprecated
- func (r *BigStorageRepository) UpdateWithResponse(bigStorage BigStorage) (rest.Response, error)
- func (r *BigStorageRepository) Upgrade(bigStorageName string, size int, offsiteBackups bool) error
- type BigStorageStatus
- type BlockStorage
- type BlockStorageBackup
- type BlockStorageOrder
- type BlockStorageRepository
- func (r *BlockStorageRepository) AttachToVps(vpsName string, blockStorage BlockStorage) error
- func (r *BlockStorageRepository) Cancel(blockStorageName string, endTime gotransip.CancellationTime) error
- func (r *BlockStorageRepository) DetachFromVps(blockStorage BlockStorage) error
- func (r *BlockStorageRepository) GetAll() ([]BlockStorage, error)
- func (r *BlockStorageRepository) GetBackups(blockStorageName string) ([]BlockStorageBackup, error)
- func (r *BlockStorageRepository) GetByName(blockStorageName string) (BlockStorage, error)
- func (r *BlockStorageRepository) GetSelection(page int, itemsPerPage int) ([]BlockStorage, error)
- func (r *BlockStorageRepository) GetUsage(blockStorageName string, period UsagePeriod) ([]UsageDataDisk, error)
- func (r *BlockStorageRepository) GetUsageLast24Hours(blockStorageName string) ([]UsageDataDisk, error)
- func (r *BlockStorageRepository) Order(order BlockStorageOrder) error
- func (r *BlockStorageRepository) OrderWithResponse(order BlockStorageOrder) (rest.Response, error)
- func (r *BlockStorageRepository) RevertBackup(blockStorageName string, backupID int64) error
- func (r *BlockStorageRepository) RevertBackupToOtherBlockStorage(blockStorageName string, backupID int64, destinationBlockStorageName string) error
- func (r *BlockStorageRepository) RevertBackupToOtherBlockStorageWithResponse(blockStorageName string, backupID int64, destinationBlockStorageName string) (rest.Response, error)
- func (r *BlockStorageRepository) RevertBackupWithResponse(blockStorageName string, backupID int64) (rest.Response, error)
- func (r *BlockStorageRepository) Update(blockStorage BlockStorage) error
- func (r *BlockStorageRepository) UpdateWithResponse(blockStorage BlockStorage) (rest.Response, error)
- func (r *BlockStorageRepository) Upgrade(blockStorageName string, size int, offsiteBackups bool) error
- type BlockStorageStatus
- type BlockStorageType
- type Firewall
- type FirewallRepository
- type FirewallRule
- type IgnoreTime
- type InstallFlavour
- type InstallOptions
- type License
- type LicenseKey
- type LicenseOrder
- type LicenseProduct
- type LicenseRepository
- func (r *LicenseRepository) Cancel(vpsName string, licenseID int64) error
- func (r *LicenseRepository) GetAll(vpsName string) (Licenses, error)
- func (r *LicenseRepository) Order(vpsName string, order LicenseOrder) error
- func (r *LicenseRepository) Replace(vpsName string, request ReplaceLicenseRequest) error
- type LicenseType
- type Licenses
- type MonitoringContact
- type OperatingSystem
- type Order
- type PrivateNetwork
- type PrivateNetworkRepository
- func (r *PrivateNetworkRepository) AttachVps(vpsName string, privateNetworkName string) error
- func (r *PrivateNetworkRepository) AttachVpsWithResponse(vpsName string, privateNetworkName string) (rest.Response, error)
- func (r *PrivateNetworkRepository) Cancel(privateNetworkName string, endTime gotransip.CancellationTime) error
- func (r *PrivateNetworkRepository) DetachVps(vpsName string, privateNetworkName string) error
- func (r *PrivateNetworkRepository) DetachVpsWithResponse(vpsName string, privateNetworkName string) (rest.Response, error)
- func (r *PrivateNetworkRepository) GetAll() ([]PrivateNetwork, error)
- func (r *PrivateNetworkRepository) GetByName(privateNetworkName string) (PrivateNetwork, error)
- func (r *PrivateNetworkRepository) GetSelection(page int, itemsPerPage int) ([]PrivateNetwork, error)
- func (r *PrivateNetworkRepository) Order(description string) error
- func (r *PrivateNetworkRepository) OrderWithResponse(description string) (rest.Response, error)
- func (r *PrivateNetworkRepository) Update(privateNetwork PrivateNetwork) error
- type ReplaceLicenseRequest
- type Repository
- func (r *Repository) AddIPv6Address(vpsName string, address net.IP) error
- func (r *Repository) Cancel(vpsName string, endTime gotransip.CancellationTime) error
- func (r *Repository) CancelAddon(vpsName string, addon string) error
- func (r *Repository) Clone(vpsName string) error
- func (r *Repository) CloneToAvailabilityZone(vpsName string, availabilityZone string) error
- func (r *Repository) CloneToAvailabilityZoneWithResponse(vpsName string, availabilityZone string) (rest.Response, error)
- func (r *Repository) CloneWithResponse(vpsName string) (rest.Response, error)
- func (r *Repository) ConvertBackupToSnapshot(vpsName string, backupID int64, snapshotDescription string) error
- func (r *Repository) ConvertBackupToSnapshotWithResponse(vpsName string, backupID int64, snapshotDescription string) (rest.Response, error)
- func (r *Repository) CreateSnapshot(vpsName string, description string, shouldStartVps bool) error
- func (r *Repository) CreateSnapshotWithResponse(vpsName string, description string, shouldStartVps bool) (rest.Response, error)
- func (r *Repository) GetAddons(vpsName string) (Addons, error)
- func (r *Repository) GetAll() ([]Vps, error)
- func (r *Repository) GetAllByTags(tags []string) ([]Vps, error)
- func (r *Repository) GetAllUsage(vpsName string, period UsagePeriod) (Usage, error)
- func (r *Repository) GetAllUsage24Hours(vpsName string) (Usage, error)
- func (r *Repository) GetBackups(vpsName string) ([]Backup, error)
- func (r *Repository) GetByName(vpsName string) (Vps, error)
- func (r *Repository) GetIPAddressByAddress(vpsName string, address net.IP) (ipaddress.IPAddress, error)
- func (r *Repository) GetIPAddresses(vpsName string) ([]ipaddress.IPAddress, error)
- func (r *Repository) GetOperatingSystems(vpsName string) ([]OperatingSystem, error)
- func (r *Repository) GetSelection(page int, itemsPerPage int) ([]Vps, error)
- func (r *Repository) GetSnapshotByName(vpsName string, snapshotName string) (Snapshot, error)
- func (r *Repository) GetSnapshots(vpsName string) ([]Snapshot, error)
- func (r *Repository) GetUpgrades(vpsName string) ([]product.Product, error)
- func (r *Repository) GetUsage(vpsName string, usageTypes []UsageType, period UsagePeriod) (Usage, error)
- func (r *Repository) GetVNCData(vpsName string) (VncData, error)
- func (r *Repository) Handover(vpsName string, targetCustomerName string) error
- func (r *Repository) InstallOperatingSystem(vpsName string, operatingSystemName string, hostname string, ...) error
- func (r *Repository) InstallOperatingSystemWithOptions(vpsName string, options InstallOptions) error
- func (r *Repository) Order(vpsOrder Order) error
- func (r *Repository) OrderAddons(vpsName string, addons []string) error
- func (r *Repository) OrderMultiple(orders []Order) error
- func (r *Repository) OrderMultipleWithResponse(orders []Order) (rest.Response, error)
- func (r *Repository) OrderWithResponse(vpsOrder Order) (rest.Response, error)
- func (r *Repository) RegenerateVNCToken(vpsName string) error
- func (r *Repository) RemoveIPv6Address(vpsName string, address net.IP) error
- func (r *Repository) RemoveSnapshot(vpsName string, snapshotName string) error
- func (r *Repository) Reset(vpsName string) error
- func (r *Repository) RevertBackup(vpsName string, backupID int64) error
- func (r *Repository) RevertBackupWithResponse(vpsName string, backupID int64) (rest.Response, error)
- func (r *Repository) RevertSnapshot(vpsName string, snapshotName string) error
- func (r *Repository) RevertSnapshotToOtherVps(vpsName string, snapshotName string, destinationVps string) error
- func (r *Repository) RevertSnapshotToOtherVpsWithResponse(vpsName string, snapshotName string, destinationVps string) (rest.Response, error)
- func (r *Repository) RevertSnapshotWithResponse(vpsName string, snapshotName string) (rest.Response, error)
- func (r *Repository) Start(vpsName string) error
- func (r *Repository) Stop(vpsName string) error
- func (r *Repository) Update(vps Vps) error
- func (r *Repository) UpdateReverseDNS(vpsName string, ip ipaddress.IPAddress) error
- func (r *Repository) Upgrade(vpsName string, productName string) error
- type RescueImage
- type RescueImageRepository
- type Setting
- type SettingRepository
- type SettingValue
- type Snapshot
- type SnapshotStatus
- type Status
- type TCPMonitor
- type TCPMonitorContact
- type TCPMonitorRepository
- func (r *TCPMonitorRepository) CreateContact(contact MonitoringContact) error
- func (r *TCPMonitorRepository) CreateTCPMonitor(vpsName string, tcpMonitor TCPMonitor) error
- func (r *TCPMonitorRepository) GetContacts() ([]MonitoringContact, error)
- func (r *TCPMonitorRepository) GetTCPMonitors(vpsName string) ([]TCPMonitor, error)
- func (r *TCPMonitorRepository) RemoveContact(contactID int64) error
- func (r *TCPMonitorRepository) RemoveTCPMonitor(vpsName string, ip net.IP) error
- func (r *TCPMonitorRepository) UpdateContact(contact MonitoringContact) error
- func (r *TCPMonitorRepository) UpdateTCPMonitor(vpsName string, tcpMonitor TCPMonitor) error
- type Usage
- type UsageDataCPU
- type UsageDataDisk
- type UsageDataNetwork
- type UsagePeriod
- type UsageType
- type VncData
- type Vps
Constants ¶
const ( RescueImageLinux = "RescueLinux" RescueImageBSD = "RescueBSD" )
The RescueImageLinux and RescueImageBSD constants exists for convenience. There may be more or less images available for a VPS in the future.
const ( // SettingBlockVPSMailPorts describes if the mail ports (25,465,465) are blocked for a VPS SettingBlockVPSMailPorts = "blockVpsMailPorts" // SettingTCPMonitoringAvailable is true when the TCP monitoring feature is enabled SettingTCPMonitoringAvailable = "tcpMonitoringAvailable" )
const ( SettingDataTypeString = "string" SettingDataTypeBoolean = "boolean" )
These constants define which data types can be returned by the api
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addons ¶
type Addons struct { // A list of all active addons Active []product.Product `json:"active,omitempty"` // A list of available addons that you can order Available []product.Product `json:"available,omitempty"` // A list of addons that you can cancel Cancellable []product.Product `json:"cancellable,omitempty"` }
Addons struct for an Addons
type Backup ¶
type Backup struct { // The backup id ID int64 `json:"id"` // Status of the backup ('active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving') Status BackupStatus `json:"status"` // The backup creation date DateTimeCreate rest.Time `json:"dateTimeCreate"` // The backup disk size in kB DiskSize int64 `json:"diskSize"` // The backup operatingSystem OperatingSystem string `json:"operatingSystem"` // The name of the availability zone the backup is in AvailabilityZone string `json:"availabilityZone"` }
Backup struct for a Backup
type BackupStatus ¶
type BackupStatus string
BackupStatus is one of the following strings 'active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving'
const ( // BackupStatusActive is the status field for a ready to use backup BackupStatusActive BackupStatus = "active" // BackupStatusCreating is the status field for a backup that is still in creation BackupStatusCreating BackupStatus = "creating" // BackupStatusReverting is the status field for a currently used backup for a revert BackupStatusReverting BackupStatus = "reverting" // BackupStatusDeleting is the status field for a backup that is about to be deleted BackupStatusDeleting BackupStatus = "deleting" // BackupStatusPendingDeletion is the status field for a backup that has a pending deletion BackupStatusPendingDeletion BackupStatus = "pendingDeletion" // BackupStatusSyncing is the status field for a backup that is still syncing BackupStatusSyncing BackupStatus = "syncing" // BackupStatusMoving is the status field for a moving backup, this means that the backup is under migration BackupStatusMoving BackupStatus = "moving" )
Definition of all of the possible backup statuses
type BigStorage ¶
type BigStorage struct { // Name of the big storage Name string `json:"name,omitempty"` // Name that can be set by customer Description string `json:"description"` // Disk size of the big storage in kB DiskSize int64 `json:"diskSize,omitempty"` // Whether a bigstorage has backups OffsiteBackups bool `json:"offsiteBackups"` // The VPS that the big storage is attached to VpsName string `json:"vpsName"` // Status of the big storage can be 'active', 'attaching' or 'detachting' Status BigStorageStatus `json:"status,omitempty"` // Serial of the big storage. This is a unique identifier that is visible by the vps it has been attached to. On // linux servers it is visible using udevadm info /dev/vdb where it will be the value of ID_SERIAL. A symlink will // also be created in /dev/disk-by-id/ containing the serial. This is useful if you want to map a disk inside a VPS // to a big storage. Serial string `json:"serial"` // Lock status of the big storage, when it is locked, it cannot be attached or detached. IsLocked bool `json:"isLocked"` // The availability zone the bigstorage is located in AvailabilityZone string `json:"availabilityZone,omitempty"` }
BigStorage struct for a BigStorage
type BigStorageBackup ¶
type BigStorageBackup struct { // ID of the big storage ID int64 `json:"id,omitempty"` // Status of the big storage backup ('active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving') Status BackupStatus `json:"status,omitempty"` // The backup disk size in kB DiskSize int64 `json:"diskSize"` // Date of the big storage backup DateTimeCreate rest.Time `json:"dateTimeCreate,omitempty"` // The name of the availability zone the backup is in AvailabilityZone string `json:"availabilityZone,omitempty"` }
BigStorageBackup struct for a BigStorageBackup
type BigStorageOrder ¶
type BigStorageOrder struct { // The size of the big storage in TB's, use a multitude of 2. The maximum size is 40. Size int `json:"size"` // Whether to order offsite backups, omit this to use current value OffsiteBackups bool `json:"offsiteBackups"` // The name of the availabilityZone where the BigStorage should be created. This parameter can not be used in conjunction with vpsName // If a vpsName is provided as well as an availabilityZone, the zone of the vps is leading AvailabilityZone string `json:"availabilityZone,omitempty"` // The name of the VPS to attach the big storage to VpsName string `json:"vpsName"` // Description that the big storage should have after ordering Description string `json:"description,omitempty"` }
BigStorageOrder struct which is used to construct a new order request for a bigstorage
type BigStorageRepository ¶
type BigStorageRepository repository.RestRepository
BigStorageRepository allows you to manage all api actions on a bigstorage getting information, ordering, upgrading, attaching/detaching it to a vps
func (*BigStorageRepository) AttachToVps ¶
func (r *BigStorageRepository) AttachToVps(vpsName string, bigStorage BigStorage) error
AttachToVps allows you to attach a given VPS by name to a BigStorage Deprecated: Use block storage resource instead
func (*BigStorageRepository) Cancel
deprecated
func (r *BigStorageRepository) Cancel(bigStorageName string, endTime gotransip.CancellationTime) error
Cancel cancels a bigstorage for the specified endTime. You can set the endTime to end or immediately, this has the following implications:
- end: The Big Storage will be terminated from the end date of the agreement as can be found in the applicable quote;
- immediately: The Big Storage will be terminated immediately.
Deprecated: Use block storage resource instead
func (*BigStorageRepository) DetachFromVps ¶
func (r *BigStorageRepository) DetachFromVps(bigStorage BigStorage) error
DetachFromVps allows you to detach a bigstorage from the vps it is attached to Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetAll ¶
func (r *BigStorageRepository) GetAll() ([]BigStorage, error)
GetAll returns a list of your bigstorages Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetBackups ¶
func (r *BigStorageRepository) GetBackups(bigStorageName string) ([]BigStorageBackup, error)
GetBackups returns a list of backups for a specific bigstorage Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetByName ¶
func (r *BigStorageRepository) GetByName(bigStorageName string) (BigStorage, error)
GetByName returns a specific BigStorage struct by name Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetSelection ¶
func (r *BigStorageRepository) GetSelection(page int, itemsPerPage int) ([]BigStorage, error)
GetSelection returns a limited list of bigstorages, specify how many and which page/chunk of your bigstorage you want to retrieve Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetUsage ¶
func (r *BigStorageRepository) GetUsage(bigStorageName string, period UsagePeriod) ([]UsageDataDisk, error)
GetUsage allows you to query your bigstorage usage within a certain period Deprecated: Use block storage resource instead
func (*BigStorageRepository) GetUsageLast24Hours ¶
func (r *BigStorageRepository) GetUsageLast24Hours(bigStorageName string) ([]UsageDataDisk, error)
GetUsageLast24Hours allows you to get usage statistics for a given bigstorage within the last 24 hours Deprecated: Use block storage resource instead
func (*BigStorageRepository) Order ¶
func (r *BigStorageRepository) Order(order BigStorageOrder) error
Order allows you to order a new bigstorage Deprecated: Use block storage resource instead
func (*BigStorageRepository) OrderWithResponse ¶ added in v6.18.0
func (r *BigStorageRepository) OrderWithResponse(order BigStorageOrder) (rest.Response, error)
OrderWithResponse allows you to order a new bigstorage and returns a response Deprecated: Use block storage resource instead
func (*BigStorageRepository) RevertBackup ¶
func (r *BigStorageRepository) RevertBackup(bigStorageName string, backupID int64) error
RevertBackup allows you to revert a bigstorage by bigstorage name and backupID if you want to revert a backup to a different big storage you can use the RevertBackupToOtherBigStorage method Deprecated: Use block storage resource instead
func (*BigStorageRepository) RevertBackupToOtherBigStorage ¶ added in v6.11.0
func (r *BigStorageRepository) RevertBackupToOtherBigStorage(bigStorageName string, backupID int64, destinationBigStorageName string) error
RevertBackupToOtherBigStorage allows you to revert a backup to a different big storage Deprecated: Use block storage resource instead
func (*BigStorageRepository) RevertBackupToOtherBigStorageWithResponse ¶ added in v6.18.0
func (r *BigStorageRepository) RevertBackupToOtherBigStorageWithResponse( bigStorageName string, backupID int64, destinationBigStorageName string, ) (rest.Response, error)
RevertBackupToOtherBigStorageWithResponse allows you to revert a backup to a different big storage and returns a response Deprecated: Use block storage resource instead
func (*BigStorageRepository) RevertBackupWithResponse ¶ added in v6.18.0
func (r *BigStorageRepository) RevertBackupWithResponse(bigStorageName string, backupID int64) (rest.Response, error)
RevertBackupWithResponse allows you to revert a bigstorage by bigstorage name and backupID and returns a response if you want to revert a backup to a different big storage you can use the RevertBackupToOtherBigStorage method Deprecated: Use block storage resource instead
func (*BigStorageRepository) Update
deprecated
func (r *BigStorageRepository) Update(bigStorage BigStorage) error
Update allows you to alter the BigStorage in several ways outlined below:
- Changing the description of a Big Storage;
- One Big Storages can only be attached to one VPS at a time;
- One VPS can have a maximum of 10 bigstorages attached;
- Set the vpsName property to the VPS name to attach to for attaching Big Storage;
- Set the vpsName property to null to detach the Big Storage from the currently attached VPS.
Deprecated: Use block storage resource instead
func (*BigStorageRepository) UpdateWithResponse ¶ added in v6.18.0
func (r *BigStorageRepository) UpdateWithResponse(bigStorage BigStorage) (rest.Response, error)
UpdateWithResponse returns a response Deprecated: Use block storage resource instead
type BigStorageStatus ¶
type BigStorageStatus string
BigStorageStatus is one of the following strings 'active', 'attaching', 'detaching'
const ( // BigStorageStatusActive is the status field for an active BigStorage, ready to use BigStorageStatusActive BigStorageStatus = "active" // BigStorageStatusAttaching is the status field for a BigStorage that is being attached to a vps BigStorageStatusAttaching BigStorageStatus = "attaching" // BigStorageStatusDetaching is the status field for a BigStorage that is being detached from a vps BigStorageStatusDetaching BigStorageStatus = "detaching" )
Definition of all of the possible bigstorage backup statuses
type BlockStorage ¶ added in v6.22.0
type BlockStorage struct { // Name of the block storage Name string `json:"name,omitempty"` // Name that can be set by customer Description string `json:"description"` // Disk size of the block storage in kB Size int64 `json:"size,omitempty"` // Whether a blockstorage has backups OffsiteBackups bool `json:"offsiteBackups"` // The VPS that the block storage is attached to VpsName string `json:"vpsName"` // Status of the block storage can be 'active', 'attaching' or 'detachting' Status BlockStorageStatus `json:"status"` // Serial of the block storage. This is a unique identifier that is visible by the vps it has been attached to. On // linux servers it is visible using udevadm info /dev/vdb where it will be the value of ID_SERIAL. A symlink will // also be created in /dev/disk-by-id/ containing the serial. This is useful if you want to map a disk inside a VPS // to a block storage. Serial string `json:"serial"` // Lock status of the block storage, when it is locked, it cannot be attached or detached. IsLocked bool `json:"isLocked"` // The availability zone the blockstorage is located in AvailabilityZone string `json:"availabilityZone,omitempty"` // The type of the block storage. It can be big-storage or fast-storage. ProductType string `json:"BlockStorageType"` }
BlockStorage struct for a BlockStorage
type BlockStorageBackup ¶ added in v6.22.0
type BlockStorageBackup struct { // ID of the block storage ID int64 `json:"id,omitempty"` // Status of the block storage backup ('active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving') Status BackupStatus `json:"status,omitempty"` // The backup disk size in kB Size int64 `json:"size"` // Date of the block storage backup DateTimeCreate rest.Time `json:"dateTimeCreate,omitempty"` // The name of the availability zone the backup is in AvailabilityZone string `json:"availabilityZone,omitempty"` }
BlockStorageBackup struct for a BlockStorageBackup
type BlockStorageOrder ¶ added in v6.22.0
type BlockStorageOrder struct { // The type of the block storage. It can be big-storage or fast-storage. ProductType BlockStorageType `json:"type"` // The size of the block storage in KB. // Big storages: The minimum size is 2 TiB and storage can be extended with up to maximum of 40 TiB. Make sure to // use a multiple of 2 TiB. Note that 2 TiB equals 2147483648 KiB. // Fast storages: The minimum size is 10 GiB and storage can be extended with up to maximum of 10000 GiB. Make sure // to use a multiple of 10 GiB. Note that 10 GiB equals 10485760 KiB. Size int `json:"size"` // Whether to order offsite backups OffsiteBackups bool `json:"offsiteBackups"` // The name of the availabilityZone where the BlockStorage should be created. This parameter can not be used in conjunction with vpsName // If a vpsName is provided as well as an availabilityZone, the zone of the vps is leading AvailabilityZone string `json:"availabilityZone,omitempty"` // The name of the VPS to attach the block storage to VpsName string `json:"vpsName,omitempty"` // Description that the block storage should have after ordering Description string `json:"description,omitempty"` }
BlockStorageOrder struct which is used to construct a new order request for a blockstorage
type BlockStorageRepository ¶ added in v6.22.0
type BlockStorageRepository repository.RestRepository
BlockStorageRepository allows you to manage all api actions on a blockstorage getting information, ordering, upgrading, attaching/detaching it to a vps
func (*BlockStorageRepository) AttachToVps ¶ added in v6.22.0
func (r *BlockStorageRepository) AttachToVps(vpsName string, blockStorage BlockStorage) error
AttachToVps allows you to attach a given VPS by name to a BlockStorage
func (*BlockStorageRepository) Cancel ¶ added in v6.22.0
func (r *BlockStorageRepository) Cancel(blockStorageName string, endTime gotransip.CancellationTime) error
Cancel cancels a blockstorage for the specified endTime. You can set the endTime to end or immediately, this has the following implications:
- end: The Block Storage will be terminated from the end date of the agreement as can be found in the applicable quote;
- immediately: The Block Storage will be terminated immediately.
func (*BlockStorageRepository) DetachFromVps ¶ added in v6.22.0
func (r *BlockStorageRepository) DetachFromVps(blockStorage BlockStorage) error
DetachFromVps allows you to detach a blockstorage from the vps it is attached to
func (*BlockStorageRepository) GetAll ¶ added in v6.22.0
func (r *BlockStorageRepository) GetAll() ([]BlockStorage, error)
GetAll returns a list of your blockstorages
func (*BlockStorageRepository) GetBackups ¶ added in v6.22.0
func (r *BlockStorageRepository) GetBackups(blockStorageName string) ([]BlockStorageBackup, error)
GetBackups returns a list of backups for a specific blockstorage
func (*BlockStorageRepository) GetByName ¶ added in v6.22.0
func (r *BlockStorageRepository) GetByName(blockStorageName string) (BlockStorage, error)
GetByName returns a specific BlockStorage struct by name
func (*BlockStorageRepository) GetSelection ¶ added in v6.22.0
func (r *BlockStorageRepository) GetSelection(page int, itemsPerPage int) ([]BlockStorage, error)
GetSelection returns a limited list of blockstorages, specify how many and which page/chunk of your blockstorage you want to retrieve
func (*BlockStorageRepository) GetUsage ¶ added in v6.22.0
func (r *BlockStorageRepository) GetUsage(blockStorageName string, period UsagePeriod) ([]UsageDataDisk, error)
GetUsage allows you to query your blockstorage usage within a certain period
func (*BlockStorageRepository) GetUsageLast24Hours ¶ added in v6.22.0
func (r *BlockStorageRepository) GetUsageLast24Hours(blockStorageName string) ([]UsageDataDisk, error)
GetUsageLast24Hours allows you to get usage statistics for a given blockstorage within the last 24 hours
func (*BlockStorageRepository) Order ¶ added in v6.22.0
func (r *BlockStorageRepository) Order(order BlockStorageOrder) error
Order allows you to order a new blockstorage
func (*BlockStorageRepository) OrderWithResponse ¶ added in v6.22.0
func (r *BlockStorageRepository) OrderWithResponse(order BlockStorageOrder) (rest.Response, error)
OrderWithResponse allows you to order a new blockstorage and returns a response
func (*BlockStorageRepository) RevertBackup ¶ added in v6.22.0
func (r *BlockStorageRepository) RevertBackup(blockStorageName string, backupID int64) error
RevertBackup allows you to revert a blockstorage by blockstorage name and backupID if you want to revert a backup to a different block storage you can use the RevertBackupToOtherBlockStorage method
func (*BlockStorageRepository) RevertBackupToOtherBlockStorage ¶ added in v6.22.0
func (r *BlockStorageRepository) RevertBackupToOtherBlockStorage(blockStorageName string, backupID int64, destinationBlockStorageName string) error
RevertBackupToOtherBlockStorage allows you to revert a backup to a different block storage
func (*BlockStorageRepository) RevertBackupToOtherBlockStorageWithResponse ¶ added in v6.22.0
func (r *BlockStorageRepository) RevertBackupToOtherBlockStorageWithResponse( blockStorageName string, backupID int64, destinationBlockStorageName string, ) (rest.Response, error)
RevertBackupToOtherBlockStorageWithResponse allows you to revert a backup to a different block storage and returns a response
func (*BlockStorageRepository) RevertBackupWithResponse ¶ added in v6.22.0
func (r *BlockStorageRepository) RevertBackupWithResponse(blockStorageName string, backupID int64) (rest.Response, error)
RevertBackupWithResponse allows you to revert a blockstorage by blockstorage name and backupID and returns a response if you want to revert a backup to a different block storage you can use the RevertBackupToOtherBlockStorage method
func (*BlockStorageRepository) Update ¶ added in v6.22.0
func (r *BlockStorageRepository) Update(blockStorage BlockStorage) error
Update allows you to alter the BlockStorage in several ways outlined below:
- Changing the description of a Block Storage;
- One Block Storages can only be attached to one VPS at a time;
- One VPS can have a maximum of 10 blockstorages attached;
- Set the vpsName property to the VPS name to attach to for attaching Block Storage;
- Set the vpsName property to an empty string to detach the Block Storage from the currently attached VPS.
func (*BlockStorageRepository) UpdateWithResponse ¶ added in v6.22.0
func (r *BlockStorageRepository) UpdateWithResponse(blockStorage BlockStorage) (rest.Response, error)
UpdateWithResponse returns a response
type BlockStorageStatus ¶ added in v6.22.0
type BlockStorageStatus string
BlockStorageStatus is one of the following strings 'active', 'attaching', 'detaching'
const ( // BlockStorageStatusActive is the status field for an active BlockStorage, ready to use BlockStorageStatusActive BlockStorageStatus = "active" // BlockStorageStatusAttaching is the status field for a BlockStorage that is being attached to a vps BlockStorageStatusAttaching BlockStorageStatus = "attaching" // BlockStorageStatusDetaching is the status field for a BlockStorage that is being detached from a vps BlockStorageStatusDetaching BlockStorageStatus = "detaching" )
Definition of all the possible blockstorage backup statuses
type BlockStorageType ¶ added in v6.22.1
type BlockStorageType string
BlockStorageType is one of the following strings 'big-storage', 'fast-storage'
const ( BigStorageType BlockStorageType = "big-storage" FastStorageType BlockStorageType = "fast-storage" )
Definition of all the possible block storage types
type Firewall ¶
type Firewall struct { // Whether the firewall is enabled for this VPS IsEnabled bool `json:"isEnabled"` // Ruleset of the VPS RuleSet []FirewallRule `json:"ruleSet"` }
Firewall struct for the Vps Firewall
type FirewallRepository ¶
type FirewallRepository repository.RestRepository
FirewallRepository allows you to get information on the current Vps firewall and to update it
func (*FirewallRepository) GetFirewall ¶
func (r *FirewallRepository) GetFirewall(vpsName string) (Firewall, error)
GetFirewall returns the state of the current VPS firewall
func (*FirewallRepository) UpdateFirewall ¶
func (r *FirewallRepository) UpdateFirewall(vpsName string, firewall Firewall) error
UpdateFirewall allows you to update the state of the firewall. Enabling it, disabling it, Adding / removing of ruleSets, updating the whitelists.
type FirewallRule ¶
type FirewallRule struct { // The rule name Description string `json:"description,omitempty"` // The start port of this firewall rule StartPort int `json:"startPort"` // The end port of this firewall rule EndPort int `json:"endPort"` // The protocol `tcp` , `udp` or `tcp_udp` Protocol string `json:"protocol"` // Whitelisted IP's or ranges that are allowed to connect, empty to allow all Whitelist []ipaddress.IPRange `json:"whitelist"` }
FirewallRule struct for a VpsFirewallRule
type IgnoreTime ¶
type IgnoreTime struct { // Start from (24 hour format) TimeFrom string `json:"timeFrom"` // End at (24 hour format) TimeTo string `json:"timeTo"` }
IgnoreTime struct for IgnoreTime
type InstallFlavour ¶ added in v6.0.4
type InstallFlavour string
InstallFlavour can be one of the following strings 'installer', 'preinstallable', 'cloudinit'
const ( // InstallFlavourInstaller is used to explicitly specify that the // operating system will be provided through the standard installer InstallFlavourInstaller InstallFlavour = "installer" // InstallFlavourPreinstallable is used to explicitly specify that the // operating system will be provided by a preinstalled image InstallFlavourPreinstallable InstallFlavour = "preinstallable" // InstallFlavourCloudInit is used to explicitly specify that the // operating system will be provided by a cloudinit-enabled image InstallFlavourCloudInit InstallFlavour = "cloudinit" )
type InstallOptions ¶ added in v6.0.4
type InstallOptions installRequest
InstallOptions can be used to provide options to the InstallOperatingSystemWithOptions method
type License ¶ added in v6.6.0
type License struct { // The License id ID int64 `json:"id"` // License name Name string `json:"name"` // Price in cents Price int `json:"price"` // Recurring price in cents RecurringPrice int `json:"recurringPrice"` // License type: 'operating-system', 'addon' Type LicenseType `json:"type"` // Quantity already purchased Quantity int `json:"quantity"` // Maximum quantity you are allowed to purchase MaxQuantity int `json:"maxQuantity"` // License keys belonging to this License Keys []LicenseKey `json:"keys"` }
License struct for a vps license
type LicenseKey ¶ added in v6.6.0
type LicenseKey struct { // License name Name string `json:"name"` // License key Key string `json:"key"` }
LicenseKey struct contains a license key and name for a specific License
type LicenseOrder ¶ added in v6.6.0
type LicenseOrder struct { // Name of the license that you want to order LicenseName string `json:"licenseName"` // Quantity of this license that you want to order Quantity int `json:"quantity"` }
The LicenseOrder struct is used for ordering a new license for a VPS
type LicenseProduct ¶ added in v6.6.0
type LicenseProduct struct { // License name Name string `json:"name"` // Price in cents Price int `json:"price"` // Recurring price in cents RecurringPrice int `json:"recurringPrice"` // License type: 'operating-system', 'addon' Type LicenseType `json:"type"` // Maximum quantity you are allowed to purchase MaxQuantity int `json:"maxQuantity"` }
LicenseProduct struct for a orderable license
type LicenseRepository ¶ added in v6.6.0
type LicenseRepository repository.RestRepository
LicenseRepository allows you to manage all vps license api actions like listing, getting license keys, ordering, updating, deleting licenses
func (*LicenseRepository) Cancel ¶ added in v6.6.0
func (r *LicenseRepository) Cancel(vpsName string, licenseID int64) error
Cancel allows you to cancel a license for a given vps by its id and the VPS name. Operating system licenses cannot be cancelled.
func (*LicenseRepository) GetAll ¶ added in v6.6.0
func (r *LicenseRepository) GetAll(vpsName string) (Licenses, error)
GetAll returns a struct with 'cancellable', 'available' and 'active' licenses in it for the given VPS
Operating system licenses cannot be directly purchased, or cancelled, they are attached to your VPS the moment you install an operating system that requires a license. Operating systems such as Plesk, DirectAdmin, cPanel and etc need a valid license. An operating system license can only be upgraded or downgraded by using the Update an operating system license API call.
Addon licenses can be purchased individually through the Order an addon license API call.
func (*LicenseRepository) Order ¶ added in v6.6.0
func (r *LicenseRepository) Order(vpsName string, order LicenseOrder) error
Order allows you to order a new license for a given Vps. In order to purchase an addon license for your VPS, use this API call. The licenses that can be ordered can be requested using the get licenses api call
func (*LicenseRepository) Replace ¶ added in v6.6.0
func (r *LicenseRepository) Replace(vpsName string, request ReplaceLicenseRequest) error
Replace allows you to switch between operating system licenses
Provide your desired license name in the licenseName parameter for either to upgrade or downgrade. Only operating system licenses can be passed through this API call.
type LicenseType ¶ added in v6.6.0
type LicenseType string
LicenseType is one of the following strings 'addon', 'operating-system'
const ( // Addon licenses can be purchased individually LicenseTypeAddon LicenseType = "addon" // Operating system licenses cannot be directly purchased, or cancelled, // they are attached to your VPS the moment you install an operating system that requires a license. // Operating systems such as Plesk, DirectAdmin, cPanel and etc need a valid license. // An operating system license can only be upgraded or downgraded LicenseTypeOperatingSystem LicenseType = "operating-system" )
Definition of all of the possible license types
type Licenses ¶ added in v6.6.0
type Licenses struct { // A list of licenses active on your VPS Active []License `json:"active"` // A list of available licenses that you can order for your VPS Available []LicenseProduct `json:"available"` // A list of licenses active on your VPS that you can cancel Cancellable []License `json:"cancellable"` }
Licenses struct contains Active, Available and Cancellable License structs in it
type MonitoringContact ¶
type MonitoringContact struct { // ID number of the contact ID int64 `json:"id,omitempty"` // Name of the contact Name string `json:"name"` // Telephone number of the contact Telephone string `json:"telephone"` // Email address of the contact Email string `json:"email"` }
MonitoringContact struct for a MonitoringContact
type OperatingSystem ¶
type OperatingSystem struct { // Description Description string `json:"description,omitempty"` // Is a preinstallable image // Deprecated: Use the InstallFlavours field to determine this instead IsPreinstallableImage bool `json:"isPreinstallableImage,omitempty"` // List of supported install flavours for this operating system InstallFlavours []InstallFlavour `json:"installFlavours"` // The operating system name Name string `json:"name"` // The monthly price of the operating system in cents Price int `json:"price,omitempty"` // The version of the operating system Version string `json:"version,omitempty"` // available licenses for this operating system Licenses []LicenseProduct `json:"licenses,omitempty"` }
OperatingSystem struct for an OperatingSystem
type Order ¶
type Order struct { // Name of the product ProductName string `json:"productName"` // The name of the operating system to install OperatingSystem string `json:"operatingSystem"` // The name of the availability zone where the vps should be created AvailabilityZone string `json:"availabilityZone,omitempty"` // The description of the VPS Description string `json:"description,omitempty"` // Array with additional addons Addons []string `json:"addons,omitempty"` // Install flavour to use for providing the operating system (optional) // If the field is left empty, the default install flavour for the operating system will be used InstallFlavour InstallFlavour `json:"installFlavour,omitempty"` // The name for the host, only needed for the preinstallable and cloudinit install flavours Hostname string `json:"hostname,omitempty"` // Username used for account creating during cloudinit installation (max 32 chars) Username string `json:"username,omitempty"` // Array of public SSH keys to use for account creating during installation // (currently only supported with the cloudinit flavour) SSHKeys []string `json:"sshKeys,omitempty"` // Base64 encoded preseed / kickstart / cloudinit instructions, when installing unattended Base64InstallText string `json:"base64InstallText,omitempty"` // Array of licenses for preinstallable install flavor Licenses []string `json:"licenses,omitempty"` }
Order struct can be used to order a new VPS
type PrivateNetwork ¶
type PrivateNetwork struct { // The unique private network name Name string `json:"name"` // The custom name that can be set by customer Description string `json:"description"` // If the Private Network is administratively blocked IsBlocked bool `json:"isBlocked"` // When locked, another process is already working with this private network IsLocked bool `json:"isLocked"` // The VPSes in this private network VpsNames []string `json:"vpsNames,omitempty"` }
PrivateNetwork struct for a PrivateNetwork
type PrivateNetworkRepository ¶
type PrivateNetworkRepository repository.RestRepository
PrivateNetworkRepository allows you to manage all private network api actions like listing, ordering, canceling, getting information, updating description, attaching and detaching vpses
func (*PrivateNetworkRepository) AttachVps ¶
func (r *PrivateNetworkRepository) AttachVps(vpsName string, privateNetworkName string) error
AttachVps allows you to attach a VPS to a PrivateNetwork
func (*PrivateNetworkRepository) AttachVpsWithResponse ¶ added in v6.18.0
func (r *PrivateNetworkRepository) AttachVpsWithResponse(vpsName string, privateNetworkName string) (rest.Response, error)
AttachVpsWithResponse allows you to attach a VPS to a PrivateNetwork and returns a response
func (*PrivateNetworkRepository) Cancel ¶
func (r *PrivateNetworkRepository) Cancel(privateNetworkName string, endTime gotransip.CancellationTime) error
Cancel allows you to cancel a private network
func (*PrivateNetworkRepository) DetachVps ¶
func (r *PrivateNetworkRepository) DetachVps(vpsName string, privateNetworkName string) error
DetachVps allows you to detach a VPS from a PrivateNetwork
func (*PrivateNetworkRepository) DetachVpsWithResponse ¶ added in v6.18.0
func (r *PrivateNetworkRepository) DetachVpsWithResponse(vpsName string, privateNetworkName string) (rest.Response, error)
DetachVpsWithResponse allows you to detach a VPS from a PrivateNetwork and returns a response
func (*PrivateNetworkRepository) GetAll ¶
func (r *PrivateNetworkRepository) GetAll() ([]PrivateNetwork, error)
GetAll returns a list of all your private networks
func (*PrivateNetworkRepository) GetByName ¶
func (r *PrivateNetworkRepository) GetByName(privateNetworkName string) (PrivateNetwork, error)
GetByName allows you to get a specific PrivateNetwork by name
func (*PrivateNetworkRepository) GetSelection ¶
func (r *PrivateNetworkRepository) GetSelection(page int, itemsPerPage int) ([]PrivateNetwork, error)
GetSelection returns a limited list of private networks, specify how many and which page/chunk of private networks you want to retrieve
func (*PrivateNetworkRepository) Order ¶
func (r *PrivateNetworkRepository) Order(description string) error
Order allows you to order new private network with a given description
func (*PrivateNetworkRepository) OrderWithResponse ¶ added in v6.18.0
func (r *PrivateNetworkRepository) OrderWithResponse(description string) (rest.Response, error)
OrderWithResponse allows you to order new private network with a given description and returns a response
func (*PrivateNetworkRepository) Update ¶
func (r *PrivateNetworkRepository) Update(privateNetwork PrivateNetwork) error
Update allows you to update the private network. You can change the description by changing the Description field on the PrivateNetwork struct Updating it using this function.
type ReplaceLicenseRequest ¶ added in v6.6.0
type ReplaceLicenseRequest struct { // The License id LicenseID int64 // NewLicenseName is the name of the license with which you want to replace the current 'operating-system' license NewLicenseName string }
ReplaceLicenseRequest this struct is used for replacing a 'operating-system' type license with a new license
type Repository ¶
type Repository repository.RestRepository
Repository is the vps repository this repository allows you to manage all VPS services for your TransIP account
func (*Repository) AddIPv6Address ¶
func (r *Repository) AddIPv6Address(vpsName string, address net.IP) error
AddIPv6Address allows you to add an IPv6 address to your VPS. After adding an IPv6 address, you can set the reverse DNS for this address using the UpdateReverseDNS function.
func (*Repository) Cancel ¶
func (r *Repository) Cancel(vpsName string, endTime gotransip.CancellationTime) error
Cancel will cancel the VPS, thus deleting it
func (*Repository) CancelAddon ¶
func (r *Repository) CancelAddon(vpsName string, addon string) error
CancelAddon allows you to cancel an add-on by name, specifying the VPS name as well. Due to technical restrictions (possible dataloss) storage add-ons cannot be cancelled.
func (*Repository) Clone ¶
func (r *Repository) Clone(vpsName string) error
Clone allows you to clone an existing VPS There are a few things to take into account when you want to clone an existing VPS to a new VPS:
- If the original VPS (which you’re going to clone) is currently locked, the clone will fail;
Cloned control panels can be used on the VPS, but as the IP address changes, this does require you to synchronise the new license on the new VPS (licenses are often IP-based);
Possibly, your VPS has its network interface(s) configured using (a) static IP(‘s) rather than a dynamic allocation using DHCP. If this is the case, you have to configure the new IP(‘s) on the new VPS. Do note that this is not the case with our pre-installed control panel images;
VPS add-ons such as Big Storage aren’t affected by cloning - these will stay attached to the original VPS and can’t be swapped automatically
func (*Repository) CloneToAvailabilityZone ¶
func (r *Repository) CloneToAvailabilityZone(vpsName string, availabilityZone string) error
CloneToAvailabilityZone allows you to clone a vps to a specific availability zone, identified by name
func (*Repository) CloneToAvailabilityZoneWithResponse ¶ added in v6.18.0
func (r *Repository) CloneToAvailabilityZoneWithResponse(vpsName string, availabilityZone string) (rest.Response, error)
CloneToAvailabilityZoneWithResponse allows you to clone a vps to a specific availability zone, identified by name and returns a response
func (*Repository) CloneWithResponse ¶ added in v6.18.0
func (r *Repository) CloneWithResponse(vpsName string) (rest.Response, error)
CloneWithResponse allows you to clone an existing VPS and returns a response
func (*Repository) ConvertBackupToSnapshot ¶
func (r *Repository) ConvertBackupToSnapshot(vpsName string, backupID int64, snapshotDescription string) error
ConvertBackupToSnapshot allows you to convert a backup to a snapshot
func (*Repository) ConvertBackupToSnapshotWithResponse ¶ added in v6.18.0
func (r *Repository) ConvertBackupToSnapshotWithResponse(vpsName string, backupID int64, snapshotDescription string) (rest.Response, error)
ConvertBackupToSnapshotWithResponse allows you to convert a backup to a snapshot and returns a response
func (*Repository) CreateSnapshot ¶
func (r *Repository) CreateSnapshot(vpsName string, description string, shouldStartVps bool) error
CreateSnapshot allows you to create a snapshot for restoring it at a later time or restoring it to another VPS. See the function RevertSnapshot for this.
func (*Repository) CreateSnapshotWithResponse ¶ added in v6.18.0
func (r *Repository) CreateSnapshotWithResponse(vpsName string, description string, shouldStartVps bool) (rest.Response, error)
CreateSnapshotWithResponse allows you to create a snapshot for restoring it at a later time or restoring it to another VPS and returns a response See the function RevertSnapshot for this.
func (*Repository) GetAddons ¶
func (r *Repository) GetAddons(vpsName string) (Addons, error)
GetAddons returns a struct with 'cancellable', 'available' and 'active' addons in it for the given VPS
func (*Repository) GetAll ¶
func (r *Repository) GetAll() ([]Vps, error)
GetAll returns a list of all your VPSs
func (*Repository) GetAllByTags ¶
func (r *Repository) GetAllByTags(tags []string) ([]Vps, error)
GetAllByTags returns a list of all VPSs that match the tags provided
func (*Repository) GetAllUsage ¶
func (r *Repository) GetAllUsage(vpsName string, period UsagePeriod) (Usage, error)
GetAllUsage returns a Usage struct filled with all usage data for the given UsagePeriod. UsagePeriod is struct containing a start and end unix timestamp
func (*Repository) GetAllUsage24Hours ¶
func (r *Repository) GetAllUsage24Hours(vpsName string) (Usage, error)
GetAllUsage24Hours returns all usage data for a given Vps within the last 24 hours
func (*Repository) GetBackups ¶
func (r *Repository) GetBackups(vpsName string) ([]Backup, error)
GetBackups allows you to get a list of backups for a given VPS which you can use to revert or convert to snapshot
func (*Repository) GetByName ¶
func (r *Repository) GetByName(vpsName string) (Vps, error)
GetByName returns information on a specific VPS by name
func (*Repository) GetIPAddressByAddress ¶
func (r *Repository) GetIPAddressByAddress(vpsName string, address net.IP) (ipaddress.IPAddress, error)
GetIPAddressByAddress returns network information for the specified IP address
func (*Repository) GetIPAddresses ¶
func (r *Repository) GetIPAddresses(vpsName string) ([]ipaddress.IPAddress, error)
GetIPAddresses returns all IPv4 and IPv6 addresses attached to the VPS
func (*Repository) GetOperatingSystems ¶
func (r *Repository) GetOperatingSystems(vpsName string) ([]OperatingSystem, error)
GetOperatingSystems returns a list of operating systems that you can install on a vps
func (*Repository) GetSelection ¶
func (r *Repository) GetSelection(page int, itemsPerPage int) ([]Vps, error)
GetSelection returns a limited list of VPSs, specify how many and which page/chunk of VPSs you want to retrieve
func (*Repository) GetSnapshotByName ¶
func (r *Repository) GetSnapshotByName(vpsName string, snapshotName string) (Snapshot, error)
GetSnapshotByName returns a Snapshot for a VPS given its snapshotName and vpsName
func (*Repository) GetSnapshots ¶
func (r *Repository) GetSnapshots(vpsName string) ([]Snapshot, error)
GetSnapshots returns a list of Snapshots for a given VPS
func (*Repository) GetUpgrades ¶
func (r *Repository) GetUpgrades(vpsName string) ([]product.Product, error)
GetUpgrades returns all available product upgrades for a VPS
func (*Repository) GetUsage ¶
func (r *Repository) GetUsage(vpsName string, usageTypes []UsageType, period UsagePeriod) (Usage, error)
GetUsage will allow you to request your vps usage for a specified period and usage type, for convenience you can also use the GetUsages or GetUsagesLast24Hours
func (*Repository) GetVNCData ¶
func (r *Repository) GetVNCData(vpsName string) (VncData, error)
GetVNCData will return VncData about your vps. It allows you to get the location, token and password in order to connect directly to the VNC console of your VPS.
func (*Repository) Handover ¶
func (r *Repository) Handover(vpsName string, targetCustomerName string) error
Handover will handover a VPS to another TransIP Account. This call will initiate the handover process. The actual handover will be done when the target customer accepts the handover
func (*Repository) InstallOperatingSystem ¶
func (r *Repository) InstallOperatingSystem(vpsName string, operatingSystemName string, hostname string, base64InstallText string) error
InstallOperatingSystem allows you to install an operating system to a Vps, optionally you can specify a hostname and a base64InstallText, which would be the automatic installation configuration of your Vps for more information, see: https://api.transip.nl/rest/docs.html#vps-operatingsystems-post
func (*Repository) InstallOperatingSystemWithOptions ¶ added in v6.0.4
func (r *Repository) InstallOperatingSystemWithOptions(vpsName string, options InstallOptions) error
InstallOperatingSystemWithOptions allows you to install an operating system to a Vps, in the options you can specify hostname, username, ssh keys, and base64InstallText, which would be the automatic installation configuration of your Vps for more information, see: https://api.transip.nl/rest/docs.html#vps-operatingsystems-post
func (*Repository) Order ¶
func (r *Repository) Order(vpsOrder Order) error
Order allows you to order a new VPS
func (*Repository) OrderAddons ¶
func (r *Repository) OrderAddons(vpsName string, addons []string) error
OrderAddons allows you to expand VPS specs with a given list of addons to order
func (*Repository) OrderMultiple ¶
func (r *Repository) OrderMultiple(orders []Order) error
OrderMultiple allows you to order multiple vpses at the same time
func (*Repository) OrderMultipleWithResponse ¶ added in v6.18.0
func (r *Repository) OrderMultipleWithResponse(orders []Order) (rest.Response, error)
OrderMultipleWithResponse allows you to order multiple vpses at the same time and returns a response
func (*Repository) OrderWithResponse ¶ added in v6.18.0
func (r *Repository) OrderWithResponse(vpsOrder Order) (rest.Response, error)
OrderWithResponse allows you to order a new VPS and returns a response
func (*Repository) RegenerateVNCToken ¶
func (r *Repository) RegenerateVNCToken(vpsName string) error
RegenerateVNCToken allows you to regenerate the VNC credentials for a VPS
func (*Repository) RemoveIPv6Address ¶
func (r *Repository) RemoveIPv6Address(vpsName string, address net.IP) error
RemoveIPv6Address allows you to remove an IPv6 address from the registered list of IPv6 address within your VPS's `/64` range.
func (*Repository) RemoveSnapshot ¶
func (r *Repository) RemoveSnapshot(vpsName string, snapshotName string) error
RemoveSnapshot allows you to remove a snapshot from a given VPS
func (*Repository) Reset ¶
func (r *Repository) Reset(vpsName string) error
Reset allows you to reset a VPS, a reset is essentially the stop and start command combined into one
func (*Repository) RevertBackup ¶
func (r *Repository) RevertBackup(vpsName string, backupID int64) error
RevertBackup allows you to revert a backup
func (*Repository) RevertBackupWithResponse ¶ added in v6.18.0
func (r *Repository) RevertBackupWithResponse(vpsName string, backupID int64) (rest.Response, error)
RevertBackupWithResponse allows you to revert a backup and returns a response
func (*Repository) RevertSnapshot ¶
func (r *Repository) RevertSnapshot(vpsName string, snapshotName string) error
RevertSnapshot allows you to revert a snapshot of a vps, if you want to revert a snapshot to a different vps you can use the RevertSnapshotToOtherVps method
func (*Repository) RevertSnapshotToOtherVps ¶
func (r *Repository) RevertSnapshotToOtherVps(vpsName string, snapshotName string, destinationVps string) error
RevertSnapshotToOtherVps allows you to revert a snapshot to a different vps
func (*Repository) RevertSnapshotToOtherVpsWithResponse ¶ added in v6.18.0
func (r *Repository) RevertSnapshotToOtherVpsWithResponse(vpsName string, snapshotName string, destinationVps string) (rest.Response, error)
RevertSnapshotToOtherVpsWithResponse allows you to revert a snapshot to a different vps
func (*Repository) RevertSnapshotWithResponse ¶ added in v6.18.0
func (r *Repository) RevertSnapshotWithResponse(vpsName string, snapshotName string) (rest.Response, error)
RevertSnapshotWithResponse allows you to revert a snapshot of a vps and returns a response if you want to revert a snapshot to a different vps you can use the RevertSnapshotToOtherVps method
func (*Repository) Start ¶
func (r *Repository) Start(vpsName string) error
Start allows you to start a VPS, given that it’s currently in a stopped state
func (*Repository) Stop ¶
func (r *Repository) Stop(vpsName string) error
Stop allows you to stop a VPS
func (*Repository) Update ¶
func (r *Repository) Update(vps Vps) error
Update allows you to lock/unlock a VPS, update a VPS description, and add/remove tags.
For locking the VPS, set isCustomerLocked to true. Set the value to false for unlocking the VPS You can change your VPS description by simply changing the description attribute To add/remove tags, you must update the tags attribute
func (*Repository) UpdateReverseDNS ¶
func (r *Repository) UpdateReverseDNS(vpsName string, ip ipaddress.IPAddress) error
UpdateReverseDNS allows you to update the reverse dns for IPv4 addresses as wal as IPv6 addresses
type RescueImage ¶ added in v6.17.0
type RescueImage struct {
Name string `json:"name"`
}
RescueImage contains the information known about a rescue image
type RescueImageRepository ¶ added in v6.17.0
type RescueImageRepository repository.RestRepository
RescueImageRepository show the rescue images available to boot from. A rescue image can be used to recover a VPS in case it doesn't normally boot
func (*RescueImageRepository) BootRescueImage ¶ added in v6.17.0
func (r *RescueImageRepository) BootRescueImage(vpsName string, imageName string) error
BootRescueImage boots a rescue image for the provided vps
func (*RescueImageRepository) GetAll ¶ added in v6.17.0
func (r *RescueImageRepository) GetAll(vpsName string) ([]RescueImage, error)
GetAll returns all the rescue images available for a vps
type Setting ¶ added in v6.17.0
type Setting struct { Name string `json:"name"` DataType string `json:"dataType"` ReadOnly bool `json:"readOnly"` Value SettingValue `json:"value"` }
Setting is a struct that describes a vps setting
type SettingRepository ¶ added in v6.17.0
type SettingRepository repository.RestRepository
SettingRepository allows you to get and modify settings a VPS. These include the `blockVpsMailPorts` and `tcpMonitoringAvailable` settings
func (*SettingRepository) GetAll ¶ added in v6.17.0
func (r *SettingRepository) GetAll(vpsName string) ([]Setting, error)
GetAll returns all the Settings for a vps
type SettingValue ¶ added in v6.17.0
type SettingValue struct { ValueBoolean bool `json:"valueBoolean"` ValueString string `json:"valueString"` }
SettingValue contains the value of a setting. Only one the fields will contain the value. Which field that is can be determined by checking the DataType of a Setting.
type Snapshot ¶
type Snapshot struct { // The snapshot creation date DateTimeCreate string `json:"dateTimeCreate,omitempty"` // The snapshot description Description string `json:"description,omitempty"` // The size of the snapshot in kB DiskSize int64 `json:"diskSize,omitempty"` // The snapshot name Name string `json:"name,omitempty"` // The snapshot OperatingSystem OperatingSystem string `json:"operatingSystem,omitempty"` // The snapshot status ('active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving') Status SnapshotStatus `json:"status,omitempty"` }
Snapshot struct for a Snapshot
type SnapshotStatus ¶
type SnapshotStatus string
SnapshotStatus is one of the following strings 'active', 'creating', 'reverting', 'deleting', 'pendingDeletion', 'syncing', 'moving'
const ( // SnapshotStatusActive is the status field for an active snapshot, ready to use SnapshotStatusActive SnapshotStatus = "active" // SnapshotStatusCreating is the status field for a snapshot that is going to be created SnapshotStatusCreating SnapshotStatus = "creating" // SnapshotStatusReverting is the status field for snapshot that is being reverted SnapshotStatusReverting SnapshotStatus = "reverting" // SnapshotStatusDeleting is the status field for snapshot that is going to be deleted SnapshotStatusDeleting SnapshotStatus = "deleting" // SnapshotStatusPendingDeletion is the status field for snapshot that is going to be deleted in the near future SnapshotStatusPendingDeletion SnapshotStatus = "pendingDeletion" // SnapshotStatusSyncing is the status field for a snapshot that is still under creation SnapshotStatusSyncing SnapshotStatus = "syncing" // SnapshotStatusMoving is the status field for a snapshot that is moving to another location, // this means that the snapshot is under migration SnapshotStatusMoving SnapshotStatus = "moving" )
Definition of all of the possible snapshot statuses
type Status ¶
type Status string
Status is one of the following strings 'created', 'installing', 'running', 'stopped', 'paused'
const ( // VpsStatusCreated is the status field for a vps that is created but not yet used VpsStatusCreated Status = "created" // VpsStatusInstalling is the status field for a vps that is going to be installed VpsStatusInstalling Status = "installing" // VpsStatusRunning is the status field for a vps that is currently turned on VpsStatusRunning Status = "running" // VpsStatusStopped is the status field for a vps that is in stopped state VpsStatusStopped Status = "stopped" // VpsStatusPaused is the status field for a vps that is in paused state VpsStatusPaused Status = "paused" )
Definition of all of the possible vps statuses
type TCPMonitor ¶
type TCPMonitor struct { // IP Address that is monitored IPAddress net.IP `json:"ipAddress"` // Title of the monitor Label string `json:"label"` // Ports that are monitored Ports []int `json:"ports"` // Checking interval in minutes (numbers 1-6) Interval int `json:"interval"` // Allowed time outs (numbers 1-5) AllowedTimeouts int `json:"allowedTimeouts"` // TCPMonitorContact that will be notified for this monitor Contacts []TCPMonitorContact `json:"contacts"` // The hours when the TCP monitoring is ignored (no notifications are sent out) IgnoreTimes []IgnoreTime `json:"ignoreTimes"` }
TCPMonitor struct for a TCPMonitor, tcp monitors are created on specific IPs
type TCPMonitorContact ¶
type TCPMonitorContact struct { // Monitoring contact id ID int64 `json:"id"` // Send emails to contact EnableEmail bool `json:"enableEmail"` // Send SMS text messages to contact EnableSMS bool `json:"enableSMS"` }
TCPMonitorContact struct for a TCPMonitorContact
type TCPMonitorRepository ¶
type TCPMonitorRepository repository.RestRepository
TCPMonitorRepository allows you to manage all tcp monitor and tcp monitor contact api actions like listing, getting information, adding, updating, deleting tcp monitors updating, creating, deleting contacts
func (*TCPMonitorRepository) CreateContact ¶
func (r *TCPMonitorRepository) CreateContact(contact MonitoringContact) error
CreateContact allows you to add a new contact which could be used by the tcp monitoring
func (*TCPMonitorRepository) CreateTCPMonitor ¶
func (r *TCPMonitorRepository) CreateTCPMonitor(vpsName string, tcpMonitor TCPMonitor) error
CreateTCPMonitor allows you to create a tcp monitor and specify which ports you would like to monitor.
To get a better grip on which fields exist and which can be changes have a look at the TCPMonitor struct or see the documentation: https://api.transip.nl/rest/docs.html#vps-tcp-monitors-post
func (*TCPMonitorRepository) GetContacts ¶
func (r *TCPMonitorRepository) GetContacts() ([]MonitoringContact, error)
GetContacts returns a list of all your monitoring contacts
func (*TCPMonitorRepository) GetTCPMonitors ¶
func (r *TCPMonitorRepository) GetTCPMonitors(vpsName string) ([]TCPMonitor, error)
GetTCPMonitors returns an overview of all existing monitors attached to a VPS
func (*TCPMonitorRepository) RemoveContact ¶
func (r *TCPMonitorRepository) RemoveContact(contactID int64) error
RemoveContact allows you to delete a specific contact by id
func (*TCPMonitorRepository) RemoveTCPMonitor ¶
func (r *TCPMonitorRepository) RemoveTCPMonitor(vpsName string, ip net.IP) error
RemoveTCPMonitor allows you to remove a tcp monitor for a specific ip address on a specifc VPS
func (*TCPMonitorRepository) UpdateContact ¶
func (r *TCPMonitorRepository) UpdateContact(contact MonitoringContact) error
UpdateContact updates the specified contact
func (*TCPMonitorRepository) UpdateTCPMonitor ¶
func (r *TCPMonitorRepository) UpdateTCPMonitor(vpsName string, tcpMonitor TCPMonitor) error
UpdateTCPMonitor allows you to update your monitor settings for a given tcp monitored ip
type Usage ¶
type Usage struct { CPU []UsageDataCPU `json:"cpu"` Disk []UsageDataDisk `json:"disk"` Network []UsageDataNetwork `json:"network"` }
Usage struct for an Usage
type UsageDataCPU ¶
type UsageDataCPU struct { // Date of the entry, by default in UNIX timestamp format Date int64 `json:"date"` // The percentage of CPU usage for this entry Percentage float32 `json:"percentage"` }
UsageDataCPU struct contains cpu usage percentage for a certain date
type UsageDataDisk ¶
type UsageDataDisk struct { // Date of the entry, by default in UNIX timestamp format Date int64 `json:"date"` // The read IOPS for this entry IopsRead float32 `json:"iopsRead"` // The write IOPS for this entry IopsWrite float32 `json:"iopsWrite"` }
UsageDataDisk struct contains disk usage for a certain date
type UsageDataNetwork ¶
type UsageDataNetwork struct { // Date of the entry, by default in UNIX timestamp format Date float32 `json:"date"` // The amount of inbound traffic in Mbps for this usage entry MbitIn float32 `json:"mbitIn"` // The amount of outbound traffic in Mbps for this usage entry MbitOut float32 `json:"mbitOut"` }
UsageDataNetwork struct for UsageDataNetwork
type UsagePeriod ¶
type UsagePeriod struct { // TimeStart contains a unix timestamp for the start of the period TimeStart int64 `json:"dateTimeStart"` // TimeEnd contains a unix timestamp for the end of the period TimeEnd int64 `json:"dateTimeEnd"` }
UsagePeriod is struct that can be used to query usage statistics for a certain period
type UsageType ¶
type UsageType string
UsageType can be one of the following strings 'cpu', 'disk', 'network'
const ( // UsageTypeCPU is used to request the cpu usage data of a VPS UsageTypeCPU UsageType = "cpu" // UsageTypeDisk is used to request the disk usage data of a VPS UsageTypeDisk UsageType = "disk" // UsageTypeNetwork is used to request the network usage data of a VPS UsageTypeNetwork UsageType = "network" )
type VncData ¶
type VncData struct { // Location of the VNC Proxy Host string `json:"host,omitempty"` // Password to setup up the VNC connection (changes dynamically) Password string `json:"password,omitempty"` // Websocket path including the token Path string `json:"path,omitempty"` // token to identify the VPS to connect to (changes dynamically) Token string `json:"token,omitempty"` // Complete websocket URL URL string `json:"url,omitempty"` }
VncData struct for the vps vnc data
type Vps ¶
type Vps struct { // The unique VPS name Name string `json:"name"` // The unique identifier for the VPS UUID string `json:"uuid"` // The name that can be set by customer Description string `json:"description"` // The product name ProductName string `json:"productName,omitempty"` // The VPS OperatingSystem OperatingSystem string `json:"operatingSystem,omitempty"` // The VPS disk size in kB DiskSize int64 `json:"diskSize,omitempty"` // The VPS memory size in kB MemorySize int64 `json:"memorySize,omitempty"` // The VPS cpu count CPUs int `json:"cpus,omitempty"` // The VPS status, either 'created', 'installing', 'running', 'stopped' or 'paused' Status Status `json:"status,omitempty"` // The VPS main ipAddress IPAddress string `json:"ipAddress,omitempty"` // The VPS macaddress MacAddress string `json:"macAddress,omitempty"` // The amount of snapshots that is used on this VPS CurrentSnapshots int `json:"currentSnapshots,omitempty"` // The maximum amount of snapshots for this VPS MaxSnapshots int `json:"maxSnapshots,omitempty"` // Whether or not another process is already doing stuff with this VPS IsLocked bool `json:"isLocked,omitempty"` // If the VPS is administratively blocked IsBlocked bool `json:"isBlocked,omitempty"` // If this VPS is locked by the customer IsCustomerLocked bool `json:"isCustomerLocked"` // The name of the availability zone the VPS is in AvailabilityZone string `json:"availabilityZone,omitempty"` // The custom tags added to this VPS Tags []string `json:"tags,omitempty"` }
Vps struct for a Vps