Skip to main content

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));