uuid_services_example.services.inc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * @file
  4. * uuid_services_example.services.inc
  5. */
  6. /**
  7. * Implements hook_default_services_endpoint().
  8. */
  9. function uuid_services_example_default_services_endpoint() {
  10. $export = array();
  11. $endpoint = new stdClass();
  12. $endpoint->disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
  13. $endpoint->api_version = 3;
  14. $endpoint->name = 'uuid_services_example';
  15. $endpoint->server = 'rest_server';
  16. $endpoint->path = 'api';
  17. $endpoint->authentication = array(
  18. 'services' => 'services',
  19. );
  20. $endpoint->server_settings = array(
  21. 'formatters' => array(
  22. 'json' => TRUE,
  23. 'bencode' => FALSE,
  24. 'jsonp' => FALSE,
  25. 'php' => FALSE,
  26. 'xml' => FALSE,
  27. 'yaml' => FALSE,
  28. ),
  29. 'parsers' => array(
  30. 'application/json' => TRUE,
  31. 'application/x-www-form-urlencoded' => TRUE,
  32. 'multipart/form-data' => TRUE,
  33. 'application/vnd.php.serialized' => FALSE,
  34. 'application/x-yaml' => FALSE,
  35. 'application/xml' => FALSE,
  36. 'text/xml' => FALSE,
  37. ),
  38. );
  39. $endpoint->resources = array(
  40. 'comment' => array(
  41. 'operations' => array(
  42. 'update' => array(
  43. 'enabled' => '1',
  44. ),
  45. ),
  46. ),
  47. 'file' => array(
  48. 'operations' => array(
  49. 'update' => array(
  50. 'enabled' => '1',
  51. ),
  52. ),
  53. ),
  54. 'node' => array(
  55. 'operations' => array(
  56. 'update' => array(
  57. 'enabled' => '1',
  58. ),
  59. ),
  60. ),
  61. 'taxonomy_term' => array(
  62. 'operations' => array(
  63. 'update' => array(
  64. 'enabled' => '1',
  65. ),
  66. ),
  67. ),
  68. 'user' => array(
  69. 'operations' => array(
  70. 'update' => array(
  71. 'enabled' => '1',
  72. ),
  73. ),
  74. 'actions' => array(
  75. 'login' => array(
  76. 'enabled' => '1',
  77. 'settings' => array(
  78. 'services' => array(
  79. 'resource_api_version' => '1.0',
  80. ),
  81. ),
  82. ),
  83. 'logout' => array(
  84. 'enabled' => '1',
  85. 'settings' => array(
  86. 'services' => array(
  87. 'resource_api_version' => '1.0',
  88. ),
  89. ),
  90. ),
  91. ),
  92. ),
  93. );
  94. $endpoint->debug = 1;
  95. $export['uuid_services_example'] = $endpoint;
  96. return $export;
  97. }