mirror of
https://github.com/ipverse/asn-ip.git
synced 2026-05-04 21:13:57 +05:30
107 lines
No EOL
2.3 KiB
Markdown
107 lines
No EOL
2.3 KiB
Markdown
# Migration guide
|
|
|
|
This repository will be renamed from **asn-ip** to **as-ip-blocks**.
|
|
|
|
## Migration steps
|
|
|
|
1. If only consuming plaintext files: just update the download URL, no code changes needed
|
|
2. Update repository URLs in your code from `ipverse/asn-ip` to `ipverse/as-ip-blocks`
|
|
3. If parsing JSON: handle the `metadata` nested object and `subnets` → `prefixes` rename
|
|
|
|
## What's changing
|
|
|
|
### Repository name
|
|
- Old: `ipverse/asn-ip`
|
|
- New: `ipverse/as-ip-blocks`
|
|
|
|
### File structure
|
|
|
|
The file structure remains the same:
|
|
```
|
|
as/1/aggregated.json
|
|
as/1/ipv4-aggregated.txt
|
|
as/1/ipv6-aggregated.txt
|
|
```
|
|
|
|
### JSON format
|
|
|
|
**Old:**
|
|
```json
|
|
{
|
|
"asn": 1,
|
|
"handle": "LVLT-1",
|
|
"description": "Level 3 Parent LLC",
|
|
"subnets": {
|
|
"ipv4": [
|
|
"177.75.88.0/24",
|
|
"177.75.90.0/24"
|
|
],
|
|
"ipv6": []
|
|
}
|
|
}
|
|
```
|
|
|
|
**New:**
|
|
```json
|
|
{
|
|
"asn": 1,
|
|
"metadata": {
|
|
"handle": "LVLT-1",
|
|
"description": "Level 3 Parent LLC",
|
|
"countryCode": "US",
|
|
"country": "United States",
|
|
"origin": "authoritative"
|
|
},
|
|
"prefixes": {
|
|
"ipv4": [
|
|
"177.75.88.0/24",
|
|
"177.75.90.0/24"
|
|
],
|
|
"ipv6": []
|
|
}
|
|
}
|
|
```
|
|
|
|
**Changes:**
|
|
- `subnets` renamed to `prefixes`
|
|
- `handle`, `description` now nested under `metadata` object
|
|
- Added `countryCode` field in metadata (ISO 3166-1 alpha-2 code or `null`)
|
|
- Added `country` field in metadata (country name in English or `null`)
|
|
- Added `origin` field in metadata (values: `authoritative`, `inferred`, `overlaid`, `none`)
|
|
|
|
### Plaintext format
|
|
|
|
The plaintext format remains the same with separate IPv4 and IPv6 files:
|
|
|
|
ipv4-aggregated.txt:
|
|
```
|
|
# AS1 (LVLT-1)
|
|
# Level 3 Parent LLC
|
|
#
|
|
177.75.88.0/24
|
|
177.75.90.0/24
|
|
```
|
|
|
|
ipv6-aggregated.txt:
|
|
```
|
|
# AS1 (LVLT-1)
|
|
# Level 3 Parent LLC
|
|
#
|
|
2a01:1234::/32
|
|
```
|
|
|
|
### URL changes
|
|
|
|
**Old:**
|
|
```
|
|
https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1/aggregated.json
|
|
https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1/ipv4-aggregated.txt
|
|
https://raw.githubusercontent.com/ipverse/asn-ip/master/as/1/ipv6-aggregated.txt
|
|
```
|
|
|
|
**New:**
|
|
```
|
|
https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1/aggregated.json
|
|
https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1/ipv4-aggregated.txt
|
|
https://raw.githubusercontent.com/ipverse/as-ip-blocks/master/as/1/ipv6-aggregated.txt
|
|
``` |