Skip to content
Start here

Get layer 3 attacks summary by dimension

client.Radar.Attacks.Layer3.SummaryV2(ctx, dimension, query) (*AttackLayer3SummaryV2Response, error)
GET/radar/attacks/layer3/summary/{dimension}

Retrieves the distribution of layer 3 attacks by the specified dimension.

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

Specifies the attribute by which to group the results.

One of the following:
const AttackLayer3SummaryV2ParamsDimensionProtocol AttackLayer3SummaryV2ParamsDimension = "PROTOCOL"
const AttackLayer3SummaryV2ParamsDimensionIPVersion AttackLayer3SummaryV2ParamsDimension = "IP_VERSION"
const AttackLayer3SummaryV2ParamsDimensionVector AttackLayer3SummaryV2ParamsDimension = "VECTOR"
const AttackLayer3SummaryV2ParamsDimensionDuration AttackLayer3SummaryV2ParamsDimension = "DURATION"
const AttackLayer3SummaryV2ParamsDimensionBitrate AttackLayer3SummaryV2ParamsDimension = "BITRATE"
const AttackLayer3SummaryV2ParamsDimensionVertical AttackLayer3SummaryV2ParamsDimension = "VERTICAL"
const AttackLayer3SummaryV2ParamsDimensionIndustry AttackLayer3SummaryV2ParamsDimension = "INDUSTRY"
query AttackLayer3SummaryV2Params
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[AttackLayer3SummaryV2ParamsDirection]Optional

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

const AttackLayer3SummaryV2ParamsDirectionOrigin AttackLayer3SummaryV2ParamsDirection = "ORIGIN"
const AttackLayer3SummaryV2ParamsDirectionTarget AttackLayer3SummaryV2ParamsDirection = "TARGET"
Format param.Field[AttackLayer3SummaryV2ParamsFormat]Optional

Format in which results will be returned.

const AttackLayer3SummaryV2ParamsFormatJson AttackLayer3SummaryV2ParamsFormat = "JSON"
const AttackLayer3SummaryV2ParamsFormatCsv AttackLayer3SummaryV2ParamsFormat = "CSV"
IPVersion param.Field[[]AttackLayer3SummaryV2ParamsIPVersion]Optional

Filters results by IP version (Ipv4 vs. IPv6).

const AttackLayer3SummaryV2ParamsIPVersionIPv4 AttackLayer3SummaryV2ParamsIPVersion = "IPv4"
const AttackLayer3SummaryV2ParamsIPVersionIPv6 AttackLayer3SummaryV2ParamsIPVersion = "IPv6"
LimitPerGroup param.Field[int64]Optional

Limits the number of objects per group to the top items within the specified time range. When item count exceeds the limit, extra items appear grouped under an “other” category.

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[[]AttackLayer3SummaryV2ParamsProtocol]Optional

Filters the results by layer 3/4 protocol.

const AttackLayer3SummaryV2ParamsProtocolUdp AttackLayer3SummaryV2ParamsProtocol = "UDP"
const AttackLayer3SummaryV2ParamsProtocolTCP AttackLayer3SummaryV2ParamsProtocol = "TCP"
const AttackLayer3SummaryV2ParamsProtocolIcmp AttackLayer3SummaryV2ParamsProtocol = "ICMP"
const AttackLayer3SummaryV2ParamsProtocolGRE AttackLayer3SummaryV2ParamsProtocol = "GRE"
ReturnsExpand Collapse
type AttackLayer3SummaryV2Response struct{…}
Meta AttackLayer3SummaryV2ResponseMeta

Metadata for the results.

ConfidenceInfo AttackLayer3SummaryV2ResponseMetaConfidenceInfo
Annotations []AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer3SummaryV2ResponseMetaConfidenceInfoAnnotationsEventType = "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 []AttackLayer3SummaryV2ResponseMetaDateRange
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 AttackLayer3SummaryV2ResponseMetaNormalization

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

One of the following:
const AttackLayer3SummaryV2ResponseMetaNormalizationPercentage AttackLayer3SummaryV2ResponseMetaNormalization = "PERCENTAGE"
const AttackLayer3SummaryV2ResponseMetaNormalizationMin0Max AttackLayer3SummaryV2ResponseMetaNormalization = "MIN0_MAX"
const AttackLayer3SummaryV2ResponseMetaNormalizationMinMax AttackLayer3SummaryV2ResponseMetaNormalization = "MIN_MAX"
const AttackLayer3SummaryV2ResponseMetaNormalizationRawValues AttackLayer3SummaryV2ResponseMetaNormalization = "RAW_VALUES"
const AttackLayer3SummaryV2ResponseMetaNormalizationPercentageChange AttackLayer3SummaryV2ResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer3SummaryV2ResponseMetaNormalizationRollingAverage AttackLayer3SummaryV2ResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer3SummaryV2ResponseMetaNormalizationOverlappedPercentage AttackLayer3SummaryV2ResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer3SummaryV2ResponseMetaNormalizationRatio AttackLayer3SummaryV2ResponseMetaNormalization = "RATIO"
Units []AttackLayer3SummaryV2ResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get layer 3 attacks summary by dimension

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.SummaryV2(
    context.TODO(),
    radar.AttackLayer3SummaryV2ParamsDimensionProtocol,
    radar.AttackLayer3SummaryV2Params{

    },
  )
  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": {
      "TCP": "50.168733",
      "UDP": "25.084366"
    }
  },
  "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": {
      "TCP": "50.168733",
      "UDP": "25.084366"
    }
  },
  "success": true
}