Origin: Is there a restful api to implement the "oc delete all -l <label>" function?

Created on 1 Sep 2016  路  4Comments  路  Source: openshift/origin

Hi,

It look like should delete the resources (pod, rc, route, dc ...) one by one. Is it possible to call a restful api to implement the "oc delete all -l

Thanks.

Version

openshift v3.2.0.20
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5

kinquestion

Most helpful comment

Expanding all to a set of named resources is done client-side.

You can pass a labelSelector to a deletecollection API call like this, rather than listing and deleting one-by-one:

DELETE /api/v1/namespaces/<foo>/pods?labelSelector=key%3Dvalue

All 4 comments

Expanding all to a set of named resources is done client-side.

You can pass a labelSelector to a deletecollection API call like this, rather than listing and deleting one-by-one:

DELETE /api/v1/namespaces/<foo>/pods?labelSelector=key%3Dvalue

@liggitt Ok, I got it, thanks!

@warmchang you can find a full specification for our REST API using Swagger (aka OpenAPI Spec) here: https://github.com/openshift/origin/tree/master/api/swagger-spec

@stevekuznetsov thank you! And can be found by "https://10.2.2.2:8443/swaggerapi/oapi/v1". :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smugcloud picture smugcloud  路  5Comments

ibuler picture ibuler  路  4Comments

thincal picture thincal  路  5Comments

crobby picture crobby  路  4Comments

crobby picture crobby  路  4Comments