Sha256: 54f9f74ab14edee211417e0ca8a467b601a31ce04c552e5d9611ddfff222eab3

Contents?: true

Size: 863 Bytes

Versions: 1

Compression:

Stored size: 863 Bytes

Contents

module Fog
  module Compute
    class Cloudstack

      class Real
        # Creates a security group
        #
        # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.3/root_admin/createSecurityGroup.html]
        def create_security_group(name, options={})
          options.merge!(
            'command' => 'createSecurityGroup', 
            'name' => name  
          )
          request(options)
        end
      end
 
      class Mock
        def create_security_group(options={})
          security_group_id = Fog::Cloudstack.uuid

          security_group = {
            "id" => security_group_id,
          }.merge(options)

          self.data[:security_groups][security_group_id]= security_group
          {"createsecuritygroupresponse" => { "securitygroup" => security_group}}
        end
      end 
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-1.23.0 lib/fog/cloudstack/requests/compute/create_security_group.rb