PCCP-7638: Enhance HttpApiClient for Alletra streaming API support [DO NOT REVIEW]#86
Draft
NimbleMike wants to merge 2 commits intov1.3.xfrom
Draft
PCCP-7638: Enhance HttpApiClient for Alletra streaming API support [DO NOT REVIEW]#86NimbleMike wants to merge 2 commits intov1.3.xfrom
NimbleMike wants to merge 2 commits intov1.3.xfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Alletra MP supports using multipart/form-data upload to send a software update file to the Alletra. The details are available here:
https://pages.github.hpe.com/hpe-3par-mgmt/ssmc-onnode/2.6.0/api/public_and_private/index.html#post-/api/v3/softwareupdate/upload
Because the Morpheus
HttpApiClientcallStreamApidid not support the format required by the Alletra, we initially developed our own streaming support which you can see here:https://github.com/HPE-EMU/morpheus-storage-abstraction/blob/18aca8b4d354feab7ba1851b668000736fc272a5/src/main/groovy/com/hpe/sal/alletra/mp/api/ApiUtils.groovy#L91
This PR enhances the
HttpApiClientcallStreamApisuch that it can support uploading software updates to the Alletra. Special consideration has been made to avoid any regression issues.callJsonApihas been separated into a privateparseJsonResponsemember function. This allows the reuse of the code when decoding the JSON response returned from a streamed request sent to the Alletra.opts.body instanceof Fileto support file uploads to the Alletra.callStreamApinow populates thertn.setContenton success or failure. It also sets theStatusCode. These changes are done to be identical to how the existingcallApihandler does it. Setting the additional properties enables theparseJsonResponseto unmarshal the JSON data.