From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Return SystemLink Feed URI from Name

Solved!
Go to solution

I'm wondering if there's any available way to programatically return a Systemlink Feed URL if I have the name to a feed that I want.  I can do this manually by looking at my System Link Server in the Feed Settings, but I want to do it programatically.  I'm currently using the https://github.com/allenh-ni/systemlink-repo-api-labview, but don't see a vi to do this.  I thought maybe it would be the "Get Feed ID.vi" in the support folder of the API, but that seems to return a different string.  My end goal is to use the name of a feed I just programatically created and return the URL, so I can subscribe to it with an NI Package Manager feed.

Steven Dusing
CLA, CTA
0 Kudos
Message 1 of 6
(3,762 Views)

Hi sdusing,

I would generally recommend just using the LabVIEW API rather than any of the Supporting VIs. I built a quick example using the function List All SystemLink Feeds.vi. The input is a "SystemLink Repo in" object that you can get from Open SystemLink Connection.vi. I then used some array primitives to give a Feed Name as a string and see if one of the elements of the SystemLink Feed Names array matches. Then grab that index, and use Index Array at the given index value to pull out the Feed ID. The Feed ID is part of the URL, so I added a simple build string using <base SystemLink URL>/#packagerepository/feed/<Feed ID>. I'm sure you could further expand on this with logic to check the URL, or other VIs in the API like Check if SystemLink Feed Exists.vi

 

I attached a VI in LabVIEW 2018 as well as an image of the Front Panel and Block Diagram if you have an older version. The VI requires the API you originally linked be installed through VIPM. For other documentation questions, see https://forums.ni.com/t5/SystemLink/SystemLink-Web-Service-APIs/td-p/3661481 for a ZIP with PDFs of all the different HTTP APIs.

 

Best,

Chris D. | Applications Engineer | National Instruments

0 Kudos
Message 2 of 6
(3,732 Views)

Thank you for the response!  I'm not sure this is exactly what I'm looking for though.  I'd like to get the URL that I can see in the SystemLink UI.    For example, I have a systemlink feed that has a URL of:

 

https://systemlink.dmcinfo.com/nirepo/v1/files/feeds/dmc-application-update-manager

 

It appears that this feed URL does not include the feed ID in the name. I have attached a screenshot of the SystemLink UI showing this particular URL.  I want to be able to get this feed URL programatically.  The vi that you provided results in a different URL:

 

https://systemlink.dmcinfo.com/#packagerepository/feed/5c16f53376a3fc1b84df82ba

 

I appreciate any further thoughts you might have on this!

Steven Dusing
CLA, CTA
Download All
0 Kudos
Message 3 of 6
(3,727 Views)

Hi sdusing,

 

I talked through this with a colleague and I may have misunderstood your original question. The example from my last post is to get the explicit URL for the feed, i.e. a feed you can type into an internet browser to get to the feed configuration window. Reading back through your post, it looks like you were actually looking for the "Feed URL" property rather than the URL to get to the feed configuration. I attached a screenshot with the two differences.

 

For the Feed URL you would put into NI Package Manager, this will usually be based on the name of the feed with some minor modifications. Some caveats:

  • Feed names can only be alphanumeric, spaces, hyphens, or underscores.
  • When creating names, spaces and dashes are treated as essentially the same character. Spaces are replaced with dashes, dashes remain the same.
  • Alphanumeric characters are the same (case insensitive). Underscores remain the same.

For an example feed "SystemLink Software Feed", the Feed URL would be http://<servername>/nirepo/v1/files/feeds/systemlink-software-feed taking into account the caveats above. If we tried to create a second feed "SystemLink-Software-Feed", we would get an error that a feed with that name already exists. You could use the information above to reformat the feed name to replace spaces with dashes and use the server base URL to get the Feed URL.

 

Best,

Chris D. | Applications Engineer | National Instruments

Message 4 of 6
(3,725 Views)
Solution
Accepted by topic author sdusing

There isn't any call that fits exactly what you are looking for. However, there is a call that can be made which will return all of the feeds that are on the SystemLink server. You'll need to send an HTTP GET to <SystemLink Server Address>/nirepo/v1/feeds. That should return all feeds and each feed's attributes which includes the Feed URI. I've attached a LabVIEW VI that also demonstrates this call and outputs all feeds and their corresponding feed URIs. I used a VI that was downloaded with the SystemLink Repo API to extract data from the JSON.

 

The SystemLink Repo LabVIEW API actually uses the HTTP Get call if you dig a couple layers deep. Look specifically at the List All SystemLink Feeds.vi.

-----------------------------------------------
Brandon Grey
Certified LabVIEW Architect

Message 5 of 6
(3,714 Views)

Thank you both.  I think those are both two ways I can accomplish what I'm looking for.  It would be great if the SystemLink API came with a method to return the URL property from the feed name without having to do these workarounds.  Can I suggest that be added to future package releases? 

In the meantime I'll try to use GreyGrey's solution, as I think that will be more robust than trying to implement all of the string filtering rules myself.

Steven Dusing
CLA, CTA
0 Kudos
Message 6 of 6
(3,708 Views)