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
object:
  metadata:
    annotations: {}
    labels: {}
    name: network-policy-rule-1
    namespace: documentation
    uid: 066d8cbc-0ee9-4186-8a2c-7fced8225388
  spec:
    gcSpec:
      action: ALLOW
      labelMatcher:
        keys:
        - app
      ports:
      - "80"
      prefixSelector:
        expressions:
        - app == web
      protocol: tcp
  systemMetadata:
    creationTimestamp: "2020-09-16T10:50:32.950934600Z"
    creatorClass: examplesvc
    creatorId: examplesvc
    finalizers: []
    namespace:
    - kind: namespace
      name: documentation
      tenant: acmecorp
    tenant: acmecorp
    traceInfo: 48f5a323180925a1:48f5a323180925a1:0:1
    uid: 066d8cbc-0ee9-4186-8a2c-7fced8225388
resourceVersion: "425"
spec:
  action: ALLOW
  labelMatcher:
    keys:
    - app
  ports:
  - "80"
  prefixSelector:
    expressions:
    - app == web
  protocol: tcp
status: []
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:32.950934600Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 066d8cbc-0ee9-4186-8a2c-7fced8225388

Request using curl:

curl -X 'GET' -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/network_policy_rules/network-policy-rule-1?response_format=0'

curl response:

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

{
  "object": {
    "metadata": {
      "name": "network-policy-rule-1",
      "namespace": "documentation",
      "uid": "066d8cbc-0ee9-4186-8a2c-7fced8225388",
      "labels": {
      },
      "annotations": {
      },
      "description": "",
      "disable": false
    },
    "system_metadata": {
      "uid": "066d8cbc-0ee9-4186-8a2c-7fced8225388",
      "creation_timestamp": "2020-09-16T10:50:32.950934600Z",
      "deletion_timestamp": null,
      "modification_timestamp": null,
      "initializers": null,
      "finalizers": [
      ],
      "tenant": "acmecorp",
      "creator_class": "examplesvc",
      "creator_id": "examplesvc",
      "creator_cookie": "",
      "trace_info": "48f5a323180925a1:48f5a323180925a1:0:1",
      "object_index": 0,
      "namespace": [
        {
          "kind": "namespace",
          "uid": "",
          "tenant": "acmecorp",
          "namespace": "",
          "name": "documentation"
        }
      ],
      "owner_view": null
    },
    "spec": {
      "gc_spec": {
        "action": "ALLOW",
        "ports": [
          "80"
        ],
        "protocol": "tcp",
        "prefix_selector": {
          "expressions": [
            "app == web"
          ]
        },
        "label_matcher": {
          "keys": [
            "app"
          ]
        },
        "pbr_action": null
      }
    }
  },
  "create_form": null,
  "replace_form": null,
  "resource_version": "425",
  "metadata": {
    "name": "network-policy-rule-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "066d8cbc-0ee9-4186-8a2c-7fced8225388",
    "creation_timestamp": "2020-09-16T10:50:32.950934600Z",
    "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"
      ]
    }
  },
  "status": [
  ]
}