-
Notifications
You must be signed in to change notification settings - Fork 85
/
ListArchivedWorkflows.ts
28 lines (24 loc) · 1.18 KB
/
ListArchivedWorkflows.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* 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.
*
*/
import { ZosmfRestClient, nozOSMFVersion } from "@zowe/core-for-zowe-sdk";
import { WorkflowValidator } from "./WorkflowValidator";
import { AbstractSession, Headers } from "@zowe/imperative";
import { WorkflowConstants } from "./WorkflowConstants";
import { IArchivedWorkflows } from "./doc/IArchivedWorkflows";
export class ListArchivedWorkflows {
public static async listArchivedWorkflows(session: AbstractSession,
zOSMFVersion = WorkflowConstants.ZOSMF_VERSION): Promise<IArchivedWorkflows> {
WorkflowValidator.validateSession(session);
WorkflowValidator.validateNotEmptyString(zOSMFVersion, nozOSMFVersion.message);
const resourcesQuery: string = `${WorkflowConstants.RESOURCE}/${zOSMFVersion}/${WorkflowConstants.ARCH_WORKFLOW_RESOURCE}`;
return ZosmfRestClient.getExpectJSON (session, resourcesQuery, [Headers.APPLICATION_JSON]);
}
}