@@ -82,18 +82,18 @@ The exception is if you're using Nova (and not Neutron) for your instance networ
82
82
Initialise a connection to the compute service:
83
83
84
84
``` ruby
85
- compute = Fog ::Compute :: OpenStack .new (@connection_params )
85
+ compute = Fog ::OpenStack :: Compute .new (@connection_params )
86
86
```
87
87
88
88
Get a list of available images for use with booting new instances:
89
89
90
90
``` ruby
91
91
p compute.images
92
- # => <Fog::Compute::OpenStack ::Images
92
+ # => <Fog::OpenStack::Compute ::Images
93
93
# filters={},
94
94
# server=nil
95
95
# [
96
- # <Fog::Compute::OpenStack ::Image
96
+ # <Fog::OpenStack::Compute ::Image
97
97
# id="57a67f8a-7bae-4578-b684-b9b4dcd48d7f",
98
98
# ...
99
99
# >
@@ -105,17 +105,17 @@ List available flavors so we can decide how powerful to make this instance:
105
105
106
106
``` ruby
107
107
p compute.flavors
108
- # => <Fog::Compute::OpenStack ::Flavors
108
+ # => <Fog::OpenStack::Compute ::Flavors
109
109
# [
110
- # <Fog::Compute::OpenStack ::Flavor
110
+ # <Fog::OpenStack::Compute ::Flavor
111
111
# id="1",
112
112
# name="m1.tiny",
113
113
# ram=512,
114
114
# disk=1,
115
115
# vcpus=1,
116
116
# ...
117
117
# >,
118
- # <Fog::Compute::OpenStack ::Flavor
118
+ # <Fog::OpenStack::Compute ::Flavor
119
119
# id="2",
120
120
# name="m1.small",
121
121
# ram=2048,
@@ -141,7 +141,7 @@ instance.wait_for { ready? }
141
141
# => {:duration=>17.359134}
142
142
143
143
p instance
144
- # => <Fog::Compute::OpenStack ::Server
144
+ # => <Fog::OpenStack::Compute ::Server
145
145
# id="63633125-26b5-4fe1-a909-0f44d1ab3337",
146
146
# instance_name=nil,
147
147
# addresses={"public"=>[{"OS-EXT-IPS-MAC:mac_addr"=>"fa:16:3e:f4:75:ab", "version"=>4, "addr"=>"1.2.3.4", "OS-EXT-IPS:type"=>"fixed"}]},
@@ -177,11 +177,11 @@ Allow TCP traffic through port 22:
177
177
``` ruby
178
178
security_group = compute.security_groups.create name: " Test SSH" ,
179
179
description: " Allow access to port 22"
180
- # => <Fog::Compute::OpenStack ::SecurityGroup
180
+ # => <Fog::OpenStack::Compute ::SecurityGroup
181
181
# id="e5d53d00-b3f9-471a-b90f-985694b966ed",
182
182
# name="Test SSH",
183
183
# description="Allow access to port 22",
184
- # security_group_rules= <Fog::Compute::OpenStack ::SecurityGroupRules
184
+ # security_group_rules= <Fog::OpenStack::Compute ::SecurityGroupRules
185
185
# [
186
186
187
187
# ]
@@ -196,7 +196,7 @@ compute.security_group_rules.create parent_group_id: security_group.id,
196
196
197
197
key_pair = compute.key_pairs.create name: " My Public Key" ,
198
198
public_key: " /full/path/to/ssh.pub"
199
- # => <Fog::Compute::OpenStack ::KeyPair
199
+ # => <Fog::OpenStack::Compute ::KeyPair
200
200
# name="My Public Key",
201
201
# ...
202
202
# user_id="20746f49211e4037a91269df6a3fbf7b",
@@ -212,7 +212,7 @@ instance = compute.servers.create name: "Test 2",
212
212
flavor_ref: flavor.id,
213
213
key_name: key_pair.name,
214
214
security_groups: security_group
215
- # => <Fog::Compute::OpenStack ::Server
215
+ # => <Fog::OpenStack::Compute ::Server
216
216
# id="e18ebdfb-e5f5-4a45-929f-4cc9926dc2c7",
217
217
# name="Test 2",
218
218
# state="ACTIVE",
@@ -230,7 +230,7 @@ floating_ip_address = compute.addresses.create pool: pool_name
230
230
instance.associate_address floating_ip_address.ip
231
231
232
232
p floating_ip_address
233
- # => <Fog::Compute::OpenStack ::Address
233
+ # => <Fog::OpenStack::Compute ::Address
234
234
# id="54064324-ce7d-448d-9753-94497b29dc91",
235
235
# ip="1.2.3.4",
236
236
# pool="external",
@@ -256,12 +256,12 @@ $ pwd
256
256
Create and attach a volume to a running instance:
257
257
258
258
``` ruby
259
- compute = Fog ::Compute :: OpenStack .new (@connection_params )
259
+ compute = Fog ::OpenStack :: Compute .new (@connection_params )
260
260
261
261
volume = compute.volumes.create name: " Test" ,
262
262
description: " Testing" ,
263
263
size: 1
264
- # => <Fog::Compute::OpenStack ::Volume
264
+ # => <Fog::OpenStack::Compute ::Volume
265
265
# id="4a212986-c6b6-4a93-8319-c6a98e347750",
266
266
# name="Test",
267
267
# description="Testing",
@@ -292,7 +292,7 @@ volume.reload
292
292
compute.snapshots.create volume_id: volume.id,
293
293
name: " test" ,
294
294
description: " test"
295
- # => <Fog::Compute::OpenStack ::Snapshot
295
+ # => <Fog::OpenStack::Compute ::Snapshot
296
296
# id="7a8c9192-25ee-4364-be91-070b7a6d9855",
297
297
# name="test",
298
298
# description="test",
@@ -315,7 +315,7 @@ Download Glance image:
315
315
316
316
``` ruby
317
317
318
- image = Fog ::Image :: OpenStack .new (@connection_params )
318
+ image = Fog ::OpenStack :: Image .new (@connection_params )
319
319
320
320
image_out = File .open (" /tmp/cirros-image-download" , ' wb' )
321
321
@@ -345,7 +345,7 @@ image_handle = image.images.create name: "cirros",
345
345
disk_format: " qcow2" ,
346
346
container_format: " bare"
347
347
348
- # => <Fog::Image::OpenStack ::V2::Image
348
+ # => <Fog::OpenStack::Image ::V2::Image
349
349
# id="67c4d02c-5601-4619-bd14-d2f7f96a046c",
350
350
# name="cirros",
351
351
# visibility="private",
@@ -392,12 +392,12 @@ cirros.destroy
392
392
List domains (Keystone V3 only):
393
393
394
394
``` ruby
395
- identity = Fog ::Identity :: OpenStack .new (@connection_params )
395
+ identity = Fog ::OpenStack :: Identity .new (@connection_params )
396
396
397
397
identity.domains
398
- # => <Fog::Identity::OpenStack ::V3::Domains
398
+ # => <Fog::OpenStack::Identity ::V3::Domains
399
399
# [
400
- # <Fog::Identity::OpenStack ::V3::Domain
400
+ # <Fog::OpenStack::Identity ::V3::Domain
401
401
# id="default",
402
402
# description="",
403
403
# enabled=true,
@@ -411,9 +411,9 @@ List projects (aka tenants):
411
411
412
412
``` ruby
413
413
identity.projects
414
- # => <Fog::Identity::OpenStack ::V3::Projects
414
+ # => <Fog::OpenStack::Identity ::V3::Projects
415
415
# [
416
- # <Fog::Identity::OpenStack ::V3::Project
416
+ # <Fog::OpenStack::Identity ::V3::Project
417
417
# id="008e5537d3424295a03560abc923693c",
418
418
# domain_id="default",
419
419
# description="Project 1",
@@ -425,15 +425,15 @@ identity.projects
425
425
426
426
# On Keystone V2
427
427
identity.tenants
428
- # => <Fog::Identity::OpenStack ::V2::Tenants
428
+ # => <Fog::OpenStack::Identity ::V2::Tenants
429
429
# [ ... ]
430
430
```
431
431
432
432
List users:
433
433
434
434
``` ruby
435
435
identity.users
436
- # => <Fog::Identity::OpenStack ::V3::Users
436
+ # => <Fog::OpenStack::Identity ::V3::Users
437
437
# [ ... ]
438
438
```
439
439
@@ -446,7 +446,7 @@ user = identity.users.create name: "test",
446
446
project_id: project_id,
447
447
448
448
password: " test"
449
- # => <Fog::Identity::OpenStack ::V3::User
449
+ # => <Fog::OpenStack::Identity ::V3::User
450
450
# id="474a59153ebd4e709938e5e9b614dc57",
451
451
# default_project_id=nil,
452
452
# description=nil,
@@ -467,7 +467,7 @@ Create/destroy new tenant:
467
467
468
468
project = identity.projects.create name: " test" ,
469
469
description: " test"
470
- # => <Fog::Identity::OpenStack ::V3::Project
470
+ # => <Fog::OpenStack::Identity ::V3::Project
471
471
# id="423559128a7249f2973cdb7d5d581c4d",
472
472
# domain_id="default",
473
473
# description="test",
@@ -486,7 +486,7 @@ Grant user role on tenant and revoke it:
486
486
487
487
``` ruby
488
488
role = identity.roles.select {|role | role.name == " _member_" }[0 ]
489
- # => <Fog::Identity::OpenStack ::V3::Role
489
+ # => <Fog::OpenStack::Identity ::V3::Role
490
490
# id="9fe2ff9ee4384b1894a90878d3e92bab",
491
491
# name="_member_",
492
492
# >
@@ -502,15 +502,15 @@ Set up a project's public gateway (needed for external access):
502
502
503
503
``` ruby
504
504
505
- identity = Fog ::Identity :: OpenStack .new (@connection_params )
505
+ identity = Fog ::OpenStack :: Identity .new (@connection_params )
506
506
507
507
tenants = identity.projects.select do |project |
508
508
project.name == @connection_params [:openstack_project_name ]
509
509
end
510
510
511
511
tenant_id = tenants[0 ].id
512
512
513
- neutron = Fog ::Network :: OpenStack .new (@connection_params )
513
+ neutron = Fog ::OpenStack :: Network .new (@connection_params )
514
514
515
515
network = neutron.networks.create name: " default" ,
516
516
tenant_id: tenant_id
0 commit comments