    org.jclouds.ec2.features.SecurityGroupApi
    org.jclouds.net.domain.IpProtocol))
 
-(defn ^SecurityGroupApi
-  sg-service
+(defn ^SecurityGroupApi sg-service
   "Returns the SecurityGroup Api associated with the specified compute
   service."
   [compute]


   e.g. (groups compute :region :us-east-1)"
  [compute & {:keys [region]}]
  (into {} (for [^SecurityGroup group (.describeSecurityGroupsInRegion (sg-service compute)
                                                                       (get-region region)
                                                                       (into-array String '()))]
             [(.getName group) group])))

(defn get-protocol [v]
  "Coerce argument to a IP Protocol."

(defn create-group
  "Creates a new security group.

  e.g. (create-group
         compute \"Database Server\" \"Description for group\"
         :region :us-west-1)"
  [compute name & {:keys [description region]}]
  (.createSecurityGroupInRegion
   (sg-service compute) (get-region region) name (or description name)))

(defn delete-group
  "Deletes a security group.
