-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
58 lines (49 loc) · 1.48 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
<?php
require_once __DIR__ . '/vendor/autoload.php';
use PonderSource\GoogleApi\Google;
use PonderSource\HerokuApi\HerokuClient;
use PonderSource\GitHubApi\GitHubClient;
use PonderSource\AWSApi\AWSClient;
use PonderSource\Library\DotEnv;
(new DotEnv(__DIR__ . '/.env'))->load();
// $uri = $_SERVER['REQUEST_URI'];
//GOOGLE
$google = new Google([
'apiKey' => putenv('GOOGLE_APPLICATION_CREDENTIALS='.realpath("application_default_credentials.json"))
]);
$google->getCloudbillingSkus();
// GITHUB
$token = getenv('GITHUB_ACCESS_TOKEN');
$github = new GitHubClient($token);
$user_billing = $github->getUserSharedStorageBilling("ishifoev");
//$org_billing = $github->getOrgSharedStorageBilling("testORGbilling");
//HEROKU
$her = new HerokuClient([
'apiKey' => getenv('HEROKU_API_KEY'),
]);
//var_dump($her->getUrlAccount($uri));
$her->getHerokuInvoice();
$her->getHerokuTeamInvoices();
//
// // AWS
// $key = getenv('AWS_ACCESS_KEY_ID');
// $secret = getenv('AWS_SECRET_ACCESS_KEY');
//
// $aws = new AWSClient([
// 'region' => 'us-east-1',
// 'version' => 'latest',
// 'credentials' => [
// 'key' => $key,
// 'secret' => $secret
// ],
// 'endpoint' => 'https://ce.us-east-1.amazonaws.com'
// ]);
// $aws->getCostAndUsage([
// 'Granularity' => 'DAILY', // REQUIRED
// 'Metrics' => ['BlendedCost'], // REQUIRED
// 'TimePeriod' => [ // REQUIRED
// 'Start' => '2022-01-03', // REQUIRED
// 'End' => '2022-02-03', // REQUIRED
// ],
// ],'aws_cost_and_usage');
?>