Skip to content

Add z/OSMF system variables GET API#533

Open
AditheD wants to merge 2 commits into
zowe:mainfrom
AditheD:issue-505-get-system-variables
Open

Add z/OSMF system variables GET API#533
AditheD wants to merge 2 commits into
zowe:mainfrom
AditheD:issue-505-get-system-variables

Conversation

@AditheD

@AditheD AditheD commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add VariableGet API for retrieving z/OSMF system variables
  • Add VariableGetResponse and VariableResponse response models
  • Add unit tests for VariableGet and response classes

Fixes #505

Signed-off-by: AditheD <adithedas20@gmail.com>
+ VariableConstants.RESOURCE
+ UrlConstants.URL_PATH_DELIM
+ EncodeUtils.encodeURIComponent(sysplexName) + "."
+ EncodeUtils.encodeURIComponent(systemName);

@frankgiordano frankgiordano Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IBM documentation says you can have two different urls for this REST API:

GET /zosmf/variables/rest/<version>/systems/<sysplex-name>.<system-name>

and

GET /zosmf/variables/rest/<version>/systems/local

you are only covering the first case. You need to implement the second one too.

I suggest you create

public VariableGetResponse get(final String sysplexName, final String systemName)

public VariableGetResponse getLocal()

private VariableGetResponse getCommon(final String sysplexName, final String systemName, boolean isLocal)

in here do a if check and construct the url based on the boolean value.

Comment thread src/main/java/zowe/client/sdk/zosvariables/methods/VariableGet.java
@frankgiordano frankgiordano added the enhancement New feature or request label Jun 30, 2026
Signed-off-by: AditheD <adithedas20@gmail.com>
* @return VariableGetResponse object
* @throws ZosmfRequestException request error state
*/
public VariableGetResponse get(final String sysplexName, final String systemName, final List<String> variableNames, final String variableType) throws ZosmfRequestException {

@frankgiordano frankgiordano Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, this is too many parameters to keep track of for the end user and for our code logic.

Let's do a factory pattern.

See https://github.com/zowe/zowe-client-java-sdk/tree/main/src/main/java/zowe/client/sdk/zosfiles/uss/input/factory

Create VariableGetInputFactory.java and VariableGetInputData.java under a factory package.

Then remove all the get methods and only leave one called get(VariableGetInputData inputData)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get system variables

2 participants