Portainer Servers
1. Server Overview
Portainer server connectors manage API connections to Portainer instances, enabling Docker stack and container management from Odoo.
Fields
- Name - Server display name (required, tracked)
- IP - Portainer server IP address (required, tracked)
- Portainer Link - Full URL to the Portainer instance, e.g.,
https://ip:9443(required, tracked) - Access Token - API access token for authentication
- State - Connector status: Draft, Confirmed, or Cancelled (tracked)
- Root Server - Associated root server
- Master Portainer - Whether this is the master Portainer instance (default: False)
- Skip SSL Verify - Skip SSL certificate verification for API calls (default: True)
- Country - Server location country
- State - Server location state/province
- Active - Archive toggle (default: True)
2. Server Lifecycle
Draft → Confirmed → Cancelled
| Action | Description |
|---|---|
| Confirm | Validates configuration (requires link and access token) |
| Reset to Draft | Returns to editable state |
| Cancel | Deactivates the server |
| Open Portainer Panel | Opens the Portainer UI in a new browser tab |
3. Stack Management API
These methods are used by other modules (like sadeem_saas_docker) to manage Docker stacks.
| Method | Description |
|---|---|
| Create Stack | Creates a Docker stack from a compose string in a specific environment |
| Update Stack | Updates an existing stack's configuration |
| Start/Stop Stack | Controls stack state |
| Delete Stack | Removes a stack and its containers |
| Check Stack Status | Queries stack and container health |
4. Container Management API
| Method | Description |
|---|---|
| Docker Actions | Restart, start, stop, pause, unpause, or remove a container |
| Docker Exec | Execute a command inside a running container |
| Docker State | Get container resource stats (CPU, memory) |
5. Installation from Root Server
Portainer can be installed directly on a root server via SSH.
| Action | Description |
|---|---|
| Install Portainer | Installs Docker and Portainer agent on the root server |
| Install Portainer Master | Installs Docker and Portainer CE (full UI) on ports 9443 and 8000 |
Auto-Setup
When installing Portainer Master, the system automatically:
- Generates a 14-character admin password
- Creates the admin user via API
- Authenticates and obtains a JWT token
- Generates a permanent API key
- Creates the
sadeem.portainerrecord with the API key