# Configs ## List account configuration `client.magicNetworkMonitoring.configs.get(ConfigGetParamsparams, RequestOptionsoptions?): Configuration` **get** `/accounts/{account_id}/mnm/config` Lists default sampling, router IPs and warp devices for account. ### Parameters - `params: ConfigGetParams` - `account_id: string` ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.get({ account_id: '6f91088a406011ed95aed352566e8d4c', }); console.log(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 `client.magicNetworkMonitoring.configs.create(ConfigCreateParamsparams, RequestOptionsoptions?): Configuration` **post** `/accounts/{account_id}/mnm/config` Create a new network monitoring configuration. ### Parameters - `params: ConfigCreateParams` - `account_id: string` Path param - `default_sampling: number` Body param: Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` Body param: The account name. - `router_ips?: Array` Body param - `warp_devices?: Array` Body param - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.create({ account_id: '6f91088a406011ed95aed352566e8d4c', default_sampling: 1, name: "cloudflare user's account", }); console.log(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 `client.magicNetworkMonitoring.configs.update(ConfigUpdateParamsparams, RequestOptionsoptions?): Configuration` **put** `/accounts/{account_id}/mnm/config` Update an existing network monitoring configuration, requires the entire configuration to be updated at once. ### Parameters - `params: ConfigUpdateParams` - `account_id: string` Path param - `default_sampling: number` Body param: Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` Body param: The account name. - `router_ips?: Array` Body param - `warp_devices?: Array` Body param - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.update({ account_id: '6f91088a406011ed95aed352566e8d4c', default_sampling: 1, name: "cloudflare user's account", }); console.log(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 `client.magicNetworkMonitoring.configs.edit(ConfigEditParamsparams, RequestOptionsoptions?): Configuration` **patch** `/accounts/{account_id}/mnm/config` Update fields in an existing network monitoring configuration. ### Parameters - `params: ConfigEditParams` - `account_id: string` Path param - `default_sampling?: number` Body param: Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name?: string` Body param: The account name. - `router_ips?: Array` Body param - `warp_devices?: Array` Body param - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.edit({ account_id: '6f91088a406011ed95aed352566e8d4c', }); console.log(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 `client.magicNetworkMonitoring.configs.delete(ConfigDeleteParamsparams, RequestOptionsoptions?): Configuration` **delete** `/accounts/{account_id}/mnm/config` Delete an existing network monitoring configuration. ### Parameters - `params: ConfigDeleteParams` - `account_id: string` ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.delete({ account_id: '6f91088a406011ed95aed352566e8d4c', }); console.log(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 - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` 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 `client.magicNetworkMonitoring.configs.full.get(FullGetParamsparams, RequestOptionsoptions?): Configuration` **get** `/accounts/{account_id}/mnm/config/full` Lists default sampling, router IPs, warp devices, and rules for account. ### Parameters - `params: FullGetParams` - `account_id: string` ### Returns - `Configuration` - `default_sampling: number` Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. - `name: string` The account name. - `router_ips: Array` - `warp_devices: Array` - `id: string` Unique identifier for the warp device. - `name: string` Name of the warp device. - `router_ip: string` IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted }); const configuration = await client.magicNetworkMonitoring.configs.full.get({ account_id: '6f91088a406011ed95aed352566e8d4c', }); console.log(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 } ```