Class: SDM::ResourcesHistory
- Inherits:
-
Object
- Object
- SDM::ResourcesHistory
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
ResourcesHistory records all changes to the state of a Resource.
See ResourceHistory.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ ResourcesHistory
constructor
A new instance of ResourcesHistory.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of ResourceHistory records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ ResourcesHistory
5377 5378 5379 5380 5381 5382 5383 5384 |
# File 'lib/svc.rb', line 5377 def initialize(channel, parent) begin @stub = V1::ResourcesHistory::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of ResourceHistory records matching a given set of criteria.
5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 |
# File 'lib/svc.rb', line 5387 def list( filter, *args, deadline: nil ) req = V1::ResourceHistoryListRequest.new() req. = V1::ListRequestMetadata.new() if @parent.page_limit > 0 req..limit = @parent.page_limit end if not @parent.snapshot_time.nil? req..snapshot_at = @parent.snapshot_time end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("ResourcesHistory.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.history.each do |plumbing_item| g.yield Plumbing::convert_resource_history_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |