File: monitoring.rb

package info (click to toggle)
ruby-fog-google 1.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: ruby: 16,775; makefile: 3
file content (60 lines) | stat: -rw-r--r-- 1,662 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module Fog
  module Google
    class Monitoring < Fog::Service
      autoload :Mock, File.expand_path("../monitoring/mock", __FILE__)
      autoload :Real, File.expand_path("../monitoring/real", __FILE__)

      requires :google_project
      recognizes(
        :app_name,
        :app_version,
        :google_application_default,
        :google_auth,
        :google_client,
        :google_client_options,
        :google_key_location,
        :google_key_string,
        :google_json_key_location,
        :google_json_key_string
      )

      GOOGLE_MONITORING_API_VERSION    = "v3".freeze
      GOOGLE_MONITORING_BASE_URL       = "https://monitoring.googleapis.com/".freeze
      GOOGLE_MONITORING_API_SCOPE_URLS = %w(https://www.googleapis.com/auth/monitoring).freeze

      ##
      # MODELS
      model_path "fog/google/models/monitoring"

      # Timeseries
      model :timeseries
      collection :timeseries_collection

      # MetricDescriptors
      model :metric_descriptor
      collection :metric_descriptors

      # MonitoredResourceDescriptors
      model :monitored_resource_descriptor
      collection :monitored_resource_descriptors

      ##
      # REQUESTS
      request_path "fog/google/requests/monitoring"

      # Timeseries
      request :list_timeseries
      request :create_timeseries

      # MetricDescriptors
      request :get_metric_descriptor
      request :list_metric_descriptors
      request :create_metric_descriptor
      request :delete_metric_descriptor

      # MonitoredResourceDescriptors
      request :list_monitored_resource_descriptors
      request :get_monitored_resource_descriptor
    end
  end
end