ves-io-schema-advertise_policy-API-Create

Examples of creating advertise_policy

Usecase:

Advertise bookinfo productpage on public network on all volterra regional edge sites. Its advertised as HTTPS. VIP is automatically chosen by the system Public network is available in ves-io/shared

Request using vesctl:

vesctl configuration create advertise_policy -i advertise_policy.yaml

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

metadata:
  name: advertise-on-public
  namespace: documentation
spec:
  port: 443
  protocol: TCP
  tlsParameters:
    commonParams:
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
  where:
    virtualNetwork:
      ref:
      - kind: virtual_network
        name: public
        namespace: shared
        tenant: ves-io

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: advertise-on-public
  namespace: documentation
spec:
  port: 443
  protocol: TCP
  publicIp: []
  tlsParameters:
    commonParams:
      cipherSuites: []
      tlsCertificates:
      - certificateUrl: string:///<Base64>
        privateKey:
          blindfoldSecretInfo:
            location: string:///<Base64>
  where:
    virtualNetwork:
      ref:
      - kind: virtual_network
        name: public
        namespace: shared
        tenant: ves-io
        uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-05-15T10:52:27.149194702Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 1869dd36-5694-4fd2-a7e9-2522e1378b1e

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"advertise-on-public","namespace":"documentation"},"spec":{"where":{"virtualNetwork":{"ref":[{"kind":"virtual_network","tenant":"ves-io","namespace":"shared","name":"public"}]}},"protocol":"TCP","port":443,"tlsParameters":{"commonParams":{"tlsCertificates":[{"certificateUrl":"string:///\u003cBase64\u003e","privateKey":{"blindfoldSecretInfo":{"location":"string:///\u003cBase64\u003e"}}}]}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build144460626_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/advertise_policys'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Fri, 15 May 2020 10:52:27 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "advertise-on-public",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "1869dd36-5694-4fd2-a7e9-2522e1378b1e",
    "creation_timestamp": "2020-05-15T10:52:27.149194702Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "where": {
      "virtual_network": {
        "ref": [
          {
            "kind": "virtual_network",
            "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
            "tenant": "ves-io",
            "namespace": "shared",
            "name": "public"
          }
        ]
      }
    },
    "address": "",
    "public_ip": [
    ],
    "protocol": "TCP",
    "port": 443,
    "tls_parameters": {
      "common_params": {
        "minimum_protocol_version": "TLS_AUTO",
        "maximum_protocol_version": "TLS_AUTO",
        "cipher_suites": [
        ],
        "tls_certificates": [
          {
            "certificate_url": "string:///\u003cBase64\u003e",
            "private_key": {
              "blindfold_secret_info": {
                "decryption_provider": "",
                "store_provider": "",
                "location": "string:///\u003cBase64\u003e"
              },
              "secret_encoding_type": "EncodingNone"
            },
            "description": ""
          }
        ],
        "trusted_ca_url": "",
        "validation_params": null
      },
      "require_client_certificate": false
    },
    "skip_xff_append": false
  }
}

Usecase:

Advertise bookinfo productpage on all sites represented by virtual site acmecrop-vsite1 Its advertised as HTTP on site local network. VIP is automatically chosen by the system

Request using vesctl:

vesctl configuration create advertise_policy -i advertise_policy.yaml

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

metadata:
  name: advertise-on-acmecrop-vsite-1
  namespace: documentation
spec:
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: documentation
        tenant: acmecorp

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: advertise-on-acmecrop-vsite-1
  namespace: documentation
spec:
  publicIp: []
  where:
    virtualSite:
      ref:
      - kind: virtual_site
        name: acmecrop-vsite1
        namespace: documentation
        tenant: acmecorp
        uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-05-15T10:52:27.155360069Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 60ad3f6a-1b60-4d2b-9440-206a68df72b0

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"advertise-on-acmecrop-vsite-1","namespace":"documentation"},"spec":{"where":{"virtualSite":{"ref":[{"kind":"virtual_site","tenant":"acmecorp","namespace":"documentation","name":"acmecrop-vsite1"}]}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build144460626_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/advertise_policys'

curl response:

HTTP/1.1 200 OK
Content-Length: 1115
Content-Type: application/json
Date: Fri, 15 May 2020 10:52:27 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "advertise-on-acmecrop-vsite-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "60ad3f6a-1b60-4d2b-9440-206a68df72b0",
    "creation_timestamp": "2020-05-15T10:52:27.155360069Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "where": {
      "virtual_site": {
        "ref": [
          {
            "kind": "virtual_site",
            "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
            "tenant": "acmecorp",
            "namespace": "documentation",
            "name": "acmecrop-vsite1"
          }
        ],
        "network_type": "VIRTUAL_NETWORK_SITE_LOCAL"
      }
    },
    "address": "",
    "public_ip": [
    ],
    "protocol": "",
    "port": 0,
    "tls_parameters": null,
    "skip_xff_append": false
  }
}