Export BIG-IP Inventory from BIG-IQ

Overview

This example describes the workflow which retrieves the BIG-IP inventory from BIG-IQ using the API.

POST to create a task to get a BIG-IP inventory

Send a POST request to the /device/tasks/device-inventory endpoint to create a task to generate a BIG-IP inventory. In the following example <BIG-IQ> represents a placeholder for the IP address of the BIG-IQ.

POST https://<BIG-IQ>/mgmt/cm/device/tasks/device-inventory

Request

For example, you can include the following JSON in the body of the POST request to retrieve the entire inventory.

{
    "devicesQueryUri": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices?%24filter=product%20eq%20%27BIG-IP%27&%24orderby=hostname%20asc"

}

Response

The response to the POST can return HTTP/1.1 200 OK and the JSON in the body of the response can return include the task’s id, the selfLink URL for the task, and an initial status of STARTED.

The JSON in the body of the response to the POST can look similar to the following.

{
    "devicesQueryUri": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices?%24filter=product%20eq%20'BIG-IP'&%24orderby=hostname%20asc",
    "id": "dabe4da6-79b5-4a60-a199-deae8bfd9734",
    "status": "STARTED",
    "userReference": {
            "link": "https://localhost/mgmt/shared/authz/users/admin"
    },
    "identityReferences": [{
            "link": "https://localhost/mgmt/shared/authz/users/admin"
    }],
    "generation": 1,
    "lastUpdateMicros": 1595956354371940,
    "kind": "cm:device:tasks:device-inventory:deviceinventorytaskstate",
    "selfLink": "https://localhost/mgmt/cm/device/tasks/device-inventory/dabe4da6-79b5-4a60-a199-deae8bfd9734"
}

GET to check the task’s updated status

After initiating the device inventory task you can poll for the task’s completion by sending GET requests to the task’s selfLink URL. The value of status can become “FINISHED” and the value of currentStep becomes “Finish” after the task completes. For this example, a GET to check the device inventory task can look as follows.
GET https://<BIG-IQ>/mgmt/cm/device/tasks/device-inventory/dabe4da6-79b5-4a60-a199-deae8bfd9734

Response

The response to the GET can return HTTP/1.1 200 OK and the JSON in the body of the response can include a status having the value of “FINISHED” and a currentStep having the value of “Finish” once the task has finished. The body of the response can then also include a URL for the resultsReference. For this example, the JSON in the body of the response can look as follows.

{
    "id": "dabe4da6-79b5-4a60-a199-deae8bfd9734",
    "kind": "cm:device:tasks:device-inventory:deviceinventorytaskstate",
    "status": "FINISHED",
    "devices": [{
                    "kind": "shared:resolver:device-groups:restdeviceresolverdevicestate",
                    "uuid": "8f08d6da-ac86-47f9-8225-04a6ff7b9c5e",
                    "build": "0.0.3",
                    "slots": [{
                            "build": "0.0.3",
                            "volume": "HD1.1",
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "isActive": true
                    }],
                    "state": "ACTIVE",
                    "address": "10.192.75.183",
                    "edition": "Point Release 5",
                    "product": "BIG-IP",
                    "version": "14.1.2.5",
                    "hostname": "bigip3.example.com",
                    "selfLink": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/8f08d6da-ac86-47f9-8225-04a6ff7b9c5e",
                    "deviceUri": "https://10.192.75.183:443",
                    "groupName": "cm-bigip-allBigIpDevices",
                    "httpsPort": 443,
                    "isVirtual": true,
                    "machineId": "8f08d6da-ac86-47f9-8225-04a6ff7b9c5e",
                    "generation": 36,
                    "properties": {
                            "clusterName": "bostonCluster",
                            "shared:resolver:device-groups:discoverer": "afa1d9b8-c7cb-465c-914c-41cd880f35b1"
                    },
                    "isClustered": false,
                    "mcpDeviceName": "/Common/bigip3.example.com",
                    "isLicenseExpired": false,
                    "lastUpdateMicros": 1594941521761424,
                    "managementAddress": "10.192.75.183",
                    "restFrameworkVersion": "14.1.2.5-0.0.3"
            },
            {
                    "kind": "shared:resolver:device-groups:restdeviceresolverdevicestate",
                    "uuid": "9f52a959-ffa0-45a6-b902-66833770c6ee",
                    "build": "0.0.3",
                    "slots": [{
                            "build": "0.0.3",
                            "volume": "HD1.1",
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "isActive": true
                    }],
                    "state": "ACTIVE",
                    "address": "10.192.75.184",
                    "edition": "Point Release 5",
                    "product": "BIG-IP",
                    "version": "14.1.2.5",
                    "hostname": "bigip4.example.com",
                    "selfLink": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/9f52a959-ffa0-45a6-b902-66833770c6ee",
                    "deviceUri": "https://10.192.75.184:443",
                    "groupName": "cm-bigip-allBigIpDevices",
                    "httpsPort": 443,
                    "isVirtual": true,
                    "machineId": "9f52a959-ffa0-45a6-b902-66833770c6ee",
                    "generation": 36,
                    "properties": {
                            "clusterName": "bostonCluster",
                            "shared:resolver:device-groups:discoverer": "afa1d9b8-c7cb-465c-914c-41cd880f35b1"
                    },
                    "isClustered": false,
                    "mcpDeviceName": "/Common/bigip4.example.com",
                    "isLicenseExpired": false,
                    "lastUpdateMicros": 1594941521652359,
                    "managementAddress": "10.192.75.184",
                    "restFrameworkVersion": "14.1.2.5-0.0.3"
            },
            {
                    "kind": "shared:resolver:device-groups:restdeviceresolverdevicestate",
                    "uuid": "5a181525-cdc3-4c9e-8eb9-6a2c09dcd255",
                    "build": "0.0.3",
                    "slots": [{
                            "build": "0.0.3",
                            "volume": "HD1.1",
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "isActive": true
                    }],
                    "state": "ACTIVE",
                    "address": "10.192.75.187",
                    "edition": "Point Release 5",
                    "product": "BIG-IP",
                    "version": "14.1.2.5",
                    "hostname": "bigip7.example.com",
                    "selfLink": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/5a181525-cdc3-4c9e-8eb9-6a2c09dcd255",
                    "deviceUri": "https://10.192.75.187:443",
                    "groupName": "cm-bigip-allBigIpDevices",
                    "httpsPort": 443,
                    "isVirtual": true,
                    "machineId": "5a181525-cdc3-4c9e-8eb9-6a2c09dcd255",
                    "generation": 15,
                    "properties": {
                            "shared:resolver:device-groups:discoverer": "afa1d9b8-c7cb-465c-914c-41cd880f35b1"
                    },
                    "isClustered": false,
                    "mcpDeviceName": "/Common/bigip7.example.com",
                    "isLicenseExpired": false,
                    "lastUpdateMicros": 1594941521431326,
                    "managementAddress": "10.192.75.187",
                    "restFrameworkVersion": "14.1.2.5-0.0.3"
            }
    ],
    "selfLink": "https://localhost/mgmt/cm/device/tasks/device-inventory/dabe4da6-79b5-4a60-a199-deae8bfd9734",
    "generation": 7,
    "currentStep": "Finish",
    "endDateTime": "2020-07-28T10:12:35.812-0700",
    "downloadLink": {
            "link": "https://localhost/mgmt/cm/device/report-download/device-inventory-export2020-07-28T10:12.csv"
    },
    "startDateTime": "2020-07-28T10:12:34.373-0700",
    "devicesQueryUri": "https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices?%24filter=product%20eq%20'BIG-IP'&%24orderby=hostname%20asc",
    "lastUpdateMicros": 1595956355862171,
    "resultsReference": {
            "link": "https://localhost/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results",
            "isSubcollection": true
    }
}

GET to retrieve the device inventory’s result

After the task completes, and the value of currentStep is “Finish”, you can retrieve the result of the device inventory by sending a GET request to the URL returned by resultsReference.

GET https://<BIG-IQ>/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results

Response

The response to the GET can return HTTP/1.1 200 OK and the JSON in the body of the response for this example can look similar to following.

{
    "items": [{
                    "id": "41bdef5b-bfb3-4bdc-aa96-ac9f3bc80312",
                    "kind": "cm:device:reports:device-inventory:results:deviceinventoryresultstate",
                    "selfLink": "https://localhost/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results/41bdef5b-bfb3-4bdc-aa96-ac9f3bc80312",
                    "infoState": {
                            "cpu": "Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz",
                            "kind": "shared:resolver:device-groups:deviceinfostate",
                            "time": 1595956355672,
                            "build": "0.0.3",
                            "slots": [{
                                    "build": "0.0.3",
                                    "volume": "HD1.1",
                                    "product": "BIG-IP",
                                    "version": "14.1.2.5",
                                    "isActive": true
                            }],
                            "address": "10.1.20.183",
                            "baseMac": "00:50:56:BB:7D:FC",
                            "edition": "Point Release 5",
                            "halUuid": "423be90d-d4c0-8e61-68d2-de2698556be8",
                            "hostMac": "00:50:56:BB:7D:FC",
                            "license": {
                                    "generation": 0,
                                    "skipLicense": false,
                                    "activeModules": [
                                            "BIG-IP, LAB (LTM,APM,ASM,AM, GTM), VE|U660083-8290460|IPV6 Gateway|Rate Shaping|External Interface and Network HSM, VE|SDN Services, VE|SSL, Forward Proxy, VE|WOM, VE|DNS Services (LAB)|SSL, VE|WBA, VE|Recycle, BIG-IP, VE|APM, Limited|Routing Bundle, VE|ASM, VE|Acceleration Manager, VE|Max Compression, VE|Ram Cache|Advanced Protocols, VE|AFM, VE (LAB ONLY - NO ROUTING)|PSM, VE|Anti-Virus Checks|Base Endpoint Security Checks|Firewall Checks|Machine Certificate Checks|Network Access|Protected Workspace|Secure Virtual Keyboard|APM, Web Application|App Tunnel|Remote Desktop|DNS RATE LIMITED, MAX|AAM, Upgrade from WAM, (v11.4 & later)|VE, Carrier Grade NAT (AFM ONLY)|DNS Rate Fallback, Unlimited|DNS Licensed Objects, Unlimited|DNS Rate Limit, Unlimited QPS",
                                            "CGN, VE (LAB)|X658904-4746572|Routing Bundle, VE",
                                            "DNSSEC|C442102-5027589"
                                    ],
                                    "registrationKey": "B9309-47529-98324-44256-5173661",
                                    "lastUpdateMicros": 0,
                                    "licenseEndDateTime": "2020-08-16T00:00:00Z"
                            },
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "hostname": "bigip3.example.com",
                            "icrdPort": 8100,
                            "platform": "Z100",
                            "selfLink": "https://localhost/mgmt/shared/identified-devices/config/device-info",
                            "deviceUri": "https://10.192.75.183:443",
                            "isVirtual": true,
                            "machineId": "8f08d6da-ac86-47f9-8225-04a6ff7b9c5e",
                            "generation": 0,
                            "interfaces": [
                                    "1.1",
                                    "1.2",
                                    "1.3",
                                    "mgmt"
                            ],
                            "properties": {
                                    "clusterName": "bostonCluster"
                            },
                            "isClustered": false,
                            "mcpDeviceName": "/Common/bigip3.example.com",
                            "hypervisorType": "0",
                            "physicalMemory": 16384,
                            "lastUpdateMicros": 0,
                            "managementAddress": "10.192.75.183",
                            "chassisSerialNumber": "423be90d-d4c0-8e61-de2698556be8",
                            "restFrameworkVersion": "14.1.2.5-0.0.3",
                            "platformMarketingName": "BIG-IP Virtual Edition",
                            "isIControlRestSupported": true
                    },
                    "generation": 1,
                    "lastUpdateMicros": 1595956355675729
            },
            {
                    "id": "54abacc3-2f29-40b1-ad9c-0fdca71282a4",
                    "kind": "cm:device:reports:device-inventory:results:deviceinventoryresultstate",
                    "selfLink": "https://localhost/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results/54abacc3-2f29-40b1-ad9c-0fdca71282a4",
                    "infoState": {
                            "cpu": "Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz",
                            "kind": "shared:resolver:device-groups:deviceinfostate",
                            "time": 1595956355632,
                            "build": "0.0.3",
                            "slots": [{
                                    "build": "0.0.3",
                                    "volume": "HD1.1",
                                    "product": "BIG-IP",
                                    "version": "14.1.2.5",
                                    "isActive": true
                            }],
                            "address": "10.1.20.184",
                            "baseMac": "00:50:56:BB:90:9E",
                            "edition": "Point Release 5",
                            "halUuid": "423b158b-af71-7f35-ba40-436a1514862b",
                            "hostMac": "00:50:56:BB:90:9E",
                            "license": {
                                    "generation": 0,
                                    "skipLicense": false,
                                    "activeModules": [
                                            "BIG-IP, LAB (LTM,APM,ASM,AM, GTM), VE|S030363-2708611|IPV6 Gateway|Rate Shaping|External Interface and Network HSM, VE|SDN Services, VE|SSL, Forward Proxy, VE|WOM, VE|DNS Services (LAB)|SSL, VE|WBA, VE|Recycle, BIG-IP, VE|APM, Limited|Routing Bundle, VE|ASM, VE|Acceleration Manager, VE|Max Compression, VE|Ram Cache|Advanced Protocols, VE|AFM, VE (LAB ONLY - NO ROUTING)|PSM, VE|Anti-Virus Checks|Base Endpoint Security Checks|Firewall Checks|Machine Certificate Checks|Network Access|Protected Workspace|Secure Virtual Keyboard|APM, Web Application|App Tunnel|Remote Desktop|DNS RATE LIMITED, MAX|AAM, Upgrade from WAM, (v11.4 & later)|VE, Carrier Grade NAT (AFM ONLY)|DNS Rate Fallback, Unlimited|DNS Licensed Objects, Unlimited|DNS Rate Limit, Unlimited QPS",
                                            "CGN, VE (LAB)|T365947-6881510|Routing Bundle, VE",
                                            "DNSSEC|S608971-6002632"
                                    ],
                                    "registrationKey": "L1824-96036-28097-06504-3734838",
                                    "lastUpdateMicros": 0,
                                    "licenseEndDateTime": "2020-08-16T00:00:00Z"
                            },
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "hostname": "bigip4.example.com",
                            "icrdPort": 8100,
                            "platform": "Z100",
                            "selfLink": "https://localhost/mgmt/shared/identified-devices/config/device-info",
                            "deviceUri": "https://10.192.75.184:443",
                            "isVirtual": true,
                            "machineId": "9f52a959-ffa0-45a6-b902-66833770c6ee",
                            "generation": 0,
                            "interfaces": [
                                    "1.1",
                                    "1.2",
                                    "1.3",
                                    "mgmt"
                            ],
                            "properties": {
                                    "clusterName": "bostonCluster"
                            },
                            "isClustered": false,
                            "mcpDeviceName": "/Common/bigip4.example.com",
                            "hypervisorType": "0",
                            "physicalMemory": 16384,
                            "lastUpdateMicros": 0,
                            "managementAddress": "10.192.75.184",
                            "chassisSerialNumber": "423b158b-af71-7f35-436a1514862b",
                            "restFrameworkVersion": "14.1.2.5-0.0.3",
                            "platformMarketingName": "BIG-IP Virtual Edition",
                            "isIControlRestSupported": true
                    },
                    "generation": 1,
                    "lastUpdateMicros": 1595956355636446
            },
            {
                    "id": "4e766a67-7bd3-4db8-bd8d-2c07faf5d15e",
                    "kind": "cm:device:reports:device-inventory:results:deviceinventoryresultstate",
                    "selfLink": "https://localhost/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results/4e766a67-7bd3-4db8-bd8d-2c07faf5d15e",
                    "infoState": {
                            "cpu": "Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz",
                            "kind": "shared:resolver:device-groups:deviceinfostate",
                            "time": 1595956355564,
                            "build": "0.0.3",
                            "slots": [{
                                    "build": "0.0.3",
                                    "volume": "HD1.1",
                                    "product": "BIG-IP",
                                    "version": "14.1.2.5",
                                    "isActive": true
                            }],
                            "address": "10.1.20.187",
                            "baseMac": "00:50:56:BB:1F:EA",
                            "edition": "Point Release 5",
                            "halUuid": "423b2d69-efda-f6d3-e30c-92dbdcab77a1",
                            "hostMac": "00:50:56:BB:1F:EA",
                            "license": {
                                    "generation": 0,
                                    "skipLicense": false,
                                    "activeModules": [
                                            "Anti-Bot Mobile, VE 1 Gbps|Q970440-5734398",
                                            "APM, Base, VE GBB (500 CCU, 2500 Access Sessions)|M648182-3491566|Anti-Virus Checks|Base Endpoint Security Checks|Firewall Checks|Machine Certificate Checks|Network Access|Protected Workspace|Secure Virtual Keyboard|APM, Web Application|App Tunnel|Remote Desktop",
                                            "ASM to AWF Upgrade, VE-1G|Q256414-7637756",
                                            "Best Bundle, VE-1G|D881342-5123309|Recycle, BIG-IP, VE|Advanced Protocols, VE|Rate Shaping|DNSSEC|Routing Bundle, VE|ASM, VE|DNS-GTM, Base, 1Gbps|SSL, VE|DENY-VER-V11.5.X|Max Compression, VE|AFM, VE|DNS Rate Limit, 1000 QPS|GTM Rate, 1000|VE, Carrier Grade NAT (AFM ONLY)|PSM, VE",
                                            "DataSafe, VE-1G|S652613-5043340|DataSafe, VE-1G",
                                            "DataSafe, VE-1G|V690909-1757502|DataSafe, VE-1G",
                                            "SSL Orchestrator, VE (25MB/200MB/1G)|Z594907-2204440"
                                    ],
                                    "registrationKey": "T9826-44857-10038-71278-4823776",
                                    "lastUpdateMicros": 0,
                                    "licenseEndDateTime": "2020-08-16T00:00:00Z"
                            },
                            "product": "BIG-IP",
                            "version": "14.1.2.5",
                            "hostname": "bigip7.example.com",
                            "icrdPort": 8100,
                            "platform": "Z100",
                            "selfLink": "https://localhost/mgmt/shared/identified-devices/config/device-info",
                            "deviceUri": "https://10.192.75.187:443",
                            "isVirtual": true,
                            "machineId": "5a181525-cdc3-4c9e-8eb9-6a2c09dcd255",
                            "generation": 0,
                            "interfaces": [
                                    "1.1",
                                    "1.2",
                                    "1.3",
                                    "mgmt"
                            ],
                            "isClustered": false,
                            "mcpDeviceName": "/Common/bigip7.example.com",
                            "hypervisorType": "0",
                            "physicalMemory": 16384,
                            "lastUpdateMicros": 0,
                            "managementAddress": "10.192.75.187",
                            "chassisSerialNumber": "423b2d69-efda-f6d3-92dbdcab77a1",
                            "restFrameworkVersion": "14.1.2.5-0.0.3",
                            "platformMarketingName": "BIG-IP Virtual Edition",
                            "isIControlRestSupported": true
                    },
                    "generation": 1,
                    "lastUpdateMicros": 1595956355569002
            }
    ],
    "generation": 4,
    "kind": "cm:device:reports:device-inventory:results:deviceinventoryresultcollectionstate",
    "lastUpdateMicros": 1595956355685464,
    "selfLink": "https://localhost/mgmt/cm/device/reports/device-inventory/376f3bbe-1ec4-4b3f-be7b-2ce7e4d51064/results"
}