Skip to content
Start here

Get layer 3 attacks by IP version summary

client.Radar.Attacks.Layer3.Summary.IPVersion(ctx, query) (*AttackLayer3SummaryIPVersionResponse, error)
GET/radar/attacks/layer3/summary/ip_version

Retrieves the distribution of layer 3 attacks by IP version.

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 AttackLayer3SummaryIPVersionParams
Continent param.Field[[]string]Optional

Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude continents from results. For example, -EU,NA excludes results from EU, but includes results from NA.

DateEnd param.Field[[]Time]Optional

End of the date range (inclusive).

DateRange param.Field[[]string]Optional

Filters results by date range. For example, use 7d and 7dcontrol to compare this week with the previous week. Use this parameter or set specific start and end dates (dateStart and dateEnd parameters).

DateStart param.Field[[]Time]Optional

Start of the date range.

Direction param.Field[AttackLayer3SummaryIPVersionParamsDirection]Optional

Specifies whether the location filter applies to the source or target location.

const AttackLayer3SummaryIPVersionParamsDirectionOrigin AttackLayer3SummaryIPVersionParamsDirection = "ORIGIN"
const AttackLayer3SummaryIPVersionParamsDirectionTarget AttackLayer3SummaryIPVersionParamsDirection = "TARGET"
Format param.Field[AttackLayer3SummaryIPVersionParamsFormat]Optional

Format in which results will be returned.

const AttackLayer3SummaryIPVersionParamsFormatJson AttackLayer3SummaryIPVersionParamsFormat = "JSON"
const AttackLayer3SummaryIPVersionParamsFormatCsv AttackLayer3SummaryIPVersionParamsFormat = "CSV"
Location param.Field[[]string]Optional

Filters results by location. Specify a comma-separated list of alpha-2 codes. Prefix with - to exclude locations from results. For example, -US,PT excludes results from the US, but includes results from PT.

Name param.Field[[]string]Optional

Array of names used to label the series in the response.

Protocol param.Field[[]AttackLayer3SummaryIPVersionParamsProtocol]Optional

Filters the results by layer 3/4 protocol.

const AttackLayer3SummaryIPVersionParamsProtocolUdp AttackLayer3SummaryIPVersionParamsProtocol = "UDP"
const AttackLayer3SummaryIPVersionParamsProtocolTCP AttackLayer3SummaryIPVersionParamsProtocol = "TCP"
const AttackLayer3SummaryIPVersionParamsProtocolIcmp AttackLayer3SummaryIPVersionParamsProtocol = "ICMP"
const AttackLayer3SummaryIPVersionParamsProtocolGRE AttackLayer3SummaryIPVersionParamsProtocol = "GRE"
ReturnsExpand Collapse
type AttackLayer3SummaryIPVersionResponse struct{…}
Meta AttackLayer3SummaryIPVersionResponseMeta

Metadata for the results.

ConfidenceInfo AttackLayer3SummaryIPVersionResponseMetaConfidenceInfo
Annotations []AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer3SummaryIPVersionResponseMetaConfidenceInfoAnnotationsEventType = "TRAFFIC_ANOMALY"
IsInstantaneous bool

Whether event is a single point in time or a time range.

LinkedURL string
formaturi
StartDate Time
formatdate-time
Tags []stringOptional
Level int64

Provides an indication of how much confidence Cloudflare has in the data.

DateRange []AttackLayer3SummaryIPVersionResponseMetaDateRange
EndTime Time

Adjusted end of date range.

formatdate-time
StartTime Time

Adjusted start of date range.

formatdate-time
LastUpdated Time

Timestamp of the last dataset update.

formatdate-time
Normalization AttackLayer3SummaryIPVersionResponseMetaNormalization

Normalization method applied to the results. Refer to Normalization methods.

One of the following:
const AttackLayer3SummaryIPVersionResponseMetaNormalizationPercentage AttackLayer3SummaryIPVersionResponseMetaNormalization = "PERCENTAGE"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationMin0Max AttackLayer3SummaryIPVersionResponseMetaNormalization = "MIN0_MAX"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationMinMax AttackLayer3SummaryIPVersionResponseMetaNormalization = "MIN_MAX"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationRawValues AttackLayer3SummaryIPVersionResponseMetaNormalization = "RAW_VALUES"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationPercentageChange AttackLayer3SummaryIPVersionResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationRollingAverage AttackLayer3SummaryIPVersionResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationOverlappedPercentage AttackLayer3SummaryIPVersionResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer3SummaryIPVersionResponseMetaNormalizationRatio AttackLayer3SummaryIPVersionResponseMetaNormalization = "RATIO"
Units []AttackLayer3SummaryIPVersionResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 AttackLayer3SummaryIPVersionResponseSummary0
IPv4 string

A numeric string.

IPv6 string

A numeric string.

Get layer 3 attacks by IP version summary

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.Attacks.Layer3.Summary.IPVersion(context.TODO(), radar.AttackLayer3SummaryIPVersionParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "IPv4": "10",
      "IPv6": "10"
    }
  },
  "success": true
}
Returns Examples
{
  "result": {
    "meta": {
      "confidenceInfo": {
        "annotations": [
          {
            "dataSource": "ALL",
            "description": "Cable cut in Tonga",
            "endDate": "2019-12-27T18:11:19.117Z",
            "eventType": "EVENT",
            "isInstantaneous": true,
            "linkedUrl": "https://example.com",
            "startDate": "2019-12-27T18:11:19.117Z",
            "tags": [
              "BOT_CLASS"
            ]
          }
        ],
        "level": 0
      },
      "dateRange": [
        {
          "endTime": "2022-09-17T10:22:57.555Z",
          "startTime": "2022-09-16T10:22:57.555Z"
        }
      ],
      "lastUpdated": "2019-12-27T18:11:19.117Z",
      "normalization": "PERCENTAGE",
      "units": [
        {
          "name": "*",
          "value": "requests"
        }
      ]
    },
    "summary_0": {
      "IPv4": "10",
      "IPv6": "10"
    }
  },
  "success": true
}