import { ZosmfRestClient , nozOSMFVersion } from "@zowe/core-for-zowe-sdk" ; import { AbstractSession } from "@zowe/imperative" ; import { ProvisioningValidator } from "./ProvisioningValidator" ; import { noInstanceId , ProvisioningConstants } from "./ProvisioningConstants" ; import { IProvisionedInstanceVariables } from "./doc/zosmf/IProvisionedInstanceVariables" ; export class export class ListInstanceVariables { param { AbstractSession } session param { string } zOSMFVersion param { string } instanceId returns { Promise < IProvisionedInstanceVariable > } see { IProvisionedInstanceVariable } memberof public static async listVariablesCommon ( session , zOSMFVersion , instanceId ) { ProvisioningValidator . validateSession ( session ) ; ProvisioningValidator . validateNotEmptyString ( zOSMFVersion , nozOSMFVersion . message ) ; ProvisioningValidator . validateNotEmptyString ( instanceId , noInstanceId . message ) ; const resourcesQuery = this . getResourcesQuery ( zOSMFVersion , instanceId ) ; return ZosmfRestClient . getExpectJSON < IProvisionedInstanceVariables > ( session , resourcesQuery ) ; } param { string } zOSMFVersion param { string } instanceId returns { string } memberof public static getResourcesQuery ( zOSMFVersion , instanceId ) { let resourcesQuery = `${ ProvisioningConstants . RESOURCE }/${ zOSMFVersion }/` ; resourcesQuery += `${ ProvisioningConstants . INSTANCES_RESOURCE }/${ instanceId }/` ; resourcesQuery += `${ ProvisioningConstants . VARIABLES_RESOURCE }` ; return resourcesQuery ; } }