HostFact API versie 3.1
VPS
VPS diensten zijn te beheren via de controller 'vps'.
add
Middels deze functie is het mogelijk een VPS toe te voegen.
Voorbeeldbestand: /voorbeelden/vps/vps.add.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| Hostname | string | De hostnaam |
| Debtor | int | De unieke ID van een debiteur |
| DebtorCode | string | Het debiteurnummer |
| Password | string | Wachtwoord voor de VPS |
| IPAddress | string | IP-adres. Standaard wordt deze automatisch gevuld. |
| Package | int | De unieke ID van het VPS pakket |
| Node | int | De unieke ID van de VPS server |
| ServerID | string | Uniek integratie-kenmerk voor de dienst |
| Image | string | De unieke ID van de image |
| MemoryMB | int | Afwijkend geheugen (in MB) |
| DiskSpaceGB | int | Afwijkende harde schijf ruimte (in GB) |
| BandWidthGB | int | Afwijkend dataverkeer (in GB) |
| CPUCores | int | Afwijkende CPU Cores (in GB) |
| Comment | string | Commentaar |
| Status | string | VPS status, zie variabelen-lijst. Standaard: 'waiting' (wachten op actie) |
| HasSubscription | 'yes' of 'no' | Dienst factureren (abonnement)? Standaard: 'no' |
| Subscription | array | Abonnement: |
| - ProductCode | string | Het productnummer |
| - Description | text | Omschrijving |
| - PriceExcl | float | Prijs per stuk (excl. BTW) |
| - TaxPercentage | int | BTW percentage: 0 - 100 |
| - DiscountPercentage | float | Korting abonnement, percentage: 0 - 100 |
| - Periods | int | Factureer iedere: aantal periodes |
| - Periodic | string | Factureer iedere: eenheid, zie variabelen-lijst |
| - StartPeriod | date | Startdatum van de periode |
| - ContractPeriods | int | Afwijkende contractperiode. Aantal van de frequentie eenheid 'ContractPeriodic' |
| - ContractPeriodic | string | Afwijkende contractperiode. Frequentie eenheid, zie variabelen-lijst |
| - StartContract | date | Startdatum afwijkende contractperiode |
| - EndContract | date | Einddatum afwijkende contractperiode |
| - TerminationDate | date | De datum waarop het abonnement opgezegd wordt |
| - Reminder | 'yes', 'no' of '' | E-mail bij nieuwe facturatie van abonnement? Standaard: '' (Algemene instelling overnemen) |
| - InvoiceAuthorisation | 'yes' of 'no' | Automatische incasso? Standaard: 'yes' = voorkeur debtor |
Bij facturatie (HasSubscription = yes): ProductCode of bij geen ProductCode zijn Description en PriceExcl verplicht
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$vpsParams = array(
'DebtorCode' => 'DB0001',
'Hostname' => 'vps1.example.com',
'Package' => 1,
'HasSubscription' => 'yes',
'Subscription' => array(
'ProductCode' => 'P005'
)
);
$response = $api->sendRequest('vps', 'add', $vpsParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => vps
[action] => add
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[success] => Array
(
[0] => Dienst is aangemaakt
)
[vps] => Array
(
[Identifier] => 3
[Hostname] => vps1.example.com
[Debtor] => 1
[DebtorCode] => DB0001
[IPAddress] =>
[Package] => 1
[Node] => 1
[ServerID] =>
[Image] => key1
[MemoryMB] => 500
[DiskSpaceGB] => 20
[BandWidthGB] => 20
[CPUCores] => 1
[Comment] =>
[Status] => waiting
[Created] => 2022-11-24 11:00:00
[Modified] => 2022-11-24 11:00:00
[Subscription] => Array
(
[Number] => 1
[NumberSuffix] =>
[ProductCode] => P005
[Description] => VPS package 1
[PriceExcl] => 35
[PriceIncl] => 42.35
[TaxPercentage] => 21
[DiscountPercentage] => 0
[Periods] => 1
[Periodic] => m
[StartPeriod] => 2022-11-24
[EndPeriod] => 2022-12-24
[NextDate] => 2022-11-10
[ContractPeriods] => 1
[ContractPeriodic] => m
[StartContract] => 2022-11-24
[EndContract] => 2022-12-24
[TerminationDate] =>
[Reminder] =>
[InvoiceAuthorisation] => yes
[AmountExcl] => 35
[AmountIncl] => 42.35
)
[NodeInfo] => Array
(
[Name] => Example VPS Node
[Images] => Array
(
[0] => Array
(
[Node] => 1
[Key] => img1
[ImageName] => An example image
[Status] => active
)
)
[Platform] => apiexample
[Location] => a
[Port] =>
)
[Translations] => Array
(
[PackageName] =>
[NodeName] => Example VPS Node
[ImageName] =>
)
)
)