當前位置: 首頁>>代碼示例>>Python>>正文


Python Vault.create方法代碼示例

本文整理匯總了Python中deuce.model.Vault.create方法的典型用法代碼示例。如果您正苦於以下問題:Python Vault.create方法的具體用法?Python Vault.create怎麽用?Python Vault.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在deuce.model.Vault的用法示例。


在下文中一共展示了Vault.create方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_put

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
    def on_put(self, req, resp, vault_id):

        vault = Vault.create(vault_id)
        # TODO: Need check and monitor failed vault.
        logger.info('Vault [{0}] created'.format(vault_id))
        if vault:
            resp.status = falcon.HTTP_201
        else:
            raise errors.HTTPInternalServerError('Vault Creation Failed')
開發者ID:BenjamenMeyer,項目名稱:deuce,代碼行數:11,代碼來源:vault.py

示例2: test_block_crud

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
    def test_block_crud(self):
        vault_id = self.create_vault_id()

        v = Vault.create(vault_id)

        # Check for blocks, should be none
        blocks_gen = v.get_blocks(0, 0)
        blocks_list = list(blocks_gen)

        assert len(blocks_list) == 0
開發者ID:BenjamenMeyer,項目名稱:deuce,代碼行數:12,代碼來源:test_model.py

示例3: test_vault_crud

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
    def test_vault_crud(self):
        vault_id = self.create_vault_id()

        v = Vault.get(vault_id)
        assert v is None

        v = Vault.create(vault_id)
        assert v is not None

        v.delete()

        v = Vault.get(vault_id)
        assert v is None
開發者ID:BenjamenMeyer,項目名稱:deuce,代碼行數:15,代碼來源:test_model.py

示例4: test_file_crud

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
    def test_file_crud(self):
        vault_id = self.create_vault_id()

        v = Vault.create(vault_id)

        f = v.create_file()

        assert isinstance(f, File)
        assert f.vault_id == vault_id

        file_id = f.file_id

        assert(len(file_id) > 0)

        file2 = v.get_file(file_id)
        file2_length = v.get_file_length(file_id)

        assert isinstance(file2, File)
        assert file2.file_id == file_id
        assert file2_length == 0
開發者ID:BenjamenMeyer,項目名稱:deuce,代碼行數:22,代碼來源:test_model.py

示例5: put

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
 def put(self, vault_name):
     vault = Vault.create(vault_name)
     # TODO: Need check and monitor failed vault.
     logger.info('Vault [{0}] created'.format(vault_name))
     response.status_code = 201 if vault else 500
開發者ID:raxyu,項目名稱:deuce-pub,代碼行數:7,代碼來源:vault.py

示例6: post

# 需要導入模塊: from deuce.model import Vault [as 別名]
# 或者: from deuce.model.Vault import create [as 別名]
 def post(self, vault_name):
     vault = Vault.create(request.project_id, vault_name)
     response.status_code = 201 if vault else 500
開發者ID:TheSriram,項目名稱:deuce,代碼行數:5,代碼來源:vault.py


注:本文中的deuce.model.Vault.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。