Class: SDM::RemoteIdentities
- Inherits:
-
Object
- Object
- SDM::RemoteIdentities
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
RemoteIdentities assign a resource directly to an account, giving the account the permission to connect to that resource.
See RemoteIdentity.
Instance Method Summary collapse
-
#create(remote_identity, deadline: nil) ⇒ Object
Create registers a new RemoteIdentity.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a RemoteIdentity by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one RemoteIdentity by ID.
-
#initialize(channel, parent) ⇒ RemoteIdentities
constructor
A new instance of RemoteIdentities.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of RemoteIdentities matching a given set of criteria.
-
#update(remote_identity, deadline: nil) ⇒ Object
Update replaces all the fields of a RemoteIdentity by ID.
Constructor Details
#initialize(channel, parent) ⇒ RemoteIdentities
Returns a new instance of RemoteIdentities.
5535 5536 5537 5538 5539 5540 5541 5542 |
# File 'lib/svc.rb', line 5535 def initialize(channel, parent) begin @stub = V1::RemoteIdentities::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(remote_identity, deadline: nil) ⇒ Object
Create registers a new RemoteIdentity.
5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 |
# File 'lib/svc.rb', line 5545 def create( remote_identity, deadline: nil ) req = V1::RemoteIdentityCreateRequest.new() req.remote_identity = Plumbing::convert_remote_identity_to_plumbing(remote_identity) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("RemoteIdentities.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RemoteIdentityCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.remote_identity = Plumbing::convert_remote_identity_to_porcelain(plumbing_response.remote_identity) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a RemoteIdentity by ID.
5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 |
# File 'lib/svc.rb', line 5639 def delete( id, deadline: nil ) req = V1::RemoteIdentityDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("RemoteIdentities.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RemoteIdentityDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one RemoteIdentity by ID.
5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 |
# File 'lib/svc.rb', line 5575 def get( id, deadline: nil ) req = V1::RemoteIdentityGetRequest.new() if not @parent.snapshot_time.nil? req. = V1::GetRequestMetadata.new() req..snapshot_at = @parent.snapshot_time end req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("RemoteIdentities.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RemoteIdentityGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.remote_identity = Plumbing::convert_remote_identity_to_porcelain(plumbing_response.remote_identity) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of RemoteIdentities matching a given set of criteria.
5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 |
# File 'lib/svc.rb', line 5668 def list( filter, *args, deadline: nil ) req = V1::RemoteIdentityListRequest.new() req. = V1::ListRequestMetadata.new() if not @parent.page_limit.nil? 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.("RemoteIdentities.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response.remote_identities.each do |plumbing_item| g.yield Plumbing::convert_remote_identity_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |
#update(remote_identity, deadline: nil) ⇒ Object
Update replaces all the fields of a RemoteIdentity by ID.
5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 |
# File 'lib/svc.rb', line 5609 def update( remote_identity, deadline: nil ) req = V1::RemoteIdentityUpdateRequest.new() req.remote_identity = Plumbing::convert_remote_identity_to_plumbing(remote_identity) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.update(req, metadata: @parent.("RemoteIdentities.Update", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception, deadline)) tries + +sleep(@parent.exponentialBackoff(tries, deadline)) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RemoteIdentityUpdateResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp.remote_identity = Plumbing::convert_remote_identity_to_porcelain(plumbing_response.remote_identity) resp end |