Skip to content
Start here

Get ASPA objects snapshot

client.Radar.BGP.RPKI.ASPA.Snapshot(ctx, query) (*BgprpkiaspaSnapshotResponse, error)
GET/radar/bgp/rpki/aspa/snapshot

Retrieves current or historical ASPA (Autonomous System Provider Authorization) objects. ASPA objects define which ASNs are authorized upstream providers for a customer ASN.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
User Details WriteUser Details Read
ParametersExpand Collapse
query BGPRPKIASPASnapshotParams
CustomerASN param.Field[int64]Optional

Filter by customer ASN (the ASN publishing the ASPA object).

Date param.Field[Time]Optional

Filters results by the specified datetime (ISO 8601).

formatdate-time
Format param.Field[BgprpkiaspaSnapshotParamsFormat]Optional

Format in which results will be returned.

const BgprpkiaspaSnapshotParamsFormatJson BgprpkiaspaSnapshotParamsFormat = "JSON"
const BgprpkiaspaSnapshotParamsFormatCsv BgprpkiaspaSnapshotParamsFormat = "CSV"
IncludeASNInfo param.Field[bool]Optional

Include ASN metadata (name, country) in response.

ProviderASN param.Field[int64]Optional

Filter by provider ASN (an authorized upstream provider in ASPA objects).

ReturnsExpand Collapse
type BgprpkiaspaSnapshotResponse struct{…}
ASNInfo BgprpkiaspaSnapshotResponseASNInfo
Number13335 BgprpkiaspaSnapshotResponseASNInfo13335
ASN int64

ASN number.

Country string

Alpha-2 country code.

Name string

AS name.

ASPAObjects []BgprpkiaspaSnapshotResponseASPAObject
CustomerASN int64

The customer ASN publishing the ASPA object.

Providers []int64
Meta BgprpkiaspaSnapshotResponseMeta
DataTime Time

Timestamp of the underlying data.

formatdate-time
QueryTime Time

Timestamp when the query was executed.

formatdate-time
TotalCount int64

Total number of ASPA objects.

Get ASPA objects snapshot

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/radar"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.Radar.BGP.RPKI.ASPA.Snapshot(context.TODO(), radar.BGPRPKIASPASnapshotParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ASNInfo)
}
{
  "result": {
    "asnInfo": {
      "13335": {
        "asn": 0,
        "country": "country",
        "name": "name"
      }
    },
    "aspaObjects": [
      {
        "customerAsn": 0,
        "providers": [
          0
        ]
      }
    ],
    "meta": {
      "dataTime": "2019-12-27T18:11:19.117Z",
      "queryTime": "2019-12-27T18:11:19.117Z",
      "totalCount": 0
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "asnInfo": {
      "13335": {
        "asn": 0,
        "country": "country",
        "name": "name"
      }
    },
    "aspaObjects": [
      {
        "customerAsn": 0,
        "providers": [
          0
        ]
      }
    ],
    "meta": {
      "dataTime": "2019-12-27T18:11:19.117Z",
      "queryTime": "2019-12-27T18:11:19.117Z",
      "totalCount": 0
    }
  },
  "success": true
}