Browse Source

Add support for system stats endpoint.

Shane Mc Cormack 8 năm trước cách đây
mục cha
commit
75934fbdd5
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  1. 12 0
      src/MyDNSHostAPI.php

+ 12 - 0
src/MyDNSHostAPI.php

@@ -249,6 +249,18 @@
 			return isset($result['response'][$key]) ? $result['response'][$key] : NULL;
 		}
 
+		/**
+		 * Get system stats.
+		 *
+		 * @return Result from the API.
+		 */
+		public function getSystemStats($type, $options) {
+			if ($this->auth === FALSE) { return []; }
+
+			$result = $this->api('/system/stats/' . $type, 'GET', $options);
+			return isset($result['response']['stats']) ? $result['response']['stats'] : [];
+		}
+
 		/**
 		 * Set information a given user id.
 		 *