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: system
spec:
  localIp:
    intf:
      localIntf:
      - name: network-interface-1
        namespace: system
        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: system
spec:
  localIp:
    intf:
      localIntf:
      - kind: network_interface.Object
        name: network-interface-1
        namespace: system
        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: "2021-07-14T08:08:33.007546590Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 2a168d75-b441-4cd5-b46e-754861aec5b5

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-1","namespace":"system"},"spec":{"localIp":{"intf":{"localIntf":[{"tenant":"acmecorp","namespace":"system","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-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:08:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "2a168d75-b441-4cd5-b46e-754861aec5b5",
    "creation_timestamp": "2021-07-14T08:08:33.007546590Z",
    "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": "system",
            "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"
          },
          "blindfold_secret_info_internal": null,
          "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: system
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: system
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: "2021-07-14T08:08:33.013750146Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: eb4e03f0-b45f-46aa-bd47-897ec0ef154c

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-2","namespace":"system"},"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-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1268
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:08:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-2",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "eb4e03f0-b45f-46aa-bd47-897ec0ef154c",
    "creation_timestamp": "2021-07-14T08:08:33.013750146Z",
    "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"
          },
          "blindfold_secret_info_internal": null,
          "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: system
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: system
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: "2021-07-14T08:08:33.018471153Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 3b1da08d-c26f-4eb6-b1f9-92656c11e820

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-3","namespace":"system"},"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-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1275
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:08:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-3",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3b1da08d-c26f-4eb6-b1f9-92656c11e820",
    "creation_timestamp": "2021-07-14T08:08:33.018471153Z",
    "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"
          },
          "blindfold_secret_info_internal": null,
          "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: system
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: system
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: "2021-07-14T08:08:33.022934233Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d5df46ba-d898-42be-a1ff-5557d6f6adbb

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-4","namespace":"system"},"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-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1264
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:08:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-4",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d5df46ba-d898-42be-a1ff-5557d6f6adbb",
    "creation_timestamp": "2021-07-14T08:08:33.022934233Z",
    "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"
          },
          "blindfold_secret_info_internal": null,
          "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: system
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: system
spec:
  localIp:
    ipAddress:
      auto: {}
      virtualNetworkType:
        siteLocal: {}
  params:
    ipsec:
      ipsecPsk:
        clearSecretInfo:
          url: string://<base64>
  remoteIp:
    ip:
      ipv4:
        addr: 192.168.0.10
systemMetadata:
  creationTimestamp: "2021-07-14T08:08:33.028449657Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d941c7b7-30cd-40ee-adc4-fd11a6acbd79

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"tunnel-5","namespace":"system"},"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-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/tunnels'

curl response:

HTTP/1.1 200 OK
Content-Length: 1196
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:08:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tunnel-5",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d941c7b7-30cd-40ee-adc4-fd11a6acbd79",
    "creation_timestamp": "2021-07-14T08:08:33.028449657Z",
    "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"
          },
          "blindfold_secret_info_internal": null,
          "secret_encoding_type": "EncodingNone"
        }
      }
    }
  }
}