ves-io-schema-operate-usb-CustomPublicAPI-ListRules

Examples of performing operate_usb CustomPublicAPI ListRules

Usecase:

List USB enablement rules

Request:

Request using vesctl:

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

where file request.yaml has following contents:

namespace: system
node: master-0
site: site1

vesctl yaml response:

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

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/operate/namespaces/system/sites/site1/vpm/usb/master-0/rules?namespace=system&node=master-0&site=site1'

curl response:

HTTP/1.1 200 OK
Content-Length: 375
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:48:55 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": ""
    }
  ]
}