-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathhosting-and-ssl.php
More file actions
66 lines (51 loc) · 1.38 KB
/
hosting-and-ssl.php
File metadata and controls
66 lines (51 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php declare(strict_types=1);
/**
* Hosting and SSL certificate management examples.
*
* See: https://www.hostfact.nl/developer/api/hosting/
* See: https://www.hostfact.nl/developer/api/ssl/
*/
use Hyperized\Hostfact\Api\Controllers\Hosting;
use Hyperized\Hostfact\Api\Controllers\Ssl;
// --- Hosting ---
// List all hosting accounts
$accounts = Hosting::new()->list([]);
// Create a hosting account on the server
$created = Hosting::new()->create([
'HostingCode' => 'HO0001',
]);
// Suspend a hosting account
$suspended = Hosting::new()->suspend([
'HostingCode' => 'HO0001',
]);
// Unsuspend a hosting account
$unsuspended = Hosting::new()->unsuspend([
'HostingCode' => 'HO0001',
]);
// Get domains linked to this hosting
$domains = Hosting::new()->getDomainList([
'HostingCode' => 'HO0001',
]);
// Send account info to customer
$emailed = Hosting::new()->emailAccountData([
'HostingCode' => 'HO0001',
]);
// --- SSL ---
// List SSL certificates
$certificates = Ssl::new()->list([]);
// Request a new SSL certificate
$requested = Ssl::new()->request([
'SSLCode' => 'SSL0001',
]);
// Reissue an SSL certificate
$reissued = Ssl::new()->reissue([
'SSLCode' => 'SSL0001',
]);
// Resend approval email
$resent = Ssl::new()->resendApproverEmail([
'SSLCode' => 'SSL0001',
]);
// Revoke a certificate
$revoked = Ssl::new()->revoke([
'SSLCode' => 'SSL0001',
]);