Skip to content
Start here

Update account configuration fields

magic_network_monitoring.configs.edit(ConfigEditParams**kwargs) -> Configuration
PATCH/accounts/{account_id}/mnm/config

Update fields in an existing network monitoring configuration.

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 Write
ParametersExpand Collapse
account_id: str
default_sampling: Optional[float]

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: Optional[str]

The account name.

router_ips: Optional[SequenceNotStr[str]]
warp_devices: Optional[Iterable[WARPDevice]]
id: str

Unique identifier for the warp device.

name: str

Name of the warp device.

router_ip: str

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

ReturnsExpand Collapse
class Configuration:
default_sampling: float

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: str

The account name.

router_ips: List[str]
warp_devices: List[WARPDevice]
id: str

Unique identifier for the warp device.

name: str

Name of the warp device.

router_ip: str

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

Update account configuration fields

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
configuration = client.magic_network_monitoring.configs.edit(
    account_id="6f91088a406011ed95aed352566e8d4c",
)
print(configuration.default_sampling)
{
  "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
}