VSphereAutomation::Appliance::MonitoringApi

All URIs are relative to https://<vcenter>/rest

Method HTTP request Description
get GET /appliance/monitoring/stat_id Get monitored item info
list GET /appliance/monitoring Get monitored items list
query GET /appliance/monitoring/query Get monitoring data.

get

ApplianceMonitoringResult get(stat_id)

Get monitored item info

Example

# load the gem
require 'vsphere-automation-appliance'
# setup authorization
VSphereAutomation::Configuration.new.tap do |config|
  # Configure API key authorization: api_key
  config.api_key['vmware-api-session-id'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['vmware-api-session-id'] = 'Bearer'
end

api_instance = VSphereAutomation::Appliance::MonitoringApi.new
stat_id = 'stat_id_example' # String | statistic item id

begin
  #Get monitored item info
  result = api_instance.get(stat_id)
  p result
rescue VSphereAutomation::ApiError => e
  puts "Exception when calling MonitoringApi->get: #{e}"
end

Parameters

Name Type Description Notes
stat_id String statistic item id

Return type

ApplianceMonitoringResult

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list

ApplianceMonitoringListResult list

Get monitored items list

Example

# load the gem
require 'vsphere-automation-appliance'
# setup authorization
VSphereAutomation::Configuration.new.tap do |config|
  # Configure API key authorization: api_key
  config.api_key['vmware-api-session-id'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['vmware-api-session-id'] = 'Bearer'
end

api_instance = VSphereAutomation::Appliance::MonitoringApi.new

begin
  #Get monitored items list
  result = api_instance.list
  p result
rescue VSphereAutomation::ApiError => e
  puts "Exception when calling MonitoringApi->list: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

ApplianceMonitoringListResult

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

query

ApplianceMonitoringQueryResult query(item_names, item_interval, item_function, item_start_time, item_end_time)

Get monitoring data.

Example

# load the gem
require 'vsphere-automation-appliance'
# setup authorization
VSphereAutomation::Configuration.new.tap do |config|
  # Configure API key authorization: api_key
  config.api_key['vmware-api-session-id'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['vmware-api-session-id'] = 'Bearer'
end

api_instance = VSphereAutomation::Appliance::MonitoringApi.new
item_names = ['item_names_example'] # Array<String> | monitored item IDs Ex: CPU, MEMORY
item_interval = 'item_interval_example' # String | {@name IntervalType} {@term enumerated type} Defines interval between the values in hours and mins,                    for which aggregation will apply
item_function = 'item_function_example' # String | {@name FunctionType} {@term enumerated type} Defines aggregation function
item_start_time = 'item_start_time_example' # String | Start time in UTC
item_end_time = 'item_end_time_example' # String | End time in UTC

begin
  #Get monitoring data.
  result = api_instance.query(item_names, item_interval, item_function, item_start_time, item_end_time)
  p result
rescue VSphereAutomation::ApiError => e
  puts "Exception when calling MonitoringApi->query: #{e}"
end

Parameters

Name Type Description Notes
item_names Array<String> monitored item IDs Ex: CPU, MEMORY
item_interval String IntervalType enumerated type Defines interval between the values in hours and mins, for which aggregation will apply
item_function String FunctionType enumerated type Defines aggregation function
item_start_time String Start time in UTC
item_end_time String End time in UTC

Return type

ApplianceMonitoringQueryResult

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json