Class: DatadogAPIClient::V2::DeploymentGatesAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/deployment_gates_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ DeploymentGatesAPI

Returns a new instance of DeploymentGatesAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#create_deployment_gate(body, opts = {}) ⇒ Object

Create deployment gate.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 29

def create_deployment_gate(body, opts = {})
  data, _status_code, _headers = create_deployment_gate_with_http_info(body, opts)
  data
end

#create_deployment_gate_with_http_info(body, opts = {}) ⇒ Array<(DeploymentGateResponse, Integer, Hash)>

Create deployment gate.

Endpoint to create a deployment gate.

Parameters:

Returns:

  • (Array<(DeploymentGateResponse, Integer, Hash)>)

    DeploymentGateResponse data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 41

def create_deployment_gate_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_deployment_gate".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_deployment_gate")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_deployment_gate"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.create_deployment_gate ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.create_deployment_gate"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :create_deployment_gate,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#create_deployment_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_deployment_rule(gate_id, body, opts = {}) ⇒ Object

Create deployment rule.



102
103
104
105
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 102

def create_deployment_rule(gate_id, body, opts = {})
  data, _status_code, _headers = create_deployment_rule_with_http_info(gate_id, body, opts)
  data
end

#create_deployment_rule_with_http_info(gate_id, body, opts = {}) ⇒ Array<(DeploymentRuleResponse, Integer, Hash)>

Create deployment rule.

Endpoint to create a deployment rule. A gate for the rule must already exist.

Parameters:

  • gate_id (String)

    The ID of the deployment gate.

  • body (CreateDeploymentRuleParams)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentRuleResponse, Integer, Hash)>)

    DeploymentRuleResponse data, response status code and response headers



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 115

def create_deployment_rule_with_http_info(gate_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_deployment_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_deployment_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_deployment_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.create_deployment_rule ...'
  end
  # verify the required parameter 'gate_id' is set
  if @api_client.config.client_side_validation && gate_id.nil?
    fail ArgumentError, "Missing the required parameter 'gate_id' when calling DeploymentGatesAPI.create_deployment_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.create_deployment_rule"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{gate_id}/rules'.sub('{gate_id}', CGI.escape(gate_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :create_deployment_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#create_deployment_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_deployment_gate(id, opts = {}) ⇒ Object

Delete deployment gate.



180
181
182
183
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 180

def delete_deployment_gate(id, opts = {})
  delete_deployment_gate_with_http_info(id, opts)
  nil
end

#delete_deployment_gate_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete deployment gate.

Endpoint to delete a deployment gate. Rules associated with the gate are also deleted.

Parameters:

  • id (String)

    The ID of the deployment gate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 192

def delete_deployment_gate_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_deployment_gate".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_deployment_gate")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_deployment_gate"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.delete_deployment_gate ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.delete_deployment_gate"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :delete_deployment_gate,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#delete_deployment_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_deployment_rule(gate_id, id, opts = {}) ⇒ Object

Delete deployment rule.



251
252
253
254
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 251

def delete_deployment_rule(gate_id, id, opts = {})
  delete_deployment_rule_with_http_info(gate_id, id, opts)
  nil
end

#delete_deployment_rule_with_http_info(gate_id, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete deployment rule.

Endpoint to delete a deployment rule.

Parameters:

  • gate_id (String)

    The ID of the deployment gate.

  • id (String)

    The ID of the deployment rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 264

def delete_deployment_rule_with_http_info(gate_id, id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_deployment_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_deployment_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_deployment_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.delete_deployment_rule ...'
  end
  # verify the required parameter 'gate_id' is set
  if @api_client.config.client_side_validation && gate_id.nil?
    fail ArgumentError, "Missing the required parameter 'gate_id' when calling DeploymentGatesAPI.delete_deployment_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.delete_deployment_rule"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{gate_id}/rules/{id}'.sub('{gate_id}', CGI.escape(gate_id.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :delete_deployment_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#delete_deployment_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment_gate(id, opts = {}) ⇒ Object

Get deployment gate.



327
328
329
330
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 327

def get_deployment_gate(id, opts = {})
  data, _status_code, _headers = get_deployment_gate_with_http_info(id, opts)
  data
end

#get_deployment_gate_rules(gate_id, opts = {}) ⇒ Object

Get rules for a deployment gate.



398
399
400
401
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 398

def get_deployment_gate_rules(gate_id, opts = {})
  data, _status_code, _headers = get_deployment_gate_rules_with_http_info(gate_id, opts)
  data
end

#get_deployment_gate_rules_with_http_info(gate_id, opts = {}) ⇒ Array<(DeploymentGateRulesResponse, Integer, Hash)>

Get rules for a deployment gate.

Endpoint to get rules for a deployment gate.

Parameters:

  • gate_id (String)

    The ID of the deployment gate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentGateRulesResponse, Integer, Hash)>)

    DeploymentGateRulesResponse data, response status code and response headers



410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 410

def get_deployment_gate_rules_with_http_info(gate_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_deployment_gate_rules".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_deployment_gate_rules")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_deployment_gate_rules"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.get_deployment_gate_rules ...'
  end
  # verify the required parameter 'gate_id' is set
  if @api_client.config.client_side_validation && gate_id.nil?
    fail ArgumentError, "Missing the required parameter 'gate_id' when calling DeploymentGatesAPI.get_deployment_gate_rules"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{gate_id}/rules'.sub('{gate_id}', CGI.escape(gate_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGateRulesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_deployment_gate_rules,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#get_deployment_gate_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment_gate_with_http_info(id, opts = {}) ⇒ Array<(DeploymentGateResponse, Integer, Hash)>

Get deployment gate.

Endpoint to get a deployment gate.

Parameters:

  • id (String)

    The ID of the deployment gate.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentGateResponse, Integer, Hash)>)

    DeploymentGateResponse data, response status code and response headers



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 339

def get_deployment_gate_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_deployment_gate".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_deployment_gate")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_deployment_gate"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.get_deployment_gate ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.get_deployment_gate"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_deployment_gate,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#get_deployment_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment_gates_evaluation_result(id, opts = {}) ⇒ Object

Get a deployment gate evaluation result.



469
470
471
472
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 469

def get_deployment_gates_evaluation_result(id, opts = {})
  data, _status_code, _headers = get_deployment_gates_evaluation_result_with_http_info(id, opts)
  data
end

#get_deployment_gates_evaluation_result_with_http_info(id, opts = {}) ⇒ Array<(DeploymentGatesEvaluationResultResponse, Integer, Hash)>

Get a deployment gate evaluation result.

Retrieves the result of a deployment gate evaluation by its evaluation ID. If the evaluation is still in progress, data.attributes.gate_status will be in_progress; continue polling until it returns pass or fail. Polling every 10-20 seconds is recommended. The endpoint may return a 404 if called too soon after triggering; retry after a few seconds.

Parameters:

  • id (UUID)

    The evaluation ID returned by the trigger endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 485

def get_deployment_gates_evaluation_result_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_deployment_gates_evaluation_result".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_deployment_gates_evaluation_result")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_deployment_gates_evaluation_result"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.get_deployment_gates_evaluation_result ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.get_deployment_gates_evaluation_result"
  end
  # resource path
  local_var_path = '/api/v2/deployments/gates/evaluation/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGatesEvaluationResultResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_deployment_gates_evaluation_result,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#get_deployment_gates_evaluation_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment_rule(gate_id, id, opts = {}) ⇒ Object

Get deployment rule.



544
545
546
547
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 544

def get_deployment_rule(gate_id, id, opts = {})
  data, _status_code, _headers = get_deployment_rule_with_http_info(gate_id, id, opts)
  data
end

#get_deployment_rule_with_http_info(gate_id, id, opts = {}) ⇒ Array<(DeploymentRuleResponse, Integer, Hash)>

Get deployment rule.

Endpoint to get a deployment rule.

Parameters:

  • gate_id (String)

    The ID of the deployment gate.

  • id (String)

    The ID of the deployment rule.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentRuleResponse, Integer, Hash)>)

    DeploymentRuleResponse data, response status code and response headers



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 557

def get_deployment_rule_with_http_info(gate_id, id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_deployment_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_deployment_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_deployment_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.get_deployment_rule ...'
  end
  # verify the required parameter 'gate_id' is set
  if @api_client.config.client_side_validation && gate_id.nil?
    fail ArgumentError, "Missing the required parameter 'gate_id' when calling DeploymentGatesAPI.get_deployment_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.get_deployment_rule"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{gate_id}/rules/{id}'.sub('{gate_id}', CGI.escape(gate_id.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :get_deployment_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#get_deployment_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_deployment_gates(opts = {}) ⇒ Object

Get all deployment gates.



620
621
622
623
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 620

def list_deployment_gates(opts = {})
  data, _status_code, _headers = list_deployment_gates_with_http_info(opts)
  data
end

#list_deployment_gates_with_http_info(opts = {}) ⇒ Array<(DeploymentGatesListResponse, Integer, Hash)>

Get all deployment gates.

Returns a paginated list of all deployment gates for the organization. Use page[cursor] and page[size] query parameters to paginate through results.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_cursor (String)

    Cursor for pagination. Use the meta.page.next_cursor value from the previous response.

  • :page_size (Integer)

    Number of results per page. Defaults to 50. Must be between 1 and 1000.

Returns:

  • (Array<(DeploymentGatesListResponse, Integer, Hash)>)

    DeploymentGatesListResponse data, response status code and response headers



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 634

def list_deployment_gates_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_deployment_gates".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_deployment_gates")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_deployment_gates"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.list_deployment_gates ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DeploymentGatesAPI.list_deployment_gates, must be smaller than or equal to 1000.'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling DeploymentGatesAPI.list_deployment_gates, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGatesListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :list_deployment_gates,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#list_deployment_gates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#trigger_deployment_gates_evaluation(body, opts = {}) ⇒ Object

Trigger a deployment gate evaluation.



697
698
699
700
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 697

def trigger_deployment_gates_evaluation(body, opts = {})
  data, _status_code, _headers = trigger_deployment_gates_evaluation_with_http_info(body, opts)
  data
end

#trigger_deployment_gates_evaluation_with_http_info(body, opts = {}) ⇒ Array<(DeploymentGatesEvaluationResponse, Integer, Hash)>

Trigger a deployment gate evaluation.

Triggers an asynchronous deployment gate evaluation for the given service and environment. Returns an evaluation ID that can be used to poll for the result via the GET /api/v2/deployments/gates/evaluation/{id} endpoint.

Parameters:

Returns:



711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 711

def trigger_deployment_gates_evaluation_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.trigger_deployment_gates_evaluation".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.trigger_deployment_gates_evaluation")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.trigger_deployment_gates_evaluation"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.trigger_deployment_gates_evaluation ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.trigger_deployment_gates_evaluation"
  end
  # resource path
  local_var_path = '/api/v2/deployments/gates/evaluation'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGatesEvaluationResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :trigger_deployment_gates_evaluation,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#trigger_deployment_gates_evaluation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_deployment_gate(id, body, opts = {}) ⇒ Object

Update deployment gate.



772
773
774
775
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 772

def update_deployment_gate(id, body, opts = {})
  data, _status_code, _headers = update_deployment_gate_with_http_info(id, body, opts)
  data
end

#update_deployment_gate_with_http_info(id, body, opts = {}) ⇒ Array<(DeploymentGateResponse, Integer, Hash)>

Update deployment gate.

Endpoint to update a deployment gate.

Parameters:

  • id (String)

    The ID of the deployment gate.

  • body (UpdateDeploymentGateParams)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentGateResponse, Integer, Hash)>)

    DeploymentGateResponse data, response status code and response headers



785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 785

def update_deployment_gate_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_deployment_gate".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_deployment_gate")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_deployment_gate"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.update_deployment_gate ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.update_deployment_gate"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.update_deployment_gate"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentGateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :update_deployment_gate,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#update_deployment_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_deployment_rule(gate_id, id, body, opts = {}) ⇒ Object

Update deployment rule.



850
851
852
853
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 850

def update_deployment_rule(gate_id, id, body, opts = {})
  data, _status_code, _headers = update_deployment_rule_with_http_info(gate_id, id, body, opts)
  data
end

#update_deployment_rule_with_http_info(gate_id, id, body, opts = {}) ⇒ Array<(DeploymentRuleResponse, Integer, Hash)>

Update deployment rule.

Endpoint to update a deployment rule.

Parameters:

  • gate_id (String)

    The ID of the deployment gate.

  • id (String)

    The ID of the deployment rule.

  • body (UpdateDeploymentRuleParams)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentRuleResponse, Integer, Hash)>)

    DeploymentRuleResponse data, response status code and response headers



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
# File 'lib/datadog_api_client/v2/api/deployment_gates_api.rb', line 864

def update_deployment_rule_with_http_info(gate_id, id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_deployment_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_deployment_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_deployment_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DeploymentGatesAPI.update_deployment_rule ...'
  end
  # verify the required parameter 'gate_id' is set
  if @api_client.config.client_side_validation && gate_id.nil?
    fail ArgumentError, "Missing the required parameter 'gate_id' when calling DeploymentGatesAPI.update_deployment_rule"
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DeploymentGatesAPI.update_deployment_rule"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling DeploymentGatesAPI.update_deployment_rule"
  end
  # resource path
  local_var_path = '/api/v2/deployment_gates/{gate_id}/rules/{id}'.sub('{gate_id}', CGI.escape(gate_id.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

  new_options = opts.merge(
    :operation => :update_deployment_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DeploymentGatesAPI#update_deployment_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end