openstack 3.3.18 → 3.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/openstack/compute/server.rb +24 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fda555d633c5827fa57d8d18e092ff7999fa426
|
4
|
+
data.tar.gz: 7621452e758b0078515cbe8554df390309711c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3f376205590a3a4f6f25c061d5dbe61e8ce06d92d94b7b142448da52c4e81043894b646f850fb48ebcb54b28f3ea0c10af7b9b1270af3cf3824db8218bdfe03
|
7
|
+
data.tar.gz: '078e426681ac146ae3d923fc4a126e86fdea6c19d5be1d570e1197db4bc01462dfcf927fb49652c1a0a6d772e7640cb177b7f348d4bc7dbb426c9aac26bbd185'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.
|
1
|
+
3.3.19
|
@@ -460,6 +460,30 @@ module Compute
|
|
460
460
|
JSON.parse(response.body)['volumeAttachments']
|
461
461
|
end
|
462
462
|
|
463
|
+
# Adds a specific security group to the server.
|
464
|
+
#
|
465
|
+
# >> server.add_security_group('default')
|
466
|
+
# => true
|
467
|
+
def add_security_group(security_group)
|
468
|
+
data = JSON.generate(:addSecurityGroup => {:name => security_group})
|
469
|
+
response = @compute.connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)
|
470
|
+
OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
|
471
|
+
self.populate
|
472
|
+
true
|
473
|
+
end
|
474
|
+
|
475
|
+
# Removes a specific security group from the server.
|
476
|
+
#
|
477
|
+
# >> server.delete_security_group('default')
|
478
|
+
# => true
|
479
|
+
def delete_security_group(security_group)
|
480
|
+
data = JSON.generate(:removeSecurityGroup => {:name => security_group})
|
481
|
+
response = @compute.connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)
|
482
|
+
OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
|
483
|
+
self.populate
|
484
|
+
true
|
485
|
+
end
|
486
|
+
|
463
487
|
end
|
464
488
|
end
|
465
489
|
end
|