Class: SDM::RoleResources
- Inherits:
-
Object
- Object
- SDM::RoleResources
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
RoleResources enumerates the resources to which roles have access. The RoleResources service is read-only.
See RoleResource.
Instance Method Summary collapse
-
#initialize(channel, parent) ⇒ RoleResources
constructor
A new instance of RoleResources.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of RoleResource records matching a given set of criteria.
Constructor Details
#initialize(channel, parent) ⇒ RoleResources
Returns a new instance of RoleResources.
4017 4018 4019 4020 4021 4022 4023 4024 |
# File 'lib/svc.rb', line 4017 def initialize(channel, parent) begin @stub = V1::RoleResources::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 RoleResource records matching a given set of criteria.
4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 |
# File 'lib/svc.rb', line 4027 def list( filter, *args, deadline: nil ) req = V1::RoleResourceListRequest.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.("RoleResources.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.role_resources.each do |plumbing_item| g.yield Plumbing::convert_role_resource_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |