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
Config → Create
AI-generatedOverview
This node operation allows users to create a new Docker Swarm config in a specified environment using the Portainer API. It is useful for managing configuration data that can be used by Docker services and containers in a swarm cluster. For example, users can create a config with specific configuration files or settings that containers can consume at runtime.
Use Case Examples
- Creating a new Docker Swarm config named 'app-config' with JSON configuration data to be used by services in environment ID 1.
- Automating the deployment of configuration files across multiple Docker Swarm nodes by creating configs programmatically.
Properties
| Name | Meaning |
|---|---|
| Environment ID | The ID of the environment/endpoint in Portainer where the config will be created. |
| Config Name | The name to assign to the new Docker Swarm config. |
| Config Data | The content/data of the config, which will be base64 encoded before sending to the API. |
| Request Options | Additional request options such as batching, SSL certificate validation, proxy settings, and timeout configuration. |
Output
JSON
body- The JSON response body from the Portainer API after creating the config, containing details of the created config such as its ID and metadata.
Dependencies
- Portainer API with an API key credential for authentication
Troubleshooting
- Ensure the environment ID is correct and accessible in Portainer to avoid authorization errors.
- Verify that the config data is properly formatted and not empty, as the API requires valid base64-encoded data.
- Check network connectivity and proxy settings if requests fail or time out.
- If SSL certificate validation fails, consider enabling the option to ignore SSL issues, but be aware of security implications.
Links
- Portainer API - Create Config - Official Portainer API documentation for creating Docker Swarm configs.