Automating downloaded product versions using JSON API

Answered

Comments

5 comments

  • Avatar
    Anton Babinov

    Hi Pieter,

    for public releases we have the following urls publicly available:

    1. https://updates.vmsproxy.com/default/releases.json where default stands for nx witness and can be replaced with required product. This json tells available releases and download URL prefix, which can be used to generate download url. 

    2. https://updates.networkoptix.com/default/35270/packages.json - this url can be generated as <packages_urls>+<build number stripped from version>/packages.json

     

    2) I noticed the following discrepancies in the JSON file, making it difficult to deterministically create the download URL:

    If you'll get releases.json for required product customization you'll have update url prefix from it, so the only thing to keep in mind the following naming:

    digitalwatchdog - DW Spectrum
    default - Nx Witness
    metavms - Meta releases

    3) Is there an equivalent JSON API or a deterministic way to get the latest Beta/pre-release versions, without needing to visit the product page? Today I use VisualPing to be notified when the download page changes, but that is not deterministic or reliable. (I know Evgeny said no before, I hope that may have changed)

    At the moment only data for releases are available publicly via json file. 

     

     

    0
    Comment actions Permalink
  • Avatar
    Pieter Viljoen

    Thank you, the information was useful.

    I have a few questions as I've been writing code to reliably create stable, latest, and beta tags from versions.

    // TODO: Questions for Nx
    // - Do we need to use package_urls, or are the downloads always updates.networkoptix.com/{product}?
    // - If we use the build number for the download URL, can we be sure that build numbers are not reused between versions?
    // - What is the significance of the order of items in "packages_urls"?
    // - What is the significance of the order of items in and "releases"?
    //   - Is the first listed release the latest and the second the stable?
    //   - Can we relay on the order or should we sort by semver?
    // - How should I interpret the "release" and "beta" publication types?
    //   - Is the "publication_type" "beta" / "release" reliable to get pre-release builds?
    //   - Can I use the first "release" as latest, and the second as stable?
    //   - If there is one "beta" then there is only one "release", expect "beta", "release", "release"?
    // - The package downloads are zip files not installer files.
    //   - Releases do have DEB files published, but Beta releases only have ZIP files.
    // - ZIP filename and DEB filenames are different for "beta" releases".
    // - E.g. "metavms-server_update-5.1.0.35151-linux_x64-beta.zip" contains "metavms-server-5.1.0.35151-linux_x64-beta.deb".
    // - The discrepancy makes automation difficult.
    // - From analysis below, there is a discrepancy between versions reported by the cloud portal and the releases API.
    //   - How to reconcile?

    // NxWitness:
    // Downloads API: 5.0.0.35136
    // Releases API: 5.0.0.35270, 4.2.0.32840
    // Cloud Portal: 5.0.0.35136
    // Beta Portal: Stable: 5.0.0.35270
    // Logic: Latest: 5.0.0.35270, Stable: 4.2.0.32840
    // Discrepancy: Cloud portal and releases versions do not match?

    // NxMeta:
    // Downloads API: 5.0.0.35134 R10
    // Releases API: 5.1.0.35151 R1 (beta), 5.0.0.35134 R10
    // Cloud Portal: 5.0.0.35134 R10
    // Beta Portal: Release: 5.0.0.35134 R10, Beta: 5.1.0.35151 R1
    // Logic: Beta: 5.1.0.35151, Latest: 5.0.0.35134, Stable: 5.0.0.35134

    // DWSpectrum:
    // Downloads API: 4.2.0.32842
    // Releases API: 5.0.0.35271, 4.2.0.32842
    // Cloud Portal: 4.2.0.32842
    // Logic: Latest: 5.0.0.35271, Stable: 4.2.0.32842
    0
    Comment actions Permalink
  • Avatar
    Pieter Viljoen

    I got code working, waiting for your answers on previous post before I move forward.

    Interpreting builds and versions using release.json: https://github.com/ptr727/NxWitness/blob/develop/CreateMatrix/ProductInfo.cs

    Download ZIP or DEB and account for DEB name not matching ZIP name: https://github.com/ptr727/NxWitness/blob/develop/Make/Download.sh

    0
    Comment actions Permalink
  • Avatar
    Pieter Viljoen

    I noticed that NxWitness downloads and release API's today report the same version:

    Download: "version": "5.0.0.35270"
    Release: "version": "5.0.0.35270"
     
    But I also now see that release removed v4.2, and now only reports one version, so stable and latest will now be the same:
    {
        "packages_urls": [
        ],
        "releases": [
            {
                "product": "vms",
                "version": "5.0.0.35270",
                "protocol_version": 5002,
                "publication_type": "release",
                "release_date": "1659371734147",
                "release_delivery_days": null
            }
        ]
    }
    0
    Comment actions Permalink
  • Avatar
    Pieter Viljoen

    Sergey pointed me to the nx_open client, did not know it existed, I'll look at the pattern of use in your C++ update logic.

    0
    Comment actions Permalink

Please sign in to leave a comment.