Updated on 2025-11-10 GMT+08:00

Updating a Subnet CIDR Reservation

Function

This API is used to update basic information about a subnet CIDR reservation, including the name and description.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    vpc:subnets:updateReservation

    Write

    subnet *

    • g:ResourceTag/<tag-key>

    • vpc:VirsubnetCidrReservationId

    • g:EnterpriseProjectId

    -

    -

URI

PUT /v3/{project_id}/vpc/virsubnet-cidr-reservations/{virsubnet_cidr_reservation_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

Range:

N/A

virsubnet_cidr_reservation_id

Yes

String

Definition:

ID of a subnet CIDR reservation.

Range:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

dry_run

No

Boolean

Definition:

Whether to only check the request.

Constraints:

N/A

Range:

  • true: Only the check request will be sent and no subnet CIDR reservation will be updated. Check items include mandatory parameters, request format, and constraints. If the check fails, an error will be returned. If the check succeeds, response code 202 will be returned.

    • false: A request will be sent and a subnet CIDR reservation will be updated.

    Default Value:

false

virsubnet_cidr_reservation

Yes

UpdateVirsubnetCidrReservationOption object

Definition:

Request body for updating a subnet CIDR reservation.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

Table 3 UpdateVirsubnetCidrReservationOption

Parameter

Mandatory

Type

Description

name

No

String

Definition:

Name of the subnet CIDR reservation.

Constraints:

The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods.

Range:

N/A

Default Value:

N/A

description

No

String

Definition:

Description of a subnet CIDR reservation.

Constraints:

The value can contain 0 to 255 characters and cannot contain angle brackets (< or >).

Range:

N/A

Default Value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Definition:

Request ID.

Range:

N/A

virsubnet_cidr_reservation

VirsubnetCidrReservation object

Definition:

Response body for updating a subnet CIDR reservation.

Range:

N/A

Table 5 VirsubnetCidrReservation

Parameter

Type

Description

id

String

Definition:

ID of a subnet CIDR reservation. Each subnet CIDR reservation comes with an ID, which uniquely identifies the subnet CIDR reservation.

Range:

The value is in UUID format with hyphens (-).

virsubnet_id

String

Definition:

ID of the subnet that a subnet CIDR reservation belongs to.

Range:

The value is in UUID format with hyphens (-).

vpc_id

String

Definition:

ID of the VPC that a subnet CIDR reservation belongs to.

Range:

The value is in UUID format with hyphens (-).

ip_version

Integer

Definition:

IP address version of a subnet CIDR reservation.

Range:

  • 4: IPv4

  • 6: IPv6

cidr

String

Definition:

CIDR block of a subnet CIDR reservation.

Range:

The value is in CIDR block format. The minimum netmask value is the subnet netmask value plus 2, and the maximum netmask value is 32 (IPv4) or 128 (IPv6).

name

String

Definition:

Name of the subnet CIDR reservation.

Range:

The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods.

description

String

Definition:

Description of a subnet CIDR reservation.

Range:

The value can contain 0 to 255 characters and cannot contain angle brackets (< or >).

project_id

String

Definition:

ID of the project that a subnet CIDR reservation belongs to.

Range:

N/A

created_at

String

Definition:

Time when a subnet CIDR reservation is created.

Range:

The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ.

updated_at

String

Definition:

Time when the subnet CIDR reservation was last updated.

Range:

The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ.

Example Requests

Update name and description of the subnet CIDR reservation whose ID is ed4edb94-754c-7848-bb77-2d381906c535 to name-test-updated and description-test-updated.

PUT https://{Endpoint}/v3/{project_id}/vpc/virsubnet-cidr-reservations/ed4edb94-754c-7848-bb77-2d381906c535

{
  "virsubnet_cidr_reservation" : {
    "name" : "name-test-updated",
    "description" : "description-test-updated"
  }
}

Example Responses

Status code: 200

The PUT operation is successful. For more status codes, see Status Codes.

{
  "virsubnet_cidr_reservation" : {
    "id" : "ed4edb94-754c-7848-bb77-2d381906c535",
    "virsubnet_id" : "fb0e2bd6-190f-0d1a-7728-a5f6b1d8dd19",
    "vpc_id" : "cef5d621-6c20-d5df-74e8-746271fba734",
    "ip_version" : 4,
    "cidr" : "192.168.21.96/28",
    "name" : "name-test-updated",
    "description" : "description-test-updated",
    "project_id" : "11e8dd119c77479db890e266e68c1ecf",
    "created_at" : "2024-09-09T11:56:27Z",
    "updated_at" : "2024-09-09T12:00:06Z"
  },
  "request_id" : "5e8c57bcfa0bd4798915cb5d7a37c1d9"
}

Status Codes

Status Code

Description

200

The PUT operation is successful. For more status codes, see Status Codes.

Error Codes

See Error Codes.