Sha256: ee3273b372982784287537f780b72ade49b9d7e52cf6732ff7c266ca2a5761ff

Contents?: true

Size: 1.33 KB

Versions: 9

Compression:

Stored size: 1.33 KB

Contents

# encoding: UTF-8

# (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.

# HPCloud security groups
module HPSecurityGroups
  def self.create_sg(oNetwork, name, description)
    params = { :name => name }
    params[:description] = description if description
    oNetwork.security_groups.create(params)
  end

  def self.create_rule(oNetwork, hData)
    oNetwork.security_group_rules.create(hData)
  end

  def self.delete_rule(oNetwork, rule_id)
    oNetwork.security_group_rules.get(rule_id).destroy
  end
end

# HPCloud keypairs
module HPKeyPairs
  def self.get_keypair(oComputeConnect, sId)
    oComputeConnect.key_pairs.get(sId)
  end

  def self.create_keypair(oComputeConnect, name, pubkey)
    oComputeConnect.key_pairs.create(:name => name, :public_key => pubkey)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lorj_cloud-0.1.12 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.11 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.10 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.9 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.8 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.7 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.6 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.5 lib/process/cloud/providers/hpcloud/security_groups.rb
lorj_cloud-0.1.4 lib/process/cloud/providers/hpcloud/security_groups.rb