Add write operations for instance environment variables - #369
Merged
Merged
Conversation
Document the two operations Morpheus already exposes for user-defined
instance environment variables alongside the existing read:
- POST /api/instances/{id}/envs -- adds variables, or updates existing ones
matched by name; variables not listed are left unchanged.
- DELETE /api/instances/{id}/envs/{name} -- removes the named variable.
Both return the same envs response as the read. Verified against a live
appliance: a repeated POST for an existing name replaces its value rather
than duplicating it.
matthew-c-hpe
approved these changes
Sep 18, 2026
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.
Summary
Documents the two operations Morpheus already exposes for an instance's user-defined environment variables, alongside the existing
GET /api/instances/{id}/envs:POST /api/instances/{id}/envs(addEnvVariables) — adds variables, or updates existing ones matched byname. Variables not listed are left unchanged.DELETE /api/instances/{id}/envs/{name}(deleteEnvVariable) — removes the named variable.Both return the same
instanceEnvsresponse as the read.Verified behaviour
Checked against a live appliance:
POSTfor an existing name replaces its value rather than duplicating the variable (upsert semantics).DELETEby name removes exactly that variable.envs+readOnlyEnvs) in the response.Changes
paths/api@instances@id@envs.yaml— add thepostoperationpaths/api@instances@id@envs@name.yaml— new path with thedeleteoperation; registered inopenapi.yamlcomponents/schemas/instanceEnvsAdd.yaml— request body (envs[]of{name, value, export?, masked?})components/parameters/envName-path.yaml— the{name}path parametercomponents/examples/instanceEnvsAdd.json— request exampleThe bundler validates cleanly and the generated Go client gains the two operations as a purely additive change.
Why
The Terraform provider's
hpe_morpheus_instanceresource could not apply environment-variable changes on update, because the instance update request does not carry them and the client only had the read. These operations let it diff and apply adds, modifications and removals.