ves-io-schema-tunnel-API-Create

Examples of creating tunnel

Usecase:

Create tunnel-1

Request using vesctl:

vesctl configuration create tunnel -i tunnel.yaml

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

metadata:
  name: tunnel-1
  namespace: documentation
spec:
  localIp:
    intf:
      localIntf:
      - name: network-interface-1
        namespace: documentation
        tenant: acmecorp
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    endpoints:
      endpoints:
        master-0/node-1:
          ip:
            ipv4:
              addr: 1.1.1.1
        node-2:
          ip:
            ipv4:
              addr: 1.1.1.2

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tunnel-1
  namespace: documentation
spec:
  localIp:
    intf:
      localIntf:
      - kind: network_interface.Object
        name: network-interface-1
        namespace: documentation
        tenant: acmecorp
        uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    endpoints:
      endpoints:
        master-0/node-1:
          ip:
            ipv4:
              addr: 1.1.1.1
        node-2:
          ip:
            ipv4:
              addr: 1.1.1.2
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:21.531695200Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 0ce1a894-65eb-474d-bb3d-6dcef8612d4d

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-1","namespace":"documentation"},"spec":{"localIp":{"intf":{"localIntf":[{"tenant":"acmecorp","namespace":"documentation","name":"network-interface-1"}]}},"remoteIp":{"endpoints":{"endpoints":{"master-0/node-1":{"ip":{"ipv4":{"addr":"1.1.1.1"}}},"node-2":{"ip":{"ipv4":{"addr":"1.1.1.2"}}}}}},"params":{"ipsec":{"ipsecPsk":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "0ce1a894-65eb-474d-bb3d-6dcef8612d4d",
    "creation_timestamp": "2020-10-19T09:49:21.531695200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "tunnel_type": "IPSEC_PSK",
    "local_ip": {
      "intf": {
        "local_intf": [
          {
            "kind": "network_interface.Object",
            "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
            "tenant": "acmecorp",
            "namespace": "documentation",
            "name": "network-interface-1"
          }
        ]
      }
    },
    "remote_ip": {
      "endpoints": {
        "endpoints": {
          "master-0/node-1": {
            "ip": {
              "ipv4": {
                "addr": "1.1.1.1"
              }
            }
          },
          "node-2": {
            "ip": {
              "ipv4": {
                "addr": "1.1.1.2"
              }
            }
          }
        }
      }
    },
    "params": {
      "ipsec": {
        "ipsec_psk": {
          "clear_secret_info": {
            "provider": "",
            "url": "string://\u003cbase64\u003e"
          },
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}

Usecase:

Create tunnel-2

Request using vesctl:

vesctl configuration create tunnel -i tunnel.yaml

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

metadata:
  name: tunnel-2
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        siteLocal: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tunnel-2
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        siteLocal: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:21.538051500Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 52a994f5-df1e-41ee-914a-6b00a796d94c

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-2","namespace":"documentation"},"spec":{"localIp":{"ipAddress":{"ipAddress":{"ipv4":{"addr":"192.168.0.10"}},"virtualNetworkType":{"siteLocal":{}}}},"remoteIp":{"ip":{"ipv4":{"addr":"192.168.0.10"}}},"params":{"ipsec":{"ipsecPsk":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1225
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-2",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "52a994f5-df1e-41ee-914a-6b00a796d94c",
    "creation_timestamp": "2020-10-19T09:49:21.538051500Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "tunnel_type": "IPSEC_PSK",
    "local_ip": {
      "ip_address": {
        "ip_address": {
          "ipv4": {
            "addr": "192.168.0.10"
          }
        },
        "virtual_network_type": {
          "site_local": {

          }
        }
      }
    },
    "remote_ip": {
      "ip": {
        "ipv4": {
          "addr": "192.168.0.10"
        }
      }
    },
    "params": {
      "ipsec": {
        "ipsec_psk": {
          "clear_secret_info": {
            "provider": "",
            "url": "string://\u003cbase64\u003e"
          },
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}

Usecase:

Create tunnel-3

Request using vesctl:

vesctl configuration create tunnel -i tunnel.yaml

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

metadata:
  name: tunnel-3
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        siteLocalInside: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tunnel-3
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        siteLocalInside: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:21.543685200Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: a069f33f-9907-4e33-83f5-0251d607e43f

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-3","namespace":"documentation"},"spec":{"localIp":{"ipAddress":{"ipAddress":{"ipv4":{"addr":"192.168.0.10"}},"virtualNetworkType":{"siteLocalInside":{}}}},"remoteIp":{"ip":{"ipv4":{"addr":"192.168.0.10"}}},"params":{"ipsec":{"ipsecPsk":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1232
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-3",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "a069f33f-9907-4e33-83f5-0251d607e43f",
    "creation_timestamp": "2020-10-19T09:49:21.543685200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "tunnel_type": "IPSEC_PSK",
    "local_ip": {
      "ip_address": {
        "ip_address": {
          "ipv4": {
            "addr": "192.168.0.10"
          }
        },
        "virtual_network_type": {
          "site_local_inside": {

          }
        }
      }
    },
    "remote_ip": {
      "ip": {
        "ipv4": {
          "addr": "192.168.0.10"
        }
      }
    },
    "params": {
      "ipsec": {
        "ipsec_psk": {
          "clear_secret_info": {
            "provider": "",
            "url": "string://\u003cbase64\u003e"
          },
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}

Usecase:

Create tunnel-4

Request using vesctl:

vesctl configuration create tunnel -i tunnel.yaml

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

metadata:
  name: tunnel-4
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        public: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tunnel-4
  namespace: documentation
spec:
  localIp:
    ipAddress:
      ipAddress:
        ipv4:
          addr: 192.168.0.10
      virtualNetworkType:
        public: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:21.549155500Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 2c2c2ecd-f207-46d8-a40f-38d1edfbf555

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-4","namespace":"documentation"},"spec":{"localIp":{"ipAddress":{"ipAddress":{"ipv4":{"addr":"192.168.0.10"}},"virtualNetworkType":{"public":{}}}},"remoteIp":{"ip":{"ipv4":{"addr":"192.168.0.10"}}},"params":{"ipsec":{"ipsecPsk":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1221
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-4",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "2c2c2ecd-f207-46d8-a40f-38d1edfbf555",
    "creation_timestamp": "2020-10-19T09:49:21.549155500Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "tunnel_type": "IPSEC_PSK",
    "local_ip": {
      "ip_address": {
        "ip_address": {
          "ipv4": {
            "addr": "192.168.0.10"
          }
        },
        "virtual_network_type": {
          "public": {

          }
        }
      }
    },
    "remote_ip": {
      "ip": {
        "ipv4": {
          "addr": "192.168.0.10"
        }
      }
    },
    "params": {
      "ipsec": {
        "ipsec_psk": {
          "clear_secret_info": {
            "provider": "",
            "url": "string://\u003cbase64\u003e"
          },
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}

Usecase:

Create tunnel-5

Request using vesctl:

vesctl configuration create tunnel -i tunnel.yaml

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

metadata:
  name: tunnel-5
  namespace: documentation
spec:
  localIp:
    ipAddress:
      auto: {}
      virtualNetworkType:
        siteLocal: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tunnel-5
  namespace: documentation
spec:
  localIp:
    ipAddress:
      auto: {}
      virtualNetworkType:
        siteLocal: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:21.554101300Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 14355c04-d64e-4c5a-bd76-cb26e6cf8447

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-5","namespace":"documentation"},"spec":{"localIp":{"ipAddress":{"auto":{},"virtualNetworkType":{"siteLocal":{}}}},"remoteIp":{"ip":{"ipv4":{"addr":"192.168.0.10"}}},"params":{"ipsec":{"ipsecPsk":{"clearSecretInfo":{"url":"string://\u003cbase64\u003e"}}}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1153
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-5",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "14355c04-d64e-4c5a-bd76-cb26e6cf8447",
    "creation_timestamp": "2020-10-19T09:49:21.554101300Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "tunnel_type": "IPSEC_PSK",
    "local_ip": {
      "ip_address": {
        "auto": {

        },
        "virtual_network_type": {
          "site_local": {

          }
        }
      }
    },
    "remote_ip": {
      "ip": {
        "ipv4": {
          "addr": "192.168.0.10"
        }
      }
    },
    "params": {
      "ipsec": {
        "ipsec_psk": {
          "clear_secret_info": {
            "provider": "",
            "url": "string://\u003cbase64\u003e"
          },
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}