def request_enroll(self, org_id='', user_id=''): """Requests for an enrollment with an Org which must be accepted or denied as a separate process. Membership in the ION Org is implied by registration with the system, so a membership association to the ION Org is not maintained. Throws a NotFound exception if neither id is found. @param org_id str @param user_id str @retval request_id str @throws NotFound object with specified id does not exist """ param_objects = self._validate_parameters(org_id=org_id, user_id=user_id) org = param_objects['org'] if org.name == ROOT_ION_ORG_NAME: raise BadRequest( "A request to enroll in the root ION Org is not allowed") #Initiate request req_obj = NegotiateRequestFactory.create_enrollment_request( org_id, user_id) req_id = self.request_handler.open_request(req_obj) return req_id
def request_enroll(self, org_id='', user_id=''): """Requests for an enrollment with an Org which must be accepted or denied as a separate process. Membership in the ION Org is implied by registration with the system, so a membership association to the ION Org is not maintained. Throws a NotFound exception if neither id is found. @param org_id str @param user_id str @retval request_id str @throws NotFound object with specified id does not exist """ param_objects = self._validate_parameters(org_id=org_id, user_id=user_id) org = param_objects['org'] if org.name == ROOT_ION_ORG_NAME: raise BadRequest("A request to enroll in the root ION Org is not allowed") #Initiate request req_obj = NegotiateRequestFactory.create_enrollment_request(org_id, user_id) req_id = self.request_handler.open_request(req_obj) return req_id