Add utility to set hostname

The user needs the ability to set the hostname
in a few different spots.

Change-Id: Ia70e7c773d7ff951a505f3297d8eaf1b3d14fa73
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 5f4b931..6f81ce1 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1120,6 +1120,20 @@
                   console.log(error);
                 });
               },
+              setHostname: function(hostname){
+                return $http({
+                  method: 'PUT',
+                  url: DataService.getHost() + "/xyz/openbmc_project/network/config/attr/HostName",
+                  headers: {
+                      'Accept': 'application/json',
+                      'Content-Type': 'application/json'
+                  },
+                  withCredentials: true,
+                  data: JSON.stringify({"data": hostname})
+                }).then(function(response){
+                    return response.data;
+                });
+              },
           };
           return SERVICE;
         }]);