statuscake-rb 1.0.0.pre.beta.4
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.
- checksums.yaml +7 -0
- data/lib/statuscake/api/contact_groups_api.rb +411 -0
- data/lib/statuscake/api/locations_api.rb +166 -0
- data/lib/statuscake/api/maintenance_windows_api.rb +444 -0
- data/lib/statuscake/api/pagespeed_api.rb +550 -0
- data/lib/statuscake/api/ssl_api.rb +458 -0
- data/lib/statuscake/api/uptime_api.rb +881 -0
- data/lib/statuscake/api_client.rb +407 -0
- data/lib/statuscake/api_error.rb +75 -0
- data/lib/statuscake/configuration.rb +296 -0
- data/lib/statuscake/models/api_error.rb +249 -0
- data/lib/statuscake/models/api_response.rb +241 -0
- data/lib/statuscake/models/api_response_data.rb +243 -0
- data/lib/statuscake/models/contact_group.rb +318 -0
- data/lib/statuscake/models/contact_group_response.rb +241 -0
- data/lib/statuscake/models/contact_groups.rb +258 -0
- data/lib/statuscake/models/links.rb +242 -0
- data/lib/statuscake/models/maintenance_window.rb +364 -0
- data/lib/statuscake/models/maintenance_window_repeat_interval.rb +59 -0
- data/lib/statuscake/models/maintenance_window_response.rb +241 -0
- data/lib/statuscake/models/maintenance_window_state.rb +57 -0
- data/lib/statuscake/models/maintenance_windows.rb +258 -0
- data/lib/statuscake/models/monitoring_location.rb +306 -0
- data/lib/statuscake/models/monitoring_location_status.rb +56 -0
- data/lib/statuscake/models/monitoring_locations.rb +244 -0
- data/lib/statuscake/models/pagespeed_test.rb +444 -0
- data/lib/statuscake/models/pagespeed_test_check_rate.rb +61 -0
- data/lib/statuscake/models/pagespeed_test_history.rb +269 -0
- data/lib/statuscake/models/pagespeed_test_history_result.rb +373 -0
- data/lib/statuscake/models/pagespeed_test_region.rb +64 -0
- data/lib/statuscake/models/pagespeed_test_response.rb +241 -0
- data/lib/statuscake/models/pagespeed_test_stats.rb +354 -0
- data/lib/statuscake/models/pagespeed_test_throttling.rb +60 -0
- data/lib/statuscake/models/pagespeed_tests.rb +258 -0
- data/lib/statuscake/models/pagination.rb +363 -0
- data/lib/statuscake/models/ssl_test.rb +594 -0
- data/lib/statuscake/models/ssl_test_check_rate.rb +60 -0
- data/lib/statuscake/models/ssl_test_flags.rb +347 -0
- data/lib/statuscake/models/ssl_test_mixed_content.rb +257 -0
- data/lib/statuscake/models/ssl_test_response.rb +241 -0
- data/lib/statuscake/models/ssl_tests.rb +258 -0
- data/lib/statuscake/models/uptime_test.rb +811 -0
- data/lib/statuscake/models/uptime_test_alert.rb +300 -0
- data/lib/statuscake/models/uptime_test_alerts.rb +269 -0
- data/lib/statuscake/models/uptime_test_check_rate.rb +62 -0
- data/lib/statuscake/models/uptime_test_history.rb +269 -0
- data/lib/statuscake/models/uptime_test_history_result.rb +302 -0
- data/lib/statuscake/models/uptime_test_overview.rb +388 -0
- data/lib/statuscake/models/uptime_test_period.rb +291 -0
- data/lib/statuscake/models/uptime_test_periods.rb +269 -0
- data/lib/statuscake/models/uptime_test_processing_state.rb +58 -0
- data/lib/statuscake/models/uptime_test_response.rb +241 -0
- data/lib/statuscake/models/uptime_test_status.rb +56 -0
- data/lib/statuscake/models/uptime_test_type.rb +61 -0
- data/lib/statuscake/models/uptime_tests.rb +258 -0
- data/lib/statuscake/version.rb +32 -0
- data/lib/statuscake.rb +107 -0
- metadata +221 -0
@@ -0,0 +1,444 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# StatusCake API
|
4
|
+
#
|
5
|
+
# Copyright (c) 2022
|
6
|
+
#
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to
|
9
|
+
# deal in the Software without restriction, including without limitation the
|
10
|
+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
11
|
+
# sell copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in
|
15
|
+
# all copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
23
|
+
# IN THE SOFTWARE.
|
24
|
+
#
|
25
|
+
# API version: 1.0.0
|
26
|
+
# Contact: support@statuscake.com
|
27
|
+
#
|
28
|
+
# Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
29
|
+
|
30
|
+
require 'cgi'
|
31
|
+
|
32
|
+
module StatusCake
|
33
|
+
# :nodoc
|
34
|
+
class MaintenanceWindowsApi
|
35
|
+
attr_accessor :api_client
|
36
|
+
|
37
|
+
def initialize(api_client = ApiClient.default)
|
38
|
+
@api_client = api_client
|
39
|
+
end
|
40
|
+
|
41
|
+
# Create a maintenance window
|
42
|
+
# Creates a maintenance window with the given parameters.
|
43
|
+
# @param name [String] Name of the maintenance window
|
44
|
+
# @param end_at [Time] End of the maintenance window (RFC3339 format)
|
45
|
+
# @param start_at [Time] Start of the maintenance window (RFC3339 format)
|
46
|
+
# @param timezone [String] Standard [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) associated with this maintenance window
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @option opts [MaintenanceWindowRepeatInterval] :repeat_interval
|
49
|
+
# @option opts [Array<String>] :tags List of tags used to include matching uptime checks in this maintenance window. At least one of `tests` and `tags` must be present in the request
|
50
|
+
# @option opts [Array<String>] :tests List of uptime check IDs explicitly included in this maintenance window. At least one of `tests` and `tags` must be present in the request
|
51
|
+
# @return [APIResponse]
|
52
|
+
def create_maintenance_window(name, end_at, start_at, timezone, opts = {})
|
53
|
+
data, _status_code, _headers = create_maintenance_window_with_http_info(name, end_at, start_at, timezone, opts)
|
54
|
+
data
|
55
|
+
end
|
56
|
+
|
57
|
+
# Create a maintenance window
|
58
|
+
# Creates a maintenance window with the given parameters.
|
59
|
+
# @param name [String] Name of the maintenance window
|
60
|
+
# @param end_at [Time] End of the maintenance window (RFC3339 format)
|
61
|
+
# @param start_at [Time] Start of the maintenance window (RFC3339 format)
|
62
|
+
# @param timezone [String] Standard [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) associated with this maintenance window
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @option opts [MaintenanceWindowRepeatInterval] :repeat_interval
|
65
|
+
# @option opts [Array<String>] :tags List of tags used to include matching uptime checks in this maintenance window. At least one of `tests` and `tags` must be present in the request
|
66
|
+
# @option opts [Array<String>] :tests List of uptime check IDs explicitly included in this maintenance window. At least one of `tests` and `tags` must be present in the request
|
67
|
+
# @return [Array<(APIResponse, Integer, Hash)>] APIResponse data, response status code and response headers
|
68
|
+
def create_maintenance_window_with_http_info(name, end_at, start_at, timezone, opts = {})
|
69
|
+
if @api_client.config.debugging
|
70
|
+
@api_client.config.logger.debug 'Calling API: MaintenanceWindowsApi.create_maintenance_window ...'
|
71
|
+
end
|
72
|
+
# verify the required parameter 'name' is set
|
73
|
+
if @api_client.config.client_side_validation && name.nil?
|
74
|
+
raise ArgumentError, "Missing the required parameter 'name' when calling MaintenanceWindowsApi.create_maintenance_window"
|
75
|
+
end
|
76
|
+
# verify the required parameter 'end_at' is set
|
77
|
+
if @api_client.config.client_side_validation && end_at.nil?
|
78
|
+
raise ArgumentError, "Missing the required parameter 'end_at' when calling MaintenanceWindowsApi.create_maintenance_window"
|
79
|
+
end
|
80
|
+
# verify the required parameter 'start_at' is set
|
81
|
+
if @api_client.config.client_side_validation && start_at.nil?
|
82
|
+
raise ArgumentError, "Missing the required parameter 'start_at' when calling MaintenanceWindowsApi.create_maintenance_window"
|
83
|
+
end
|
84
|
+
# verify the required parameter 'timezone' is set
|
85
|
+
if @api_client.config.client_side_validation && timezone.nil?
|
86
|
+
raise ArgumentError, "Missing the required parameter 'timezone' when calling MaintenanceWindowsApi.create_maintenance_window"
|
87
|
+
end
|
88
|
+
# resource path
|
89
|
+
local_var_path = '/maintenance-windows'
|
90
|
+
|
91
|
+
# query parameters
|
92
|
+
query_params = opts[:query_params] || {}
|
93
|
+
|
94
|
+
# header parameters
|
95
|
+
header_params = opts[:header_params] || {}
|
96
|
+
# HTTP header 'Accept' (if needed)
|
97
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
98
|
+
# HTTP header 'Content-Type'
|
99
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
100
|
+
unless content_type.nil?
|
101
|
+
header_params['Content-Type'] = content_type
|
102
|
+
end
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = opts[:form_params] || {}
|
106
|
+
form_params['name'] = name
|
107
|
+
form_params['end_at'] = end_at
|
108
|
+
form_params['start_at'] = start_at
|
109
|
+
form_params['timezone'] = timezone
|
110
|
+
form_params['repeat_interval'] = opts[:'repeat_interval'] unless opts[:'repeat_interval'].nil?
|
111
|
+
form_params['tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) unless opts[:'tags'].nil?
|
112
|
+
form_params['tests'] = @api_client.build_collection_param(opts[:'tests'], :csv) unless opts[:'tests'].nil?
|
113
|
+
|
114
|
+
# http body (model)
|
115
|
+
post_body = opts[:debug_body]
|
116
|
+
|
117
|
+
# return_type
|
118
|
+
return_type = opts[:debug_return_type] || 'APIResponse'
|
119
|
+
|
120
|
+
# auth_names
|
121
|
+
auth_names = opts[:debug_auth_names] || []
|
122
|
+
|
123
|
+
new_options = opts.merge(
|
124
|
+
:operation => :'MaintenanceWindowsApi.create_maintenance_window',
|
125
|
+
:header_params => header_params,
|
126
|
+
:query_params => query_params,
|
127
|
+
:form_params => form_params,
|
128
|
+
:body => post_body,
|
129
|
+
:auth_names => auth_names,
|
130
|
+
:return_type => return_type,
|
131
|
+
)
|
132
|
+
|
133
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
134
|
+
if @api_client.config.debugging
|
135
|
+
@api_client.config.logger.debug "API called: MaintenanceWindowsApi#create_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
136
|
+
end
|
137
|
+
|
138
|
+
[data, status_code, headers]
|
139
|
+
end
|
140
|
+
|
141
|
+
# Delete a maintenance window
|
142
|
+
# Deletes a maintenance window with the given id.
|
143
|
+
# @param window_id [String] Maintenance window ID
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @return [nil]
|
146
|
+
def delete_maintenance_window(window_id, opts = {})
|
147
|
+
delete_maintenance_window_with_http_info(window_id, opts)
|
148
|
+
nil
|
149
|
+
end
|
150
|
+
|
151
|
+
# Delete a maintenance window
|
152
|
+
# Deletes a maintenance window with the given id.
|
153
|
+
# @param window_id [String] Maintenance window ID
|
154
|
+
# @param [Hash] opts the optional parameters
|
155
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
156
|
+
def delete_maintenance_window_with_http_info(window_id, opts = {})
|
157
|
+
if @api_client.config.debugging
|
158
|
+
@api_client.config.logger.debug 'Calling API: MaintenanceWindowsApi.delete_maintenance_window ...'
|
159
|
+
end
|
160
|
+
# verify the required parameter 'window_id' is set
|
161
|
+
if @api_client.config.client_side_validation && window_id.nil?
|
162
|
+
raise ArgumentError, "Missing the required parameter 'window_id' when calling MaintenanceWindowsApi.delete_maintenance_window"
|
163
|
+
end
|
164
|
+
# resource path
|
165
|
+
local_var_path = '/maintenance-windows/{window_id}'.sub('{' + 'window_id' + '}', CGI.escape(window_id.to_s))
|
166
|
+
|
167
|
+
# query parameters
|
168
|
+
query_params = opts[:query_params] || {}
|
169
|
+
|
170
|
+
# header parameters
|
171
|
+
header_params = opts[:header_params] || {}
|
172
|
+
# HTTP header 'Accept' (if needed)
|
173
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
174
|
+
|
175
|
+
# form parameters
|
176
|
+
form_params = opts[:form_params] || {}
|
177
|
+
|
178
|
+
# http body (model)
|
179
|
+
post_body = opts[:debug_body]
|
180
|
+
|
181
|
+
# return_type
|
182
|
+
return_type = opts[:debug_return_type]
|
183
|
+
|
184
|
+
# auth_names
|
185
|
+
auth_names = opts[:debug_auth_names] || []
|
186
|
+
|
187
|
+
new_options = opts.merge(
|
188
|
+
:operation => :'MaintenanceWindowsApi.delete_maintenance_window',
|
189
|
+
:header_params => header_params,
|
190
|
+
:query_params => query_params,
|
191
|
+
:form_params => form_params,
|
192
|
+
:body => post_body,
|
193
|
+
:auth_names => auth_names,
|
194
|
+
:return_type => return_type,
|
195
|
+
)
|
196
|
+
|
197
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
198
|
+
if @api_client.config.debugging
|
199
|
+
@api_client.config.logger.debug "API called: MaintenanceWindowsApi#delete_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
200
|
+
end
|
201
|
+
|
202
|
+
[data, status_code, headers]
|
203
|
+
end
|
204
|
+
|
205
|
+
# Retrieve a maintenance window
|
206
|
+
# Returns a maintenance window with the given id.
|
207
|
+
# @param window_id [String] Maintenance window ID
|
208
|
+
# @param [Hash] opts the optional parameters
|
209
|
+
# @return [MaintenanceWindowResponse]
|
210
|
+
def get_maintenance_window(window_id, opts = {})
|
211
|
+
data, _status_code, _headers = get_maintenance_window_with_http_info(window_id, opts)
|
212
|
+
data
|
213
|
+
end
|
214
|
+
|
215
|
+
# Retrieve a maintenance window
|
216
|
+
# Returns a maintenance window with the given id.
|
217
|
+
# @param window_id [String] Maintenance window ID
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @return [Array<(MaintenanceWindowResponse, Integer, Hash)>] MaintenanceWindowResponse data, response status code and response headers
|
220
|
+
def get_maintenance_window_with_http_info(window_id, opts = {})
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug 'Calling API: MaintenanceWindowsApi.get_maintenance_window ...'
|
223
|
+
end
|
224
|
+
# verify the required parameter 'window_id' is set
|
225
|
+
if @api_client.config.client_side_validation && window_id.nil?
|
226
|
+
raise ArgumentError, "Missing the required parameter 'window_id' when calling MaintenanceWindowsApi.get_maintenance_window"
|
227
|
+
end
|
228
|
+
# resource path
|
229
|
+
local_var_path = '/maintenance-windows/{window_id}'.sub('{' + 'window_id' + '}', CGI.escape(window_id.to_s))
|
230
|
+
|
231
|
+
# query parameters
|
232
|
+
query_params = opts[:query_params] || {}
|
233
|
+
|
234
|
+
# header parameters
|
235
|
+
header_params = opts[:header_params] || {}
|
236
|
+
# HTTP header 'Accept' (if needed)
|
237
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
238
|
+
|
239
|
+
# form parameters
|
240
|
+
form_params = opts[:form_params] || {}
|
241
|
+
|
242
|
+
# http body (model)
|
243
|
+
post_body = opts[:debug_body]
|
244
|
+
|
245
|
+
# return_type
|
246
|
+
return_type = opts[:debug_return_type] || 'MaintenanceWindowResponse'
|
247
|
+
|
248
|
+
# auth_names
|
249
|
+
auth_names = opts[:debug_auth_names] || []
|
250
|
+
|
251
|
+
new_options = opts.merge(
|
252
|
+
:operation => :'MaintenanceWindowsApi.get_maintenance_window',
|
253
|
+
:header_params => header_params,
|
254
|
+
:query_params => query_params,
|
255
|
+
:form_params => form_params,
|
256
|
+
:body => post_body,
|
257
|
+
:auth_names => auth_names,
|
258
|
+
:return_type => return_type,
|
259
|
+
)
|
260
|
+
|
261
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
262
|
+
if @api_client.config.debugging
|
263
|
+
@api_client.config.logger.debug "API called: MaintenanceWindowsApi#get_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
264
|
+
end
|
265
|
+
|
266
|
+
[data, status_code, headers]
|
267
|
+
end
|
268
|
+
|
269
|
+
# Get all maintenance windows
|
270
|
+
# Returns a list of maintenance windows for an account.
|
271
|
+
# @param [Hash] opts the optional parameters
|
272
|
+
# @option opts [Integer] :page Page of results (default to 1)
|
273
|
+
# @option opts [Integer] :limit The number of maintenance windows to return per page (default to 25)
|
274
|
+
# @option opts [String] :state Maintenance window state
|
275
|
+
# @return [MaintenanceWindows]
|
276
|
+
def list_maintenance_windows(opts = {})
|
277
|
+
data, _status_code, _headers = list_maintenance_windows_with_http_info(opts)
|
278
|
+
data
|
279
|
+
end
|
280
|
+
|
281
|
+
# Get all maintenance windows
|
282
|
+
# Returns a list of maintenance windows for an account.
|
283
|
+
# @param [Hash] opts the optional parameters
|
284
|
+
# @option opts [Integer] :page Page of results (default to 1)
|
285
|
+
# @option opts [Integer] :limit The number of maintenance windows to return per page (default to 25)
|
286
|
+
# @option opts [String] :state Maintenance window state
|
287
|
+
# @return [Array<(MaintenanceWindows, Integer, Hash)>] MaintenanceWindows data, response status code and response headers
|
288
|
+
def list_maintenance_windows_with_http_info(opts = {})
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug 'Calling API: MaintenanceWindowsApi.list_maintenance_windows ...'
|
291
|
+
end
|
292
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
293
|
+
raise ArgumentError, 'invalid value for "opts[:"page"]" when calling MaintenanceWindowsApi.list_maintenance_windows, must be greater than or equal to 1.'
|
294
|
+
end
|
295
|
+
|
296
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
297
|
+
raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling MaintenanceWindowsApi.list_maintenance_windows, must be smaller than or equal to 100.'
|
298
|
+
end
|
299
|
+
|
300
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
301
|
+
raise ArgumentError, 'invalid value for "opts[:"limit"]" when calling MaintenanceWindowsApi.list_maintenance_windows, must be greater than or equal to 1.'
|
302
|
+
end
|
303
|
+
|
304
|
+
# rubocop:disable Style/WordArray
|
305
|
+
allowable_values = ["active", "paused", "pending"]
|
306
|
+
# rubocop:enable Style/WordArray
|
307
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
308
|
+
raise ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
309
|
+
end
|
310
|
+
# resource path
|
311
|
+
local_var_path = '/maintenance-windows'
|
312
|
+
|
313
|
+
# query parameters
|
314
|
+
query_params = opts[:query_params] || {}
|
315
|
+
query_params[:'page'] = opts[:'page'] unless opts[:'page'].nil?
|
316
|
+
query_params[:'limit'] = opts[:'limit'] unless opts[:'limit'].nil?
|
317
|
+
query_params[:'state'] = opts[:'state'] unless opts[:'state'].nil?
|
318
|
+
|
319
|
+
# header parameters
|
320
|
+
header_params = opts[:header_params] || {}
|
321
|
+
# HTTP header 'Accept' (if needed)
|
322
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
323
|
+
|
324
|
+
# form parameters
|
325
|
+
form_params = opts[:form_params] || {}
|
326
|
+
|
327
|
+
# http body (model)
|
328
|
+
post_body = opts[:debug_body]
|
329
|
+
|
330
|
+
# return_type
|
331
|
+
return_type = opts[:debug_return_type] || 'MaintenanceWindows'
|
332
|
+
|
333
|
+
# auth_names
|
334
|
+
auth_names = opts[:debug_auth_names] || []
|
335
|
+
|
336
|
+
new_options = opts.merge(
|
337
|
+
:operation => :'MaintenanceWindowsApi.list_maintenance_windows',
|
338
|
+
:header_params => header_params,
|
339
|
+
:query_params => query_params,
|
340
|
+
:form_params => form_params,
|
341
|
+
:body => post_body,
|
342
|
+
:auth_names => auth_names,
|
343
|
+
:return_type => return_type,
|
344
|
+
)
|
345
|
+
|
346
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
347
|
+
if @api_client.config.debugging
|
348
|
+
@api_client.config.logger.debug "API called: MaintenanceWindowsApi#list_maintenance_windows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
349
|
+
end
|
350
|
+
|
351
|
+
[data, status_code, headers]
|
352
|
+
end
|
353
|
+
|
354
|
+
# Update a maintenance window
|
355
|
+
# Updates a maintenance window with the given parameters.
|
356
|
+
# @param window_id [String] Maintenance window ID
|
357
|
+
# @param [Hash] opts the optional parameters
|
358
|
+
# @option opts [String] :name Name of the maintenance window
|
359
|
+
# @option opts [Time] :end_at End of the maintenance window (RFC3339 format)
|
360
|
+
# @option opts [MaintenanceWindowRepeatInterval] :repeat_interval
|
361
|
+
# @option opts [Time] :start_at Start of the maintenance window (RFC3339 format)
|
362
|
+
# @option opts [Array<String>] :tags List of tags used to include matching uptime checks in this maintenance window
|
363
|
+
# @option opts [Array<String>] :tests List of uptime check IDs explicitly included in this maintenance window
|
364
|
+
# @option opts [String] :timezone Standard [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) associated with this maintenance window
|
365
|
+
# @return [nil]
|
366
|
+
def update_maintenance_window(window_id, opts = {})
|
367
|
+
update_maintenance_window_with_http_info(window_id, opts)
|
368
|
+
nil
|
369
|
+
end
|
370
|
+
|
371
|
+
# Update a maintenance window
|
372
|
+
# Updates a maintenance window with the given parameters.
|
373
|
+
# @param window_id [String] Maintenance window ID
|
374
|
+
# @param [Hash] opts the optional parameters
|
375
|
+
# @option opts [String] :name Name of the maintenance window
|
376
|
+
# @option opts [Time] :end_at End of the maintenance window (RFC3339 format)
|
377
|
+
# @option opts [MaintenanceWindowRepeatInterval] :repeat_interval
|
378
|
+
# @option opts [Time] :start_at Start of the maintenance window (RFC3339 format)
|
379
|
+
# @option opts [Array<String>] :tags List of tags used to include matching uptime checks in this maintenance window
|
380
|
+
# @option opts [Array<String>] :tests List of uptime check IDs explicitly included in this maintenance window
|
381
|
+
# @option opts [String] :timezone Standard [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) associated with this maintenance window
|
382
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
383
|
+
def update_maintenance_window_with_http_info(window_id, opts = {})
|
384
|
+
if @api_client.config.debugging
|
385
|
+
@api_client.config.logger.debug 'Calling API: MaintenanceWindowsApi.update_maintenance_window ...'
|
386
|
+
end
|
387
|
+
# verify the required parameter 'window_id' is set
|
388
|
+
if @api_client.config.client_side_validation && window_id.nil?
|
389
|
+
raise ArgumentError, "Missing the required parameter 'window_id' when calling MaintenanceWindowsApi.update_maintenance_window"
|
390
|
+
end
|
391
|
+
# resource path
|
392
|
+
local_var_path = '/maintenance-windows/{window_id}'.sub('{' + 'window_id' + '}', CGI.escape(window_id.to_s))
|
393
|
+
|
394
|
+
# query parameters
|
395
|
+
query_params = opts[:query_params] || {}
|
396
|
+
|
397
|
+
# header parameters
|
398
|
+
header_params = opts[:header_params] || {}
|
399
|
+
# HTTP header 'Accept' (if needed)
|
400
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
401
|
+
# HTTP header 'Content-Type'
|
402
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
403
|
+
unless content_type.nil?
|
404
|
+
header_params['Content-Type'] = content_type
|
405
|
+
end
|
406
|
+
|
407
|
+
# form parameters
|
408
|
+
form_params = opts[:form_params] || {}
|
409
|
+
form_params['name'] = opts[:'name'] unless opts[:'name'].nil?
|
410
|
+
form_params['end_at'] = opts[:'end_at'] unless opts[:'end_at'].nil?
|
411
|
+
form_params['repeat_interval'] = opts[:'repeat_interval'] unless opts[:'repeat_interval'].nil?
|
412
|
+
form_params['start_at'] = opts[:'start_at'] unless opts[:'start_at'].nil?
|
413
|
+
form_params['tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) unless opts[:'tags'].nil?
|
414
|
+
form_params['tests'] = @api_client.build_collection_param(opts[:'tests'], :csv) unless opts[:'tests'].nil?
|
415
|
+
form_params['timezone'] = opts[:'timezone'] unless opts[:'timezone'].nil?
|
416
|
+
|
417
|
+
# http body (model)
|
418
|
+
post_body = opts[:debug_body]
|
419
|
+
|
420
|
+
# return_type
|
421
|
+
return_type = opts[:debug_return_type]
|
422
|
+
|
423
|
+
# auth_names
|
424
|
+
auth_names = opts[:debug_auth_names] || []
|
425
|
+
|
426
|
+
new_options = opts.merge(
|
427
|
+
:operation => :'MaintenanceWindowsApi.update_maintenance_window',
|
428
|
+
:header_params => header_params,
|
429
|
+
:query_params => query_params,
|
430
|
+
:form_params => form_params,
|
431
|
+
:body => post_body,
|
432
|
+
:auth_names => auth_names,
|
433
|
+
:return_type => return_type,
|
434
|
+
)
|
435
|
+
|
436
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
437
|
+
if @api_client.config.debugging
|
438
|
+
@api_client.config.logger.debug "API called: MaintenanceWindowsApi#update_maintenance_window\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
439
|
+
end
|
440
|
+
|
441
|
+
[data, status_code, headers]
|
442
|
+
end
|
443
|
+
end
|
444
|
+
end
|