From 46f9fbabdf2fdb3aa7ca92fd8a54a9a0a9443f4d Mon Sep 17 00:00:00 2001 From: nvazquez Date: Tue, 1 Dec 2015 11:46:22 -0800 Subject: [PATCH] CLOUDSTACK-9074: API Changes: Add l2gatewayserviceuuid to NVP devices --- .../apache/cloudstack/api/ApiConstants.java | 1 + .../classes/resources/messages.properties | 1 + .../api/commands/AddNiciraNvpDeviceCmd.java | 10 +++++++++ .../api/response/NiciraNvpDeviceResponse.java | 7 +++++++ ui/dictionary.jsp | 1 + ui/scripts/system.js | 21 +++++++++++++++++-- 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 742d2f42abf..4f689303705 100644 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -498,6 +498,7 @@ public class ApiConstants { public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid"; public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename"; public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid"; + public static final String NICIRA_NVP_L2_GATEWAYSERVICE_UUID = "l2gatewayserviceuuid"; public static final String S3_ACCESS_KEY = "accesskey"; public static final String S3_SECRET_KEY = "secretkey"; public static final String S3_END_POINT = "endpoint"; diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index e7beaa9304d..a487ea7b198 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -942,6 +942,7 @@ label.nfs.storage=NFS Storage label.nfs=NFS label.nic.adapter.type=NIC adapter type label.nicira.controller.address=Controller Address +label.nicira.l2gatewayserviceuuid=L2 Gateway Service Uuid label.nicira.l3gatewayserviceuuid=L3 Gateway Service Uuid label.nicira.transportzoneuuid=Transport Zone Uuid label.brocade.vcs.address=Vcs Switch Address diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java index 1a9be2854c3..1bde3b73609 100644 --- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java +++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/commands/AddNiciraNvpDeviceCmd.java @@ -80,6 +80,12 @@ public class AddNiciraNvpDeviceCmd extends BaseAsyncCmd { description = "The L3 Gateway Service UUID configured on the Nicira Controller") private String l3gatewayserviceuuid; + @Parameter(name = ApiConstants.NICIRA_NVP_L2_GATEWAYSERVICE_UUID, + type = CommandType.STRING, + required = false, + description = "The L2 Gateway Service UUID configured on the Nicira Controller") + private String l2gatewayserviceuuid; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -108,6 +114,10 @@ public class AddNiciraNvpDeviceCmd extends BaseAsyncCmd { return l3gatewayserviceuuid; } + public String getL2GatewayServiceUuid() { + return l2gatewayserviceuuid; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// diff --git a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java index 46287aa1f09..dedccefcc91 100644 --- a/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java +++ b/plugins/network-elements/nicira-nvp/src/main/java/com/cloud/api/response/NiciraNvpDeviceResponse.java @@ -58,6 +58,10 @@ public class NiciraNvpDeviceResponse extends BaseResponse { @Param(description = "this L3 gateway service Uuid") private String l3GatewayServiceUuid; + @SerializedName(ApiConstants.NICIRA_NVP_L2_GATEWAYSERVICE_UUID) + @Param(description = "this L2 gateway service Uuid") + private String l2GatewayServiceUuid; + public void setId(String nvpDeviceId) { this.id = nvpDeviceId; } @@ -86,4 +90,7 @@ public class NiciraNvpDeviceResponse extends BaseResponse { this.l3GatewayServiceUuid = l3GatewayServiceUuid; } + public void setL2GatewayServiceUuid(final String l2GatewayServiceUuid) { + this.l2GatewayServiceUuid = l2GatewayServiceUuid; + } } diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index e82ae19ebbc..b97141ca3b8 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -934,6 +934,7 @@ dictionary = { 'label.nfs.storage': '', 'label.nic.adapter.type': '', 'label.nicira.controller.address': '', +'label.nicira.l2gatewayserviceuuid': '', 'label.nicira.l3gatewayserviceuuid': '', 'label.nicira.transportzoneuuid': '', 'label.brocade.vcs.address': '', diff --git a/ui/scripts/system.js b/ui/scripts/system.js index af69359637b..faa388c17c4 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5774,6 +5774,9 @@ }, l3gatewayserviceuuid: { label: 'label.nicira.l3gatewayserviceuuid' + }, + l2gatewayserviceuuid: { + label: 'label.nicira.l2gatewayserviceuuid' } } }, @@ -12539,6 +12542,9 @@ }, l3gatewayserviceuuid: { label: 'label.nicira.l3gatewayserviceuuid' + }, + l2gatewayserviceuuid: { + label: 'label.nicira.l2gatewayserviceuuid' } }, actions: { @@ -12569,7 +12575,10 @@ }, l3gatewayserviceuuid: { label: 'label.nicira.l3gatewayserviceuuid' - } + }, + l2gatewayserviceuuid: { + label: 'label.nicira.l2gatewayserviceuuid' + } } }, action: function (args) { @@ -12687,7 +12696,10 @@ }, l3gatewayserviceuuid: { label: 'label.nicira.l3gatewayserviceuuid' - } + }, + l2gatewayserviceuuid: { + label: 'label.nicira.l2gatewayserviceuuid' + } }], dataProvider: function (args) { $.ajax({ @@ -20324,6 +20336,11 @@ if (l3GatewayServiceUuid != null && l3GatewayServiceUuid.length > 0) { array1.push("&l3gatewayserviceuuid=" + todb(args.data.l3gatewayserviceuuid)); } + + var l2GatewayServiceUuid = args.data.l2gatewayserviceuuid; + if (l2GatewayServiceUuid != null && l2GatewayServiceUuid.length > 0) { + array1.push("&l2gatewayserviceuuid=" + todb(args.data.l2gatewayserviceuuid)); + } $.ajax({ url: createURL(apiCmd + array1.join("")),