Supprimer une règle de réseau
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Supprime une règle de réseau.
Exemple de code
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],[],[],[],null,["# Delete network policy\n\nDeletes a network policy.\n\nCode sample\n-----------\n\n### Python\n\n\nTo authenticate to VMware Engine, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n from google.api_core import operation\n from google.cloud import vmwareengine_v1\n\n\n def delete_network_policy(project_id: str, region: str) -\u003e operation.Operation:\n \"\"\"\n Delete a Network Policy.\n\n Args:\n project_id: name of the project hosting the policy.\n region: name of the region hosting the policy. I.e. \"us-central1\"\n\n Return:\n Operation object. You can use .result() to wait for it to finish.\n \"\"\"\n client = vmwareengine_v1.VmwareEngineClient()\n return client.delete_network_policy(\n name=f\"projects/{project_id}/locations/{region}/networkPolicies/{region}-default\"\n )\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=vmwareengine)."]]