Skip to content
Start here

Get layer 7 attacks by HTTP method summary

client.Radar.Attacks.Layer7.Summary.HTTPMethod(ctx, query) (*AttackLayer7SummaryHTTPMethodResponse, error)
GET/radar/attacks/layer7/summary/http_method

Retrieves the distribution of layer 7 attacks by HTTP method.

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 AttackLayer7SummaryHTTPMethodParams
ASN param.Field[[]string]Optional

Filters results by Autonomous System. Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. Prefix with - to exclude ASNs from results. For example, -174, 3356 excludes results from AS174, but includes results from AS3356.

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.

Format param.Field[AttackLayer7SummaryHTTPMethodParamsFormat]Optional

Format in which results will be returned.

const AttackLayer7SummaryHTTPMethodParamsFormatJson AttackLayer7SummaryHTTPMethodParamsFormat = "JSON"
const AttackLayer7SummaryHTTPMethodParamsFormatCsv AttackLayer7SummaryHTTPMethodParamsFormat = "CSV"
HTTPVersion param.Field[[]AttackLayer7SummaryHTTPMethodParamsHTTPVersion]Optional

Filters results by HTTP version.

const AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv1 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv1"
const AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv2 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv2"
const AttackLayer7SummaryHTTPMethodParamsHTTPVersionHttPv3 AttackLayer7SummaryHTTPMethodParamsHTTPVersion = "HTTPv3"
IPVersion param.Field[[]AttackLayer7SummaryHTTPMethodParamsIPVersion]Optional

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

const AttackLayer7SummaryHTTPMethodParamsIPVersionIPv4 AttackLayer7SummaryHTTPMethodParamsIPVersion = "IPv4"
const AttackLayer7SummaryHTTPMethodParamsIPVersionIPv6 AttackLayer7SummaryHTTPMethodParamsIPVersion = "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.

MitigationProduct param.Field[[]AttackLayer7SummaryHTTPMethodParamsMitigationProduct]Optional

Filters the results by layer 7 mitigation product.

const AttackLayer7SummaryHTTPMethodParamsMitigationProductDDoS AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DDOS"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductWAF AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "WAF"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductBotManagement AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "BOT_MANAGEMENT"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductAccessRules AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "ACCESS_RULES"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductIPReputation AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "IP_REPUTATION"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductAPIShield AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "API_SHIELD"
const AttackLayer7SummaryHTTPMethodParamsMitigationProductDataLossPrevention AttackLayer7SummaryHTTPMethodParamsMitigationProduct = "DATA_LOSS_PREVENTION"
Name param.Field[[]string]Optional

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

ReturnsExpand Collapse
type AttackLayer7SummaryHTTPMethodResponse struct{…}
Meta AttackLayer7SummaryHTTPMethodResponseMeta

Metadata for the results.

ConfidenceInfo AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfo
Annotations []AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotation
DataSource AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource

Data source for annotations.

One of the following:
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceAll AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "ALL"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceAIBots AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "AI_BOTS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceAIGateway AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "AI_GATEWAY"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceBGP AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "BGP"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceBots AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "BOTS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceConnectionAnomaly AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "CONNECTION_ANOMALY"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceCT AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "CT"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceDNS AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "DNS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceDNSMagnitude AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_MAGNITUDE"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceDNSAS112 AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "DNS_AS112"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceDos AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "DOS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceEmailRouting AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_ROUTING"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceEmailSecurity AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "EMAIL_SECURITY"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceFw AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "FW"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceFwPg AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "FW_PG"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceHTTP AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceHTTPControl AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CONTROL"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceHTTPCrawlerReferer AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_CRAWLER_REFERER"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceHTTPOrigins AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "HTTP_ORIGINS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceIQI AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "IQI"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceLeakedCredentials AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "LEAKED_CREDENTIALS"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceNet AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "NET"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceRobotsTXT AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "ROBOTS_TXT"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceSpeed AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "SPEED"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSourceWorkersAI AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsDataSource = "WORKERS_AI"
Description string
EndDate Time
formatdate-time
EventType AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType

Event type for annotations.

One of the following:
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypeEvent AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "EVENT"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypeGeneral AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "GENERAL"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypeOutage AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "OUTAGE"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypePartialProjection AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "PARTIAL_PROJECTION"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypePipeline AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "PIPELINE"
const AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventTypeTrafficAnomaly AttackLayer7SummaryHTTPMethodResponseMetaConfidenceInfoAnnotationsEventType = "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 []AttackLayer7SummaryHTTPMethodResponseMetaDateRange
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 AttackLayer7SummaryHTTPMethodResponseMetaNormalization

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

One of the following:
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationPercentage AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "PERCENTAGE"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationMin0Max AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "MIN0_MAX"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationMinMax AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "MIN_MAX"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationRawValues AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "RAW_VALUES"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationPercentageChange AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "PERCENTAGE_CHANGE"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationRollingAverage AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "ROLLING_AVERAGE"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationOverlappedPercentage AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "OVERLAPPED_PERCENTAGE"
const AttackLayer7SummaryHTTPMethodResponseMetaNormalizationRatio AttackLayer7SummaryHTTPMethodResponseMetaNormalization = "RATIO"
Units []AttackLayer7SummaryHTTPMethodResponseMetaUnit

Measurement units for the results.

Name string
Value string
Summary0 map[string, string]

Get layer 7 attacks by HTTP method 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.Layer7.Summary.HTTPMethod(context.TODO(), radar.AttackLayer7SummaryHTTPMethodParams{

  })
  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": {
      "GET": "99.100257",
      "POST": "0.899743"
    }
  },
  "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": {
      "GET": "99.100257",
      "POST": "0.899743"
    }
  },
  "success": true
}