Add z/OSMF system variables GET API#533
Conversation
Signed-off-by: AditheD <adithedas20@gmail.com>
| + VariableConstants.RESOURCE | ||
| + UrlConstants.URL_PATH_DELIM | ||
| + EncodeUtils.encodeURIComponent(sysplexName) + "." | ||
| + EncodeUtils.encodeURIComponent(systemName); |
There was a problem hiding this comment.
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.
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 { |
There was a problem hiding this comment.
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.
Create VariableGetInputFactory.java and VariableGetInputData.java under a factory package.
Then remove all the get methods and only leave one called get(VariableGetInputData inputData)
Summary
Fixes #505