google-apis-monitoring_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,247 @@
1
+ # Copyright 2020 Google LLC
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 MonitoringV1
23
+ # Cloud Monitoring API
24
+ #
25
+ # Manages your Cloud Monitoring data and configurations. Most projects must be
26
+ # associated with a Workspace, with a few exceptions as noted on the individual
27
+ # method pages. The table entries below are presented in alphabetical order, not
28
+ # in order of common use. For explanations of the concepts found in the table
29
+ # entries, read the Cloud Monitoring documentation.
30
+ #
31
+ # @example
32
+ # require 'google/apis/monitoring_v1'
33
+ #
34
+ # Monitoring = Google::Apis::MonitoringV1 # Alias the module
35
+ # service = Monitoring::MonitoringService.new
36
+ #
37
+ # @see https://cloud.google.com/monitoring/api/
38
+ class MonitoringService < Google::Apis::Core::BaseService
39
+ # @return [String]
40
+ # API key. Your API key identifies your project and provides you with API access,
41
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
42
+ attr_accessor :key
43
+
44
+ # @return [String]
45
+ # Available to use for quota purposes for server-side applications. Can be any
46
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
47
+ attr_accessor :quota_user
48
+
49
+ def initialize
50
+ super('https://monitoring.googleapis.com/', '',
51
+ client_name: 'google-apis-monitoring_v1',
52
+ client_version: Google::Apis::MonitoringV1::GEM_VERSION)
53
+ @batch_path = 'batch'
54
+ end
55
+
56
+ # Creates a new custom dashboard.This method requires the monitoring.dashboards.
57
+ # create permission on the specified project. For more information, see Google
58
+ # Cloud IAM (https://cloud.google.com/iam).
59
+ # @param [String] parent
60
+ # Required. The project on which to execute the request. The format is: projects/
61
+ # [PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard
62
+ # resource name.
63
+ # @param [Google::Apis::MonitoringV1::Dashboard] dashboard_object
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::MonitoringV1::Dashboard] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::MonitoringV1::Dashboard]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def create_project_dashboard(parent, dashboard_object = nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:post, 'v1/{+parent}/dashboards', options)
83
+ command.request_representation = Google::Apis::MonitoringV1::Dashboard::Representation
84
+ command.request_object = dashboard_object
85
+ command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
86
+ command.response_class = Google::Apis::MonitoringV1::Dashboard
87
+ command.params['parent'] = parent unless parent.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Deletes an existing custom dashboard.This method requires the monitoring.
94
+ # dashboards.delete permission on the specified dashboard. For more information,
95
+ # see Google Cloud IAM (https://cloud.google.com/iam).
96
+ # @param [String] name
97
+ # Required. The resource name of the Dashboard. The format is: projects/[
98
+ # PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
99
+ # @param [String] fields
100
+ # Selector specifying which fields to include in a partial response.
101
+ # @param [String] quota_user
102
+ # Available to use for quota purposes for server-side applications. Can be any
103
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
104
+ # @param [Google::Apis::RequestOptions] options
105
+ # Request-specific options
106
+ #
107
+ # @yield [result, err] Result & error if block supplied
108
+ # @yieldparam result [Google::Apis::MonitoringV1::Empty] parsed result object
109
+ # @yieldparam err [StandardError] error object if request failed
110
+ #
111
+ # @return [Google::Apis::MonitoringV1::Empty]
112
+ #
113
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
114
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
115
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
116
+ def delete_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block)
117
+ command = make_simple_command(:delete, 'v1/{+name}', options)
118
+ command.response_representation = Google::Apis::MonitoringV1::Empty::Representation
119
+ command.response_class = Google::Apis::MonitoringV1::Empty
120
+ command.params['name'] = name unless name.nil?
121
+ command.query['fields'] = fields unless fields.nil?
122
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
123
+ execute_or_queue_command(command, &block)
124
+ end
125
+
126
+ # Fetches a specific dashboard.This method requires the monitoring.dashboards.
127
+ # get permission on the specified dashboard. For more information, see Google
128
+ # Cloud IAM (https://cloud.google.com/iam).
129
+ # @param [String] name
130
+ # Required. The resource name of the Dashboard. The format is one of: dashboards/
131
+ # [DASHBOARD_ID] (for system dashboards) projects/[PROJECT_ID_OR_NUMBER]/
132
+ # dashboards/[DASHBOARD_ID] (for custom dashboards).
133
+ # @param [String] fields
134
+ # Selector specifying which fields to include in a partial response.
135
+ # @param [String] quota_user
136
+ # Available to use for quota purposes for server-side applications. Can be any
137
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
138
+ # @param [Google::Apis::RequestOptions] options
139
+ # Request-specific options
140
+ #
141
+ # @yield [result, err] Result & error if block supplied
142
+ # @yieldparam result [Google::Apis::MonitoringV1::Dashboard] parsed result object
143
+ # @yieldparam err [StandardError] error object if request failed
144
+ #
145
+ # @return [Google::Apis::MonitoringV1::Dashboard]
146
+ #
147
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
148
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
149
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
150
+ def get_project_dashboard(name, fields: nil, quota_user: nil, options: nil, &block)
151
+ command = make_simple_command(:get, 'v1/{+name}', options)
152
+ command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
153
+ command.response_class = Google::Apis::MonitoringV1::Dashboard
154
+ command.params['name'] = name unless name.nil?
155
+ command.query['fields'] = fields unless fields.nil?
156
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
157
+ execute_or_queue_command(command, &block)
158
+ end
159
+
160
+ # Lists the existing dashboards.This method requires the monitoring.dashboards.
161
+ # list permission on the specified project. For more information, see Google
162
+ # Cloud IAM (https://cloud.google.com/iam).
163
+ # @param [String] parent
164
+ # Required. The scope of the dashboards to list. The format is: projects/[
165
+ # PROJECT_ID_OR_NUMBER]
166
+ # @param [Fixnum] page_size
167
+ # A positive number that is the maximum number of results to return. If
168
+ # unspecified, a default of 1000 is used.
169
+ # @param [String] page_token
170
+ # If this field is not empty then it must contain the nextPageToken value
171
+ # returned by a previous call to this method. Using this field causes the method
172
+ # to return additional results from the previous method call.
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [String] quota_user
176
+ # Available to use for quota purposes for server-side applications. Can be any
177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # @param [Google::Apis::RequestOptions] options
179
+ # Request-specific options
180
+ #
181
+ # @yield [result, err] Result & error if block supplied
182
+ # @yieldparam result [Google::Apis::MonitoringV1::ListDashboardsResponse] parsed result object
183
+ # @yieldparam err [StandardError] error object if request failed
184
+ #
185
+ # @return [Google::Apis::MonitoringV1::ListDashboardsResponse]
186
+ #
187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
190
+ def list_project_dashboards(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
191
+ command = make_simple_command(:get, 'v1/{+parent}/dashboards', options)
192
+ command.response_representation = Google::Apis::MonitoringV1::ListDashboardsResponse::Representation
193
+ command.response_class = Google::Apis::MonitoringV1::ListDashboardsResponse
194
+ command.params['parent'] = parent unless parent.nil?
195
+ command.query['pageSize'] = page_size unless page_size.nil?
196
+ command.query['pageToken'] = page_token unless page_token.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Replaces an existing custom dashboard with a new definition.This method
203
+ # requires the monitoring.dashboards.update permission on the specified
204
+ # dashboard. For more information, see Google Cloud IAM (https://cloud.google.
205
+ # com/iam).
206
+ # @param [String] name
207
+ # Immutable. The resource name of the dashboard.
208
+ # @param [Google::Apis::MonitoringV1::Dashboard] dashboard_object
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::MonitoringV1::Dashboard] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::MonitoringV1::Dashboard]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def patch_project_dashboard(name, dashboard_object = nil, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:patch, 'v1/{+name}', options)
228
+ command.request_representation = Google::Apis::MonitoringV1::Dashboard::Representation
229
+ command.request_object = dashboard_object
230
+ command.response_representation = Google::Apis::MonitoringV1::Dashboard::Representation
231
+ command.response_class = Google::Apis::MonitoringV1::Dashboard
232
+ command.params['name'] = name unless name.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ protected
239
+
240
+ def apply_command_defaults(command)
241
+ command.query['key'] = key unless key.nil?
242
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
243
+ end
244
+ end
245
+ end
246
+ end
247
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-monitoring_v1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for Cloud Monitoring API V1. Simple REST
28
+ clients are Ruby client libraries that provide access to Google services via their
29
+ HTTP REST API endpoints. These libraries are generated and updated automatically
30
+ based on the discovery documents published by the service, and they handle most
31
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
32
+ use this client to access the Cloud Monitoring API, but note that some services
33
+ may provide a separate modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-monitoring_v1.rb
44
+ - lib/google/apis/monitoring_v1.rb
45
+ - lib/google/apis/monitoring_v1/classes.rb
46
+ - lib/google/apis/monitoring_v1/gem_version.rb
47
+ - lib/google/apis/monitoring_v1/representations.rb
48
+ - lib/google/apis/monitoring_v1/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-monitoring_v1/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-monitoring_v1/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-monitoring_v1
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for Cloud Monitoring API V1
76
+ test_files: []