<h2>CAPI MID server Selection process</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><style type="text/css"><!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } table tr td { padding: 15px; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } hr{ border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc; } ul { list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --></style> <div class="margin"> <h1>Overview</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <p style="padding-left: 30px;">While working with Discovery and Discovery schedules, there is an opportunity to select a specific MID server to execute discovery on a specific device, but, working with discovery on Cloud Resources (AWS/Azure.. Etc) we do not have the option to select any specific MID server.</p> <p style="padding-left: 30px;">This article will demonstrate on the Background code /logic on how the Discovery of Cloud resources chooses the MID server. </p> <h1>The "capiSvrScript.findMatchingMid()"</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <ul style="list-style-position: inside;"><li><strong>capiSvrScript.findMatchingMid()</strong> is a java scripted API.</li><li>In this method, the function gets all matching MIDs based on capabilities and then we get active MID, again, based on capabilities, target, and other parameters. </li><li>After that, we call the override MID (<a title="Override the MID Server selection filter" href="https://docs.servicenow.com/csh?topicname=override_mid_server_selector.html&version=latest">Override the MID Server selection filter</a>)</li><li>The javascript at platform level cannot be modified. </li></ul> <h1> </h1> <h1>Additional Information</h1> <hr style="border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc;" /> <p style="padding-left: 30px;">It might be necessary to have the flexibility to select the MID server for Cloud discovery or Cloud operations, as of now, according to capiSvrScript.findMatchingMid() API it is not possible, we using override ScriptInclude to customize. This can be achieved by modifying the 'overrideMid()' method in <strong>'CAPIMidSelector'</strong> script include.</p> <p style="padding-left: 30px;">Refer: <a title="Mid Server Selection For Cloud Management(CMPv2)" href="https://support.servicenow.com/kb_view.do?sysparm_article=KB0690238" target="_blank" rel="noopener noreferrer">Mid Server Selection For Cloud Management(CMPv2)</a></p> </div></section></div></article></div>