Class: SDM::PeeringGroupPeers
- Inherits:
-
Object
- Object
- SDM::PeeringGroupPeers
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/svc.rb
Overview
PeeringGroupPeers provides the building blocks necessary to link two peering groups.
See PeeringGroupPeer.
Instance Method Summary collapse
-
#create(peering_group_peer, deadline: nil) ⇒ Object
Create links two peering groups.
-
#delete(id, deadline: nil) ⇒ Object
Delete unlinks two peering groups.
-
#get(id, deadline: nil) ⇒ Object
Get reads the information of one peering group link.
-
#initialize(channel, parent) ⇒ PeeringGroupPeers
constructor
A new instance of PeeringGroupPeers.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of peering group links.
Constructor Details
#initialize(channel, parent) ⇒ PeeringGroupPeers
Returns a new instance of PeeringGroupPeers.
3184 3185 3186 3187 3188 3189 3190 3191 |
# File 'lib/svc.rb', line 3184 def initialize(channel, parent) begin @stub = V1::PeeringGroupPeers::Stub.new(nil, nil, channel_override: channel) rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(peering_group_peer, deadline: nil) ⇒ Object
Create links two peering groups.
3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 |
# File 'lib/svc.rb', line 3194 def create( peering_group_peer, deadline: nil ) req = V1::PeeringGroupPeerCreateRequest.new() req.peering_group_peer = Plumbing::convert_peering_group_peer_to_plumbing(peering_group_peer) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("PeeringGroupPeers.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = PeeringGroupPeerCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp.peering_group_peer = Plumbing::convert_peering_group_peer_to_porcelain(plumbing_response.peering_group_peer) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete unlinks two peering groups.
3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 |
# File 'lib/svc.rb', line 3224 def delete( id, deadline: nil ) req = V1::PeeringGroupPeerDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("PeeringGroupPeers.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = PeeringGroupPeerDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads the information of one peering group link.
3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 |
# File 'lib/svc.rb', line 3253 def get( id, deadline: nil ) req = V1::PeeringGroupPeerGetRequest.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.("PeeringGroupPeers.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = PeeringGroupPeerGetResponse.new() resp. = Plumbing::(plumbing_response.) resp.peering_group_peer = Plumbing::convert_peering_group_peer_to_porcelain(plumbing_response.peering_group_peer) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of peering group links.
3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 |
# File 'lib/svc.rb', line 3287 def list( filter, *args, deadline: nil ) req = V1::PeeringGroupPeerListRequest.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.("PeeringGroupPeers.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.peering_group_peers.each do |plumbing_item| g.yield Plumbing::convert_peering_group_peer_to_porcelain(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |