Connect a container to a network Run in API Explorer
The network must be either a local-scoped network or a swarm-scoped network with the attachable
option set. A network cannot be re-attached to a running container
POST
/networks/{id}/connect
curl \
--request POST 'http://api.example.com/v1.44/networks/{id}/connect' \
--header "Content-Type: application/json" \
--data '{"Container":"3613f73ba0e4","EndpointConfig":{"IPAMConfig":{"IPv4Address":"172.24.56.89","IPv6Address":"2001:db8::5689"},"MacAddress":"02:42:ac:12:05:02"}}'
Request examples
{
"Container": "3613f73ba0e4",
"EndpointConfig": {
"IPAMConfig": {
"IPv4Address": "172.24.56.89",
"IPv6Address": "2001:db8::5689"
},
"MacAddress": "02:42:ac:12:05:02"
}
}
Response examples (400)
{
"message": "Something went wrong."
}
Response examples (400)
{
"message": "Something went wrong."
}
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."
}