Class: DatadogAPIClient::V2::CSMOwnershipAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::CSMOwnershipAPI
- Defined in:
- lib/datadog_api_client/v2/api/csm_ownership_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_ownership_feedback(resource_id, owner_type, body, opts = {}) ⇒ Object
Submit feedback on an ownership inference.
-
#create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts = {}) ⇒ Array<(OwnershipFeedbackResponse, Integer, Hash)>
Submit feedback on an ownership inference.
-
#get_ownership_evidence(resource_id, owner_type, opts = {}) ⇒ Object
Get the evidence for an ownership inference.
-
#get_ownership_evidence_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipEvidenceResponse, Integer, Hash)>
Get the evidence for an ownership inference.
-
#get_ownership_inference(resource_id, owner_type, opts = {}) ⇒ Object
Get an ownership inference by owner type.
-
#get_ownership_inference_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipInferenceResponse, Integer, Hash)>
Get an ownership inference by owner type.
-
#get_ownership_settings(opts = {}) ⇒ Object
Get ownership settings for the org.
-
#get_ownership_settings_with_http_info(opts = {}) ⇒ Array<(OwnershipSettingsResponse, Integer, Hash)>
Get ownership settings for the org.
-
#get_ownership_untagged_findings(opts = {}) ⇒ Object
Count untagged findings by ownership confidence.
-
#get_ownership_untagged_findings_with_http_info(opts = {}) ⇒ Array<(OwnershipUntaggedFindingsResponse, Integer, Hash)>
Count untagged findings by ownership confidence.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ CSMOwnershipAPI
constructor
A new instance of CSMOwnershipAPI.
-
#list_ownership_history(resource_id, opts = {}) ⇒ Object
List ownership inference history for a resource.
-
#list_ownership_history_by_owner_type(resource_id, owner_type, opts = {}) ⇒ Object
List ownership history by owner type.
-
#list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipHistoryResponse, Integer, Hash)>
List ownership history by owner type.
-
#list_ownership_history_with_http_info(resource_id, opts = {}) ⇒ Array<(OwnershipHistoryResponse, Integer, Hash)>
List ownership inference history for a resource.
-
#list_ownership_inferences(resource_id, opts = {}) ⇒ Object
List ownership inferences for a resource.
-
#list_ownership_inferences_with_http_info(resource_id, opts = {}) ⇒ Array<(OwnershipInferenceListResponse, Integer, Hash)>
List ownership inferences for a resource.
-
#post_ownership_settings(body, opts = {}) ⇒ Object
Update ownership settings for the org.
-
#post_ownership_settings_with_http_info(body, opts = {}) ⇒ Array<(OwnershipSettingsResponse, Integer, Hash)>
Update ownership settings for the org.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ CSMOwnershipAPI
Returns a new instance of CSMOwnershipAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#create_ownership_feedback(resource_id, owner_type, body, opts = {}) ⇒ Object
Submit feedback on an ownership inference.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 29 def create_ownership_feedback(resource_id, owner_type, body, opts = {}) data, _status_code, _headers = create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts) data end |
#create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts = {}) ⇒ Array<(OwnershipFeedbackResponse, Integer, Hash)>
Submit feedback on an ownership inference.
Submit feedback on the current ownership inference for a resource and owner type. Valid actions are confirm, reject, correct, and persist.
The request must include the current inference checksum in inference_checksum. If the checksum does not match the current inference state, the endpoint returns 409 Conflict.
When action is correct, corrected_owner_handle and corrected_owner_type are required.
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 47 def create_ownership_feedback_with_http_info(resource_id, owner_type, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_ownership_feedback".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ownership_feedback") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ownership_feedback")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.create_ownership_feedback ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.create_ownership_feedback" end # verify the required parameter 'owner_type' is set if @api_client.config.client_side_validation && owner_type.nil? fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.create_ownership_feedback" end # verify enum value allowable_values = ['user', 'team', 'service', 'unknown'] if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" 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 CSMOwnershipAPI.create_ownership_feedback" end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/feedback'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.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] || 'OwnershipFeedbackResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :create_ownership_feedback, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#create_ownership_feedback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ownership_evidence(resource_id, owner_type, opts = {}) ⇒ Object
Get the evidence for an ownership inference.
121 122 123 124 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 121 def get_ownership_evidence(resource_id, owner_type, opts = {}) data, _status_code, _headers = get_ownership_evidence_with_http_info(resource_id, owner_type, opts) data end |
#get_ownership_evidence_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipEvidenceResponse, Integer, Hash)>
Get the evidence for an ownership inference.
Get the evidence versions backing the current ownership inference for a resource and owner type.
This endpoint supports weak ETag caching. Pass the previously returned ETag value in the If-None-Match request header to receive a 304 Not Modified response when the evidence has not changed.
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 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 137 def get_ownership_evidence_with_http_info(resource_id, owner_type, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_evidence".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_evidence") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_evidence")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_evidence ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.get_ownership_evidence" end # verify the required parameter 'owner_type' is set if @api_client.config.client_side_validation && owner_type.nil? fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.get_ownership_evidence" end # verify enum value allowable_values = ['user', 'team', 'service', 'unknown'] if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/evidence'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.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']) header_params['If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OwnershipEvidenceResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_ownership_evidence, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#get_ownership_evidence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ownership_inference(resource_id, owner_type, opts = {}) ⇒ Object
Get an ownership inference by owner type.
206 207 208 209 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 206 def get_ownership_inference(resource_id, owner_type, opts = {}) data, _status_code, _headers = get_ownership_inference_with_http_info(resource_id, owner_type, opts) data end |
#get_ownership_inference_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipInferenceResponse, Integer, Hash)>
Get an ownership inference by owner type.
Get the current ownership inference for a resource for a specific owner type.
This endpoint supports ETag-based caching. Pass the previously returned ETag value in the If-None-Match request header to receive a 304 Not Modified response when the inference has not changed.
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 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 222 def get_ownership_inference_with_http_info(resource_id, owner_type, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_inference".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_inference") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_inference")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_inference ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.get_ownership_inference" end # verify the required parameter 'owner_type' is set if @api_client.config.client_side_validation && owner_type.nil? fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.get_ownership_inference" end # verify enum value allowable_values = ['user', 'team', 'service', 'unknown'] if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.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']) header_params['If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OwnershipInferenceResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_ownership_inference, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#get_ownership_inference\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ownership_settings(opts = {}) ⇒ Object
Get ownership settings for the org.
291 292 293 294 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 291 def get_ownership_settings(opts = {}) data, _status_code, _headers = get_ownership_settings_with_http_info(opts) data end |
#get_ownership_settings_with_http_info(opts = {}) ⇒ Array<(OwnershipSettingsResponse, Integer, Hash)>
Get ownership settings for the org.
Get ownership settings for the org. When settings are unset, the API returns the default opt-out configuration with auto_tag set to true and confidence_level set to high.
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 302 def get_ownership_settings_with_http_info(opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_settings".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_settings") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_settings")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_settings ...' end # resource path local_var_path = '/api/v2/csm/ownership/settings' # 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] || 'OwnershipSettingsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_ownership_settings, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#get_ownership_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_ownership_untagged_findings(opts = {}) ⇒ Object
Count untagged findings by ownership confidence.
357 358 359 360 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 357 def get_ownership_untagged_findings(opts = {}) data, _status_code, _headers = get_ownership_untagged_findings_with_http_info(opts) data end |
#get_ownership_untagged_findings_with_http_info(opts = {}) ⇒ Array<(OwnershipUntaggedFindingsResponse, Integer, Hash)>
Count untagged findings by ownership confidence.
Count findings with no team tag, grouped by ownership confidence level.
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 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 368 def get_ownership_untagged_findings_with_http_info(opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_ownership_untagged_findings".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ownership_untagged_findings") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ownership_untagged_findings")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.get_ownership_untagged_findings ...' end # resource path local_var_path = '/api/v2/csm/ownership/settings/untagged' # 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] || 'OwnershipUntaggedFindingsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_ownership_untagged_findings, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#get_ownership_untagged_findings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ownership_history(resource_id, opts = {}) ⇒ Object
List ownership inference history for a resource.
423 424 425 426 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 423 def list_ownership_history(resource_id, opts = {}) data, _status_code, _headers = list_ownership_history_with_http_info(resource_id, opts) data end |
#list_ownership_history_by_owner_type(resource_id, owner_type, opts = {}) ⇒ Object
List ownership history by owner type.
504 505 506 507 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 504 def list_ownership_history_by_owner_type(resource_id, owner_type, opts = {}) data, _status_code, _headers = list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts) data end |
#list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts = {}) ⇒ Array<(OwnershipHistoryResponse, Integer, Hash)>
List ownership history by owner type.
List inference history entries for a resource filtered by owner type, ordered from most recent to oldest. Uses cursor-based pagination.
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 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 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 519 def list_ownership_history_by_owner_type_with_http_info(resource_id, owner_type, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_history_by_owner_type".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_history_by_owner_type") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_history_by_owner_type")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_history_by_owner_type ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_history_by_owner_type" end # verify the required parameter 'owner_type' is set if @api_client.config.client_side_validation && owner_type.nil? fail ArgumentError, "Missing the required parameter 'owner_type' when calling CSMOwnershipAPI.list_ownership_history_by_owner_type" end # verify enum value allowable_values = ['user', 'team', 'service', 'unknown'] if @api_client.config.client_side_validation && !allowable_values.include?(owner_type) fail ArgumentError, "invalid value for \"owner_type\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history_by_owner_type, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history_by_owner_type, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}/{owner_type}/history'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')).sub('{owner_type}', CGI.escape(owner_type.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'OwnershipHistoryResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_ownership_history_by_owner_type, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#list_ownership_history_by_owner_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ownership_history_with_http_info(resource_id, opts = {}) ⇒ Array<(OwnershipHistoryResponse, Integer, Hash)>
List ownership inference history for a resource.
List inference history entries for a resource across all owner types, ordered from most recent to oldest. Uses cursor-based pagination.
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 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 437 def list_ownership_history_with_http_info(resource_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_history".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_history") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_history")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_history ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_history" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CSMOwnershipAPI.list_ownership_history, must be greater than or equal to 1.' end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}/history'.sub('{resource_id}', CGI.escape(resource_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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] || 'OwnershipHistoryResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_ownership_history, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#list_ownership_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_ownership_inferences(resource_id, opts = {}) ⇒ Object
List ownership inferences for a resource.
595 596 597 598 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 595 def list_ownership_inferences(resource_id, opts = {}) data, _status_code, _headers = list_ownership_inferences_with_http_info(resource_id, opts) data end |
#list_ownership_inferences_with_http_info(resource_id, opts = {}) ⇒ Array<(OwnershipInferenceListResponse, Integer, Hash)>
List ownership inferences for a resource.
Get all current ownership inferences for a resource, one per owner type (user, team, service, unknown).
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 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 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 607 def list_ownership_inferences_with_http_info(resource_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_ownership_inferences".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ownership_inferences") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ownership_inferences")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.list_ownership_inferences ...' end # verify the required parameter 'resource_id' is set if @api_client.config.client_side_validation && resource_id.nil? fail ArgumentError, "Missing the required parameter 'resource_id' when calling CSMOwnershipAPI.list_ownership_inferences" end # resource path local_var_path = '/api/v2/csm/ownership/{resource_id}'.sub('{resource_id}', CGI.escape(resource_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] || 'OwnershipInferenceListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_ownership_inferences, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#list_ownership_inferences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_ownership_settings(body, opts = {}) ⇒ Object
Update ownership settings for the org.
666 667 668 669 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 666 def post_ownership_settings(body, opts = {}) data, _status_code, _headers = post_ownership_settings_with_http_info(body, opts) data end |
#post_ownership_settings_with_http_info(body, opts = {}) ⇒ Array<(OwnershipSettingsResponse, Integer, Hash)>
Update ownership settings for the org.
Update ownership settings for the org.
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 |
# File 'lib/datadog_api_client/v2/api/csm_ownership_api.rb', line 678 def post_ownership_settings_with_http_info(body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.post_ownership_settings".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.post_ownership_settings") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.post_ownership_settings")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CSMOwnershipAPI.post_ownership_settings ...' 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 CSMOwnershipAPI.post_ownership_settings" end # resource path local_var_path = '/api/v2/csm/ownership/settings' # 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] || 'OwnershipSettingsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :post_ownership_settings, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: CSMOwnershipAPI#post_ownership_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |