8.15.1 • Published 4 months ago

@zowe/provisioning-for-zowe-sdk v8.15.1

Weekly downloads
606
License
EPL-2.0
Repository
github
Last release
4 months ago

Provisioning Package

Contains APIs to interact with the z/OS provisioning APIs

API Examples

List z/OSMF Published Catalog Templates

import { ProfileInfo, TextUtils } from "@zowe/imperative";
import { explainPublishedTemplatesFull, explainPublishedTemplatesSummary, ListCatalogTemplates,
    ProvisioningConstants } from "@zowe/provisioning-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    const templates = await ListCatalogTemplates.listCatalogCommon(session, ProvisioningConstants.ZOSMF_VERSION);
    let prettifiedTemplates: any = {};
    if (process.argv.slice(2).includes("--all") || process.argv.slice(2).includes("-a")) {
        prettifiedTemplates = TextUtils.explainObject(templates, explainPublishedTemplatesFull, true);
    } else {
        prettifiedTemplates = TextUtils.explainObject(templates, explainPublishedTemplatesSummary, false);
    }
    const response = "z/OSMF Service Catalog templates\n" + TextUtils.prettyJson(prettifiedTemplates);
    console.log(response);
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

Provision a Published Software Service Template

import { ProfileInfo, TextUtils } from "@zowe/imperative";
import { ProvisioningConstants, explainProvisionTemplateResponse,
    ProvisionPublishedTemplate } from "@zowe/provisioning-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    const templateName = "myTemplate";
    const response = await ProvisionPublishedTemplate.provisionTemplate(session,
        ProvisioningConstants.ZOSMF_VERSION, templateName);
    let prettyResponse = TextUtils.explainObject(response, explainProvisionTemplateResponse, false);
    prettyResponse = TextUtils.prettyJson(prettyResponse);
    console.log(prettyResponse);
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

List Provisioned Instances and Perform an Action to the Matching Instance

import { ProfileInfo, TextUtils } from "@zowe/imperative";
import { explainActionResponse, IProvisionedInstance, ListRegistryInstances, PerformAction,
    ProvisioningConstants } from "@zowe/provisioning-for-zowe-sdk";

(async () => {
    // Load connection info from default z/OSMF profile
    const profInfo = new ProfileInfo("zowe");
    await profInfo.readProfilesFromDisk();
    const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
    const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
    const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

    const instanceName = "myInstance";
    const actionName = "myAction";
    const registry = await ListRegistryInstances.listFilteredRegistry(session,
        ProvisioningConstants.ZOSMF_VERSION, null, instanceName);
    const instances: IProvisionedInstance[] = registry["scr-list"];
    if (instances == null) {
        console.error("No instance with name " + instanceName + " was found");
    } else if (instances.length === 1) {
        const id = instances.pop()["object-id"];
        const response = await PerformAction.doProvisioningActionCommon(session,
            ProvisioningConstants.ZOSMF_VERSION, id, actionName);
        const pretty = TextUtils.explainObject(response, explainActionResponse, false);
        console.log(TextUtils.prettyJson(pretty));
    } else if (instances.length > 1) {
        console.error("Multiple instances with name " + instanceName + " were found");
    }
})().catch((err) => {
    console.error(err);
    process.exit(1);
});
8.15.1

4 months ago

8.14.1

4 months ago

8.14.0

5 months ago

8.12.0

6 months ago

8.13.0

5 months ago

7.29.10

5 months ago

8.11.0

6 months ago

7.29.9

6 months ago

8.10.4

6 months ago

8.10.3

6 months ago

8.10.0

7 months ago

8.10.1

7 months ago

7.29.8

7 months ago

7.29.7

8 months ago

7.29.6

8 months ago

8.8.3

8 months ago

8.8.2

8 months ago

8.6.2

8 months ago

8.7.1

8 months ago

8.7.0

8 months ago

8.8.1

8 months ago

8.8.0

8 months ago

8.6.1

9 months ago

7.29.4

9 months ago

8.3.1

9 months ago

8.6.0

9 months ago

8.1.0

10 months ago

8.1.1

10 months ago

8.2.0

9 months ago

8.0.1

10 months ago

7.29.2

10 months ago

8.0.0

10 months ago

6.40.31

11 months ago

7.29.0

11 months ago

6.40.30

11 months ago

7.28.4

11 months ago

7.28.3

11 months ago

7.28.2

12 months ago

7.28.1

12 months ago

7.28.0

12 months ago

6.40.29

1 year ago

7.27.0

1 year ago

7.25.2

1 year ago

7.25.0

1 year ago

7.24.3

1 year ago

7.24.1

1 year ago

6.40.28

1 year ago

7.24.0

1 year ago

7.23.9

1 year ago

6.40.27

1 year ago

7.23.8

1 year ago

7.23.6

1 year ago

7.23.4

1 year ago

7.23.3

1 year ago

7.23.2

1 year ago

6.40.26

1 year ago

7.23.1

1 year ago

7.23.0

1 year ago

7.22.0

1 year ago

7.21.4

2 years ago

7.21.2

2 years ago

7.21.0

2 years ago

7.18.7

2 years ago

7.18.2

2 years ago

7.18.0

2 years ago

7.18.1

2 years ago

7.18.8

2 years ago

7.18.9

2 years ago

7.17.0

2 years ago

7.16.5

2 years ago

6.40.21

2 years ago

6.40.20

2 years ago

7.19.0

2 years ago

6.40.22

2 years ago

6.40.18

2 years ago

6.40.19

2 years ago

7.18.11

2 years ago

7.16.0

2 years ago

7.16.1

2 years ago

7.16.4

2 years ago

7.16.3

2 years ago

6.40.17

2 years ago

7.14.0

2 years ago

7.14.1

2 years ago

7.13.0

2 years ago

7.12.0

2 years ago

7.11.3

2 years ago

7.11.1

2 years ago

7.11.2

2 years ago

7.11.0

2 years ago

6.40.16

2 years ago

6.40.15

2 years ago

7.3.1

3 years ago

7.3.0

3 years ago

7.8.0

3 years ago

7.4.2

3 years ago

7.4.1

3 years ago

7.0.0

3 years ago

6.39.0

3 years ago

6.39.1

3 years ago

7.0.2

3 years ago

7.0.1

3 years ago

7.5.1

3 years ago

7.5.0

3 years ago

7.9.3

3 years ago

7.9.2

3 years ago

7.9.0

3 years ago

7.9.7

3 years ago

7.9.6

3 years ago

7.1.3

3 years ago

7.1.2

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

7.6.2

3 years ago

7.6.1

3 years ago

7.2.5

3 years ago

7.6.0

3 years ago

7.2.3

3 years ago

6.38.0

3 years ago

6.40.3

3 years ago

6.40.2

3 years ago

6.40.5

3 years ago

6.40.4

3 years ago

6.40.7

3 years ago

6.40.6

3 years ago

6.40.8

3 years ago

6.40.1

3 years ago

7.2.2

3 years ago

6.37.8

3 years ago

7.2.0

3 years ago

6.40.13

3 years ago

7.7.0

3 years ago

6.40.10

3 years ago

6.40.12

3 years ago

7.10.4

2 years ago

7.10.2

2 years ago

7.10.0

2 years ago

7.10.1

2 years ago

6.36.1

4 years ago

6.37.4

3 years ago

6.37.2

4 years ago

6.37.3

3 years ago

6.37.6

3 years ago

6.37.1

4 years ago

6.36.0

4 years ago

6.34.0

4 years ago

6.33.4

4 years ago

6.34.1

4 years ago

6.33.2

4 years ago

6.33.1

4 years ago

6.33.0

4 years ago

6.32.1

4 years ago

6.31.1

4 years ago

6.31.0

4 years ago

6.30.0

4 years ago

6.28.0

4 years ago

6.27.0

4 years ago

6.26.0

4 years ago

6.25.1

5 years ago

6.25.0

5 years ago

6.24.5

5 years ago

6.24.4

5 years ago

6.24.2

5 years ago

6.24.1

5 years ago