ves-io-schema-network_policy-API-Get

Examples of getting network_policy

Usecase:

Get network-policy-1

Request using vesctl:

vesctl configuration get network_policy network-policy-1 --namespace documentation

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: network-policy-1
  namespace: documentation
object:
  metadata:
    annotations: {}
    labels: {}
    name: network-policy-1
    namespace: documentation
    uid: 574c95ad-2a6d-4606-9755-9029a2e71300
  spec:
    gcSpec:
      egressRules:
      - kind: network_policy_rule
        name: egress-rule-1
        namespace: documentation
        tenant: acmecorp
      forwardingClass: []
      ingressRules:
      - kind: network_policy_rule
        name: ingress-rule-1
        namespace: documentation
        tenant: acmecorp
      prefix:
        prefix:
        - 1.1.1.1/32
  systemMetadata:
    creationTimestamp: "2020-09-23T09:53:39.937495100Z"
    creatorClass: examplesvc
    creatorId: examplesvc
    finalizers: []
    namespace:
    - kind: namespace
      name: documentation
      tenant: acmecorp
    tenant: acmecorp
    traceInfo: 745521adf5308bc7:745521adf5308bc7:0:1
    uid: 574c95ad-2a6d-4606-9755-9029a2e71300
resourceVersion: "462"
spec:
  egressRules:
  - kind: network_policy_rule
    name: egress-rule-1
    namespace: documentation
    tenant: acmecorp
  ingressRules:
  - kind: network_policy_rule
    name: ingress-rule-1
    namespace: documentation
    tenant: acmecorp
  prefix:
    prefix:
    - 1.1.1.1/32
status: []
systemMetadata:
  creationTimestamp: "2020-09-23T09:53:39.937495100Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 574c95ad-2a6d-4606-9755-9029a2e71300

Request using curl:

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

curl response:

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

{
  "object": {
    "metadata": {
      "name": "network-policy-1",
      "namespace": "documentation",
      "uid": "574c95ad-2a6d-4606-9755-9029a2e71300",
      "labels": {
      },
      "annotations": {
      },
      "description": "",
      "disable": false
    },
    "system_metadata": {
      "uid": "574c95ad-2a6d-4606-9755-9029a2e71300",
      "creation_timestamp": "2020-09-23T09:53:39.937495100Z",
      "deletion_timestamp": null,
      "modification_timestamp": null,
      "initializers": null,
      "finalizers": [
      ],
      "tenant": "acmecorp",
      "creator_class": "examplesvc",
      "creator_id": "examplesvc",
      "creator_cookie": "",
      "trace_info": "745521adf5308bc7:745521adf5308bc7:0:1",
      "object_index": 0,
      "namespace": [
        {
          "kind": "namespace",
          "uid": "",
          "tenant": "acmecorp",
          "namespace": "",
          "name": "documentation"
        }
      ],
      "owner_view": null
    },
    "spec": {
      "gc_spec": {
        "prefix": {
          "prefix": [
            "1.1.1.1/32"
          ]
        },
        "ingress_rules": [
          {
            "kind": "network_policy_rule",
            "uid": "",
            "tenant": "acmecorp",
            "namespace": "documentation",
            "name": "ingress-rule-1"
          }
        ],
        "egress_rules": [
          {
            "kind": "network_policy_rule",
            "uid": "",
            "tenant": "acmecorp",
            "namespace": "documentation",
            "name": "egress-rule-1"
          }
        ],
        "forwarding_class": [
        ]
      }
    }
  },
  "create_form": null,
  "replace_form": null,
  "resource_version": "462",
  "metadata": {
    "name": "network-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "574c95ad-2a6d-4606-9755-9029a2e71300",
    "creation_timestamp": "2020-09-23T09:53:39.937495100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "prefix": {
      "prefix": [
        "1.1.1.1/32"
      ]
    },
    "ingress_rules": [
      {
        "kind": "network_policy_rule",
        "uid": "",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "ingress-rule-1"
      }
    ],
    "egress_rules": [
      {
        "kind": "network_policy_rule",
        "uid": "",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "egress-rule-1"
      }
    ]
  },
  "status": [
  ]
}