---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# MIDServer - Global

# MIDServer - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 20 minutes to read

The MIDServer script include provides methods to encapsulate the notion of a MID Server.

Use these methods in server scripts to manage a MID Server using Ajax.

## MIDServer - getByName(String name) {#ariaid-title2}

Returns the specified MID server.
{#r_MSVR-getByName_S__table_j3v_5tf_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The MID server name |
[Table 1. Parameters]

{#r_MSVR-getByName_S__table_j3v_5tf_zt} {#r_MSVR-getByName_S__table_k3v_5tf_zt__entry__2}

| Type | Description |
|-|-|
| GlideRecord | The record of the requested MID server. |
[Table 2. Returns]

{#r_MSVR-getByName_S__table_k3v_5tf_zt}  
The following example shows how to access and display mid server details.

    // Get a mid server object by name
    var ms = MIDServer.getByName("windows_mid");

    // Stringify the object for display purposes
    gs.info(JSON.stringify(ms, null, 2));

    // Show the value of each API property 
    gs.info('hostmane ' + ms.hostname);
    gs.info('hostOS ' + ms.hostOS);
    gs.info('ip ' + ms.ip);
    gs.info('name ' + ms.name);
    gs.info('routerIP ' + ms.routerIP);
    gs.info('status ' + ms.status);
    gs.info('sysID ' + ms.sysID);
    gs.info('url ' + ms.url);
    gs.info('version ' + ms.version);
    gs.info('windowsDomain ' + ms.windowsDomain);

Output:

    *** Script: {
      "valid": true,
      "sysID": "3cb25f0f874b3410c3a99999cebb35ba",
      "name": "windows_mid",
      "url": null,
      "hostname": "myHostname.service-now.com",
      "hostOS": "Windows",
      "version": "fixed",
      "ip": "10.11.128.184",
      "routerIP": "10.11.128.1",
      "network": "10.11.128.0/22",
      "windowsDomain": null,
      "status": "Up",
      "validated": "true",
      "userName": "MID_Profile"
    }
    *** Script: hostname myHostname.service-now.com
    *** Script: hostOS Windows
    *** Script: ip 10.11.128.184
    *** Script: name windows_mid
    *** Script: routerIP 10.11.128.1
    *** Script: status Up
    *** Script: sysID 3cb25f0f874b3410c3a99999cebb35ba
    *** Script: url null
    *** Script: version fixed
    *** Script: windowsDomain null

## MIDServer - getDefault(DiscoverySchedule schedule) {#ariaid-title3}

Returns the MID server associated with the specified schedule (the MID server with the
same name). If there is no associated MID server, gets the next MID server in the ecc_agent
table.
{#r_MSVR-getDefault_S__table_jpd_gvf_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| schedule | DiscoverySchedule | The discovery schedule |
[Table 3. Parameters]

{#r_MSVR-getDefault_S__table_jpd_gvf_zt} {#r_MSVR-getDefault_S__table_kpd_gvf_zt__entry__2}

| Type | Description |
|-|-|
| GlideRecord | The MID server |
[Table 4. Returns]

{#r_MSVR-getDefault_S__table_kpd_gvf_zt}

## MIDServer - getForPing(DiscoverySchedule schedule, DiscoveryRange range) {#ariaid-title4}

Returns the MID Server with the specified schedule and range set.
{#r_MSVR-getForPing_S_S__table_vp1_t5f_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| schedule | DiscoverySchedule | The discovery schedule |
| range | DiscoveryRange | The discovery range set |
[Table 5. Parameters]

{#r_MSVR-getForPing_S_S__table_vp1_t5f_zt} {#r_MSVR-getForPing_S_S__table_wp1_t5f_zt__entry__2}

| Type | Description |
|-|-|
| GlideRecord | The MID server |
[Table 6. Returns]

{#r_MSVR-getForPing_S_S__table_wp1_t5f_zt}

## MIDServer - hostname {#ariaid-title5}

The name of the MID server's host.
{#r_MSVR-hostname__table_yrz_mk1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| hostname | String | The name of the MID server's host. |
[Table 7. Field]

{#r_MSVR-hostname__table_yrz_mk1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-hostname__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

q

## MIDServer - hostOS {#ariaid-title6}

The operating system of the MID server's host.
{#r_MSVR-hostOS__table_bky_vk1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| hostOS | String | The operating system of the MID server's host. |
[Table 8. Field]

{#r_MSVR-hostOS__table_bky_vk1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-hostOS__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - ip {#ariaid-title7}

The IP address of the MID server's host.
{#r_MSVR-ip__table_brg_nl1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| ip | String | The IP address of the MID server's host. |
[Table 9. Field]

{#r_MSVR-ip__table_brg_nl1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-ip__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - name {#ariaid-title8}

Name of the MID server.
{#r_MSVR-name__table_evt_yj1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Name of the MID server |
[Table 10. Field]

{#r_MSVR-name__table_evt_yj1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-name__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - network {#ariaid-title9}

The network containing the MID server's host.
{#r_MSVR-network__table_d3s_dm1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| network | String | The network containing the MID server's host. For example, "10.10.10.0/24" or "10.10.10.0/255.255.255.0". |
[Table 11. Field]

{#r_MSVR-network__table_d3s_dm1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-network__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - routerIP {#ariaid-title10}

The IP address of the MID server host's default router.
{#r_MSVR-routerIP__table_tgy_5l1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| routerIP | String | The IP address of the MID server host's default router. |
[Table 12. Field]

{#r_MSVR-routerIP__table_tgy_5l1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-routerIP__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - status {#ariaid-title11}

The MID server's status ("Up" or "Down").
{#r_MSVR-status__table_qtc_1n1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| status | String | The MID server's status ("Up" or "Down"). |
[Table 13. Field]

{#r_MSVR-status__table_qtc_1n1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-status__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - sysID {#ariaid-title12}

The sys_id of the MID server record.
{#r_MSVR-sysID__table_ojq_qj1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| sysID | String | The sys_id of the MID server record. |
[Table 14. Field]

{#r_MSVR-sysID__table_ojq_qj1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-sysID__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - url {#ariaid-title13}

The URL the MID server uses to contact the instance.
{#r_MSVR-url__table_z5r_fk1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| url | String | The URL the MID server uses to contact the instance. |
[Table 15. Field]

{#r_MSVR-url__table_z5r_fk1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-url__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - version {#ariaid-title14}

Version of the MID server (WAR name).
{#r_MSVR-version__table_czl_fl1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| version | String | Version of the MID server (WAR name). |
[Table 16. Field]

{#r_MSVR-version__table_czl_fl1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-version__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null

## MIDServer - windowsDomain {#ariaid-title15}

Windows domain of the MID server's host (if it is a Windows machine).
{#r_MSVR-windowsDomain__table_rnk_pm1_t5__entry__3}

| Name | Type | Description |
|-|-|-|
| windowsDomain | String | The Windows domain of the MID server's host. |
[Table 17. Field]

{#r_MSVR-windowsDomain__table_rnk_pm1_t5}  
The following example shows how to execute and return all parameters of an available Mid
server.

    var getMIDServerAttributes = new MIDServer(<mid_sys_id>); //Pass the sys id of the MID server record
    var midServerHostname = getMIDServerAttributes.hostname; //would return the Host name of the MID Server Record
    var midServerHostOS = getMIDServerAttributes.hostOS; // would return the Host OS of the MID Server Record
    var midServerIP = getMIDServerAttributes.ip; //would return the IP of the MID Server Record
    var midServerName = getMIDServerAttributes.name; //would return the Name of the MID Server Record
    var midServerRouterIP = getMIDServerAttributes.routerIP; //would return the router IP of the MID Server Record
    var midServerStatus = getMIDServerAttributes.status; //would return the status of the MID Server Record (UP or Down)
    var midServerSysID = getMIDServerAttributes.sysID; // Would return the Sys ID of the MID server record
    var midServerURL = getMIDServerAttributes.url; // Would return the URL of the MID server record
    var midServerVersion = getMIDServerAttributes.version; // Would return ServiceNow release version of the MID server record
    var midServerwindowsDomain = getMIDServerAttributes.windowsDomain; // Would return windows domain of the MID server record

    gs.info("\nMID Server Host Name - "+ midServerHostname +"\nMid Server Host OS - " + midServerHostOS + "\nMID Server IP - "+ midServerIP + "
    \nMID Server Name - " + midServerName + "\nMID Server Router IP - " + midServerRouterIP + "\nMID Server Status - " +  midServerStatus  + 
    "\nMID Server SYS ID - " + midServerSysID  + "\nMID Server URL - " + midServerURL  + "\nMID Server Version - " + midServerVersion + 
    "\nMID Server Windows Domain - " + midServerwindowsDomain);

{#r_MSVR-windowsDomain__midserverAPI_example1_cb}

Output:

    MID Server Host Name - midSvrName.service-now.com
    Mid Server Host OS - Windows
    MID Server IP - 10.11.999.999
    MID Server Name - Windows MID
    MID Server Router IP - 10.11.111.1
    MID Server Status - Up
    MID Server SYS ID - <mid_sys_id>
    MID Server URL - null
    MID Server Version - fixed
    MID Server Windows Domain - null


