google-api-client 0.9.8 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  4. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +76 -1
  5. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +22 -0
  6. data/generated/google/apis/adsense_v1_4.rb +1 -1
  7. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  8. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  9. data/generated/google/apis/analyticsreporting_v4/classes.rb +32 -14
  10. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  11. data/generated/google/apis/androidenterprise_v1/classes.rb +1 -1
  12. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  13. data/generated/google/apis/appstate_v1.rb +1 -1
  14. data/generated/google/apis/bigquery_v2.rb +1 -1
  15. data/generated/google/apis/bigquery_v2/classes.rb +10 -0
  16. data/generated/google/apis/bigquery_v2/representations.rb +1 -0
  17. data/generated/google/apis/calendar_v3.rb +1 -1
  18. data/generated/google/apis/clouddebugger_v2.rb +1 -1
  19. data/generated/google/apis/clouddebugger_v2/service.rb +2 -2
  20. data/generated/google/apis/compute_beta.rb +1 -1
  21. data/generated/google/apis/compute_beta/classes.rb +28 -5
  22. data/generated/google/apis/compute_beta/representations.rb +3 -0
  23. data/generated/google/apis/compute_beta/service.rb +1 -2
  24. data/generated/google/apis/compute_v1.rb +1 -1
  25. data/generated/google/apis/compute_v1/classes.rb +680 -4
  26. data/generated/google/apis/compute_v1/representations.rb +274 -0
  27. data/generated/google/apis/compute_v1/service.rb +442 -2
  28. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  29. data/generated/google/apis/dns_v1.rb +1 -1
  30. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  31. data/generated/google/apis/drive_v2.rb +1 -1
  32. data/generated/google/apis/drive_v2/classes.rb +6 -0
  33. data/generated/google/apis/drive_v2/representations.rb +2 -0
  34. data/generated/google/apis/drive_v2/service.rb +8 -2
  35. data/generated/google/apis/drive_v3.rb +1 -1
  36. data/generated/google/apis/drive_v3/classes.rb +6 -0
  37. data/generated/google/apis/drive_v3/representations.rb +2 -0
  38. data/generated/google/apis/drive_v3/service.rb +4 -1
  39. data/generated/google/apis/fusiontables_v2.rb +1 -1
  40. data/generated/google/apis/fusiontables_v2/classes.rb +4 -3
  41. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  42. data/generated/google/apis/games_management_v1management.rb +1 -1
  43. data/generated/google/apis/games_v1.rb +1 -1
  44. data/generated/google/apis/genomics_v1.rb +1 -1
  45. data/generated/google/apis/genomics_v1/classes.rb +63 -0
  46. data/generated/google/apis/genomics_v1/representations.rb +31 -0
  47. data/generated/google/apis/gmail_v1.rb +1 -1
  48. data/generated/google/apis/groupssettings_v1.rb +1 -1
  49. data/generated/google/apis/groupssettings_v1/classes.rb +12 -0
  50. data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
  51. data/generated/google/apis/identitytoolkit_v3.rb +1 -1
  52. data/generated/google/apis/identitytoolkit_v3/classes.rb +30 -0
  53. data/generated/google/apis/identitytoolkit_v3/representations.rb +5 -0
  54. data/generated/google/apis/monitoring_v3.rb +45 -0
  55. data/generated/google/apis/monitoring_v3/classes.rb +1404 -0
  56. data/generated/google/apis/monitoring_v3/representations.rb +533 -0
  57. data/generated/google/apis/monitoring_v3/service.rb +743 -0
  58. data/generated/google/apis/oauth2_v2.rb +1 -1
  59. data/generated/google/apis/plus_domains_v1.rb +1 -1
  60. data/generated/google/apis/plus_v1.rb +1 -1
  61. data/generated/google/apis/sheets_v4.rb +1 -1
  62. data/generated/google/apis/vision_v1.rb +1 -1
  63. data/generated/google/apis/vision_v1/classes.rb +10 -9
  64. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  65. data/generated/google/apis/youtube_v3.rb +1 -1
  66. data/generated/google/apis/youtube_v3/classes.rb +155 -0
  67. data/generated/google/apis/youtube_v3/representations.rb +81 -0
  68. data/generated/google/apis/youtube_v3/service.rb +6 -2
  69. data/lib/google/apis/errors.rb +2 -2
  70. data/lib/google/apis/version.rb +1 -1
  71. data/samples/cli/lib/samples/bigquery.rb +101 -0
  72. data/samples/cli/lib/samples/sheets.rb +61 -0
  73. metadata +8 -2
@@ -0,0 +1,743 @@
1
+ # Copyright 2015 Google Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module MonitoringV3
23
+ # Google Monitoring API
24
+ #
25
+ # Manages your Stackdriver Monitoring data and configurations. Most projects
26
+ # must be associated with a Stackdriver account, with a few exceptions as noted
27
+ # on the individual method pages.
28
+ #
29
+ # @example
30
+ # require 'google/apis/monitoring_v3'
31
+ #
32
+ # Monitoring = Google::Apis::MonitoringV3 # Alias the module
33
+ # service = Monitoring::MonitoringService.new
34
+ #
35
+ # @see https://cloud.google.com/monitoring/api/
36
+ class MonitoringService < Google::Apis::Core::BaseService
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super('https://monitoring.googleapis.com/', '')
49
+ end
50
+
51
+ # **Stackdriver Monitoring Agent only:** Creates a new time series.
52
+ # <aside class="caution">This method is only for use by the Google Monitoring
53
+ # Agent.
54
+ # Use projects.timeSeries.create
55
+ # instead.</aside>
56
+ # @param [String] name
57
+ # The project in which to create the time series. The format is
58
+ # `"projects/PROJECT_ID_OR_NUMBER"`.
59
+ # @param [Google::Apis::MonitoringV3::CreateCollectdTimeSeriesRequest] create_collectd_time_series_request_object
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [Google::Apis::RequestOptions] options
66
+ # Request-specific options
67
+ #
68
+ # @yield [result, err] Result & error if block supplied
69
+ # @yieldparam result [Google::Apis::MonitoringV3::Empty] parsed result object
70
+ # @yieldparam err [StandardError] error object if request failed
71
+ #
72
+ # @return [Google::Apis::MonitoringV3::Empty]
73
+ #
74
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
75
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
76
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
77
+ def create_collectd_time_series(name, create_collectd_time_series_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
78
+ command = make_simple_command(:post, 'v3/{+name}/collectdTimeSeries', options)
79
+ command.request_representation = Google::Apis::MonitoringV3::CreateCollectdTimeSeriesRequest::Representation
80
+ command.request_object = create_collectd_time_series_request_object
81
+ command.response_representation = Google::Apis::MonitoringV3::Empty::Representation
82
+ command.response_class = Google::Apis::MonitoringV3::Empty
83
+ command.params['name'] = name unless name.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ command.query['fields'] = fields unless fields.nil?
86
+ execute_or_queue_command(command, &block)
87
+ end
88
+
89
+ # Updates an existing group.
90
+ # You can change any group attributes except `name`.
91
+ # @param [String] name
92
+ # The name of this group.
93
+ # The format is
94
+ # `"projects/`project_id_or_number`/groups/`group_id`"`.
95
+ # When creating a group, this field is ignored and a new name is created
96
+ # consisting of the project specified in the call to `CreateGroup`
97
+ # and a unique ``group_id`` that is generated automatically.
98
+ # @OutputOnly
99
+ # @param [Google::Apis::MonitoringV3::Group] group_object
100
+ # @param [Boolean] validate_only
101
+ # If true, validate this request but do not update the existing group.
102
+ # @param [String] quota_user
103
+ # Available to use for quota purposes for server-side applications. Can be any
104
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
105
+ # @param [String] fields
106
+ # Selector specifying which fields to include in a partial response.
107
+ # @param [Google::Apis::RequestOptions] options
108
+ # Request-specific options
109
+ #
110
+ # @yield [result, err] Result & error if block supplied
111
+ # @yieldparam result [Google::Apis::MonitoringV3::Group] parsed result object
112
+ # @yieldparam err [StandardError] error object if request failed
113
+ #
114
+ # @return [Google::Apis::MonitoringV3::Group]
115
+ #
116
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
117
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
118
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
119
+ def update_project_group(name, group_object = nil, validate_only: nil, quota_user: nil, fields: nil, options: nil, &block)
120
+ command = make_simple_command(:put, 'v3/{+name}', options)
121
+ command.request_representation = Google::Apis::MonitoringV3::Group::Representation
122
+ command.request_object = group_object
123
+ command.response_representation = Google::Apis::MonitoringV3::Group::Representation
124
+ command.response_class = Google::Apis::MonitoringV3::Group
125
+ command.params['name'] = name unless name.nil?
126
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
127
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
128
+ command.query['fields'] = fields unless fields.nil?
129
+ execute_or_queue_command(command, &block)
130
+ end
131
+
132
+ # Gets a single group.
133
+ # @param [String] name
134
+ # The group to retrieve. The format is
135
+ # `"projects/`project_id_or_number`/groups/`group_id`"`.
136
+ # @param [String] quota_user
137
+ # Available to use for quota purposes for server-side applications. Can be any
138
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [Google::Apis::RequestOptions] options
142
+ # Request-specific options
143
+ #
144
+ # @yield [result, err] Result & error if block supplied
145
+ # @yieldparam result [Google::Apis::MonitoringV3::Group] parsed result object
146
+ # @yieldparam err [StandardError] error object if request failed
147
+ #
148
+ # @return [Google::Apis::MonitoringV3::Group]
149
+ #
150
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
151
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
152
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
153
+ def get_project_group(name, quota_user: nil, fields: nil, options: nil, &block)
154
+ command = make_simple_command(:get, 'v3/{+name}', options)
155
+ command.response_representation = Google::Apis::MonitoringV3::Group::Representation
156
+ command.response_class = Google::Apis::MonitoringV3::Group
157
+ command.params['name'] = name unless name.nil?
158
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
159
+ command.query['fields'] = fields unless fields.nil?
160
+ execute_or_queue_command(command, &block)
161
+ end
162
+
163
+ # Creates a new group.
164
+ # @param [String] name
165
+ # The project in which to create the group. The format is
166
+ # `"projects/`project_id_or_number`"`.
167
+ # @param [Google::Apis::MonitoringV3::Group] group_object
168
+ # @param [Boolean] validate_only
169
+ # If true, validate this request but do not create the group.
170
+ # @param [String] quota_user
171
+ # Available to use for quota purposes for server-side applications. Can be any
172
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [Google::Apis::RequestOptions] options
176
+ # Request-specific options
177
+ #
178
+ # @yield [result, err] Result & error if block supplied
179
+ # @yieldparam result [Google::Apis::MonitoringV3::Group] parsed result object
180
+ # @yieldparam err [StandardError] error object if request failed
181
+ #
182
+ # @return [Google::Apis::MonitoringV3::Group]
183
+ #
184
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
185
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
186
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
187
+ def create_project_group(name, group_object = nil, validate_only: nil, quota_user: nil, fields: nil, options: nil, &block)
188
+ command = make_simple_command(:post, 'v3/{+name}/groups', options)
189
+ command.request_representation = Google::Apis::MonitoringV3::Group::Representation
190
+ command.request_object = group_object
191
+ command.response_representation = Google::Apis::MonitoringV3::Group::Representation
192
+ command.response_class = Google::Apis::MonitoringV3::Group
193
+ command.params['name'] = name unless name.nil?
194
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
195
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
196
+ command.query['fields'] = fields unless fields.nil?
197
+ execute_or_queue_command(command, &block)
198
+ end
199
+
200
+ # Lists the existing groups.
201
+ # @param [String] name
202
+ # The project whose groups are to be listed. The format is
203
+ # `"projects/`project_id_or_number`"`.
204
+ # @param [String] descendants_of_group
205
+ # A group name: `"projects/`project_id_or_number`/groups/`group_id`"`.
206
+ # Returns the descendants of the specified group. This is a superset of
207
+ # the results returned by the `childrenOfGroup` filter, and includes
208
+ # children-of-children, and so forth.
209
+ # @param [Fixnum] page_size
210
+ # A positive number that is the maximum number of results to return.
211
+ # @param [String] children_of_group
212
+ # A group name: `"projects/`project_id_or_number`/groups/`group_id`"`.
213
+ # Returns groups whose `parentName` field contains the group
214
+ # name. If no groups have this parent, the results are empty.
215
+ # @param [String] ancestors_of_group
216
+ # A group name: `"projects/`project_id_or_number`/groups/`group_id`"`.
217
+ # Returns groups that are ancestors of the specified group.
218
+ # The groups are returned in order, starting with the immediate parent and
219
+ # ending with the most distant ancestor. If the specified group has no
220
+ # immediate parent, the results are empty.
221
+ # @param [String] page_token
222
+ # If this field is not empty then it must contain the `nextPageToken` value
223
+ # returned by a previous call to this method. Using this field causes the
224
+ # method to return additional results from the previous method call.
225
+ # @param [String] quota_user
226
+ # Available to use for quota purposes for server-side applications. Can be any
227
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
228
+ # @param [String] fields
229
+ # Selector specifying which fields to include in a partial response.
230
+ # @param [Google::Apis::RequestOptions] options
231
+ # Request-specific options
232
+ #
233
+ # @yield [result, err] Result & error if block supplied
234
+ # @yieldparam result [Google::Apis::MonitoringV3::ListGroupsResponse] parsed result object
235
+ # @yieldparam err [StandardError] error object if request failed
236
+ #
237
+ # @return [Google::Apis::MonitoringV3::ListGroupsResponse]
238
+ #
239
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
240
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
241
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
242
+ def list_project_groups(name, descendants_of_group: nil, page_size: nil, children_of_group: nil, ancestors_of_group: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
243
+ command = make_simple_command(:get, 'v3/{+name}/groups', options)
244
+ command.response_representation = Google::Apis::MonitoringV3::ListGroupsResponse::Representation
245
+ command.response_class = Google::Apis::MonitoringV3::ListGroupsResponse
246
+ command.params['name'] = name unless name.nil?
247
+ command.query['descendantsOfGroup'] = descendants_of_group unless descendants_of_group.nil?
248
+ command.query['pageSize'] = page_size unless page_size.nil?
249
+ command.query['childrenOfGroup'] = children_of_group unless children_of_group.nil?
250
+ command.query['ancestorsOfGroup'] = ancestors_of_group unless ancestors_of_group.nil?
251
+ command.query['pageToken'] = page_token unless page_token.nil?
252
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
253
+ command.query['fields'] = fields unless fields.nil?
254
+ execute_or_queue_command(command, &block)
255
+ end
256
+
257
+ # Deletes an existing group.
258
+ # @param [String] name
259
+ # The group to delete. The format is
260
+ # `"projects/`project_id_or_number`/groups/`group_id`"`.
261
+ # @param [String] quota_user
262
+ # Available to use for quota purposes for server-side applications. Can be any
263
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
264
+ # @param [String] fields
265
+ # Selector specifying which fields to include in a partial response.
266
+ # @param [Google::Apis::RequestOptions] options
267
+ # Request-specific options
268
+ #
269
+ # @yield [result, err] Result & error if block supplied
270
+ # @yieldparam result [Google::Apis::MonitoringV3::Empty] parsed result object
271
+ # @yieldparam err [StandardError] error object if request failed
272
+ #
273
+ # @return [Google::Apis::MonitoringV3::Empty]
274
+ #
275
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
276
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
277
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
278
+ def delete_project_group(name, quota_user: nil, fields: nil, options: nil, &block)
279
+ command = make_simple_command(:delete, 'v3/{+name}', options)
280
+ command.response_representation = Google::Apis::MonitoringV3::Empty::Representation
281
+ command.response_class = Google::Apis::MonitoringV3::Empty
282
+ command.params['name'] = name unless name.nil?
283
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
284
+ command.query['fields'] = fields unless fields.nil?
285
+ execute_or_queue_command(command, &block)
286
+ end
287
+
288
+ # Lists the monitored resources that are members of a group.
289
+ # @param [String] name
290
+ # The group whose members are listed. The format is
291
+ # `"projects/`project_id_or_number`/groups/`group_id`"`.
292
+ # @param [String] filter
293
+ # An optional [list filter](/monitoring/api/learn_more#filtering) describing
294
+ # the members to be returned. The filter may reference the type, labels, and
295
+ # metadata of monitored resources that comprise the group.
296
+ # For example, to return only resources representing Compute Engine VM
297
+ # instances, use this filter:
298
+ # resource.type = "gce_instance"
299
+ # @param [String] interval_end_time
300
+ # Required. The end of the interval. The interval includes this
301
+ # time.
302
+ # @param [String] interval_start_time
303
+ # If this value is omitted, the interval is a point in time,
304
+ # `endTime`. If `startTime` is present, it must be earlier than
305
+ # (less than) `endTime`. The interval begins after
306
+ # `startTime`&mdash;it does not include `startTime`.
307
+ # @param [Fixnum] page_size
308
+ # A positive number that is the maximum number of results to return.
309
+ # @param [String] page_token
310
+ # If this field is not empty then it must contain the `nextPageToken` value
311
+ # returned by a previous call to this method. Using this field causes the
312
+ # method to return additional results from the previous method call.
313
+ # @param [String] quota_user
314
+ # Available to use for quota purposes for server-side applications. Can be any
315
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
316
+ # @param [String] fields
317
+ # Selector specifying which fields to include in a partial response.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::MonitoringV3::ListGroupMembersResponse] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::MonitoringV3::ListGroupMembersResponse]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ def list_project_group_members(name, filter: nil, interval_end_time: nil, interval_start_time: nil, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
331
+ command = make_simple_command(:get, 'v3/{+name}/members', options)
332
+ command.response_representation = Google::Apis::MonitoringV3::ListGroupMembersResponse::Representation
333
+ command.response_class = Google::Apis::MonitoringV3::ListGroupMembersResponse
334
+ command.params['name'] = name unless name.nil?
335
+ command.query['filter'] = filter unless filter.nil?
336
+ command.query['interval.endTime'] = interval_end_time unless interval_end_time.nil?
337
+ command.query['interval.startTime'] = interval_start_time unless interval_start_time.nil?
338
+ command.query['pageSize'] = page_size unless page_size.nil?
339
+ command.query['pageToken'] = page_token unless page_token.nil?
340
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
341
+ command.query['fields'] = fields unless fields.nil?
342
+ execute_or_queue_command(command, &block)
343
+ end
344
+
345
+ # Gets a single metric descriptor. This method does not require a Stackdriver
346
+ # account.
347
+ # @param [String] name
348
+ # The metric descriptor on which to execute the request. The format is
349
+ # `"projects/`project_id_or_number`/metricDescriptors/`metric_id`"`.
350
+ # An example value of ``metric_id`` is
351
+ # `"compute.googleapis.com/instance/disk/read_bytes_count"`.
352
+ # @param [String] quota_user
353
+ # Available to use for quota purposes for server-side applications. Can be any
354
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
355
+ # @param [String] fields
356
+ # Selector specifying which fields to include in a partial response.
357
+ # @param [Google::Apis::RequestOptions] options
358
+ # Request-specific options
359
+ #
360
+ # @yield [result, err] Result & error if block supplied
361
+ # @yieldparam result [Google::Apis::MonitoringV3::MetricDescriptor] parsed result object
362
+ # @yieldparam err [StandardError] error object if request failed
363
+ #
364
+ # @return [Google::Apis::MonitoringV3::MetricDescriptor]
365
+ #
366
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
367
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
368
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
369
+ def get_project_metric_descriptor(name, quota_user: nil, fields: nil, options: nil, &block)
370
+ command = make_simple_command(:get, 'v3/{+name}', options)
371
+ command.response_representation = Google::Apis::MonitoringV3::MetricDescriptor::Representation
372
+ command.response_class = Google::Apis::MonitoringV3::MetricDescriptor
373
+ command.params['name'] = name unless name.nil?
374
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
375
+ command.query['fields'] = fields unless fields.nil?
376
+ execute_or_queue_command(command, &block)
377
+ end
378
+
379
+ # Creates a new metric descriptor.
380
+ # User-created metric descriptors define
381
+ # [custom metrics](/monitoring/custom-metrics).
382
+ # @param [String] name
383
+ # The project on which to execute the request. The format is
384
+ # `"projects/`project_id_or_number`"`.
385
+ # @param [Google::Apis::MonitoringV3::MetricDescriptor] metric_descriptor_object
386
+ # @param [String] quota_user
387
+ # Available to use for quota purposes for server-side applications. Can be any
388
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
389
+ # @param [String] fields
390
+ # Selector specifying which fields to include in a partial response.
391
+ # @param [Google::Apis::RequestOptions] options
392
+ # Request-specific options
393
+ #
394
+ # @yield [result, err] Result & error if block supplied
395
+ # @yieldparam result [Google::Apis::MonitoringV3::MetricDescriptor] parsed result object
396
+ # @yieldparam err [StandardError] error object if request failed
397
+ #
398
+ # @return [Google::Apis::MonitoringV3::MetricDescriptor]
399
+ #
400
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
401
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
402
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
403
+ def create_project_metric_descriptor(name, metric_descriptor_object = nil, quota_user: nil, fields: nil, options: nil, &block)
404
+ command = make_simple_command(:post, 'v3/{+name}/metricDescriptors', options)
405
+ command.request_representation = Google::Apis::MonitoringV3::MetricDescriptor::Representation
406
+ command.request_object = metric_descriptor_object
407
+ command.response_representation = Google::Apis::MonitoringV3::MetricDescriptor::Representation
408
+ command.response_class = Google::Apis::MonitoringV3::MetricDescriptor
409
+ command.params['name'] = name unless name.nil?
410
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
411
+ command.query['fields'] = fields unless fields.nil?
412
+ execute_or_queue_command(command, &block)
413
+ end
414
+
415
+ # Lists metric descriptors that match a filter. This method does not require a
416
+ # Stackdriver account.
417
+ # @param [String] name
418
+ # The project on which to execute the request. The format is
419
+ # `"projects/`project_id_or_number`"`.
420
+ # @param [Fixnum] page_size
421
+ # A positive number that is the maximum number of results to return.
422
+ # @param [String] filter
423
+ # If this field is empty, all custom and
424
+ # system-defined metric descriptors are returned.
425
+ # Otherwise, the [filter](/monitoring/api/v3/filters)
426
+ # specifies which metric descriptors are to be
427
+ # returned. For example, the following filter matches all
428
+ # [custom metrics](/monitoring/custom-metrics):
429
+ # metric.type = starts_with("custom.googleapis.com/")
430
+ # @param [String] page_token
431
+ # If this field is not empty then it must contain the `nextPageToken` value
432
+ # returned by a previous call to this method. Using this field causes the
433
+ # method to return additional results from the previous method call.
434
+ # @param [String] quota_user
435
+ # Available to use for quota purposes for server-side applications. Can be any
436
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
437
+ # @param [String] fields
438
+ # Selector specifying which fields to include in a partial response.
439
+ # @param [Google::Apis::RequestOptions] options
440
+ # Request-specific options
441
+ #
442
+ # @yield [result, err] Result & error if block supplied
443
+ # @yieldparam result [Google::Apis::MonitoringV3::ListMetricDescriptorsResponse] parsed result object
444
+ # @yieldparam err [StandardError] error object if request failed
445
+ #
446
+ # @return [Google::Apis::MonitoringV3::ListMetricDescriptorsResponse]
447
+ #
448
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
449
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
450
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
451
+ def list_project_metric_descriptors(name, page_size: nil, filter: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
452
+ command = make_simple_command(:get, 'v3/{+name}/metricDescriptors', options)
453
+ command.response_representation = Google::Apis::MonitoringV3::ListMetricDescriptorsResponse::Representation
454
+ command.response_class = Google::Apis::MonitoringV3::ListMetricDescriptorsResponse
455
+ command.params['name'] = name unless name.nil?
456
+ command.query['pageSize'] = page_size unless page_size.nil?
457
+ command.query['filter'] = filter unless filter.nil?
458
+ command.query['pageToken'] = page_token unless page_token.nil?
459
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
460
+ command.query['fields'] = fields unless fields.nil?
461
+ execute_or_queue_command(command, &block)
462
+ end
463
+
464
+ # Deletes a metric descriptor. Only user-created
465
+ # [custom metrics](/monitoring/custom-metrics) can be deleted.
466
+ # @param [String] name
467
+ # The metric descriptor on which to execute the request. The format is
468
+ # `"projects/`project_id_or_number`/metricDescriptors/`metric_id`"`.
469
+ # An example of ``metric_id`` is:
470
+ # `"custom.googleapis.com/my_test_metric"`.
471
+ # @param [String] quota_user
472
+ # Available to use for quota purposes for server-side applications. Can be any
473
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
474
+ # @param [String] fields
475
+ # Selector specifying which fields to include in a partial response.
476
+ # @param [Google::Apis::RequestOptions] options
477
+ # Request-specific options
478
+ #
479
+ # @yield [result, err] Result & error if block supplied
480
+ # @yieldparam result [Google::Apis::MonitoringV3::Empty] parsed result object
481
+ # @yieldparam err [StandardError] error object if request failed
482
+ #
483
+ # @return [Google::Apis::MonitoringV3::Empty]
484
+ #
485
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
486
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
487
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
488
+ def delete_project_metric_descriptor(name, quota_user: nil, fields: nil, options: nil, &block)
489
+ command = make_simple_command(:delete, 'v3/{+name}', options)
490
+ command.response_representation = Google::Apis::MonitoringV3::Empty::Representation
491
+ command.response_class = Google::Apis::MonitoringV3::Empty
492
+ command.params['name'] = name unless name.nil?
493
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
494
+ command.query['fields'] = fields unless fields.nil?
495
+ execute_or_queue_command(command, &block)
496
+ end
497
+
498
+ # Creates or adds data to one or more time series.
499
+ # The response is empty if all time series in the request were written.
500
+ # If any time series could not be written, a corresponding failure message is
501
+ # included in the error response.
502
+ # @param [String] name
503
+ # The project on which to execute the request. The format is
504
+ # `"projects/`project_id_or_number`"`.
505
+ # @param [Google::Apis::MonitoringV3::CreateTimeSeriesRequest] create_time_series_request_object
506
+ # @param [String] quota_user
507
+ # Available to use for quota purposes for server-side applications. Can be any
508
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
509
+ # @param [String] fields
510
+ # Selector specifying which fields to include in a partial response.
511
+ # @param [Google::Apis::RequestOptions] options
512
+ # Request-specific options
513
+ #
514
+ # @yield [result, err] Result & error if block supplied
515
+ # @yieldparam result [Google::Apis::MonitoringV3::Empty] parsed result object
516
+ # @yieldparam err [StandardError] error object if request failed
517
+ #
518
+ # @return [Google::Apis::MonitoringV3::Empty]
519
+ #
520
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
521
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
522
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
523
+ def create_time_series(name, create_time_series_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
524
+ command = make_simple_command(:post, 'v3/{+name}/timeSeries', options)
525
+ command.request_representation = Google::Apis::MonitoringV3::CreateTimeSeriesRequest::Representation
526
+ command.request_object = create_time_series_request_object
527
+ command.response_representation = Google::Apis::MonitoringV3::Empty::Representation
528
+ command.response_class = Google::Apis::MonitoringV3::Empty
529
+ command.params['name'] = name unless name.nil?
530
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
531
+ command.query['fields'] = fields unless fields.nil?
532
+ execute_or_queue_command(command, &block)
533
+ end
534
+
535
+ # Lists time series that match a filter. This method does not require a
536
+ # Stackdriver account.
537
+ # @param [String] name
538
+ # The project on which to execute the request. The format is
539
+ # "projects/`project_id_or_number`".
540
+ # @param [String] filter
541
+ # A [monitoring filter](/monitoring/api/v3/filters) that specifies which time
542
+ # series should be returned. The filter must specify a single metric type,
543
+ # and can additionally specify metric labels and other information. For
544
+ # example:
545
+ # metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
546
+ # metric.label.instance_name = "my-instance-name"
547
+ # @param [Array<String>, String] aggregation_group_by_fields
548
+ # The set of fields to preserve when `crossSeriesReducer` is
549
+ # specified. The `groupByFields` determine how the time series
550
+ # are partitioned into subsets prior to applying the aggregation
551
+ # function. Each subset contains time series that have the same
552
+ # value for each of the grouping fields. Each individual time
553
+ # series is a member of exactly one subset. The
554
+ # `crossSeriesReducer` is applied to each subset of time series.
555
+ # Fields not specified in `groupByFields` are aggregated away.
556
+ # If `groupByFields` is not specified, the time series are
557
+ # aggregated into a single output time series. If
558
+ # `crossSeriesReducer` is not defined, this field is ignored.
559
+ # @param [String] aggregation_cross_series_reducer
560
+ # The approach to be used to combine time series. Not all reducer
561
+ # functions may be applied to all time series, depending on the
562
+ # metric type and the value type of the original time
563
+ # series. Reduction may change the metric type of value type of the
564
+ # time series.
565
+ # Time series data must be aligned in order to perform cross-time
566
+ # series reduction. If `crossSeriesReducer` is specified, then
567
+ # `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
568
+ # and `alignmentPeriod` must be specified; otherwise, an error is
569
+ # returned.
570
+ # @param [String] interval_end_time
571
+ # Required. The end of the interval. The interval includes this
572
+ # time.
573
+ # @param [String] interval_start_time
574
+ # If this value is omitted, the interval is a point in time,
575
+ # `endTime`. If `startTime` is present, it must be earlier than
576
+ # (less than) `endTime`. The interval begins after
577
+ # `startTime`&mdash;it does not include `startTime`.
578
+ # @param [Fixnum] page_size
579
+ # A positive number that is the maximum number of results to return.
580
+ # When `view` field sets to `FULL`, it limits the number of `Points` server
581
+ # will return; if `view` field is `HEADERS`, it limits the number of
582
+ # `TimeSeries` server will return.
583
+ # @param [String] view
584
+ # Specifies which information is returned about the time series.
585
+ # @param [String] aggregation_alignment_period
586
+ # The alignment period for per-time series
587
+ # alignment. If present, `alignmentPeriod` must be at least 60
588
+ # seconds. After per-time series alignment, each time series will
589
+ # contain data points only on the period boundaries. If
590
+ # `perSeriesAligner` is not specified or equals `ALIGN_NONE`, then
591
+ # this field is ignored. If `perSeriesAligner` is specified and
592
+ # does not equal `ALIGN_NONE`, then this field must be defined;
593
+ # otherwise an error is returned.
594
+ # @param [String] aggregation_per_series_aligner
595
+ # The approach to be used to align individual time series. Not all
596
+ # alignment functions may be applied to all time series, depending
597
+ # on the metric type and value type of the original time
598
+ # series. Alignment may change the metric type or the value type of
599
+ # the time series.
600
+ # Time series data must be aligned in order to perform cross-time
601
+ # series reduction. If `crossSeriesReducer` is specified, then
602
+ # `perSeriesAligner` must be specified and not equal `ALIGN_NONE`
603
+ # and `alignmentPeriod` must be specified; otherwise, an error is
604
+ # returned.
605
+ # @param [String] order_by
606
+ # Specifies the order in which the points of the time series should
607
+ # be returned. By default, results are not ordered. Currently,
608
+ # this field must be left blank.
609
+ # @param [String] page_token
610
+ # If this field is not empty then it must contain the `nextPageToken` value
611
+ # returned by a previous call to this method. Using this field causes the
612
+ # method to return additional results from the previous method call.
613
+ # @param [String] quota_user
614
+ # Available to use for quota purposes for server-side applications. Can be any
615
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
616
+ # @param [String] fields
617
+ # Selector specifying which fields to include in a partial response.
618
+ # @param [Google::Apis::RequestOptions] options
619
+ # Request-specific options
620
+ #
621
+ # @yield [result, err] Result & error if block supplied
622
+ # @yieldparam result [Google::Apis::MonitoringV3::ListTimeSeriesResponse] parsed result object
623
+ # @yieldparam err [StandardError] error object if request failed
624
+ #
625
+ # @return [Google::Apis::MonitoringV3::ListTimeSeriesResponse]
626
+ #
627
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
628
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
629
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
630
+ def list_project_time_series(name, filter: nil, aggregation_group_by_fields: nil, aggregation_cross_series_reducer: nil, interval_end_time: nil, interval_start_time: nil, page_size: nil, view: nil, aggregation_alignment_period: nil, aggregation_per_series_aligner: nil, order_by: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
631
+ command = make_simple_command(:get, 'v3/{+name}/timeSeries', options)
632
+ command.response_representation = Google::Apis::MonitoringV3::ListTimeSeriesResponse::Representation
633
+ command.response_class = Google::Apis::MonitoringV3::ListTimeSeriesResponse
634
+ command.params['name'] = name unless name.nil?
635
+ command.query['filter'] = filter unless filter.nil?
636
+ command.query['aggregation.groupByFields'] = aggregation_group_by_fields unless aggregation_group_by_fields.nil?
637
+ command.query['aggregation.crossSeriesReducer'] = aggregation_cross_series_reducer unless aggregation_cross_series_reducer.nil?
638
+ command.query['interval.endTime'] = interval_end_time unless interval_end_time.nil?
639
+ command.query['interval.startTime'] = interval_start_time unless interval_start_time.nil?
640
+ command.query['pageSize'] = page_size unless page_size.nil?
641
+ command.query['view'] = view unless view.nil?
642
+ command.query['aggregation.alignmentPeriod'] = aggregation_alignment_period unless aggregation_alignment_period.nil?
643
+ command.query['aggregation.perSeriesAligner'] = aggregation_per_series_aligner unless aggregation_per_series_aligner.nil?
644
+ command.query['orderBy'] = order_by unless order_by.nil?
645
+ command.query['pageToken'] = page_token unless page_token.nil?
646
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
647
+ command.query['fields'] = fields unless fields.nil?
648
+ execute_or_queue_command(command, &block)
649
+ end
650
+
651
+ # Gets a single monitored resource descriptor. This method does not require a
652
+ # Stackdriver account.
653
+ # @param [String] name
654
+ # The monitored resource descriptor to get. The format is
655
+ # `"projects/`project_id_or_number`/monitoredResourceDescriptors/`resource_type`"
656
+ # `.
657
+ # The ``resource_type`` is a predefined type, such as
658
+ # `cloudsql_database`.
659
+ # @param [String] quota_user
660
+ # Available to use for quota purposes for server-side applications. Can be any
661
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
662
+ # @param [String] fields
663
+ # Selector specifying which fields to include in a partial response.
664
+ # @param [Google::Apis::RequestOptions] options
665
+ # Request-specific options
666
+ #
667
+ # @yield [result, err] Result & error if block supplied
668
+ # @yieldparam result [Google::Apis::MonitoringV3::MonitoredResourceDescriptor] parsed result object
669
+ # @yieldparam err [StandardError] error object if request failed
670
+ #
671
+ # @return [Google::Apis::MonitoringV3::MonitoredResourceDescriptor]
672
+ #
673
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
674
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
675
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
676
+ def get_project_monitored_resource_descriptor(name, quota_user: nil, fields: nil, options: nil, &block)
677
+ command = make_simple_command(:get, 'v3/{+name}', options)
678
+ command.response_representation = Google::Apis::MonitoringV3::MonitoredResourceDescriptor::Representation
679
+ command.response_class = Google::Apis::MonitoringV3::MonitoredResourceDescriptor
680
+ command.params['name'] = name unless name.nil?
681
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
682
+ command.query['fields'] = fields unless fields.nil?
683
+ execute_or_queue_command(command, &block)
684
+ end
685
+
686
+ # Lists monitored resource descriptors that match a filter. This method does not
687
+ # require a Stackdriver account.
688
+ # @param [String] name
689
+ # The project on which to execute the request. The format is
690
+ # `"projects/`project_id_or_number`"`.
691
+ # @param [Fixnum] page_size
692
+ # A positive number that is the maximum number of results to return.
693
+ # @param [String] filter
694
+ # An optional [filter](/monitoring/api/v3/filters) describing
695
+ # the descriptors to be returned. The filter can reference
696
+ # the descriptor's type and labels. For example, the
697
+ # following filter returns only Google Compute Engine descriptors
698
+ # that have an `id` label:
699
+ # resource.type = starts_with("gce_") AND resource.label:id
700
+ # @param [String] page_token
701
+ # If this field is not empty then it must contain the `nextPageToken` value
702
+ # returned by a previous call to this method. Using this field causes the
703
+ # method to return additional results from the previous method call.
704
+ # @param [String] quota_user
705
+ # Available to use for quota purposes for server-side applications. Can be any
706
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
707
+ # @param [String] fields
708
+ # Selector specifying which fields to include in a partial response.
709
+ # @param [Google::Apis::RequestOptions] options
710
+ # Request-specific options
711
+ #
712
+ # @yield [result, err] Result & error if block supplied
713
+ # @yieldparam result [Google::Apis::MonitoringV3::ListMonitoredResourceDescriptorsResponse] parsed result object
714
+ # @yieldparam err [StandardError] error object if request failed
715
+ #
716
+ # @return [Google::Apis::MonitoringV3::ListMonitoredResourceDescriptorsResponse]
717
+ #
718
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
719
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
720
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
721
+ def list_project_monitored_resource_descriptors(name, page_size: nil, filter: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
722
+ command = make_simple_command(:get, 'v3/{+name}/monitoredResourceDescriptors', options)
723
+ command.response_representation = Google::Apis::MonitoringV3::ListMonitoredResourceDescriptorsResponse::Representation
724
+ command.response_class = Google::Apis::MonitoringV3::ListMonitoredResourceDescriptorsResponse
725
+ command.params['name'] = name unless name.nil?
726
+ command.query['pageSize'] = page_size unless page_size.nil?
727
+ command.query['filter'] = filter unless filter.nil?
728
+ command.query['pageToken'] = page_token unless page_token.nil?
729
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
730
+ command.query['fields'] = fields unless fields.nil?
731
+ execute_or_queue_command(command, &block)
732
+ end
733
+
734
+ protected
735
+
736
+ def apply_command_defaults(command)
737
+ command.query['key'] = key unless key.nil?
738
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
739
+ end
740
+ end
741
+ end
742
+ end
743
+ end