ves-io-schema-registration-API-Create

Examples of creating registration

Usecase:

Create r-4b0b5d92-c23e-4cdd-884e-8d48978fecc8

Request using vesctl:

vesctl configuration create registration -i registration.yaml

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

metadata:
  labels:
    host-os-version: coreos-2135-6-0
    hw-model: m5a-xlarge
    hw-serial-number: ec2a5ad2-ffe1-0724-2e18-9a5dbaf8ecf8
    hw-vendor: amazon-ec2
    hw-version: ""
    provider: AWS
  name: r-4b0b5d92-c23e-4cdd-884e-8d48978fecc8
  namespace: documentation
spec:
  infra:
    domain: us-east-2.compute.internal
    hostname: ip-192-168-32-24
    instanceId: i-0a50a70afd761a1a9
    interfaces:
      fabric:
        addr: 192.168.32.24
        name: eth0
        plen: 24
    provider: AWS
    zone: us-east-2
  passport:
    clusterName: ce01
    clusterSize: 1
    clusterType: ce
    customerRoute: 192.168.36.0/24
    latitude: 49.315674
    longitude: 14.248433
    privateDefaultGw: 192.168.33.1
    privateVnPrefix: 192.168.33.0
  token: cc3af983-cb5e-4d97-8cc2-55e367566166

vesctl yaml response:

metadata:
  annotations: {}
  labels:
    host-os-version: coreos-2135-6-0
    hw-model: m5a-xlarge
    hw-serial-number: ec2a5ad2-ffe1-0724-2e18-9a5dbaf8ecf8
    hw-vendor: amazon-ec2
    hw-version: ""
    provider: AWS
  name: r-4b0b5d92-c23e-4cdd-884e-8d48978fecc8
  namespace: documentation
spec:
  infra:
    domain: us-east-2.compute.internal
    hostname: ip-192-168-32-24
    instanceId: i-0a50a70afd761a1a9
    interfaces:
      fabric:
        addr: 192.168.32.24
        name: eth0
        plen: 24
    provider: AWS
    zone: us-east-2
  passport:
    clusterName: ce01
    clusterSize: 1
    clusterType: ce
    customerRoute: 192.168.36.0/24
    latitude: 49.315674
    longitude: 14.248433
    privateDefaultGw: 192.168.33.1
    privateVnPrefix: 192.168.33.0
  token: cc3af983-cb5e-4d97-8cc2-55e367566166
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:41.808607500Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 657f8616-288b-4bdd-9113-7815743a7647

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"r-4b0b5d92-c23e-4cdd-884e-8d48978fecc8","namespace":"documentation","labels":{"host-os-version":"coreos-2135-6-0","hw-model":"m5a-xlarge","hw-serial-number":"ec2a5ad2-ffe1-0724-2e18-9a5dbaf8ecf8","hw-vendor":"amazon-ec2","hw-version":"","provider":"AWS"}},"spec":{"infra":{"provider":"AWS","instanceId":"i-0a50a70afd761a1a9","zone":"us-east-2","hostname":"ip-192-168-32-24","domain":"us-east-2.compute.internal","interfaces":{"fabric":{"addr":"192.168.32.24","plen":24,"name":"eth0"}}},"token":"cc3af983-cb5e-4d97-8cc2-55e367566166","passport":{"clusterName":"ce01","clusterType":"ce","privateDefaultGw":"192.168.33.1","privateVnPrefix":"192.168.33.0","customerRoute":"192.168.36.0/24","latitude":49.315674,"longitude":14.248433,"clusterSize":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/register/namespaces/documentation/registrations'

curl response:

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

{
  "metadata": {
    "name": "r-4b0b5d92-c23e-4cdd-884e-8d48978fecc8",
    "namespace": "documentation",
    "labels": {
      "host-os-version": "coreos-2135-6-0",
      "hw-model": "m5a-xlarge",
      "hw-serial-number": "ec2a5ad2-ffe1-0724-2e18-9a5dbaf8ecf8",
      "hw-vendor": "amazon-ec2",
      "hw-version": "",
      "provider": "AWS"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "657f8616-288b-4bdd-9113-7815743a7647",
    "creation_timestamp": "2020-09-16T10:50:41.808607500Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "infra": {
      "provider": "AWS",
      "instance_id": "i-0a50a70afd761a1a9",
      "zone": "us-east-2",
      "availability_zone": "",
      "hostname": "ip-192-168-32-24",
      "domain": "us-east-2.compute.internal",
      "machine_id": "",
      "interfaces": {
        "fabric": {
          "addr": "192.168.32.24",
          "plen": 24,
          "name": "eth0"
        }
      },
      "hw_info": null,
      "certified_hw": "",
      "internet_proxy": null
    },
    "token": "cc3af983-cb5e-4d97-8cc2-55e367566166",
    "passport": {
      "cluster_name": "ce01",
      "cluster_type": "ce",
      "tenant": "",
      "private_default_gw": "192.168.33.1",
      "private_vn_prefix": "192.168.33.0",
      "customer_route": "192.168.36.0/24",
      "latitude": 49.315674,
      "longitude": 14.248433,
      "cluster_size": 1,
      "vpm_version": ""
    }
  }
}