Browse Source

Add getDomainLogs()

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

+ 13 - 0
src/MyDNSHostAPI.php

@@ -721,6 +721,19 @@
 			return isset($result['response']['stats']) ? $result['response']['stats'] : [];
 		}
 
+		/**
+		 * Get domain logs
+		 *
+		 * @param $domain Domain to get logs for.
+		 * @return Array of logs.
+		 */
+		public function getDomainLogs($domain) {
+			if ($this->auth === FALSE) { return []; }
+
+			$result = $this->api(($this->domainAdmin ? '/admin' : '') . '/domains/' . $domain . '/logs', 'GET', $options);
+			return isset($result['response']) ? $result['response'] : [];
+		}
+
 		/**
 		 * Attempt to sync the domain to the backends.
 		 *