google-cloud-monitoring-v3 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6856967b626775c695be818fccbdb736ba4d6d8f797c8e409d40bd5d8dd10ea
4
- data.tar.gz: 770b24b699b03420e570b42e7aece38e03a6546267ea96265d0eff3aeccb355d
3
+ metadata.gz: 07a0579368d28b4962f85144ea6aa7e6eed6543a3acf6c30fe51d9cf4bb1e775
4
+ data.tar.gz: 7058dc672ae6f71e6dcba9f4f62c2b9d208ae7bd46d5f7668497acb86dae561d
5
5
  SHA512:
6
- metadata.gz: ff8875b6565bffd3452d4ddd02e8435cd4bd5a6c7b91cd81acbefc327d8cd6765a07d210370d86f1bb73793eaf4aeed1bd49e519b4541db3a2ba06b2810585d3
7
- data.tar.gz: 32ba560c72fded98c223e3ea0f795b160debeef92305a9f8d5c809a62ddc7c275c4f6a5511a23775e59c0660bab8bd65e23552ca6162d3895e7cf93a16fb838d
6
+ metadata.gz: 07f87d655246c36c40d1780614c23c7cb563c6acc9a13c6db6c4ed1eb994598ca54121ee38de751cd8e5dcf535bd3961dafbddf33efd5e5bf1ce48f5e1db17dd
7
+ data.tar.gz: 23968ec10dc1fc78b10dbe07d017f69eb9dc29ba98f94213e3987a9312225b172bf4276e98f34f18169223d7f9236dd66c23329ea40d271df45f7905d70d7254
data/README.md CHANGED
@@ -6,6 +6,12 @@ Cloud Monitoring collects metrics, events, and metadata from Google Cloud, Amazo
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
9
+ This gem is a _versioned_ client. It provides basic client classes for a
10
+ specific version of the Cloud Monitoring V3 API. Most users should consider using
11
+ the main client gem,
12
+ [google-cloud-monitoring](https://rubygems.org/gems/google-cloud-monitoring).
13
+ See the section below titled *Which client should I use?* for more information.
14
+
9
15
  ## Installation
10
16
 
11
17
  ```
@@ -18,6 +24,7 @@ In order to use this library, you first need to go through the following steps:
18
24
 
19
25
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
26
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
27
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/monitoring.googleapis.com)
21
28
  1. {file:AUTHENTICATION.md Set up authentication.}
22
29
 
23
30
  ## Quick Start
@@ -33,6 +40,9 @@ response = client.list_alert_policies request
33
40
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-monitoring-v3/latest)
34
41
  for class and method documentation.
35
42
 
43
+ See also the [Product Documentation](https://cloud.google.com/monitoring)
44
+ for general usage information.
45
+
36
46
  ## Enabling Logging
37
47
 
38
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -69,3 +79,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
69
79
  and later. Older versions of Ruby _may_ still work, but are unsupported and not
70
80
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
71
81
  about the Ruby support schedule.
82
+
83
+ ## Which client should I use?
84
+
85
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
86
+ client library with a name such as `google-cloud-monitoring`,
87
+ and lower-level _versioned_ client libraries with names such as
88
+ `google-cloud-monitoring-v3`.
89
+ _In most cases, you should install the main client._
90
+
91
+ ### What's the difference between the main client and a versioned client?
92
+
93
+ A _versioned client_ provides a basic set of data types and client classes for
94
+ a _single version_ of a specific service. (That is, for a service with multiple
95
+ versions, there might be a separate versioned client for each service version.)
96
+ Most versioned clients are written and maintained by a code generator.
97
+
98
+ The _main client_ is designed to provide you with the _recommended_ client
99
+ interfaces for the service. There will be only one main client for any given
100
+ service, even a service with multiple versions. The main client includes
101
+ factory methods for constructing the client objects we recommend for most
102
+ users. In some cases, those will be classes provided by an underlying versioned
103
+ client; in other cases, they will be handwritten higher-level client objects
104
+ with additional capabilities, convenience methods, or best practices built in.
105
+ Generally, the main client will default to a recommended service version,
106
+ although in some cases you can override this if you need to talk to a specific
107
+ service version.
108
+
109
+ ### Why would I want to use the main client?
110
+
111
+ We recommend that most users install the main client gem for a service. You can
112
+ identify this gem as the one _without_ a version in its name, e.g.
113
+ `google-cloud-monitoring`.
114
+ The main client is recommended because it will embody the best practices for
115
+ accessing the service, and may also provide more convenient interfaces or
116
+ tighter integration into frameworks and third-party libraries. In addition, the
117
+ documentation and samples published by Google will generally demonstrate use of
118
+ the main client.
119
+
120
+ ### Why would I want to use a versioned client?
121
+
122
+ You can use a versioned client if you are content with a possibly lower-level
123
+ class interface, you explicitly want to avoid features provided by the main
124
+ client, or you want to access a specific service version not be covered by the
125
+ main client. You can identify versioned client gems because the service version
126
+ is part of the name, e.g. `google-cloud-monitoring-v3`.
127
+
128
+ ### What about the google-apis-<name> clients?
129
+
130
+ Client library gems with names that begin with `google-apis-` are based on an
131
+ older code generation technology. They talk to a REST/JSON backend (whereas
132
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
133
+ not offer the same performance, features, and ease of use provided by more
134
+ modern clients.
135
+
136
+ The `google-apis-` clients have wide coverage across Google services, so you
137
+ might need to use one if there is no modern client available for the service.
138
+ However, if a modern client is available, we generally recommend it over the
139
+ older `google-apis-` clients.
@@ -38,3 +38,6 @@ module Google
38
38
  end
39
39
  end
40
40
  end
41
+
42
+ helper_path = ::File.join __dir__, "v3", "_helpers.rb"
43
+ require "google/cloud/monitoring/v3/_helpers" if ::File.file? helper_path
@@ -78,7 +78,7 @@ module Google
78
78
  initial_delay: 0.1,
79
79
  max_delay: 30.0,
80
80
  multiplier: 1.3,
81
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
81
+ retry_codes: [4, 14]
82
82
  }
83
83
 
84
84
  default_config.rpcs.get_alert_policy.timeout = 30.0
@@ -86,7 +86,7 @@ module Google
86
86
  initial_delay: 0.1,
87
87
  max_delay: 30.0,
88
88
  multiplier: 1.3,
89
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
89
+ retry_codes: [4, 14]
90
90
  }
91
91
 
92
92
  default_config.rpcs.create_alert_policy.timeout = 30.0
@@ -96,7 +96,7 @@ module Google
96
96
  initial_delay: 0.1,
97
97
  max_delay: 30.0,
98
98
  multiplier: 1.3,
99
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
99
+ retry_codes: [4, 14]
100
100
  }
101
101
 
102
102
  default_config.rpcs.update_alert_policy.timeout = 30.0
@@ -162,7 +162,13 @@ module Google
162
162
 
163
163
  # Create credentials
164
164
  credentials = @config.credentials
165
- credentials ||= Credentials.default scope: @config.scope
165
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
166
+ # but only if the default endpoint does not have a region prefix.
167
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
168
+ @config.endpoint == Client.configure.endpoint &&
169
+ !@config.endpoint.split(".").first.include?("-")
170
+ credentials ||= Credentials.default scope: @config.scope,
171
+ enable_self_signed_jwt: enable_self_signed_jwt
166
172
  if credentials.is_a?(String) || credentials.is_a?(Hash)
167
173
  credentials = Credentials.new credentials, scope: @config.scope
168
174
  end
@@ -670,7 +676,7 @@ module Google
670
676
 
671
677
  config_attr :endpoint, "monitoring.googleapis.com", ::String
672
678
  config_attr :credentials, nil do |value|
673
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
679
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
674
680
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
675
681
  allowed.any? { |klass| klass === value }
676
682
  end
@@ -710,7 +716,7 @@ module Google
710
716
  # Each configuration object is of type `Gapic::Config::Method` and includes
711
717
  # the following configuration fields:
712
718
  #
713
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
719
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
714
720
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
715
721
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
716
722
  # include the following keys:
@@ -81,7 +81,7 @@ module Google
81
81
  initial_delay: 0.1,
82
82
  max_delay: 30.0,
83
83
  multiplier: 1.3,
84
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
84
+ retry_codes: [4, 14]
85
85
  }
86
86
 
87
87
  default_config.rpcs.get_group.timeout = 30.0
@@ -89,7 +89,7 @@ module Google
89
89
  initial_delay: 0.1,
90
90
  max_delay: 30.0,
91
91
  multiplier: 1.3,
92
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
92
+ retry_codes: [4, 14]
93
93
  }
94
94
 
95
95
  default_config.rpcs.create_group.timeout = 30.0
@@ -99,7 +99,7 @@ module Google
99
99
  initial_delay: 0.1,
100
100
  max_delay: 30.0,
101
101
  multiplier: 1.3,
102
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
102
+ retry_codes: [4, 14]
103
103
  }
104
104
 
105
105
  default_config.rpcs.delete_group.timeout = 30.0
@@ -107,7 +107,7 @@ module Google
107
107
  initial_delay: 0.1,
108
108
  max_delay: 30.0,
109
109
  multiplier: 1.3,
110
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
110
+ retry_codes: [4, 14]
111
111
  }
112
112
 
113
113
  default_config.rpcs.list_group_members.timeout = 30.0
@@ -115,7 +115,7 @@ module Google
115
115
  initial_delay: 0.1,
116
116
  max_delay: 30.0,
117
117
  multiplier: 1.3,
118
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
118
+ retry_codes: [4, 14]
119
119
  }
120
120
 
121
121
  default_config
@@ -179,7 +179,13 @@ module Google
179
179
 
180
180
  # Create credentials
181
181
  credentials = @config.credentials
182
- credentials ||= Credentials.default scope: @config.scope
182
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
183
+ # but only if the default endpoint does not have a region prefix.
184
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
185
+ @config.endpoint == Client.configure.endpoint &&
186
+ !@config.endpoint.split(".").first.include?("-")
187
+ credentials ||= Credentials.default scope: @config.scope,
188
+ enable_self_signed_jwt: enable_self_signed_jwt
183
189
  if credentials.is_a?(String) || credentials.is_a?(Hash)
184
190
  credentials = Credentials.new credentials, scope: @config.scope
185
191
  end
@@ -753,7 +759,7 @@ module Google
753
759
 
754
760
  config_attr :endpoint, "monitoring.googleapis.com", ::String
755
761
  config_attr :credentials, nil do |value|
756
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
762
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
757
763
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
758
764
  allowed.any? { |klass| klass === value }
759
765
  end
@@ -793,7 +799,7 @@ module Google
793
799
  # Each configuration object is of type `Gapic::Config::Method` and includes
794
800
  # the following configuration fields:
795
801
  #
796
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
802
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
797
803
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
798
804
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
799
805
  # include the following keys:
@@ -71,7 +71,7 @@ module Google
71
71
  initial_delay: 0.1,
72
72
  max_delay: 30.0,
73
73
  multiplier: 1.3,
74
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
74
+ retry_codes: [4, 14]
75
75
  }
76
76
 
77
77
  default_config.rpcs.get_monitored_resource_descriptor.timeout = 30.0
@@ -79,7 +79,7 @@ module Google
79
79
  initial_delay: 0.1,
80
80
  max_delay: 30.0,
81
81
  multiplier: 1.3,
82
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
82
+ retry_codes: [4, 14]
83
83
  }
84
84
 
85
85
  default_config.rpcs.list_metric_descriptors.timeout = 30.0
@@ -87,7 +87,7 @@ module Google
87
87
  initial_delay: 0.1,
88
88
  max_delay: 30.0,
89
89
  multiplier: 1.3,
90
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
90
+ retry_codes: [4, 14]
91
91
  }
92
92
 
93
93
  default_config.rpcs.get_metric_descriptor.timeout = 30.0
@@ -95,7 +95,7 @@ module Google
95
95
  initial_delay: 0.1,
96
96
  max_delay: 30.0,
97
97
  multiplier: 1.3,
98
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
98
+ retry_codes: [4, 14]
99
99
  }
100
100
 
101
101
  default_config.rpcs.create_metric_descriptor.timeout = 12.0
@@ -105,7 +105,7 @@ module Google
105
105
  initial_delay: 0.1,
106
106
  max_delay: 30.0,
107
107
  multiplier: 1.3,
108
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
108
+ retry_codes: [4, 14]
109
109
  }
110
110
 
111
111
  default_config.rpcs.list_time_series.timeout = 30.0
@@ -113,7 +113,7 @@ module Google
113
113
  initial_delay: 0.1,
114
114
  max_delay: 30.0,
115
115
  multiplier: 1.3,
116
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
116
+ retry_codes: [4, 14]
117
117
  }
118
118
 
119
119
  default_config.rpcs.create_time_series.timeout = 12.0
@@ -179,7 +179,13 @@ module Google
179
179
 
180
180
  # Create credentials
181
181
  credentials = @config.credentials
182
- credentials ||= Credentials.default scope: @config.scope
182
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
183
+ # but only if the default endpoint does not have a region prefix.
184
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
185
+ @config.endpoint == Client.configure.endpoint &&
186
+ !@config.endpoint.split(".").first.include?("-")
187
+ credentials ||= Credentials.default scope: @config.scope,
188
+ enable_self_signed_jwt: enable_self_signed_jwt
183
189
  if credentials.is_a?(String) || credentials.is_a?(Hash)
184
190
  credentials = Credentials.new credentials, scope: @config.scope
185
191
  end
@@ -917,7 +923,7 @@ module Google
917
923
 
918
924
  config_attr :endpoint, "monitoring.googleapis.com", ::String
919
925
  config_attr :credentials, nil do |value|
920
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
926
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
921
927
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
922
928
  allowed.any? { |klass| klass === value }
923
929
  end
@@ -957,7 +963,7 @@ module Google
957
963
  # Each configuration object is of type `Gapic::Config::Method` and includes
958
964
  # the following configuration fields:
959
965
  #
960
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
966
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
961
967
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
962
968
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
963
969
  # include the following keys:
@@ -71,7 +71,7 @@ module Google
71
71
  initial_delay: 0.1,
72
72
  max_delay: 30.0,
73
73
  multiplier: 1.3,
74
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
74
+ retry_codes: [4, 14]
75
75
  }
76
76
 
77
77
  default_config.rpcs.get_notification_channel_descriptor.timeout = 30.0
@@ -79,7 +79,7 @@ module Google
79
79
  initial_delay: 0.1,
80
80
  max_delay: 30.0,
81
81
  multiplier: 1.3,
82
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
82
+ retry_codes: [4, 14]
83
83
  }
84
84
 
85
85
  default_config.rpcs.list_notification_channels.timeout = 30.0
@@ -87,7 +87,7 @@ module Google
87
87
  initial_delay: 0.1,
88
88
  max_delay: 30.0,
89
89
  multiplier: 1.3,
90
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
90
+ retry_codes: [4, 14]
91
91
  }
92
92
 
93
93
  default_config.rpcs.get_notification_channel.timeout = 30.0
@@ -95,7 +95,7 @@ module Google
95
95
  initial_delay: 0.1,
96
96
  max_delay: 30.0,
97
97
  multiplier: 1.3,
98
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
98
+ retry_codes: [4, 14]
99
99
  }
100
100
 
101
101
  default_config.rpcs.create_notification_channel.timeout = 30.0
@@ -107,7 +107,7 @@ module Google
107
107
  initial_delay: 0.1,
108
108
  max_delay: 30.0,
109
109
  multiplier: 1.3,
110
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
110
+ retry_codes: [4, 14]
111
111
  }
112
112
 
113
113
  default_config.rpcs.send_notification_channel_verification_code.timeout = 30.0
@@ -117,7 +117,7 @@ module Google
117
117
  initial_delay: 0.1,
118
118
  max_delay: 30.0,
119
119
  multiplier: 1.3,
120
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
120
+ retry_codes: [4, 14]
121
121
  }
122
122
 
123
123
  default_config.rpcs.verify_notification_channel.timeout = 30.0
@@ -125,7 +125,7 @@ module Google
125
125
  initial_delay: 0.1,
126
126
  max_delay: 30.0,
127
127
  multiplier: 1.3,
128
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
128
+ retry_codes: [4, 14]
129
129
  }
130
130
 
131
131
  default_config
@@ -189,7 +189,13 @@ module Google
189
189
 
190
190
  # Create credentials
191
191
  credentials = @config.credentials
192
- credentials ||= Credentials.default scope: @config.scope
192
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
193
+ # but only if the default endpoint does not have a region prefix.
194
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
195
+ @config.endpoint == Client.configure.endpoint &&
196
+ !@config.endpoint.split(".").first.include?("-")
197
+ credentials ||= Credentials.default scope: @config.scope,
198
+ enable_self_signed_jwt: enable_self_signed_jwt
193
199
  if credentials.is_a?(String) || credentials.is_a?(Hash)
194
200
  credentials = Credentials.new credentials, scope: @config.scope
195
201
  end
@@ -1076,7 +1082,7 @@ module Google
1076
1082
 
1077
1083
  config_attr :endpoint, "monitoring.googleapis.com", ::String
1078
1084
  config_attr :credentials, nil do |value|
1079
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1085
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1080
1086
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1081
1087
  allowed.any? { |klass| klass === value }
1082
1088
  end
@@ -1116,7 +1122,7 @@ module Google
1116
1122
  # Each configuration object is of type `Gapic::Config::Method` and includes
1117
1123
  # the following configuration fields:
1118
1124
  #
1119
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1125
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1120
1126
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1121
1127
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1122
1128
  # include the following keys:
@@ -75,7 +75,7 @@ module Google
75
75
  initial_delay: 0.1,
76
76
  max_delay: 30.0,
77
77
  multiplier: 1.3,
78
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
78
+ retry_codes: [4, 14]
79
79
  }
80
80
 
81
81
  default_config.rpcs.list_services.timeout = 30.0
@@ -83,7 +83,7 @@ module Google
83
83
  initial_delay: 0.1,
84
84
  max_delay: 30.0,
85
85
  multiplier: 1.3,
86
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
86
+ retry_codes: [4, 14]
87
87
  }
88
88
 
89
89
  default_config.rpcs.update_service.timeout = 30.0
@@ -93,7 +93,7 @@ module Google
93
93
  initial_delay: 0.1,
94
94
  max_delay: 30.0,
95
95
  multiplier: 1.3,
96
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
96
+ retry_codes: [4, 14]
97
97
  }
98
98
 
99
99
  default_config.rpcs.create_service_level_objective.timeout = 30.0
@@ -103,7 +103,7 @@ module Google
103
103
  initial_delay: 0.1,
104
104
  max_delay: 30.0,
105
105
  multiplier: 1.3,
106
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
106
+ retry_codes: [4, 14]
107
107
  }
108
108
 
109
109
  default_config.rpcs.list_service_level_objectives.timeout = 30.0
@@ -111,7 +111,7 @@ module Google
111
111
  initial_delay: 0.1,
112
112
  max_delay: 30.0,
113
113
  multiplier: 1.3,
114
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
114
+ retry_codes: [4, 14]
115
115
  }
116
116
 
117
117
  default_config.rpcs.update_service_level_objective.timeout = 30.0
@@ -121,7 +121,7 @@ module Google
121
121
  initial_delay: 0.1,
122
122
  max_delay: 30.0,
123
123
  multiplier: 1.3,
124
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
124
+ retry_codes: [4, 14]
125
125
  }
126
126
 
127
127
  default_config
@@ -185,7 +185,13 @@ module Google
185
185
 
186
186
  # Create credentials
187
187
  credentials = @config.credentials
188
- credentials ||= Credentials.default scope: @config.scope
188
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
189
+ # but only if the default endpoint does not have a region prefix.
190
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
191
+ @config.endpoint == Client.configure.endpoint &&
192
+ !@config.endpoint.split(".").first.include?("-")
193
+ credentials ||= Credentials.default scope: @config.scope,
194
+ enable_self_signed_jwt: enable_self_signed_jwt
189
195
  if credentials.is_a?(String) || credentials.is_a?(Hash)
190
196
  credentials = Credentials.new credentials, scope: @config.scope
191
197
  end
@@ -1031,7 +1037,7 @@ module Google
1031
1037
 
1032
1038
  config_attr :endpoint, "monitoring.googleapis.com", ::String
1033
1039
  config_attr :credentials, nil do |value|
1034
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1040
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1035
1041
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1036
1042
  allowed.any? { |klass| klass === value }
1037
1043
  end
@@ -1071,7 +1077,7 @@ module Google
1071
1077
  # Each configuration object is of type `Gapic::Config::Method` and includes
1072
1078
  # the following configuration fields:
1073
1079
  #
1074
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1080
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1075
1081
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1076
1082
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1077
1083
  # include the following keys:
@@ -77,7 +77,7 @@ module Google
77
77
  initial_delay: 0.1,
78
78
  max_delay: 30.0,
79
79
  multiplier: 1.3,
80
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
80
+ retry_codes: [4, 14]
81
81
  }
82
82
 
83
83
  default_config.rpcs.get_uptime_check_config.timeout = 30.0
@@ -85,7 +85,7 @@ module Google
85
85
  initial_delay: 0.1,
86
86
  max_delay: 30.0,
87
87
  multiplier: 1.3,
88
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
88
+ retry_codes: [4, 14]
89
89
  }
90
90
 
91
91
  default_config.rpcs.create_uptime_check_config.timeout = 30.0
@@ -97,7 +97,7 @@ module Google
97
97
  initial_delay: 0.1,
98
98
  max_delay: 30.0,
99
99
  multiplier: 1.3,
100
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
100
+ retry_codes: [4, 14]
101
101
  }
102
102
 
103
103
  default_config.rpcs.list_uptime_check_ips.timeout = 30.0
@@ -105,7 +105,7 @@ module Google
105
105
  initial_delay: 0.1,
106
106
  max_delay: 30.0,
107
107
  multiplier: 1.3,
108
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
108
+ retry_codes: [4, 14]
109
109
  }
110
110
 
111
111
  default_config
@@ -169,7 +169,13 @@ module Google
169
169
 
170
170
  # Create credentials
171
171
  credentials = @config.credentials
172
- credentials ||= Credentials.default scope: @config.scope
172
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
173
+ # but only if the default endpoint does not have a region prefix.
174
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
175
+ @config.endpoint == Client.configure.endpoint &&
176
+ !@config.endpoint.split(".").first.include?("-")
177
+ credentials ||= Credentials.default scope: @config.scope,
178
+ enable_self_signed_jwt: enable_self_signed_jwt
173
179
  if credentials.is_a?(String) || credentials.is_a?(Hash)
174
180
  credentials = Credentials.new credentials, scope: @config.scope
175
181
  end
@@ -713,7 +719,7 @@ module Google
713
719
 
714
720
  config_attr :endpoint, "monitoring.googleapis.com", ::String
715
721
  config_attr :credentials, nil do |value|
716
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
722
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
717
723
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
718
724
  allowed.any? { |klass| klass === value }
719
725
  end
@@ -753,7 +759,7 @@ module Google
753
759
  # Each configuration object is of type `Gapic::Config::Method` and includes
754
760
  # the following configuration fields:
755
761
  #
756
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
762
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
757
763
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
758
764
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
759
765
  # include the following keys:
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Monitoring
23
23
  module V3
24
- VERSION = "0.1.1"
24
+ VERSION = "0.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -42,18 +42,18 @@ module Google
42
42
  self.service_name = 'google.monitoring.v3.AlertPolicyService'
43
43
 
44
44
  # Lists the existing alerting policies for the project.
45
- rpc :ListAlertPolicies, Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest, Google::Cloud::Monitoring::V3::ListAlertPoliciesResponse
45
+ rpc :ListAlertPolicies, ::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest, ::Google::Cloud::Monitoring::V3::ListAlertPoliciesResponse
46
46
  # Gets a single alerting policy.
47
- rpc :GetAlertPolicy, Google::Cloud::Monitoring::V3::GetAlertPolicyRequest, Google::Cloud::Monitoring::V3::AlertPolicy
47
+ rpc :GetAlertPolicy, ::Google::Cloud::Monitoring::V3::GetAlertPolicyRequest, ::Google::Cloud::Monitoring::V3::AlertPolicy
48
48
  # Creates a new alerting policy.
49
- rpc :CreateAlertPolicy, Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest, Google::Cloud::Monitoring::V3::AlertPolicy
49
+ rpc :CreateAlertPolicy, ::Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest, ::Google::Cloud::Monitoring::V3::AlertPolicy
50
50
  # Deletes an alerting policy.
51
- rpc :DeleteAlertPolicy, Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest, Google::Protobuf::Empty
51
+ rpc :DeleteAlertPolicy, ::Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest, ::Google::Protobuf::Empty
52
52
  # Updates an alerting policy. You can either replace the entire policy with
53
53
  # a new one or replace only certain fields in the current alerting policy by
54
54
  # specifying the fields to be updated via `updateMask`. Returns the
55
55
  # updated alerting policy.
56
- rpc :UpdateAlertPolicy, Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest, Google::Cloud::Monitoring::V3::AlertPolicy
56
+ rpc :UpdateAlertPolicy, ::Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest, ::Google::Cloud::Monitoring::V3::AlertPolicy
57
57
  end
58
58
 
59
59
  Stub = Service.rpc_stub_class
@@ -45,18 +45,18 @@ module Google
45
45
  self.service_name = 'google.monitoring.v3.GroupService'
46
46
 
47
47
  # Lists the existing groups.
48
- rpc :ListGroups, Google::Cloud::Monitoring::V3::ListGroupsRequest, Google::Cloud::Monitoring::V3::ListGroupsResponse
48
+ rpc :ListGroups, ::Google::Cloud::Monitoring::V3::ListGroupsRequest, ::Google::Cloud::Monitoring::V3::ListGroupsResponse
49
49
  # Gets a single group.
50
- rpc :GetGroup, Google::Cloud::Monitoring::V3::GetGroupRequest, Google::Cloud::Monitoring::V3::Group
50
+ rpc :GetGroup, ::Google::Cloud::Monitoring::V3::GetGroupRequest, ::Google::Cloud::Monitoring::V3::Group
51
51
  # Creates a new group.
52
- rpc :CreateGroup, Google::Cloud::Monitoring::V3::CreateGroupRequest, Google::Cloud::Monitoring::V3::Group
52
+ rpc :CreateGroup, ::Google::Cloud::Monitoring::V3::CreateGroupRequest, ::Google::Cloud::Monitoring::V3::Group
53
53
  # Updates an existing group.
54
54
  # You can change any group attributes except `name`.
55
- rpc :UpdateGroup, Google::Cloud::Monitoring::V3::UpdateGroupRequest, Google::Cloud::Monitoring::V3::Group
55
+ rpc :UpdateGroup, ::Google::Cloud::Monitoring::V3::UpdateGroupRequest, ::Google::Cloud::Monitoring::V3::Group
56
56
  # Deletes an existing group.
57
- rpc :DeleteGroup, Google::Cloud::Monitoring::V3::DeleteGroupRequest, Google::Protobuf::Empty
57
+ rpc :DeleteGroup, ::Google::Cloud::Monitoring::V3::DeleteGroupRequest, ::Google::Protobuf::Empty
58
58
  # Lists the monitored resources that are members of a group.
59
- rpc :ListGroupMembers, Google::Cloud::Monitoring::V3::ListGroupMembersRequest, Google::Cloud::Monitoring::V3::ListGroupMembersResponse
59
+ rpc :ListGroupMembers, ::Google::Cloud::Monitoring::V3::ListGroupMembersRequest, ::Google::Cloud::Monitoring::V3::ListGroupMembersResponse
60
60
  end
61
61
 
62
62
  Stub = Service.rpc_stub_class
@@ -35,28 +35,28 @@ module Google
35
35
  self.service_name = 'google.monitoring.v3.MetricService'
36
36
 
37
37
  # Lists monitored resource descriptors that match a filter. This method does not require a Workspace.
38
- rpc :ListMonitoredResourceDescriptors, Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest, Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsResponse
38
+ rpc :ListMonitoredResourceDescriptors, ::Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest, ::Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsResponse
39
39
  # Gets a single monitored resource descriptor. This method does not require a Workspace.
40
- rpc :GetMonitoredResourceDescriptor, Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest, Google::Api::MonitoredResourceDescriptor
40
+ rpc :GetMonitoredResourceDescriptor, ::Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest, ::Google::Api::MonitoredResourceDescriptor
41
41
  # Lists metric descriptors that match a filter. This method does not require a Workspace.
42
- rpc :ListMetricDescriptors, Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest, Google::Cloud::Monitoring::V3::ListMetricDescriptorsResponse
42
+ rpc :ListMetricDescriptors, ::Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest, ::Google::Cloud::Monitoring::V3::ListMetricDescriptorsResponse
43
43
  # Gets a single metric descriptor. This method does not require a Workspace.
44
- rpc :GetMetricDescriptor, Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest, Google::Api::MetricDescriptor
44
+ rpc :GetMetricDescriptor, ::Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest, ::Google::Api::MetricDescriptor
45
45
  # Creates a new metric descriptor.
46
46
  # User-created metric descriptors define
47
47
  # [custom metrics](https://cloud.google.com/monitoring/custom-metrics).
48
- rpc :CreateMetricDescriptor, Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest, Google::Api::MetricDescriptor
48
+ rpc :CreateMetricDescriptor, ::Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest, ::Google::Api::MetricDescriptor
49
49
  # Deletes a metric descriptor. Only user-created
50
50
  # [custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be
51
51
  # deleted.
52
- rpc :DeleteMetricDescriptor, Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest, Google::Protobuf::Empty
52
+ rpc :DeleteMetricDescriptor, ::Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest, ::Google::Protobuf::Empty
53
53
  # Lists time series that match a filter. This method does not require a Workspace.
54
- rpc :ListTimeSeries, Google::Cloud::Monitoring::V3::ListTimeSeriesRequest, Google::Cloud::Monitoring::V3::ListTimeSeriesResponse
54
+ rpc :ListTimeSeries, ::Google::Cloud::Monitoring::V3::ListTimeSeriesRequest, ::Google::Cloud::Monitoring::V3::ListTimeSeriesResponse
55
55
  # Creates or adds data to one or more time series.
56
56
  # The response is empty if all time series in the request were written.
57
57
  # If any time series could not be written, a corresponding failure message is
58
58
  # included in the error response.
59
- rpc :CreateTimeSeries, Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest, Google::Protobuf::Empty
59
+ rpc :CreateTimeSeries, ::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest, ::Google::Protobuf::Empty
60
60
  end
61
61
 
62
62
  Stub = Service.rpc_stub_class
@@ -36,29 +36,29 @@ module Google
36
36
 
37
37
  # Lists the descriptors for supported channel types. The use of descriptors
38
38
  # makes it possible for new channel types to be dynamically added.
39
- rpc :ListNotificationChannelDescriptors, Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest, Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsResponse
39
+ rpc :ListNotificationChannelDescriptors, ::Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest, ::Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsResponse
40
40
  # Gets a single channel descriptor. The descriptor indicates which fields
41
41
  # are expected / permitted for a notification channel of the given type.
42
- rpc :GetNotificationChannelDescriptor, Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest, Google::Cloud::Monitoring::V3::NotificationChannelDescriptor
42
+ rpc :GetNotificationChannelDescriptor, ::Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest, ::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor
43
43
  # Lists the notification channels that have been created for the project.
44
- rpc :ListNotificationChannels, Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest, Google::Cloud::Monitoring::V3::ListNotificationChannelsResponse
44
+ rpc :ListNotificationChannels, ::Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest, ::Google::Cloud::Monitoring::V3::ListNotificationChannelsResponse
45
45
  # Gets a single notification channel. The channel includes the relevant
46
46
  # configuration details with which the channel was created. However, the
47
47
  # response may truncate or omit passwords, API keys, or other private key
48
48
  # matter and thus the response may not be 100% identical to the information
49
49
  # that was supplied in the call to the create method.
50
- rpc :GetNotificationChannel, Google::Cloud::Monitoring::V3::GetNotificationChannelRequest, Google::Cloud::Monitoring::V3::NotificationChannel
50
+ rpc :GetNotificationChannel, ::Google::Cloud::Monitoring::V3::GetNotificationChannelRequest, ::Google::Cloud::Monitoring::V3::NotificationChannel
51
51
  # Creates a new notification channel, representing a single notification
52
52
  # endpoint such as an email address, SMS number, or PagerDuty service.
53
- rpc :CreateNotificationChannel, Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest, Google::Cloud::Monitoring::V3::NotificationChannel
53
+ rpc :CreateNotificationChannel, ::Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest, ::Google::Cloud::Monitoring::V3::NotificationChannel
54
54
  # Updates a notification channel. Fields not specified in the field mask
55
55
  # remain unchanged.
56
- rpc :UpdateNotificationChannel, Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest, Google::Cloud::Monitoring::V3::NotificationChannel
56
+ rpc :UpdateNotificationChannel, ::Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest, ::Google::Cloud::Monitoring::V3::NotificationChannel
57
57
  # Deletes a notification channel.
58
- rpc :DeleteNotificationChannel, Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest, Google::Protobuf::Empty
58
+ rpc :DeleteNotificationChannel, ::Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest, ::Google::Protobuf::Empty
59
59
  # Causes a verification code to be delivered to the channel. The code
60
60
  # can then be supplied in `VerifyNotificationChannel` to verify the channel.
61
- rpc :SendNotificationChannelVerificationCode, Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest, Google::Protobuf::Empty
61
+ rpc :SendNotificationChannelVerificationCode, ::Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest, ::Google::Protobuf::Empty
62
62
  # Requests a verification code for an already verified channel that can then
63
63
  # be used in a call to VerifyNotificationChannel() on a different channel
64
64
  # with an equivalent identity in the same or in a different project. This
@@ -80,11 +80,11 @@ module Google
80
80
  # have a shorter expiration (e.g. codes such as "G-123456") whereas
81
81
  # GetVerificationCode() will typically return a much longer, websafe base
82
82
  # 64 encoded string that has a longer expiration time.
83
- rpc :GetNotificationChannelVerificationCode, Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest, Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse
83
+ rpc :GetNotificationChannelVerificationCode, ::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest, ::Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse
84
84
  # Verifies a `NotificationChannel` by proving receipt of the code
85
85
  # delivered to the channel as a result of calling
86
86
  # `SendNotificationChannelVerificationCode`.
87
- rpc :VerifyNotificationChannel, Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest, Google::Cloud::Monitoring::V3::NotificationChannel
87
+ rpc :VerifyNotificationChannel, ::Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest, ::Google::Cloud::Monitoring::V3::NotificationChannel
88
88
  end
89
89
 
90
90
  Stub = Service.rpc_stub_class
@@ -37,25 +37,25 @@ module Google
37
37
  self.service_name = 'google.monitoring.v3.ServiceMonitoringService'
38
38
 
39
39
  # Create a `Service`.
40
- rpc :CreateService, Google::Cloud::Monitoring::V3::CreateServiceRequest, Google::Cloud::Monitoring::V3::Service
40
+ rpc :CreateService, ::Google::Cloud::Monitoring::V3::CreateServiceRequest, ::Google::Cloud::Monitoring::V3::Service
41
41
  # Get the named `Service`.
42
- rpc :GetService, Google::Cloud::Monitoring::V3::GetServiceRequest, Google::Cloud::Monitoring::V3::Service
42
+ rpc :GetService, ::Google::Cloud::Monitoring::V3::GetServiceRequest, ::Google::Cloud::Monitoring::V3::Service
43
43
  # List `Service`s for this workspace.
44
- rpc :ListServices, Google::Cloud::Monitoring::V3::ListServicesRequest, Google::Cloud::Monitoring::V3::ListServicesResponse
44
+ rpc :ListServices, ::Google::Cloud::Monitoring::V3::ListServicesRequest, ::Google::Cloud::Monitoring::V3::ListServicesResponse
45
45
  # Update this `Service`.
46
- rpc :UpdateService, Google::Cloud::Monitoring::V3::UpdateServiceRequest, Google::Cloud::Monitoring::V3::Service
46
+ rpc :UpdateService, ::Google::Cloud::Monitoring::V3::UpdateServiceRequest, ::Google::Cloud::Monitoring::V3::Service
47
47
  # Soft delete this `Service`.
48
- rpc :DeleteService, Google::Cloud::Monitoring::V3::DeleteServiceRequest, Google::Protobuf::Empty
48
+ rpc :DeleteService, ::Google::Cloud::Monitoring::V3::DeleteServiceRequest, ::Google::Protobuf::Empty
49
49
  # Create a `ServiceLevelObjective` for the given `Service`.
50
- rpc :CreateServiceLevelObjective, Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest, Google::Cloud::Monitoring::V3::ServiceLevelObjective
50
+ rpc :CreateServiceLevelObjective, ::Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest, ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
51
51
  # Get a `ServiceLevelObjective` by name.
52
- rpc :GetServiceLevelObjective, Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest, Google::Cloud::Monitoring::V3::ServiceLevelObjective
52
+ rpc :GetServiceLevelObjective, ::Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest, ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
53
53
  # List the `ServiceLevelObjective`s for the given `Service`.
54
- rpc :ListServiceLevelObjectives, Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest, Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesResponse
54
+ rpc :ListServiceLevelObjectives, ::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest, ::Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesResponse
55
55
  # Update the given `ServiceLevelObjective`.
56
- rpc :UpdateServiceLevelObjective, Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest, Google::Cloud::Monitoring::V3::ServiceLevelObjective
56
+ rpc :UpdateServiceLevelObjective, ::Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest, ::Google::Cloud::Monitoring::V3::ServiceLevelObjective
57
57
  # Delete the given `ServiceLevelObjective`.
58
- rpc :DeleteServiceLevelObjective, Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest, Google::Protobuf::Empty
58
+ rpc :DeleteServiceLevelObjective, ::Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest, ::Google::Protobuf::Empty
59
59
  end
60
60
 
61
61
  Stub = Service.rpc_stub_class
@@ -42,22 +42,22 @@ module Google
42
42
 
43
43
  # Lists the existing valid Uptime check configurations for the project
44
44
  # (leaving out any invalid configurations).
45
- rpc :ListUptimeCheckConfigs, Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest, Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsResponse
45
+ rpc :ListUptimeCheckConfigs, ::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest, ::Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsResponse
46
46
  # Gets a single Uptime check configuration.
47
- rpc :GetUptimeCheckConfig, Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest, Google::Cloud::Monitoring::V3::UptimeCheckConfig
47
+ rpc :GetUptimeCheckConfig, ::Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest, ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
48
48
  # Creates a new Uptime check configuration.
49
- rpc :CreateUptimeCheckConfig, Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest, Google::Cloud::Monitoring::V3::UptimeCheckConfig
49
+ rpc :CreateUptimeCheckConfig, ::Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest, ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
50
50
  # Updates an Uptime check configuration. You can either replace the entire
51
51
  # configuration with a new one or replace only certain fields in the current
52
52
  # configuration by specifying the fields to be updated via `updateMask`.
53
53
  # Returns the updated configuration.
54
- rpc :UpdateUptimeCheckConfig, Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest, Google::Cloud::Monitoring::V3::UptimeCheckConfig
54
+ rpc :UpdateUptimeCheckConfig, ::Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest, ::Google::Cloud::Monitoring::V3::UptimeCheckConfig
55
55
  # Deletes an Uptime check configuration. Note that this method will fail
56
56
  # if the Uptime check configuration is referenced by an alert policy or
57
57
  # other dependent configs that would be rendered invalid by the deletion.
58
- rpc :DeleteUptimeCheckConfig, Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest, Google::Protobuf::Empty
58
+ rpc :DeleteUptimeCheckConfig, ::Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest, ::Google::Protobuf::Empty
59
59
  # Returns the list of IP addresses that checkers run from
60
- rpc :ListUptimeCheckIps, Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest, Google::Cloud::Monitoring::V3::ListUptimeCheckIpsResponse
60
+ rpc :ListUptimeCheckIps, ::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest, ::Google::Cloud::Monitoring::V3::ListUptimeCheckIpsResponse
61
61
  end
62
62
 
63
63
  Stub = Service.rpc_stub_class
@@ -54,6 +54,12 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
57
63
  end
58
64
  end
59
65
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -57,10 +57,13 @@ module Google
57
57
  # Example 4: Pack and unpack a message in Go
58
58
  #
59
59
  # foo := &pb.Foo{...}
60
- # any, err := ptypes.MarshalAny(foo)
60
+ # any, err := anypb.New(foo)
61
+ # if err != nil {
62
+ # ...
63
+ # }
61
64
  # ...
62
65
  # foo := &pb.Foo{}
63
- # if err := ptypes.UnmarshalAny(any, foo); err != nil {
66
+ # if err := any.UnmarshalTo(foo); err != nil {
64
67
  # ...
65
68
  # }
66
69
  #
@@ -70,7 +70,16 @@ module Google
70
70
  # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
71
  #
72
72
  #
73
- # Example 5: Compute Timestamp from current time in Python.
73
+ # Example 5: Compute Timestamp from Java `Instant.now()`.
74
+ #
75
+ # Instant now = Instant.now();
76
+ #
77
+ # Timestamp timestamp =
78
+ # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
+ # .setNanos(now.getNano()).build();
80
+ #
81
+ #
82
+ # Example 6: Compute Timestamp from current time in Python.
74
83
  #
75
84
  # timestamp = Timestamp()
76
85
  # timestamp.GetCurrentTime()
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-monitoring-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.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: 2020-06-08 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -152,6 +152,9 @@ dependencies:
152
152
  version: '0.9'
153
153
  description: Cloud Monitoring collects metrics, events, and metadata from Google Cloud,
154
154
  Amazon Web Services (AWS), hosted uptime probes, and application instrumentation.
155
+ Note that google-cloud-monitoring-v3 is a version-specific client library. For most
156
+ uses, we recommend installing the main client library google-cloud-monitoring instead.
157
+ See the readme for more details.
155
158
  email: googleapis-packages@google.com
156
159
  executables: []
157
160
  extensions: []
@@ -262,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
265
  - !ruby/object:Gem::Version
263
266
  version: '0'
264
267
  requirements: []
265
- rubygems_version: 3.1.3
268
+ rubygems_version: 3.2.6
266
269
  signing_key:
267
270
  specification_version: 4
268
271
  summary: API Client library for the Cloud Monitoring V3 API