You are here

monitoring_test.default_services.inc in Monitoring 7

Default services import definition.

File

test/monitoring_test.default_services.inc
View source
<?php

/**
 * @file
 *   Default services import definition.
 */

/**
 * Implements hook_default_services_endpoint().
 */
function monitoring_test_default_services_endpoint() {
  $endpoint = new stdClass();
  $endpoint->disabled = FALSE;

  /* Edit this to true to make a default endpoint disabled initially */
  $endpoint->api_version = 3;
  $endpoint->name = 'monitoring_sensors';
  $endpoint->server = 'rest_server';
  $endpoint->path = 'monitoring/v1';
  $endpoint->authentication = array(
    'services' => 'services',
  );
  $endpoint->server_settings = array(
    'formatters' => array(
      'json' => TRUE,
      'bencode' => FALSE,
      'jsonp' => FALSE,
      'php' => FALSE,
      'xml' => FALSE,
    ),
    'parsers' => array(
      'application/x-www-form-urlencoded' => TRUE,
      'application/json' => FALSE,
      'application/vnd.php.serialized' => FALSE,
      'application/xml' => FALSE,
      'multipart/form-data' => FALSE,
      'text/xml' => FALSE,
    ),
  );
  $endpoint->resources = array(
    'sensor-info' => array(
      'operations' => array(
        'retrieve' => array(
          'enabled' => '1',
        ),
        'index' => array(
          'enabled' => '1',
        ),
      ),
    ),
    'sensor-result' => array(
      'operations' => array(
        'retrieve' => array(
          'enabled' => '1',
        ),
        'index' => array(
          'enabled' => '1',
        ),
      ),
    ),
  );
  $endpoint->debug = 0;
  $export['monitoring_services'] = $endpoint;
  return $export;
}

Functions

Namesort descending Description
monitoring_test_default_services_endpoint Implements hook_default_services_endpoint().