Class: DatadogAPIClient::V2::LogsRestrictionQueriesAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::LogsRestrictionQueriesAPI
- Defined in:
- lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_role_to_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Grant role to a restriction query.
-
#add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Grant role to a restriction query.
-
#create_restriction_query(body, opts = {}) ⇒ Object
Create a restriction query.
-
#create_restriction_query_with_http_info(body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Create a restriction query.
-
#delete_restriction_query(restriction_query_id, opts = {}) ⇒ Object
Delete a restriction query.
-
#delete_restriction_query_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a restriction query.
-
#get_restriction_query(restriction_query_id, opts = {}) ⇒ Object
Get a restriction query.
-
#get_restriction_query_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(RestrictionQueryWithRelationshipsResponse, Integer, Hash)>
Get a restriction query.
-
#get_role_restriction_query(role_id, opts = {}) ⇒ Object
Get restriction query for a given role.
-
#get_role_restriction_query_with_http_info(role_id, opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
Get restriction query for a given role.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ LogsRestrictionQueriesAPI
constructor
A new instance of LogsRestrictionQueriesAPI.
-
#list_restriction_queries(opts = {}) ⇒ Object
List restriction queries.
-
#list_restriction_queries_with_http_info(opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
List restriction queries.
-
#list_restriction_query_roles(restriction_query_id, opts = {}) ⇒ Object
List roles for a restriction query.
-
#list_restriction_query_roles_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(RestrictionQueryRolesResponse, Integer, Hash)>
List roles for a restriction query.
-
#list_user_restriction_queries(user_id, opts = {}) ⇒ Object
Get all restriction queries for a given user.
-
#list_user_restriction_queries_with_http_info(user_id, opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
Get all restriction queries for a given user.
-
#remove_role_from_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Revoke role from a restriction query.
-
#remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revoke role from a restriction query.
-
#replace_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Replace a restriction query.
-
#replace_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Replace a restriction query.
-
#update_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Update a restriction query.
-
#update_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Update a restriction query.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ LogsRestrictionQueriesAPI
Returns a new instance of LogsRestrictionQueriesAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_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/logs_restriction_queries_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#add_role_to_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Grant role to a restriction query.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 29 def add_role_to_restriction_query(restriction_query_id, body, opts = {}) add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts) nil end |
#add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Grant role to a restriction query.
Adds a role to a restriction query.
Note: This operation automatically grants the ‘logs_read_data` permission to the role if it doesn’t already have it.
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 98 99 100 101 102 103 104 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 44 def add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.add_role_to_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_role_to_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.add_role_to_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.add_role_to_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.add_role_to_restriction_query" 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 LogsRestrictionQueriesAPI.add_role_to_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_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(['*/*']) # 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] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :add_role_to_restriction_query, :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: LogsRestrictionQueriesAPI#add_role_to_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_restriction_query(body, opts = {}) ⇒ Object
Create a restriction query.
109 110 111 112 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 109 def create_restriction_query(body, opts = {}) data, _status_code, _headers = create_restriction_query_with_http_info(body, opts) data end |
#create_restriction_query_with_http_info(body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Create a restriction query.
Create a new restriction query for your organization.
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 176 177 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 121 def create_restriction_query_with_http_info(body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.create_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.create_restriction_query ...' 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 LogsRestrictionQueriesAPI.create_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries' # 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] || 'RestrictionQueryWithoutRelationshipsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :create_restriction_query, :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: LogsRestrictionQueriesAPI#create_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_restriction_query(restriction_query_id, opts = {}) ⇒ Object
Delete a restriction query.
182 183 184 185 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 182 def delete_restriction_query(restriction_query_id, opts = {}) delete_restriction_query_with_http_info(restriction_query_id, opts) nil end |
#delete_restriction_query_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a restriction query.
Deletes a restriction query.
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 247 248 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 194 def delete_restriction_query_with_http_info(restriction_query_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.delete_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.delete_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.delete_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_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] = opts.merge( :operation => :delete_restriction_query, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#delete_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_restriction_query(restriction_query_id, opts = {}) ⇒ Object
Get a restriction query.
253 254 255 256 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 253 def get_restriction_query(restriction_query_id, opts = {}) data, _status_code, _headers = get_restriction_query_with_http_info(restriction_query_id, opts) data end |
#get_restriction_query_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(RestrictionQueryWithRelationshipsResponse, Integer, Hash)>
Get a restriction query.
Get a restriction query in the organization specified by the restriction query’s ‘restriction_query_id`.
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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 265 def get_restriction_query_with_http_info(restriction_query_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.get_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_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] || 'RestrictionQueryWithRelationshipsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_restriction_query, :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: LogsRestrictionQueriesAPI#get_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_role_restriction_query(role_id, opts = {}) ⇒ Object
Get restriction query for a given role.
324 325 326 327 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 324 def get_role_restriction_query(role_id, opts = {}) data, _status_code, _headers = get_role_restriction_query_with_http_info(role_id, opts) data end |
#get_role_restriction_query_with_http_info(role_id, opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
Get restriction query for a given role.
Get restriction query for a given role.
336 337 338 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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 336 def get_role_restriction_query_with_http_info(role_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.get_role_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_role_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_role_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_role_restriction_query ...' end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling LogsRestrictionQueriesAPI.get_role_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/role/{role_id}'.sub('{role_id}', CGI.escape(role_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] || 'RestrictionQueryListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :get_role_restriction_query, :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: LogsRestrictionQueriesAPI#get_role_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_restriction_queries(opts = {}) ⇒ Object
List restriction queries.
395 396 397 398 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 395 def list_restriction_queries(opts = {}) data, _status_code, _headers = list_restriction_queries_with_http_info(opts) data end |
#list_restriction_queries_with_http_info(opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
List restriction queries.
Returns all restriction queries, including their names and IDs.
408 409 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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 408 def list_restriction_queries_with_http_info(opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_queries".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_queries") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_queries")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_queries ...' end # resource path local_var_path = '/api/v2/logs/config/restriction_queries' # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].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] || 'RestrictionQueryListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_restriction_queries, :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: LogsRestrictionQueriesAPI#list_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_restriction_query_roles(restriction_query_id, opts = {}) ⇒ Object
List roles for a restriction query.
465 466 467 468 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 465 def list_restriction_query_roles(restriction_query_id, opts = {}) data, _status_code, _headers = list_restriction_query_roles_with_http_info(restriction_query_id, opts) data end |
#list_restriction_query_roles_with_http_info(restriction_query_id, opts = {}) ⇒ Array<(RestrictionQueryRolesResponse, Integer, Hash)>
List roles for a restriction query.
Returns all roles that have a given restriction query.
479 480 481 482 483 484 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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 479 def list_restriction_query_roles_with_http_info(restriction_query_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_query_roles".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_query_roles") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_query_roles")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_query_roles ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.list_restriction_query_roles" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].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] || 'RestrictionQueryRolesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_restriction_query_roles, :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: LogsRestrictionQueriesAPI#list_restriction_query_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_user_restriction_queries(user_id, opts = {}) ⇒ Object
Get all restriction queries for a given user.
540 541 542 543 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 540 def list_user_restriction_queries(user_id, opts = {}) data, _status_code, _headers = list_user_restriction_queries_with_http_info(user_id, opts) data end |
#list_user_restriction_queries_with_http_info(user_id, opts = {}) ⇒ Array<(RestrictionQueryListResponse, Integer, Hash)>
Get all restriction queries for a given user.
Get all restriction queries for a given user.
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 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 552 def list_user_restriction_queries_with_http_info(user_id, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_user_restriction_queries".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_user_restriction_queries") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_user_restriction_queries")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_user_restriction_queries ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling LogsRestrictionQueriesAPI.list_user_restriction_queries" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/user/{user_id}'.sub('{user_id}', CGI.escape(user_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] || 'RestrictionQueryListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :list_user_restriction_queries, :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: LogsRestrictionQueriesAPI#list_user_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#remove_role_from_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Revoke role from a restriction query.
611 612 613 614 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 611 def remove_role_from_restriction_query(restriction_query_id, body, opts = {}) remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts) nil end |
#remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revoke role from a restriction query.
Removes a role from a restriction query.
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 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 624 def remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.remove_role_from_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_role_from_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_role_from_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.remove_role_from_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.remove_role_from_restriction_query" 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 LogsRestrictionQueriesAPI.remove_role_from_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_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(['*/*']) # 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] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :remove_role_from_restriction_query, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#remove_role_from_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#replace_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Replace a restriction query.
689 690 691 692 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 689 def replace_restriction_query(restriction_query_id, body, opts = {}) data, _status_code, _headers = replace_restriction_query_with_http_info(restriction_query_id, body, opts) data end |
#replace_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Replace a restriction query.
Replace a restriction query.
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 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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 702 def replace_restriction_query_with_http_info(restriction_query_id, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.replace_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.replace_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.replace_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.replace_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.replace_restriction_query" 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 LogsRestrictionQueriesAPI.replace_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_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] || 'RestrictionQueryWithoutRelationshipsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :replace_restriction_query, :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#replace_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_restriction_query(restriction_query_id, body, opts = {}) ⇒ Object
Update a restriction query.
767 768 769 770 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 767 def update_restriction_query(restriction_query_id, body, opts = {}) data, _status_code, _headers = update_restriction_query_with_http_info(restriction_query_id, body, opts) data end |
#update_restriction_query_with_http_info(restriction_query_id, body, opts = {}) ⇒ Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>
Update a restriction query.
Edit a restriction query.
780 781 782 783 784 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 |
# File 'lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb', line 780 def update_restriction_query_with_http_info(restriction_query_id, body, opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.update_restriction_query".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_restriction_query") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_restriction_query")) end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.update_restriction_query ...' end # verify the required parameter 'restriction_query_id' is set if @api_client.config.client_side_validation && restriction_query_id.nil? fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.update_restriction_query" 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 LogsRestrictionQueriesAPI.update_restriction_query" end # resource path local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_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] || 'RestrictionQueryWithoutRelationshipsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] = opts.merge( :operation => :update_restriction_query, :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::Patch, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#update_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |