virtual int processCMD() { Owned<IClientWsPackageProcess> packageProcessClient = getWsPackageSoapService(optServer, optPort, optUsername, optPassword); StringBuffer pkgInfo; pkgInfo.loadFile(optFileName); fprintf(stdout, "\n ... looking up files in package to see what needs copying\n\n"); Owned<IClientCopyFilesRequest> request = packageProcessClient->createCopyFilesRequest(); request->setInfo(pkgInfo); request->setProcess(optProcess); request->setPackageName(optFileName); request->setOverWrite(optOverWrite); if (!optDaliIp.isEmpty()) request->setDaliIp(optDaliIp.get()); Owned<IClientCopyFilesResponse> resp = packageProcessClient->CopyFiles(request); if (resp->getExceptions().ordinality()) outputMultiExceptions(resp->getExceptions()); return 0; }
virtual int processCMD() { Owned<IClientWsPackageProcess> packageProcessClient = getWsPackageSoapService(optServer, optPort, optUsername, optPassword); Owned<IClientListPackageRequest> request = packageProcessClient->createListPackageRequest(); request->setCluster(optCluster); Owned<IClientListPackageResponse> resp = packageProcessClient->ListPackage(request); if (resp->getExceptions().ordinality()) outputMultiExceptions(resp->getExceptions()); else { IArrayOf<IConstPackageListMapData> &pkgMapInfo = resp->getPkgListMapData(); unsigned int num = pkgMapInfo.ordinality(); for (unsigned i=0; i<num; i++) { IConstPackageListMapData& req = pkgMapInfo.item(i); const char *id = req.getId(); printf("\nPackage Name = %s\n", id); IArrayOf<IConstPackageListData> &pkgInfo = req.getPkgListData(); unsigned int numPkgs = pkgInfo.ordinality(); for (unsigned int j = 0; j <numPkgs; j++) { IConstPackageListData& req = pkgInfo.item(j); const char *id = req.getId(); const char *queries = req.getQueries(); if (queries && *queries) printf("\t\tid = %s queries = %s\n", id, queries); else printf("\t\tid = %s\n", id); } } } return 0; }
virtual int processCMD() { Owned<IClientWsPackageProcess> packageProcessClient = getWsPackageSoapService(optServer, optPort, optUsername, optPassword); Owned<IClientValidatePackageRequest> request = packageProcessClient->createValidatePackageRequest(); if (optFileName.length()) { StringBuffer pkgInfo; pkgInfo.loadFile(optFileName); fprintf(stdout, "\nvalidating packagemap file %s\n\n", optFileName.sget()); request->setInfo(pkgInfo); } request->setActive(optValidateActive); request->setPMID(optPMID); request->setTarget(optTarget); request->setQueryIdToVerify(optQueryId); request->setCheckDFS(optCheckDFS); request->setGlobalScope(optGlobalScope); bool validateMessages = false; Owned<IClientValidatePackageResponse> resp = packageProcessClient->ValidatePackage(request); if (resp->getExceptions().ordinality()>0) { validateMessages = true; outputMultiExceptions(resp->getExceptions()); } StringArray &errors = resp->getErrors(); if (errors.ordinality()>0) { validateMessages = true; fputs(" Error(s):\n", stderr); ForEachItemIn(i, errors) fprintf(stderr, " %s\n", errors.item(i)); } StringArray &warnings = resp->getWarnings(); if (warnings.ordinality()>0) { validateMessages = true; fputs(" Warning(s):\n", stderr); ForEachItemIn(i, warnings) fprintf(stderr, " %s\n", warnings.item(i)); } StringArray &unmatchedQueries = resp->getQueries().getUnmatched(); if (unmatchedQueries.ordinality()>0) { validateMessages = true; fputs("\n Queries without matching package:\n", stderr); ForEachItemIn(i, unmatchedQueries) fprintf(stderr, " %s\n", unmatchedQueries.item(i)); } StringArray &unusedPackages = resp->getPackages().getUnmatched(); if (unusedPackages.ordinality()>0) { validateMessages = true; fputs("\n Packages without matching queries:\n", stderr); ForEachItemIn(i, unusedPackages) fprintf(stderr, " %s\n", unusedPackages.item(i)); } StringArray &unusedFiles = resp->getFiles().getUnmatched(); if (unusedFiles.ordinality()>0) { fputs("\n Files without matching package definitions:\n", stderr); ForEachItemIn(i, unusedFiles) fprintf(stderr, " %s\n", unusedFiles.item(i)); } StringArray ¬InDFS = resp->getFiles().getNotInDFS(); if (notInDFS.ordinality()>0) { fputs("\n Packagemap SubFiles not found in DFS:\n", stderr); ForEachItemIn(i, notInDFS) fprintf(stderr, " %s\n", notInDFS.item(i)); } if (!validateMessages) fputs(" Validation was successful\n", stdout); return 0; }