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.
6199 6200 6201 6202 6203 6204 6205 6206 |
# File 'lib/svc.rb', line 6199 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.
6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 |
# File 'lib/svc.rb', line 6209 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.
6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 |
# File 'lib/svc.rb', line 6318 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.
6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 |
# File 'lib/svc.rb', line 6244 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.
6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 |
# File 'lib/svc.rb', line 6352 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.
6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 |
# File 'lib/svc.rb', line 6283 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 |