class CreateEdgeRoleCommand in Apigee Edge 8
Developer synchronization command class for Drupal Console.
@Drupal\Console\Annotations\DrupalCommand ( extension="apigee_edge", extensionType="module" )
Hierarchy
- class \Drupal\apigee_edge\Command\CommandBase extends \Drupal\Console\Core\Command\Command uses \Drupal\Console\Core\Command\Shared\CommandTrait
- class \Drupal\apigee_edge\Command\CreateEdgeRoleCommand
Expanded class hierarchy of CreateEdgeRoleCommand
1 file declares its use of CreateEdgeRoleCommand
- CreateEdgeRoleCommandTest.php in tests/
src/ Unit/ Command/ CreateEdgeRoleCommandTest.php
1 string reference to 'CreateEdgeRoleCommand'
1 service uses CreateEdgeRoleCommand
File
- src/
Command/ CreateEdgeRoleCommand.php, line 35
Namespace
Drupal\apigee_edge\CommandView source
class CreateEdgeRoleCommand extends CommandBase {
/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setName('apigee_edge:role:create')
->setDescription($this
->trans('commands.apigee_edge.role.create.description'))
->setHelp('commands.apigee_edge.role.create.help')
->addArgument('org', InputArgument::REQUIRED, $this
->trans('commands.apigee_edge.role.create.arguments.org'))
->addArgument('email', InputArgument::REQUIRED, $this
->trans('commands.apigee_edge.role.create.arguments.email'))
->addOption('password', 'p', InputArgument::OPTIONAL, $this
->trans('commands.apigee_edge.role.create.options.password'))
->addOption('base-url', 'b', InputArgument::OPTIONAL, $this
->trans('commands.apigee_edge.role.create.options.base-url'))
->addOption('role-name', 'r', InputArgument::OPTIONAL, $this
->trans('commands.apigee_edge.role.create.options.role-name'))
->addOption('force', 'f', InputOption::VALUE_NONE, $this
->trans('commands.apigee_edge.role.create.options.force'));
}
/**
* {@inheritdoc}
*/
public function interact(InputInterface $input, OutputInterface $output) {
$this
->setupIo($input, $output);
$password = $input
->getOption('password');
if (!$password) {
$password = $this
->getIo()
->askHidden($this
->trans('commands.apigee_edge.role.create.questions.password'));
$input
->setOption('password', $password);
}
}
/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output) {
$this
->setupIo($input, $output);
$org = $input
->getArgument('org');
$email = $input
->getArgument('email');
$password = $input
->getOption('password');
$base_url = $input
->getOption('base-url');
$role_name = $input
->getOption('role-name');
$force = $input
->getOption('force');
$this->cliService
->createEdgeRoleForDrupal($this
->getIo(), 't', $org, $email, $password, $base_url, $role_name, $force);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommandBase:: |
protected | property | The interoperability cli service. | |
CommandBase:: |
protected | property | The IO interface composed of a commands input and output. | |
CommandBase:: |
protected | property | The logger channel factory. | |
CommandBase:: |
protected | property | The parser object. | |
CommandBase:: |
public | function | Gets the IO interface. | |
CommandBase:: |
protected | function | Sets up the IO interface. | |
CommandBase:: |
protected | function | Sets up the logger service. | |
CommandBase:: |
public | function | Constructor with cli service injection. | |
CreateEdgeRoleCommand:: |
protected | function | ||
CreateEdgeRoleCommand:: |
public | function | ||
CreateEdgeRoleCommand:: |
public | function |