-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
161 lines (152 loc) · 9.19 KB
/
index.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html lang="en">
<?php
// Include the PHP functions
include('functions.php');
// Set of the subsidiary, useful for the prices
$subsidiary = set_sub();
// Parse the API result line by line
$plans = parse_plans($subsidiary);
// Get the currency code
$currency = get_currency($plans);
?>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>OVHcloud baremetal servers pricelist</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120246315-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-120246315-1');
</script>
<!-- Datatables.net scripts -->
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/cr-1.5.2/fh-3.1.6/kt-2.5.1/r-2.2.3/rg-1.1.1/sc-2.0.1/sl-1.3.1/datatables.min.css"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/cr-1.5.2/fh-3.1.6/kt-2.5.1/r-2.2.3/rg-1.1.1/sc-2.0.1/sl-1.3.1/datatables.min.js"></script>
<!-- Github button -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- Custom CSS -->
<link href="css/main.css" rel="stylesheet">
<!-- Custom JS -->
<script src="js/custom.js"></script>
</head>
<body class="container-fluid">
<div class="row">
<div class="col-9">
<h1>OVHcloud baremetal servers pricelist</h1>
</div>
<div class="col-3 d-none d-sm-block">
<span class="float-right">
<a href="https://twitter.com/BastienOVH?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @BastienOVH</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<a class="github-button" href="https://github.com/baaastijn/ovh_pricelist/issues" data-color-scheme="no-preference: light; light: light; dark: dark;" data-show-count="true" aria-label="Issue baaastijn/ovh_pricelist on GitHub">Issue</a>
<h6><span class="badge badge-secondary"><?php echo get_cache_time($subsidiary); ?></span></h6>
</span>
</div>
</div>
<div class="row">
<div class="col">
<div class="text">
<p><?php list_subs() ?> /</p>
<p class="text-warning"><strong>Warning:</strong> This site is not maintained by or affiliated with OVHcloud. The data shown is not guaranteed to be accurate or current. Please report issues you see on Github. </p>
<p>Pricelist generated via OVHcloud API. Some highly customizable ranges like HG are not fully shown here.</p>
<p>You can also find here generated <a target="_blank" href="<?php echo "cache/ovhcloud_servers_pricelist_".$subsidiary.".json"; ?>">pricelist JSON</a>, and <a target="_blank" href="https://github.com/baaastijn/ovh_pricelist/">source code on Github</a>.</p>
</div>
<hr/>
<table id='sd' class='table table-striped table-hover table-bordered table-sm display compact' style='width:100%'>
<thead class="thead-dark">
<tr>
<th>Range</th>
<th>Name</th>
<th>API Name</th>
<th>FQN</th>
<th>CPU model</th>
<th>CPU cores</th>
<th>CPU threads</th>
<th>CPU clock speed (GHz)</th>
<th>CPU score</th>
<th>RAM summary</th>
<th>RAM size (GB)</th>
<th>RAM clock speed (GHz)</th>
<th>RAM type</th>
<th>Storage summary</th>
<th>Storage RAID type</th>
<th>Storage total size</th>
<th>Disk #1 amount</th>
<th>Disk #1 capacity</th>
<th>Disk #1 techno</th>
<th>Disk #2 amount</th>
<th>Disk #2 capacity</th>
<th>Disk #2 techno</th>
<th>Storage price per GB (<?php echo $currency; ?>)</th>
<th>Public Network</th>
<th>Private Network</th>
<th>Frame size</th>
<th>Frame model</th>
<th>Setup fee (<?php echo $currency; ?>)</th>
<th>Monthly price (<?php echo $currency; ?>)</th>
<th>Buy</th>
</tr>
</thead>
<tbody>
<?php
foreach($plans as $item) {
if ($item['price'] > 0){
?>
<tr>
<td><?php echo strtoupper($item['range']) ?></td>
<td><?php echo $item['invoiceName'] ?></td>
<td><?php echo $item['planCode'] ?></td>
<td><?php echo $item['fqn'] ?></td>
<td><?php echo $item['cpu']['brand']." ".$item['cpu']['model'] ?></td>
<td><?php echo $item['cpu']['cores'] ?></td>
<td><?php echo $item['cpu']['threads'] ?></td>
<td><?php echo $item['cpu']['frequency'] ?></td>
<td><?php echo $item['cpu']['score'] ?></td>
<td><?php echo $item['memory']['invoiceName'] ?></td>
<td><?php echo $item['memory']['specifications']['size'] ?></td>
<td><?php echo $item['memory']['specifications']['frequency'] ?></td>
<td><?php echo $item['memory']['specifications']['ramType'] ?></td>
<td><?php echo $item['storageSpecs']['invoiceName'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['raid'] ?></td>
<td><?php
// You can have 1 or 2 disks. If second disk exist, we sum the amount of GB.
if ($item['storageSpecs']['specifications']['disks'][1]['number'] != '') {
$storage_amount = ($item['storageSpecs']['specifications']['disks'][0]['number'] * $item['storageSpecs']['specifications']['disks'][0]['capacity'] + $item['storageSpecs']['specifications']['disks'][1]['number'] * $item['storageSpecs']['specifications']['disks'][1]['capacity']);
} else {
$storage_amount = $item['storageSpecs']['specifications']['disks'][0]['number'] * $item['storageSpecs']['specifications']['disks'][0]['capacity'];
};
echo $storage_amount; ?>
</td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][0]['number'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][0]['capacity'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][0]['technology'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][1]['number'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][1]['capacity'] ?></td>
<td><?php echo $item['storageSpecs']['specifications']['disks'][1]['technology'] ?></td>
<td><?php $ratio = $item['price'] / $storage_amount ; echo round($ratio,5); ?></td>
<td>see website</td>
<td>see website</td>
<td><?php echo $item['frame']['size'] ?></td>
<td><?php echo $item['frame']['model'] ?></td>
<td><?php echo $item['setupfee'] ?></td>
<td><?php echo $item['price'] ?></td>
<td><a href="https://www.ovhcloud.com/en-ie/bare-metal/prices/" target="_blank">See options</a></td>
</tr>
<?php
}
} ?>
</tbody>
</table>
<div class="card">
<div class="card-body bg-light">
<p>Project initiated by <a href="https://www.twitter.com/BastienOVH" target="_blank">@BastienOVH</a>, with EC2instance.info as an inspiration.</p>
</div>
</div>
</div>
</div>
</body>
</html>