bgpview 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a664513f54fe8ebc782b133c9a7d0740e8a9132aec436ca356279f73bb1abaee
4
- data.tar.gz: 3290ba042a3351ed1c31e5157cb038727113c3783e550ae20c114843f096eb0a
3
+ metadata.gz: 1ff26f2ea9bb2981740614516a47f52b4e52a006e69b544aed399bb815659c54
4
+ data.tar.gz: 5b232102656bea3c8ff39ae2ff404624780965e918f06ac698a6b14b7e76b759
5
5
  SHA512:
6
- metadata.gz: 71ada1c0de7e5469a2cce664710299adf1d78eabfa2c2c3c7029402d14ad3db6be7cffa5e7370d0b4d1856716d77607019221e536e0cbdcdf5c24faa42cbb6cf
7
- data.tar.gz: 6b5a689b6178c635ac343a8483f8a225af46e0689c35f9b82d6b36d8f6938db8f971b32dd20294c523966900aaff4d5ad8e36a39aa61343424e67f6c1d013078
6
+ metadata.gz: 7a810ad30c85f1af5b92a407fd7d2d2d97d689932c56f5f234c2f227e6cfa9f018cf9cacb0513f5d8bef69be781965ef0109de065508aba7930537cc2e4558f4
7
+ data.tar.gz: c0fd44f5ed5d0e86a248947415f030e23932873e2ec18f4f58743d622aebb9df9e47ee4d0fd4f2ff74823ce5965842762c61f6a9b206d5b9fa659bc2299f36d1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bgpview (0.3.0)
4
+ bgpview (0.3.1)
5
5
  httpclient (~> 2.8)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -51,7 +51,7 @@ prefixes.ipv6.map(&:prefix) # => ["2401:c800::/32"]
51
51
 
52
52
  ### ASN Peers
53
53
  ```ruby
54
- peers = as7511.prefixes # BGPView::Peers instance
54
+ peers = as7511.peers # BGPView::Peers instance
55
55
  peers.ipv4 # array of IPv4 peers BGPView::Asn instances
56
56
  peers.ipv6 # array of IPv6 peers BGPView::Asn instances
57
57
  peers.ipv4.map(&:number) # => [7514, 8220, 17676, 45687, 24482, 7517, 4637, 6939, 23815, 64050]
data/lib/bgpview/api.rb CHANGED
@@ -6,7 +6,7 @@ require 'bgpview/error'
6
6
 
7
7
  module BGPView
8
8
  class API
9
- API_BASE_URL = 'https://api.bgpview.io/asn/'
9
+ API_BASE_URL = 'https://api.bgpview.io/'
10
10
 
11
11
  def self.call(url)
12
12
  client = HTTPClient.new
data/lib/bgpview/asn.rb CHANGED
@@ -66,7 +66,7 @@ module BGPView
66
66
  end
67
67
 
68
68
  def call_api
69
- result = BGPView::API.call(@number)
69
+ result = BGPView::API.call("asn/#{@number}")
70
70
  @name = result[:data][:name]
71
71
  @data = result[:data]
72
72
  end
@@ -12,7 +12,7 @@ module BGPView
12
12
  def initialize(number)
13
13
  BGPView::Number.check(number)
14
14
 
15
- downstreams = BGPView::API.call("#{number}/downstreams")
15
+ downstreams = BGPView::API.call("asn/#{number}/downstreams")
16
16
 
17
17
  @ipv4 = extract_as(downstreams, 'ipv4')
18
18
  @ipv6 = extract_as(downstreams, 'ipv6')
data/lib/bgpview/peers.rb CHANGED
@@ -12,7 +12,7 @@ module BGPView
12
12
  def initialize(number)
13
13
  BGPView::Number.check(number)
14
14
 
15
- peers = BGPView::API.call("#{number}/peers")
15
+ peers = BGPView::API.call("asn/#{number}/peers")
16
16
 
17
17
  @ipv4 = extract_as(peers, 'ipv4')
18
18
  @ipv6 = extract_as(peers, 'ipv6')
@@ -13,7 +13,7 @@ module BGPView
13
13
  def initialize(number)
14
14
  BGPView::Number.check(number)
15
15
 
16
- prefixes = BGPView::API.call("#{number}/prefixes")
16
+ prefixes = BGPView::API.call("asn/#{number}/prefixes")
17
17
 
18
18
  @ipv4 = extract_ip(prefixes, 'ipv4')
19
19
  @ipv6 = extract_ip(prefixes, 'ipv6')
@@ -12,7 +12,7 @@ module BGPView
12
12
  def initialize(number)
13
13
  BGPView::Number.check(number)
14
14
 
15
- upstreams = BGPView::API.call("#{number}/upstreams")
15
+ upstreams = BGPView::API.call("asn/#{number}/upstreams")
16
16
 
17
17
  @ipv4 = extract_as(upstreams, 'ipv4')
18
18
  @ipv6 = extract_as(upstreams, 'ipv6')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BGPView
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bgpview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryonkn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-06 00:00:00.000000000 Z
11
+ date: 2019-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler