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.
6448 6449 6450 6451 6452 6453 6454 6455 |
# File 'lib/svc.rb', line 6448 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.
6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 |
# File 'lib/svc.rb', line 6458 def create( remote_identity, deadline: nil ) req = V1::RemoteIdentityCreateRequest.new() req.remote_identity = Plumbing::convert_remote_identity_to_plumbing(remote_identity) # Execute before interceptor hooks req = @parent.interceptor.execute_before("RemoteIdentities.Create", self, req) 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("RemoteIdentities.Create", self, req, plumbing_response) 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.
6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 |
# File 'lib/svc.rb', line 6567 def delete( id, deadline: nil ) req = V1::RemoteIdentityDeleteRequest.new() req.id = (id) # Execute before interceptor hooks req = @parent.interceptor.execute_before("RemoteIdentities.Delete", self, req) 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("RemoteIdentities.Delete", self, req, plumbing_response) 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.
6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 |
# File 'lib/svc.rb', line 6493 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) # Execute before interceptor hooks req = @parent.interceptor.execute_before("RemoteIdentities.Get", self, req) 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("RemoteIdentities.Get", self, req, plumbing_response) 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.
6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 |
# File 'lib/svc.rb', line 6601 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.
6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 |
# File 'lib/svc.rb', line 6532 def update( remote_identity, deadline: nil ) req = V1::RemoteIdentityUpdateRequest.new() req.remote_identity = Plumbing::convert_remote_identity_to_plumbing(remote_identity) # Execute before interceptor hooks req = @parent.interceptor.execute_before("RemoteIdentities.Update", self, req) 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 # Execute after interceptor hooks plumbing_response = @parent.interceptor.execute_after("RemoteIdentities.Update", self, req, plumbing_response) 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 |