Development docs

Network Api

This API allows to modify the configuration for the HL4 network. The network configuration is stored in a gitlab repo When a change is needed this project will create a merge request to change the ansible config in the repo.

At the moment of writing Admin seems to be the only consumer of this api.

Vni vs Vlan

Due technical limitations this project is a mapper between Vni and VLan The number of VLans in a network is limited to 4096. This limit is to low for the amount of Vlans managed by True. The technical solution is to use Vni. Our current higlander hardware does not support this feature. To solve this problem the network leaves-switches have a mapping between Vni and VLans.

The overlay-access.yaml files in the repository host_vars contains a list of vlans per host machine and the native_vlan_id for each network interface of the switch.

Magic numbers

Vlans are automatically managed in most situations as they are restricted on leave level. The VLans below 1000 are reserved for True internal networking. The other numbers are managed by this application following an auto-increment principal. The first available number after 1000 is used for new created vlans.

Endpoints

Available endpoints are:

  • /api/network/transactions
    • GET
  • /api/network/transactions/{id}
    • GET
    • PUT
    • POST
    • DELETE
  • /api/network/mergerequests
    • GET
  • /api/network/devices
    • GET
  • /api/network/devices/{id}
    • GET
  • /api/network/devices/{id}/interfaces
    • GET
  • /api/network/interfaces
    • GET
  • /api/network/vlans
    • GET
    • POST
  • /api/network/tenants
    • GET
  • /api/network/tenants/{id}
    • GET
  • /api/network/vmhosts/{name}
    • GET

In order to have the network configured for a customers VM there should be a mapping for the customers VNI to a vlan on the networkdevices connected to the VmHost.

To create this mapping a request should be made to the [POST] /api/network/vms endpoint with the relevant data. When the mapping is already available the response should have a 200 status and the data of the involved devices. If the mapping is not yet available a transaction should be created and the [POST] api/network/vms repeated with a transactionId. When successfull the transaction can be committed by making a PUT request to the /api/network/transactions endpoint with parameter commit=true .

Search results