def register_url_rules(self): self.flask_app.add_url_rule('/clients/show', 'get_clients', api_key_required(self.show_clients)) self.flask_app.add_url_rule('/client/register', 'register_client', self.register_client, methods=["POST"]) self.flask_app.add_url_rule('/clients/working', 'get_clients_working', api_key_required(self.working_clients), methods=['GET']) self.flask_app.add_url_rule('/clients/<path:client_ip>/still_working/<path:action_instance_id>', 'client_still_working_on', api_key_required(self.client_still_working_on), methods=['GET']) self.flask_app.add_url_rule('/clients/verify_working', 'client_verify_working', api_key_required(self.client_verify_working), methods=['GET']) self.flask_app.register_error_handler(HttpException, self.http_exception_handler) self.flask_app.register_error_handler(VcsNotFoundException, self.http_exception_handler)
def register_url_rules(self, flask_app): self.app = flask_app flask_app.add_url_rule('/api/pipelines/create', 'create_pipeline', api_key_required(self.create_pipeline), methods=['POST']) flask_app.add_url_rule('/api/pipelines/<int:pipeline_id>/start', 'start_pipeline_instance', api_key_required(self.start_pipeline_instance), methods=['POST'])
def register_url_rules(self, flask_app): self.app = flask_app flask_app.add_url_rule("/api/qa_tests/analysis", 'qa_tests_analysis', api_key_required(self.analyze_qa_tests), methods=['POST']) flask_app.add_url_rule( "/api/qa_test_mappings/coverage/<path:pipeline_instance_id>", 'qa_test_mapping_coverage', api_key_required(self.get_qa_testmap_coverage), methods=['GET'])
def configure_urls(self): if self.flask_app: self.flask_app.add_url_rule(Constants.get_api_url("releases/<int:release_id>/step/<path:step_id>/<path:status>"), "status_step", api_key_required(self.status_step), methods=["POST"]) self.flask_app.add_url_rule(Constants.get_api_url("releases/<path:commit_identifier>/step/<path:step_custom_id>/<path:status_name>"), "mark_step_for_commit", api_key_required(self.mark_step_for_commit), methods=['POST'])
def register_url_rules(self, flask_app): """ This is the entry point for the controller. All URL ruls are add_url_rule(d) here. :param flask_app: The app you want to add a url to :return: void """ flask_app.add_url_rule('/work/request', 'work_request', api_key_required(self.work_request)) flask_app.add_url_rule('/work/execute', 'work_execute', api_key_required(self.work_execute), methods=['POST']) flask_app.add_url_rule('/work/cancel/<path:action_instance_id>', 'work_cancel', api_key_required(self.work_cancel), methods=['POST']) self.app = flask_app
def register_url_rules(self, flask_app): flask_app.add_url_rule('/api/<path:endpoint>', 'api_list', api_key_required(self.list), methods=['GET', 'POST']) flask_app.add_url_rule('/api/<path:endpoint>/metadata', 'api_meta', api_key_required(self.metadata), methods=['GET']) flask_app.add_url_rule('/api/metadata', 'all_api_meta', api_key_required(self.metadata), methods=['GET']) flask_app.add_url_rule('/api/bulk_create', 'bulk_create', api_key_required(self.bulk_create), methods=['PUT']) flask_app.add_url_rule('/api/<path:endpoint>', 'create_object', api_key_required(self.create), methods=['PUT']) flask_app.add_url_rule('/api/<path:endpoint>/<int:_id>', 'edit_object', api_key_required(self.edit_object), methods=['POST']) flask_app.add_url_rule('/api/<path:endpoint>/<int:_id>', 'delete_object', api_key_required(self.delete_object), methods=['DELETE']) flask_app.add_url_rule('/api/<path:endpoint>/<int:_id>', 'list_object', api_key_required(self.list_single_object), methods=['GET']) flask_app.add_url_rule('/api/action_instances/<int:_id>/done', 'finish_action_instance', api_key_required(self.finish_action_instance), methods=['POST']) flask_app.add_url_rule('/api/action_instances/<int:_id>/callback', 'callback_action_instance', api_key_required(self.callback_action_instance), methods=['POST']) flask_app.add_url_rule('/api/action_instances/<int:_id>/reset', 'reset_action_instance', api_key_required(self.reset_action_instance), methods=['POST']) flask_app.add_url_rule('/api/action_instances/<int:_id>/results', 'action_instance_results', api_key_required(self.action_instance_results), methods=['GET']) flask_app.add_url_rule( '/api/action_instances/<int:action_instance_id>/work_request', 'action_instance_work_request', api_key_required(self.action_instance_work_request), methods=['GET']), flask_app.add_url_rule( '/api/action_instances/<int:action_instance_id>/is_completing', 'action_instance_is_completing', api_key_required(self.action_instance_is_completing), methods=['GET']) flask_app.add_url_rule( '/api/action_instances/<int:action_instance_id>/clear_completing', 'action_instance_clear_completing', api_key_required(self.action_instance_clear_completing), methods=['GET']) flask_app.add_url_rule( '/api/pipeline_instances/<int:_id>/failure_count', 'failure_count_instance', api_key_required(self.failure_count_instance)) flask_app.add_url_rule('/api/queue', 'get_queue', api_key_required(self.get_queue), methods=['GET']) flask_app.add_url_rule('/api/pipeline_instances/<int:_id>/reset', 'reset_pipeline_instance', api_key_required(self.reset_pipeline_instance), methods=['POST', 'GET']) flask_app.add_url_rule("/api/reports/canned/<path:report_name>", 'canned_report', api_key_required(self.canned_report), methods=['GET']) flask_app.add_url_rule("/api/reports/canned/list", 'list_canned_report', api_key_required(self.list_canned_reports), methods=['GET']) flask_app.add_url_rule( "/api/pipeline_instances/<int:pipeline_instance_id>/cancel", "cancel_pipeline_instance", api_key_required(self.cancel_pipeline_instance), methods=['POST']) flask_app.add_url_rule( "/api/action_instances/<int:action_instance_id>/cancel", "cancel_action_instance", api_key_required(self.cancel_action_instance), methods=['POST']) flask_app.add_url_rule( "/api/pipeline_instances/<int:pipeline_instance_id>/print", "print_pipeline_instance", api_key_required(self.print_pipeline_instance), methods=['GET']) flask_app.add_url_rule("/api/canary", "canary_endpoint", self.get_canary, methods=['GET']) self.app = flask_app
def register_url_rules(self): self.flask_app.add_url_rule( "/api/commits/<path:commit_identifier>/version", "create_version_for_commit", api_key_required(self.create_version_for_commit), methods=["PUT"])
def configure_routing(self): self.flask_app.add_url_rule('/api/upgrade/<path:version>', 'upgrade_master', api_key_required(self.upgrade_master), methods=['POST'])
def register_url_rules(self, flask_app): flask_app.add_url_rule('/fire_registration', 'registration', api_key_required(self.fire_registration)) self.flask_app = flask_app