Module: NSOne::API::Stats
- Defined in:
- lib/nsone/api/stats.rb
Instance Method Summary collapse
-
#network_usage(params = {}) ⇒ NSOne::Response
Returns statistics and graphs on ‘NSOne Network` level (Managed/Dedicated).
-
#qps ⇒ NSOne::Response
Returns current queries per second (QPS) for the account.
-
#record_qps(zone, domain, type) ⇒ NSOne::Response
Returns current queries per second (QPS) for a specific record.
-
#record_usage(zone, domain, type, params = {}) ⇒ NSOne::Response
Returns statistics and graphs for a given record over a given period.
-
#region_usage(params = {}) ⇒ NSOne::Response
Returns total usage (Queries) during ‘:period` per region/Geo-Location.
-
#usage(params = {}) ⇒ NSOne::Response
Returns statistics and graphs for the entire account over a given period.
-
#zone_qps(zone) ⇒ NSOne::Response
Returns current queries per second (QPS) for a specific zone.
-
#zone_usage(zone, params = {}) ⇒ NSOne::Response
Returns statistics and graphs for a given zone over a given period.
Instance Method Details
#network_usage(params = {}) ⇒ NSOne::Response
Returns statistics and graphs on ‘NSOne Network` level (Managed/Dedicated)
88 89 90 |
# File 'lib/nsone/api/stats.rb', line 88 def network_usage(params = {}) perform_request(HTTP_GET, "/v1/stats/network/usage", params) end |
#qps ⇒ NSOne::Response
Returns current queries per second (QPS) for the account
12 13 14 |
# File 'lib/nsone/api/stats.rb', line 12 def qps() perform_request(HTTP_GET, "/v1/stats/qps") end |
#record_qps(zone, domain, type) ⇒ NSOne::Response
Returns current queries per second (QPS) for a specific record
38 39 40 41 42 43 44 |
# File 'lib/nsone/api/stats.rb', line 38 def record_qps(zone, domain, type) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) normalize_names!(zone, domain) perform_request(HTTP_GET, "/v1/stats/qps/#{zone}/#{domain}/#{type}") end |
#record_usage(zone, domain, type, params = {}) ⇒ NSOne::Response
Returns statistics and graphs for a given record over a given period
164 165 166 167 168 169 170 |
# File 'lib/nsone/api/stats.rb', line 164 def record_usage(zone, domain, type, params = {}) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) raise NSOne::MissingParameter, "domain cannot be blank" if blank?(domain) raise NSOne::MissingParameter, "type cannot be blank" if blank?(type) normalize_names!(zone, domain) perform_request(HTTP_GET, "/v1/stats/usage/#{zone}/#{domain}/#{type}", params) end |
#region_usage(params = {}) ⇒ NSOne::Response
Returns total usage (Queries) during ‘:period` per region/Geo-Location. At the moment NSOne API return the following areas: Europe, North America, Oceania, Africa, Asia
112 113 114 |
# File 'lib/nsone/api/stats.rb', line 112 def region_usage(params = {}) perform_request(HTTP_GET, "/v1/stats/region/usage", params) end |
#usage(params = {}) ⇒ NSOne::Response
Returns statistics and graphs for the entire account over a given period
65 66 67 |
# File 'lib/nsone/api/stats.rb', line 65 def usage(params = {}) perform_request(HTTP_GET, "/v1/stats/usage", params) end |
#zone_qps(zone) ⇒ NSOne::Response
Returns current queries per second (QPS) for a specific zone
23 24 25 26 27 |
# File 'lib/nsone/api/stats.rb', line 23 def zone_qps(zone) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) normalize_names!(zone) perform_request(HTTP_GET, "/v1/stats/qps/#{zone}") end |
#zone_usage(zone, params = {}) ⇒ NSOne::Response
Returns statistics and graphs for a given zone over a given period
136 137 138 139 140 |
# File 'lib/nsone/api/stats.rb', line 136 def zone_usage(zone, params = {}) raise NSOne::MissingParameter, "zone cannot be blank" if blank?(zone) normalize_names!(zone) perform_request(HTTP_GET, "/v1/stats/usage/#{zone}", params) end |