Skip to content
Start here

Magic Network Monitoring

Magic Network MonitoringVPC Flows

Magic Network MonitoringVPC FlowsTokens

Generate authentication token for VPC flow logs export.
client.MagicNetworkMonitoring.VPCFlows.Tokens.New(ctx, body) (*string, error)
POST/accounts/{account_id}/mnm/vpc-flows/token

Magic Network MonitoringConfigs

List account configuration
client.MagicNetworkMonitoring.Configs.Get(ctx, query) (*Configuration, error)
GET/accounts/{account_id}/mnm/config
Create account configuration
client.MagicNetworkMonitoring.Configs.New(ctx, params) (*Configuration, error)
POST/accounts/{account_id}/mnm/config
Update an entire account configuration
client.MagicNetworkMonitoring.Configs.Update(ctx, params) (*Configuration, error)
PUT/accounts/{account_id}/mnm/config
Update account configuration fields
client.MagicNetworkMonitoring.Configs.Edit(ctx, params) (*Configuration, error)
PATCH/accounts/{account_id}/mnm/config
Delete account configuration
client.MagicNetworkMonitoring.Configs.Delete(ctx, body) (*Configuration, error)
DELETE/accounts/{account_id}/mnm/config
ModelsExpand 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.

Magic Network MonitoringConfigsFull

List rules and account configuration
client.MagicNetworkMonitoring.Configs.Full.Get(ctx, query) (*Configuration, error)
GET/accounts/{account_id}/mnm/config/full

Magic Network MonitoringRules

List rules
client.MagicNetworkMonitoring.Rules.List(ctx, query) (*SinglePage[MagicNetworkMonitoringRule], error)
GET/accounts/{account_id}/mnm/rules
Get rule
client.MagicNetworkMonitoring.Rules.Get(ctx, ruleID, query) (*MagicNetworkMonitoringRule, error)
GET/accounts/{account_id}/mnm/rules/{rule_id}
Create rules
client.MagicNetworkMonitoring.Rules.New(ctx, params) (*MagicNetworkMonitoringRule, error)
POST/accounts/{account_id}/mnm/rules
Update rules
client.MagicNetworkMonitoring.Rules.Update(ctx, params) (*MagicNetworkMonitoringRule, error)
PUT/accounts/{account_id}/mnm/rules
Update rule
client.MagicNetworkMonitoring.Rules.Edit(ctx, ruleID, params) (*MagicNetworkMonitoringRule, error)
PATCH/accounts/{account_id}/mnm/rules/{rule_id}
Delete rule
client.MagicNetworkMonitoring.Rules.Delete(ctx, ruleID, body) (*MagicNetworkMonitoringRule, error)
DELETE/accounts/{account_id}/mnm/rules/{rule_id}
ModelsExpand Collapse
type MagicNetworkMonitoringRule struct{…}
AutomaticAdvertisement bool

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

Name string

The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.

Prefixes []string
Type MagicNetworkMonitoringRuleType

MNM rule type.

One of the following:
const MagicNetworkMonitoringRuleTypeThreshold MagicNetworkMonitoringRuleType = "threshold"
const MagicNetworkMonitoringRuleTypeZscore MagicNetworkMonitoringRuleType = "zscore"
const MagicNetworkMonitoringRuleTypeAdvancedDDoS MagicNetworkMonitoringRuleType = "advanced_ddos"
ID stringoptional

The id of the rule. Must be unique.

BandwidthThreshold float64optional

The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

minimum1
Duration MagicNetworkMonitoringRuleDurationoptional

The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].

One of the following:
const MagicNetworkMonitoringRuleDuration1m MagicNetworkMonitoringRuleDuration = "1m"
const MagicNetworkMonitoringRuleDuration5m MagicNetworkMonitoringRuleDuration = "5m"
const MagicNetworkMonitoringRuleDuration10m MagicNetworkMonitoringRuleDuration = "10m"
const MagicNetworkMonitoringRuleDuration15m MagicNetworkMonitoringRuleDuration = "15m"
const MagicNetworkMonitoringRuleDuration20m MagicNetworkMonitoringRuleDuration = "20m"
const MagicNetworkMonitoringRuleDuration30m MagicNetworkMonitoringRuleDuration = "30m"
const MagicNetworkMonitoringRuleDuration45m MagicNetworkMonitoringRuleDuration = "45m"
const MagicNetworkMonitoringRuleDuration60m MagicNetworkMonitoringRuleDuration = "60m"
PacketThreshold float64optional

The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

minimum1
PrefixMatch MagicNetworkMonitoringRulePrefixMatchoptional

Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.

One of the following:
const MagicNetworkMonitoringRulePrefixMatchExact MagicNetworkMonitoringRulePrefixMatch = "exact"
const MagicNetworkMonitoringRulePrefixMatchSubnet MagicNetworkMonitoringRulePrefixMatch = "subnet"
const MagicNetworkMonitoringRulePrefixMatchSupernet MagicNetworkMonitoringRulePrefixMatch = "supernet"
ZscoreSensitivity MagicNetworkMonitoringRuleZscoreSensitivityoptional

Level of sensitivity set for zscore rules.

One of the following:
const MagicNetworkMonitoringRuleZscoreSensitivityLow MagicNetworkMonitoringRuleZscoreSensitivity = "low"
const MagicNetworkMonitoringRuleZscoreSensitivityMedium MagicNetworkMonitoringRuleZscoreSensitivity = "medium"
const MagicNetworkMonitoringRuleZscoreSensitivityHigh MagicNetworkMonitoringRuleZscoreSensitivity = "high"
ZscoreTarget MagicNetworkMonitoringRuleZscoreTargetoptional

Target of the zscore rule analysis.

One of the following:
const MagicNetworkMonitoringRuleZscoreTargetBits MagicNetworkMonitoringRuleZscoreTarget = "bits"
const MagicNetworkMonitoringRuleZscoreTargetPackets MagicNetworkMonitoringRuleZscoreTarget = "packets"

Magic Network MonitoringRulesAdvertisements

Update advertisement for rule
client.MagicNetworkMonitoring.Rules.Advertisements.Edit(ctx, ruleID, params) (*Advertisement, error)
PATCH/accounts/{account_id}/mnm/rules/{rule_id}/advertisement
ModelsExpand Collapse