Method: SDM::PeeringGroups#create

Defined in:
lib/svc.rb

#create(peering_group, deadline: nil) ⇒ Object

Create registers a new PeeringGroup.



3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
# File 'lib/svc.rb', line 3841

def create(
  peering_group,
  deadline: nil
)
  req = V1::PeeringGroupCreateRequest.new()

  req.peering_group = Plumbing::convert_peering_group_to_plumbing(peering_group)
  tries = 0
  plumbing_response = nil
  loop do
    begin
      plumbing_response = @stub.create(req, metadata: @parent.("PeeringGroups.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 = PeeringGroupCreateResponse.new()
  resp.meta = Plumbing::(plumbing_response.meta)
  resp.peering_group = Plumbing::convert_peering_group_to_porcelain(plumbing_response.peering_group)
  resp.rate_limit = Plumbing::(plumbing_response.rate_limit)
  resp
end