.. _arbitrator-API-resources-v2-configs-assets: ``/v2/configs/assets`` -------------------------- .. tabularcolumns:: |p{1.5cm}|p{5cm}|p{8.5cm}| +--------+------------------------+---------------------------------------+ | Method | URL | Description | +========+========================+=======================================+ | GET | ``/v2/configs/assets`` | Retrieves current list of all assets. | +--------+------------------------+---------------------------------------+ | POST | ``/v2/configs/assets`` | Adds new assets. | +--------+------------------------+---------------------------------------+ | PUT | ``/v2/configs/assets`` | Modifies an existing asset. | +--------+------------------------+---------------------------------------+ | DELETE | ``/v2/configs/assets`` | Deletes an existing asset. | +--------+------------------------+---------------------------------------+ Header (required) ................... ``x-lxt-api-token``: "token from login" GET ..... ``/v2/configs/assets`` * Example 1: Get All Assets Command: :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1Qi[...] --insecure -w "RESP_CODE: %{response_code}" -X GET https:///api/v2/configs/assets Output (formatted): :: {"status":200, "message":"Success", "data":[{"asset_id":"a3b7d01cd3b7a3[...]", "name":"Local System", "ipaddress":"10.13.37.173", "hostname":"ATestArb", "customer":"", "last_method":"", "last_byte_time":0, "did":"Unknown", "mac_address":"Unknown", "address":"", "version":"Unknown", "manufacturer":"LayerX Technologies", "timezone":"UTC", "description":"Local Arbitrator Platform", "model":"Unknown", "asset_groups":[], "assets":[], "profiles":[{ "profile_id":"LXTAE3NIJH37W3C8[...]", "asset_id":"a3b7d01cd3b7a3860b[...]", "probe_group_id":"LXTCSP5DDP62[...]", "enabled":1, "interval":30, "start_time":-1, "start_weekdays":127, "end_window":86400, "assets":[{"asset_id":"a3b7d01cd[...]"}], "credentials":[], "probe_groups":[{ "probe_group_id":"LXTCSP5DDP62[...]", "name":"Local System Stats", "description":"Probes the local Arbitrator platform for statistics.", "profiles":[{"profile_id":"LXTAE3NIJH[...]"}], "probes":[{"probe_id":"LXTQITGJ6DFZ00[...]", "name":"Disk Stats", "short_message":"DISK", "command":"get_arb_stat.sh -d", "description":"Local System Disk Usage", "locked":0, "enabled":1, "unit":"", "autoscale":0, "probe_groups":[{"probe_group_id":"LXTCSP5DDP62[...]"}] }]} ] }] }, {"asset_id":"b9ae6a7a12cbb238[...]", "name":"CUCM_8", "ipaddress":"CUCM_8", "hostname":"CUCM_8", "customer":"", "last_method":"", "last_byte_time":0, "did":"Unknown", "mac_address":"Unknown", "address":"", "version":"Cisco Call Manager", "manufacturer":"Cisco", "timezone":"Unknown", "description":"", "model":"Unknown", "asset_groups":[], "assets":[], "profiles":[] } ] } RESP_CODE: ``200`` * Example 2: Get One Asset Command: :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1Qi[...] --insecure -w "RESP_CODE: %{response_code}" -X GET https:///api/v2/configs/assets/a3b7d01cd3[...] Output (formatted): :: {"status":200, "message":"Success", "data":[{"asset_id":"a3b7d01cd3b7a3860b6a[...]", "name":"Local System", "ipaddress":"10.13.37.173", "hostname":"ATestArb", "customer":"", "last_method":"", "last_byte_time":0, "did":"Unknown", "mac_address":"Unknown", "address":"", "version":"Unknown", "manufacturer":"LayerX Technologies", "timezone":"UTC", "description":"Local Arbitrator Platform", "model":"Unknown", "asset_groups":[], "assets":[], "profiles":[{"profile_id":"LXTAE3NIJH37W3[...]", "asset_id":"a3b7d01cd3b7a386[...]", "probe_group_id":"LXTCSP5DDP62CC6C[...]", "enabled":1, "interval":30, "start_time":-1, "start_weekdays":127, "end_window":86400, "assets":[{"asset_id":"a3b7d01cd3b7a3860[...]"}], "credentials":[], "probe_groups":[{"probe_group_id":"LXTCSP5DDP62CC6C1560[...]", "name":"Local System Stats", "description":"Probes the local Arbitrator platform for statistics.", "profiles":[{"profile_id":"LXTAE3NIJH37W3C81[...]"}], "probes":[{"probe_id":"LXTQITGJ6DFZ00TD156053[...]", "name":"Disk Stats", "short_message":"DISK", "command":"get_arb_stat.sh -d", "description":"Local System Disk Usage", "locked":0, "enabled":1, "unit":"", "autoscale":0, "probe_groups":[{"probe_group_id":"LXTCSP5DDP62CC6C1[...]"}]}] }] }] }] } RESP_CODE: ``200`` POST ......... ``/v2/configs/assets`` Input Data This is an example input object describing a single Asset. :: {"name": "run.sh", "ipaddress": "3.3.3.3", "hostname": "3.3.3.3", "customer": "", "last_method": "", "last_byte_time": 0, "did": "Unknown", "mac_address": "Unknown", "address": "", "version": "Cisco Call Manager", "manufacturer": "Cisco", "timezone": "Unknown", "description": "", "model": "Unknown", "asset_groups": [], "assets": [], "profiles": [] } * Example 1: POST asset Command: :: curl -s -H "x-lxt-api-token: xxx" --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https:///v2/configs/assets ie. :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1QiLC[...] --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https://10.13.37.14/v2/configs/assets Output (formatted): :: {"status": 200, "message": "Success", "data": [{"asset_id": "S33HDW6Z5205ICNK1582657[...]", "name": "run.sh", "ipaddress": "3.3.3.3", "hostname": "3.3.3.3", "customer": "", "last_method": "", "last_byte_time": 0, "did": "Unknown", "mac_address": "Unknown", "address": "", "version": "Cisco Call Manager", "manufacturer": "Cisco", "timezone": "Unknown", "description": "", "model": "Unknown", "asset_groups": [], "assets": [], "profiles": [] }] } RESP_CODE: ``200`` * Example 2: POST asset with profile Input Data This is an example input object describing a single Asset Group with a single Asset. :: {"asset_id": "d9506ab97e091007a74bf[...]", "name": "Voss-IMP", "ipaddress": "10.30.1.104", "hostname": "Voss-IMP", "customer": "", "last_method": "syslog", "last_byte_time": 1611069910, "did": "Unknown", "mac_address": "Unknown", "address": "Main Street", "version": "Unknown", "manufacturer": "Unknown", "timezone": "Unknown", "description": "VOSS-EMEA-IMP", "model": "Unknown", "asset_groups": [{"asset_group_id": "LQ1CUQCIUF985[...]"}], "assets": [], "profiles": [{"profile_id": "WL7B4CWE5Y6N414N1597174[...]", "asset_id": "d9506ab97e0910[...]", "probe_group_id": "CUEJIM0KAA28G[...]", "enabled": 1, "interval": 60, "start_time": -1, "start_weekdays": 127, "end_window": 86400, "assets": [{"asset_id": "d9506ab97[...]" } ], "credentials": [], "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GWS[...]", "name": "1b-PING Monitor", "description": null, "profiles": [{"profile_id": "WL7B4CWE5Y6N41[...]"}], "probes": [{"probe_id": "LOQ465XQQXJHS0JW[...]", "name": "PING Monitor", "short_message": "", "command": "icmp_echo.exp %s", "description": "", "locked": 0, "enabled": 1, "unit": "", "autoscale": 0, "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GWSB1[...]"}] }] }] }] } Command :: curl -s -H "x-lxt-api-token: xxx" --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https:///v2/configs/assets ie. :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1QiL[...] --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https://10.13.37.14/v2/configs/assets Output (formatted): :: {"status": 200, "message": "Success", "data": [{"asset_id":"d9506ab97e091007a74bf[...]", "name": "Voss-IMP", "ipaddress": "10.30.1.104", "hostname": "Voss-IMP", "customer": "", "last_method": "syslog", "last_byte_time": 1611069910, "did": "Unknown", "mac_address": "Unknown", "address": "Main Street", "version": "Unknown", "manufacturer": "Unknown", "timezone": "Unknown", "description": "VOSS-EMEA-IMP", "model": "Unknown", "asset_groups": [{"asset_group_id": "LQ1CUQCIUF985LHY[...]"}], "assets": [], "profiles": [{"profile_id": "WL7B4CWE5Y6N414N1[...]", "asset_id":"d9506ab97e091007a74[...]", "probe_group_id": "CUEJIM0KAA28GWSB156[...]", "enabled": 1, "interval": 60, "start_time": -1, "start_weekdays": 127, "end_window": 86400, "assets": [{"asset_id":"d9506ab97e091007a74bf16[...]"}], "credentials": [], "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GWSB1[...]", "name": "1b-PING Monitor", "description": null, "profiles": [{"profile_id": "WL7B4CWE5Y6N414[...]"}], "probes": [{"probe_id": "LOQ465XQQXJHS0JW1568[...]", "name": "PING Monitor", "short_message": "", "command": "icmp_echo.exp %s", "description": "", "locked": 0, "enabled": 1, "unit": "", "autoscale": 0, "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GWSB1[...]"}] }] }] }] }] } RESP_CODE: ``200`` * Example 3: PUT assets: Modify Asset Input data :: {"asset_id": "d9506ab97e091007a74b[...]", "name": "New Name" } Command: :: curl -s -H "x-lxt-api-token: xxx" --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https:///v2/configs/assets ie. :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1QiLCJ[...] --insecure -w "RESP_CODE: %{response_code}" -d@test_data/asset1 -X POST https://10.13.37.14/v2/configs/assets Output (formatted): :: {"status": 200, "message": "Success", "data": [{"asset_id":"d9506ab97e091007a74bf169[...]", "name": "New Name", "ipaddress": "10.30.1.104", "hostname": "Voss-IMP", "customer": "", "last_method": "syslog", "last_byte_time": 1611069910, "did": "Unknown", "mac_address": "Unknown", "address": "Main Street", "version": "Unknown", "manufacturer": "Unknown", "timezone": "Unknown", "description": "VOSS-EMEA-IMP", "model": "Unknown", "asset_groups": [{"asset_group_id": "LQ1CUQCIUF985LHY1[...]"}], "assets": [], "profiles": [{"profile_id": "WL7B4CWE5Y6N414N1[...]", "asset_id":"d9506ab97e091007a74[...]", "probe_group_id": "CUEJIM0KAA28GWS[...]", "enabled": 1, "interval": 60, "start_time": -1, "start_weekdays": 127, "end_window": 86400, "assets": [{"asset_id":"d9506ab97e091007a74b[...]"}], "credentials": [], "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GW[...]", "name": "1b-PING Monitor", "description": null, "profiles": [{"profile_id": "WL7B4CWE5Y6N414N1[...]"}], "probes": [{"probe_id": "LOQ465XQQXJHS0JW15[...]", "name": "PING Monitor", "short_message": "", "command": "icmp_echo.exp %s", "description": "", "locked": 0, "enabled": 1, "unit": "", "autoscale": 0, "probe_groups": [{"probe_group_id": "CUEJIM0KAA28GWSB1[...]"}] }] }] }] }] } RESP_CODE: ``200`` DELETE .......... ``/v2/configs/assets`` * Example 1: Delete Asset Input Data :: {"asset_id": "d9506ab97e091[...]"} Command :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1[...] --insecure -w RESP_CODE: %{response_code} -d@./test/input_data.json -X DELETE https://10.13.37.14/api/v2/configs/assets or :: curl -s -H x-lxt-api-token:eyJ0eXAiOiJKV1QiLC[...] --insecure -w RESP_CODE: %{response_code} -X DELETE https://10.13.37.14/api/v2/configs/assets/d9506ab97e09100[...] Output (formatted): :: {"status":null, "message":null, "data":[]} RESP_CODE: ``200``