IBM Z® Open Editor
Docs
News and Blogs
IBM Downloads
VS Code Marketplace
GitHub
Docs
News and Blogs
IBM Downloads
VS Code Marketplace
GitHub
  • Overview

    • Introduction
    • Updates and user feedback
  • Getting Started

    • Getting started with IBM Z Open Editor
    • Setting up integrations to interact with z/OS
    • Getting started with Zowe 3.0
  • Configuration

    • Setting preferences
    • Configuring your applications with ZAPP files
    • Setting property groups
    • Setting compiler options
    • Setting file associations
    • Setting language-specific tab stops and rulers
    • Enabling and disabling problems in IBM Z Open Editor
    • Enabling and disabling unreachable COBOL code warnings
    • Customizing the Outline view
    • Setting language-specific maximum line length
    • EBCDIC code pages and mappings files
    • Experimental: Formatting COBOL source code
  • Tutorials

    • Tutorial overview
    • Exploring the user interface
    • Exploring the sample files
    • COBOL editing tutorial
    • COBOL, PL/I Preprocessor tutorial
    • HLASM editing tutorial
    • REXX editing tutorial
    • Managing z/OS resources with IBM RSE API Plug-in for Zowe CLI tutorial
    • Submitting JCL to compile, link, and run jobs tutorial
  • Editing program files

    • Language References
    • Making COBOL and PL/I code changes
    • Making High Level Assembler code changes
    • Making REXX code changes
    • Making JCL code changes
    • PL/I macro preprocessor
    • Using and managing code snippets
    • Using the integrated Git
    • Searching for COBOL, PL/I, HLASM, and REXX components
  • Interacting with z/OS using Zowe

    • Interacting with z/OS
    • Creating a configuration profile in Zowe Explorer v3.0.0
    • Migrating your old Zowe yaml profiles for Zowe v3.0
    • Supported methods of authentication for z/OS using Zowe
    • Sharing team configuration files
    • Connecting to z/OS with Zowe Explorer walk through
    • Using the Zowe Explorer views
    • Using Zowe profiles in Z Open Editor
    • Connecting to z/OS using Zowe CLI walk through
    • Using command line to interact with z/OS
    • Interact with RSE Common Properties
  • Advanced Capabilities

    • Overview
    • Activating advanced capabilities
    • Launching a 3270 emulator from Zowe Explorer
    • z/OS Resources Table
    • Data Elements View
    • Program Control Flow Browser
    • Data Flow Browser
    • Preprocessor support
    • Custom Macros for HLASM
    • Language Detection
    • Linting with IBM ZCodeScan
    • User build with IBM Dependency Based Build (DBB)
    • User build with customizable tasks
    • Agent Mode
    • Line Hex Editor
  • Cloud-based Editing

    • Overview to using Cloud and Browser-based platforms
    • Try Z Open Editor in the Red Hat Developer Sandbox
    • Configuring Red Hat OpenShift Dev Spaces
    • Managing Developer Workspaces
    • Managing secrets
    • Create and use custom images
    • Migrating from IBM Wazi for Dev Spaces
    • Using Z Open Editor on GitHub Codespaces
    • Using Z® Open Editor with Dev Containers
  • Troubleshooting

    • Known issues and limitations
    • Troubleshooting using log files
    • Troubleshooting for User Build
    • Uninstalling CLI plugins and VS Code extensions
  • Reference

    • IBM RSE API Plug-in for Zowe CLI commands
    • IBM RSE API Plug-in for Zowe CLI as nodejs SDK package
    • IBM RSE API Plug-in for Zowe CLI as nodejs SDK reference
    • Example Zowe configuation setups
    • IBM Z Open Editor MCP Tools
    • GRUB Scripts - Git remote user build
    • Accessibility and Keyboard Shortcuts
    • settings.json properties
    • Message ID Reference
    • Other Visual Studio Code extensions
  • Legal information

    • Notices
    • Trademarks
    • Privacy policy considerations

IBM RSE API Plug-in for Zowe CLI as nodejs SDK package

IBM® RSE API Plug-in for Zowe™ CLI (RSE API plug-in) is a Nodejs package that can also be used as a Software Development Kit (SDK) to build client applications and scripts that interact with the mainframe through RSE rest APIs.

Projects that adopt the RSE API plug-in as an SDK must also adopt the Zowe SDKs as dependencies, depending on the project's requirements. Zowe Imperative is a Nodejs package that must be declared as a peer dependency of the RSE API plug-in. Zowe Session objects are passed to the RSE API plug-in methods with connection information for the REST requests. More information on the Zowe SDK is available at zowe.org.

RSE API plug-in SDK Examples

Get system information

import * as imperative from "@zowe/imperative";
import { CheckStatus } from "@ibm/rse-api-for-zowe-cli";

export class exampleRseSdkClass {
  public static async getSystemInfo(): Promise<void> {
    //pass an instance of imperative.Session with connection information to the rest call
    const response = await CheckStatus.getRseStatus(session);
    const output = imperative.TextUtils.prettyJson(response);
    console.log(output);
  }
}

List data set members

import * as imperative from "@zowe/imperative";
import { List } from "@ibm/rse-api-for-zowe-cli";

export class exampleRseSdkClass {
  public static async getMemberList(): Promise<void> {
    // prompt for or pass partitioned data set name for rest call
    // format: HLQ.PDS
    const dsName = imperative.CliUtils.readPrompt(
      "Enter data set name to list it's members:"
    );
    if (dsName) {
      //pass an instance of imperative.Session with connection information to the rest call
      const response = await List.allMembers(session, String(dsName));
      const list: String[] = [];
      response.apiResponse.items.forEach((obj: any) =>
        list.push(obj?.memberName)
      );
      const output = String(list).replaceAll(",", "\n");
      console.log(output);
    } else {
      console.log("operation cancelled");
    }
  }
}

Submit data set member as job

import * as imperative from "@zowe/imperative";
import { SubmitJobs } from "@ibm/rse-api-for-zowe-cli";

export class exampleRseSdkClass {
  public static async submitAsJob(): Promise<void> {
    // prompt for or pass data set member name for rest call
    // format: HLQ.PDS(MEMBER)
    const jobName = imperative.CliUtils.readPrompt(
      "Enter data set member name to submit as job:"
    );
    if (jobName) {
      //pass an instance of imperative.Session with connection information to the rest call
      const response = await SubmitJobs.submitJob(session, {
        jobDataSet: String(jobName)
      });
      console.log(JSON.stringify(response));
    } else {
      console.log("operation cancelled");
    }
  }
}

RSE API plug-in SDK used with Zowe Explorer

Zowe Explorer offers an API package that can be used by extenders to register new protocols, extend menu options, and more. RSE type profiles are available in Zowe Explorer via IBM Z Open Editor using these extender APIs to register the protocol and adopting available APIs for file manipulation and other z/OS actions that are supported for that protocol.

Registering a protocol with Zowe Explorer

import * as rest from '@ibm/rse-api-for-zowe-cli';
import { MainframeInteraction, ZoweVsCodeExtension } from '@zowe/zowe-explorer-api';
// Retrieve the Zowe Explorer API object from the currently running instance.
// Choose the version of Zowe Explorer to support, i.e.. v2 or v3.
const zoweExplorerApi = ZoweVsCodeExtension.getZoweExplorerApi("3.0.0");
if (zoweExplorerApi) {
  // register with the Zowe Explorer tree views
  rest.RseRestUssApi.registerApi(importedApi);
  rest.RseRestMvsApi.registerApi(importedApi);
  rest.RseRestJesApi.registerApi(importedApi);
  rest.RseRestCommandApi.registerApi(importedApi);
  // Initialized the users ~/.zowe directory with the metadata for new protocol's profiles in case
  const meta = await rest.ProfileUtils.getProfileMeta();;
  await zoweExplorerApi.getExplorerExtenderApi().initForZowe("rse", meta);
  await zoweExplorerApi.getExplorerExtenderApi().reloadProfiles();

  // Get the IApiExplorerExtender instance from the API that extenders can used
  // to interact with Zowe Explorer such as accessing all the loaded profiles
  const profilesCache = zoweExplorerApi.getExplorerExtenderApi().getProfilesCache();

  // Example for iterating over the profiles loaded by Zowe Explorer by type
  const allProfileTypes = profilesCache.getAllTypes();
  let message = "Found the following available profiles: ";
  if (!allProfileTypes) {
    message += "none.";
  } else {
    for (const profileType of allProfileTypes) {
      const profileNames = await profilesCache.getNamesForType(profileType);
      message += `${profileType}: ${JSON.stringify(profileNames)} `;
    }
  }
  void vscode.window.showInformationMessage(message);

  // Example of listing data sets using Zowe Explorer APIs
  const loadedProfile = profilesCache.loadNamedProfile(profileName, optionalProfileType);
  const mvsApi: MainframeInteraction.IMvs = ZoweSettings.getZoweExplorerApi().getMvsApi(loadedProfile);
  const response = await mvsApi.dataSet(dsFilter, listOptions);
  //display returned list items
  console.log(response.apiResponse.items)
}

More information about extending Zowe Explorer and using the extension APIs can be found in Zowe Explorer's Wiki for Extending Zowe Explorer.

Last Updated: 8/10/26, 7:06 AM
Contributors: Billie Simmons, Esther M, phaumer
Prev
IBM RSE API Plug-in for Zowe CLI commands
Next
IBM RSE API Plug-in for Zowe CLI as nodejs SDK reference