Class: RBACApiClient::GroupApi
- Inherits:
-
Object
- Object
- RBACApiClient::GroupApi
- Defined in:
- lib/insights-rbac-api-client/api/group_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_principal_to_group(uuid, group_principal_in, opts = {}) ⇒ GroupWithPrincipalsAndRoles
Add a principal to a group in the tenant.
-
#add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>
Add a principal to a group in the tenant.
-
#add_role_to_group(uuid, group_role_in, opts = {}) ⇒ AddRoleToGroup200Response
Add a role to a group in the tenant.
-
#add_role_to_group_with_http_info(uuid, group_role_in, opts = {}) ⇒ Array<(AddRoleToGroup200Response, Integer, Hash)>
Add a role to a group in the tenant.
-
#create_group(group, opts = {}) ⇒ GroupOut
Create a group in a tenant.
-
#create_group_with_http_info(group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>
Create a group in a tenant.
-
#delete_group(uuid, opts = {}) ⇒ nil
Delete a group in the tenant.
-
#delete_group_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a group in the tenant.
-
#delete_principal_from_group(uuid, usernames, opts = {}) ⇒ nil
Remove a principal from a group in the tenant.
-
#delete_principal_from_group_with_http_info(uuid, usernames, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Remove a principal from a group in the tenant.
-
#delete_role_from_group(uuid, roles, opts = {}) ⇒ nil
Remove a role from a group in the tenant.
-
#delete_role_from_group_with_http_info(uuid, roles, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Remove a role from a group in the tenant.
-
#get_group(uuid, opts = {}) ⇒ GroupWithPrincipalsAndRoles
Get a group in the tenant.
-
#get_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>
Get a group in the tenant.
-
#get_principals_from_group(uuid, opts = {}) ⇒ PrincipalPagination
Get a list of principals from a group in the tenant By default, responses are sorted in ascending order by username.
-
#get_principals_from_group_with_http_info(uuid, opts = {}) ⇒ Array<(PrincipalPagination, Integer, Hash)>
Get a list of principals from a group in the tenant By default, responses are sorted in ascending order by username.
-
#initialize(api_client = ApiClient.default) ⇒ GroupApi
constructor
A new instance of GroupApi.
-
#list_groups(opts = {}) ⇒ GroupPagination
List the groups for a tenant By default, responses are sorted in ascending order by group name.
-
#list_groups_with_http_info(opts = {}) ⇒ Array<(GroupPagination, Integer, Hash)>
List the groups for a tenant By default, responses are sorted in ascending order by group name.
-
#list_roles_for_group(uuid, opts = {}) ⇒ GroupRolesPagination
List the roles for a group in the tenant By default, responses are sorted in ascending order by role name.
-
#list_roles_for_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupRolesPagination, Integer, Hash)>
List the roles for a group in the tenant By default, responses are sorted in ascending order by role name.
-
#update_group(uuid, group, opts = {}) ⇒ GroupOut
Update a group in the tenant.
-
#update_group_with_http_info(uuid, group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>
Update a group in the tenant.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ GroupApi
Returns a new instance of GroupApi.
19 20 21 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#add_principal_to_group(uuid, group_principal_in, opts = {}) ⇒ GroupWithPrincipalsAndRoles
Add a principal to a group in the tenant
27 28 29 30 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 27 def add_principal_to_group(uuid, group_principal_in, opts = {}) data, _status_code, _headers = add_principal_to_group_with_http_info(uuid, group_principal_in, opts) data end |
#add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>
Add a principal to a group in the tenant
37 38 39 40 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 37 def add_principal_to_group_with_http_info(uuid, group_principal_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.add_principal_to_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_principal_to_group" end # verify the required parameter 'group_principal_in' is set if @api_client.config.client_side_validation && group_principal_in.nil? fail ArgumentError, "Missing the required parameter 'group_principal_in' when calling GroupApi.add_principal_to_group" end # resource path local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(group_principal_in) # return_type return_type = opts[:debug_return_type] || 'GroupWithPrincipalsAndRoles' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.add_principal_to_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#add_principal_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#add_role_to_group(uuid, group_role_in, opts = {}) ⇒ AddRoleToGroup200Response
Add a role to a group in the tenant
99 100 101 102 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 99 def add_role_to_group(uuid, group_role_in, opts = {}) data, _status_code, _headers = add_role_to_group_with_http_info(uuid, group_role_in, opts) data end |
#add_role_to_group_with_http_info(uuid, group_role_in, opts = {}) ⇒ Array<(AddRoleToGroup200Response, Integer, Hash)>
Add a role to a group in the tenant
109 110 111 112 113 114 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 109 def add_role_to_group_with_http_info(uuid, group_role_in, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.add_role_to_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.add_role_to_group" end # verify the required parameter 'group_role_in' is set if @api_client.config.client_side_validation && group_role_in.nil? fail ArgumentError, "Missing the required parameter 'group_role_in' when calling GroupApi.add_role_to_group" end # resource path local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(group_role_in) # return_type return_type = opts[:debug_return_type] || 'AddRoleToGroup200Response' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.add_role_to_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#add_role_to_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_group(group, opts = {}) ⇒ GroupOut
Create a group in a tenant
170 171 172 173 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 170 def create_group(group, opts = {}) data, _status_code, _headers = create_group_with_http_info(group, opts) data end |
#create_group_with_http_info(group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>
Create a group in a tenant
179 180 181 182 183 184 185 186 187 188 189 190 191 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 179 def create_group_with_http_info(group, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.create_group ...' end # verify the required parameter 'group' is set if @api_client.config.client_side_validation && group.nil? fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.create_group" end # resource path local_var_path = '/groups/' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(group) # return_type return_type = opts[:debug_return_type] || 'GroupOut' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.create_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#create_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_group(uuid, opts = {}) ⇒ nil
Delete a group in the tenant
236 237 238 239 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 236 def delete_group(uuid, opts = {}) delete_group_with_http_info(uuid, opts) nil end |
#delete_group_with_http_info(uuid, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a group in the tenant
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 287 288 289 290 291 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 245 def delete_group_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.delete_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_group" end # resource path local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # 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] # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.delete_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#delete_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_principal_from_group(uuid, usernames, opts = {}) ⇒ nil
Remove a principal from a group in the tenant
298 299 300 301 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 298 def delete_principal_from_group(uuid, usernames, opts = {}) delete_principal_from_group_with_http_info(uuid, usernames, opts) nil end |
#delete_principal_from_group_with_http_info(uuid, usernames, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Remove a principal from a group in the tenant
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 353 354 355 356 357 358 359 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 308 def delete_principal_from_group_with_http_info(uuid, usernames, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.delete_principal_from_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_principal_from_group" end # verify the required parameter 'usernames' is set if @api_client.config.client_side_validation && usernames.nil? fail ArgumentError, "Missing the required parameter 'usernames' when calling GroupApi.delete_principal_from_group" end # resource path local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'usernames'] = usernames # 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] # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.delete_principal_from_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#delete_principal_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_role_from_group(uuid, roles, opts = {}) ⇒ nil
Remove a role from a group in the tenant
366 367 368 369 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 366 def delete_role_from_group(uuid, roles, opts = {}) delete_role_from_group_with_http_info(uuid, roles, opts) nil end |
#delete_role_from_group_with_http_info(uuid, roles, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Remove a role from a group in the tenant
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 419 420 421 422 423 424 425 426 427 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 376 def delete_role_from_group_with_http_info(uuid, roles, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.delete_role_from_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.delete_role_from_group" end # verify the required parameter 'roles' is set if @api_client.config.client_side_validation && roles.nil? fail ArgumentError, "Missing the required parameter 'roles' when calling GroupApi.delete_role_from_group" end # resource path local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'roles'] = roles # 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] # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.delete_role_from_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#delete_role_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_group(uuid, opts = {}) ⇒ GroupWithPrincipalsAndRoles
Get a group in the tenant
433 434 435 436 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 433 def get_group(uuid, opts = {}) data, _status_code, _headers = get_group_with_http_info(uuid, opts) data end |
#get_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupWithPrincipalsAndRoles, Integer, Hash)>
Get a group in the tenant
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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 442 def get_group_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.get_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_group" end # resource path local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # 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] || 'GroupWithPrincipalsAndRoles' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.get_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#get_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_principals_from_group(uuid, opts = {}) ⇒ PrincipalPagination
Get a list of principals from a group in the tenant By default, responses are sorted in ascending order by username
501 502 503 504 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 501 def get_principals_from_group(uuid, opts = {}) data, _status_code, _headers = get_principals_from_group_with_http_info(uuid, opts) data end |
#get_principals_from_group_with_http_info(uuid, opts = {}) ⇒ Array<(PrincipalPagination, Integer, Hash)>
Get a list of principals from a group in the tenant By default, responses are sorted in ascending order by username
517 518 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 517 def get_principals_from_group_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.get_principals_from_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.get_principals_from_group" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'admin_only'] && !allowable_values.include?(opts[:'admin_only']) fail ArgumentError, "invalid value for \"admin_only\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.get_principals_from_group, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.get_principals_from_group, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.get_principals_from_group, must be greater than or equal to 0.' end allowable_values = ["username"] if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" end # resource path local_var_path = '/groups/{uuid}/principals/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'admin_only'] = opts[:'admin_only'] if !opts[:'admin_only'].nil? query_params[:'principal_username'] = opts[:'principal_username'] if !opts[:'principal_username'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'username_only'] = opts[:'username_only'] if !opts[:'username_only'].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] || 'PrincipalPagination' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.get_principals_from_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#get_principals_from_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_groups(opts = {}) ⇒ GroupPagination
List the groups for a tenant By default, responses are sorted in ascending order by group name
609 610 611 612 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 609 def list_groups(opts = {}) data, _status_code, _headers = list_groups_with_http_info(opts) data end |
#list_groups_with_http_info(opts = {}) ⇒ Array<(GroupPagination, Integer, Hash)>
List the groups for a tenant By default, responses are sorted in ascending order by group name
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 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 632 def list_groups_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.list_groups ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_groups, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_groups, must be greater than or equal to 0.' end allowable_values = ["partial", "exact"] if @api_client.config.client_side_validation && opts[:'name_match'] && !allowable_values.include?(opts[:'name_match']) fail ArgumentError, "invalid value for \"name_match\", must be one of #{allowable_values}" end allowable_values = ["account", "principal"] if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope']) fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}" end allowable_values = ["all", "any"] if @api_client.config.client_side_validation && opts[:'role_discriminator'] && !allowable_values.include?(opts[:'role_discriminator']) fail ArgumentError, "invalid value for \"role_discriminator\", must be one of #{allowable_values}" end allowable_values = ["name", "modified", "principalCount", "policyCount"] if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" end # resource path local_var_path = '/groups/' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'name_match'] = opts[:'name_match'] if !opts[:'name_match'].nil? query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil? query_params[:'username'] = opts[:'username'] if !opts[:'username'].nil? query_params[:'exclude_username'] = opts[:'exclude_username'] if !opts[:'exclude_username'].nil? query_params[:'uuid'] = @api_client.build_collection_param(opts[:'uuid'], :csv) if !opts[:'uuid'].nil? query_params[:'role_names'] = @api_client.build_collection_param(opts[:'role_names'], :csv) if !opts[:'role_names'].nil? query_params[:'role_discriminator'] = opts[:'role_discriminator'] if !opts[:'role_discriminator'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil? query_params[:'platform_default'] = opts[:'platform_default'] if !opts[:'platform_default'].nil? query_params[:'admin_default'] = opts[:'admin_default'] if !opts[:'admin_default'].nil? query_params[:'system'] = opts[:'system'] if !opts[:'system'].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] || 'GroupPagination' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.list_groups", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#list_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_roles_for_group(uuid, opts = {}) ⇒ GroupRolesPagination
List the roles for a group in the tenant By default, responses are sorted in ascending order by role name
732 733 734 735 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 732 def list_roles_for_group(uuid, opts = {}) data, _status_code, _headers = list_roles_for_group_with_http_info(uuid, opts) data end |
#list_roles_for_group_with_http_info(uuid, opts = {}) ⇒ Array<(GroupRolesPagination, Integer, Hash)>
List the roles for a group in the tenant By default, responses are sorted in ascending order by role name
751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 751 def list_roles_for_group_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.list_roles_for_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.list_roles_for_group" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling GroupApi.list_roles_for_group, must be greater than or equal to 0.' end allowable_values = ["name", "display_name", "modified", "policyCount"] if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" end # resource path local_var_path = '/groups/{uuid}/roles/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].nil? query_params[:'role_name'] = opts[:'role_name'] if !opts[:'role_name'].nil? query_params[:'role_display_name'] = opts[:'role_display_name'] if !opts[:'role_display_name'].nil? query_params[:'role_description'] = opts[:'role_description'] if !opts[:'role_description'].nil? query_params[:'role_system'] = opts[:'role_system'] if !opts[:'role_system'].nil? query_params[:'role_external_tenant'] = opts[:'role_external_tenant'] if !opts[:'role_external_tenant'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].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] || 'GroupRolesPagination' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.list_roles_for_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#list_roles_for_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_group(uuid, group, opts = {}) ⇒ GroupOut
Update a group in the tenant
829 830 831 832 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 829 def update_group(uuid, group, opts = {}) data, _status_code, _headers = update_group_with_http_info(uuid, group, opts) data end |
#update_group_with_http_info(uuid, group, opts = {}) ⇒ Array<(GroupOut, Integer, Hash)>
Update a group in the tenant
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 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 |
# File 'lib/insights-rbac-api-client/api/group_api.rb', line 839 def update_group_with_http_info(uuid, group, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GroupApi.update_group ...' end # verify the required parameter 'uuid' is set if @api_client.config.client_side_validation && uuid.nil? fail ArgumentError, "Missing the required parameter 'uuid' when calling GroupApi.update_group" end # verify the required parameter 'group' is set if @api_client.config.client_side_validation && group.nil? fail ArgumentError, "Missing the required parameter 'group' when calling GroupApi.update_group" end # resource path local_var_path = '/groups/{uuid}/'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(group) # return_type return_type = opts[:debug_return_type] || 'GroupOut' # auth_names auth_names = opts[:debug_auth_names] || ['basic_auth'] = opts.merge( :operation => :"GroupApi.update_group", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GroupApi#update_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |