To get all the devices on the network, use the GetNetworkDevices
method. The library delivers a collection of Metasys object items. If you want to filter the response, the method accepts a parameter.
To get the device types on the network, use the GetNetworkDeviceTypes
method. The library delivers a collection of MetasysObjectType
items.
Library method name |
GetNetworkDevices
|
---|---|
Description | Get all devices on the network. |
Method signature |
IEnumerable<MetasysObject> GetNetworkDevices(string type = null);
|
Method input parameters |
Optional
|
Return value | A collection of MetasysObjects that represent the devices. |
The following .NET C# code is an example of a successful Metasys object response.
List<MetasysObjectType> types = client.GetNetworkDeviceTypes().ToList();
Console.WriteLine(types[0]);
/*
{
"Description": "NAE55-NIE59",
"DescriptionEnumerationKey": "objectTypeEnumSet.n50Class",
"Id": 185
}
*/
int type1 = types[0].Id;
List<MetasysObject> devices = client.GetNetworkDevices(type1.ToString()).ToList();
MetasysObject device = devices.LastOrDefault();
Console.WriteLine(device);
/*
{
"ItemReference": "Win2016-VM2:vNAE2343996",
"Id": "142558f8-c4c7-5f89-be97-d806adb72053",
"Name": "vNAE2343996",
"Description": "",
"Type": null,
"TypeUrl": "https://win2016-vm2/api/v2/enumSets/508/members/185",
"Category": null,
"Children": [],
"ChildrenCount": 0
}
*/