Class: Fog::Google::Monitoring::Mock

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/fog/google/monitoring/mock.rb,
lib/fog/google/requests/monitoring/list_timeseries.rb,
lib/fog/google/requests/monitoring/create_timeseries.rb,
lib/fog/google/requests/monitoring/get_metric_descriptor.rb,
lib/fog/google/requests/monitoring/list_metric_descriptors.rb,
lib/fog/google/requests/monitoring/create_metric_descriptor.rb,
lib/fog/google/requests/monitoring/delete_metric_descriptor.rb,
lib/fog/google/requests/monitoring/get_monitored_resource_descriptor.rb,
lib/fog/google/requests/monitoring/list_monitored_resource_descriptors.rb

Instance Attribute Summary

Attributes included from Shared

#api_url, #api_version, #project

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Shared

#apply_client_options, #build_excon_response, #initialize_google_client, #request, #shared_initialize

Constructor Details

#initialize(options) ⇒ Mock

Returns a new instance of Mock.



7
8
9
# File 'lib/fog/google/monitoring/mock.rb', line 7

def initialize(options)
  shared_initialize(options[:google_project], GOOGLE_MONITORING_API_VERSION, GOOGLE_MONITORING_BASE_URL)
end

Class Method Details

.dataObject



11
12
13
14
15
16
17
18
19
# File 'lib/fog/google/monitoring/mock.rb', line 11

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = {
      :timeseries => {},
      :monitored_resource_descriptor => {},
      :metric_descriptors => {}
    }
  end
end

.resetObject



21
22
23
# File 'lib/fog/google/monitoring/mock.rb', line 21

def self.reset
  @data = nil
end

Instance Method Details

#create_metric_descriptor(**_args) ⇒ Object



43
44
45
46
47
# File 'lib/fog/google/requests/monitoring/create_metric_descriptor.rb', line 43

def create_metric_descriptor(**_args)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#create_timeseries(_timeseries: []) ⇒ Object



21
22
23
24
25
# File 'lib/fog/google/requests/monitoring/create_timeseries.rb', line 21

def create_timeseries(_timeseries: [])
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#dataObject



25
26
27
# File 'lib/fog/google/monitoring/mock.rb', line 25

def data
  self.class.data[project]
end

#delete_metric_descriptor(_metric_type) ⇒ Object



11
12
13
14
15
# File 'lib/fog/google/requests/monitoring/delete_metric_descriptor.rb', line 11

def delete_metric_descriptor(_metric_type)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_metric_descriptor(_metric_type) ⇒ Object



11
12
13
14
15
# File 'lib/fog/google/requests/monitoring/get_metric_descriptor.rb', line 11

def get_metric_descriptor(_metric_type)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#get_monitored_resource_descriptor(_resource_type) ⇒ Object

Raises:

  • (Fog::Errors::MockNotImplemented)


13
14
15
# File 'lib/fog/google/requests/monitoring/get_monitored_resource_descriptor.rb', line 13

def get_monitored_resource_descriptor(_resource_type)
  raise Fog::Errors::MockNotImplemented
end

#list_metric_descriptors(_options = {}) ⇒ Object

Raises:

  • (Fog::Errors::MockNotImplemented)


20
21
22
# File 'lib/fog/google/requests/monitoring/list_metric_descriptors.rb', line 20

def list_metric_descriptors(_options = {})
  raise Fog::Errors::MockNotImplemented
end

#list_monitored_resource_descriptors(_filter, _page_size, _page_token) ⇒ Object



21
22
23
24
25
# File 'lib/fog/google/requests/monitoring/list_monitored_resource_descriptors.rb', line 21

def list_monitored_resource_descriptors(_filter, _page_size, _page_token)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_timeseries(_options = {}) ⇒ Object



47
48
49
50
51
# File 'lib/fog/google/requests/monitoring/list_timeseries.rb', line 47

def list_timeseries(_options = {})
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#reset_dataObject



29
30
31
# File 'lib/fog/google/monitoring/mock.rb', line 29

def reset_data
  self.class.data.delete(project)
end