Update list of RDS Databases for the account / region

        Returns:
            `None`
481803
def update_rds_databases(self):
        
        self.log.info('Updating RDS Databases for {} / {}'.format(
            self.account, self.region
        ))
        # All RDS resources are polled via a Lambda collector in a central account
        rds_collector_account = AWSAccount.get(self.rds_collector_account)
        rds_session = get_aws_session(rds_collector_account)
        # Existing RDS resources come from database
        existing_rds_dbs = RDSInstance.get_all(self.account, self.region)

        try:
            # Special session pinned to a single account for Lambda invocation so we
            # don't have to manage lambdas in every account & region
            lambda_client = rds_session.client('lambda', region_name=self.rds_collector_region)

            # The AWS Config Lambda will collect all the non-compliant resources for all regions
            # within the account
            input_payload = json.dumps({"account_id": self.account.account_number,
                                        "region": self.region,
                                        "role": self.rds_role,
                                        "config_rule_name": self.rds_config_rule_name
                                        }).encode('utf-8')
            response = lambda_client.invoke(FunctionName=self.rds_function_name, InvocationType='RequestResponse',
                                            Payload=input_payload
                                            )
            response_payload = json.loads(response['Payload'].read().decode('utf-8'))
            if response_payload['success']:
                rds_dbs = response_payload['data']
                if rds_dbs:
                    for db_instance in rds_dbs:
                        tags = {t['Key']: t['Value'] for t in db_instance['tags'] or {}}
                        properties = {
                            'tags': tags,
                            'metrics': None,
                            'engine': db_instance['engine'],
                            'creation_date': db_instance['creation_date']
                        }
                        if db_instance['resource_name'] in existing_rds_dbs:
                            rds = existing_rds_dbs[db_instance['resource_name']]
                            if rds.update(db_instance, properties):
                                self.log.debug('Change detected for RDS instance {}/{} '
                                               .format(db_instance['resource_name'], properties))
                        else:
                            RDSInstance.create(
                                db_instance['resource_name'],
                                account_id=self.account.account_id,
                                location=db_instance['region'],
                                properties=properties,
                                tags=tags
                            )
                    # Removal of RDS instances
                    rk = set()
                    erk = set()
                    for database in rds_dbs:
                        rk.add(database['resource_name'])
                    for existing in existing_rds_dbs.keys():
                        erk.add(existing)

                    for resource_id in erk - rk:
                        db.session.delete(existing_rds_dbs[resource_id].resource)
                        self.log.debug('Removed RDS instances {}/{}'.format(
                            self.account.account_name,
                            resource_id
                        ))
                    db.session.commit()

            else:
                self.log.error('RDS Lambda Execution Failed / {} / {} / {}'.
                                format(self.account.account_name, self.region, response_payload))

        except Exception as e:
            self.log.exception('There was a problem during RDS collection for {}/{}/{}'.format(
                self.account.account_name, self.region, e
            ))
            db.session.rollback()
1040773
def db_list(user=None, password=None, host=None, port=None, authdb=None):
    '''
    
    '''
    conn = _connect(user, password, host, port, authdb=authdb)
    if not conn:
        return 'Failed to connect to mongo database'

    try:
        log.info('Listing databases')
        return conn.database_names()
    except pymongo.errors.PyMongoError as err:
        log.error(err)
        return six.text_type(err)
1349622
def update(self, id):
        """"""
        # url('DataStores', id=ID)
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        content = content.decode('utf8')
        content = simplejson.loads(content)        
        result = meta.Session.query(DataStore).get(id)
        result.name = content['name']
        result.type = content['type']
        result.ogrstring = content['ogrstring']
        meta.Session.commit()
        response.status = 201
831501
def refresh_db(root=None):
    '''
    
    '''
    # Remove rtag file to keep multiple refreshes from happening in pkg states
    salt.utils.pkg.clear_rtag(__opts__)
    ret = {}
    out = __zypper__(root=root).refreshable.call('refresh', '--force')

    for line in out.splitlines():
        if not line:
            continue
        if line.strip().startswith('Repository') and '\'' in line:
            try:
                key = line.split('\'')[1].strip()
                if 'is up to date' in line:
                    ret[key] = False
            except IndexError:
                continue
        elif line.strip().startswith('Building') and '\'' in line:
            key = line.split('\'')[1].strip()
            if 'done' in line:
                ret[key] = True
    return ret
733801
def __update_all(self):
		
		self.__next_start = None
		self.__next_sources = []

		for source in self.__sources:
			self.__update(source)
1131542
def wait_for_new_security_group
      old_group_name = @config['rds_security_group']
      update_status "Applying security group #{old_group_name}"+
        " to #{@new_instance.id}"
      @new_instance.wait_for {
        new_group = (db_security_groups.select do |group|
          group['DBSecurityGroupName'] == old_group_name
        end).first
        (new_group ? new_group['Status'] : 'Unknown') == 'active'
      }
    end
163976
def update_deps(self):
        
        onelist, dependencies = [], []
        onelist = Utils().dimensional_list(self.deps)
        dependencies = Utils().remove_dbs(onelist)
        for dep in dependencies:
            deps = Requires(self.flag).sbo(dep)
            self.deps_dict[dep] = self.one_for_all(deps)
130544
def update_resources(self, data, type_, names=None, languages=None):
        
        UpdateResources(self.filename, data, type_, names, languages)
973312
def list(region=None, key=None, keyid=None, profile=None):
    '''
    

    '''
    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        buckets = conn.list_buckets()
        if not bool(buckets.get('Buckets')):
            log.warning('No buckets found')
        if 'ResponseMetadata' in buckets:
            del buckets['ResponseMetadata']
        return buckets
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
1156141
public void setRdsDbInstances(java.util.Collection<RdsDbInstance> rdsDbInstances) {
        if (rdsDbInstances == null) {
            this.rdsDbInstances = null;
            return;
        }

        this.rdsDbInstances = new com.amazonaws.internal.SdkInternalList<RdsDbInstance>(rdsDbInstances);
    }
881422
def batch_update(self, command, rows):
        
        request = {
            "database": {
                "alias": self.__options['dbAlias']
            },
            "batchUpdate": {
                "command": command,
                "rows": rows,
                "shardKey": self.__options.get('shardKey'),
            }
        }
        dr = self.__app.native_api_call('db', 'batch-update', request, self.__options, False)
        return json.loads(dr.text)
528376
def update_data(self):
        
        existing_issues = EBSVolumeAuditIssue.get_all()

        volumes = self.get_unattached_volumes()
        new_issues = self.process_new_issues(volumes, existing_issues)
        fixed_issues = self.process_fixed_issues(volumes, existing_issues)

        # region Process the data to be returned
        output = defaultdict(list)
        for acct, data in new_issues.items():
            output[acct] += data
        # endregion

        # region Update the database with the changes pending
        for issues in new_issues.values():
            for issue in issues:
                db.session.add(issue.issue)

        for issue in fixed_issues:
            db.session.delete(issue.issue)

        db.session.commit()
        # endregion

        return output
1168007
def update(self, rec=None, drop=None, tables=None, install=None, materialize=None,
               indexes=None, joins=0, views=0):
        
        if not drop:
            drop = []

        if not tables:
            tables = set()

        if not install:
            install = set()

        if not materialize:
            materialize = set()

        if not indexes:
            indexes = set()

        if rec:
            self.update(
                drop=rec.drop, tables=rec.tables, install=rec.install, materialize=rec.materialize,
                indexes=rec.indexes, joins=rec.joins
            )

        self.drop += drop
        self.tables |= set(tables)
        self.install |= set(install)
        self.materialize |= set(materialize)
        self.indexes |= set(indexes)

        self.joins += joins
        self.views += views

        # Joins or views promote installed partitions to materialized partitions
        if self.joins > 0 or self.views > 0:
            self.materialize |= self.install
            self.install = set()
1365413
def list_dynamodb(region, filter_by_kwargs):
    """"""
    conn = boto.dynamodb.connect_to_region(region)
    tables = conn.list_tables()
    return lookup(tables, filter_by=filter_by_kwargs)
415356
def _update_rs_with_primary_from_member(
        sds,
        replica_set_name,
        server_description):
    
    assert replica_set_name is not None

    if replica_set_name != server_description.replica_set_name:
        sds.pop(server_description.address)
    elif (server_description.me and
          server_description.address != server_description.me):
        sds.pop(server_description.address)

    # Had this member been the primary?
    return _check_has_primary(sds)
379243
def create_db_instance(self, params):
        '''  '''
        if not self.connect_to_aws_rds():
            return False
        try:
            database = self.rdsc.create_dbinstance(
                id=params['id'],
                allocated_storage=params['size'],
                instance_class='db.t1.micro',
                engine='MySQL',
                master_username=params['username'],
                master_password=params['password'],
                db_name=params['dbname'],
                multi_az=False
            )
        except:
            return False
        else:
            return True
1169507
@Override
    public void sync(List<Dml> dmls) {
        if (dmls == null || dmls.isEmpty()) {
            return;
        }
        try {
            rdbSyncService.sync(mappingConfigCache, dmls, envProperties);
            rdbMirrorDbSyncService.sync(dmls);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }