# Configs ## List account configuration `magic_network_monitoring.configs.get(ConfigGetParams**kwargs) -> Configuration` **get** `/accounts/{account_id}/mnm/config` Lists default sampling, router IPs and warp devices for account. ### Parameters - `account_id: str` ### Returns - `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. - `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. ### Example ```python 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.get( account_id="6f91088a406011ed95aed352566e8d4c", ) print(configuration.default_sampling) ``` #### Response ```json { "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 } ``` ## Create account configuration `magic_network_monitoring.configs.create(ConfigCreateParams**kwargs) -> Configuration` **post** `/accounts/{account_id}/mnm/config` Create a new network monitoring configuration. ### Parameters - `account_id: str` - `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. - `name: 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. ### Returns - `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. - `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. ### Example ```python 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.create( account_id="6f91088a406011ed95aed352566e8d4c", default_sampling=1, name="cloudflare user's account", ) print(configuration.default_sampling) ``` #### Response ```json { "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 } ``` ## Update an entire account configuration `magic_network_monitoring.configs.update(ConfigUpdateParams**kwargs) -> Configuration` **put** `/accounts/{account_id}/mnm/config` Update an existing network monitoring configuration, requires the entire configuration to be updated at once. ### Parameters - `account_id: str` - `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. - `name: 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. ### Returns - `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. - `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. ### Example ```python 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.update( account_id="6f91088a406011ed95aed352566e8d4c", default_sampling=1, name="cloudflare user's account", ) print(configuration.default_sampling) ``` #### Response ```json { "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 } ``` ## 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. ### Parameters - `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. - `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. ### Returns - `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. - `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. ### Example ```python 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) ``` #### Response ```json { "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 } ``` ## Delete account configuration `magic_network_monitoring.configs.delete(ConfigDeleteParams**kwargs) -> Configuration` **delete** `/accounts/{account_id}/mnm/config` Delete an existing network monitoring configuration. ### Parameters - `account_id: str` ### Returns - `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. - `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. ### Example ```python 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.delete( account_id="6f91088a406011ed95aed352566e8d4c", ) print(configuration.default_sampling) ``` #### Response ```json { "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 } ``` ## Domain Types ### Configuration - `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. - `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. # Full ## List rules and account configuration `magic_network_monitoring.configs.full.get(FullGetParams**kwargs) -> Configuration` **get** `/accounts/{account_id}/mnm/config/full` Lists default sampling, router IPs, warp devices, and rules for account. ### Parameters - `account_id: str` ### Returns - `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. - `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. ### Example ```python 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.full.get( account_id="6f91088a406011ed95aed352566e8d4c", ) print(configuration.default_sampling) ``` #### Response ```json { "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 } ```