更新时间:2022-04-18 GMT+08:00
分享

批量删除networkpolicy

功能介绍

This API is used to delete collection of NetworkPolicy

URL

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

参数解释描述该API的参数。

表1 参数解释

参数

是否必选

描述

namespace

Yes

Object name and auth scope, such as for teams and projects.

pretty

No

If 'true', then the output is pretty printed.

body

Yes

-

请求消息

N/A

响应消息

响应参数:

响应参数的详细描述请参见请求参数

响应示例:

{
  "kind": "NetworkPolicyList",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "selfLink": "/apis/extensions/v1beta1/namespaces/default/networkpolicies",
    "resourceVersion": "1105434"
  },
  "items": [
    {
      "metadata": {
        "name": "test111",
        "namespace": "default",
        "selfLink": "/apis/extensions/v1beta1/namespaces/default/networkpolicies/test111",
        "uid": "c4ca7f4e-ed3a-11e8-85b0-fa163e2ce5f0",
        "resourceVersion": "1105348",
        "generation": 1,
        "creationTimestamp": "2018-11-21T03:08:50Z",
        "labels": {
          "app": "nginx"
        }
      },
      "spec": {
        "podSelector": {
          "matchLabels": {
            "app": "nginx"
          }
        },
        "ingress": [
          {
            "ports": [
              {
                "protocol": "TCP",
                "port": 80
              }
            ],
            "from": [
              {
                "namespaceSelector": {
                  "matchLabels": {
                    "project": "default"
                  }
                }
              }
            ]
          }
        ],
        "policyTypes": [
          "Ingress"
        ]
      }
    },
    {
      "metadata": {
        "name": "test222",
        "namespace": "default",
        "selfLink": "/apis/extensions/v1beta1/namespaces/default/networkpolicies/test222",
        "uid": "9017a491-ed3a-11e8-85b0-fa163e2ce5f0",
        "resourceVersion": "1105156",
        "generation": 1,
        "creationTimestamp": "2018-11-21T03:07:21Z",
        "labels": {
          "app": "nginx"
        }
      },
      "spec": {
        "podSelector": {
          "matchLabels": {
            "app": "nginx"
          }
        },
        "ingress": [
          {
            "ports": [
              {
                "protocol": "TCP",
                "port": 80
              }
            ],
            "from": [
              {
                "podSelector": {
                  "matchLabels": {
                    "app": "nginx"
                  }
                }
              }
            ]
          }
        ],
        "policyTypes": [
          "Ingress"
        ]
      }
    }
  ]
}

状态码

状态码描述API的状态码。

表2 状态码

状态码

描述

200

OK

分享:

    相关文档

    相关产品

关闭导读