Python 3.x 名称错误:名称';从_dbsnapshot';在使用BOTO python模块时未定义
我想使用amazon Web services(AWS)将我的RDS实例从RDS快照恢复为在云上运行,我使用的是Pycharm 3+,使用脚本语言的此代码的AWS CLI等价物是: aws rds从数据库快照还原数据库实例 Python等效代码如下所示: 导入boto.rdsPython 3.x 名称错误:名称';从_dbsnapshot';在使用BOTO python模块时未定义,python-3.x,amazon-web-services,pycharm,boto,rds,Python 3.x,Amazon Web Services,Pycharm,Boto,Rds,我想使用amazon Web services(AWS)将我的RDS实例从RDS快照恢复为在云上运行,我使用的是Pycharm 3+,使用脚本语言的此代码的AWS CLI等价物是: aws rds从数据库快照还原数据库实例 Python等效代码如下所示: 导入boto.rds restore\u dbinstance\u from_dbsnapshot('oracledev-final-snapshot','oracleid',db.m1.small,1521,'east-1') 但当我运行时,
restore\u dbinstance\u from_dbsnapshot('oracledev-final-snapshot','oracleid',db.m1.small,1521,'east-1')
但当我运行时,我得到了标题中提到的上述错误。
谁能帮我一下吗。
提前感谢我没有使用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')
您能否显示导致问题的实际代码?没有上下文,很难知道该建议什么。boto RDS模块有一个
restore\u dbinstance\u from\u dbsnapshot
方法。