Actions86
- Config Actions
- Container Actions
- Edge Group Actions
- Edge Stack Actions
- Environment Actions
- Image Actions
- Network Actions
- Node Actions
- Registry Actions
- Secret Actions
- Service Actions
- Setting Actions
- Stack Actions
- System Actions
- Team Actions
- Template Actions
- User Actions
- Volume Actions
- Webhook Actions
Service → Update
AI-generatedOverview
This node operation updates an existing Docker Swarm service in a specified environment using the Portainer API. It allows users to modify the service's Docker image and environment variables, ensuring the service runs with the desired configuration. This is useful for scenarios such as deploying new versions of an application, changing service settings, or updating environment variables without recreating the service.
Use Case Examples
- Updating a Docker Swarm service to use a new Docker image version.
- Modifying environment variables of a running service to change its behavior.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the environment/endpoint in Portainer where the service is located. |
| Service ID | The ID of the Docker Swarm service to update. |
| Image | The Docker image to use for the service update. |
| Environment Variables | A collection of environment variables to set for the service's container specification during the update. |
| Version | The object version number required for the update operation to ensure concurrency control. |
Output
JSON
body- The response body from the Portainer API after updating the service, typically containing status or updated service details.
Dependencies
- Portainer API with an API key credential for authentication
Troubleshooting
- Ensure the Environment ID and Service ID are correct and correspond to existing resources in Portainer.
- Verify that the Version number matches the current version of the service to avoid update conflicts.
- Check that the Docker image name is valid and accessible from the environment's Docker registry.
- If environment variables are provided, ensure they are correctly formatted as name-value pairs.
- Network or authentication issues with the Portainer API can cause request failures; verify API credentials and network connectivity.
Links
- Portainer API - Update Service - Official documentation for updating Docker Swarm services via the Portainer API.