To use this function add it to the class library file named vCenterVAPIService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterVAPIService.ts
Function findTagsByCategoryID
privatefindTagsByCategoryID(objVAPIClient:VAPIClient,strTagCategoryID:string):com_vmware_cis_tagging_tag__model[]{
letobjVAPITaggingTag: com_vmware_cis_tagging_tag=newcom_vmware_cis_tagging_tag(objVAPIClient);
letarrTagIDs:string[]=objVAPITaggingTag.list_tags_for_category(strTagCategoryID);
letarrVMwareCISTaggingTagModel: com_vmware_cis_tagging_tag__model[]=arrTagIDs.map((strTagID:string): com_vmware_cis_tagging_tag__model=>{
letobjVMwareCISTaggingTagModel: com_vmware_cis_tagging_tag__model=objVAPITaggingTag.get(strTagID);
returnobjVMwareCISTaggingTagModel;
});
returnarrVMwareCISTaggingTagModel;
}Function findTagIDByNameFromSpecificCategoryID
privatefindTagIDByNameFromSpecificCategoryID(objVAPIClient:VAPIClient,strTagName:string,strTagCategoryID:string):string{
letarrVMwareCISTaggingTagModel: com_vmware_cis_tagging_tag__model[]=this.findTagsByCategoryID(objVAPIClient,strTagCategoryID);
letobjVMwareCISTaggingTagModel: com_vmware_cis_tagging_tag__model=arrVMwareCISTaggingTagModel.find((objVMwareCISTaggingTagModel: com_vmware_cis_tagging_tag__model):boolean=>{
returnobjVMwareCISTaggingTagModel.name===strTagName;
});
returnobjVMwareCISTaggingTagModel.id;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
