簡體   English   中英

從 AWS 代碼提交獲取文件

[英]Getting files from AWS codecommit

我有一個關於 uri 的 codecommit 文件:

codecommit://FruitLoops/apples/granny_smith.json

當我嘗試時:

import boto3

client = boto3.session(some_key, some_secret, key)

repo = "FruitLoops"

client.get_file(repositoryName="FruitLoops", filePath="apples/granny_smith.json"

它拋出一個錯誤:L

RepositoryDoesNotExistException: An error ocurred (RepositoryDoesNotExistException) when calling GetFile operation on: FruitLoops does not exist

我嘗試在 Google 上搜索並找到示例https://github.com/boto/boto3/issues/2329https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/代碼提交.html

但是當我使用 CLI 時,存儲庫就在那里

aws codecommit get-file --repository-name FruitLoops --file-path "apples/granny_smith.json" --query fileContent --output text

boto3 中通過boto3訪問文件的正確語法是什么?

您沒有傳遞區域名稱。 這是解釋如何做到這一點的文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM