POST zstack/v1/port-mirrorsAuthorization: OAuth the-session-uuid{
"params": {
"mirrorNetworkUuid": "7d4ac8aafcd33306b21a0c40a6dec9cb"
},
"systemTags": [],
"userTags": []
}curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"mirrorNetworkUuid":"7d4ac8aafcd33306b21a0c40a6dec9cb"}}' http://localhost:8080/zstack/v1/port-mirrors| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| mirrorNetworkUuid | String | body(包含在params结构中) | 镜像网络资源的UUID | 3.7.0 | |
| name (可选) | String | body(包含在params结构中) | 资源名称 | 3.7.0 | |
| description (可选) | String | body(包含在params结构中) | 资源的详细描述 | 3.7.0 | |
| stateEvent (可选) | String | body(包含在params结构中) | 流量镜像服务的状态 |
| 3.7.0 |
| resourceUuid (可选) | String | body(包含在params结构中) | 3.7.0 | ||
| tagUuids (可选) | List | body(包含在params结构中) | 标签UUID列表 | 3.7.0 | |
| systemTags (可选) | List | body | 系统标签 | 3.7.0 | |
| userTags (可选) | List | body | 用户标签 | 3.7.0 |
{
"inventory": {
"uuid": "66818821906036338c8e8f7773b03263",
"name": "port mirror",
"state": "Enabled",
"mirrorNetworkUuid": "c1da6a9a815f3b17be87c19f9a43fe77",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.7.0 |
| inventory | PortMirrorInventory | 详情参考inventory | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.7.0 |
| description | String | 错误的概要描述 | 3.7.0 |
| details | String | 错误的详细信息 | 3.7.0 |
| elaboration | String | 保留字段,默认为null | 3.7.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.7.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| mirrorNetworkUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| state | PortMirrorState | 详情参考state | 3.7.0 |
| sessions | List | 详情参考sessions | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Enabled | PortMirrorState | 3.7.0 | |
| Disabled | PortMirrorState | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| internalId | Long | 3.7.0 | |
| srcEndPoint | String | 3.7.0 | |
| dstEndPoint | String | 3.7.0 | |
| portMirrorUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| status | SessionStatus | 详情参考status | 3.7.0 |
| type | SessionType | 详情参考type | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Created | SessionStatus | 3.7.0 | |
| Active | SessionStatus | 3.7.0 | |
| Inactive | SessionStatus | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Ingress | SessionType | 3.7.0 | |
| Egress | SessionType | 3.7.0 | |
| Bidirection | SessionType | 3.7.0 |
CreatePortMirrorAction action = new CreatePortMirrorAction();
action.mirrorNetworkUuid = "7d4ac8aafcd33306b21a0c40a6dec9cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreatePortMirrorAction.Result res = action.call();CreatePortMirrorAction action = CreatePortMirrorAction()
action.mirrorNetworkUuid = "7d4ac8aafcd33306b21a0c40a6dec9cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreatePortMirrorAction.Result res = action.call()GET zstack/v1/port-mirrors
GET zstack/v1/portMirrors/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/port-mirrors?q=name=web&q=state=Enabledcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/portMirrors/5aa247a04fbd3b9e9331e78645e81729可查询字段
运行zstack-cli命令行工具,输入QueryPortMirror并按Tab键查看所有可查询字段以及可跨表查询的资源名。
{
"inventories": [
{
"uuid": "a1595ae4032236ed8cf8c0d8b4b498e7",
"name": "port mirror",
"state": "Enabled",
"mirrorNetworkUuid": "2616116e22ab3033adc12890947259a6",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.7.0 |
| inventories | List | 详情参考inventories | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.7.0 |
| description | String | 错误的概要描述 | 3.7.0 |
| details | String | 错误的详细信息 | 3.7.0 |
| elaboration | String | 保留字段,默认为null | 3.7.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.7.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| mirrorNetworkUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| state | PortMirrorState | 详情参考state | 3.7.0 |
| sessions | List | 详情参考sessions | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Enabled | PortMirrorState | 3.7.0 | |
| Disabled | PortMirrorState | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| internalId | Long | 3.7.0 | |
| srcEndPoint | String | 3.7.0 | |
| dstEndPoint | String | 3.7.0 | |
| portMirrorUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| status | SessionStatus | 详情参考status | 3.7.0 |
| type | SessionType | 详情参考type | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Created | SessionStatus | 3.7.0 | |
| Active | SessionStatus | 3.7.0 | |
| Inactive | SessionStatus | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Ingress | SessionType | 3.7.0 | |
| Egress | SessionType | 3.7.0 | |
| Bidirection | SessionType | 3.7.0 |
QueryPortMirrorAction action = new QueryPortMirrorAction();
action.conditions = asList("name=web","state=Enabled");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryPortMirrorAction.Result res = action.call();QueryPortMirrorAction action = QueryPortMirrorAction()
action.conditions = ["name=web","state=Enabled"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryPortMirrorAction.Result res = action.call()PUT zstack/v1/port-mirrors/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updatePortMirror": {
"name": "new pm",
"description": "for test update"
},
"systemTags": [],
"userTags": []
}curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updatePortMirror":{"name":"new pm","description":"for test update"}}' http://localhost:8080/zstack/v1/port-mirrors/8b4a0c82ba273ceda3ef09daf0ecd90d/actions| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 3.7.0 | |
| name (可选) | String | body(包含在updatePortMirror结构中) | 资源名称 | 3.7.0 | |
| description (可选) | String | body(包含在updatePortMirror结构中) | 资源的详细描述 | 3.7.0 | |
| systemTags (可选) | List | body | 系统标签 | 3.7.0 | |
| userTags (可选) | List | body | 用户标签 | 3.7.0 |
{
"inventory": {
"uuid": "2bafc0057bac3a6294a24a48c079c738",
"name": "port mirror",
"state": "Enabled",
"mirrorNetworkUuid": "aacd59f03a853463846361bb946097c8",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.7.0 |
| inventory | PortMirrorInventory | 详情参考inventory | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.7.0 |
| description | String | 错误的概要描述 | 3.7.0 |
| details | String | 错误的详细信息 | 3.7.0 |
| elaboration | String | 保留字段,默认为null | 3.7.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.7.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| mirrorNetworkUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| state | PortMirrorState | 详情参考state | 3.7.0 |
| sessions | List | 详情参考sessions | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Enabled | PortMirrorState | 3.7.0 | |
| Disabled | PortMirrorState | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.7.0 |
| name | String | 资源名称 | 3.7.0 |
| description | String | 资源的详细描述 | 3.7.0 |
| internalId | Long | 3.7.0 | |
| srcEndPoint | String | 3.7.0 | |
| dstEndPoint | String | 3.7.0 | |
| portMirrorUuid | String | 3.7.0 | |
| createDate | Timestamp | 创建时间 | 3.7.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.7.0 |
| status | SessionStatus | 详情参考status | 3.7.0 |
| type | SessionType | 详情参考type | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Created | SessionStatus | 3.7.0 | |
| Active | SessionStatus | 3.7.0 | |
| Inactive | SessionStatus | 3.7.0 |
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| Ingress | SessionType | 3.7.0 | |
| Egress | SessionType | 3.7.0 | |
| Bidirection | SessionType | 3.7.0 |
UpdatePortMirrorAction action = new UpdatePortMirrorAction();
action.uuid = "8b4a0c82ba273ceda3ef09daf0ecd90d";
action.name = "new pm";
action.description = "for test update";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdatePortMirrorAction.Result res = action.call();UpdatePortMirrorAction action = UpdatePortMirrorAction()
action.uuid = "8b4a0c82ba273ceda3ef09daf0ecd90d"
action.name = "new pm"
action.description = "for test update"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdatePortMirrorAction.Result res = action.call()学习路径
ZStack Cloud 产品学习路径
快速梳理文档,点击相应文本链接,快速跳转到相应文档的页面,学习 ZStack Cloud 产品。
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io商务咨询:
400-962-2212 转 1商务联系:
channel@zstack.io下载链接已发送至您的邮箱。
如未收到,请查看您的垃圾邮件、订阅邮件、广告邮件。 当您收到电子邮件后,请点击 URL 链接,以完成下载。感谢您使用 ZStack 产品和服务。
成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。
立即体验
联系我们
回到顶部
商务咨询:
400-962-2212 转 1售后咨询:
400-962-2212 转 2商务联系:
sales@zstack.io成功提交申请。
我们将安排工作人员尽快与您取得联系。感谢您使用 ZStack 产品和服务。