You are here

function deploy_services_services_resources in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 modules/deploy_services/deploy_services.services.inc \deploy_services_services_resources()

Implements hook_services_resources().

File

modules/deploy_services/deploy_services.services.inc, line 10
Deploy Services module services functions.

Code

function deploy_services_services_resources() {
  $resources = array(
    'deploy' => array(),
  );
  $resources['deploy']['index'] = array(
    'help' => t('This method returns a list of deployment plans'),
    'callback' => 'deploy_services_index',
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy',
      'name' => 'deploy.services',
    ),
    // TODO add support for args
    'args' => array(),
    'access arguments' => array(
      'administer deployment plans',
    ),
  );
  $resources['deploy']['create'] = array(
    'help' => t('Creates a deployment plan'),
    'callback' => 'deploy_services_create',
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy',
      'name' => 'deploy.services',
    ),
    'args' => array(
      array(
        'name' => 'data',
        'type' => 'struct',
        'description' => 'The plan object',
        'source' => 'data',
        'optional' => FALSE,
      ),
    ),
    'access arguments' => array(
      'administer deployment plans',
    ),
  );
  $resources['deploy']['retrieve'] = array(
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy',
      'name' => 'deploy.services',
    ),
    'help' => t('Retrieve a deployment plan'),
    'callback' => 'deploy_services_retrieve',
    'args' => array(
      array(
        'name' => 'name',
        'type' => 'string',
        'description' => 'The name of the plan to fetch',
        'source' => array(
          'path' => '0',
        ),
        'optional' => FALSE,
      ),
    ),
    'access arguments' => array(
      'view deployment plans',
    ),
  );
  $resources['deploy']['update'] = array(
    'callback' => 'deploy_services_update',
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy',
      'name' => 'deploy.services',
    ),
    'args' => array(
      array(
        'name' => 'name',
        'optional' => FALSE,
        'source' => array(
          'path' => 0,
        ),
        'description' => 'The name of the deployment plan.',
        'type' => 'int',
      ),
      array(
        'name' => 'config',
        'optional' => FALSE,
        'source' => 'data',
        'description' => 'The configuration for the deployment plan.',
        'type' => 'array',
      ),
    ),
    'access arguments' => array(
      'administer deployment plans',
    ),
  );
  $resources['deploy']['targeted_actions'] = array();
  $resources['deploy']['targeted_actions']['deploy'] = array(
    'help' => t('This method deploys a deployment plan.'),
    'callback' => 'deploy_services_deploy',
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy',
      'name' => 'deploy.services',
    ),
    'args' => array(
      array(
        'name' => 'name',
        'type' => 'string',
        'description' => 'The name of the plan to fetch',
        'source' => array(
          'path' => '0',
        ),
        'optional' => FALSE,
      ),
    ),
    'access arguments' => array(
      'deploy deployment plans',
    ),
  );
  $resources['deploy']['targeted_actions']['diff'] = array(
    'help' => t('This method provides a diff of a plan.'),
    'callback' => 'deploy_services_diff_plan',
    'file' => array(
      'type' => 'inc',
      'module' => 'deploy_services',
      'name' => 'deploy_services.services',
    ),
    'args' => array(
      array(
        'name' => 'name',
        'type' => 'string',
        'description' => 'The name of the plan to fetch',
        'source' => array(
          'path' => '0',
        ),
        'optional' => FALSE,
      ),
    ),
    'access arguments' => array(
      'view deployment plans',
    ),
  );
  return $resources;
}