Function: vCenter OVF Parse Descriptor

by Simon Sparks · 4 February 2026

To use this function add it to the class library file named OrchestratorService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorPluginOVAService.ts

Private Function: ParseOvfDescriptor

public ParseOvfDescriptor(objVcSdkConnection: VcSdkConnection, enumOvaTransferImportType: OvaTransferImportType, strSourcePathType: string, strSourceHostname: string, strSourcePath: string, intSourcePort: number = 443, blnUseAuthentication: boolean, strAuthType: string, strAuthUsername: string, strAuthPassword: string): VcOvfParseDescriptorResult {
  let objSVAImportManagerFactory: SVAImportManagerFactory = SVAImportManagerFactory.getInstance();

  let objTemplateImportManager: TemplateImportManager = objSVAImportManagerFactory.createImportManager(enumOvaTransferImportType);
  objTemplateImportManager.setSource(strSourcePathType, strSourceHostname, strSourcePath, intSourcePort, blnUseAuthentication, strAuthType, strAuthUsername, strAuthPassword);

  let strOvfDescriptor: string = objTemplateImportManager.getOvfDescriptor();

  let objVcOvfManager: VcOvfManager = objVcSdkConnection.ovfManager;

  let objVcOvfParseDescriptorParams: VcOvfParseDescriptorParams = new VcOvfParseDescriptorParams();
  objVcOvfParseDescriptorParams.locale = '';
  objVcOvfParseDescriptorParams.deploymentOption = '';

  let objVcOvfParseDescriptorResult: VcOvfParseDescriptorResult = objVcOvfManager.parseDescriptor(strOvfDescriptor, objVcOvfParseDescriptorParams);

  if (objVcOvfParseDescriptorResult.deploymentOption != null) {
    this.objLogger.info("Available Deployment Options:");

    let arrVcOvfDeploymentOption: VcOvfDeploymentOption[] = objVcOvfParseDescriptorResult.deploymentOption;

    arrVcOvfDeploymentOption.forEach((objVcOvfDeploymentOption: VcOvfDeploymentOption): void => {

      this.objLogger.info("Key (used in import workflow): " + objVcOvfDeploymentOption.key);
      this.objLogger.info("Label: " + objVcOvfDeploymentOption.label);
      this.objLogger.info("Description:");
      this.objLogger.info(objVcOvfDeploymentOption.description);
    });
  }

  if (objVcOvfParseDescriptorResult.property != null) {
    this.objLogger.info("Available OVF Properties:");

    let arrVcVAppPropertyInfo: VcVAppPropertyInfo[] = objVcOvfParseDescriptorResult.property;

    arrVcVAppPropertyInfo.forEach((objVcVAppPropertyInfo: VcVAppPropertyInfo): void => {

      this.objLogger.info("Id: " + objVcVAppPropertyInfo.id);
      this.objLogger.info("ClassId: " + objVcVAppPropertyInfo.classId);
      this.objLogger.info("InstanceId: " + objVcVAppPropertyInfo.instanceId);
      this.objLogger.info("Import Property Key Name (used in import workflow): " + ((objVcVAppPropertyInfo.classId != null && objVcVAppPropertyInfo.classId != '') ? objVcVAppPropertyInfo.classId + "." : "") + objVcVAppPropertyInfo.id + ((objVcVAppPropertyInfo.instanceId != null && objVcVAppPropertyInfo.instanceId != '') ? "." + objVcVAppPropertyInfo.instanceId : ""));
      this.objLogger.info("Label: " + objVcVAppPropertyInfo.label);
      this.objLogger.info("Description:");
      this.objLogger.info(objVcVAppPropertyInfo.description);
    });
  }

  if (objVcOvfParseDescriptorResult.network != null) {
    this.objLogger.info("Available OVF Networks:");

    let arrVcOvfNetworkInfo: VcOvfNetworkInfo[] = objVcOvfParseDescriptorResult.network;

    arrVcOvfNetworkInfo.forEach((objVcOvfNetworkInfo: VcOvfNetworkInfo): void => {

      this.objLogger.info("Name: " + objVcOvfNetworkInfo.name);
      this.objLogger.info("Description:");
      this.objLogger.info(objVcOvfNetworkInfo.description);
    });

  }

  return objVcOvfParseDescriptorResult;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like