当前位置: 首页>>代码示例>>Python>>正文


Python RestConnection.delete_function方法代码示例

本文整理汇总了Python中lib.membase.api.rest_client.RestConnection.delete_function方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.delete_function方法的具体用法?Python RestConnection.delete_function怎么用?Python RestConnection.delete_function使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lib.membase.api.rest_client.RestConnection的用法示例。


在下文中一共展示了RestConnection.delete_function方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: EventingBaseTest

# 需要导入模块: from lib.membase.api.rest_client import RestConnection [as 别名]
# 或者: from lib.membase.api.rest_client.RestConnection import delete_function [as 别名]

#.........这里部分代码省略.........
            log.debug("Full Stats for Node {0} is \n{1} ".format(eventing_node.ip, json.dumps(full_out, sort_keys=True,
                                                                                            indent=4)))

    def eventing_stats(self):
        self.sleep(30)
        content=self.rest.get_all_eventing_stats()
        js=json.loads(content)
        log.info("execution stats: {0}".format(js))
        # for j in js:
        #     print j["function_name"]
        #     print j["execution_stats"]["on_update_success"]
        #     print j["failure_stats"]["n1ql_op_exception_count"]

    def deploy_function(self, body, deployment_fail=False, wait_for_bootstrap=True):
        body['settings']['deployment_status'] = True
        body['settings']['processing_status'] = True
        # save the function so that it appears in UI
        content = self.rest.save_function(body['appname'], body)
        # deploy the function
        log.info("Deploying the following handler code")
        log.info("\n{0}".format(body['appcode']))
        content1 = self.rest.deploy_function(body['appname'], body)
        log.info("deploy Application : {0}".format(content1))
        if deployment_fail:
            res = json.loads(content1)
            if not res["compile_success"]:
                return
            else:
                raise Exception("Deployment is expected to be failed but no message of failure")
        if wait_for_bootstrap:
            # wait for the function to come out of bootstrap state
            self.wait_for_bootstrap_to_complete(body['appname'])

    def undeploy_and_delete_function(self, body):
        self.undeploy_function(body)
        self.delete_function(body)

    def undeploy_function(self, body):
        body['settings']['deployment_status'] = False
        body['settings']['processing_status'] = False
        # save the function so that it disappears from UI
        content = self.rest.save_function(body['appname'], body)
        # undeploy the function
        content1 = self.rest.set_settings_for_function(body['appname'], body['settings'])
        log.info("Undeploy Application : {0}".format(content1))
        return content, content1

    def delete_function(self, body):
        # delete the function from the UI and backend
        content = self.rest.delete_function_from_temp_store(body['appname'])
        content1 = self.rest.delete_function(body['appname'])
        log.info("Delete Application : {0}".format(body['appname']))
        return content, content1

    def pause_function(self, body):
        body['settings']['deployment_status'] = True
        body['settings']['processing_status'] = False
        # save the function so that it is visible in UI
        content = self.rest.save_function(body['appname'], body)
        # undeploy the function
        content1 = self.rest.set_settings_for_function(body['appname'], body['settings'])
        log.info("Pause Application : {0}".format(content1))

    def resume_function(self, body):
        body['settings']['deployment_status'] = True
        body['settings']['processing_status'] = True
开发者ID:membase,项目名称:testrunner,代码行数:70,代码来源:eventing_base.py


注:本文中的lib.membase.api.rest_client.RestConnection.delete_function方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。