ByCloud Docs
GuidesCLIAPISDK
patch/v1/instances/{instance_id}

Update instance

Update an instance's name, description, or metadata

Path Parameters

instance_id

string<uuid>required

path

Instance ID

Example: "550e8400-e29b-41d4-a716-446655440000"

Request Body

required

Content-Type: application/json

name

stringoptional

description

stringoptional

metadata

objectoptional

tags

arrayoptional

Responses

200

Instance updated

Content-Type: application/json

instance

objectoptional
400

Invalid request parameters

Content-Type: application/json

error

objectrequired
401

Authentication required or token invalid

Content-Type: application/json

error

objectrequired
404

Resource not found

Content-Type: application/json

error

objectrequired
500

Internal server error

Content-Type: application/json

error

objectrequired
curl -X PATCH "https://api.spo1.mycloud.com/v1/instances/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": [
"web",
"frontend"
]
}'

Response

Instance updated

{
"instance": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"crn": "crn:spo1:compute:instance:550e8400-e29b-41d4-a716-446655440000",
"name": "web-server-01",
"description": "Primary web server",
"status": "ACTIVE",
"power_state": "RUNNING",
"task_state": null,
"vm_state": "ACTIVE",
"flavor": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "m1.medium",
"vcpus": 2,
"ram": 4096,
"disk": 40
},
"image": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Ubuntu 22.04 LTS"
},
"addresses": {
"private-network": [
{
"addr": "192.168.1.10",
"version": 4,
"type": "fixed",
"mac_addr": "fa:16:3e:4f:5a:2b"
}
]
},
"security_groups": [
{
"name": "default"
}
],
"volumes_attached": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"device": "/dev/vdb",
"delete_on_termination": false
}
],
"key_names": [
"my-keypair",
"backup-key"
],
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": [
"web",
"frontend"
],
"fault": {
"code": 500,
"message": "No valid host was found",
"details": "string",
"created": "2024-01-15T10:30:00Z"
},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"launched_at": "2024-01-15T10:30:00Z",
"terminated_at": "2024-01-15T10:30:00Z"
}
}