RENAMELABEL and Vault 9.1 API Question/Request
Posted: Fri Mar 04, 2016 10:21 am
We use RENAMELABEL as part of our promotion process.
Ex. Need to promote 5 files from DEV to PRODUCTION
file: a ---> Label: promote_a
file: b ---> Label: promote_a
file: c ---> Label: promote_a
file: d ---> Label: promote_a
file: e ---> Label: promote_a
We use GETLABELS to have vault write those updates to the production server. Once it writes to the production server, we use RENAMELABEL to add a prefix to the label: _prod_
RENAMELABEL -repository [repository] [item] [from_label] [to_label]
RENAMELABEL -repository Chicago $/datamgmt/script/a promote_a _prod_promote_a
file: a ---> Label: _prod_promote_a
RENAMELABEL -repository Chicago $/datamgmt/script/b promote_a _prod_promote_a
file: b ---> Label: _prod_promote_a
RENAMELABEL -repository Chicago $/datamgmt/script/c promote_a _prod_promote_a
file: c ---> Label: _prod_promote_a
RENAMELABEL -repository Chicago $/datamgmt/script/d promote_a _prod_promote_a
file: d ---> Label: _prod_promote_a
RENAMELABEL -repository Chicago $/datamgmt/script/e promote_a _prod_promote_a
file: e ---> Label: _prod_promote_a
This works fine for small promotion jobs. The problem is when a developer needs to move an entire folder or a lot of programs (which happens about 20% of the time.)
i.e. Right click on Chicago repository's $/projecta and label it promote_projectA ( contains 7 folders each with 200 programs)
In this case, we have to loop through every program to see if the label was created for the file. If so, rename the label...then it goes to loop through each of the directory names to see if a label was placed on it and if so, rename the label.
So in this example, it has to loop through 1400 programs (none of which have a label to be renamed since the label was done on the root folder + each RENAMELABEL command takes between 10 and 15 seconds.) And then it loops through the 7 folders (none of which have a label to be renamed since the label was done on the root folder.) Finally, it checks the root folder and renames the label to _prod_promote_projectA.
There is no way to short circuit this process without the possibility of failing to rename a file or folder from a different location but containing the same label.
This type of promotion occurs about 20% of the time.
What we would like is a C# code and/or a CLI program that allows all files/folders with a given label to be updated all at once.
So instead of :
RENAMELABEL -repository [repository] [item] [from_label] [to_label]
RENAMELABEL -repository Chicago $/datamgmt/script/a promote_projectA _prod_promote_projectA
Because of the [item] we have to loop through each and every file and folder to renamelabel one at a time.
Ideal usage:
RENAMELABELS -repository [repository] [from_label] [to_label]
RENAMELABELS -repository Chicago promote_projectA _prod_promote_projectA
or
RENAMELABEL -repository [repository] -wildcard [yes|no] [item(s)] [from_label] [to_label]
RENAMELABEL -repository Chicago -wildcard yes * promote_projectA _prod_promote_projectA
This would look for all files and folders in the "Chicago" repository with the label "promote_projectA" and change it to "_prod_promote_projectA"
The command only needs to be triggered once and could save hours of processing time and a lot of extra code.
Is there any existing part of the API that we can leverage to make this happen? If not, can we request that you add this ability in the next release? This single problem is responsible for a lot of wasted time and is prone to errors.