djedig Absent Member.
Absent Member.
965 views

changing bundle display name programatically

We have a somewhat sophisticated requirement for copying bundles between zones and conducting a number of bundle-related checks in the middle of this process. An apparently suitable mechanism is using zman betf / zman bsetf in the source zone to get the export data, decode it for processing by the relevant bundle-related checks, mangle the data as necessary and use it for zman bc / zman bss in the destination zone.

All of this is already a working proof-of-concept, with one (well, two) exceptions:
1. the new bundle's display name is not being set to what the export data says it should be
2. the icon is not being exported with betf and thus cannot be re-imported using bc

We've actually solved 2. by using the undocumented zenworks-bundleadmin SOAP service in undocumented ways (Powershell code follows):


$ZCMServer = "localhost"
$SourceBundlePath = "/Bundles/My/TestBundle"
$DestBundlePath = "/Bundles/My/AnotherBundle"
$SOAPBundleAdmin = New-WebServiceProxy -Uri "http://$ZCMServer/zenworks-bundleadmin/?wsdl" -Credential $ZenCredential

# Get the bundle icon
$BundleIcon = $SOAPBundleAdmin.getBundleIcon($SourceBundlePath)

# Set the bundle icon
If(-not $SOAPBundleAdmin.setBundleIcon($DestBundlePath, $BundleIcon)) {
Throw "Could not set Icon for Bundle '$DestBundlePath' - setBundleIcon has returned 'false'."
}


But so far we could not find a viable approach to change the bundle's display name. Zman has no relevant commands in its command set and using the SOAP API seems not as straightforward as it is for the bundle icon:

$MyBundle = $SOAPBundleAdmin.getByUID($DestBundlePath)
$MyBundle.DisplayName = "My Another Bundle"
$SOAPBundleAdmin.update($MyBundle)
Exception calling "update" with "1" argument(s): "got "ELEMENT_START" ("<IsEnabled"), expected "ELEMENT_END""
At line:1 char:1
+ $SOAPBundleAdmin.update($MyBundle)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : SoapException


So I am open to suggestions, although I would be especially interested in solutions involving the SOAP API.
Labels (1)
Tags (3)
0 Likes
6 Replies
Micro Focus Expert
Micro Focus Expert

Re: changing bundle display name programatically

Confirmed all of your observations....which actually surprised me.

For the "Bundle Display Name"...it appears that "zman bc" uses the Bundle Name to populate that field, regardless of the value of the "Display Name".
One option would be to edit the XML to alter the Bundles Name, Import it, and then use ZMAN to rename the bundle.

No...Not Ideal....

FYI....
Bundle Export/Import via the ZCC seems to handle the Icon stuff correctly.
The Display Name is handle "Different" where that becomes the default Bundle Name...Not sure that is any more correct....but at least that is requires responding to prompts...
0 Likes
Highlighted
djedig Absent Member.
Absent Member.

Re: changing bundle display name programatically

Craig, thanks for trying to help out here. I tried thís:

One option would be to edit the XML to alter the Bundles Name, Import it, and then use ZMAN to rename the bundle.


but apparently, zac br does change the display name as well if it did match the bundle name previously. So unfortunately, this is not gaining me much.

Do you have any options for finding someone who could get me example code for setting the display name through zenworks-bundleadmin on from getByUID()? The language of choice really does not matter much - Java would do just as fine as would pure example SOAP HTTP body data.

Alternatively, if we would stand a chance of getting a patch where zman bc would honor the DisplayName attribute in the XML data and set the display name accordingly, we would file a bug. But this is our less-favored option as experience shows that bug resolution could take quite a while.

Kind regards,
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: changing bundle display name programatically

A Service Request would be the best way to go.
If you can't create one, let me know.

If you create an SR, I can try and track it to make sure it is in good hands....though I won't be in the office next week.
0 Likes
djedig Absent Member.
Absent Member.

Re: changing bundle display name programatically

Craig,

I've mailed our PSE: New SR # 101207940591 has been created. ZCM 2017.3: zman bc not setting bundle display name
I mostly used the text from my original forum post, leaving out the .SetIcon() stuff.

Kind regards,
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: changing bundle display name programatically

It's in Good hands....I linked this thread on the internal notes....The Engineer has good dev contacts so they should be able to help you figure out a solution that is workable....
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: changing bundle display name programatically

Note: In the end...I think Soap would likely be best too, mostly because it would not have any potential impact upon other customers. For Example, while I find the current behavior curious and surprising...Fixing it may unexpectedly impact others.
I'm always leery about changing existing behavior...no matter how logical a change may be.

Finding the SOAP commands for your own use, would not impact others and would most likely serve your needs better.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.