File tree Expand file tree Collapse file tree 5 files changed +90
-0
lines changed
samples/compute/v2/servers
tests/integration/Compute/v2 Expand file tree Collapse file tree 5 files changed +90
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require 'vendor/autoload.php ' ;
4+
5+ $ openstack = new OpenStack \OpenStack ([
6+ 'authUrl ' => '{authUrl} ' ,
7+ 'region ' => '{region} ' ,
8+ 'user ' => [
9+ 'id ' => '{userId} ' ,
10+ 'password ' => '{password} '
11+ ],
12+ 'scope ' => ['project ' => ['id ' => '{projectId} ' ]]
13+ ]);
14+
15+ $ compute = $ openstack ->computeV2 (['region ' => '{region} ' ]);
16+
17+ $ server = $ compute ->getServer (['id ' => '{serverId} ' ]);
18+
19+ $ console = $ server ->getRDPConsole ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require 'vendor/autoload.php ' ;
4+
5+ $ openstack = new OpenStack \OpenStack ([
6+ 'authUrl ' => '{authUrl} ' ,
7+ 'region ' => '{region} ' ,
8+ 'user ' => [
9+ 'id ' => '{userId} ' ,
10+ 'password ' => '{password} '
11+ ],
12+ 'scope ' => ['project ' => ['id ' => '{projectId} ' ]]
13+ ]);
14+
15+ $ compute = $ openstack ->computeV2 (['region ' => '{region} ' ]);
16+
17+ $ server = $ compute ->getServer (['id ' => '{serverId} ' ]);
18+
19+ $ console = $ server ->getSerialConsole ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require 'vendor/autoload.php ' ;
4+
5+ $ openstack = new OpenStack \OpenStack ([
6+ 'authUrl ' => '{authUrl} ' ,
7+ 'region ' => '{region} ' ,
8+ 'user ' => [
9+ 'id ' => '{userId} ' ,
10+ 'password ' => '{password} '
11+ ],
12+ 'scope ' => ['project ' => ['id ' => '{projectId} ' ]]
13+ ]);
14+
15+ $ compute = $ openstack ->computeV2 (['region ' => '{region} ' ]);
16+
17+ $ server = $ compute ->getServer (['id ' => '{serverId} ' ]);
18+
19+ $ console = $ server ->getSpiceConsole ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require 'vendor/autoload.php ' ;
4+
5+ $ openstack = new OpenStack \OpenStack ([
6+ 'authUrl ' => '{authUrl} ' ,
7+ 'region ' => '{region} ' ,
8+ 'user ' => [
9+ 'id ' => '{userId} ' ,
10+ 'password ' => '{password} '
11+ ],
12+ 'scope ' => ['project ' => ['id ' => '{projectId} ' ]]
13+ ]);
14+
15+ $ compute = $ openstack ->computeV2 (['region ' => '{region} ' ]);
16+
17+ $ server = $ compute ->getServer (['id ' => '{serverId} ' ]);
18+
19+ $ console = $ server ->getVncConsole ();
Original file line number Diff line number Diff line change @@ -180,6 +180,9 @@ public function runTests()
180180 // Limits
181181 $ this ->getLimits ();
182182 $ this ->getHypervisorsStatistics ();
183+
184+ // Console
185+ $ this ->getVncConsole ();
183186 } finally {
184187 // Teardown
185188 $ this ->deleteServer ();
@@ -647,4 +650,15 @@ private function detachVolumeFromServer()
647650
648651 $ this ->logStep ('Detached volume attachments for server {serverId} ' , $ replacements );
649652 }
653+
654+ private function getVncConsole ()
655+ {
656+ $ replacements = [
657+ '{serverId} ' => $ this ->serverId
658+ ];
659+
660+ require_once $ this ->sampleFile ($ replacements , 'servers/get_server_vnc_console.php ' );
661+
662+ $ this ->logStep ('Get VNC console for server {serverId} ' , $ replacements );
663+ }
650664}
You can’t perform that action at this time.
0 commit comments