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 getTagCategories
privategetTagCategories(objVAPIClient:VAPIClient):com_vmware_cis_tagging_category__model[]{
letobjVAPITaggingCategory: com_vmware_cis_tagging_category=newcom_vmware_cis_tagging_category(objVAPIClient);
letarrTagCategoryID:string[]=objVAPITaggingCategory.list();
letarrVAPITagCategoryModel: com_vmware_cis_tagging_category__model[]=arrTagCategoryID.map((strTagCategoryID:string): com_vmware_cis_tagging_category__model=>{
letobjVAPITagCategoryModel: com_vmware_cis_tagging_category__model=objVAPITaggingCategory.get(strTagCategoryID);
returnobjVAPITagCategoryModel;
});
returnarrVAPITagCategoryModel;
}Function findTagCategoryIDByName.
privatefindTagCategoryIDByName(objVAPIClient:VAPIClient,strTagCategoryName:string):string{
letarrVAPITagCategoryModel: com_vmware_cis_tagging_category__model[]=this.getTagCategories(objVAPIClient);
letobjVAPITagCategoryModel: com_vmware_cis_tagging_category__model=arrVAPITagCategoryModel.find((objVAPITagCategoryModel: com_vmware_cis_tagging_category__model):boolean=>{
returnobjVAPITagCategoryModel.name==strTagCategoryName;
});
returnobjVAPITagCategoryModel.id;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
