Set IPV4 interfaces

If a gateway, netmask, or IP address of an IPV4 interface changes on
the page, when the user hits "Save changes" and confirms the popup,
delete the old IPV4 interface and create a new one with the new
values. After talking with Ratan, deleting then adding is the
the correct way to change IPV4 interfaces.
More information can be found in the network README up for review:
https://gerrit.openbmc-project.xyz/#/c/6872/

Tested: Changed IPV4 interface properties on a Witherspoon.
Also tested a Witherspoon in DHCP mode then moved over to a static
IP.
Change-Id: Idc0026aa01533ea327b53efc57e21147c4b68967
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index c8617d3..9f1cc23 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -225,6 +225,46 @@
                 return response.data;
               });
         },
+        deleteIPV4: function(interfaceName, networkID) {
+          return $http({
+                   method: 'POST',
+                   url: DataService.getHost() +
+                       '/xyz/openbmc_project/network/' + interfaceName +
+                       '/ipv4/' + networkID + '/action/Delete',
+                   headers: {
+                     'Accept': 'application/json',
+                     'Content-Type': 'application/json'
+                   },
+                   withCredentials: true,
+                   data: JSON.stringify({'data': []})
+                 })
+              .then(function(response) {
+                return response.data;
+              });
+        },
+        addIPV4: function(
+            interfaceName, ipAddress, netmaskPrefixLength, gateway) {
+          return $http({
+                   method: 'POST',
+                   url: DataService.getHost() +
+                       '/xyz/openbmc_project/network/' + interfaceName +
+                       '/action/IP',
+                   headers: {
+                     'Accept': 'application/json',
+                     'Content-Type': 'application/json'
+                   },
+                   withCredentials: true,
+                   data: JSON.stringify({
+                     'data': [
+                       'xyz.openbmc_project.Network.IP.Protocol.IPv4',
+                       ipAddress, +netmaskPrefixLength, gateway
+                     ]
+                   })
+                 })
+              .then(function(response) {
+                return response.data;
+              });
+        },
         getLEDState: function() {
           var deferred = $q.defer();
           $http({