ves-io-schema-forwarding_class-API-Create

Examples of creating forwarding_class

Usecase:

Create forwarding-class-1, that sends traffic on interfaces with priority 1,2 and apply policer-1

Request using vesctl:

vesctl configuration create forwarding_class -i forwarding_class.yaml

where file forwardingclass.yaml has following contents (forwardingclass.CreateRequest):

metadata:
  name: forwarding-class-1
  namespace: documentation
spec:
  dscpBasedQueue: {}
  interfaceGroup: INTERFACE_GROUP1
  noMarking: {}
  policer:
    name: policer-1
    namespace: documentation

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: forwarding-class-1
  namespace: documentation
spec:
  dscpBasedQueue: {}
  interfaceGroup: INTERFACE_GROUP1
  noMarking: {}
  policer:
    name: policer-1
    namespace: documentation
    tenant: acmecorp
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:14.211854100Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 432b0081-142d-43ba-8eca-323a16ce25b0

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"forwarding-class-1","namespace":"documentation"},"spec":{"interfaceGroup":"INTERFACE_GROUP1","noMarking":{},"dscpBasedQueue":{},"policer":{"namespace":"documentation","name":"policer-1"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/forwarding_classs'

curl response:

HTTP/1.1 200 OK
Content-Length: 820
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:14 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "forwarding-class-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "432b0081-142d-43ba-8eca-323a16ce25b0",
    "creation_timestamp": "2020-09-16T10:50:14.211854100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "interface_group": "INTERFACE_GROUP1",
    "no_marking": {

    },
    "dscp_based_queue": {

    },
    "policer": {
      "tenant": "acmecorp",
      "namespace": "documentation",
      "name": "policer-1"
    }
  }
}