Direct download link for MID server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 03:56 PM
Hello,
I wanted to automate the installation of the MID server across multiple accounts and needed to automate the download of the MID server install. Is there a set of direct download links? We could always download the version we need and host it ourselves but it would be nice if we could do a curl / wget and download the installation file via a link that points to the latest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2020 07:58 PM
I attempted to do this once. Didn't finish it, but that was simply due to my attention span and lack of programming knowledge outside of the ServiceNow and not the tasks feasibility.
To start, as you may know, the URLs for the MID Server installation files will change every time you upgrade/patch your instance. There's no way around this.
Thankfully, there's a UI Page in all instances that we all use to download our MID Server installation files that can help with this. That UI Page is "mid_server_download_ui" - https://<instance>.service-now.com/nav_to.do?uri=sys_ui_page.do?sys_id=cd0a66a90a0a0b71001a2124a83c44d3
In this UI page, within the HTML section there is a Jelly script that builds an object that is eventually displayed on this UI Page giving you your download options.
I took this script and stripped away all the crap I didn't need. Since I would only ever download the Windows 64-bit installer, I was able to take this 20+ line script and cut it down to three lines (see below). I then took this more efficient script and set it to run after every upgrade/patch/hot-fix, writing the URL for the MID Server OS I wanted to a system property that I created.
//Script
var buildstamp = gs.getProperty('mid.buildstamp');
//For the "windows" and "x86-64" values below, see the "packages" object in the UI Page. It has all your options
var url = new MIDPackageUriFactory(new MIDPackage('mid', buildstamp, 'windows', 'x86-64'), 'attachment_download').getUris(1)[0]
gs.setProperty("<system property>",url);
From there, my plan was to then pull that system property's value via the REST API so I'd have the most-up-to-date URL for the install files I need based on my instance version. I never completed this last part 😞
I'm not sure if there's a most efficient or proper way of handling this, but this approach made sense to me and you shouldn't have any issues completing the remaining steps assuming someone on your end can automate the download/install steps.
Hopefully this helps!
Edit: Adding the URL for one of their more recent MID Server packages to showcase how dynamic the URLs can be. Looking at the directory structure and file name and you'll see what I mean - https://install.service-now.com/glide/distribution/builds/package/mid/2020/01/12/mid.orlando-12-11-2019__patch0-hotfix1-01-08-2020_01-12-2020_1944.windows.x86-64.zip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2020 07:32 AM
Thats a very clever way of externalizing the dynamic url since the part that isn't static is the build timestamp and path. It would be nice if there was just an ftp site / path for latest that is maintained by servicenow for each OS so we could just directly grab / link to the latest versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2021 11:16 AM
Run the following as a background script:
var buildstamp = gs.getProperty('mid.buildstamp')
var m = new MIDPackage('mid', buildstamp, 'linux', 'x86-64');
var uri = new MIDPackageUriFactory(m, 'attachment_download').getUris(1)[0];
gs.print(uri);