Skip to content
Start here

Get BGP route leak events

client.Radar.BGP.Leaks.Events.List(ctx, query) (*V4PagePagination[BGPLeakEventListResponse], error)
GET/radar/bgp/leaks/events

Retrieves the BGP route leak events.

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 BGPLeakEventListParams
DateEnd param.Field[Time]Optional

End of the date range (inclusive).

formatdate-time
DateRange param.Field[string]Optional

Filters results by date range.

DateStart param.Field[Time]Optional

Start of the date range (inclusive).

formatdate-time
EventID param.Field[int64]Optional

The unique identifier of a event.

Format param.Field[BGPLeakEventListParamsFormat]Optional

Format in which results will be returned.

const BGPLeakEventListParamsFormatJson BGPLeakEventListParamsFormat = "JSON"
const BGPLeakEventListParamsFormatCsv BGPLeakEventListParamsFormat = "CSV"
InvolvedASN param.Field[int64]Optional

ASN that is causing or affected by a route leak event.

InvolvedCountry param.Field[string]Optional

Country code of a involved ASN in a route leak event.

maxLength2
minLength2
LeakASN param.Field[int64]Optional

The leaking AS of a route leak event.

Page param.Field[int64]Optional

Current page number, starting from 1.

exclusiveMinimum
minimum0
PerPage param.Field[int64]Optional

Number of entries per page.

exclusiveMinimum
minimum0
SortBy param.Field[BGPLeakEventListParamsSortBy]Optional

Sorts results by the specified field.

const BGPLeakEventListParamsSortByID BGPLeakEventListParamsSortBy = "ID"
const BGPLeakEventListParamsSortByLeaks BGPLeakEventListParamsSortBy = "LEAKS"
const BGPLeakEventListParamsSortByPeers BGPLeakEventListParamsSortBy = "PEERS"
const BGPLeakEventListParamsSortByPrefixes BGPLeakEventListParamsSortBy = "PREFIXES"
const BGPLeakEventListParamsSortByOrigins BGPLeakEventListParamsSortBy = "ORIGINS"
const BGPLeakEventListParamsSortByTime BGPLeakEventListParamsSortBy = "TIME"
SortOrder param.Field[BGPLeakEventListParamsSortOrder]Optional

Sort order.

const BGPLeakEventListParamsSortOrderAsc BGPLeakEventListParamsSortOrder = "ASC"
const BGPLeakEventListParamsSortOrderDesc BGPLeakEventListParamsSortOrder = "DESC"
ReturnsExpand Collapse
type BGPLeakEventListResponse struct{…}
ASNInfo []BGPLeakEventListResponseASNInfo
ASN int64
CountryCode string
OrgName string
Events []BGPLeakEventListResponseEvent
ID int64
Countries []string
DetectedTs string
Finished bool
LeakASN int64
LeakCount int64
LeakSeg []int64
LeakType int64
MaxTs string
MinTs string
OriginCount int64
PeerCount int64
PrefixCount int64

Get BGP route leak events

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"),
  )
  page, err := client.Radar.BGP.Leaks.Events.List(context.TODO(), radar.BGPLeakEventListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "result": {
    "asn_info": [
      {
        "asn": 0,
        "country_code": "country_code",
        "org_name": "org_name"
      }
    ],
    "events": [
      {
        "id": 0,
        "countries": [
          "string"
        ],
        "detected_ts": "detected_ts",
        "finished": true,
        "leak_asn": 0,
        "leak_count": 0,
        "leak_seg": [
          0
        ],
        "leak_type": 0,
        "max_ts": "max_ts",
        "min_ts": "min_ts",
        "origin_count": 0,
        "peer_count": 0,
        "prefix_count": 0
      }
    ]
  },
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}
Returns Examples
{
  "result": {
    "asn_info": [
      {
        "asn": 0,
        "country_code": "country_code",
        "org_name": "org_name"
      }
    ],
    "events": [
      {
        "id": 0,
        "countries": [
          "string"
        ],
        "detected_ts": "detected_ts",
        "finished": true,
        "leak_asn": 0,
        "leak_count": 0,
        "leak_seg": [
          0
        ],
        "leak_type": 0,
        "max_ts": "max_ts",
        "min_ts": "min_ts",
        "origin_count": 0,
        "peer_count": 0,
        "prefix_count": 0
      }
    ]
  },
  "result_info": {
    "count": 0,
    "page": 0,
    "per_page": 0,
    "total_count": 0
  },
  "success": true
}