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.
1883 1884 1885 1886 1887 1888 1889 1890 |
# File 'lib/svc.rb', line 1883 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.
1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 |
# File 'lib/svc.rb', line 1893 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.
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 |
# File 'lib/svc.rb', line 1923 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.
1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 |
# File 'lib/svc.rb', line 1952 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.
1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 |
# File 'lib/svc.rb', line 1986 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 |