Skip to content
Start here

List account configuration

client.MagicNetworkMonitoring.Configs.Get(ctx, query) (*Configuration, error)
GET/accounts/{account_id}/mnm/config

Lists default sampling, router IPs and warp devices for account.

Security

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)
Magic Network Monitoring AdminMagic Network Monitoring Config WriteMagic Network Monitoring Config Read
ParametersExpand Collapse
query ConfigGetParams
AccountID param.Field[string]
ReturnsExpand Collapse
type Configuration struct{…}
DefaultSampling float64

Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.

minimum1
Name string

The account name.

RouterIPs []string
WARPDevices []ConfigurationWARPDevice
ID string

Unique identifier for the warp device.

Name string

Name of the warp device.

RouterIP string

IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported.

List account configuration

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/magic_network_monitoring"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  configuration, err := client.MagicNetworkMonitoring.Configs.Get(context.TODO(), magic_network_monitoring.ConfigGetParams{
    AccountID: cloudflare.F("6f91088a406011ed95aed352566e8d4c"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", configuration.DefaultSampling)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "default_sampling": 1,
    "name": "cloudflare user's account",
    "router_ips": [
      "203.0.113.1"
    ],
    "warp_devices": [
      {
        "id": "5360368d-b351-4791-abe1-93550dabd351",
        "name": "My warp device",
        "router_ip": "203.0.113.1"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "default_sampling": 1,
    "name": "cloudflare user's account",
    "router_ips": [
      "203.0.113.1"
    ],
    "warp_devices": [
      {
        "id": "5360368d-b351-4791-abe1-93550dabd351",
        "name": "My warp device",
        "router_ip": "203.0.113.1"
      }
    ]
  },
  "success": true
}