{"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 !"},"common.ResourceStatusEnum":{"type":"string","description":"Current status of a resource","enum":["CREATING","CREATION_PLANNED","DELETING","ERROR","OUT_OF_SYNC","READY","SUSPENDED","UNKNOWN","UPDATING"]},"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"},"iam.ResourceMetadata":{"type":"object","description":"IAM resource metadata embedded in services models","properties":{"displayName":{"type":"string","description":"Resource display name","nullable":true,"readOnly":true},"id":{"type":"string","description":"Unique identifier of the resource","format":"uuid","readOnly":true},"state":{"allOf":[{"$ref":"#/components/schemas/iam.ResourceMetadata.StateEnum"}],"description":"Resource state","nullable":true,"readOnly":true},"tags":{"type":"object","description":"Resource tags. Tags that were internally computed are prefixed with ovh:","nullable":true,"additionalProperties":{"type":"string"},"readOnly":true},"urn":{"type":"string","description":"Unique resource name used in policies","readOnly":true}}},"iam.ResourceMetadata.StateEnum":{"type":"string","description":"Resource state","enum":["EXPIRED","IN_CREATION","OK","SUSPENDED"]},"iam.resource.TagFilter":{"type":"object","description":"Resource tag filter","properties":{"operator":{"allOf":[{"$ref":"#/components/schemas/iam.resource.TagFilter.OperatorEnum"}],"description":"Operator to use in order to filter on the value. Defaults to `EQ`.","nullable":true,"readOnly":true},"value":{"type":"string","description":"Value to use in order to filter tags","readOnly":true}}},"iam.resource.TagFilter.OperatorEnum":{"type":"string","description":"Operator that can be used in order to filter resources tags","enum":["EQ","EXISTS","ILIKE","LIKE","NEQ","NEXISTS"]},"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.Vac.PolicyAsyncAdd":{"type":"object","description":"Fields to create a policy","properties":{"targetSpec":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicySpecInput"}],"description":"Protection configuration to apply to the policy"}},"required":["targetSpec"]},"networkDefense.Vac.PolicyAsyncResource":{"type":"object","description":"A protection policy within a VAC resource. Changes are applied in the background, so its status shows whether the policy is ready or a change is still being applied.","properties":{"checksum":{"type":"string","description":"Checksum of the current configuration, used to detect concurrent changes. Provide it on update to avoid overwriting another change.","readOnly":true},"createdAt":{"type":"string","description":"Date and time the policy was created","format":"date-time","readOnly":true},"currentState":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicyState"}],"description":"Configuration currently being enforced. Null while the policy is still being created (CREATING).","nullable":true,"readOnly":true},"errorMessage":{"type":"string","description":"Details of the last error, set when the status is ERROR","nullable":true,"readOnly":true},"id":{"type":"string","description":"Unique identifier of the policy","format":"uuid","readOnly":true},"resourceStatus":{"allOf":[{"$ref":"#/components/schemas/common.ResourceStatusEnum"}],"description":"Current status of the policy","readOnly":true},"targetSpec":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicySpec"}],"description":"Configuration you requested. While a change is being applied (CREATING, UPDATING or ERROR) it differs from currentState. Once READY it mirrors currentState. Null while the policy is being deleted.","nullable":true,"readOnly":true},"updatedAt":{"type":"string","description":"Date and time the policy was last updated","nullable":true,"format":"date-time","readOnly":true}}},"networkDefense.Vac.PolicyAsyncResourceWithIAM":{"type":"object","description":"A protection policy within a VAC resource. Changes are applied in the background, so its status shows whether the policy is ready or a change is still being applied.","properties":{"checksum":{"type":"string","description":"Checksum of the current configuration, used to detect concurrent changes. Provide it on update to avoid overwriting another change.","readOnly":true},"createdAt":{"type":"string","description":"Date and time the policy was created","format":"date-time","readOnly":true},"currentState":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicyState"}],"description":"Configuration currently being enforced. Null while the policy is still being created (CREATING).","nullable":true,"readOnly":true},"errorMessage":{"type":"string","description":"Details of the last error, set when the status is ERROR","nullable":true,"readOnly":true},"iam":{"allOf":[{"$ref":"#/components/schemas/iam.ResourceMetadata"}],"description":"IAM resource metadata","nullable":true,"readOnly":true},"id":{"type":"string","description":"Unique identifier of the policy","format":"uuid","readOnly":true},"resourceStatus":{"allOf":[{"$ref":"#/components/schemas/common.ResourceStatusEnum"}],"description":"Current status of the policy","readOnly":true},"targetSpec":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicySpec"}],"description":"Configuration you requested. While a change is being applied (CREATING, UPDATING or ERROR) it differs from currentState. Once READY it mirrors currentState. Null while the policy is being deleted.","nullable":true,"readOnly":true},"updatedAt":{"type":"string","description":"Date and time the policy was last updated","nullable":true,"format":"date-time","readOnly":true}}},"networkDefense.Vac.PolicyAsyncUpdate":{"type":"object","description":"Fields to update a policy","properties":{"checksum":{"type":"string","description":"Checksum returned by the last read, used to detect concurrent changes. A stale value is rejected with HTTP 412.","nullable":true},"targetSpec":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PolicySpecInput"}],"description":"Protection configuration to apply to the policy"}},"required":["targetSpec"]},"networkDefense.Vac.PolicySpec":{"type":"object","description":"Protection configuration of a policy: its name, the targets it protects, and the profile and sensitivity enforced on those targets","properties":{"enabled":{"type":"boolean","description":"Whether the policy is active. A disabled policy keeps its configuration but does not protect any traffic.","readOnly":true},"name":{"type":"string","description":"Name of the policy. Renaming it does not change the protection being enforced.","readOnly":true},"profileId":{"type":"string","description":"Identifier of the protection profile, chosen from the available profile catalog","readOnly":true},"sensitivity":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.SensitivityEnum"}],"description":"Protection sensitivity level","readOnly":true},"targets":{"type":"array","description":"The complete set of targets the policy protects, excluding the ones being removed. Only the PREFIX type is available today.","nullable":true,"items":{"$ref":"#/components/schemas/networkDefense.Vac.TargetDefinition"},"readOnly":true}}},"networkDefense.Vac.PolicySpecInput":{"type":"object","description":"Protection configuration to apply to a policy: its name, the targets to protect, and the profile and sensitivity to enforce on them","properties":{"enabled":{"type":"boolean","description":"Whether the policy is active. Defaults to true."},"name":{"type":"string","description":"Name for the policy. Renaming it does not change the protection being enforced."},"profileId":{"type":"string","description":"Identifier of the protection profile, chosen from the available profile catalog"},"sensitivity":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.SensitivityEnum"}],"description":"Protection sensitivity level"},"targets":{"type":"array","description":"The complete set of targets to protect. Every write fully replaces the previous set: omitting this field or sending an empty list removes every target. At most 1000 entries. Changing only the targets is always accepted, even while another change is still being applied.","nullable":true,"items":{"$ref":"#/components/schemas/networkDefense.Vac.TargetDefinition"}}},"required":["name","profileId","sensitivity"]},"networkDefense.Vac.PolicyState":{"type":"object","description":"Protection configuration currently enforced by a policy, including the targets it currently holds, together with the read-only details of the enforced deployment","properties":{"enabled":{"type":"boolean","description":"Whether the policy is active. A disabled policy keeps its configuration but does not protect any traffic.","readOnly":true},"name":{"type":"string","description":"Name of the policy. Renaming it does not change the protection being enforced.","readOnly":true},"profileId":{"type":"string","description":"Identifier of the protection profile, chosen from the available profile catalog","readOnly":true},"profileVersion":{"type":"integer","description":"Version of the enforced configuration, increased each time a change is applied","readOnly":true},"sensitivity":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.SensitivityEnum"}],"description":"Protection sensitivity level","readOnly":true},"serviceId":{"type":"string","description":"Identifier of the VAC resource this policy belongs to","format":"uuid","readOnly":true},"targets":{"type":"array","description":"The targets currently held by the policy, each with the status of every prefix it protects. Also includes the targets removed from the configuration that are still being taken down, so it can list more targets than the configuration does.","nullable":true,"items":{"$ref":"#/components/schemas/networkDefense.Vac.TargetState"},"readOnly":true}}},"networkDefense.Vac.PrefixDefinition":{"type":"object","description":"A PREFIX target: a single IP range in CIDR notation","properties":{"cidr":{"allOf":[{"$ref":"#/components/schemas/ipBlock"}],"description":"CIDR notation, for example `192.0.2.0/24`"}}},"networkDefense.Vac.ResolvedPrefix":{"type":"object","description":"One IP prefix protected by a target, with its current status","properties":{"cidr":{"allOf":[{"$ref":"#/components/schemas/ipBlock"}],"description":"CIDR notation, for example `192.0.2.0/24`","readOnly":true},"status":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.TargetStatusEnum"}],"description":"Current status of this prefix","readOnly":true}}},"networkDefense.Vac.SensitivityEnum":{"type":"string","description":"Protection sensitivity level chosen for a policy. A higher sensitivity means tighter detection thresholds and a more aggressive mitigation profile.","enum":["HIGH","LOW","MEDIUM"]},"networkDefense.Vac.TargetDefinition":{"type":"object","description":"One target declared in a policy's configuration: what the policy protects. A target is identified by its value, not by an identifier. Only the PREFIX type is available today, so the prefix field must be set.","properties":{"prefix":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PrefixDefinition"}],"description":"The IP range for the PREFIX target"}},"required":["prefix"]},"networkDefense.Vac.TargetState":{"type":"object","description":"One target currently held by a policy, with the status of every IP prefix it protects. A target listed here but no longer present in the policy's configuration is being taken down: its prefixes stay DELETING until they are cleared.","properties":{"id":{"type":"string","description":"Read-only target identifier. It is not part of the policy configuration: a target is declared by its value.","format":"uuid","readOnly":true},"prefix":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.PrefixDefinition"}],"description":"The IP range, set when the target type is PREFIX","nullable":true,"readOnly":true},"resolved":{"type":"array","description":"The IP prefixes this target currently protects, each with its status. A PREFIX target always has exactly one entry.","items":{"$ref":"#/components/schemas/networkDefense.Vac.ResolvedPrefix"},"readOnly":true},"type":{"allOf":[{"$ref":"#/components/schemas/networkDefense.Vac.TargetTypeEnum"}],"description":"Type of target, which determines which definition field is set","readOnly":true}}},"networkDefense.Vac.TargetStatusEnum":{"type":"string","description":"Status of a single protected prefix within a policy. Each target protects one or more prefixes, each carrying this status.","enum":["ACTIVE","DELETING","PENDING"]},"networkDefense.Vac.TargetTypeEnum":{"type":"string","description":"Type of a policy target. Only PREFIX (a single CIDR range) is available today. Other types will be added in the future.","enum":["PREFIX"]},"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/resource/{resourceName}/policy":{"get":{"operationId":"getAllVacPolicies","summary":"List VAC policies","description":"Returns the list of policies within a VAC DDoS protection resource. Every policy applies a profile and a sensitivity level to target IP address prefixes, and carries the configuration requested and the one currently enforced.","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":"iamTags","description":"Filter resources on IAM tags","schema":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/iam.resource.TagFilter"}}}},{"in":"path","name":"resourceName","description":"Resource name","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncResourceWithIAM"}}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Configuration@@@10"]],"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/resource/{resourceName}/policy\")\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/resource/{resourceName}/policy\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"vac:apiovh:resource/policy/get","required":true}],"x-expanded-response":"NetworkDefenseVacPolicyAsyncResourceWithIAM"},"post":{"operationId":"createVacPolicy","summary":"Create a VAC policy","description":"Creates a policy within a VAC DDoS protection resource, applying a profile and a sensitivity level to target IP address prefixes in order to tune detection and mitigation rules. Async call, follow resourceStatus for operation progress. A target whose prefix carries protection settings that were not set via a policy is refused, unless you send force=true to overwrite them.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"query","name":"force","description":"Overwrite the protection settings that were not set via a policy on the targets this request adds. Without it, such a request is refused. The previous settings are lost: you cannot restore them yourself. The `force` flag is not stored in the policy spec.","schema":{"type":"boolean"}},{"in":"path","name":"resourceName","description":"Resource name","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncAdd"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncResource"}}}},"400":{"description":"Error 400 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::BadRequest::DuplicateTarget":{"value":{"class":"Client::BadRequest::DuplicateTarget","message":"Target {{.prefix}} is declared more than once."}},"Client::BadRequest::InvalidPrefix":{"value":{"class":"Client::BadRequest::InvalidPrefix","message":"'{{.prefix}}' is not a valid prefix, e.g. 192.0.2.0/24."}},"Client::BadRequest::ProfileDoesNotExist":{"value":{"class":"Client::BadRequest::ProfileDoesNotExist","message":"Profile {{.profileId}} does not exist."}},"Client::BadRequest::ProfileNotAssignable":{"value":{"class":"Client::BadRequest::ProfileNotAssignable","message":"The profile and sensitivity can no longer be assigned. Read the profile again and retry."}},"Client::BadRequest::ProfileRetired":{"value":{"class":"Client::BadRequest::ProfileRetired","message":"Profile {{.profileId}} is retired and cannot be assigned to a policy."}},"Client::BadRequest::RequiredField":{"value":{"class":"Client::BadRequest::RequiredField","message":"Field {{.field}} is required."}},"Client::BadRequest::SensitivityNotDefined":{"value":{"class":"Client::BadRequest::SensitivityNotDefined","message":"Profile {{.profileId}} does not define sensitivity {{.sensitivity}}."}},"Client::BadRequest::TooManyTargets":{"value":{"class":"Client::BadRequest::TooManyTargets","message":"A policy can declare at most {{.maxTargets}} targets."}}}}}},"403":{"description":"Error 403 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Forbidden::DestinationNotAllowed":{"value":{"class":"Client::Forbidden::DestinationNotAllowed","message":"You are not allowed to protect the requested prefixes."}}}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::ServiceDoesNotExist":{"value":{"class":"Client::NotFound::ServiceDoesNotExist","message":"VAC service {{.serviceId}} does not exist."}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::PolicyNameAlreadyExists":{"value":{"class":"Client::Conflict::PolicyNameAlreadyExists","message":"A policy named '{{.name}}' already exists in this VAC service."}},"Client::Conflict::PrefixAlreadyAssigned":{"value":{"class":"Client::Conflict::PrefixAlreadyAssigned","message":"Prefix {{.prefix}} is already protected by another policy."}},"Client::Conflict::QuotaExceeded":{"value":{"class":"Client::Conflict::QuotaExceeded","message":"VAC service {{.serviceId}} already holds the maximum of {{.limit}} policies."}},"Client::Conflict::ResourceBusy":{"value":{"class":"Client::Conflict::ResourceBusy","message":"Resource {{.resourceId}} is being applied or deleted."}},"Client::Conflict::UnmanagedConfiguration":{"value":{"class":"Client::Conflict::UnmanagedConfiguration","message":"Prefixes {{.prefixes}} carry protection settings that were not set via a policy. Retry with force=true to overwrite them."}}}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Configuration@@@30"]],"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\n# Request body type: networkDefense.Vac.PolicyAsyncAdd\nresult = client.post(\"/v2/networkDefense/vac/resource/{resourceName}/policy\",\n\ttargetSpec = None, # Protection configuration to apply to the policy (type: networkDefense.Vac.PolicySpecInput)\n)\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// Request body type: networkDefense.Vac.PolicyAsyncAdd\n$result = $ovh->post(\"/v2/networkDefense/vac/resource/{resourceName}/policy\", array(\n\ttargetSpec => null, // Protection configuration to apply to the policy (type: networkDefense.Vac.PolicySpecInput)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"vac:apiovh:resource/policy/create","required":true},{"name":"ip:apiovh:networkDefense/vac/protect","required":true}]}},"/networkDefense/vac/resource/{resourceName}/policy/{policyId}":{"delete":{"operationId":"deleteVacPolicy","summary":"Delete a VAC policy","description":"Deletes a policy from a VAC DDoS protection resource. All settings of linked target IP address prefixes return to their default states.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"policyId","description":"Policy ID","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"resourceName","description":"Resource name","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncResource"}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::PolicyDoesNotExist":{"value":{"class":"Client::NotFound::PolicyDoesNotExist","message":"Policy {{.policyId}} does not exist."}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::ResourceBusy":{"value":{"class":"Client::Conflict::ResourceBusy","message":"Resource {{.resourceId}} is being applied or deleted."}}}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Configuration@@@50"]],"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.delete(\"/v2/networkDefense/vac/resource/{resourceName}/policy/{policyId}\")\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->delete(\"/v2/networkDefense/vac/resource/{resourceName}/policy/{policyId}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"vac:apiovh:resource/policy/delete","required":true}]},"get":{"operationId":"getVacPolicy","summary":"Get a VAC policy","description":"Returns a policy with the configuration requested and the one currently enforced, including the status of every protected IP address prefix.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"policyId","description":"Policy ID","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"resourceName","description":"Resource name","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncResourceWithIAM"}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::PolicyDoesNotExist":{"value":{"class":"Client::NotFound::PolicyDoesNotExist","message":"Policy {{.policyId}} does not exist."}}}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Configuration@@@20"]],"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/resource/{resourceName}/policy/{policyId}\")\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/resource/{resourceName}/policy/{policyId}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"vac:apiovh:resource/policy/get","required":true}]},"put":{"operationId":"editVacPolicy","summary":"Update a VAC policy","description":"Updates the name, enabled state, targets, profile and sensitivity level of a policy. The targets sent fully replace the previous ones: an omitted or empty list of targets removes every target from the policy. Removed target IPs reset their VAC DDoS protection settings to the default state. Send the checksum from the last read. A stale value is rejected. A new target whose prefix carries protection settings that were not set via a policy is refused, unless you send force=true to overwrite them.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"query","name":"force","description":"Overwrite the protection settings that were not set via a policy on the targets this request adds. Without it, such a request is refused. The previous settings are lost: you cannot restore them yourself. The `force` flag is not stored in the policy spec.","schema":{"type":"boolean"}},{"in":"path","name":"policyId","description":"Policy ID","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"path","name":"resourceName","description":"Resource name","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncUpdate"}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/networkDefense.Vac.PolicyAsyncResource"}}}},"400":{"description":"Error 400 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::BadRequest::DuplicateTarget":{"value":{"class":"Client::BadRequest::DuplicateTarget","message":"Target {{.prefix}} is declared more than once."}},"Client::BadRequest::InvalidPrefix":{"value":{"class":"Client::BadRequest::InvalidPrefix","message":"'{{.prefix}}' is not a valid prefix, e.g. 192.0.2.0/24."}},"Client::BadRequest::ProfileDoesNotExist":{"value":{"class":"Client::BadRequest::ProfileDoesNotExist","message":"Profile {{.profileId}} does not exist."}},"Client::BadRequest::ProfileNotAssignable":{"value":{"class":"Client::BadRequest::ProfileNotAssignable","message":"The profile and sensitivity can no longer be assigned. Read the profile again and retry."}},"Client::BadRequest::ProfileRetired":{"value":{"class":"Client::BadRequest::ProfileRetired","message":"Profile {{.profileId}} is retired and cannot be assigned to a policy."}},"Client::BadRequest::RequiredField":{"value":{"class":"Client::BadRequest::RequiredField","message":"Field {{.field}} is required."}},"Client::BadRequest::SensitivityNotDefined":{"value":{"class":"Client::BadRequest::SensitivityNotDefined","message":"Profile {{.profileId}} does not define sensitivity {{.sensitivity}}."}},"Client::BadRequest::TooManyTargets":{"value":{"class":"Client::BadRequest::TooManyTargets","message":"A policy can declare at most {{.maxTargets}} targets."}}}}}},"403":{"description":"Error 403 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Forbidden::DestinationNotAllowed":{"value":{"class":"Client::Forbidden::DestinationNotAllowed","message":"You are not allowed to protect the requested prefixes."}}}}}},"404":{"description":"Error 404 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::NotFound::PolicyDoesNotExist":{"value":{"class":"Client::NotFound::PolicyDoesNotExist","message":"Policy {{.policyId}} does not exist."}}}}}},"409":{"description":"Error 409 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::Conflict::PolicyNameAlreadyExists":{"value":{"class":"Client::Conflict::PolicyNameAlreadyExists","message":"A policy named '{{.name}}' already exists in this VAC service."}},"Client::Conflict::PrefixAlreadyAssigned":{"value":{"class":"Client::Conflict::PrefixAlreadyAssigned","message":"Prefix {{.prefix}} is already protected by another policy."}},"Client::Conflict::ResourceBusy":{"value":{"class":"Client::Conflict::ResourceBusy","message":"Resource {{.resourceId}} is being applied or deleted."}},"Client::Conflict::TargetAlreadyDeclared":{"value":{"class":"Client::Conflict::TargetAlreadyDeclared","message":"Target {{.prefix}} is already declared on this policy."}},"Client::Conflict::UnmanagedConfiguration":{"value":{"class":"Client::Conflict::UnmanagedConfiguration","message":"Prefixes {{.prefixes}} carry protection settings that were not set via a policy. Retry with force=true to overwrite them."}}}}}},"412":{"description":"Error 412 response","content":{"application/json":{"schema":{"type":"object","description":"Common error model","properties":{"class":{"type":"string","description":"Class of the error"},"message":{"type":"string","description":"Error message"}}},"examples":{"Client::PreconditionFailed::InvalidChecksum":{"value":{"class":"Client::PreconditionFailed::InvalidChecksum","message":"The policy changed since it was read. Get it again and resend the update with its new checksum."}}}}}}},"x-developer-hub-navigation":[["Security","Anti-DDoS","Configuration@@@40"]],"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\n# Request body type: networkDefense.Vac.PolicyAsyncUpdate\nresult = client.put(\"/v2/networkDefense/vac/resource/{resourceName}/policy/{policyId}\",\n\tchecksum = None, # Checksum returned by the last read, used to detect concurrent changes. A stale value is rejected with HTTP 412. (type: string, nullable)\n\ttargetSpec = None, # Protection configuration to apply to the policy (type: networkDefense.Vac.PolicySpecInput)\n)\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// Request body type: networkDefense.Vac.PolicyAsyncUpdate\n$result = $ovh->put(\"/v2/networkDefense/vac/resource/{resourceName}/policy/{policyId}\", array(\n\tchecksum => null, // Checksum returned by the last read, used to detect concurrent changes. A stale value is rejected with HTTP 412. (type: string, nullable)\n\ttargetSpec => null, // Protection configuration to apply to the policy (type: networkDefense.Vac.PolicySpecInput)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"vac:apiovh:resource/policy/edit","required":true},{"name":"ip:apiovh:networkDefense/vac/protect","required":true}]}}}}
