UNPKG

@zowe/zos-files-for-zowe-sdk

Version:

Zowe SDK to interact with files and data sets on z/OS

50 lines 2.52 kB
"use strict"; /* * This program and the accompanying materials are made available under the terms of the * Eclipse Public License v2.0 which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-v20.html * * SPDX-License-Identifier: EPL-2.0 * * Copyright Contributors to the Zowe Project. * */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HDelete = void 0; const ZosFilesUtils_1 = require("../../utils/ZosFilesUtils"); const ZosFiles_messages_1 = require("../../constants/ZosFiles.messages"); /** * This class holds helper functions that are used to delete data sets through the * z/OSMF APIs. */ class HDelete { /** * * @param {AbstractSession} session z/OSMF connection info * @param {string} dataSetName The name of the data set to recall * @param {boolean} wait If true then the function waits for completion of the request. If false (default) the request is queued. * * @returns {Promise<IZosFilesResponse>} A response indicating the status of the deletion * * @throws {ImperativeError} Data set name must be specified as a non-empty string * @throws {Error} When the {@link ZosmfRestClient} throws an error * * @see https://www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.izua700/IZUHPINFO_API_PutDataSetMemberUtilities.htm */ static dataSet(session_1, dataSetName_1) { return __awaiter(this, arguments, void 0, function* (session, dataSetName, options = {}) { return ZosFilesUtils_1.ZosFilesUtils.dfsmsHsmCommand(session, dataSetName, ZosFiles_messages_1.ZosFilesMessages.datasetDeletionRequested.message, { request: "hdelete" }, options); }); } } exports.HDelete = HDelete; //# sourceMappingURL=HDelete.js.map