lib/openstack/compute/server.rb
def add_security_group(security_group)
      data = JSON.generate(:addSecurityGroup => {:name => security_group})
      response = @compute.connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)
      OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
      self.populate
      true
    end
# Adds a specific security group to the server.
#
#   >> server.add_security_group('default')
#   => true
Adds a specific security group to the server.
Adds a specific security group to the server .
def add_security_group(security_group)
      data = JSON.generate(:addSecurityGroup => {:name => security_group})
      response = @compute.connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)
      OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
      self.populate
      true
    end
def add_security_group ( security_group ) data = JSON . generate ( :addSecurityGroup => { :name => security_group } ) response = @compute . connection . csreq ( "POST" , @svrmgmthost , "#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action" , @svrmgmtport , @svrmgmtscheme , { 'content-type' => 'application/json' } , data ) OpenStack :: Exception . raise_exception ( response ) unless response . code . match ( / ^20.$ / ) self . populate true end
Adds a specific security group to the server.
Adds a specific security group to the server .
security_group