Network API

Manage VLANs and IP Networks programmatically

Overview

The Network API allows you to manage VLANs (Virtual Local Area Networks) and IP Networks. VLANs provide network segmentation, while IP Networks manage IP address allocations.

VLAN API

GET Get VLAN

Retrieve a single VLAN by its ID.

Request

GET https://api.rackcorp.net/api/rest/v2.9/json.php?cmd=network.vlan.get&id=123
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Parameter Type Required Description
cmd string Yes Must be "network.vlan.get"
id integer Yes VLAN database ID

Response

{
  "code": "OK",
  "vlan": {
    "VLANDatabaseID": 123,
    "VLANID": 100,
    "VLANName": "Production Network",
    "DCNAME": "SYD01",
    "CustomerTradingName": "Example Corp",
    "VLANStatus": "ACTIVE",
    "VLANOperationalStatus": "OPERATIONAL",
    "VLANDateCreated": "2024-01-15 10:30:00",
    "PortConnects": 5
  }
}

GET List VLANs

Retrieve a list of VLANs with optional filtering and pagination.

Request

GET https://api.rackcorp.net/api/rest/v2.9/json.php?cmd=network.vlan.getall&resStart=0&resWindow=50&keyword=search%20term&status=ACTIVE&includeportcounts=true
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Parameter Type Required Description
cmd string Yes Must be "network.vlan.getall"
resStart integer No Pagination start offset (default: 0)
resWindow integer No Number of results per page (default: 20, minimum: 20)
keyword string No Search term to filter results
stdname string No Filter by standard name
status string No Filter by status (e.g., "ACTIVE")
includeportcounts boolean No If true, includes port connection counts
ordering array No Array of sort objects with field and dir

Response

{
  "code": "OK",
  "count": 25,
  "vlanlist": [
    {
      "VLANDatabaseID": 123,
      "VLANID": 100,
      "VLANName": "Production Network",
      "DCNAME": "SYD01",
      "VLANStatus": "ACTIVE",
      "VLANOperationalStatus": "OPERATIONAL",
      "PortConnects": 5
    }
  ]
}

DELETE Delete VLAN

Delete a VLAN by its ID.

Request

DELETE https://api.rackcorp.net/api/rest/v2.9/json.php
Content-Type: application/json
Authorization: Bearer YOUR_JWT_TOKEN

{
  "cmd": "network.vlan.delete",
  "id": 123
}

Response

{
  "code": "OK",
  "message": "VLAN deleted"
}

IP Network API

GET List IP Networks

Retrieve a list of IP networks with optional filtering and pagination.

Request

GET https://api.rackcorp.net/api/rest/v2.9/json.php?cmd=network.ipnetwork.getall&resStart=0&resWindow=50&keyword=search%20term&status=ACTIVE
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Parameter Type Required Description
cmd string Yes Must be "network.ipnetwork.getall"
resStart integer No Pagination start offset (default: 0)
resWindow integer No Number of results per page (default: 20, minimum: 20)
keyword string No Search term to filter results
stdname string No Filter by standard name
status string No Filter by status (e.g., "ACTIVE")

Response

{
  "code": "OK",
  "count": 25,
  "ipnetworks": [
    {
      "IPNetworkID": 123,
      "IPNetworkName": "Production IP Network",
      "IPNetworkCIDR": "203.0.113.0/24",
      "IPNetworkStatus": "ACTIVE",
      "CustomerTradingName": "Example Corp"
    }
  ]
}

DELETE Delete IP Network

Delete an IP network by its ID.

Request

DELETE https://api.rackcorp.net/api/rest/v2.9/json.php
Content-Type: application/json
Authorization: Bearer YOUR_JWT_TOKEN

{
  "cmd": "network.ipnetwork.delete",
  "IPNetworkID": 123
}

Response

{
  "code": "OK",
  "message": "IP Network deleted"
}

Error Responses

If an error occurs, the API will return a response with code: "FAULT":

{
  "code": "FAULT",
  "message": "Error message",
  "error": {
    "field1": "Error message 1",
    "field2": "Error message 2"
  }
}