You are using RTF and need to restart all your apps via API. Instead of bulk stopping and starting your apps, which can cause some downtime, you want to maintain the Rolling Update feature to minimize downtime.
Original script of reference: RTF Stop and Start Applications in Bulk
If you have existing tools to manage app deployment, then use those existing tools to make a small non-impacting change (e.g. adding a dummy property, which can be removed in the future). Apply the change to all relevant apps, and it will trigger a restart using the selected (e.g. rolling) deployment model.
If you need to do this manually, the below steps explain how to achieve this using API call.
1. Please follow the steps 1-2 in this article: RTF Stop and Start Applications in Bulk
2. Send a PATCH request to make a small non-impacting change. For example, this request will modify the app properties.
a) Check current properties in the app.
curl --silent https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid> \
-H "Authorization: Bearer <token>" | jq
b) PATCH request to set new list of properties.
curl --silent -X PATCH "https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"application": {"configuration": {"mule.agent.application.properties.service": {"properties": {"testproperty1": "1", "testproperty2": "2"}}}}}'
3. Or make a different change, such as decreasing the CPU limit by 1. For example, if all apps have a CPU limit of 3.9 vCPU (3900m), change (lower by 1m) it to 3.899 vCPU (3899m).
curl --silent -X PATCH "https://anypoint.mulesoft.com/hybrid/api/v2/organizations/<orgid>/environments/<envid>/deployments/<appid>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"target": {"deploymentSettings": {"resources": {"cpu": {"limit": "3899"}}}}}'
The above are just examples. The idea is to create a script that sends a PATCH request to all apps (that need to be restarted), by making a small non-impacting change, to trigger a rolling restart. Alternatively, if your app deployments are managed via automation (e.g. Jenkins), you can do the same from there.
001117072

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.