Skip to content

Models And API's

Models

  • Rack Allocations
  • Server Allocations
  • Deployment Types
  • Deployment zones
  • RDMA clusters
  • Earmarks
  • Earmark Servers
  • Ownerships
  • Timelines
  • Accounts

API usage to create/update and delete allocations

The API is available through the PERF environment, eventually it will be available through the PREPROD & PROD environment.

POST Rack Allocations

Use this to create or update rack allocations. The API will check if the allocation already exists and update it if it does, otherwise it will create a new allocation.

Example request: POST /api/plugins/asset-index/rackallocations-job

bash curl -X 'POST' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/rackallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "id": "dal2-qz4-sr7-rk103", "location": "dal09.sr07.rk103", "inventory_state": "production", "workflow": "none", "class": "control_ngdc_generic_7050tx3-48_pdu_down", "config_version": "latest", "ng_data": { "mgmt_cidr": "192.168.103.0/24" }, "vpc_data": { "data_cidr": "172.31.103.0/24" } } ]'

PATCH Rack Allocations

Use this to update rack allocations with specific fields. The API will update the fields specified in the request body.

Example request: PATCH /api/plugins/asset-index/rackallocations-job

bash curl -X 'PATCH' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/rackallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "id": "dal1-qz1-sr1-rk036", "location": "dal10.sr01.rk36" } ]'

DELETE Rack Allocations

Use this to delete rack allocations. The API will delete the allocation specified in the request body. NOTE This will delete the rack allocation and the corresponding server allocations for the specified rack.

Example request: DELETE /api/plugins/asset-index/rackallocations-job

bash curl -X 'DELETE' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/rackallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "id": "dal1-qz1-sr1-rk036" } ]'

API usage to create/update and delete server allocations

POST Server Allocations

Use this to create or update server allocations. The API will check if the allocation already exists and update it if it does, otherwise it will create a new allocation.

Example request: POST /api/plugins/asset-index/serverallocations-job

bash curl -X 'POST' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/serverallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "hostname": "dal1-qz1-sr1-rk035-s02", "inventory_state": "production", "workflow": "none", "allocation": "mzone717", "class": "mx2", "config_version": "1.0.1.0", "role": "vpc_compute" } ]'

PATCH Server Allocations

Use this to update server allocations with specific fields. The API will update the fields specified in the request body.

Example request: PATCH /api/plugins/asset-index/serverallocations-job

bash curl -X 'PATCH' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/serverallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "hostname": "dal1-qz1-sr1-rk035-s02", "allocation": "mzone717" } ]'

DELETE Server Allocations

Use this to delete server allocations. The API will delete the allocation specified in the request body.

Example request: DELETE /api/plugins/asset-index/serverallocations-job

bash curl -X 'DELETE' \ 'https://uim-perf-netbox-citrix-cluster.perf-uim-cluster-8f35b3970f40b370064b5d3ea7058098-0000.ca-tor.containers.appdomain.cloud/api/plugins/asset-index/serverallocations-job/' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -d '[ { "hostname": "dal1-qz1-sr1-rk035-s02" } ]'

Similar approach can be followed for other asset-index API's.

OpenAPI docs are available at here