ves-io-schema-network_policy_rule-API-Get

Examples of getting networkpolicyrule

Usecase:

Get network-policy-rule-1

Request using vesctl:

vesctl configuration get network_policy_rule network-policy-rule-1 --namespace documentation

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: network-policy-rule-1
  namespace: documentation
referringObjects: []
resourceVersion: "637"
spec:
  action: ALLOW
  labelMatcher:
    keys:
    - app
  ports:
  - "80"
  prefixSelector:
    expressions:
    - app == web
  protocol: TCP
status: []
systemMetadata:
  creationTimestamp: "2021-08-25T09:03:35.125796695Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 7fa7e9d5-0f33-4312-8055-4314d3f97473

Request using curl:

curl -X 'GET' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/network_policy_rules/network-policy-rule-1?response_format=0'

curl response:

HTTP/1.1 200 OK
Content-Length: 1007
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:35 GMT
Vary: Accept-Encoding

{
  "object": null,
  "create_form": null,
  "replace_form": null,
  "resource_version": "637",
  "metadata": {
    "name": "network-policy-rule-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7fa7e9d5-0f33-4312-8055-4314d3f97473",
    "creation_timestamp": "2021-08-25T09:03:35.125796695Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "action": "ALLOW",
    "ports": [
      "80"
    ],
    "protocol": "TCP",
    "prefix_selector": {
      "expressions": [
        "app == web"
      ]
    },
    "label_matcher": {
      "keys": [
        "app"
      ]
    },
    "advanced_action": null
  },
  "status": [
  ],
  "referring_objects": [
  ]
}