Exemplo n.º 1
0
Arquivo: cmsi.py Projeto: pagezhou/DOP
    def __init__(self):
        try:
            from config.domains import CMSI_API_ROOT

            self.get_msg_type = DataAPI(
                method="POST",
                url=CMSI_API_ROOT + "get_msg_type/",
                module="TOF",
                description="支持发送消息的类型",
                before_request=before_send_cmsi_api,
            )
            self.send_mail = DataAPI(
                method="POST",
                url=CMSI_API_ROOT + "send_mail/",
                module="CMSI",
                description=u"发送邮件",
                before_request=before_send_cmsi_api,
            )
            self.send_sms = DataAPI(
                method="POST",
                url=CMSI_API_ROOT + "send_sms/",
                module="CMSI",
                description=u"发送短信通知",
                before_request=before_send_cmsi_sms,
            )
            self.send_wechat = DataAPI(
                method="POST",
                url=CMSI_API_ROOT + "send_weixin/",
                module="CMSI",
                description=u"发送微信通知",
                before_request=before_send_cmsi_wechat,
            )
        except ImportError:
            logger.error(u"无法在配置文件中找到CMSI_API_ROOT")
Exemplo n.º 2
0
 def __init__(self):
     self.get_all_user = DataAPI(
         method="POST",
         url=BK_LOGIN_APIGATEWAY_ROOT + "get_all_user/",
         module=self.MODULE,
         description=u"获取所有用户",
         before_request=add_esb_info_before_request,
         cache_time=300,
     )
     self.get_user = DataAPI(
         method="POST",
         url=BK_LOGIN_APIGATEWAY_ROOT + "get_user/",
         module=self.MODULE,
         description=u"获取单个用户",
         before_request=add_esb_info_before_request,
     )
Exemplo n.º 3
0
 def __init__(self):
     self.get_app_info = DataAPI(
         method="GET",
         url=BK_PAAS_APIGATEWAY_ROOT + "get_app_info/",
         module=self.MODULE,
         description=u"获取app信息",
         before_request=add_esb_info_before_request,
     )
Exemplo n.º 4
0
 def __init__(self):
     self.get_agent_status = DataAPI(
         method="POST",
         url=GSE_APIGATEWAY_ROOT_V2 + "get_agent_status",
         module=self.MODULE,
         description=_("获取agent状态"),
         before_request=get_agent_status_before,
         after_request=get_agent_status_after,
     )
Exemplo n.º 5
0
Arquivo: job.py Projeto: pagezhou/DOP
 def __init__(self):
     self.fast_execute_script = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V2 + "fast_execute_script",
         description=_("快速执行脚本"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.fast_push_file = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V2 + "fast_push_file",
         description=_("快速分发文件"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.get_job_instance_log = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V2 + "get_job_instance_log",
         description=_("根据作业ID获取执行日志"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
Exemplo n.º 6
0
 def __init__(self):
     self.fast_execute_script = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V3 + "fast_execute_script",
         description=_("快速执行脚本"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.fast_transfer_file = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V3 + "fast_transfer_file",
         description=_("快速分发文件"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.get_job_instance_log = DataAPI(
         method="POST",
         url=JOB_APIGATEWAY_ROOT_V3 + "get_job_instance_log",
         description=_("根据作业ID获取执行日志"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.get_job_instance_ip_log = DataAPI(
         method="GET",
         url=JOB_APIGATEWAY_ROOT_V3 + "get_job_instance_ip_log",
         description=_("根据作业ID获取执行日志"),
         module=self.MODULE,
         before_request=get_job_request_before,
     )
     self.get_job_instance_status = DataAPI(
         method="GET",
         url=JOB_APIGATEWAY_ROOT_V3 + "get_job_instance_status",
         description=u'根据作业实例 ID 查询作业执行状态',
         module=self.MODULE,
         before_request=get_job_request_before,
     )
Exemplo n.º 7
0
Arquivo: cc.py Projeto: pagezhou/DOP
 def __init__(self):
     self.search_business = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_business/",
         module=self.MODULE,
         description=u"查询业务列表",
         before_request=add_esb_info_before_request,
         cache_time=60,
     )
     self.search_inst_by_object = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_inst_by_object/",
         module=self.MODULE,
         description=u"查询CC对象列表",
         before_request=add_esb_info_before_request,
     )
     self.search_biz_inst_topo = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_biz_inst_topo/",
         module=self.MODULE,
         description=u"查询业务TOPO,显示各个层级",
         before_request=add_esb_info_before_request,
     )
     self.search_module = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_module",
         module=self.MODULE,
         description="查询模块",
         before_request=add_esb_info_before_request,
     )
     self.get_host_info = DataAPI(
         method="GET",
         url=CC_APIGATEWAY_ROOT_V2 + "search_module",
         module=self.MODULE,
         description="查询模块",
         before_request=add_esb_info_before_request,
     )
     self.get_biz_internal_module = DataAPI(
         method="GET",
         url=CC_APIGATEWAY_ROOT_V2 + "get_biz_internal_module",
         module=self.MODULE,
         description="查询内部业务模块",
         before_request=add_esb_info_before_request,
     )
     self.search_object_attribute = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_object_attribute",
         module=self.MODULE,
         description="查询对象属性",
         before_request=add_esb_info_before_request,
     )
     self.list_biz_hosts = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "list_biz_hosts",
         module=self.MODULE,
         description="查询业务下的主机",
         before_request=add_esb_info_before_request,
     )
     self.list_biz_hosts_topo = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "list_biz_hosts_topo",
         module=self.MODULE,
         description="查询业务下的主机和拓扑信息",
         before_request=add_esb_info_before_request,
     )
     self.search_cloud_area = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_cloud_area",
         module=self.MODULE,
         description="查询云区域",
         before_request=add_esb_info_before_request,
     )
     self.find_host_topo_relation = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "find_host_topo_relation",
         module=self.MODULE,
         description="获取主机与拓扑的关系",
         before_request=add_esb_info_before_request,
     )
     self.search_set = DataAPI(
         method="POST",
         url=CC_APIGATEWAY_ROOT_V2 + "search_set",
         module=self.MODULE,
         description="查询集群",
         before_request=add_esb_info_before_request,
     )