google-cloud-monitoring-v3 0.4.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/monitoring/v3/alert_policy_service/client.rb +113 -20
  3. data/lib/google/cloud/monitoring/v3/group_service/client.rb +142 -26
  4. data/lib/google/cloud/monitoring/v3/metric_service/client.rb +309 -38
  5. data/lib/google/cloud/monitoring/v3/notification_channel_service/client.rb +227 -41
  6. data/lib/google/cloud/monitoring/v3/query_service/client.rb +28 -4
  7. data/lib/google/cloud/monitoring/v3/service_monitoring_service/client.rb +222 -38
  8. data/lib/google/cloud/monitoring/v3/uptime_check_service/client.rb +135 -21
  9. data/lib/google/cloud/monitoring/v3/version.rb +1 -1
  10. data/lib/google/monitoring/v3/alert_pb.rb +18 -2
  11. data/lib/google/monitoring/v3/alert_service_pb.rb +2 -2
  12. data/lib/google/monitoring/v3/alert_service_services_pb.rb +1 -1
  13. data/lib/google/monitoring/v3/common_pb.rb +2 -2
  14. data/lib/google/monitoring/v3/group_pb.rb +1 -1
  15. data/lib/google/monitoring/v3/group_service_pb.rb +2 -2
  16. data/lib/google/monitoring/v3/group_service_services_pb.rb +1 -1
  17. data/lib/google/monitoring/v3/metric_pb.rb +2 -2
  18. data/lib/google/monitoring/v3/metric_service_pb.rb +2 -2
  19. data/lib/google/monitoring/v3/metric_service_services_pb.rb +13 -1
  20. data/lib/google/monitoring/v3/mutation_record_pb.rb +1 -1
  21. data/lib/google/monitoring/v3/notification_pb.rb +2 -2
  22. data/lib/google/monitoring/v3/notification_service_pb.rb +2 -2
  23. data/lib/google/monitoring/v3/notification_service_services_pb.rb +1 -1
  24. data/lib/google/monitoring/v3/query_service_pb.rb +2 -2
  25. data/lib/google/monitoring/v3/query_service_services_pb.rb +1 -1
  26. data/lib/google/monitoring/v3/service_pb.rb +5 -2
  27. data/lib/google/monitoring/v3/service_service_pb.rb +2 -2
  28. data/lib/google/monitoring/v3/service_service_services_pb.rb +1 -1
  29. data/lib/google/monitoring/v3/uptime_pb.rb +2 -2
  30. data/lib/google/monitoring/v3/uptime_service_pb.rb +3 -2
  31. data/lib/google/monitoring/v3/uptime_service_services_pb.rb +1 -1
  32. data/proto_docs/google/longrunning/operations.rb +164 -0
  33. data/proto_docs/google/monitoring/v3/alert.rb +72 -3
  34. data/proto_docs/google/monitoring/v3/alert_service.rb +4 -2
  35. data/proto_docs/google/monitoring/v3/common.rb +18 -6
  36. data/proto_docs/google/monitoring/v3/group_service.rb +4 -2
  37. data/proto_docs/google/monitoring/v3/metric.rb +3 -1
  38. data/proto_docs/google/monitoring/v3/metric_service.rb +13 -8
  39. data/proto_docs/google/monitoring/v3/notification_service.rb +8 -4
  40. data/proto_docs/google/monitoring/v3/service.rb +38 -6
  41. data/proto_docs/google/monitoring/v3/service_service.rb +4 -2
  42. data/proto_docs/google/monitoring/v3/span_context.rb +2 -2
  43. data/proto_docs/google/monitoring/v3/uptime.rb +5 -2
  44. data/proto_docs/google/monitoring/v3/uptime_service.rb +4 -2
  45. metadata +3 -2
@@ -67,34 +67,34 @@ module Google
67
67
 
68
68
  default_config.rpcs.list_monitored_resource_descriptors.timeout = 30.0
69
69
  default_config.rpcs.list_monitored_resource_descriptors.retry_policy = {
70
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
70
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
71
71
  }
72
72
 
73
73
  default_config.rpcs.get_monitored_resource_descriptor.timeout = 30.0
74
74
  default_config.rpcs.get_monitored_resource_descriptor.retry_policy = {
75
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
75
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
76
76
  }
77
77
 
78
78
  default_config.rpcs.list_metric_descriptors.timeout = 30.0
79
79
  default_config.rpcs.list_metric_descriptors.retry_policy = {
80
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
81
81
  }
82
82
 
83
83
  default_config.rpcs.get_metric_descriptor.timeout = 30.0
84
84
  default_config.rpcs.get_metric_descriptor.retry_policy = {
85
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
86
86
  }
87
87
 
88
88
  default_config.rpcs.create_metric_descriptor.timeout = 12.0
89
89
 
90
90
  default_config.rpcs.delete_metric_descriptor.timeout = 30.0
91
91
  default_config.rpcs.delete_metric_descriptor.retry_policy = {
92
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
92
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
93
93
  }
94
94
 
95
- default_config.rpcs.list_time_series.timeout = 30.0
95
+ default_config.rpcs.list_time_series.timeout = 90.0
96
96
  default_config.rpcs.list_time_series.retry_policy = {
97
- initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
97
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14]
98
98
  }
99
99
 
100
100
  default_config.rpcs.create_time_series.timeout = 12.0
@@ -198,7 +198,8 @@ module Google
198
198
  # the default parameter values, pass an empty Hash as a request object (see above).
199
199
  #
200
200
  # @param name [::String]
201
- # Required. The project on which to execute the request. The format is:
201
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
202
+ # which to execute the request. The format is:
202
203
  #
203
204
  # projects/[PROJECT_ID_OR_NUMBER]
204
205
  # @param filter [::String]
@@ -223,6 +224,27 @@ module Google
223
224
  #
224
225
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
225
226
  #
227
+ # @example Basic example
228
+ # require "google/cloud/monitoring/v3"
229
+ #
230
+ # # Create a client object. The client can be reused for multiple calls.
231
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
232
+ #
233
+ # # Create a request. To set request fields, pass in keyword arguments.
234
+ # request = Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest.new
235
+ #
236
+ # # Call the list_monitored_resource_descriptors method.
237
+ # result = client.list_monitored_resource_descriptors request
238
+ #
239
+ # # The returned object is of type Gapic::PagedEnumerable. You can
240
+ # # iterate over all elements by calling #each, and the enumerable
241
+ # # will lazily make API calls to fetch subsequent pages. Other
242
+ # # methods are also available for managing paging directly.
243
+ # result.each do |response|
244
+ # # Each element is of type ::Google::Api::MonitoredResourceDescriptor.
245
+ # p response
246
+ # end
247
+ #
226
248
  def list_monitored_resource_descriptors request, options = nil
227
249
  raise ::ArgumentError, "request must be provided" if request.nil?
228
250
 
@@ -240,9 +262,11 @@ module Google
240
262
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
241
263
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
264
 
243
- header_params = {
244
- "name" => request.name
245
- }
265
+ header_params = {}
266
+ if request.name
267
+ header_params["name"] = request.name
268
+ end
269
+
246
270
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
247
271
  metadata[:"x-goog-request-params"] ||= request_params_header
248
272
 
@@ -297,6 +321,21 @@ module Google
297
321
  #
298
322
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
299
323
  #
324
+ # @example Basic example
325
+ # require "google/cloud/monitoring/v3"
326
+ #
327
+ # # Create a client object. The client can be reused for multiple calls.
328
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
329
+ #
330
+ # # Create a request. To set request fields, pass in keyword arguments.
331
+ # request = Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest.new
332
+ #
333
+ # # Call the get_monitored_resource_descriptor method.
334
+ # result = client.get_monitored_resource_descriptor request
335
+ #
336
+ # # The returned object is of type Google::Api::MonitoredResourceDescriptor.
337
+ # p result
338
+ #
300
339
  def get_monitored_resource_descriptor request, options = nil
301
340
  raise ::ArgumentError, "request must be provided" if request.nil?
302
341
 
@@ -314,9 +353,11 @@ module Google
314
353
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
315
354
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
316
355
 
317
- header_params = {
318
- "name" => request.name
319
- }
356
+ header_params = {}
357
+ if request.name
358
+ header_params["name"] = request.name
359
+ end
360
+
320
361
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
321
362
  metadata[:"x-goog-request-params"] ||= request_params_header
322
363
 
@@ -355,7 +396,8 @@ module Google
355
396
  # the default parameter values, pass an empty Hash as a request object (see above).
356
397
  #
357
398
  # @param name [::String]
358
- # Required. The project on which to execute the request. The format is:
399
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
400
+ # which to execute the request. The format is:
359
401
  #
360
402
  # projects/[PROJECT_ID_OR_NUMBER]
361
403
  # @param filter [::String]
@@ -382,6 +424,27 @@ module Google
382
424
  #
383
425
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
384
426
  #
427
+ # @example Basic example
428
+ # require "google/cloud/monitoring/v3"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest.new
435
+ #
436
+ # # Call the list_metric_descriptors method.
437
+ # result = client.list_metric_descriptors request
438
+ #
439
+ # # The returned object is of type Gapic::PagedEnumerable. You can
440
+ # # iterate over all elements by calling #each, and the enumerable
441
+ # # will lazily make API calls to fetch subsequent pages. Other
442
+ # # methods are also available for managing paging directly.
443
+ # result.each do |response|
444
+ # # Each element is of type ::Google::Api::MetricDescriptor.
445
+ # p response
446
+ # end
447
+ #
385
448
  def list_metric_descriptors request, options = nil
386
449
  raise ::ArgumentError, "request must be provided" if request.nil?
387
450
 
@@ -399,9 +462,11 @@ module Google
399
462
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
400
463
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
401
464
 
402
- header_params = {
403
- "name" => request.name
404
- }
465
+ header_params = {}
466
+ if request.name
467
+ header_params["name"] = request.name
468
+ end
469
+
405
470
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
406
471
  metadata[:"x-goog-request-params"] ||= request_params_header
407
472
 
@@ -456,6 +521,21 @@ module Google
456
521
  #
457
522
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
458
523
  #
524
+ # @example Basic example
525
+ # require "google/cloud/monitoring/v3"
526
+ #
527
+ # # Create a client object. The client can be reused for multiple calls.
528
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
529
+ #
530
+ # # Create a request. To set request fields, pass in keyword arguments.
531
+ # request = Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest.new
532
+ #
533
+ # # Call the get_metric_descriptor method.
534
+ # result = client.get_metric_descriptor request
535
+ #
536
+ # # The returned object is of type Google::Api::MetricDescriptor.
537
+ # p result
538
+ #
459
539
  def get_metric_descriptor request, options = nil
460
540
  raise ::ArgumentError, "request must be provided" if request.nil?
461
541
 
@@ -473,9 +553,11 @@ module Google
473
553
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
474
554
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
475
555
 
476
- header_params = {
477
- "name" => request.name
478
- }
556
+ header_params = {}
557
+ if request.name
558
+ header_params["name"] = request.name
559
+ end
560
+
479
561
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
480
562
  metadata[:"x-goog-request-params"] ||= request_params_header
481
563
 
@@ -497,6 +579,8 @@ module Google
497
579
 
498
580
  ##
499
581
  # Creates a new metric descriptor.
582
+ # The creation is executed asynchronously and callers may check the returned
583
+ # operation to track its progress.
500
584
  # User-created metric descriptors define
501
585
  # [custom metrics](https://cloud.google.com/monitoring/custom-metrics).
502
586
  #
@@ -516,8 +600,9 @@ module Google
516
600
  # the default parameter values, pass an empty Hash as a request object (see above).
517
601
  #
518
602
  # @param name [::String]
519
- # Required. The project on which to execute the request. The format is:
520
- #
603
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
604
+ # which to execute the request. The format is:
605
+ # 4
521
606
  # projects/[PROJECT_ID_OR_NUMBER]
522
607
  # @param metric_descriptor [::Google::Api::MetricDescriptor, ::Hash]
523
608
  # Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics)
@@ -531,6 +616,21 @@ module Google
531
616
  #
532
617
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
533
618
  #
619
+ # @example Basic example
620
+ # require "google/cloud/monitoring/v3"
621
+ #
622
+ # # Create a client object. The client can be reused for multiple calls.
623
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
624
+ #
625
+ # # Create a request. To set request fields, pass in keyword arguments.
626
+ # request = Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest.new
627
+ #
628
+ # # Call the create_metric_descriptor method.
629
+ # result = client.create_metric_descriptor request
630
+ #
631
+ # # The returned object is of type Google::Api::MetricDescriptor.
632
+ # p result
633
+ #
534
634
  def create_metric_descriptor request, options = nil
535
635
  raise ::ArgumentError, "request must be provided" if request.nil?
536
636
 
@@ -548,9 +648,11 @@ module Google
548
648
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
549
649
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
550
650
 
551
- header_params = {
552
- "name" => request.name
553
- }
651
+ header_params = {}
652
+ if request.name
653
+ header_params["name"] = request.name
654
+ end
655
+
554
656
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
555
657
  metadata[:"x-goog-request-params"] ||= request_params_header
556
658
 
@@ -606,6 +708,21 @@ module Google
606
708
  #
607
709
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
608
710
  #
711
+ # @example Basic example
712
+ # require "google/cloud/monitoring/v3"
713
+ #
714
+ # # Create a client object. The client can be reused for multiple calls.
715
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
716
+ #
717
+ # # Create a request. To set request fields, pass in keyword arguments.
718
+ # request = Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest.new
719
+ #
720
+ # # Call the delete_metric_descriptor method.
721
+ # result = client.delete_metric_descriptor request
722
+ #
723
+ # # The returned object is of type Google::Protobuf::Empty.
724
+ # p result
725
+ #
609
726
  def delete_metric_descriptor request, options = nil
610
727
  raise ::ArgumentError, "request must be provided" if request.nil?
611
728
 
@@ -623,9 +740,11 @@ module Google
623
740
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
624
741
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
625
742
 
626
- header_params = {
627
- "name" => request.name
628
- }
743
+ header_params = {}
744
+ if request.name
745
+ header_params["name"] = request.name
746
+ end
747
+
629
748
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
630
749
  metadata[:"x-goog-request-params"] ||= request_params_header
631
750
 
@@ -664,8 +783,8 @@ module Google
664
783
  # the default parameter values, pass an empty Hash as a request object (see above).
665
784
  #
666
785
  # @param name [::String]
667
- # Required. The project, organization or folder on which to execute the request. The
668
- # format is:
786
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name),
787
+ # organization or folder on which to execute the request. The format is:
669
788
  #
670
789
  # projects/[PROJECT_ID_OR_NUMBER]
671
790
  # organizations/[ORGANIZATION_ID]
@@ -715,6 +834,27 @@ module Google
715
834
  #
716
835
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
717
836
  #
837
+ # @example Basic example
838
+ # require "google/cloud/monitoring/v3"
839
+ #
840
+ # # Create a client object. The client can be reused for multiple calls.
841
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
842
+ #
843
+ # # Create a request. To set request fields, pass in keyword arguments.
844
+ # request = Google::Cloud::Monitoring::V3::ListTimeSeriesRequest.new
845
+ #
846
+ # # Call the list_time_series method.
847
+ # result = client.list_time_series request
848
+ #
849
+ # # The returned object is of type Gapic::PagedEnumerable. You can
850
+ # # iterate over all elements by calling #each, and the enumerable
851
+ # # will lazily make API calls to fetch subsequent pages. Other
852
+ # # methods are also available for managing paging directly.
853
+ # result.each do |response|
854
+ # # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeries.
855
+ # p response
856
+ # end
857
+ #
718
858
  def list_time_series request, options = nil
719
859
  raise ::ArgumentError, "request must be provided" if request.nil?
720
860
 
@@ -732,9 +872,11 @@ module Google
732
872
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
733
873
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
734
874
 
735
- header_params = {
736
- "name" => request.name
737
- }
875
+ header_params = {}
876
+ if request.name
877
+ header_params["name"] = request.name
878
+ end
879
+
738
880
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
739
881
  metadata[:"x-goog-request-params"] ||= request_params_header
740
882
 
@@ -777,7 +919,8 @@ module Google
777
919
  # the default parameter values, pass an empty Hash as a request object (see above).
778
920
  #
779
921
  # @param name [::String]
780
- # Required. The project on which to execute the request. The format is:
922
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
923
+ # which to execute the request. The format is:
781
924
  #
782
925
  # projects/[PROJECT_ID_OR_NUMBER]
783
926
  # @param time_series [::Array<::Google::Cloud::Monitoring::V3::TimeSeries, ::Hash>]
@@ -797,6 +940,21 @@ module Google
797
940
  #
798
941
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
799
942
  #
943
+ # @example Basic example
944
+ # require "google/cloud/monitoring/v3"
945
+ #
946
+ # # Create a client object. The client can be reused for multiple calls.
947
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
948
+ #
949
+ # # Create a request. To set request fields, pass in keyword arguments.
950
+ # request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new
951
+ #
952
+ # # Call the create_time_series method.
953
+ # result = client.create_time_series request
954
+ #
955
+ # # The returned object is of type Google::Protobuf::Empty.
956
+ # p result
957
+ #
800
958
  def create_time_series request, options = nil
801
959
  raise ::ArgumentError, "request must be provided" if request.nil?
802
960
 
@@ -814,9 +972,11 @@ module Google
814
972
  gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
815
973
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
816
974
 
817
- header_params = {
818
- "name" => request.name
819
- }
975
+ header_params = {}
976
+ if request.name
977
+ header_params["name"] = request.name
978
+ end
979
+
820
980
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
821
981
  metadata[:"x-goog-request-params"] ||= request_params_header
822
982
 
@@ -836,6 +996,110 @@ module Google
836
996
  raise ::Google::Cloud::Error.from_error(e)
837
997
  end
838
998
 
999
+ ##
1000
+ # Creates or adds data to one or more service time series. A service time
1001
+ # series is a time series for a metric from a Google Cloud service. The
1002
+ # response is empty if all time series in the request were written. If any
1003
+ # time series could not be written, a corresponding failure message is
1004
+ # included in the error response. This endpoint rejects writes to
1005
+ # user-defined metrics.
1006
+ # This method is only for use by Google Cloud services. Use
1007
+ # {::Google::Cloud::Monitoring::V3::MetricService::Client#create_time_series projects.timeSeries.create}
1008
+ # instead.
1009
+ #
1010
+ # @overload create_service_time_series(request, options = nil)
1011
+ # Pass arguments to `create_service_time_series` via a request object, either of type
1012
+ # {::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest} or an equivalent Hash.
1013
+ #
1014
+ # @param request [::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest, ::Hash]
1015
+ # A request object representing the call parameters. Required. To specify no
1016
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1017
+ # @param options [::Gapic::CallOptions, ::Hash]
1018
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1019
+ #
1020
+ # @overload create_service_time_series(name: nil, time_series: nil)
1021
+ # Pass arguments to `create_service_time_series` via keyword arguments. Note that at
1022
+ # least one keyword argument is required. To specify no parameters, or to keep all
1023
+ # the default parameter values, pass an empty Hash as a request object (see above).
1024
+ #
1025
+ # @param name [::String]
1026
+ # Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on
1027
+ # which to execute the request. The format is:
1028
+ #
1029
+ # projects/[PROJECT_ID_OR_NUMBER]
1030
+ # @param time_series [::Array<::Google::Cloud::Monitoring::V3::TimeSeries, ::Hash>]
1031
+ # Required. The new data to be added to a list of time series.
1032
+ # Adds at most one data point to each of several time series. The new data
1033
+ # point must be more recent than any other point in its time series. Each
1034
+ # `TimeSeries` value must fully specify a unique time series by supplying
1035
+ # all label values for the metric and the monitored resource.
1036
+ #
1037
+ # The maximum number of `TimeSeries` objects per `Create` request is 200.
1038
+ #
1039
+ # @yield [response, operation] Access the result along with the RPC operation
1040
+ # @yieldparam response [::Google::Protobuf::Empty]
1041
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1042
+ #
1043
+ # @return [::Google::Protobuf::Empty]
1044
+ #
1045
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1046
+ #
1047
+ # @example Basic example
1048
+ # require "google/cloud/monitoring/v3"
1049
+ #
1050
+ # # Create a client object. The client can be reused for multiple calls.
1051
+ # client = Google::Cloud::Monitoring::V3::MetricService::Client.new
1052
+ #
1053
+ # # Create a request. To set request fields, pass in keyword arguments.
1054
+ # request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new
1055
+ #
1056
+ # # Call the create_service_time_series method.
1057
+ # result = client.create_service_time_series request
1058
+ #
1059
+ # # The returned object is of type Google::Protobuf::Empty.
1060
+ # p result
1061
+ #
1062
+ def create_service_time_series request, options = nil
1063
+ raise ::ArgumentError, "request must be provided" if request.nil?
1064
+
1065
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest
1066
+
1067
+ # Converts hash and nil to an options object
1068
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1069
+
1070
+ # Customize the options with defaults
1071
+ metadata = @config.rpcs.create_service_time_series.metadata.to_h
1072
+
1073
+ # Set x-goog-api-client and x-goog-user-project headers
1074
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1075
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1076
+ gapic_version: ::Google::Cloud::Monitoring::V3::VERSION
1077
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1078
+
1079
+ header_params = {}
1080
+ if request.name
1081
+ header_params["name"] = request.name
1082
+ end
1083
+
1084
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1085
+ metadata[:"x-goog-request-params"] ||= request_params_header
1086
+
1087
+ options.apply_defaults timeout: @config.rpcs.create_service_time_series.timeout,
1088
+ metadata: metadata,
1089
+ retry_policy: @config.rpcs.create_service_time_series.retry_policy
1090
+
1091
+ options.apply_defaults timeout: @config.timeout,
1092
+ metadata: @config.metadata,
1093
+ retry_policy: @config.retry_policy
1094
+
1095
+ @metric_service_stub.call_rpc :create_service_time_series, request, options: options do |response, operation|
1096
+ yield response, operation if block_given?
1097
+ return response
1098
+ end
1099
+ rescue ::GRPC::BadStatus => e
1100
+ raise ::Google::Cloud::Error.from_error(e)
1101
+ end
1102
+
839
1103
  ##
840
1104
  # Configuration class for the MetricService API.
841
1105
  #
@@ -1011,6 +1275,11 @@ module Google
1011
1275
  # @return [::Gapic::Config::Method]
1012
1276
  #
1013
1277
  attr_reader :create_time_series
1278
+ ##
1279
+ # RPC-specific configuration for `create_service_time_series`
1280
+ # @return [::Gapic::Config::Method]
1281
+ #
1282
+ attr_reader :create_service_time_series
1014
1283
 
1015
1284
  # @private
1016
1285
  def initialize parent_rpcs = nil
@@ -1030,6 +1299,8 @@ module Google
1030
1299
  @list_time_series = ::Gapic::Config::Method.new list_time_series_config
1031
1300
  create_time_series_config = parent_rpcs.create_time_series if parent_rpcs.respond_to? :create_time_series
1032
1301
  @create_time_series = ::Gapic::Config::Method.new create_time_series_config
1302
+ create_service_time_series_config = parent_rpcs.create_service_time_series if parent_rpcs.respond_to? :create_service_time_series
1303
+ @create_service_time_series = ::Gapic::Config::Method.new create_service_time_series_config
1033
1304
 
1034
1305
  yield self if block_given?
1035
1306
  end