ves-io-schema-operate-usb-CustomPublicAPI-DeleteRules

Examples of performing operate_usb CustomPublicAPI DeleteRules

Usecase:

Delete USB enablement rules

Request:

Request using vesctl:

vesctl request rpc operate_usb.CustomPublicAPI.DeleteRules -i request.yaml --uri /public/namespaces/system/sites/site1/vpm/usb/master-0/rules/delete --http-method POST

where file request.yaml has following contents:

namespace: system
node: master-0
rules:
- idVendor: 05e3
- idProduct: 1d6b
  idVendor: "0003"
site: site1

vesctl yaml response:

rules:
- idVendor: 05e3
- idProduct: 1d6b
  idVendor: "0003"

Request using curl:

curl -X 'POST' -d '{"namespace":"system","site":"site1","node":"master-0","rules":[{"idVendor":"05e3"},{"idVendor":"0003","idProduct":"1d6b"}]}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build823219857_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/operate/namespaces/system/sites/site1/vpm/usb/master-0/rules/delete'

curl response:

HTTP/1.1 200 OK
Content-Length: 375
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:45 GMT
Vary: Accept-Encoding

{
  "rules": [
    {
      "i_serial": "",
      "id_vendor": "05e3",
      "id_product": "",
      "b_device_class": "",
      "b_device_sub_class": "",
      "b_device_protocol": ""
    },
    {
      "i_serial": "",
      "id_vendor": "0003",
      "id_product": "1d6b",
      "b_device_class": "",
      "b_device_sub_class": "",
      "b_device_protocol": ""
    }
  ]
}