Method: HPE3PAR_API#create_qos_rules

Defined in:
lib/puppet/util/hpe3par_api.rb

#create_qos_rules(target_name, target_type, priority = nil, bwMinGoalKB = nil, bwMaxLimitKB = nil, ioMinGoal = nil, ioMaxLimit = nil, bwMinGoalOP = nil, bwMaxLimitOP = nil, ioMinGoalOP = nil, ioMaxLimitOP = nil, latencyGoal = nil, defaultLatency = nil, enable = nil, latencyGoaluSecs = nil, debug = false) ⇒ Object



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/puppet/util/hpe3par_api.rb', line 225

def create_qos_rules(target_name, target_type, priority = nil, bwMinGoalKB = nil,
                     bwMaxLimitKB = nil, ioMinGoal= nil, ioMaxLimit = nil, bwMinGoalOP = nil,
                     bwMaxLimitOP = nil, ioMinGoalOP = nil, ioMaxLimitOP = nil, latencyGoal = nil,
                     defaultLatency = nil, enable = nil, latencyGoaluSecs = nil, debug = false)

  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
  begin
    qos_rules = {
        :bwMinGoalKB => bwMinGoalKB,
        :bwMaxLimitKB => bwMaxLimitKB,
        :ioMinGoal => ioMinGoal,
        :ioMaxLimit => ioMaxLimit,
        :latencyGoal => latencyGoal,
        :defaultLatency => defaultLatency,
        :enable => enable,
        :latencyGoaluSecs => latencyGoaluSecs
    }
    unless priority.nil?
      qos_rules[:priority] = Hpe3parSdk::QoSpriorityEnumeration.const_get(priority)
    end

    unless bwMinGoalOP.nil?
      qos_rules[:bwMinGoalOP] = Hpe3parSdk::QosZeroNoneOperation.const_get(bwMinGoalOP)
    end

    unless bwMaxLimitOP.nil?
      qos_rules[:bwMaxLimitOP] = Hpe3parSdk::QosZeroNoneOperation.const_get(bwMaxLimitOP)
    end
    unless ioMinGoalOP.nil?
      qos_rules[:ioMinGoalOP] = Hpe3parSdk::QosZeroNoneOperation.const_get(ioMinGoalOP)
    end
    unless ioMaxLimitOP.nil?
      qos_rules[:ioMaxLimitOP] = Hpe3parSdk::QosZeroNoneOperation.const_get(ioMaxLimitOP)
    end
    cl.(@url.user, @url.password)
    cl.create_qos_rules(target_name, qos_rules, target_type = Hpe3parSdk::QoStargetType.const_get(target_type))
  ensure
    cl.logout
  end
end