Method: OpenapiClient::ResourceRolesApi#add_parent_resource_role_with_http_info
- Defined in:
- lib/openapi_client/api/resource_roles_api.rb
#add_parent_resource_role_with_http_info(proj_id, env_id, resource_id, role_id, parent_role_id, opts = {}) ⇒ Array<(ResourceRoleRead, Integer, Hash)>
Add Parent Role This endpoint is part of the role hierarchy feature. Makes role with id `role_id` extend the role with id `parent_role_id`. In other words, `role_id` will automatically be assigned any permissions that are granted to `parent_role_id`. We can say the `role_id` extends `parent_role_id` or inherits from `parent_role_id`. If `role_id` is already an ancestor of `parent_role_id`, the request will fail with HTTP 400 to prevent a cycle in the role hierarchy. Both roles must be defined on the same resource, identified by id `resource_id`.
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 105 106 107 |
# File 'lib/openapi_client/api/resource_roles_api.rb', line 45 def add_parent_resource_role_with_http_info(proj_id, env_id, resource_id, role_id, parent_role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResourceRolesApi.add_parent_resource_role ...' end # verify the required parameter 'proj_id' is set if @api_client.config.client_side_validation && proj_id.nil? fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceRolesApi.add_parent_resource_role" end # verify the required parameter 'env_id' is set if @api_client.config.client_side_validation && env_id.nil? fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceRolesApi.add_parent_resource_role" 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 ResourceRolesApi.add_parent_resource_role" 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 ResourceRolesApi.add_parent_resource_role" end # verify the required parameter 'parent_role_id' is set if @api_client.config.client_side_validation && parent_role_id.nil? fail ArgumentError, "Missing the required parameter 'parent_role_id' when calling ResourceRolesApi.add_parent_resource_role" end # resource path local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}/parents/{parent_role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s)).sub('{' + 'parent_role_id' + '}', CGI.escape(parent_role_id.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] || 'ResourceRoleRead' # auth_names auth_names = opts[:debug_auth_names] || ['HTTPBearer'] = opts.merge( :operation => :"ResourceRolesApi.add_parent_resource_role", :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: ResourceRolesApi#add_parent_resource_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |