Import refactored library. See MIGRATING.MD for details
This commit is contained in:
1 parent
9b7809174d
commit
f584a2cec8
373 files changed
+255715
-474
No files matched your search
@@ -0,0 +1,679 @@
|
||||
# Copyright 2015 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
require 'date'
|
||||
require 'google/apis/core/base_service'
|
||||
require 'google/apis/core/json_representation'
|
||||
require 'google/apis/core/hashable'
|
||||
require 'google/apis/errors'
|
||||
|
||||
module Google
|
||||
module Apis
|
||||
module CloudmonitoringV2beta2
|
||||
|
||||
# The response of cloudmonitoring.metricDescriptors.delete.
|
||||
class DeleteMetricDescriptorResponse
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#deleteMetricDescriptorResponse".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The request of cloudmonitoring.metricDescriptors.list.
|
||||
class ListMetricDescriptorsRequest
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listMetricDescriptorsRequest".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The response of cloudmonitoring.metricDescriptors.list.
|
||||
class ListMetricDescriptorsResponse
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listMetricDescriptorsResponse".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
# The returned metric descriptors.
|
||||
# Corresponds to the JSON property `metrics`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::MetricDescriptor>]
|
||||
attr_accessor :metrics
|
||||
|
||||
# Pagination token. If present, indicates that additional results are available
|
||||
# for retrieval. To access the results past the pagination limit, pass this
|
||||
# value to the pageToken query parameter.
|
||||
# Corresponds to the JSON property `nextPageToken`
|
||||
# @return [String]
|
||||
attr_accessor :next_page_token
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
@metrics = args[:metrics] unless args[:metrics].nil?
|
||||
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The request of cloudmonitoring.timeseriesDescriptors.list
|
||||
class ListTimeseriesDescriptorsRequest
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listTimeseriesDescriptorsRequest".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The response of cloudmonitoring.timeseriesDescriptors.list
|
||||
class ListTimeseriesDescriptorsResponse
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listTimeseriesDescriptorsResponse".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
# Pagination token. If present, indicates that additional results are available
|
||||
# for retrieval. To access the results past the pagination limit, set this value
|
||||
# to the pageToken query parameter.
|
||||
# Corresponds to the JSON property `nextPageToken`
|
||||
# @return [String]
|
||||
attr_accessor :next_page_token
|
||||
|
||||
# The oldest timestamp of the interval of this query, as an RFC 3339 string.
|
||||
# Corresponds to the JSON property `oldest`
|
||||
# @return [DateTime]
|
||||
attr_accessor :oldest
|
||||
|
||||
# The returned time series descriptors.
|
||||
# Corresponds to the JSON property `timeseries`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor>]
|
||||
attr_accessor :timeseries
|
||||
|
||||
# The youngest timestamp of the interval of this query, as an RFC 3339 string.
|
||||
# Corresponds to the JSON property `youngest`
|
||||
# @return [DateTime]
|
||||
attr_accessor :youngest
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
|
||||
@oldest = args[:oldest] unless args[:oldest].nil?
|
||||
@timeseries = args[:timeseries] unless args[:timeseries].nil?
|
||||
@youngest = args[:youngest] unless args[:youngest].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The request of cloudmonitoring.timeseries.list
|
||||
class ListTimeseriesRequest
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listTimeseriesRequest".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The response of cloudmonitoring.timeseries.list
|
||||
class ListTimeseriesResponse
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#listTimeseriesResponse".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
# Pagination token. If present, indicates that additional results are available
|
||||
# for retrieval. To access the results past the pagination limit, set the
|
||||
# pageToken query parameter to this value. All of the points of a time series
|
||||
# will be returned before returning any point of the subsequent time series.
|
||||
# Corresponds to the JSON property `nextPageToken`
|
||||
# @return [String]
|
||||
attr_accessor :next_page_token
|
||||
|
||||
# The oldest timestamp of the interval of this query as an RFC 3339 string.
|
||||
# Corresponds to the JSON property `oldest`
|
||||
# @return [DateTime]
|
||||
attr_accessor :oldest
|
||||
|
||||
# The returned time series.
|
||||
# Corresponds to the JSON property `timeseries`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::Timeseries>]
|
||||
attr_accessor :timeseries
|
||||
|
||||
# The youngest timestamp of the interval of this query as an RFC 3339 string.
|
||||
# Corresponds to the JSON property `youngest`
|
||||
# @return [DateTime]
|
||||
attr_accessor :youngest
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
@next_page_token = args[:next_page_token] unless args[:next_page_token].nil?
|
||||
@oldest = args[:oldest] unless args[:oldest].nil?
|
||||
@timeseries = args[:timeseries] unless args[:timeseries].nil?
|
||||
@youngest = args[:youngest] unless args[:youngest].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# A metricDescriptor defines the name, label keys, and data type of a particular
|
||||
# metric.
|
||||
class MetricDescriptor
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Description of this metric.
|
||||
# Corresponds to the JSON property `description`
|
||||
# @return [String]
|
||||
attr_accessor :description
|
||||
|
||||
# Labels defined for this metric.
|
||||
# Corresponds to the JSON property `labels`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::MetricDescriptorLabelDescriptor>]
|
||||
attr_accessor :labels
|
||||
|
||||
# The name of this metric.
|
||||
# Corresponds to the JSON property `name`
|
||||
# @return [String]
|
||||
attr_accessor :name
|
||||
|
||||
# The project ID to which the metric belongs.
|
||||
# Corresponds to the JSON property `project`
|
||||
# @return [String]
|
||||
attr_accessor :project
|
||||
|
||||
# A type in a metric contains information about how the metric is collected and
|
||||
# what its data points look like.
|
||||
# Corresponds to the JSON property `typeDescriptor`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::MetricDescriptorTypeDescriptor]
|
||||
attr_accessor :type_descriptor
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@description = args[:description] unless args[:description].nil?
|
||||
@labels = args[:labels] unless args[:labels].nil?
|
||||
@name = args[:name] unless args[:name].nil?
|
||||
@project = args[:project] unless args[:project].nil?
|
||||
@type_descriptor = args[:type_descriptor] unless args[:type_descriptor].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# A label in a metric is a description of this metric, including the key of this
|
||||
# description (what the description is), and the value for this description.
|
||||
class MetricDescriptorLabelDescriptor
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Label description.
|
||||
# Corresponds to the JSON property `description`
|
||||
# @return [String]
|
||||
attr_accessor :description
|
||||
|
||||
# Label key.
|
||||
# Corresponds to the JSON property `key`
|
||||
# @return [String]
|
||||
attr_accessor :key
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@description = args[:description] unless args[:description].nil?
|
||||
@key = args[:key] unless args[:key].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# A type in a metric contains information about how the metric is collected and
|
||||
# what its data points look like.
|
||||
class MetricDescriptorTypeDescriptor
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The method of collecting data for the metric. See Metric types.
|
||||
# Corresponds to the JSON property `metricType`
|
||||
# @return [String]
|
||||
attr_accessor :metric_type
|
||||
|
||||
# The data type of of individual points in the metric's time series. See Metric
|
||||
# value types.
|
||||
# Corresponds to the JSON property `valueType`
|
||||
# @return [String]
|
||||
attr_accessor :value_type
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@metric_type = args[:metric_type] unless args[:metric_type].nil?
|
||||
@value_type = args[:value_type] unless args[:value_type].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# Point is a single point in a time series. It consists of a start time, an end
|
||||
# time, and a value.
|
||||
class Point
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The value of this data point. Either "true" or "false".
|
||||
# Corresponds to the JSON property `boolValue`
|
||||
# @return [Boolean]
|
||||
attr_accessor :bool_value
|
||||
alias_method :bool_value?, :bool_value
|
||||
|
||||
# Distribution data point value type. When writing distribution points, try to
|
||||
# be consistent with the boundaries of your buckets. If you must modify the
|
||||
# bucket boundaries, then do so by merging, partitioning, or appending rather
|
||||
# than skewing them.
|
||||
# Corresponds to the JSON property `distributionValue`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::PointDistribution]
|
||||
attr_accessor :distribution_value
|
||||
|
||||
# The value of this data point as a double-precision floating-point number.
|
||||
# Corresponds to the JSON property `doubleValue`
|
||||
# @return [Float]
|
||||
attr_accessor :double_value
|
||||
|
||||
# The interval [start, end] is the time period to which the point's value
|
||||
# applies. For gauge metrics, whose values are instantaneous measurements, this
|
||||
# interval should be empty (start should equal end). For cumulative metrics (of
|
||||
# which deltas and rates are special cases), the interval should be non-empty.
|
||||
# Both start and end are RFC 3339 strings.
|
||||
# Corresponds to the JSON property `end`
|
||||
# @return [DateTime]
|
||||
attr_accessor :end
|
||||
|
||||
# The value of this data point as a 64-bit integer.
|
||||
# Corresponds to the JSON property `int64Value`
|
||||
# @return [String]
|
||||
attr_accessor :int64_value
|
||||
|
||||
# The interval [start, end] is the time period to which the point's value
|
||||
# applies. For gauge metrics, whose values are instantaneous measurements, this
|
||||
# interval should be empty (start should equal end). For cumulative metrics (of
|
||||
# which deltas and rates are special cases), the interval should be non-empty.
|
||||
# Both start and end are RFC 3339 strings.
|
||||
# Corresponds to the JSON property `start`
|
||||
# @return [DateTime]
|
||||
attr_accessor :start
|
||||
|
||||
# The value of this data point in string format.
|
||||
# Corresponds to the JSON property `stringValue`
|
||||
# @return [String]
|
||||
attr_accessor :string_value
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@bool_value = args[:bool_value] unless args[:bool_value].nil?
|
||||
@distribution_value = args[:distribution_value] unless args[:distribution_value].nil?
|
||||
@double_value = args[:double_value] unless args[:double_value].nil?
|
||||
@end = args[:end] unless args[:end].nil?
|
||||
@int64_value = args[:int64_value] unless args[:int64_value].nil?
|
||||
@start = args[:start] unless args[:start].nil?
|
||||
@string_value = args[:string_value] unless args[:string_value].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# Distribution data point value type. When writing distribution points, try to
|
||||
# be consistent with the boundaries of your buckets. If you must modify the
|
||||
# bucket boundaries, then do so by merging, partitioning, or appending rather
|
||||
# than skewing them.
|
||||
class PointDistribution
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The finite buckets.
|
||||
# Corresponds to the JSON property `buckets`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::PointDistributionBucket>]
|
||||
attr_accessor :buckets
|
||||
|
||||
# The overflow bucket is a special bucket that does not have the upperBound
|
||||
# field; it includes all of the events that are no less than its lower bound.
|
||||
# Corresponds to the JSON property `overflowBucket`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::PointDistributionOverflowBucket]
|
||||
attr_accessor :overflow_bucket
|
||||
|
||||
# The underflow bucket is a special bucket that does not have the lowerBound
|
||||
# field; it includes all of the events that are less than its upper bound.
|
||||
# Corresponds to the JSON property `underflowBucket`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::PointDistributionUnderflowBucket]
|
||||
attr_accessor :underflow_bucket
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@buckets = args[:buckets] unless args[:buckets].nil?
|
||||
@overflow_bucket = args[:overflow_bucket] unless args[:overflow_bucket].nil?
|
||||
@underflow_bucket = args[:underflow_bucket] unless args[:underflow_bucket].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The histogram's bucket. Buckets that form the histogram of a distribution
|
||||
# value. If the upper bound of a bucket, say U1, does not equal the lower bound
|
||||
# of the next bucket, say L2, this means that there is no event in [U1, L2).
|
||||
class PointDistributionBucket
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The number of events whose values are in the interval defined by this bucket.
|
||||
# Corresponds to the JSON property `count`
|
||||
# @return [String]
|
||||
attr_accessor :count
|
||||
|
||||
# The lower bound of the value interval of this bucket (inclusive).
|
||||
# Corresponds to the JSON property `lowerBound`
|
||||
# @return [Float]
|
||||
attr_accessor :lower_bound
|
||||
|
||||
# The upper bound of the value interval of this bucket (exclusive).
|
||||
# Corresponds to the JSON property `upperBound`
|
||||
# @return [Float]
|
||||
attr_accessor :upper_bound
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@count = args[:count] unless args[:count].nil?
|
||||
@lower_bound = args[:lower_bound] unless args[:lower_bound].nil?
|
||||
@upper_bound = args[:upper_bound] unless args[:upper_bound].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The overflow bucket is a special bucket that does not have the upperBound
|
||||
# field; it includes all of the events that are no less than its lower bound.
|
||||
class PointDistributionOverflowBucket
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The number of events whose values are in the interval defined by this bucket.
|
||||
# Corresponds to the JSON property `count`
|
||||
# @return [String]
|
||||
attr_accessor :count
|
||||
|
||||
# The lower bound of the value interval of this bucket (inclusive).
|
||||
# Corresponds to the JSON property `lowerBound`
|
||||
# @return [Float]
|
||||
attr_accessor :lower_bound
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@count = args[:count] unless args[:count].nil?
|
||||
@lower_bound = args[:lower_bound] unless args[:lower_bound].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The underflow bucket is a special bucket that does not have the lowerBound
|
||||
# field; it includes all of the events that are less than its upper bound.
|
||||
class PointDistributionUnderflowBucket
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The number of events whose values are in the interval defined by this bucket.
|
||||
# Corresponds to the JSON property `count`
|
||||
# @return [String]
|
||||
attr_accessor :count
|
||||
|
||||
# The upper bound of the value interval of this bucket (exclusive).
|
||||
# Corresponds to the JSON property `upperBound`
|
||||
# @return [Float]
|
||||
attr_accessor :upper_bound
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@count = args[:count] unless args[:count].nil?
|
||||
@upper_bound = args[:upper_bound] unless args[:upper_bound].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The monitoring data is organized as metrics and stored as data points that are
|
||||
# recorded over time. Each data point represents information like the CPU
|
||||
# utilization of your virtual machine. A historical record of these data points
|
||||
# is called a time series.
|
||||
class Timeseries
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The data points of this time series. The points are listed in order of their
|
||||
# end timestamp, from younger to older.
|
||||
# Corresponds to the JSON property `points`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::Point>]
|
||||
attr_accessor :points
|
||||
|
||||
# TimeseriesDescriptor identifies a single time series.
|
||||
# Corresponds to the JSON property `timeseriesDesc`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor]
|
||||
attr_accessor :timeseries_desc
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@points = args[:points] unless args[:points].nil?
|
||||
@timeseries_desc = args[:timeseries_desc] unless args[:timeseries_desc].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# TimeseriesDescriptor identifies a single time series.
|
||||
class TimeseriesDescriptor
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The label's name.
|
||||
# Corresponds to the JSON property `labels`
|
||||
# @return [Hash<String,String>]
|
||||
attr_accessor :labels
|
||||
|
||||
# The name of the metric.
|
||||
# Corresponds to the JSON property `metric`
|
||||
# @return [String]
|
||||
attr_accessor :metric
|
||||
|
||||
# The Developers Console project number to which this time series belongs.
|
||||
# Corresponds to the JSON property `project`
|
||||
# @return [String]
|
||||
attr_accessor :project
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@labels = args[:labels] unless args[:labels].nil?
|
||||
@metric = args[:metric] unless args[:metric].nil?
|
||||
@project = args[:project] unless args[:project].nil?
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
class TimeseriesDescriptorLabel
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The label's name.
|
||||
# Corresponds to the JSON property `key`
|
||||
# @return [String]
|
||||
attr_accessor :key
|
||||
|
||||
# The label's value.
|
||||
# Corresponds to the JSON property `value`
|
||||
# @return [String]
|
||||
attr_accessor :value
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@key = args[:key] unless args[:key].nil?
|
||||
@value = args[:value] unless args[:value].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# When writing time series, TimeseriesPoint should be used instead of Timeseries,
|
||||
# to enforce single point for each time series in the timeseries.write request.
|
||||
class TimeseriesPoint
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Point is a single point in a time series. It consists of a start time, an end
|
||||
# time, and a value.
|
||||
# Corresponds to the JSON property `point`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::Point]
|
||||
attr_accessor :point
|
||||
|
||||
# TimeseriesDescriptor identifies a single time series.
|
||||
# Corresponds to the JSON property `timeseriesDesc`
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor]
|
||||
attr_accessor :timeseries_desc
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@point = args[:point] unless args[:point].nil?
|
||||
@timeseries_desc = args[:timeseries_desc] unless args[:timeseries_desc].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The request of cloudmonitoring.timeseries.write
|
||||
class WriteTimeseriesRequest
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# The label's name.
|
||||
# Corresponds to the JSON property `commonLabels`
|
||||
# @return [Hash<String,String>]
|
||||
attr_accessor :common_labels
|
||||
|
||||
# Provide time series specific labels and the data points for each time series.
|
||||
# The labels in timeseries and the common_labels should form a complete list of
|
||||
# labels that required by the metric.
|
||||
# Corresponds to the JSON property `timeseries`
|
||||
# @return [Array<Google::Apis::CloudmonitoringV2beta2::TimeseriesPoint>]
|
||||
attr_accessor :timeseries
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@common_labels = args[:common_labels] unless args[:common_labels].nil?
|
||||
@timeseries = args[:timeseries] unless args[:timeseries].nil?
|
||||
end
|
||||
end
|
||||
|
||||
# The response of cloudmonitoring.timeseries.write
|
||||
class WriteTimeseriesResponse
|
||||
include Google::Apis::Core::Hashable
|
||||
|
||||
# Identifies what kind of resource this is. Value: the fixed string "
|
||||
# cloudmonitoring#writeTimeseriesResponse".
|
||||
# Corresponds to the JSON property `kind`
|
||||
# @return [String]
|
||||
attr_accessor :kind
|
||||
|
||||
def initialize(**args)
|
||||
update!(**args)
|
||||
end
|
||||
|
||||
# Update properties of this object
|
||||
def update!(**args)
|
||||
@kind = args[:kind] unless args[:kind].nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,311 @@
|
||||
# Copyright 2015 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
require 'date'
|
||||
require 'google/apis/core/base_service'
|
||||
require 'google/apis/core/json_representation'
|
||||
require 'google/apis/core/hashable'
|
||||
require 'google/apis/errors'
|
||||
|
||||
module Google
|
||||
module Apis
|
||||
module CloudmonitoringV2beta2
|
||||
|
||||
class DeleteMetricDescriptorResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListMetricDescriptorsRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListMetricDescriptorsResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListTimeseriesDescriptorsRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListTimeseriesDescriptorsResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListTimeseriesRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class ListTimeseriesResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class MetricDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class MetricDescriptorLabelDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class MetricDescriptorTypeDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class Point
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class PointDistribution
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class PointDistributionBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class PointDistributionOverflowBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class PointDistributionUnderflowBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class Timeseries
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class TimeseriesDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class TimeseriesDescriptorLabel
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class TimeseriesPoint
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class WriteTimeseriesRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
class WriteTimeseriesResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation; end
|
||||
end
|
||||
|
||||
# @private
|
||||
class DeleteMetricDescriptorResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListMetricDescriptorsRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListMetricDescriptorsResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
collection :metrics, as: 'metrics', class: Google::Apis::CloudmonitoringV2beta2::MetricDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::MetricDescriptor::Representation
|
||||
|
||||
property :next_page_token, as: 'nextPageToken'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListTimeseriesDescriptorsRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListTimeseriesDescriptorsResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
property :next_page_token, as: 'nextPageToken'
|
||||
property :oldest, as: 'oldest', type: DateTime
|
||||
|
||||
collection :timeseries, as: 'timeseries', class: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor::Representation
|
||||
|
||||
property :youngest, as: 'youngest', type: DateTime
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListTimeseriesRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class ListTimeseriesResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
property :next_page_token, as: 'nextPageToken'
|
||||
property :oldest, as: 'oldest', type: DateTime
|
||||
|
||||
collection :timeseries, as: 'timeseries', class: Google::Apis::CloudmonitoringV2beta2::Timeseries, decorator: Google::Apis::CloudmonitoringV2beta2::Timeseries::Representation
|
||||
|
||||
property :youngest, as: 'youngest', type: DateTime
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class MetricDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :description, as: 'description'
|
||||
collection :labels, as: 'labels', class: Google::Apis::CloudmonitoringV2beta2::MetricDescriptorLabelDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::MetricDescriptorLabelDescriptor::Representation
|
||||
|
||||
property :name, as: 'name'
|
||||
property :project, as: 'project'
|
||||
property :type_descriptor, as: 'typeDescriptor', class: Google::Apis::CloudmonitoringV2beta2::MetricDescriptorTypeDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::MetricDescriptorTypeDescriptor::Representation
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class MetricDescriptorLabelDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :description, as: 'description'
|
||||
property :key, as: 'key'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class MetricDescriptorTypeDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :metric_type, as: 'metricType'
|
||||
property :value_type, as: 'valueType'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class Point
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :bool_value, as: 'boolValue'
|
||||
property :distribution_value, as: 'distributionValue', class: Google::Apis::CloudmonitoringV2beta2::PointDistribution, decorator: Google::Apis::CloudmonitoringV2beta2::PointDistribution::Representation
|
||||
|
||||
property :double_value, as: 'doubleValue'
|
||||
property :end, as: 'end', type: DateTime
|
||||
|
||||
property :int64_value, as: 'int64Value'
|
||||
property :start, as: 'start', type: DateTime
|
||||
|
||||
property :string_value, as: 'stringValue'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class PointDistribution
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
collection :buckets, as: 'buckets', class: Google::Apis::CloudmonitoringV2beta2::PointDistributionBucket, decorator: Google::Apis::CloudmonitoringV2beta2::PointDistributionBucket::Representation
|
||||
|
||||
property :overflow_bucket, as: 'overflowBucket', class: Google::Apis::CloudmonitoringV2beta2::PointDistributionOverflowBucket, decorator: Google::Apis::CloudmonitoringV2beta2::PointDistributionOverflowBucket::Representation
|
||||
|
||||
property :underflow_bucket, as: 'underflowBucket', class: Google::Apis::CloudmonitoringV2beta2::PointDistributionUnderflowBucket, decorator: Google::Apis::CloudmonitoringV2beta2::PointDistributionUnderflowBucket::Representation
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class PointDistributionBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :count, as: 'count'
|
||||
property :lower_bound, as: 'lowerBound'
|
||||
property :upper_bound, as: 'upperBound'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class PointDistributionOverflowBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :count, as: 'count'
|
||||
property :lower_bound, as: 'lowerBound'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class PointDistributionUnderflowBucket
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :count, as: 'count'
|
||||
property :upper_bound, as: 'upperBound'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class Timeseries
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
collection :points, as: 'points', class: Google::Apis::CloudmonitoringV2beta2::Point, decorator: Google::Apis::CloudmonitoringV2beta2::Point::Representation
|
||||
|
||||
property :timeseries_desc, as: 'timeseriesDesc', class: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor::Representation
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class TimeseriesDescriptor
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
hash :labels, as: 'labels'
|
||||
property :metric, as: 'metric'
|
||||
property :project, as: 'project'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class TimeseriesDescriptorLabel
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :key, as: 'key'
|
||||
property :value, as: 'value'
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class TimeseriesPoint
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :point, as: 'point', class: Google::Apis::CloudmonitoringV2beta2::Point, decorator: Google::Apis::CloudmonitoringV2beta2::Point::Representation
|
||||
|
||||
property :timeseries_desc, as: 'timeseriesDesc', class: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor, decorator: Google::Apis::CloudmonitoringV2beta2::TimeseriesDescriptor::Representation
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class WriteTimeseriesRequest
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
hash :common_labels, as: 'commonLabels'
|
||||
collection :timeseries, as: 'timeseries', class: Google::Apis::CloudmonitoringV2beta2::TimeseriesPoint, decorator: Google::Apis::CloudmonitoringV2beta2::TimeseriesPoint::Representation
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
# @private
|
||||
class WriteTimeseriesResponse
|
||||
class Representation < Google::Apis::Core::JsonRepresentation
|
||||
property :kind, as: 'kind'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,458 @@
|
||||
# Copyright 2015 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
require 'google/apis/core/base_service'
|
||||
require 'google/apis/core/json_representation'
|
||||
require 'google/apis/core/hashable'
|
||||
require 'google/apis/errors'
|
||||
|
||||
module Google
|
||||
module Apis
|
||||
module CloudmonitoringV2beta2
|
||||
# Cloud Monitoring API
|
||||
#
|
||||
# API for accessing Google Cloud and API monitoring data.
|
||||
#
|
||||
# @example
|
||||
# require 'google/apis/cloudmonitoring_v2beta2'
|
||||
#
|
||||
# Cloudmonitoring = Google::Apis::CloudmonitoringV2beta2 # Alias the module
|
||||
# service = Cloudmonitoring::CloudMonitoringService.new
|
||||
#
|
||||
# @see https://cloud.google.com/monitoring/v2beta2/
|
||||
class CloudMonitoringService < Google::Apis::Core::BaseService
|
||||
# @return [String]
|
||||
# API key. Your API key identifies your project and provides you with API access,
|
||||
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
||||
attr_accessor :key
|
||||
|
||||
# @return [String]
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
attr_accessor :quota_user
|
||||
|
||||
# @return [String]
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
attr_accessor :user_ip
|
||||
|
||||
def initialize
|
||||
super('https://www.googleapis.com/', 'cloudmonitoring/v2beta2/projects/')
|
||||
end
|
||||
|
||||
# Create a new metric.
|
||||
# @param [String] project
|
||||
# The project id. The value can be the numeric project ID or string-based
|
||||
# project name.
|
||||
# @param [Google::Apis::CloudmonitoringV2beta2::MetricDescriptor] metric_descriptor_object
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::MetricDescriptor] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::MetricDescriptor]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def create_metric_descriptor(project, metric_descriptor_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/metricDescriptors'
|
||||
command = make_simple_command(:post, path, options)
|
||||
command.request_representation = Google::Apis::CloudmonitoringV2beta2::MetricDescriptor::Representation
|
||||
command.request_object = metric_descriptor_object
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::MetricDescriptor::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::MetricDescriptor
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
# Delete an existing metric.
|
||||
# @param [String] project
|
||||
# The project ID to which the metric belongs.
|
||||
# @param [String] metric
|
||||
# Name of the metric.
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::DeleteMetricDescriptorResponse] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::DeleteMetricDescriptorResponse]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def delete_metric_descriptor(project, metric, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/metricDescriptors/{metric}'
|
||||
command = make_simple_command(:delete, path, options)
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::DeleteMetricDescriptorResponse::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::DeleteMetricDescriptorResponse
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.params['metric'] = metric unless metric.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
# List metric descriptors that match the query. If the query is not set, then
|
||||
# all of the metric descriptors will be returned. Large responses will be
|
||||
# paginated, use the nextPageToken returned in the response to request
|
||||
# subsequent pages of results by setting the pageToken query parameter to the
|
||||
# value of the nextPageToken.
|
||||
# @param [String] project
|
||||
# The project id. The value can be the numeric project ID or string-based
|
||||
# project name.
|
||||
# @param [Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsRequest] list_metric_descriptors_request_object
|
||||
# @param [Fixnum] count
|
||||
# Maximum number of metric descriptors per page. Used for pagination. If not
|
||||
# specified, count = 100.
|
||||
# @param [String] page_token
|
||||
# The pagination token, which is used to page through large result sets. Set
|
||||
# this value to the value of the nextPageToken to retrieve the next page of
|
||||
# results.
|
||||
# @param [String] query
|
||||
# The query used to search against existing metrics. Separate keywords with a
|
||||
# space; the service joins all keywords with AND, meaning that all keywords must
|
||||
# match for a metric to be returned. If this field is omitted, all metrics are
|
||||
# returned. If an empty string is passed with this field, no metrics are
|
||||
# returned.
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsResponse] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsResponse]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def list_metric_descriptors(project, list_metric_descriptors_request_object = nil, count: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/metricDescriptors'
|
||||
command = make_simple_command(:get, path, options)
|
||||
command.request_representation = Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsRequest::Representation
|
||||
command.request_object = list_metric_descriptors_request_object
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsResponse::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::ListMetricDescriptorsResponse
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.query['count'] = count unless count.nil?
|
||||
command.query['pageToken'] = page_token unless page_token.nil?
|
||||
command.query['query'] = query unless query.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
# List the data points of the time series that match the metric and labels
|
||||
# values and that have data points in the interval. Large responses are
|
||||
# paginated; use the nextPageToken returned in the response to request
|
||||
# subsequent pages of results by setting the pageToken query parameter to the
|
||||
# value of the nextPageToken.
|
||||
# @param [String] project
|
||||
# The project ID to which this time series belongs. The value can be the numeric
|
||||
# project ID or string-based project name.
|
||||
# @param [String] metric
|
||||
# Metric names are protocol-free URLs as listed in the Supported Metrics page.
|
||||
# For example, compute.googleapis.com/instance/disk/read_ops_count.
|
||||
# @param [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesRequest] list_timeseries_request_object
|
||||
# @param [String] aggregator
|
||||
# The aggregation function that will reduce the data points in each window to a
|
||||
# single point. This parameter is only valid for non-cumulative metrics with a
|
||||
# value type of INT64 or DOUBLE.
|
||||
# @param [Fixnum] count
|
||||
# Maximum number of data points per page, which is used for pagination of
|
||||
# results.
|
||||
# @param [Array<String>, String] labels
|
||||
# A collection of labels for the matching time series, which are represented as:
|
||||
#
|
||||
# - key==value: key equals the value
|
||||
# - key=~value: key regex matches the value
|
||||
# - key!=value: key does not equal the value
|
||||
# - key!~value: key regex does not match the value For example, to list all of
|
||||
# the time series descriptors for the region us-central1, you could specify:
|
||||
# label=cloud.googleapis.com%2Flocation=~us-central1.*
|
||||
# @param [String] oldest
|
||||
# Start of the time interval (exclusive), which is expressed as an RFC 3339
|
||||
# timestamp. If neither oldest nor timespan is specified, the default time
|
||||
# interval will be (youngest - 4 hours, youngest]
|
||||
# @param [String] page_token
|
||||
# The pagination token, which is used to page through large result sets. Set
|
||||
# this value to the value of the nextPageToken to retrieve the next page of
|
||||
# results.
|
||||
# @param [String] timespan
|
||||
# Length of the time interval to query, which is an alternative way to declare
|
||||
# the interval: (youngest - timespan, youngest]. The timespan and oldest
|
||||
# parameters should not be used together. Units:
|
||||
# - s: second
|
||||
# - m: minute
|
||||
# - h: hour
|
||||
# - d: day
|
||||
# - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d
|
||||
# is not allowed; you should use 17d instead.
|
||||
# If neither oldest nor timespan is specified, the default time interval will be
|
||||
# (youngest - 4 hours, youngest].
|
||||
# @param [String] window
|
||||
# The sampling window. At most one data point will be returned for each window
|
||||
# in the requested time interval. This parameter is only valid for non-
|
||||
# cumulative metric types. Units:
|
||||
# - m: minute
|
||||
# - h: hour
|
||||
# - d: day
|
||||
# - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is
|
||||
# not allowed; you should use 17d instead.
|
||||
# @param [String] youngest
|
||||
# End of the time interval (inclusive), which is expressed as an RFC 3339
|
||||
# timestamp.
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesResponse] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesResponse]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def list_timeseries(project, metric, list_timeseries_request_object = nil, aggregator: nil, count: nil, labels: nil, oldest: nil, page_token: nil, timespan: nil, window: nil, youngest: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/timeseries/{metric}'
|
||||
command = make_simple_command(:get, path, options)
|
||||
command.request_representation = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesRequest::Representation
|
||||
command.request_object = list_timeseries_request_object
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesResponse::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesResponse
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.params['metric'] = metric unless metric.nil?
|
||||
command.query['aggregator'] = aggregator unless aggregator.nil?
|
||||
command.query['count'] = count unless count.nil?
|
||||
command.query['labels'] = labels unless labels.nil?
|
||||
command.query['oldest'] = oldest unless oldest.nil?
|
||||
command.query['pageToken'] = page_token unless page_token.nil?
|
||||
command.query['timespan'] = timespan unless timespan.nil?
|
||||
command.query['window'] = window unless window.nil?
|
||||
command.query['youngest'] = youngest unless youngest.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
# Put data points to one or more time series for one or more metrics. If a time
|
||||
# series does not exist, a new time series will be created. It is not allowed to
|
||||
# write a time series point that is older than the existing youngest point of
|
||||
# that time series. Points that are older than the existing youngest point of
|
||||
# that time series will be discarded silently. Therefore, users should make sure
|
||||
# that points of a time series are written sequentially in the order of their
|
||||
# end time.
|
||||
# @param [String] project
|
||||
# The project ID. The value can be the numeric project ID or string-based
|
||||
# project name.
|
||||
# @param [Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesRequest] write_timeseries_request_object
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesResponse] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesResponse]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def write_timeseries(project, write_timeseries_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/timeseries:write'
|
||||
command = make_simple_command(:post, path, options)
|
||||
command.request_representation = Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesRequest::Representation
|
||||
command.request_object = write_timeseries_request_object
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesResponse::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::WriteTimeseriesResponse
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
# List the descriptors of the time series that match the metric and labels
|
||||
# values and that have data points in the interval. Large responses are
|
||||
# paginated; use the nextPageToken returned in the response to request
|
||||
# subsequent pages of results by setting the pageToken query parameter to the
|
||||
# value of the nextPageToken.
|
||||
# @param [String] project
|
||||
# The project ID to which this time series belongs. The value can be the numeric
|
||||
# project ID or string-based project name.
|
||||
# @param [String] metric
|
||||
# Metric names are protocol-free URLs as listed in the Supported Metrics page.
|
||||
# For example, compute.googleapis.com/instance/disk/read_ops_count.
|
||||
# @param [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsRequest] list_timeseries_descriptors_request_object
|
||||
# @param [String] aggregator
|
||||
# The aggregation function that will reduce the data points in each window to a
|
||||
# single point. This parameter is only valid for non-cumulative metrics with a
|
||||
# value type of INT64 or DOUBLE.
|
||||
# @param [Fixnum] count
|
||||
# Maximum number of time series descriptors per page. Used for pagination. If
|
||||
# not specified, count = 100.
|
||||
# @param [Array<String>, String] labels
|
||||
# A collection of labels for the matching time series, which are represented as:
|
||||
#
|
||||
# - key==value: key equals the value
|
||||
# - key=~value: key regex matches the value
|
||||
# - key!=value: key does not equal the value
|
||||
# - key!~value: key regex does not match the value For example, to list all of
|
||||
# the time series descriptors for the region us-central1, you could specify:
|
||||
# label=cloud.googleapis.com%2Flocation=~us-central1.*
|
||||
# @param [String] oldest
|
||||
# Start of the time interval (exclusive), which is expressed as an RFC 3339
|
||||
# timestamp. If neither oldest nor timespan is specified, the default time
|
||||
# interval will be (youngest - 4 hours, youngest]
|
||||
# @param [String] page_token
|
||||
# The pagination token, which is used to page through large result sets. Set
|
||||
# this value to the value of the nextPageToken to retrieve the next page of
|
||||
# results.
|
||||
# @param [String] timespan
|
||||
# Length of the time interval to query, which is an alternative way to declare
|
||||
# the interval: (youngest - timespan, youngest]. The timespan and oldest
|
||||
# parameters should not be used together. Units:
|
||||
# - s: second
|
||||
# - m: minute
|
||||
# - h: hour
|
||||
# - d: day
|
||||
# - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d
|
||||
# is not allowed; you should use 17d instead.
|
||||
# If neither oldest nor timespan is specified, the default time interval will be
|
||||
# (youngest - 4 hours, youngest].
|
||||
# @param [String] window
|
||||
# The sampling window. At most one data point will be returned for each window
|
||||
# in the requested time interval. This parameter is only valid for non-
|
||||
# cumulative metric types. Units:
|
||||
# - m: minute
|
||||
# - h: hour
|
||||
# - d: day
|
||||
# - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is
|
||||
# not allowed; you should use 17d instead.
|
||||
# @param [String] youngest
|
||||
# End of the time interval (inclusive), which is expressed as an RFC 3339
|
||||
# timestamp.
|
||||
# @param [String] fields
|
||||
# Selector specifying which fields to include in a partial response.
|
||||
# @param [String] quota_user
|
||||
# Available to use for quota purposes for server-side applications. Can be any
|
||||
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
# Overrides userIp if both are provided.
|
||||
# @param [String] user_ip
|
||||
# IP address of the site where the request originates. Use this if you want to
|
||||
# enforce per-user limits.
|
||||
# @param [Google::Apis::RequestOptions] options
|
||||
# Request-specific options
|
||||
#
|
||||
# @yield [result, err] Result & error if block supplied
|
||||
# @yieldparam result [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsResponse] parsed result object
|
||||
# @yieldparam err [StandardError] error object if request failed
|
||||
#
|
||||
# @return [Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsResponse]
|
||||
#
|
||||
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
||||
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
||||
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
||||
def list_timeseries_descriptors(project, metric, list_timeseries_descriptors_request_object = nil, aggregator: nil, count: nil, labels: nil, oldest: nil, page_token: nil, timespan: nil, window: nil, youngest: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
||||
path = '{project}/timeseriesDescriptors/{metric}'
|
||||
command = make_simple_command(:get, path, options)
|
||||
command.request_representation = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsRequest::Representation
|
||||
command.request_object = list_timeseries_descriptors_request_object
|
||||
command.response_representation = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsResponse::Representation
|
||||
command.response_class = Google::Apis::CloudmonitoringV2beta2::ListTimeseriesDescriptorsResponse
|
||||
command.params['project'] = project unless project.nil?
|
||||
command.params['metric'] = metric unless metric.nil?
|
||||
command.query['aggregator'] = aggregator unless aggregator.nil?
|
||||
command.query['count'] = count unless count.nil?
|
||||
command.query['labels'] = labels unless labels.nil?
|
||||
command.query['oldest'] = oldest unless oldest.nil?
|
||||
command.query['pageToken'] = page_token unless page_token.nil?
|
||||
command.query['timespan'] = timespan unless timespan.nil?
|
||||
command.query['window'] = window unless window.nil?
|
||||
command.query['youngest'] = youngest unless youngest.nil?
|
||||
command.query['fields'] = fields unless fields.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
execute_or_queue_command(command, &block)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def apply_command_defaults(command)
|
||||
command.query['key'] = key unless key.nil?
|
||||
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
||||
command.query['userIp'] = user_ip unless user_ip.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user