protected function createShovel(MigrationTargetInterface $migration_target, $src_exchange_name, $dest_exchange_name, $src_queue) { $connector = $migration_target->getTargetConnector(); $endpoint = sprintf('/api/parameters/shovel/%s/%s.shovel', $connector->getConfig()->get('vhost', '%2f'), $src_exchange_name); $body = ['value' => ['src-uri' => 'amqp://', 'src-queue' => $src_queue, 'dest-uri' => 'amqp://', 'dest-exchange' => $dest_exchange_name, 'add-forward-headers' => false, 'ack-mode' => 'on-confirm', 'delete-after' => 'never']]; $connector->putToAdminApi($endpoint, $body); }
protected function getExecutedMigrationVersions(MigrationTargetInterface $migration_target) { $executed_versions = []; foreach ($migration_target->getStructureVersionList() as $structure_version) { $executed_versions[$structure_version->getVersion()] = $structure_version->getCreatedDate(); } return $executed_versions; }
protected function guardMigrationTarget(MigrationTargetInterface $migration_target) { if (!$migration_target->isActivated()) { throw new RuntimeError(sprintf('Not allowed to execute migration %s:%s, migration target %s is deactivated.', $this->getVersion(), $this->getName(), $migration_target->getName())); } }
protected function getIndexName(MigrationTargetInterface $migration_target) { return $migration_target->getConfig()->get('index'); }