google-cloud-monitoring 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/google/cloud/monitoring.rb +2 -2
- data/lib/google/cloud/monitoring/v3.rb +2 -2
- data/lib/google/cloud/monitoring/v3/notification_channel_service_client.rb +166 -0
- data/lib/google/cloud/monitoring/v3/notification_channel_service_client_config.json +15 -0
- data/lib/google/cloud/monitoring/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a4523eba78f675c7e693212d8224995806726976d0e8537b25ace18d35ebd83
|
4
|
+
data.tar.gz: d4c28ae689a85292d43ba97436af28cfbc171abc6f969cd9814bc5c64a7fed69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cc452861113b8e14adf23f105f7fab5f1637db9005823aaed4b58fb1589d7de1d92233e38dcc560c18eb90565a619a59d94ac009d4c5ba9d29e20901c50c253
|
7
|
+
data.tar.gz: 8745006dfcdd48e36754f5a7e32cee48dd41be7dcc5f9bca2cbb9e963193f1c0d4b848fa791866db445d54214c33d0d58620ce62b943835cfc3c26404c695cd4
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ steps:
|
|
14
14
|
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
15
15
|
2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
16
16
|
3. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
|
17
|
-
4. [Setup Authentication.](https://googleapis.
|
17
|
+
4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-monitoring/latest/file.AUTHENTICATION.html)
|
18
18
|
|
19
19
|
### Installation
|
20
20
|
```
|
@@ -51,14 +51,14 @@ end
|
|
51
51
|
- View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
52
52
|
to see the full list of Cloud APIs that we cover.
|
53
53
|
|
54
|
-
[Client Library Documentation]: https://googleapis.
|
54
|
+
[Client Library Documentation]: https://googleapis.dev/ruby/google-cloud-monitoring/latest
|
55
55
|
[Product Documentation]: https://cloud.google.com/monitoring
|
56
56
|
|
57
57
|
## Enabling Logging
|
58
58
|
|
59
59
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
60
60
|
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
61
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.
|
61
|
+
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
62
62
|
that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
63
63
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
64
64
|
|
@@ -36,7 +36,7 @@ module Google
|
|
36
36
|
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
37
37
|
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
38
38
|
# 3. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
|
39
|
-
# 4. [Setup Authentication.](https://googleapis.
|
39
|
+
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-monitoring/latest/file.AUTHENTICATION.html)
|
40
40
|
#
|
41
41
|
# ### Installation
|
42
42
|
# ```
|
@@ -77,7 +77,7 @@ module Google
|
|
77
77
|
#
|
78
78
|
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
79
79
|
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
80
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.
|
80
|
+
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
81
81
|
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
82
82
|
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
83
83
|
#
|
@@ -42,7 +42,7 @@ module Google
|
|
42
42
|
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
43
43
|
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
44
44
|
# 3. [Enable the Stackdriver Monitoring API.](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
|
45
|
-
# 4. [Setup Authentication.](https://googleapis.
|
45
|
+
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-monitoring/latest/file.AUTHENTICATION.html)
|
46
46
|
#
|
47
47
|
# ### Installation
|
48
48
|
# ```
|
@@ -83,7 +83,7 @@ module Google
|
|
83
83
|
#
|
84
84
|
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
85
85
|
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
86
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.
|
86
|
+
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
87
87
|
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
88
88
|
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
89
89
|
#
|
@@ -290,6 +290,30 @@ module Google
|
|
290
290
|
{'name' => request.name}
|
291
291
|
end
|
292
292
|
)
|
293
|
+
@send_notification_channel_verification_code = Google::Gax.create_api_call(
|
294
|
+
@notification_channel_service_stub.method(:send_notification_channel_verification_code),
|
295
|
+
defaults["send_notification_channel_verification_code"],
|
296
|
+
exception_transformer: exception_transformer,
|
297
|
+
params_extractor: proc do |request|
|
298
|
+
{'name' => request.name}
|
299
|
+
end
|
300
|
+
)
|
301
|
+
@get_notification_channel_verification_code = Google::Gax.create_api_call(
|
302
|
+
@notification_channel_service_stub.method(:get_notification_channel_verification_code),
|
303
|
+
defaults["get_notification_channel_verification_code"],
|
304
|
+
exception_transformer: exception_transformer,
|
305
|
+
params_extractor: proc do |request|
|
306
|
+
{'name' => request.name}
|
307
|
+
end
|
308
|
+
)
|
309
|
+
@verify_notification_channel = Google::Gax.create_api_call(
|
310
|
+
@notification_channel_service_stub.method(:verify_notification_channel),
|
311
|
+
defaults["verify_notification_channel"],
|
312
|
+
exception_transformer: exception_transformer,
|
313
|
+
params_extractor: proc do |request|
|
314
|
+
{'name' => request.name}
|
315
|
+
end
|
316
|
+
)
|
293
317
|
end
|
294
318
|
|
295
319
|
# Service calls
|
@@ -629,6 +653,148 @@ module Google
|
|
629
653
|
@delete_notification_channel.call(req, options, &block)
|
630
654
|
nil
|
631
655
|
end
|
656
|
+
|
657
|
+
# Causes a verification code to be delivered to the channel. The code
|
658
|
+
# can then be supplied in `VerifyNotificationChannel` to verify the channel.
|
659
|
+
#
|
660
|
+
# @param name [String]
|
661
|
+
# The notification channel to which to send a verification code.
|
662
|
+
# @param options [Google::Gax::CallOptions]
|
663
|
+
# Overrides the default settings for this call, e.g, timeout,
|
664
|
+
# retries, etc.
|
665
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
666
|
+
# @yieldparam result []
|
667
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
668
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
669
|
+
# @example
|
670
|
+
# require "google/cloud/monitoring"
|
671
|
+
#
|
672
|
+
# notification_channel_client = Google::Cloud::Monitoring::NotificationChannel.new(version: :v3)
|
673
|
+
# formatted_name = Google::Cloud::Monitoring::V3::NotificationChannelServiceClient.notification_channel_path("[PROJECT]", "[NOTIFICATION_CHANNEL]")
|
674
|
+
# notification_channel_client.send_notification_channel_verification_code(formatted_name)
|
675
|
+
|
676
|
+
def send_notification_channel_verification_code \
|
677
|
+
name,
|
678
|
+
options: nil,
|
679
|
+
&block
|
680
|
+
req = {
|
681
|
+
name: name
|
682
|
+
}.delete_if { |_, v| v.nil? }
|
683
|
+
req = Google::Gax::to_proto(req, Google::Monitoring::V3::SendNotificationChannelVerificationCodeRequest)
|
684
|
+
@send_notification_channel_verification_code.call(req, options, &block)
|
685
|
+
nil
|
686
|
+
end
|
687
|
+
|
688
|
+
# Requests a verification code for an already verified channel that can then
|
689
|
+
# be used in a call to VerifyNotificationChannel() on a different channel
|
690
|
+
# with an equivalent identity in the same or in a different project. This
|
691
|
+
# makes it possible to copy a channel between projects without requiring
|
692
|
+
# manual reverification of the channel. If the channel is not in the
|
693
|
+
# verified state, this method will fail (in other words, this may only be
|
694
|
+
# used if the SendNotificationChannelVerificationCode and
|
695
|
+
# VerifyNotificationChannel paths have already been used to put the given
|
696
|
+
# channel into the verified state).
|
697
|
+
#
|
698
|
+
# There is no guarantee that the verification codes returned by this method
|
699
|
+
# will be of a similar structure or form as the ones that are delivered
|
700
|
+
# to the channel via SendNotificationChannelVerificationCode; while
|
701
|
+
# VerifyNotificationChannel() will recognize both the codes delivered via
|
702
|
+
# SendNotificationChannelVerificationCode() and returned from
|
703
|
+
# GetNotificationChannelVerificationCode(), it is typically the case that
|
704
|
+
# the verification codes delivered via
|
705
|
+
# SendNotificationChannelVerificationCode() will be shorter and also
|
706
|
+
# have a shorter expiration (e.g. codes such as "G-123456") whereas
|
707
|
+
# GetVerificationCode() will typically return a much longer, websafe base
|
708
|
+
# 64 encoded string that has a longer expiration time.
|
709
|
+
#
|
710
|
+
# @param name [String]
|
711
|
+
# The notification channel for which a verification code is to be generated
|
712
|
+
# and retrieved. This must name a channel that is already verified; if
|
713
|
+
# the specified channel is not verified, the request will fail.
|
714
|
+
# @param expire_time [Google::Protobuf::Timestamp | Hash]
|
715
|
+
# The desired expiration time. If specified, the API will guarantee that
|
716
|
+
# the returned code will not be valid after the specified timestamp;
|
717
|
+
# however, the API cannot guarantee that the returned code will be
|
718
|
+
# valid for at least as long as the requested time (the API puts an upper
|
719
|
+
# bound on the amount of time for which a code may be valid). If omitted,
|
720
|
+
# a default expiration will be used, which may be less than the max
|
721
|
+
# permissible expiration (so specifying an expiration may extend the
|
722
|
+
# code's lifetime over omitting an expiration, even though the API does
|
723
|
+
# impose an upper limit on the maximum expiration that is permitted).
|
724
|
+
# A hash of the same form as `Google::Protobuf::Timestamp`
|
725
|
+
# can also be provided.
|
726
|
+
# @param options [Google::Gax::CallOptions]
|
727
|
+
# Overrides the default settings for this call, e.g, timeout,
|
728
|
+
# retries, etc.
|
729
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
730
|
+
# @yieldparam result [Google::Monitoring::V3::GetNotificationChannelVerificationCodeResponse]
|
731
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
732
|
+
# @return [Google::Monitoring::V3::GetNotificationChannelVerificationCodeResponse]
|
733
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
734
|
+
# @example
|
735
|
+
# require "google/cloud/monitoring"
|
736
|
+
#
|
737
|
+
# notification_channel_client = Google::Cloud::Monitoring::NotificationChannel.new(version: :v3)
|
738
|
+
# formatted_name = Google::Cloud::Monitoring::V3::NotificationChannelServiceClient.notification_channel_path("[PROJECT]", "[NOTIFICATION_CHANNEL]")
|
739
|
+
# response = notification_channel_client.get_notification_channel_verification_code(formatted_name)
|
740
|
+
|
741
|
+
def get_notification_channel_verification_code \
|
742
|
+
name,
|
743
|
+
expire_time: nil,
|
744
|
+
options: nil,
|
745
|
+
&block
|
746
|
+
req = {
|
747
|
+
name: name,
|
748
|
+
expire_time: expire_time
|
749
|
+
}.delete_if { |_, v| v.nil? }
|
750
|
+
req = Google::Gax::to_proto(req, Google::Monitoring::V3::GetNotificationChannelVerificationCodeRequest)
|
751
|
+
@get_notification_channel_verification_code.call(req, options, &block)
|
752
|
+
end
|
753
|
+
|
754
|
+
# Verifies a `NotificationChannel` by proving receipt of the code
|
755
|
+
# delivered to the channel as a result of calling
|
756
|
+
# `SendNotificationChannelVerificationCode`.
|
757
|
+
#
|
758
|
+
# @param name [String]
|
759
|
+
# The notification channel to verify.
|
760
|
+
# @param code [String]
|
761
|
+
# The verification code that was delivered to the channel as
|
762
|
+
# a result of invoking the `SendNotificationChannelVerificationCode` API
|
763
|
+
# method or that was retrieved from a verified channel via
|
764
|
+
# `GetNotificationChannelVerificationCode`. For example, one might have
|
765
|
+
# "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only
|
766
|
+
# guaranteed that the code is valid UTF-8; one should not
|
767
|
+
# make any assumptions regarding the structure or format of the code).
|
768
|
+
# @param options [Google::Gax::CallOptions]
|
769
|
+
# Overrides the default settings for this call, e.g, timeout,
|
770
|
+
# retries, etc.
|
771
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
772
|
+
# @yieldparam result [Google::Monitoring::V3::NotificationChannel]
|
773
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
774
|
+
# @return [Google::Monitoring::V3::NotificationChannel]
|
775
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
776
|
+
# @example
|
777
|
+
# require "google/cloud/monitoring"
|
778
|
+
#
|
779
|
+
# notification_channel_client = Google::Cloud::Monitoring::NotificationChannel.new(version: :v3)
|
780
|
+
# formatted_name = Google::Cloud::Monitoring::V3::NotificationChannelServiceClient.notification_channel_path("[PROJECT]", "[NOTIFICATION_CHANNEL]")
|
781
|
+
#
|
782
|
+
# # TODO: Initialize `code`:
|
783
|
+
# code = ''
|
784
|
+
# response = notification_channel_client.verify_notification_channel(formatted_name, code)
|
785
|
+
|
786
|
+
def verify_notification_channel \
|
787
|
+
name,
|
788
|
+
code,
|
789
|
+
options: nil,
|
790
|
+
&block
|
791
|
+
req = {
|
792
|
+
name: name,
|
793
|
+
code: code
|
794
|
+
}.delete_if { |_, v| v.nil? }
|
795
|
+
req = Google::Gax::to_proto(req, Google::Monitoring::V3::VerifyNotificationChannelRequest)
|
796
|
+
@verify_notification_channel.call(req, options, &block)
|
797
|
+
end
|
632
798
|
end
|
633
799
|
end
|
634
800
|
end
|
@@ -54,6 +54,21 @@
|
|
54
54
|
"timeout_millis": 30000,
|
55
55
|
"retry_codes_name": "idempotent",
|
56
56
|
"retry_params_name": "default"
|
57
|
+
},
|
58
|
+
"SendNotificationChannelVerificationCode": {
|
59
|
+
"timeout_millis": 30000,
|
60
|
+
"retry_codes_name": "non_idempotent",
|
61
|
+
"retry_params_name": "default"
|
62
|
+
},
|
63
|
+
"GetNotificationChannelVerificationCode": {
|
64
|
+
"timeout_millis": 30000,
|
65
|
+
"retry_codes_name": "idempotent",
|
66
|
+
"retry_params_name": "default"
|
67
|
+
},
|
68
|
+
"VerifyNotificationChannel": {
|
69
|
+
"timeout_millis": 30000,
|
70
|
+
"retry_codes_name": "idempotent",
|
71
|
+
"retry_params_name": "default"
|
57
72
|
}
|
58
73
|
}
|
59
74
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-monitoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
|
-
rubygems_version: 3.0.
|
199
|
+
rubygems_version: 3.0.4
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: API Client library for Stackdriver Monitoring API
|