protected function execute(InputInterface $input, OutputInterface $output)
 {
     $rage4 = $this->getRage4DNS($input->getOption('credentials'));
     $status = $rage4->domains->createDomainVanity($input->getArgument('name'), $input->getArgument('email'), $input->getArgument('nsname'), $input->getArgument('nsprefix'));
     $content[] = $status->getTableRow();
     $this->renderTable(Status::getTableHeaders(), $content, $output);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $recordID = $input->getArgument('id');
     $confirmation = $this->getHelperSet()->get('dialog')->askConfirmation($output, sprintf('<question>Are you sure to delete record with id %d ? (y/N)</question> ', $recordID), false);
     if ($input->getOption('no-interaction')) {
         $confirmation = true;
     }
     if (false === $confirmation) {
         return;
     }
     $rage4 = $this->getRage4DNS($input->getOption('credentials'));
     $status = $rage4->records->deleteRecord($recordID);
     $content[] = $status->getTableRow();
     $this->renderTable(Status::getTableHeaders(), $content, $output);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $rage4 = $this->getRage4DNS($input->getOption('credentials'));
     $record = new Record();
     $record->setId($input->getArgument('id'));
     $record->setName($input->getArgument('name'));
     $record->setContent($input->getArgument('content'));
     $record->setType($input->getArgument('type'));
     $record->setPriority($input->getOption('priority'));
     $record->setFailoverEnabled($input->getOption('enable-failover') ? true : false);
     $record->setFailoverContent($input->getOption('failover-content'));
     $record->setTtl($input->getOption('ttl'));
     $record->setGeoRegionId($input->getOption('geozone'));
     $record->setGeoLock($input->getOption('lock-geo') ? true : false);
     $record->setGeoLong($input->getOption('geo-long'));
     $record->setGeoLat($input->getOption('geo-lat'));
     $status = $rage4->records->updateRecord($record);
     $content[] = $status->getTableRow();
     $this->renderTable(Status::getTableHeaders(), $content, $output);
 }
Example #4
0
 /**
  * @param int $recordID
  *
  * @return Status
  */
 public function deleteRecord($recordID)
 {
     $url = sprintf("%s/%s/%d", $this->apiUrl, self::URL_DELETE_RECORD, $recordID);
     $response = $this->processQuery($url);
     return Status::createFromArray($response);
 }
Example #5
0
 /**
  * Delete a domain
  *
  * @param int $id
  *
  * @return Status
  */
 public function deleteDomain($id)
 {
     $url = sprintf("%s/%s/", $this->apiUrl, self::URL_DELETE_DOMAIN);
     $response = $this->processQuery($url, null, array('query' => array('id' => $id)));
     return Status::createFromArray($response);
 }
Example #6
0
 /**
  * Rage4 DNS does not properly return error code
  *
  * @param array $response
  *
  * @return null
  */
 protected function getStatusMessage($response)
 {
     if (is_array($response) && isset($response['status'])) {
         return Status::createFromArray($response['status']);
     } else {
         return null;
     }
 }