openstack 3.3.18 → 3.3.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43b99278f1dde6d2c5c9bc125e87691e50aece05
4
- data.tar.gz: 4fa98f1d6fb9f58a7f161490a2b215c5db26a32b
3
+ metadata.gz: 9fda555d633c5827fa57d8d18e092ff7999fa426
4
+ data.tar.gz: 7621452e758b0078515cbe8554df390309711c7b
5
5
  SHA512:
6
- metadata.gz: ec779836098027ff94c51393dd0281eee56dc892d57c3ae7c60dd6f03d0b957bf2283ad15c6a8e24fde5d50414d7ee68ce4c048362312c28f6df0ead9fc5f700
7
- data.tar.gz: 4ffddb1a4c9900848c6116849648ac7fdc51c78147f817acfd7695a683da5dbe0061e78b5a81137e44e55b7797e7351e3266657af6d83a6294ad8ad55312b523
6
+ metadata.gz: f3f376205590a3a4f6f25c061d5dbe61e8ce06d92d94b7b142448da52c4e81043894b646f850fb48ebcb54b28f3ea0c10af7b9b1270af3cf3824db8218bdfe03
7
+ data.tar.gz: '078e426681ac146ae3d923fc4a126e86fdea6c19d5be1d570e1197db4bc01462dfcf927fb49652c1a0a6d772e7640cb177b7f348d4bc7dbb426c9aac26bbd185'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.18
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.18
4
+ version: 3.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Prince