-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraphQL.php
42 lines (31 loc) · 1.03 KB
/
graphQL.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
<?php
include_once "rkFramework.php";
// Local CLuster credentials
$clusterConnect=array(
"username" => "username",
"password" => "password",
"ip" => "cdm_ip"
);
$clientID="client|xxxxxxxxx";
$clientSecret="xxxxxxxxxxxxxxxxxxxxxx";
$tenant="my_tenant";
// Polaris credenditals
$polarisConnect=array(
"token" => rkpolGetToken($clientID,$clientSecret,$tenant),
"tenant" => $tenant
);
$cdmQuery="{\"query\":\"query Cluster{cluster(id:\\\"me\\\"){version id brikCount isSingle isBootstrapped}}\"}";
$polarisQuery="query DataSitesMapQuery {clusterConnection(filter: {type: [OnPrem]}) { nodes { id name version estimatedRunway status geoLocation { address latitude longitude }}}}";
// Polaris call
$res=rkPolGraphQL($polarisConnect,$polarisQuery);
print("\nPolaris query result : \n");
print("--------------------\n\n");
var_dump($res);
print("\n");
// CDM call
$res=rkGraphQL($clusterConnect,$cdmQuery);
print("CDM query result : \n");
print("----------------\n\n");
var_dump($res);
print("\n");
?>