/
classes.rb
4175 lines (3560 loc) · 191 KB
/
classes.rb
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# 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 MonitoringV3
# Describes how to combine multiple time series to provide a different view of
# the data. Aggregation of time series is done in two steps. First, each time
# series in the set is aligned to the same time interval boundaries, then the
# set of time series is optionally reduced in number.Alignment consists of
# applying the per_series_aligner operation to each time series after its data
# has been divided into regular alignment_period time intervals. This process
# takes all of the data points in an alignment period, applies a mathematical
# transformation such as averaging, minimum, maximum, delta, etc., and converts
# them into a single data point per period.Reduction is when the aligned and
# transformed time series can optionally be combined, reducing the number of
# time series through similar mathematical transformations. Reduction involves
# applying a cross_series_reducer to all the time series, optionally sorting the
# time series into subsets with group_by_fields, and applying the reducer to
# each subset.The raw time series data can contain a huge amount of information
# from multiple sources. Alignment and reduction transforms this mass of data
# into a more manageable and representative collection of data, for example "the
# 95% latency across the average of all tasks in a cluster". This representative
# data can be more easily graphed and comprehended, and the individual time
# series data is still available for later drilldown. For more details, see
# Filtering and aggregation (https://cloud.google.com/monitoring/api/v3/
# aggregation).
class Aggregation
include Google::Apis::Core::Hashable
# The alignment_period specifies a time interval, in seconds, that is used to
# divide the data in all the time series into consistent blocks of time. This
# will be done before the per-series aligner can be applied to the data.The
# value must be at least 60 seconds. If a per-series aligner other than
# ALIGN_NONE is specified, this field is required or an error is returned. If no
# per-series aligner is specified, or the aligner ALIGN_NONE is specified, then
# this field is ignored.The maximum value of the alignment_period is 104 weeks (
# 2 years) for charts, and 90,000 seconds (25 hours) for alerting policies.
# Corresponds to the JSON property `alignmentPeriod`
# @return [String]
attr_accessor :alignment_period
# The reduction operation to be used to combine time series into a single time
# series, where the value of each data point in the resulting series is a
# function of all the already aligned values in the input time series.Not all
# reducer operations can be applied to all time series. The valid choices depend
# on the metric_kind and the value_type of the original time series. Reduction
# can yield a time series with a different metric_kind or value_type than the
# input time series.Time series data must first be aligned (see
# per_series_aligner) in order to perform cross-time series reduction. If
# cross_series_reducer is specified, then per_series_aligner must be specified,
# and must not be ALIGN_NONE. An alignment_period must also be specified;
# otherwise, an error is returned.
# Corresponds to the JSON property `crossSeriesReducer`
# @return [String]
attr_accessor :cross_series_reducer
# The set of fields to preserve when cross_series_reducer is specified. The
# group_by_fields determine how the time series are partitioned into subsets
# prior to applying the aggregation operation. Each subset contains time series
# that have the same value for each of the grouping fields. Each individual time
# series is a member of exactly one subset. The cross_series_reducer is applied
# to each subset of time series. It is not possible to reduce across different
# resource types, so this field implicitly contains resource.type. Fields not
# specified in group_by_fields are aggregated away. If group_by_fields is not
# specified and all the time series have the same resource type, then the time
# series are aggregated into a single output time series. If
# cross_series_reducer is not defined, this field is ignored.
# Corresponds to the JSON property `groupByFields`
# @return [Array<String>]
attr_accessor :group_by_fields
# An Aligner describes how to bring the data points in a single time series into
# temporal alignment. Except for ALIGN_NONE, all alignments cause all the data
# points in an alignment_period to be mathematically grouped together, resulting
# in a single data point for each alignment_period with end timestamp at the end
# of the period.Not all alignment operations may be applied to all time series.
# The valid choices depend on the metric_kind and value_type of the original
# time series. Alignment can change the metric_kind or the value_type of the
# time series.Time series data must be aligned in order to perform cross-time
# series reduction. If cross_series_reducer is specified, then
# per_series_aligner must be specified and not equal to ALIGN_NONE and
# alignment_period must be specified; otherwise, an error is returned.
# Corresponds to the JSON property `perSeriesAligner`
# @return [String]
attr_accessor :per_series_aligner
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@alignment_period = args[:alignment_period] if args.key?(:alignment_period)
@cross_series_reducer = args[:cross_series_reducer] if args.key?(:cross_series_reducer)
@group_by_fields = args[:group_by_fields] if args.key?(:group_by_fields)
@per_series_aligner = args[:per_series_aligner] if args.key?(:per_series_aligner)
end
end
# A description of the conditions under which some aspect of your system is
# considered to be "unhealthy" and the ways to notify people or services about
# this state. For an overview of alert policies, see Introduction to Alerting (
# https://cloud.google.com/monitoring/alerts/).
class AlertPolicy
include Google::Apis::Core::Hashable
# How to combine the results of multiple conditions to determine if an incident
# should be opened. If condition_time_series_query_language is present, this
# must be COMBINE_UNSPECIFIED.
# Corresponds to the JSON property `combiner`
# @return [String]
attr_accessor :combiner
# A list of conditions for the policy. The conditions are combined by AND or OR
# according to the combiner field. If the combined conditions evaluate to true,
# then an incident is created. A policy can have from one to six conditions. If
# condition_time_series_query_language is present, it must be the only condition.
# Corresponds to the JSON property `conditions`
# @return [Array<Google::Apis::MonitoringV3::Condition>]
attr_accessor :conditions
# Describes a change made to a configuration.
# Corresponds to the JSON property `creationRecord`
# @return [Google::Apis::MonitoringV3::MutationRecord]
attr_accessor :creation_record
# A short name or phrase used to identify the policy in dashboards,
# notifications, and incidents. To avoid confusion, don't use the same display
# name for multiple policies in the same project. The name is limited to 512
# Unicode characters.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# A content string and a MIME type that describes the content string's format.
# Corresponds to the JSON property `documentation`
# @return [Google::Apis::MonitoringV3::Documentation]
attr_accessor :documentation
# Whether or not the policy is enabled. On write, the default interpretation if
# unset is that the policy is enabled. On read, clients should not make any
# assumption about the state if it has not been populated. The field should
# always be populated on List and Get operations, unless a field projection has
# been specified that strips it out.
# Corresponds to the JSON property `enabled`
# @return [Boolean]
attr_accessor :enabled
alias_method :enabled?, :enabled
# Describes a change made to a configuration.
# Corresponds to the JSON property `mutationRecord`
# @return [Google::Apis::MonitoringV3::MutationRecord]
attr_accessor :mutation_record
# Required if the policy exists. The resource name for this policy. The format
# is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] [
# ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is
# created. When calling the alertPolicies.create method, do not include the name
# field in the alerting policy passed as part of the request.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Identifies the notification channels to which notifications should be sent
# when incidents are opened or closed or when new violations occur on an already
# opened incident. Each element of this array corresponds to the name field in
# each of the NotificationChannel objects that are returned from the
# ListNotificationChannels method. The format of the entries in this field is:
# projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
# Corresponds to the JSON property `notificationChannels`
# @return [Array<String>]
attr_accessor :notification_channels
# User-supplied key/value data to be used for organizing and identifying the
# AlertPolicy objects.The field can contain up to 64 entries. Each key and value
# is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels
# and values can contain only lowercase letters, numerals, underscores, and
# dashes. Keys must begin with a letter.
# Corresponds to the JSON property `userLabels`
# @return [Hash<String,String>]
attr_accessor :user_labels
# The Status type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by gRPC
# (https://github.com/grpc). Each Status message contains three pieces of data:
# error code, error message, and error details.You can find out more about this
# error model and how to work with it in the API Design Guide (https://cloud.
# google.com/apis/design/errors).
# Corresponds to the JSON property `validity`
# @return [Google::Apis::MonitoringV3::Status]
attr_accessor :validity
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@combiner = args[:combiner] if args.key?(:combiner)
@conditions = args[:conditions] if args.key?(:conditions)
@creation_record = args[:creation_record] if args.key?(:creation_record)
@display_name = args[:display_name] if args.key?(:display_name)
@documentation = args[:documentation] if args.key?(:documentation)
@enabled = args[:enabled] if args.key?(:enabled)
@mutation_record = args[:mutation_record] if args.key?(:mutation_record)
@name = args[:name] if args.key?(:name)
@notification_channels = args[:notification_channels] if args.key?(:notification_channels)
@user_labels = args[:user_labels] if args.key?(:user_labels)
@validity = args[:validity] if args.key?(:validity)
end
end
# App Engine service. Learn more at https://cloud.google.com/appengine.
class AppEngine
include Google::Apis::Core::Hashable
# The ID of the App Engine module underlying this service. Corresponds to the
# module_id resource label in the gae_app monitored resource: https://cloud.
# google.com/monitoring/api/resources#tag_gae_app
# Corresponds to the JSON property `moduleId`
# @return [String]
attr_accessor :module_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@module_id = args[:module_id] if args.key?(:module_id)
end
end
# Future parameters for the availability SLI.
class AvailabilityCriteria
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# The authentication parameters to provide to the specified resource or URL that
# requires a username and password. Currently, only Basic HTTP authentication (
# https://tools.ietf.org/html/rfc7617) is supported in Uptime checks.
class BasicAuthentication
include Google::Apis::Core::Hashable
# The password to use when authenticating with the HTTP server.
# Corresponds to the JSON property `password`
# @return [String]
attr_accessor :password
# The username to use when authenticating with the HTTP server.
# Corresponds to the JSON property `username`
# @return [String]
attr_accessor :username
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@password = args[:password] if args.key?(:password)
@username = args[:username] if args.key?(:username)
end
end
# An SLI measuring performance on a well-known service type. Performance will be
# computed on the basis of pre-defined metrics. The type of the service_resource
# determines the metrics to use and the service_resource.labels and
# metric_labels are used to construct a monitoring filter to filter that metric
# down to just the data relevant to this service.
class BasicSli
include Google::Apis::Core::Hashable
# Future parameters for the availability SLI.
# Corresponds to the JSON property `availability`
# @return [Google::Apis::MonitoringV3::AvailabilityCriteria]
attr_accessor :availability
# Parameters for a latency threshold SLI.
# Corresponds to the JSON property `latency`
# @return [Google::Apis::MonitoringV3::LatencyCriteria]
attr_accessor :latency
# OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from
# other locations will not be used to calculate performance for this SLI. If
# omitted, this SLI applies to all locations in which the Service has activity.
# For service types that don't support breaking down by location, setting this
# field will result in an error.
# Corresponds to the JSON property `location`
# @return [Array<String>]
attr_accessor :location
# OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other
# methods will not be used to calculate performance for this SLI. If omitted,
# this SLI applies to all the Service's methods. For service types that don't
# support breaking down by method, setting this field will result in an error.
# Corresponds to the JSON property `method`
# @return [Array<String>]
attr_accessor :method_prop
# OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
# from other API versions will not be used to calculate performance for this SLI.
# If omitted, this SLI applies to all API versions. For service types that don'
# t support breaking down by version, setting this field will result in an error.
# Corresponds to the JSON property `version`
# @return [Array<String>]
attr_accessor :version
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@availability = args[:availability] if args.key?(:availability)
@latency = args[:latency] if args.key?(:latency)
@location = args[:location] if args.key?(:location)
@method_prop = args[:method_prop] if args.key?(:method_prop)
@version = args[:version] if args.key?(:version)
end
end
# BucketOptions describes the bucket boundaries used to create a histogram for
# the distribution. The buckets can be in a linear sequence, an exponential
# sequence, or each bucket can be specified explicitly. BucketOptions does not
# include the number of values in each bucket.A bucket has an inclusive lower
# bound and exclusive upper bound for the values that are counted for that
# bucket. The upper bound of a bucket must be strictly greater than the lower
# bound. The sequence of N buckets for a distribution consists of an underflow
# bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an
# overflow bucket (number N - 1). The buckets are contiguous: the lower bound of
# bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets
# span the whole range of finite values: lower bound of the underflow bucket is -
# infinity and the upper bound of the overflow bucket is +infinity. The finite
# buckets are so-called because both bounds are finite.
class BucketOptions
include Google::Apis::Core::Hashable
# Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 (=
# N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1):
# boundsi Lower bound (1 <= i < N); boundsi - 1The bounds field must contain at
# least one element. If bounds has only one element, then there are no finite
# buckets, and that single element is the common boundary of the overflow and
# underflow buckets.
# Corresponds to the JSON property `explicitBuckets`
# @return [Google::Apis::MonitoringV3::Explicit]
attr_accessor :explicit_buckets
# Specifies an exponential sequence of buckets that have a width that is
# proportional to the value of the lower bound. Each bucket represents a
# constant relative uncertainty on a specific value in the bucket.There are
# num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:
# Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i <
# N): scale * (growth_factor ^ (i - 1)).
# Corresponds to the JSON property `exponentialBuckets`
# @return [Google::Apis::MonitoringV3::Exponential]
attr_accessor :exponential_buckets
# Specifies a linear sequence of buckets that all have the same width (except
# overflow and underflow). Each bucket represents a constant absolute
# uncertainty on the specific value in the bucket.There are num_finite_buckets +
# 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-
# 1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
# Corresponds to the JSON property `linearBuckets`
# @return [Google::Apis::MonitoringV3::Linear]
attr_accessor :linear_buckets
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@explicit_buckets = args[:explicit_buckets] if args.key?(:explicit_buckets)
@exponential_buckets = args[:exponential_buckets] if args.key?(:exponential_buckets)
@linear_buckets = args[:linear_buckets] if args.key?(:linear_buckets)
end
end
# Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints.
class CloudEndpoints
include Google::Apis::Core::Hashable
# The name of the Cloud Endpoints service underlying this service. Corresponds
# to the service resource label in the api monitored resource: https://cloud.
# google.com/monitoring/api/resources#tag_api
# Corresponds to the JSON property `service`
# @return [String]
attr_accessor :service
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@service = args[:service] if args.key?(:service)
end
end
# Istio service scoped to a single Kubernetes cluster. Learn more at http://
# istio.io.
class ClusterIstio
include Google::Apis::Core::Hashable
# The name of the Kubernetes cluster in which this Istio service is defined.
# Corresponds to the cluster_name resource label in k8s_cluster resources.
# Corresponds to the JSON property `clusterName`
# @return [String]
attr_accessor :cluster_name
# The location of the Kubernetes cluster in which this Istio service is defined.
# Corresponds to the location resource label in k8s_cluster resources.
# Corresponds to the JSON property `location`
# @return [String]
attr_accessor :location
# The name of the Istio service underlying this service. Corresponds to the
# destination_service_name metric label in Istio metrics.
# Corresponds to the JSON property `serviceName`
# @return [String]
attr_accessor :service_name
# The namespace of the Istio service underlying this service. Corresponds to the
# destination_service_namespace metric label in Istio metrics.
# Corresponds to the JSON property `serviceNamespace`
# @return [String]
attr_accessor :service_namespace
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@cluster_name = args[:cluster_name] if args.key?(:cluster_name)
@location = args[:location] if args.key?(:location)
@service_name = args[:service_name] if args.key?(:service_name)
@service_namespace = args[:service_namespace] if args.key?(:service_namespace)
end
end
# A collection of data points sent from a collectd-based plugin. See the
# collectd documentation for more information.
class CollectdPayload
include Google::Apis::Core::Hashable
# The end time of the interval.
# Corresponds to the JSON property `endTime`
# @return [String]
attr_accessor :end_time
# The measurement metadata. Example: "process_id" -> 12345
# Corresponds to the JSON property `metadata`
# @return [Hash<String,Google::Apis::MonitoringV3::TypedValue>]
attr_accessor :metadata
# The name of the plugin. Example: "disk".
# Corresponds to the JSON property `plugin`
# @return [String]
attr_accessor :plugin
# The instance name of the plugin Example: "hdcl".
# Corresponds to the JSON property `pluginInstance`
# @return [String]
attr_accessor :plugin_instance
# The start time of the interval.
# Corresponds to the JSON property `startTime`
# @return [String]
attr_accessor :start_time
# The measurement type. Example: "memory".
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# The measurement type instance. Example: "used".
# Corresponds to the JSON property `typeInstance`
# @return [String]
attr_accessor :type_instance
# The measured values during this time interval. Each value must have a
# different data_source_name.
# Corresponds to the JSON property `values`
# @return [Array<Google::Apis::MonitoringV3::CollectdValue>]
attr_accessor :values
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@end_time = args[:end_time] if args.key?(:end_time)
@metadata = args[:metadata] if args.key?(:metadata)
@plugin = args[:plugin] if args.key?(:plugin)
@plugin_instance = args[:plugin_instance] if args.key?(:plugin_instance)
@start_time = args[:start_time] if args.key?(:start_time)
@type = args[:type] if args.key?(:type)
@type_instance = args[:type_instance] if args.key?(:type_instance)
@values = args[:values] if args.key?(:values)
end
end
# Describes the error status for payloads that were not written.
class CollectdPayloadError
include Google::Apis::Core::Hashable
# The Status type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by gRPC
# (https://github.com/grpc). Each Status message contains three pieces of data:
# error code, error message, and error details.You can find out more about this
# error model and how to work with it in the API Design Guide (https://cloud.
# google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::MonitoringV3::Status]
attr_accessor :error
# The zero-based index in CreateCollectdTimeSeriesRequest.collectd_payloads.
# Corresponds to the JSON property `index`
# @return [Fixnum]
attr_accessor :index
# Records the error status for values that were not written due to an error.
# Failed payloads for which nothing is written will not include partial value
# errors.
# Corresponds to the JSON property `valueErrors`
# @return [Array<Google::Apis::MonitoringV3::CollectdValueError>]
attr_accessor :value_errors
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@error = args[:error] if args.key?(:error)
@index = args[:index] if args.key?(:index)
@value_errors = args[:value_errors] if args.key?(:value_errors)
end
end
# A single data point from a collectd-based plugin.
class CollectdValue
include Google::Apis::Core::Hashable
# The data source for the collectd value. For example, there are two data
# sources for network measurements: "rx" and "tx".
# Corresponds to the JSON property `dataSourceName`
# @return [String]
attr_accessor :data_source_name
# The type of measurement.
# Corresponds to the JSON property `dataSourceType`
# @return [String]
attr_accessor :data_source_type
# A single strongly-typed value.
# Corresponds to the JSON property `value`
# @return [Google::Apis::MonitoringV3::TypedValue]
attr_accessor :value
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@data_source_name = args[:data_source_name] if args.key?(:data_source_name)
@data_source_type = args[:data_source_type] if args.key?(:data_source_type)
@value = args[:value] if args.key?(:value)
end
end
# Describes the error status for values that were not written.
class CollectdValueError
include Google::Apis::Core::Hashable
# The Status type defines a logical error model that is suitable for different
# programming environments, including REST APIs and RPC APIs. It is used by gRPC
# (https://github.com/grpc). Each Status message contains three pieces of data:
# error code, error message, and error details.You can find out more about this
# error model and how to work with it in the API Design Guide (https://cloud.
# google.com/apis/design/errors).
# Corresponds to the JSON property `error`
# @return [Google::Apis::MonitoringV3::Status]
attr_accessor :error
# The zero-based index in CollectdPayload.values within the parent
# CreateCollectdTimeSeriesRequest.collectd_payloads.
# Corresponds to the JSON property `index`
# @return [Fixnum]
attr_accessor :index
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@error = args[:error] if args.key?(:error)
@index = args[:index] if args.key?(:index)
end
end
# A condition is a true/false test that determines when an alerting policy
# should open an incident. If a condition evaluates to true, it signifies that
# something is wrong.
class Condition
include Google::Apis::Core::Hashable
# A condition type that checks that monitored resources are reporting data. The
# configuration defines a metric and a set of monitored resources. The predicate
# is considered in violation when a time series for the specified metric of a
# monitored resource does not include any data in the specified duration.
# Corresponds to the JSON property `conditionAbsent`
# @return [Google::Apis::MonitoringV3::MetricAbsence]
attr_accessor :condition_absent
# A condition type that allows alert policies to be defined using Monitoring
# Query Language (https://cloud.google.com/monitoring/mql).
# Corresponds to the JSON property `conditionMonitoringQueryLanguage`
# @return [Google::Apis::MonitoringV3::MonitoringQueryLanguageCondition]
attr_accessor :condition_monitoring_query_language
# A condition type that compares a collection of time series against a threshold.
# Corresponds to the JSON property `conditionThreshold`
# @return [Google::Apis::MonitoringV3::MetricThreshold]
attr_accessor :condition_threshold
# A short name or phrase used to identify the condition in dashboards,
# notifications, and incidents. To avoid confusion, don't use the same display
# name for multiple conditions in the same policy.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# Required if the condition exists. The unique resource name for this condition.
# Its format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/
# conditions/[CONDITION_ID] [CONDITION_ID] is assigned by Stackdriver Monitoring
# when the condition is created as part of a new or updated alerting policy.When
# calling the alertPolicies.create method, do not include the name field in the
# conditions of the requested alerting policy. Stackdriver Monitoring creates
# the condition identifiers and includes them in the new policy.When calling the
# alertPolicies.update method to update a policy, including a condition name
# causes the existing condition to be updated. Conditions without names are
# added to the updated policy. Existing conditions are deleted if they are not
# updated.Best practice is to preserve [CONDITION_ID] if you make only small
# changes, such as those to condition thresholds, durations, or trigger values.
# Otherwise, treat the change as a new condition and let the existing condition
# be deleted.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@condition_absent = args[:condition_absent] if args.key?(:condition_absent)
@condition_monitoring_query_language = args[:condition_monitoring_query_language] if args.key?(:condition_monitoring_query_language)
@condition_threshold = args[:condition_threshold] if args.key?(:condition_threshold)
@display_name = args[:display_name] if args.key?(:display_name)
@name = args[:name] if args.key?(:name)
end
end
# Optional. Used to perform content matching. This allows matching based on
# substrings and regular expressions, together with their negations. Only the
# first 4 MB of an HTTP or HTTPS check's response (and the first 1 MB of a TCP
# check's response) are examined for purposes of content matching.
class ContentMatcher
include Google::Apis::Core::Hashable
# String or regex content to match. Maximum 1024 bytes. An empty content string
# indicates no content matching is to be performed.
# Corresponds to the JSON property `content`
# @return [String]
attr_accessor :content
# The type of content matcher that will be applied to the server output,
# compared to the content string when the check is run.
# Corresponds to the JSON property `matcher`
# @return [String]
attr_accessor :matcher
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@content = args[:content] if args.key?(:content)
@matcher = args[:matcher] if args.key?(:matcher)
end
end
# The CreateCollectdTimeSeries request.
class CreateCollectdTimeSeriesRequest
include Google::Apis::Core::Hashable
# The collectd payloads representing the time series data. You must not include
# more than a single point for each time series, so no two payloads can have the
# same values for all of the fields plugin, plugin_instance, type, and
# type_instance.
# Corresponds to the JSON property `collectdPayloads`
# @return [Array<Google::Apis::MonitoringV3::CollectdPayload>]
attr_accessor :collectd_payloads
# The version of collectd that collected the data. Example: "5.3.0-192.el6".
# Corresponds to the JSON property `collectdVersion`
# @return [String]
attr_accessor :collectd_version
# An object representing a resource that can be used for monitoring, logging,
# billing, or other purposes. Examples include virtual machine instances,
# databases, and storage devices such as disks. The type field identifies a
# MonitoredResourceDescriptor object that describes the resource's schema.
# Information in the labels field identifies the actual resource and its
# attributes according to the schema. For example, a particular Compute Engine
# VM instance could be represented by the following object, because the
# MonitoredResourceDescriptor for "gce_instance" has labels "instance_id" and "
# zone": ` "type": "gce_instance", "labels": ` "instance_id": "12345678901234", "
# zone": "us-central1-a" ``
# Corresponds to the JSON property `resource`
# @return [Google::Apis::MonitoringV3::MonitoredResource]
attr_accessor :resource
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@collectd_payloads = args[:collectd_payloads] if args.key?(:collectd_payloads)
@collectd_version = args[:collectd_version] if args.key?(:collectd_version)
@resource = args[:resource] if args.key?(:resource)
end
end
# The CreateCollectdTimeSeries response.
class CreateCollectdTimeSeriesResponse
include Google::Apis::Core::Hashable
# Records the error status for points that were not written due to an error in
# the request.Failed requests for which nothing is written will return an error
# response instead. Requests where data points were rejected by the backend will
# set summary instead.
# Corresponds to the JSON property `payloadErrors`
# @return [Array<Google::Apis::MonitoringV3::CollectdPayloadError>]
attr_accessor :payload_errors
# Summary of the result of a failed request to write data to a time series.
# Corresponds to the JSON property `summary`
# @return [Google::Apis::MonitoringV3::CreateTimeSeriesSummary]
attr_accessor :summary
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@payload_errors = args[:payload_errors] if args.key?(:payload_errors)
@summary = args[:summary] if args.key?(:summary)
end
end
# The CreateTimeSeries request.
class CreateTimeSeriesRequest
include Google::Apis::Core::Hashable
# Required. The new data to be added to a list of time series. Adds at most one
# data point to each of several time series. The new data point must be more
# recent than any other point in its time series. Each TimeSeries value must
# fully specify a unique time series by supplying all label values for the
# metric and the monitored resource.The maximum number of TimeSeries objects per
# Create request is 200.
# Corresponds to the JSON property `timeSeries`
# @return [Array<Google::Apis::MonitoringV3::TimeSeries>]
attr_accessor :time_series
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@time_series = args[:time_series] if args.key?(:time_series)
end
end
# Summary of the result of a failed request to write data to a time series.
class CreateTimeSeriesSummary
include Google::Apis::Core::Hashable
# The number of points that failed to be written. Order is not guaranteed.
# Corresponds to the JSON property `errors`
# @return [Array<Google::Apis::MonitoringV3::Error>]
attr_accessor :errors
# The number of points that were successfully written.
# Corresponds to the JSON property `successPointCount`
# @return [Fixnum]
attr_accessor :success_point_count
# The number of points in the request.
# Corresponds to the JSON property `totalPointCount`
# @return [Fixnum]
attr_accessor :total_point_count
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@errors = args[:errors] if args.key?(:errors)
@success_point_count = args[:success_point_count] if args.key?(:success_point_count)
@total_point_count = args[:total_point_count] if args.key?(:total_point_count)
end
end
# Custom view of service telemetry. Currently a place-holder pending final
# design.
class Custom
include Google::Apis::Core::Hashable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
end
end
# Distribution contains summary statistics for a population of values. It
# optionally contains a histogram representing the distribution of those values
# across a set of buckets.The summary statistics are the count, mean, sum of the
# squared deviation from the mean, the minimum, and the maximum of the set of
# population of values. The histogram is based on a sequence of buckets and
# gives a count of values that fall into each bucket. The boundaries of the
# buckets are given either explicitly or by formulas for buckets of fixed or
# exponentially increasing widths.Although it is not forbidden, it is generally
# a bad idea to include non-finite values (infinities or NaNs) in the population
# of values, as this will render the mean and sum_of_squared_deviation fields
# meaningless.
class Distribution
include Google::Apis::Core::Hashable
# Required in the Cloud Monitoring API v3. The values for each bucket specified
# in bucket_options. The sum of the values in bucketCounts must equal the value
# in the count field of the Distribution object. The order of the bucket counts
# follows the numbering schemes described for the three bucket types. The
# underflow bucket has number 0; the finite buckets, if any, have numbers 1
# through N-2; and the overflow bucket has number N-1. The size of bucket_counts
# must not be greater than N. If the size is less than N, then the remaining
# buckets are assigned values of zero.
# Corresponds to the JSON property `bucketCounts`
# @return [Array<Fixnum>]
attr_accessor :bucket_counts
# BucketOptions describes the bucket boundaries used to create a histogram for
# the distribution. The buckets can be in a linear sequence, an exponential
# sequence, or each bucket can be specified explicitly. BucketOptions does not
# include the number of values in each bucket.A bucket has an inclusive lower
# bound and exclusive upper bound for the values that are counted for that
# bucket. The upper bound of a bucket must be strictly greater than the lower
# bound. The sequence of N buckets for a distribution consists of an underflow
# bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an
# overflow bucket (number N - 1). The buckets are contiguous: the lower bound of
# bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets
# span the whole range of finite values: lower bound of the underflow bucket is -
# infinity and the upper bound of the overflow bucket is +infinity. The finite
# buckets are so-called because both bounds are finite.
# Corresponds to the JSON property `bucketOptions`
# @return [Google::Apis::MonitoringV3::BucketOptions]
attr_accessor :bucket_options
# The number of values in the population. Must be non-negative. This value must
# equal the sum of the values in bucket_counts if a histogram is provided.
# Corresponds to the JSON property `count`
# @return [Fixnum]
attr_accessor :count
# Must be in increasing order of value field.
# Corresponds to the JSON property `exemplars`
# @return [Array<Google::Apis::MonitoringV3::Exemplar>]
attr_accessor :exemplars
# The arithmetic mean of the values in the population. If count is zero then
# this field must be zero.
# Corresponds to the JSON property `mean`
# @return [Float]
attr_accessor :mean
# The range of the population values.
# Corresponds to the JSON property `range`
# @return [Google::Apis::MonitoringV3::Range]
attr_accessor :range
# The sum of squared deviations from the mean of the values in the population.
# For values x_i this is: Sum[i=1..n]((x_i - mean)^2) Knuth, "The Art of
# Computer Programming", Vol. 2, page 232, 3rd edition describes Welford's
# method for accumulating this sum in one pass.If count is zero then this field
# must be zero.
# Corresponds to the JSON property `sumOfSquaredDeviation`
# @return [Float]
attr_accessor :sum_of_squared_deviation
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@bucket_counts = args[:bucket_counts] if args.key?(:bucket_counts)
@bucket_options = args[:bucket_options] if args.key?(:bucket_options)
@count = args[:count] if args.key?(:count)
@exemplars = args[:exemplars] if args.key?(:exemplars)
@mean = args[:mean] if args.key?(:mean)
@range = args[:range] if args.key?(:range)
@sum_of_squared_deviation = args[:sum_of_squared_deviation] if args.key?(:sum_of_squared_deviation)
end
end
# A DistributionCut defines a TimeSeries and thresholds used for measuring good
# service and total service. The TimeSeries must have ValueType = DISTRIBUTION
# and MetricKind = DELTA or MetricKind = CUMULATIVE. The computed good_service
# will be the count of values x in the Distribution such that range.min <= x <
# range.max.
class DistributionCut
include Google::Apis::Core::Hashable
# A monitoring filter (https://cloud.google.com/monitoring/api/v3/filters)
# specifying a TimeSeries aggregating values. Must have ValueType = DISTRIBUTION
# and MetricKind = DELTA or MetricKind = CUMULATIVE.
# Corresponds to the JSON property `distributionFilter`
# @return [String]
attr_accessor :distribution_filter
# Range of numerical values, inclusive of min and exclusive of max. If the open
# range "< range.max" is desired, set range.min = -infinity. If the open range ">
# = range.min" is desired, set range.max = infinity.
# Corresponds to the JSON property `range`
# @return [Google::Apis::MonitoringV3::GoogleMonitoringV3Range]
attr_accessor :range
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@distribution_filter = args[:distribution_filter] if args.key?(:distribution_filter)
@range = args[:range] if args.key?(:range)
end
end
# A content string and a MIME type that describes the content string's format.
class Documentation
include Google::Apis::Core::Hashable
# The text of the documentation, interpreted according to mime_type. The content
# may not exceed 8,192 Unicode characters and may not exceed more than 10,240
# bytes when encoded in UTF-8 format, whichever is smaller.
# Corresponds to the JSON property `content`
# @return [String]
attr_accessor :content