Document navigation

Multicast Routing Operations

CreateMulticastRouter

API Request

URLs
POST zstack/v1/multicast/virtual-routers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vpcRouterVmUuid": "6fe7772600d039bf80d8e2359fcef61a",
    "description": "this is a header router for test"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vpcRouterVmUuid":"6fe7772600d039bf80d8e2359fcef61a","description":"this is a header router for test"}}' http://localhost:8080/zstack/v1/multicast/virtual-routers
Request Parameters
Name Type Location Description Optional Value Starting Version
vpcRouterVmUuid String body (contained in the params structure) 3.7.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.7.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.7.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "974c38ae483737c3b4ded18de56773b6",
    "description": "test for header",
    "rpGroups": [
      {
        "uuid": "0bda384377d53656b89270948f795ab8",
        "multicastRouterUuid": "974c38ae483737c3b4ded18de56773b6",
        "rpAddress": "1.2.3.4",
        "groupAddress": "239.1.1.1/32"
      }
    ],
    "vpcVrs": []
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventory MulticastRouterInventory See inventory. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0
description String The detailed description of the resource. 3.7.0
state String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
rpGroups List See rpGroups. 3.7.0
vpcVrs List See vpcVrs. 3.7.0
#rpGroups
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
multicastRouterUuid String 3.7.0
rpAddress String 3.7.0
groupAddress String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
#vpcVrs
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0

SDK Sample

Java SDK
CreateMulticastRouterAction action = new CreateMulticastRouterAction();
action.vpcRouterVmUuid = "6fe7772600d039bf80d8e2359fcef61a";
action.description = "this is a header router for test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateMulticastRouterAction.Result res = action.call();
Python SDK
CreateMulticastRouterAction action = CreateMulticastRouterAction()
action.vpcRouterVmUuid = "6fe7772600d039bf80d8e2359fcef61a"
action.description = "this is a header router for test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateMulticastRouterAction.Result res = action.call()

DeleteMulticastRouter

API Request

URLs
DELETE zstack/v1/multicast/virtual-routers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/multicast/virtual-routers/cce17d3b823933a8b0694af5159fed4d?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.7.0
deleteMode String body Optional. The delete mode. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
DeleteMulticastRouterAction action = new DeleteMulticastRouterAction();
action.uuid = "cce17d3b823933a8b0694af5159fed4d";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteMulticastRouterAction.Result res = action.call();
Python SDK
DeleteMulticastRouterAction action = DeleteMulticastRouterAction()
action.uuid = "cce17d3b823933a8b0694af5159fed4d"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteMulticastRouterAction.Result res = action.call()

QueryMulticastRouter

API Request

URLs
GET zstack/v1/multicast/virtual-routers
GET zstack/v1/multicast/virtual-routers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/multicast/virtual-routers?q=name=multicastRouter
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/multicast/virtual-routers/83791299370039dba6b9318e46dfcf69

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryMulticastRouter, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "df41b45fd5213ceab084e5b733886ac0",
      "description": "test for header",
      "rpGroups": [
        {
          "uuid": "08f7436a526b3cbab51ca95d9e578d27",
          "multicastRouterUuid": "df41b45fd5213ceab084e5b733886ac0",
          "rpAddress": "1.2.3.4",
          "groupAddress": "239.1.1.1/32"
        }
      ],
      "vpcVrs": []
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventories List See inventories. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0
description String The detailed description of the resource. 3.7.0
state String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
rpGroups List See rpGroups. 3.7.0
vpcVrs List See vpcVrs. 3.7.0
#rpGroups
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
multicastRouterUuid String 3.7.0
rpAddress String 3.7.0
groupAddress String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
#vpcVrs
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0

SDK Sample

Java SDK
QueryMulticastRouterAction action = new QueryMulticastRouterAction();
action.conditions = asList("name=multicastRouter");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryMulticastRouterAction.Result res = action.call();
Python SDK
QueryMulticastRouterAction action = QueryMulticastRouterAction()
action.conditions = ["name=multicastRouter"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryMulticastRouterAction.Result res = action.call()

ChangeMulticastRouterState

API Request

URLs
PUT zstack/v1/multicast/virtual-routers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeMulticastRouterState": {
    "stateEvent": "enable"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeMulticastRouterState":{"stateEvent":"enable"}}' http://localhost:8080/zstack/v1/multicast/virtual-routers/0cbf995f538b3aed855e3e50ea38eb0c/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.7.0
stateEvent String body (contained in the changeMulticastRouterState structure)
  • enable
  • disable
3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "93ce20a6a51932ce8f544033d5cdca3c",
    "description": "test for header",
    "rpGroups": [
      {
        "uuid": "3ef422d857ff3a09a6c000900ac37f78",
        "multicastRouterUuid": "93ce20a6a51932ce8f544033d5cdca3c",
        "rpAddress": "1.2.3.4",
        "groupAddress": "239.1.1.1/32"
      }
    ],
    "vpcVrs": []
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventory MulticastRouterInventory See inventory. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0
description String The detailed description of the resource. 3.7.0
state String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
rpGroups List See rpGroups. 3.7.0
vpcVrs List See vpcVrs. 3.7.0
#rpGroups
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
multicastRouterUuid String 3.7.0
rpAddress String 3.7.0
groupAddress String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
#vpcVrs
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0

SDK Sample

Java SDK
ChangeMulticastRouterStateAction action = new ChangeMulticastRouterStateAction();
action.uuid = "0cbf995f538b3aed855e3e50ea38eb0c";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeMulticastRouterStateAction.Result res = action.call();
Python SDK
ChangeMulticastRouterStateAction action = ChangeMulticastRouterStateAction()
action.uuid = "0cbf995f538b3aed855e3e50ea38eb0c"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeMulticastRouterStateAction.Result res = action.call()

GetVpcMulticastRoute

API Request

URLs
GET zstack/v1/multicast/virtual-routers/{uuid}/routes
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/multicast/virtual-routers/a880287e652d3137a9f7349dc7f65a49/routes
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.7.0
systemTags List query Optional. 3.7.0
userTags List query Optional. 3.7.0

API Response

Sample Response
{
  "inventories": [
    {
      "sourceAddress": "1.2.3.4",
      "groupAddress": "239.1.1.1",
      "ingressInterfaces": "eth0",
      "egressInterfaces": "eth1"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventories List See inventories. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventories
Name Type Description Starting Version
sourceAddress String 3.7.0
groupAddress String 3.7.0
ingressInterfaces String 3.7.0
egressInterfaces String 3.7.0

SDK Sample

Java SDK
GetVpcMulticastRouteAction action = new GetVpcMulticastRouteAction();
action.uuid = "a880287e652d3137a9f7349dc7f65a49";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVpcMulticastRouteAction.Result res = action.call();
Python SDK
GetVpcMulticastRouteAction action = GetVpcMulticastRouteAction()
action.uuid = "a880287e652d3137a9f7349dc7f65a49"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVpcMulticastRouteAction.Result res = action.call()

AddRendezvousPointToMulticastRouter

API Request

URLs
POST zstack/v1/multicast/virtual-routers/{uuid}/RendezvousPoint
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "rpAddress": "1.2.3.4",
    "groupAddress": "239.0.0.1/32"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"rpAddress":"1.2.3.4","groupAddress":"239.0.0.1/32"}}' http://localhost:8080/zstack/v1/multicast/virtual-routers/fae38e0915973679ac76cc40da3e2f51/RendezvousPoint
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.7.0
rpAddress String body (contained in the params structure) 3.7.0
groupAddress String body (contained in the params structure) 3.7.0
resourceUuid String body (contained in the params structure) Optional. 3.7.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "9127988e024a3a87865efcd1381d8fd4",
    "description": "test for header",
    "rpGroups": [
      {
        "uuid": "68953d6bf3913f0188ddf66656daedaa",
        "multicastRouterUuid": "9127988e024a3a87865efcd1381d8fd4",
        "rpAddress": "1.2.3.4",
        "groupAddress": "239.1.1.1/32"
      }
    ],
    "vpcVrs": []
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.7.0
inventory MulticastRouterInventory See inventory. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.7.0
description String The brief description of the error. 3.7.0
details String The details about the error. 3.7.0
elaboration String The reserved field. Default value: null. 3.7.0
opaque LinkedHashMap The reserved field. Default value: null. 3.7.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.7.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0
description String The detailed description of the resource. 3.7.0
state String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
rpGroups List See rpGroups. 3.7.0
vpcVrs List See vpcVrs. 3.7.0
#rpGroups
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
multicastRouterUuid String 3.7.0
rpAddress String 3.7.0
groupAddress String 3.7.0
createDate Timestamp The creation date. 3.7.0
lastOpDate Timestamp The last operation date. 3.7.0
#vpcVrs
Name Type Description Starting Version
uuid String The resource UUID. 3.7.0
vpcRouterUuid String 3.7.0

SDK Sample

Java SDK
AddRendezvousPointToMulticastRouterAction action = new AddRendezvousPointToMulticastRouterAction();
action.uuid = "fae38e0915973679ac76cc40da3e2f51";
action.rpAddress = "1.2.3.4";
action.groupAddress = "239.0.0.1/32";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddRendezvousPointToMulticastRouterAction.Result res = action.call();
Python SDK
AddRendezvousPointToMulticastRouterAction action = AddRendezvousPointToMulticastRouterAction()
action.uuid = "fae38e0915973679ac76cc40da3e2f51"
action.rpAddress = "1.2.3.4"
action.groupAddress = "239.0.0.1/32"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddRendezvousPointToMulticastRouterAction.Result res = action.call()

RemoveRendezvousPointFromMulticastRouter

API Request

URLs
DELETE zstack/v1/multicast/virtual-routers/{uuid}/RendezvousPoint
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/multicast/virtual-routers/b0efeaec578931d49c6c8b457287e1db/RendezvousPoint?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.7.0
rpAddress String body 3.7.0
groupAddress String body 3.7.0
deleteMode String body Optional. The delete mode. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
RemoveRendezvousPointFromMulticastRouterAction action = new RemoveRendezvousPointFromMulticastRouterAction();
action.uuid = "b0efeaec578931d49c6c8b457287e1db";
action.rpAddress = "1.2.3.4";
action.groupAddress = "239.1.1.1/32";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveRendezvousPointFromMulticastRouterAction.Result res = action.call();
Python SDK
RemoveRendezvousPointFromMulticastRouterAction action = RemoveRendezvousPointFromMulticastRouterAction()
action.uuid = "b0efeaec578931d49c6c8b457287e1db"
action.rpAddress = "1.2.3.4"
action.groupAddress = "239.1.1.1/32"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveRendezvousPointFromMulticastRouterAction.Result res = action.call()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center