文档数据库服务

安全组管理

2025-07-14 02:21:15

修改MongoDB实例的安全组

接口功能介绍

调用modifySecurityGroup接口修改MongoDB实例的安全组。

接口约束

URI
POST /v1/extApi/modifySecurityGroup

路径参数

Query参数

请求参数

请求头header参数

请求体body参数

参数

是否必填

参数类型

说明

示例

下级对象

spuInstId

String

实例ID

7eb8d17d789047d2892d9f1ec89a20ac


oldSecurityGroupId

String

旧用户安全组id

b625798c-06d7-4e57-b0c1-95f2d9a9eb4f


targetSecurityGroupId

String

目标用户安全组id

aa8ddfb7-f042-4c57-bb25-7df09d5c732a


targetSecurityGroupName

String

目标用户安全组名称

sgs-95601111


响应参数

参数

是否必填

参数类型

说明

示例

下级对象

statusCode

Integer

响应码取值范围:800为成功,900为失败

800


message

String

响应信息

修改安全组成功


returnObj

Object

返回对象



请求示例

请求头header

请求体body
{
    "spuInstId":"7eb8d17d789047d2892d9f1ec89a20ac",
    "oldSecurityGroupId":"b625798c-06d7-4e57-b0c1-95f2d9a9eb4f",
    "targetSecurityGroupId":"aa8ddfb7-f042-4c57-bb25-7df09d5c732a",
    "targetSecurityGroupName":"sgs-95601111"
}
响应示例
{
    "statusCode": 800,
    "message": "修改安全组成功",
    "returnObj": null
}
状态码

状态码

描述

800

表示请求成功

900

表示请求失败

错误码


查询iaas层安全组列表信息

接口功能介绍

调用describeSecurityGroup查询安全组列表信息。

接口约束

URI

GET /v1/extApi/describeSecurityGroup

路径参数

Query参数

参数

是否必填

参数类型

说明


下级对象

spuInstId

String

实例ID

7eb8d17d789047d2892d9f1ec89a20a


pageNow

Integer

当前页

不填则默认为1


pageSize

Integer

当前页数量

不填则默认为10


请求参数

请求头header参数

响应参数

响应参数

参数

是否必填

参数类型

说明


对象

statusCode

Integer

响应码
取值范围:800为成功,900为失败

800


message

String

响应信息

查询iaas层安全组列表成功


returnObj

Object

返回对象数组


returnObj

returnObj

参数

是否必填

参数类型

说明


下级对象

code  

Integer

接口调用状态码,0为成功,非0为失败

0


data

Object

返回对象


data

data

参数

是否必填

参数类型

说明


下级对象

lastPage

Integer

最后一页

8


navigatepageNums

Integer[]

导航页码数



startRow

Object

当前页面第一个元素在数据库中的行号


returnObj

hasNextPage

Boolean

是否有下一页



prePage

Integer

前一页



nextPage

Integer

下一页



endRow

Integer

当前页面最后一个元素在数据库中的行号



pageSize

Integer

每页的数量



list

Object[]



list

pageNum

Integer

当前页



navigatePages

Integer

导航页码数



total

Long

总记录数



pages

Integer

总页数



firstPage

Integer

第一页



size

Integer

当前页的数量



isLastPage

Boolean

是否为最后一页



hasPreviousPage

Boolean

是否有前一页



isFirstPage

Boolean

是否为第一页



list

参数

是否必填

参数类型

说明

示例

下级对象

regionId

String

资源池标识

100054c0416811e9a6690242ac110002


resSecurityGroupId

String

安全组标识

3d510445-8ec4-48e7-95b6-2db12c89ed95


vpcId

String

vpc标识



name

String

安全组名称

sgs-95601111


zoneId

String

zone标识

100054c0416811e9a6690242ac110002


zoneName

String

zone名称

保定os


请求示例

请求头header

请求参数query

GET /v1/extApi/describeSecurityGroup?spuInstId=7eb8d17d789047d2892d9f1ec89a20ac&pageNow=1&pageSize=10
响应示例
{
    "statusCode": 800,
    "message": "查询iaas层安全组列表成功",
    "returnObj": {
        "code": 0,
        "data": {
            "startRow": 0,
            "navigatepageNums": [
                1
            ],
            "lastPage": 1,
            "prePage": 0,
            "hasNextPage": false,
            "nextPage": 0,
            "pageSize": 10,
            "endRow": 3,
            "list": [
                {
                    "regionId": "100054c0416811e9a6690242ac110002",
                    "resSecurityGroupId": "3d510445-8ec4-48e7-95b6-2db12c89ed95",
                    "vpcId": null,
                    "name": "sgs-htap",
                    "zoneId": "100054c0416811e9a6690242ac110002",
                    "zoneName": "保定os"
                },
                {
                    "regionId": "100054c0416811e9a6690242ac110002",
                    "resSecurityGroupId": "aa8ddfb7-f042-4c57-bb25-7df09d5c732a",
                    "vpcId": null,
                    "name": "sgs-95601111",
                    "zoneId": "100054c0416811e9a6690242ac110002",
                    "zoneName": "保定os"
                },
                {
                    "regionId": "100054c0416811e9a6690242ac110002",
                    "resSecurityGroupId": "b625798c-06d7-4e57-b0c1-95f2d9a9eb4f",
                    "vpcId": null,
                    "name": "sgs-eb3e",
                    "zoneId": "100054c0416811e9a6690242ac110002",
                    "zoneName": "保定os"
                },
                {
                    "regionId": "100054c0416811e9a6690242ac110002",
                    "resSecurityGroupId": "f2036ce1-029c-426a-b6af-6afef5dbd487",
                    "vpcId": null,
                    "name": "default",
                    "zoneId": "100054c0416811e9a6690242ac110002",
                    "zoneName": "保定os"
                }
            ],
            "pageNum": 1,
            "navigatePages": 8,
            "total": 4,
            "navigateFirstPage": 1,
            "pages": 1,
            "size": 4,
            "firstPage": 1,
            "isLastPage": true,
            "hasPreviousPage": false,
            "navigateLastPage": 1,
            "isFirstPage": true
        }
    }
}
状态码

状态码

描述

800

表示请求成功

900

表示请求失败

错误码



Zbj6Hw9wN.L9