Rename
The /actions/:cluster/container/:containerName/rename endpoint of the Dashium API allows you to rename a Docker container.
Endpointβ
- Path:
/actions/:cluster/container/:containerName/rename - Method:
PUT
Parametersβ
:cluster(path parameter): The ID of the cluster containing the container.:containerName(path parameter): The name of the container to be renamed.newName(request body): The new name to be assigned to the container.
Responseβ
The response confirms the successful renaming of the Docker container.
Response Exampleβ
{
"info": "Container {containerName} renamed to {newName}!"
}
Exampleβ
fetch('http://your-api-url/actions/your-cluster/container/your-container/rename', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ newName: 'NewContainerName' }),
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));