Inventory Service (2.2.0)

Download OpenAPI specification:Download

This is the spec that defines the API provided by the Inventory/Asset Service, which is used by multiple services to access network configuration/state data

Switch

getSwitch Deprecated

Get only specified Switch details. The Switch can be identified by IP Address

query Parameters
ip_address
required
string

IP Address of the Device

Responses

200

OK

401

Authorization information is missing or invalid.

404

A device with the specified IP was not found.

500

Unexpected error.

default

Unexpected error

get/switch
http://goinventory-service:80/v1/inventory/switch

deleteSwitch Deprecated

Delete the specified device from the inventory.

query Parameters
ip_address
required
string

IP Addresses of the device to be deleted.

Responses

200

OK

401

Authorization information is missing or invalid.

404

A switch with the specified IP Address was not found.

422

Not able to delete the switch with specified IP Address.

500

Unexpected error.

default

Unexpected error

delete/switch
http://goinventory-service:80/v1/inventory/switch

updateSwitch Deprecated

Update the specified device details in the inventory.

path Parameters
ip_address
required
string

IP Address of the device to be updated.

Request Body schema: application/json

Update switch if credentials changes provide new username and password

ip_address
required
string
username
required
string
password
required
string
maintmode
boolean

Responses

200

OK

401

Authorization information is missing or invalid.

404

Couldnt connect to the device. Check device credentials.

422

Update switch failed because of invalid IP address in the request.

424

Switch update failed for the specified IP address.

500

Unexpected error.

default

Unexpected error

put/switch/{ip_address}
http://goinventory-service:80/v1/inventory/switch/{ip_address}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "password",
  • "ip_address": "ip_address",
  • "username": "username",
  • "maintmode": true
}

Register

registerSwitch Deprecated

Register switch with the inventory service

Request Body schema: application/json

Register a new Switch.

ip_address
required
string
username
required
string
password
required
string
maintmode
boolean

Responses

200

OK

401

Authorization information is missing or invalid.

409

A switch with the specified IP already exists.

422

Invalid IP/Username/Password for registering the device.

424

Device connection or enabling interfaces failed while registering the device.

500

Unexpected error.

default

Unexpected error

post/switch
http://goinventory-service:80/v1/inventory/switch

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "password",
  • "ip_address": "ip_address",
  • "username": "username",
  • "maintmode": true
}

registerSwitches

Register switches with the inventory service

Request Body schema: application/json

Register a new Switch.

device_ips
required
Array of strings
username
required
string
password
required
string
maintmode
boolean

Responses

200

OK

401

Authorization information is missing or invalid.

409

A switch with the specified IP already exists.

500

Unexpected error.

default

Unexpected error

post/switches
http://goinventory-service:80/v1/inventory/switches

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "password",
  • "device_ips":
    [
    ],
  • "username": "username",
  • "maintmode": true
}

Replace

replaceSwitch

Replace the switch as part of an RMA. This will replace the asset information of the new switch in the Inventory.

query Parameters
ip_address
required
string

IP Addresses of the device to be replaced.

config_backup_id
string

UUID of config backup

Responses

202

Accepted switch replace request

401

Authorization information is missing or invalid.

409

A switch with the specified IP doesnt exists.

500

Unexpected error

default

Unexpected error

post/switch/replace
http://goinventory-service:80/v1/inventory/switch/replace

Switch replace

rma

delet RMA ID.

query Parameters
key
string

IP Addresses of the device or RMA uuid to deleted.

Responses

200

drift and reconcile delete request

409

Invalid IP address.

500

Unexpected error.

default

Unexpected error

delete/switch/replace
http://goinventory-service:80/v1/inventory/switch/replace

Switch replace History list

getRMAHistorys

Get Switch replace History list

query Parameters
device_ip
string

Ip of the entry for which RMA history is fetched

Responses

200

OK

404

No RMA History found in the system

500

Unexpected error

default

Unexpected error

get/rma-history
http://goinventory-service:80/v1/inventory/rma-history

Switch Replace Details

getRMADetail

Get RMA Detail

query Parameters
rma_id
required
string

RMA Id of the entry for which detail is fetched

Responses

200

OK

404

Status of the device was not found.

500

Unexpected error.

default

Unexpected error

get/rma-detail
http://goinventory-service:80/v1/inventory/rma-detail

Compare

compareSwitch

Compare the Specified Switch configuration with whats in the Asset DB

query Parameters
ip_address
required
string

IP Addresses of the device which we want to compare configuration that is saved on the device vs actual configuration on the device.

Responses

200

OK

404

A switch with the specified IP doesnt exists.

500

Unexpected error

default

Unexpected error

post/switch/compare
http://goinventory-service:80/v1/inventory/switch/compare

Switch Setting

getSwitchSetting

query Parameters
ip_address
required
string

IP Addresses of the device to be retrieved.

Responses

200

OK</