Stacks

Update stack compose file

Changed on

Writes the compose file that was opened. Send X-Compose-File with the basename from the matching GET. When that name no longer matches the file Sencho resolves, the response is 412 with code compose_source_changed and nothing is written. If-Match compares the file modification time; a mismatch is 412 with code stack_file_changed. When no compose file exists yet, the write creates compose.yaml. Requires stack:edit permission.

put/api/stacks/{stackName}

Request

  • Base URL
    https://localhost:1852
  • URL
    https://localhost:1852/api/stacks/{stackName}
  • Auth
    HTTP bearer

Path parameters

stackNamestring required
Example:my-stack

Stack directory name. Must match ^[a-zA-Z0-9_-]+$ (alphanumeric characters, hyphens, and underscores only). Returns 400 Invalid stack name if the name contains path separators, dots, spaces, or other special characters.

Headers

x-node-idinteger
Example:1

Target a specific node by ID. If omitted, the default node is used. Can also be passed as ?nodeId= query parameter.

X-Compose-File'compose.yaml' | 'compose.yml' | 'docker-compose.yaml' | 'docker-compose.yml'

Basename returned by the matching GET.

If-Matchstring

ETag from the matching GET.

Request body

contentstring required

Full compose file content.

Response

Stack saved.

messagestring required

Changes

    • info

      added the new optional header request parameter If-Match

    • info

      added the new optional header request parameter X-Compose-File

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status

    • info

      removed the ADMIRAL_REQUIRED enum value from the response property for the response status