RESTAPI baseline source fixlet site

I’m building a process that can transfer baselines from one root to another and maintain the source fixlet links. I have a process that works well IF the source fixlet and baseline are in the same site.

The question is, based off of the xml returned from:
https://server.domain:52311/api/baseline/custom/site/ID

…How do I tell the source site of the fixlet SourceID? I see the SourceSiteURL=“http://server:52311/cgi-bin/bfgather.exe/actionsite” in the BaselineComponent, but I don’t think that tells me where to query for the source fixlet.

Here’s a little more visual info:

Any thoughts on this? How can I tell where the source fixlet is from in a baseline?

@steve, I had pulling people into conversations like this… but I’m desperate. Could you send someone my way on this topic?

Site ID’s are not consistent often from one deployment to the other so you will have a big difficulty knowing which site each is. The IDs are assigned by the deployment so the same external site could be 2 on one deployment and 25 on another

Each component pulled from existing content is uniquely identified by the SourceSiteURL, SourceID and ActionName. So you would need to specify the SourceSiteURL (the site that the content is from), the SourceID (fixlet ID), and ActionName (usually Action1). External sites will always have the same SourceSiteURL. The action site and custom sites will have different hostnames/ports in their URL for each deployment.

Doesn’t totally help me. Most of the SourceSiteURL’s listed are …/cgi-bin/bfgather.exe/actionsite which doesn’t help me at all (or don’t think so). I don’t see how that gives me a path to the source fixlet xml in any way.

<BaselineComponent Name="Software package 1" IncludeInRelevance="true" SourceSiteURL="http://server.dom:52311/cgi-bin/bfgather.exe/actionsite" SourceID="1094" SyncStatus="synchronized" ActionName="Action1">

I guess what I’m hoping or thinking I need is what I can gather as the “Display Names of Sites” of the source fixlet. Here’s my process:

  1. search for baselines in site on source root
  2. for each baseline, search for source fixlet
  3. if fixlet doesn’t exists on dest root, get source source xml, and import into dest root
  4. gather IDs for dest fixlets, update stored source xml SourceID with new fixlet IDs
  5. import updated xml to dest root

I feel like there should be a “Resource” path to get that source xml like when you query for a site’s baselines:

<Baseline Resource="https://krem-dev-dse.kroger.com:52311/api/baseline/custom/name/12345" LastModified="Wed, 06 Sep 2017 23:48:29 +0000">
<Name>Software package 1</Name>
<ID>12345</ID>
</Baseline>

…From that, there is a clear path to getting the linked items information.

I’ve been able to hobble together some relevance to query for this, but it’s a guess at best. Thanks for taking a look guys.

Actually that actionsite URL should be the correct site URL for any piece of custom content you have. Internally all custom site content is associated with the actionsite because all fixlet IDs are unique across all opsites and custom sites. The trick will be that the SourceID will change across deployments, so you will need to search for the proper ID, which you can do using session relevance.

We considered using Resource as the link, but you would still have to do the same query to check for the content, and then construct the resource link. Since you can’t query for fixlets by name using the fixlet resource in REST API, you will have to use session relevance which can output the site URL and ID, but not the API resource URL. If you want to post your relevance, we can suggest if there is a better version of it.

OK, so then I guess this is the workflow. Once I query for the fixlet:

(item 0 of it as string,
	item 1 of it as string) 
of (
	(if (exists Names of Sites of it | false) 
		then (concatenations "%0A" of (Names of Sites of it as string)) 
		else ("<none>")), 
	(if (exists ID of it | false) 
		then (concatenations "%0A" of (ID of it as string)) 
		else ("<none>"))) 
of bes fixlets 
		whose ((Name of it as string = "Software package 1") AND
			(Baseline Flag of it = False))

…I use that result (pray there is only one) to match up the “Names of Sites” with what I find in:

https://server.dom:52311/api/sites

Grabbing the <GatherURL> value from the node where the <Name> site matches the results above, but also removing “https://server.dom:52311/api/site” from that value to get me the “custom/software”, “external/Enterprise%20Security”, “operator/userid” or something like that. That way I can get the full path of the xml

https://server.dom:52311/api/fixlet/custom/software/12345

…so it that my shortest path?

Try this instead:

((if custom flag of it then url of bes site whose (master site flag of it) else url of site of it), id of it) of bes fixlets whose (name of it as string = "Software package 1" AND not baseline flag of it)