{"openapi":"3.0.0","info":{"title":"OVHcloud API specification","description":"Specification for OVHcloud API","version":"1.0","contact":{"name":"OVH","email":"api@ml.ovh.net"}},"servers":[{"url":"https://api.eu.ovhcloud.com/v2"}],"components":{"schemas":{"any":{"description":"Can be anything (text, int, bool, json, html, etc.)","example":"This is a content of any type !"},"duration":{"type":"string","description":"Duration (e.g., P1Y2M3DT4H6M9S)","example":"P1Y2M3DT4H6M9S"},"email":{"type":"string","description":"Email address (e.g., api@ml.ovh.net)","format":"email","example":"api@ml.ovh.net"},"internationalPhoneNumber":{"type":"string","description":"International phone number","format":"phone-number"},"ip":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipBlock":{"type":"string","description":"IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24)","format":"ip-block","example":"192.0.2.0/24"},"ipInterface":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4":{"type":"string","description":"IPv4 address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4Block":{"type":"string","description":"IPv4 CIDR notation (e.g., 192.0.2.0/24)","format":"ipv4-block","example":"192.0.2.0/24"},"ipv6":{"type":"string","description":"IPv6 address (e.g., 2001:41d0:1:1994::1)","format":"ipv6","example":"2001:41d0:1:1994::1"},"ipv6Block":{"type":"string","description":"IPv6 CIDR notation (e.g., 2001:41d0::/128)","format":"ipv6-block","example":"2001:41d0::/128"},"macAddress":{"type":"string","description":"MAC address (e.g., 00:00:5e:00:53:01)","format":"mac-address","example":"00:00:5e:00:53:01"},"networkDefense.RegionEnum":{"type":"string","description":"Representation of a Region","enum":["CA","EU","US"]},"networkDefense.Vac.Event":{"type":"object","description":"DDoS mitigation event. It typically starts when the DDoS detection system sends an alert, and the traffic of the subnet is routed through the mitigation system (VAC).","properties":{"endedAt":{"type":"string","description":"End date of the event. Null when the event is ongoing.","nullable":true,"format":"date-time","readOnly":true},"startedAt":{"type":"string","description":"Start date of the event","format":"date-time","readOnly":true},"subnet":{"allOf":[{"$ref":"#/components/schemas/ipBlock"}],"description":"IP subnet affected by the event","readOnly":true},"vectors":{"type":"array","description":"Attack vector","items":{"$ref":"#/components/schemas/networkDefense.VectorsEnum"},"readOnly":true}}},"networkDefense.Vac.EventsResponse":{"type":"object","description":"List of DDoS mitigation events","properties":{"events":{"type":"array","description":"List of events","nullable":true,"items":{"$ref":"#/components/schemas/networkDefense.Vac.Event"},"readOnly":true}}},"networkDefense.Vac.TrafficResponse":{"type":"object","description":"DDoS mitigation traffic statistics. All arrays have the same length. The Nth item of the dropped or passed arrays matches the Nth timestamp.","properties":{"bps":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.TrafficResponseData"}],"description":"Bits per seconds statistics","readOnly":true},"pps":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.TrafficResponseData"}],"description":"Packets per seconds statistics","readOnly":true},"timestamps":{"type":"array","description":"Timestamps of the statistics points","items":{"type":"string","format":"date-time"},"readOnly":true}}},"networkDefense.Vac.TrafficResponseData":{"type":"object","description":"DDoS mitigation traffic statistics","properties":{"dropped":{"type":"array","description":"Volume of traffic dropped by the VAC (DDoS protection)","items":{"type":"string"},"readOnly":true},"passed":{"type":"array","description":"Volume of traffic which was not dropped by the VAC (DDoS protection)","items":{"type":"string"},"readOnly":true}}},"networkDefense.VectorsEnum":{"type":"string","description":"Network Defense DDoS attack vectors","enum":["CHARGEN","DNS","DNS_TO_OVH","FRAGMENT","ICMP","IP_NULL","NTP","OTHER","TCP_ACK","TCP_FIN","TCP_NULL","TCP_PSH","TCP_RST","TCP_SYN","UDP","VECTOR_TYPE_UNSPECIFIED"]},"phoneNumber":{"type":"string","description":"Phone number","format":"phone-number"},"time":{"type":"string","description":"Time (e.g., 15:04:05)","format":"time","example":"15:04:05"}},"securitySchemes":{"oAuth2AuthCode":{"type":"oauth2","description":"Oauth2","x-client-id":"1bb9c7df371741c0","x-client-secret":"a5b4de870aca620d10fbf63cd18d205b","flows":{"authorizationCode":{"authorizationUrl":"https://auth.eu.ovhcloud.com/oauth2/authorize","tokenUrl":"https://auth.eu.ovhcloud.com/oauth2/token","scopes":{"account/all":"Manage your account","all":"Manage your whole account and all your services","services/all":"Manage your services lifecycle and billing"}}}}}},"paths":{"/networkDefense/vac/event":{"get":{"operationId":"getVacEvents","summary":"List VAC detection events","description":"Returns the detection events of the VAC DDoS protection, with their start and end dates and attack vectors when available. Filter by date range, region or subnet. Ongoing events, not finished, can be requested on their own.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"header","name":"X-Pagination-Cursor","description":"Pagination cursor","schema":{"type":"string"}},{"in":"header","name":"X-Pagination-Size","description":"Pagination size","schema":{"type":"integer"}},{"in":"query","name":"after","description":"Query events which started after the given date","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"before","description":"Query events which ended before the given date","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"ongoingOnly","description":"Query for ongoing events only. If this is set, `after` and `before` parameters are ignored.","schema":{"type":"boolean"}},{"in":"query","name":"region","description":"Query events for the given region","schema":{"$ref":"#/components/schemas/networkDefense.RegionEnum"}},{"in":"query","name":"subnets","description":"Query events for the given subnets","schema":{"type":"array","items":{"$ref":"#/components/schemas/ipBlock"}}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.EventsResponse"}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Observability"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/networkDefense/vac/event\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/networkDefense/vac/event\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:networkDefense/vac/event/get","required":false}]}},"/networkDefense/vac/traffic":{"get":{"operationId":"getVacTraffic","summary":"Get VAC traffic statistics","description":"Returns the traffic dropped and passed by the VAC DDoS protection after a detection event. Request by subnet, IPv4 /32 or IPv6 /64 CIDR, in bits and packets per second, over a date range.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"header","name":"X-Pagination-Cursor","description":"Pagination cursor","schema":{"type":"string"}},{"in":"header","name":"X-Pagination-Size","description":"Pagination size","schema":{"type":"integer"}},{"in":"query","name":"after","description":"Query statistics after the given date","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"before","description":"Query statistics before the given date","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"subnet","description":"Query statistics for the given subnet (currently, only IPv4/32 or IPv6/64 are supported)","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.TrafficResponse"}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Observability"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/v2/networkDefense/vac/traffic\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/v2/networkDefense/vac/traffic\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:networkDefense/vac/traffic/get","required":false}]}}}}
