2017-02-13 90 views
-1
C:\Users\abhij\.aws\model>aws dynamodb put-item --table-name weatherstation_data --item '{"station_id":{"S":"000001"},"dateandtime" : {"S": "2015/12/25 00:00"},"temperature": {"N" : "0"}}' --profile loadmin 
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] 
To see help text, you can run: 

    aws help 
    aws <command> help 
    aws <command> <subcommand> help 

Unknown options: {S:, 2015/12/25 00:00},temperature:, {N, :, 0}}', : 

回答

1

您需要刪除或轉義命令的JSON部分中的所有空白。這是一個常見的問題,這也就是爲什麼大多數的aws dynamodb CLI tool docs的例子顯示使用JSON文件,而不是像這樣:

aws dynamodb put-item --table-name weatherstation_data --item file://item.json --profile loadmin 
0

沒關係的窗戶CMD那給這個問題跑一樣在Linux中返回輸出

aws dynamodb put-item --table-name weatherstation_data --item'{「station_id」:{「S」:「000001」},「dateandtime」:{「S」:「2015/12/25 00:00「},」temperature「:{」N「:」0「}}' - 配置文件loadmin