DescribeSecurityGroups_云服务器 ECS_API文档

Plugin DownloadLearn more
VS Code Plugin
Before installing the plugin, please install VS CodeBefore installing the plugin, please install VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains Plugin
Before installing the plugin, please install JetBrains IDEBefore installing the plugin, please install JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

Operation Description

  • Paged query: We recommend that you specify MaxResults and NextToken.

    • If the response does not include NextToken, the current page of results is the last page and no more results are to be returned.
    • During a paged query, when you call the DescribeSecurityGroups operation to retrieve the first page of results, set MaxResults to specify the maximum number of entries to return in the call. The return value of NextToken is a pagination token that can be used in the next call to retrieve a new page of results.
    • When you call the DescribeSecurityGroups operation to retrieve a new page of results, set NextToken to the NextToken value returned in the previous call and set MaxResults to specify the maximum number of entries to return in this call.
  • When you use Alibaba Cloud CLI to call an API operation, you must specify request parameter values of different data types in required formats. For more information, see Parameter formats.

Quotas Info

The current API request rate is 1000/60(s).View More quotas information, please go to Quota Management View

Authorization Information

The following table shows the authorization information corresponding to this API, which can be used in the Action policy element to grant a RAM user or RAM role the permissions to call the API. Please use RAM to set up these permissions and refer to RAM documentation for more instructions.

Description:View Details...

ActionsAccess levelResource typeCondition keyAssociated operation
ecs:DescribeSecurityGroups
Get
SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/*
SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/{#securitygroupId}
ecs:tag
ecs:tag
ecs:tag
ecs:tag
None

Request Parameters

Field NameField Details
RegionIdstring

The region ID. You can call the DescribeRegions operation to query the most recent region list.

Example:cn-hangzhouReference Value Source:
    DescribeRegions
SecurityGroupIdsstring

The security group IDs. Set this parameter to a JSON array that consists of up to 100 security group IDs. Separate the security group IDs with commas (,).

Example:["sg-bp67acfmxazb4p****", "sg-bp67acfmxazb4p****", "sg-bp67acfmxazb4p****",....]Reference Value Source:
    CreateSecurityGroup
    DescribeSecurityGroupAttribute
VpcIdstring

The ID of the virtual private cloud (VPC) to which the security group belongs.

Example:vpc-bp67acfmxazb4p****
SecurityGroupTypestring

The type of the security group. Valid values:View Details...

Example:normal
NextTokenstring

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

Example:e71d8a535bd9cc11
MaxResultsinteger<int32>

The maximum number of entries per page. If you specify this parameter, both MaxResults and NextToken are used for a paged query.View Details...

Example:10value <= 100
NetworkTypestring

The network type of the security group. Valid values:View Details...

Example:vpc
SecurityGroupNamestring

The name of the security group.

Example:SGTestNameReference Value Source:
    DescribeSecurityGroupAttribute
IsQueryEcsCountboolean

Specifies whether to query the capacity of the security group. If you set this parameter to True, the EcsCount and AvailableInstanceAmount values in the response are valid.View Details...

Example:null
ResourceGroupIdstring

The ID of the resource group to which the security group belongs. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response. You can call the ListResourceGroups operation to query the most recent resource group list.View Details...

Example:rg-bp67acfmxazb4p****Reference Value Source:
    DescribeSnapshotGroups
Tagarray<object>

The tags to add to the security groups.

Count of Children <= 20
DryRunboolean

Specifies whether to perform only a dry run, without performing the actual request. Valid values:View Details...

Example:false
SecurityGroupIdstring

The security group ID.

Example:sg-bp67acfmxazb4p****Reference Value Source:
    CreateSecurityGroup
FuzzyQueryboolean
Note This parameter is deprecated.
Example:null
PageNumberinteger<int32>
Note This parameter will be removed in the future. We recommend that you use NextToken and MaxResults for a paged query.
Example:1value >= 1
PageSizeinteger<int32>
Note This parameter will be removed in the future. We recommend that you use NextToken and MaxResults for a paged query.
Example:10value <= 100
ServiceManagedboolean

Specifies whether to query managed security groups. Valid values:View Details...

Example:false

Response Parameters

Field NameField Details
RequestIdstring

The request ID.

Example:473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
RegionIdstring

The region ID of the security group.

Example:cn-hangzhou
NextTokenstring

A pagination token. If the return value of this parameter is empty when MaxResults and NextToken are used for a paged query, no next page exists.

Example:e71d8a535bd9cc11
SecurityGroupsobject
TotalCountinteger<int32>

The total number of security groups returned. If MaxResults and NextToken are specified in the request, the value of this parameter is not returned.

Example:20
PageNumberinteger<int32>

The page number.View Details...

Example:1
PageSizeinteger<int32>

The number of entries per page.View Details...

Example:10

Sample Response

Change History

Change timeChange content summaryoperation
2024-09-23
changeError code 400
changeresponse parameters
2023-11-14
addRequest parameter ServiceManaged
2023-04-07
changeError code 400
2021-12-05
changeError code 400
2021-10-12
changeRequest parameter MaxResults

Examples