summaryrefslogtreecommitdiff
path: root/redfish-core/lib/ethernet.hpp
diff options
context:
space:
mode:
authorRAJESWARAN THILLAIGOVINDAN <rajeswgo@in.ibm.com>2019-03-06 12:10:24 +0300
committerEd Tanous <ed.tanous@intel.com>2019-05-09 21:46:28 +0300
commit5112e9b47b0f55eb7d56657154472785b6300298 (patch)
tree57d084dba14690e3b32e838285ef369df81ea431 /redfish-core/lib/ethernet.hpp
parent86adcd6d5cd159448c800a03c29485b93cdd2189 (diff)
downloadbmcweb-5112e9b47b0f55eb7d56657154472785b6300298.tar.xz
Redfish(Network): Implemented PATCH of Nameservers array
Testing: "NameServers": [], "NameServers@Message.ExtendedInfo": [ { "@odata.type": "/redfish/v1/$metadata#Message.v1_0_0.Message", "Message": "The property NameServers is a read only property and cannot be assigned a value.", "MessageArgs": [ "NameServers" ], "MessageId": "Base.1.4.0.PropertyNotWritable", "Resolution": "Remove the property from the request body and resubmit the request if the operation failed.", "Severity": "Warning" } ] Change-Id: I12b8cb0ad9b8ad83371ee1d834f38e7537cc7b61 Signed-off-by: RAJESWARAN THILLAIGOVINDAN <rajeswgo@in.ibm.com>
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r--redfish-core/lib/ethernet.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 0356b0c99f..f1ef23f525 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -1317,12 +1317,13 @@ class EthernetInterface : public Node
std::optional<nlohmann::json> ipv4Addresses;
std::optional<nlohmann::json> ipv6Addresses;
std::optional<std::vector<std::string>> staticNameServers;
+ std::optional<std::vector<std::string>> nameServers;
if (!json_util::readJson(
req, res, "HostName", hostname, "IPv4Addresses", ipv4Addresses,
"IPv6Addresses", ipv6Addresses, "MACAddress", macAddress,
"StaticNameServers", staticNameServers, "IPv6DefaultGateway",
- ipv6DefaultGateway))
+ ipv6DefaultGateway, "NameServers", nameServers))
{
return;
}
@@ -1336,7 +1337,8 @@ class EthernetInterface : public Node
ipv4Addresses = std::move(ipv4Addresses),
ipv6Addresses = std::move(ipv6Addresses),
ipv6DefaultGateway = std::move(ipv6DefaultGateway),
- staticNameServers = std::move(staticNameServers)](
+ staticNameServers = std::move(staticNameServers),
+ nameServers = std::move(nameServers)](
const bool &success, const EthernetInterfaceData &ethData,
const boost::container::flat_set<IPv4AddressData> &ipv4Data) {
if (!success)
@@ -1374,6 +1376,13 @@ class EthernetInterface : public Node
handleIPv4Patch(iface_id, ipv4, ipv4Data, asyncResp);
}
+ if (nameServers)
+ {
+ // Data.Permissions is read-only
+ messages::propertyNotWritable(asyncResp->res,
+ "NameServers");
+ }
+
if (ipv6Addresses)
{
// TODO(kkowalsk) IPv6 Not supported on D-Bus yet