Skip to main content

Pull image and recreate

POST/v2/stacks/{stackId}/services/{serviceId}/actions/pull
API version
v2
Request method
POST
Operation ID
container-pull-image-for-service

Pulls the image for this container and recreates it. This is equivalent to running docker-compose pull and docker-compose up -d on the command line.

Request​

  • stackIdstring (uuid)required

    ID of the Stack to pull the image of a Service for.

  • serviceIdstringrequired

    ID of the Service to pull the image for.

Responses​

No response content specified.

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/stacks/f0f86186-0a5a-45b2-aa33-502777496347/services/string/actions/pull?skipRecreate=true
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.container.pullImageForService({
"stackId": "f0f86186-0a5a-45b2-aa33-502777496347",
"serviceId": "string",
"queryParameters": {
"skipRecreate": true
}
});

assertStatus(response, 204);

use \Mittwald\ApiClient\Generated\V2\Clients\Container\PullImageForService\PullImageForServiceRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new PullImageForServiceRequest(
stackId: "f0f86186-0a5a-45b2-aa33-502777496347",
serviceId: "string"
))
->withSkipRecreate(true);
$response = $client->container()->pullImageForService($request);

var_dump($response->getBody();

On this page