虚拟私有云 VPC
虚拟私有云 VPC
- 最新动态
- 功能总览
- 产品介绍
- 快速入门
- 用户指南
- 最佳实践
-
API参考
- 使用前必读
- API概览
- 如何调用API
- API
- API V3
- 应用示例
-
权限和授权项
- 策略及授权项说明
- VPC
- 子网
- 端口
- 对等连接
- VPC路由
- 路由表
- 配额
- 私有IP
- 安全组
- 安全组规则
- VPC标签
- 子网标签
- VPC流日志
- 端口(Openstack Neutron API)
- 网络(Openstack Neutron API)
- 子网(Openstack Neutron API)
- 路由器(Openstack Neutron API)
- 网络ACL(Openstack Neutron API)
- 安全组(Openstack Neutron API)
- VPC(API V3)
- 安全组(API V3)
- 安全组规则(API V3)
- IP地址组(API V3)
- 辅助弹性网卡(API V3)
- 流量镜像会话(API V3)
- 流量镜像筛选条件(API V3)
- 流量镜像筛选规则(API V3)
- 网络ACL(API V3)
- 网络ACL标签(API V3)
- 端口(API V3)
- API授权项注意事项
- 常见问题
- 历史API
- 附录
- SDK参考
- 场景代码示例
-
常见问题
- 计费类
- 虚拟私有云与子网类
- 弹性公网IP类
- 对等连接类
- 虚拟IP类
- 带宽类
-
网络连接类
- VPN支持将两个VPC互连吗?
- ECS有多个网卡时,为何无法通过域名访问公网网站及云中的内部域名?
- 同时拥有自定义路由和EIP的ECS访问外网的优先级是什么?
- 本地主机访问使用弹性云服务器搭建的网站出现间歇性中断怎么办?
- 同一个子网下的弹性云服务器只能通过内网IP地址单向通信怎么办?
- 同一个VPC内的两台弹性云服务器无法互通或者出现丢包等现象时,如何排查?
- Cloud-init连接出现问题时,如何排查?
- EIP连接出现问题时,如何排查?
- 二三层通信出现问题时,如何排查?
- 裸机网络出现问题时,如何排查?
- 弹性云服务器IP获取不到时,如何排查?
- VPN及专线网络连接出现问题时,如何排查?
- 外网能访问服务器,但是服务器无法访问外网时,如何排查?
- 配置了IPv6双栈,为什么无法访问IPv6网站?
- 弹性云服务器防火墙配置完成后,为什么网络不通?
- 路由类
- 安全类
- 视频帮助
- 文档下载
- 通用参考
链接复制成功!
创建安全组
功能介绍
创建安全组。
在创建安全组后,默认配置允许任何IP地址访问TCP协议的22端口和3389端口,这意味着允许SSH连接和RDP访问,存在一定安全隐患。
调试
您可以在API Explorer中调试该接口。
URI
POST /v1/{project_id}/security-groups
请求参数
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
security_group |
是 |
security_group object |
安全组对象,请参见表3。 |
请求示例
- 创建一个安全组,命名为sg-01,所在vpc id为3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85。
POST https://{Endpoint}/v1/{project_id}/security-groups { "security_group": { "name": "sg-01", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" } }
响应参数
名称 |
参数类型 |
说明 |
---|---|---|
security_group |
security_group object |
安全组对象,请参见表5。 |
名称 |
参数类型 |
说明 |
---|---|---|
name |
String |
安全组名称。 |
description |
String |
安全组描述。 |
id |
String |
安全组唯一标识。 |
vpc_id |
String |
安全组所在的vpc的资源标识。 当前该参数只作提示用,不约束安全组在此vpc下,不建议继续使用。 |
security_group_rules |
Array of security_group_rule objects |
默认安全组规则列表,保证安全组内互通。 |
enterprise_project_id |
String |
|
名称 |
参数类型 |
说明 |
---|---|---|
id |
String |
安全组规则标识。 |
description |
String |
|
security_group_id |
String |
安全组标识。 |
direction |
String |
|
ethertype |
String |
|
protocol |
String |
|
port_range_min |
Integer |
|
port_range_max |
Integer |
|
remote_ip_prefix |
String |
|
remote_group_id |
String |
|
remote_address_group_id |
String |
|
tenant_id |
String |
|
响应示例
{ "security_group": { "id": "16b6e77a-08fa-42c7-aa8b-106c048884e6", "name": "qq", "description": "", "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2", "security_group_rules": [ { "id": "f11a3824-ac19-4fad-b4f1-c5f4a6dd0a80", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction": "ingress", "protocol": null, "description": "", "ethertype": "IPv6", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "3d6480e8-9ea4-46dc-bb1b-8db190cd5677", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": null, "direction": "egress", "protocol": null, "description": "", "ethertype": "IPv6", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "9581f18c-1fdd-43da-ace9-7758a56ef28a", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": null, "direction": "egress", "protocol": null, "description": "", "ethertype": "IPv4", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null }, { "id": "a3ba270e-e58b-432d-a912-aeb7eace9fb8", "tenant_id": "060576782980d5762f9ec014dd2f1148", "security_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "remote_group_id": "69c999ad-d9ef-4d79-94fd-35e6ceb75325", "direction": "ingress", "protocol": null, "description": "", "ethertype": "IPv4", "remote_ip_prefix": null, "remote_address_group_id": null, "port_range_max": null, "port_range_min": null } ] } }
状态码
请参见状态码。
错误码
请参考错误码。
父主题: 安全组