批量删除networkpolicy
功能介绍
This API is used to delete collection of NetworkPolicy
URL
DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies
参数解释描述该API的参数。
参数 |
是否必选 |
描述 |
---|---|---|
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" ] } } ] }
