查询安全组详情
1. 接口描述
调用 DescribeSecurityGroupDetail 接口查询一个安全组的详细信息。安全组规则列表数据默认按优先级从高到低返回。
2. 请求参数
参数名 | 类型 | 是否必选 | 描述 |
---|---|---|---|
Action | String | 是 | 固定取值:DescribeSecurityGroupDetail |
SecurityGroupUUID | String | 是 | 安全组ID |
3. 返回数据
参数名 | 类型 | 说明 |
---|---|---|
SecurityGroupInfo | SecurityGroupInfo | 安全组详细信息 |
RuleInfoList | List<SecurityGroupRuleDetails> | 安全组规则列表 |
EcsInfoList | List<SecurityGroupEcsInstanceDetails> | 云主机实例列表 |
RequestId | String | 请求ID |
4. 示例
请求示例
https://openapi.kaopuyun.com/?SignatureVersion=1.0
&Action=DescribeSecurityGroup
&Format=JSON
&SecurityGroupUUID=sg-9r0000hvemzi
&SignatureNonce=fad368fd-b5e3-476b-903b-2ef34e0e9fba
&Version=2014-05-26
&AccessKeyId=hfWkfqG6a794
&Signature=IcyHYfUBWSzJauAbDaqniNSNE94=
&SignatureMethod=HMAC-SHA1
&Timestamp=2023-02-25T15:29:21Z
正常返回示例
{
"SecurityGroupInfo": {
"RuleInfoList": [
{
"SecurityGroupRuleUUID": "rul-8k0000002him",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:14:55",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "ALL",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "OUT",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"SecurityGroupRuleUUID": "rul-8k0000002hin",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:15:05",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "ICMP",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "3389/3389",
"PortRange": "3389/3389",
"SecurityGroupRuleUUID": "rul-8k0000002hio",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:15:10",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "22/22",
"PortRange": "22/22",
"SecurityGroupRuleUUID": "rul-8k0000002hiq",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:15:14",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "443/443",
"PortRange": "443/443",
"SecurityGroupRuleUUID": "rul-8k0000002hir",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:15:16",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
},
{
"Policy": "80/80",
"PortRange": "80/80",
"SecurityGroupRuleUUID": "rul-8k0000002hiv",
"SecurityGroupRulePendingStatus": "NONE",
"CreateTime": "2024-08-26 10:15:20",
"SecurityGroupRuleStatus": "AVAILABLE",
"UpdateTime": "2024-08-26 10:15:31",
"IpProtocol": "TCP",
"SecurityGroupUUID": "sg-8k0000002hii",
"RuleDirection": "IN",
"AuthorizObject": "0.0.0.0/0",
"Remark": "预设规则"
}
],
"BindIpAllowance": 100,
"SecurityGroupName": "test",
"RegionCode": "cn-dev-1",
"RegionName": "测试十区",
"CreateTime": "2024-08-26 10:14:40",
"RuleNumber": 6,
"SecurityGroupUUID": "sg-8k0000002hii",
"EcsNumber": 0
},
"RequestId": "5fe76e20-7ece-11ef-a820-aa0281f49de7",
"EcsInfoList": []
}
5. 错误码
错误码 | 错误信息 |
---|---|
MissingParameter | SecurityGroupUUID参数不能为空 |
NoPermission | 没有权限 |
ResourceNotExist | 资源不存在 |
DescribeSecurityGroupDetailsFailed | 查询安全组详情失败:xxx |