python 2.7 - RDS - boto - how to get results from read_replica_dbinstance_identifiers? -
according understanding of boto.rds.dbinstance
class, should able variable named read_replica_dbinstance_identifiers
object, cannot , don't understand why. know doing wrong.
when run rds-describe-db-instances --quiet --show-xml
can find read replicas in xml:
<readreplicadbinstanceidentifiers> <readreplicadbinstanceidentifier>my-dbinstance-id-1</readreplicadbinstanceidentifier> <readreplicadbinstanceidentifier>my-dbinstance-id-2</readreplicadbinstanceidentifier> </readreplicadbinstanceidentifiers>
but when use boto same information test script 1 below, get:
attributeerror: 'dbinstance' object has no attribute 'read_replica_dbinstance_identifiers'
the script looks this:
import boto dbinstanceid = 'my-dbinstance-id' rds = boto.connect_rds() instances = rds.get_all_dbinstances(dbinstanceid) in instances: property, value in vars(i).iteritems(): print property, ": ", value print "=============================" print i, " ", i.id print "connection: ", i.connection print 'db instance identifiers: ', i.readreplicadbinstanceidentifiers print i.read_replica_dbinstance_identifiers
my version of boto, according pip is:
name: boto
version: 2.9.7
location: /library/python/2.7/site-packages
have tried using read_replica_dbinstance_identifiers method instead?
if reading correctly have pulled down instances in array , looping through them each 1 'i'
so should able to: print i.read_replica_dbinstance_identifiers or similar
if ever stuck problems this:
print dir(i) #is useful see possible on object
now go , implement tags rds :-( loooooong!
Comments
Post a Comment