Get All Equipments Examples (Bulk Information Transfer)

Overview

GET /networkinventory/equipments request shall be used to retrieve list of all Equipments stored in OMS

Here described is an example of Get All Equipments

GET All Equipments

Below is code snippet to retrieve all equipments.


public class BulkUplaodService extends Service {
	/**Retrieve all the equipments */
	public List<String> getAllEquipments(OMSRestTemplate restTemplate) {
		return retrieveData (restTemplate"/networkinventory/equipments");
	}

	/**
	*
	* retrieves list of json files to be download
	*
	* */
	public List<String> retrieveData (OMSRestTemplate restTemplate, String urlSuffix) {
		List<String> retData= new ArrayList <String>();

		/**Url to retrieve equipment json file*/
		String custUrl = restTemplate.getUrlPrefix() + urlSuffix; //"/networkinventory/equipments";
//?userid=ECmdKGhCKVqxOwMqdli62w==&password=zGwL2f+0s44QqnRUAhJSKQ==";

		/**retrieve json file path*/
		JsonNode networkDataFileList = restTemplate.getForObject(custUrl, JsonNode.class);
		downloadFiles(restTemplate, retData, networkDataFileList, restTemplate.getUrlPrefix());

		return retData;
	}
	/**
	*

JSON Request


/oms1350/networkinventory/equipments

JSON Response


/oms1350/web/eqm/data/1459269625353GetAllEQPTResponse.json

Download the JSON Response files

Below is code snippet to download the response json files.


/**
*
* Download all the json files.
*
* @param restTemplate - Spring Rest Template 
* @param retData - Response data which is returned
* @param networkDataFileList - JSON Response files to be downloaded
* @param urlPrefix - OMS base path
*
*/
private void downloadFiles(OMSRestTemplate restTemplate, List<String> retData, JsonNode networkDataFileList, String ) {
	String url;
	Iterator<JsonNode> it = networkDataFileList.iterator();

	/** Iterator over all the files and download*/
	while (it.hasNext ()) {
		String filePath = it.next().textValue();
		url = urlPrefix + filePath.replace("oms1350/", "") ;//+ "?userid=ECmdKGhCKVqxOwMqdli62w==&password=zGwL2f+0s44QqnRUAhJSKQ==";
		System.out.println( "URL : " + url);
		String jsonResp = restTemplate.getForObject(url String.class);
		retData.add(jsonResp);
	}
}

JSON Request


/oms1350/web/eqm/data/1459269625353GetAllEQPTResponse.json

JSON Response


[
{
	"R14_AUTO_NODE_05": [
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "11DPE12A-6-6",
			"equipmentType": "Card",
			"provisionedType": "11DPE12A",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": "QinQ",
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "11STAR1A-4-4",
			"equipmentType": "Card",
			"provisionedType": "11STAR1A",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "130SCX10-4-11",
			"equipmentType": "Card",
			"provisionedType": "130SCX10",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "130SNX10-4-13",
			"equipmentType": "Card",
			"provisionedType": "130SNX10",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"equipmentName": "1UD200-6-9",
			"equipmentType": "Card",
			"provisionedType": "1UD200",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AUMA",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "1UD200-8-10",
			"equipmentType": "Card",
			"provisionedType": "1UD200",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "1UD200-8-8",
			"equipmentType": "Card",
			"provisionedType": "1UD200",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "20P200-8-7",
			"equipmentType": "Card",
			"provisionedType": "20P200",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "20P200-8-9",
			"equipmentType": "Card",
			"provisionedType": "20P200",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "2UC400-10-20",
			"equipmentType": "Card",
			"provisionedType": "2UC400",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AUMA",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "2UC400-5-1",
			"equipmentType": "Card",
			"provisionedType": "2UC400",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AUMA",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "30AN300-15-3",
			"equipmentType": "Card",
			"provisionedType": "30AN300",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "30AN300-5-2",
			"equipmentType": "Card",
			"provisionedType": "30AN300",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AUMA",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				"neType": "1830PSS-32"
			}
		},
		{
			"neName": "R14_AUTO_NODE_05",
			"equipmentName": "32EC2-6-2",
			"equipmentType": "Card",
			"provisionedType": "32EC2",
			"actualType": null,
			"installedPartNumber": null,
			"installedVersion": null,
			"installedSerialNumber": null,
			"cardMode": null,
			"holderState": "EXPECTED_AND_NOT_INSTALLED",
			"pluggableTypes": null,
			"primaryState": "OOS-AU",
			"protectionRole": null,
			"attributeNameValue": {
				"protectionMode": null,
				"expectedPFAmps_PFB": null,
				"expectedPFAmps_PFA": null,
				"expectedPFAmps": null,
				"oprMode": null,
				"provisionedDistance": null,
				"shelfVoltageFloor": null,
				"maxAddChannelCount": null,
				"lineCount": null,
				"pathTargetPower": null,
				"provisionedFiberType": null,
				"fiberType": null,
				neType": "1830PSS-32"
			}
		}
	 ]
 }
 ]

Main Class

Following shows the client code snippet in main class to retrieve all the equipments.


public class OmsRestClientApplication {
	public static void main(String[] args) {
		AuthInfo authInfo = new AuthInfo();
		authInfo.setServerIP("135.250.184.42");
		authInfo.setServerPort("8443");
		authInfo.setServerUser("alcatel");
		authInfo.setServerPwd("Lucent1.!");
		authInfo.setPresentationIP("135.250.184.43");

		/**create OMSRestTemplate instance**/
		OMSRestTemplate omsRestTemplate = new OMSRestTemplate ();

		/**authenticate*/
		omsRestTemplate.authenticate(authInfo);

		BulkUplaodService bSvc = new BulkUplaodService ();
		List<String> resp = bSvc.getAllEquipments(omsRestTemplate);
	}
}