Closed thepandaguitar closed 3 years ago
There are a bunch of items that will be set when updating app definition:
serviceManager
.updateAppDefinition(
appName,
description,
Number(instanceCount),
captainDefinitionRelativeFilePath,
envVars,
volumes,
nodeId,
notExposeAsWebApp,
containerHttpPort,
httpAuth,
forceSsl,
ports,
repoInfo,
customNginxConfig,
preDeployFunction,
serviceUpdateOverride,
websocketSupport
)
Seems like in your case, your app is simple and does not require any of these. So it should be fine to go with what you have now.
Thank you so much for your quick replies @githubsaturn! 🙏
Correct me if I'm wrong. That means as long as I have { "appName": "myApp" }
in my POST request, all my previous settings are kept and optional in the call?
For example, let's say my app with some settings (eg 2 instances or forceSSL set to true). If I update the app definitions with
POST { "appName": "myApp", "description": "blahblah" }
Everything get overwritten (set to defaults), and only the new settings are set.
That's why you first need to get the current app definition, then edit it, then update it with the entire content.
Got it, thank you!
Hi @githubsaturn
I would like to confirm with you if there are required fields when updating the app definitions using
/user/apps/appDefinitions/update
In my case, I was able update the HTTP Container Port just by posting the following data, and everything seems to work:
{"appName":"myapp","instanceCount":1, "containerHttpPort":80}
Do you have any defaults set somewhere? I want to make sure this is ok to continue.
Thank you as always @githubsaturn 🙌
(At first I added this question as a comment to my other issue but it seemed it would be more helpful for others to add it in a separate discussion)