Disconnect a container from a network Run in API Explorer

POST /networks/{id}/disconnect

Path parameters

  • id string Required

    Network ID or name

application/json

Body Required

  • Container string

    The ID or name of the container to disconnect from the network.

  • Force boolean

    Force the container to disconnect from the network.

Responses

  • 200

    No error

  • 403 application/json

    Operation not supported for swarm scoped networks

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 404 application/json

    Network or container not found

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 500 application/json

    Server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

POST /networks/{id}/disconnect
curl \
 --request POST 'http://api.example.com/v1.49/networks/{id}/disconnect' \
 --header "Content-Type: application/json" \
 --data '{"Container":"string","Force":true}'
Request examples
{
  "Container": "string",
  "Force": true
}
Response examples (403)
{
  "message": "Something went wrong."
}
Response examples (403)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}