Update Virtual Hub

This endpoint allows for updating an existing virtual hub within an organisation. The request can modify key attributes such as the virtual hub’s name, description, and associated organisation ID. Additionally, it enables updates to connected ports, allowing changes to the mapping between the virtual hub and physical hubs by adjusting linked hub IDs and corresponding port IDs. This structured approach ensures accurate visibility into the virtual hub’s configuration, supporting efficient management of port assignments and network connectivity. By updating a virtual hub, organisations can maintain an optimised infrastructure, adapt to changing requirements, and enhance network oversight.

Syntax: see 'CCall Structure

Type = 'PATCH'

'https://connect.cambrionix.com/api/hardware/v1/virtual-hubs/virtual-hub-id'

Variable Description
virtual-hub-id This is the id of the virtual hub as a unique 128-bit number

In the data section of the request, include the information you wish to add, formatted as shown below.

{ "name": "virtual-hub-name", "description": "virtual-hub-description", "ports": { "virtual-hub-port": { "hub": { "id": "hub-serial" }, "port": { "id": hub-port } } }

Variable Description
virtual-hub-name This is the name of the virtual hub
virtual-hub-description This is the description of the virtual hub
virtual-hub-port This is the port number of the virtual hub
hub-serial This is the serial number of the hub
hub-port This is the port number of the hub
Returns:

{ "created": { "time": time }, "updated": { "time": time }, "id": "virtual-hub-id", "organization": { "id": "organisation-id" }, "name": "virtual-hub-name", "description": "virtual-hub-description", "ports": { "virtual-hub-port": { "hub": { "id": "hub-serial" }, "port": { "id": hub-port } } }

Output Description
time The hub time, shown as an integer in ms
virtual-hub-id This is the id of the virtual hub as a unique 128-bit number
organisation-id This is the id of the organisation as a unique 128-bit number
virtual-hub-name This is the name of the virtual hub
virtual-hub-description This is the description of the virtual hub
virtual-hub-port This is theport number of the virtual hub
hub-serial This is the serial number of the hub
hub-port This is the port number of the hub
Example
curl -X 'PATCH' \
  'https://connect.cambrionix.com/api/hardware/v1/virtual-hubs/00000000-0000-0000-0000-000000000000' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1RTSpd5DmuJd2PGWm_s8Wfzl-DTdsi-rz-PcYMUyiNtDteuTvRDA' \
  -H 'Content-Type: application/json' \
  -d '      "name": "hub 1",
      "description": "aaa",
      "ports": {
        "1": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 2
          }
        },
        "2": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 5
          }
        },
        "3": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 8
          }
        },
        "4": {
          "hub": {
            "id": "DJ00B475"
          },
          "port": {
            "id": 1
          }
        }
      }
    }
  }
}'
Returns
{
  "result": [
    {
      "created": {
        "time": 1724248462488
      },
      "updated": {
        "time": 1724248462488
      },
      "id": "00f7543a-d6ef-4059-8691-9ce54a9f12e1",
      "organization": {
        "id": "dafc70d5-a4c8-42a3-ad8d-a8ccb5fa313f"
      },
      "name": "hub 1",
      "description": "aaa",
      "ports": {
        "1": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 2
          }
        },
        "2": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 5
          }
        },
        "3": {
          "hub": {
            "id": "0000006567CDF436"
          },
          "port": {
            "id": 8
          }
        },
        "4": {
          "hub": {
            "id": "DJ00B475"
          },
          "port": {
            "id": 1
          }
        }
      }
    }
  }
}
Errors

If there is an error in the API method then JSON-RPC Error Object a will be returned