ves-io-schema-registration-CustomAPI-RegistrationCreate

Examples of performing registration CustomAPI RegistrationCreate

Usecase:

Creates new registration

Request:

Request using vesctl:

vesctl request rpc registration.CustomAPI.RegistrationCreate -i request.yaml --uri /public/registerBootstrap --http-method POST

where file request.yaml has following contents:

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:
    tu-generated: "yes"
  labels:
    abc: def
  name: reg-3361aa03-2bd4-4629-8233-44f9f70c137b
  namespace: system
  uid: 3361aa03-2bd4-4629-8233-44f9f70c137b
spec:
  gcSpec:
    infra:
      interfaces: {}
    passport:
      clusterName: cinta
      clusterSize: 1
      clusterType: ce
      latitude: 49.315674
      longitude: 14.248433
    role: []
    site: []
    token: abc123
status:
  currentState: APPROVED
systemMetadata:
  finalizers: []
  namespace: []
  tenant: customer1
  uid: 3361aa03-2bd4-4629-8233-44f9f70c137b

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/registerBootstrap'

curl response:

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

{
  "metadata": {
    "name": "reg-3361aa03-2bd4-4629-8233-44f9f70c137b",
    "namespace": "system",
    "uid": "3361aa03-2bd4-4629-8233-44f9f70c137b",
    "labels": {
      "abc": "def"
    },
    "annotations": {
      "tu-generated": "yes"
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3361aa03-2bd4-4629-8233-44f9f70c137b",
    "creation_timestamp": null,
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "customer1",
    "creator_class": "",
    "creator_id": "",
    "creator_cookie": "",
    "trace_info": "",
    "object_index": 0,
    "namespace": [
    ],
    "owner_view": null
  },
  "spec": {
    "gc_spec": {
      "infra": {
        "provider": "UNKNOWN",
        "instance_id": "",
        "zone": "",
        "availability_zone": "",
        "hostname": "",
        "domain": "",
        "machine_id": "",
        "interfaces": {
        },
        "hw_info": null,
        "certified_hw": "",
        "internet_proxy": null
      },
      "token": "abc123",
      "passport": {
        "cluster_name": "cinta",
        "cluster_type": "ce",
        "tenant": "",
        "private_default_gw": "",
        "private_vn_prefix": "",
        "customer_route": "",
        "latitude": 49.315674,
        "longitude": 14.248433,
        "cluster_size": 1,
        "vpm_version": ""
      },
      "site": [
      ],
      "role": [
      ],
      "tunnel_type": "SITE_TO_SITE_TUNNEL_IPSEC_OR_SSL"
    }
  },
  "status": {
    "object_status": null,
    "current_state": "APPROVED"
  }
}