Class: Hpe3parSdk::QOSManager
- Inherits:
-
Object
- Object
- Hpe3parSdk::QOSManager
- Defined in:
- lib/Hpe3parSdk/qos_manager.rb
Instance Method Summary collapse
- #create_qos_rules(target_name, qos_rules, target_type) ⇒ Object
- #delete_qos_rules(target_name, target_type) ⇒ Object
-
#initialize(http) ⇒ QOSManager
constructor
A new instance of QOSManager.
- #modify_qos_rules(target_name, qos_rules, target_type) ⇒ Object
- #qos_rule_exists?(target_name, target_type) ⇒ Boolean
- #query_qos_rule(target_name, target_type) ⇒ Object
- #query_qos_rules ⇒ Object
Constructor Details
#initialize(http) ⇒ QOSManager
Returns a new instance of QOSManager.
17 18 19 |
# File 'lib/Hpe3parSdk/qos_manager.rb', line 17 def initialize(http) @http = http end |
Instance Method Details
#create_qos_rules(target_name, qos_rules, target_type) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/Hpe3parSdk/qos_manager.rb', line 44 def create_qos_rules(target_name, qos_rules, target_type) info = { 'name' => target_name, 'type' => target_type } info = Util.merge_hash(info, qos_rules) response = @http.post('/qos', body: info) response[1] end |
#delete_qos_rules(target_name, target_type) ⇒ Object
59 60 61 62 |
# File 'lib/Hpe3parSdk/qos_manager.rb', line 59 def delete_qos_rules(target_name, target_type) response = @http.delete("/qos/#{target_type}:#{target_name}") response[1] end |
#modify_qos_rules(target_name, qos_rules, target_type) ⇒ Object
54 55 56 57 |
# File 'lib/Hpe3parSdk/qos_manager.rb', line 54 def modify_qos_rules(target_name, qos_rules, target_type) response = @http.put("/qos/#{target_type}:#{target_name}", body: qos_rules) response end |
#qos_rule_exists?(target_name, target_type) ⇒ Boolean
35 36 37 38 39 40 41 42 |
# File 'lib/Hpe3parSdk/qos_manager.rb', line 35 def qos_rule_exists?(target_name, target_type) begin query_qos_rule(target_name, target_type) return true rescue Hpe3parSdk::HTTPNotFound => ex return false end end |