Queries Dynamic Host Configuration Protocol (DHCP) options sets.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
vpc:ListDhcpOptionsSets | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the DHCP options sets that you want to query. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. Valid values:
| FFmyTO70tTpLG6I3FmYAXGKPd**** |
MaxResults | integer | No | The number of entries per page. Valid values: 1 to 100. Default value: 10. | 10 |
DomainName | string | No | The root domain. For example, you can set the value to example.com. After a DHCP options set is associated with a virtual private cloud (VPC), the root domain in the DHCP options set is automatically synchronized with the ECS instances in the VPC. | example.com |
DhcpOptionsSetName | string | No | The name of the DHCP options set. The name must be 1 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter. Valid values:
| test |
DhcpOptionsSetId | array | No | The ID of the DHCP options set. You can specify at most 20 IDs. | |
string | No | The ID of the DHCP options set. You can specify at most 20 IDs. | dopt-o6w0df4epg9zo8isy**** | |
ResourceGroupId | string | No | The ID of the resource group to which the DHCP options set belongs. | rg-acfmxazb4ph**** |
Tags | array<object> | No | The tag list. | |
object | No | |||
Key | string | No | The tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string. The tag key can be up to 64 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). The tag key must start with a letter but cannot start with | FinanceDept |
Value | string | No | The tag value. You can specify at most 20 tag values. The tag value can be an empty string. The tag value can be up to 128 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). The tag value must start with a letter but cannot start with | FinanceJoshua |
Response parameters
Examples
Sample success responses
JSON
format
{
"NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd********",
"RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
"DhcpOptionsSets": [
{
"DhcpOptionsSetDescription": "test",
"Status": "Available",
"DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
"DhcpOptionsSetName": "test",
"AssociateVpcCount": 2,
"OwnerId": 253460731706911260,
"DhcpOptions": {
"DomainNameServers": "192.168.XX.XX",
"DomainName": "example.com",
"LeaseTime": "3650d",
"Ipv6LeaseTime": "3650d"
},
"ResourceGroupId": "rg-acfmxazb4ph****",
"Tags": [
{
"Key": "FinanceDept",
"Value": "FinanceJoshua"
}
]
}
],
"TotalCount": "10"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IllegalParam.NextToken | The specified NextToken is invalid. | The specified NextToken is invalid. |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | The specified region does not exist. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-03-23 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2021-11-17 | The Error code has changed. The response structure of the API has changed | View Change Details |