def getPDSMembers(pdsName, issuesErrorMessages=True): result = run("zowe files list am " + pdsName + " --rfj") if result.stdout: members = json.loads(result.stdout) return members['stdout'] else: return ''
def deletePDS(pdsName, issuesErrorMessages=True): result = run("zowe files delete ds " + pdsName + " -f", issuesErrorMessages) if result.stdout: return True else: return False
def jobStatus(jobid, issuesErrorMessages=True): result = run("zowe jobs view jsbj " + jobid + " --rfj", issuesErrorMessages) if result.stdout: jobDetails = json.loads(result.stdout) return jobDetails['data'] else: return ''
def submitLocal(jclName, issuesErrorMessages=True): result = run("zowe jobs sub lf " + jclName + " --rfj", issuesErrorMessages) if result.stdout: jobDetails = json.loads(result.stdout) return jobDetails['data']['jobid'].upper() else: return ''
def submitRemote(pdsName, membName, issuesErrorMessages=True): result = run( "zowe jobs sub ds \"" + pdsName + "(" + membName + ")\" --rfj", issuesErrorMessages) if result.stdout: jobDetails = json.loads(result.stdout) return jobDetails['data']['jobid'].upper() else: return ''
def getDefaultZosmfUser(issuesErrorMessages=True): zoweUser = ZoweUser() result = run("zowe profiles list zosmf --sc --rfj", issuesErrorMessages) if result.stdout: zosmfProfile = json.loads(result.stdout) zoweUser.user = zosmfProfile['data'][0]['profile']['user'].upper() zoweUser.host = zosmfProfile['data'][0]['profile']['host'] return zoweUser else: return ''
def downloadPDSMembers(pdsName, toDir, ext="txt", issuesErrorMessages=True): if not ext: ext = '""' result = run( "zowe files download am " + pdsName + " -d " + toDir + " -e " + ext, issuesErrorMessages) if result.stdout: return True else: return False
def downloadPDSContent(pdsName, membName, toDir, ext=".txt", issuesErrorMessages=True): if not ext: ext = '""' result = run( "zowe files download ds \"" + pdsName + "(" + membName + ")\"" + " -f " + toDir + membName + ext, issuesErrorMessages) if result.stdout: return True else: return False
def createPDS(pdsName, issuesErrorMessages=True): result = run("zowe files create classic " + pdsName, issuesErrorMessages) if result.stdout: return True else: return False