You are here

public function ApigeeEdgeCommands::createEdgeRole in Apigee Edge 8

Create a custom role in an Apigee organization for Drupal usage.

Create a custom Apigee role that limits permissions for Drupal connections to the Apigee API.

@option password Password for the Apigee orgadmin user. If not set, you will be prompted for the password. @option base-url Base URL to use, defaults to public cloud URL: https://api.enterprise.apigee.com/v1. @option role-name The role to create in the Apigee Edge org, defaults to "drupalportal". @option $force Force running of permissions on a role that already exists, defaults to throwing an error message if role exists. Note that permissions are only added, any current permissions not not removed. @usage drush create-edge-role myorg me@example.com Create "drupalportal" role as orgadmin me@example.com for org myorg. @usage drush create-edge-role myorg me@example.com --role-name=portal Create role named "portal" @usage drush create-edge-role myorg me@example.com --base-url=https://api.edge.example.com Create role on private Apigee Edge server "api.edge.example.com". @usage drush create-edge-role myorg me@example.com --force Update permissions on "drupalportal" role even if role already exists. @command apigee-edge:create-edge-role @aliases create-edge-role

Parameters

string $org: The Apigee Edge org to create the role in.

string $email: An Apigee user email address with orgadmin role for this org.

array $options: Drush options for the command.

File

src/Commands/ApigeeEdgeCommands.php, line 98

Class

ApigeeEdgeCommands
Drush 9 command file.

Namespace

Drupal\apigee_edge\Commands

Code

public function createEdgeRole(string $org, string $email, array $options = [
  'password' => NULL,
  'base-url' => NULL,
  'role-name' => NULL,
  'force' => FALSE,
]) {

  // Call the CLI Service.
  $this->cliService
    ->createEdgeRoleForDrupal($this
    ->io(), 'dt', $org, $email, $options['password'], $options['base-url'], $options['role-name'], $options['force']);
}