7
7
use Acquia \Hmac \Exception \MalformedResponseException as MalformedResponseExceptionAlias ;
8
8
use AcquiaCloudApi \CloudApi \Client ;
9
9
use AcquiaCloudApi \CloudApi \Connector ;
10
+ use AcquiaCloudApi \Endpoints \Account ;
11
+ use AcquiaCloudApi \Endpoints \Applications ;
12
+ use AcquiaCloudApi \Endpoints \Environments ;
10
13
use Symfony \Component \Yaml \Yaml ;
11
14
use Acquia \Blt \Robo \Common \YamlMunge ;
12
15
@@ -67,7 +70,8 @@ public function generateAliasesAcquia() {
67
70
$ cloudApiConfig = $ this ->loadCloudApiConfig ();
68
71
$ this ->setCloudApiClient ($ cloudApiConfig ['key ' ], $ cloudApiConfig ['secret ' ]);
69
72
$ this ->say ("<info>Gathering site info from Acquia Cloud.</info> " );
70
- $ site = $ this ->cloudApiClient ->application ($ this ->appId );
73
+ $ applicationAdapter = new Applications ($ this ->cloudApiClient );
74
+ $ site = $ applicationAdapter ->get ($ this ->appId );
71
75
$ error = FALSE ;
72
76
try {
73
77
$ this ->getSiteAliases ($ site );
@@ -192,7 +196,8 @@ protected function setCloudApiClient($key, $secret) {
192
196
]);
193
197
$ cloud_api = Client::factory ($ connector );
194
198
// We must call some method on the client to test authentication.
195
- $ cloud_api ->account ();
199
+ $ account = new Account ();
200
+ $ account ->get ();
196
201
$ this ->cloudApiClient = $ cloud_api ;
197
202
}
198
203
catch (MalformedResponseExceptionAlias $ e ) {
@@ -229,7 +234,8 @@ protected function getSiteAliases($site) {
229
234
$ aliases = [];
230
235
$ sites = [];
231
236
$ this ->output ->writeln ("<info>Gathering sites list from Acquia Cloud.</info> " );
232
- $ environments = $ this ->cloudApiClient ->environments ($ site ->uuid );
237
+ $ environmentAdapter = new Environments ($ this ->cloudApiClient );
238
+ $ environments = $ environmentAdapter ->getAll ($ site ->uuid );
233
239
$ hosting = $ site ->hosting ->type ;
234
240
$ site_split = explode (': ' , $ site ->hosting ->id );
235
241
foreach ($ environments as $ env ) {
@@ -375,4 +381,4 @@ protected function writeSiteAliases($site_id, array $aliases) {
375
381
file_put_contents ($ filePath , Yaml::dump ($ aliases ));
376
382
return $ filePath ;
377
383
}
378
- }
384
+ }
0 commit comments