-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from haphan/os-console
[rfr] Get console vnc/serial/rdp/spice methods
- Loading branch information
Showing
14 changed files
with
305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => [ | ||
'id' => '{userId}', | ||
'password' => '{password}' | ||
], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$compute = $openstack->computeV2(['region' => '{region}']); | ||
|
||
$server = $compute->getServer(['id' => '{serverId}']); | ||
|
||
/** @var array $console */ | ||
$console = $server->getRDPConsole(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => [ | ||
'id' => '{userId}', | ||
'password' => '{password}' | ||
], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$compute = $openstack->computeV2(['region' => '{region}']); | ||
|
||
$server = $compute->getServer(['id' => '{serverId}']); | ||
|
||
/** @var array $console */ | ||
$console = $server->getSerialConsole(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => [ | ||
'id' => '{userId}', | ||
'password' => '{password}' | ||
], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$compute = $openstack->computeV2(['region' => '{region}']); | ||
|
||
$server = $compute->getServer(['id' => '{serverId}']); | ||
|
||
/** @var array $console */ | ||
$console = $server->getSpiceConsole(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
require 'vendor/autoload.php'; | ||
|
||
$openstack = new OpenStack\OpenStack([ | ||
'authUrl' => '{authUrl}', | ||
'region' => '{region}', | ||
'user' => [ | ||
'id' => '{userId}', | ||
'password' => '{password}' | ||
], | ||
'scope' => ['project' => ['id' => '{projectId}']] | ||
]); | ||
|
||
$compute = $openstack->computeV2(['region' => '{region}']); | ||
|
||
$server = $compute->getServer(['id' => '{serverId}']); | ||
|
||
/** @var array $console */ | ||
$console = $server->getVncConsole(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
HTTP/1.1 200 Accepted | ||
Content-Type: application/json | ||
|
||
{ | ||
"console": { | ||
"type": "rdp-html5", | ||
"url": "http://127.0.0.1:6083/?token=191996c3-7b0f-42f3-95a7-f1839f2da6ed" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/unit/Compute/v2/Fixtures/server-get-console-serial.resp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
HTTP/1.1 200 Accepted | ||
Content-Type: application/json | ||
|
||
{ | ||
"console": { | ||
"type": "serial", | ||
"url":"ws://127.0.0.1:6083/?token=f9906a48-b71e-4f18-baca-c987da3ebdb3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
HTTP/1.1 200 Accepted | ||
Content-Type: application/json | ||
|
||
{ | ||
"console": { | ||
"type": "spice-html5", | ||
"url": "http://127.0.0.1:6082/spice_auto.html?token=a30e5d08-6a20-4043-958f-0852440c6af4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
HTTP/1.1 200 Accepted | ||
Content-Type: application/json | ||
|
||
{ | ||
"console": { | ||
"type": "novnc", | ||
"url": "http://127.0.0.1:6080/vnc_auto.html?token=191996c3-7b0f-42f3-95a7-f1839f2da6ed" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters