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


Python RestConnection.delete_single_function方法代码示例

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


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

示例1: EventingBaseTest

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

#.........这里部分代码省略.........
            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.sleep(5)
        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
        content = self.rest.undeploy_function(body['appname'])
        log.info("Undeploy Application : {0}".format(body['appname']))
        self.wait_for_undeployment(body['appname'])
        return content

    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
        content1 = self.rest.delete_single_function(body['appname'])
        log.info("Delete Application : {0}".format(body['appname']))
        return 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
        # 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("Resume Application : {0}".format(content1))

    def refresh_rest_server(self):
        eventing_nodes_list = self.get_nodes_from_services_map(service_type="eventing", get_all_nodes=True)
        self.restServer = eventing_nodes_list[0]
        self.rest = RestConnection(self.restServer)
        return len(eventing_nodes_list)

    def check_if_eventing_consumers_are_cleaned_up(self):
        eventing_nodes = self.get_nodes_from_services_map(service_type="eventing", get_all_nodes=True)
        array_of_counts = []
        command = "ps -ef | grep eventing-consumer | grep -v grep | wc -l"
        for eventing_node in eventing_nodes:
开发者ID:arod1987,项目名称:testrunner,代码行数:70,代码来源:eventing_base.py


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