File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ HTTP/1.1 200 OK
2
+ Content-Type: application/json
3
+
4
+ {
5
+ "keypairs": [
6
+ {
7
+ "keypair": {
8
+ "fingerprint": "7e:eb:ab:24:ba:d1:e1:88:ae:9a:fb:66:53:df:d3:bd",
9
+ "name": "keypair-50ca852e-273f-4cdc-8949-45feba200837",
10
+ "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkF3MX59OrlBs3dH5CU7lNmvpbrgZxSpyGjlnE8Flkirnc/Up22lpjznoxqeoTAwTW034k7Dz6aYIrZGmQwe2TkE084yqvlj45Dkyoj95fW/sZacm0cZNuL69EObEGHdprfGJQajrpz22NQoCD8TFB8Wv+8om9NH9Le6s+WPe98WC77KLw8qgfQsbIey+JawPWl4O67ZdL5xrypuRjfIPWjgy/VH85IXg/Z/GONZ2nxHgSShMkwqSFECAC5L3PHB+0+/12M/iikdatFSVGjpuHvkLOs3oe7m6HlOfluSJ85BzLWBbvva93qkGmLg4ZAc8rPh2O+YIsBUHNLLMM/oQp Generated-by-Nova\n"
11
+ }
12
+ }
13
+ ]
14
+ }
Original file line number Diff line number Diff line change 6
6
use OpenStack \Compute \v2 \Api ;
7
7
use OpenStack \Compute \v2 \Models \Flavor ;
8
8
use OpenStack \Compute \v2 \Models \Image ;
9
+ use OpenStack \Compute \v2 \Models \Keypair ;
9
10
use OpenStack \Compute \v2 \Models \Server ;
10
11
use OpenStack \Compute \v2 \Service ;
11
12
use OpenCloud \Test \TestCase ;
@@ -113,4 +114,16 @@ public function test_it_gets_an_image()
113
114
$ this ->assertInstanceOf (Image::class, $ image );
114
115
$ this ->assertEquals ('imageId ' , $ image ->id );
115
116
}
117
+
118
+ public function test_it_lists_keypairs ()
119
+ {
120
+ $ this ->client
121
+ ->request ('GET ' , 'os-keypairs ' , ['headers ' => []])
122
+ ->shouldBeCalled ()
123
+ ->willReturn ($ this ->getFixture ('keypairs-get ' ));
124
+
125
+ foreach ($ this ->service ->listKeypairs () as $ keypair ) {
126
+ $ this ->assertInstanceOf (Keypair::class, $ keypair );
127
+ }
128
+ }
116
129
}
You can’t perform that action at this time.
0 commit comments