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 ContentLibrarySubscriptionCreate
privateContentLibrarySubscriptionCreate(objVAPIContentLibrary:com_vmware_content_library__model,enumVAPIContentLibrarySubscriptionCreateSpecSubscribedLibraryTarget:com_vmware_content_library_subscriptions_create__spec__subscribed__library_target,objVAPIContentLibrarySubscriptionCreateSpecNewSubscribedLibrary:com_vmware_content_library_subscriptions_create__spec__new__subscribed__library,strSubscribedLibrary:string,objVAPIContentLibrarySubscriptionLocation:com_vmware_content_library_subscriptions_location,objVAPIContentLibrarySubscriptionCreateSpecVCenter:com_vmware_content_library_subscriptions_create__spec__vcenter,objVAPIContentLibrarySubscriptionCreateSpecPlacement:com_vmware_content_library_subscriptions_create__spec__placement):string{
letobjVAPIContentLibrarySubscriptions:com_vmware_content_library_subscriptions=newcom_vmware_content_library_subscriptions(this.objVAPIClient);
letobjVAPIContentLibrarySubscriptionCreateSpecSubscribedLibrary:com_vmware_content_library_subscriptions_create__spec__subscribed__library={
target:enumVAPIContentLibrarySubscriptionCreateSpecSubscribedLibraryTarget,
new_subscribed_library:objVAPIContentLibrarySubscriptionCreateSpecNewSubscribedLibrary,
subscribed_library:strSubscribedLibrary,
location:objVAPIContentLibrarySubscriptionLocation,
vcenter:objVAPIContentLibrarySubscriptionCreateSpecVCenter,
placement:objVAPIContentLibrarySubscriptionCreateSpecPlacement
};
letobjVAPIContentLibrarySubscriptionCreateSpec:com_vmware_content_library_subscriptions_create__spec={
subscribed_library:objVAPIContentLibrarySubscriptionCreateSpecSubscribedLibrary
};
letstrVAPIContentLibrarySubscriptionID:string=objVAPIContentLibrarySubscriptions.create(null,objVAPIContentLibrary.id,objVAPIContentLibrarySubscriptionCreateSpec);
returnstrVAPIContentLibrarySubscriptionID;
}
Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
