2014-10-06 63 views
0

我想使用Amazon Web服务(AWS)将RDS实例从RDS快照恢复到云上运行,我正在使用Pycharm 3+,AWS CLI相当于使用脚本语言的代码是: AWS RDS恢复-DB-实例从DB-快照NameError:使用BOTO python模块时未定义name'restore_dbinstance_from_dbsnapshot'

Python的等效代码低于: 进口boto.rds restore_dbinstance_from_dbsnapshot('oracledev-final-snapshot','oracleid',db.m1.small,1521,'east-1')

但是,当我运行得到标题中提到上述错误。 任何人都可以帮助我这个请。 先感谢

+0

你能证明是导致该问题的实际代码?如果没有一些背景知识,很难知道该建议什么。 boto RDS模块有一个''restore_dbinstance_from_dbsnapshot''方法。 – garnaat 2014-10-06 11:43:45

回答

0

我没有用Pycharm,但我不喜欢这样使用IPython的CLI的测试和LiClipse:

#import the module 
import boto.rds 
#connect to the region - you'll need your AWS info as the second two parameters if it isn't pre-configured 
conn=boto.rds.get_all_connections("us-east-1") 
#now is when you call the db creation, but from the connection 
conn.restore_dbinstance_from_dbsnapshot('oracledev-final-snapshot','oracleid',db.m1.small,1521,'east-1')