"MDL-20904, web services for files"
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * Core external functions and service definitions.
20 *
21 * @package moodlecore
22 * @subpackage webservice
23 * @copyright 2009 Petr Skoda (http://skodak.org)
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27$functions = array(
ef22c1b6 28
29 // === group related functions ===
f5072177 30
9a0df45a 31 'moodle_group_create_groups' => array(
32 'classname' => 'moodle_group_external',
33 'methodname' => 'create_groups',
34 'classpath' => 'group/externallib.php',
f5072177 35 'description' => 'Creates new groups.',
36 'type' => 'write',
9a0df45a 37 ),
f5072177 38
9a0df45a 39 'moodle_group_get_groups' => array(
40 'classname' => 'moodle_group_external',
41 'methodname' => 'get_groups',
42 'classpath' => 'group/externallib.php',
cfb99b75 43 'description' => 'Returns group details.',
f5072177 44 'type' => 'read',
9a0df45a 45 ),
246f6da2 46
47 'moodle_group_get_course_groups' => array(
48 'classname' => 'moodle_group_external',
49 'methodname' => 'get_course_groups',
50 'classpath' => 'group/externallib.php',
51 'description' => 'Returns all groups in specified course.',
52 'type' => 'read',
53 ),
2cb1ee78 54
9a0df45a 55 'moodle_group_delete_groups' => array(
56 'classname' => 'moodle_group_external',
57 'methodname' => 'delete_groups',
58 'classpath' => 'group/externallib.php',
0f4e72de
PS
59 'description' => 'Deletes all specified groups.',
60 'type' => 'delete',
9a0df45a 61 ),
c863dc38 62
9a0df45a 63 'moodle_group_get_groupmembers' => array(
64 'classname' => 'moodle_group_external',
65 'methodname' => 'get_groupmembers',
66 'classpath' => 'group/externallib.php',
0f4e72de
PS
67 'description' => 'Returns group members.',
68 'type' => 'read',
9a0df45a 69 ),
4efa2483 70
9a0df45a 71 'moodle_group_add_groupmembers' => array(
72 'classname' => 'moodle_group_external',
73 'methodname' => 'add_groupmembers',
74 'classpath' => 'group/externallib.php',
0f4e72de
PS
75 'description' => 'Adds group members.',
76 'type' => 'write',
9a0df45a 77 ),
78
79 'moodle_group_delete_groupmembers' => array(
80 'classname' => 'moodle_group_external',
81 'methodname' => 'delete_groupmembers',
82 'classpath' => 'group/externallib.php',
0f4e72de
PS
83 'description' => 'Deletes group members.',
84 'type' => 'delete',
9a0df45a 85 ),
249c4f60
DC
86 'moodle_file_get_files' => array(
87 'classname' => 'moodle_file_external',
88 'methodname' => 'get_files',
89 'description' => 'browse moodle files',
90 'type' => 'read',
91 'classpath' => 'files/externallib.php',
92 ),
93 'moodle_file_upload' => array(
94 'classname' => 'moodle_file_external',
95 'methodname' => 'upload',
96 'description' => 'upload a file to moodle',
97 'type' => 'write',
98 'classpath' => 'files/externallib.php',
99 ),
4efa2483 100
ef22c1b6 101 // === user related functions ===
ef22c1b6 102 'moodle_user_create_users' => array(
103 'classname' => 'moodle_user_external',
104 'methodname' => 'create_users',
105 'classpath' => 'user/externallib.php',
fb79269b 106 'description' => 'Create users.',
107 'type' => 'write',
ef22c1b6 108 ),
109
fb79269b 110 'moodle_user_get_users_by_id' => array(
ef22c1b6 111 'classname' => 'moodle_user_external',
fb79269b 112 'methodname' => 'get_users_by_id',
ef22c1b6 113 'classpath' => 'user/externallib.php',
fb79269b 114 'description' => 'Get users by id.',
115 'type' => 'read',
ef22c1b6 116 ),
117
118 'moodle_user_delete_users' => array(
119 'classname' => 'moodle_user_external',
120 'methodname' => 'delete_users',
121 'classpath' => 'user/externallib.php',
fb79269b 122 'description' => 'Delete users.',
123 'type' => 'write',
ef22c1b6 124 ),
125
126 'moodle_user_update_users' => array(
127 'classname' => 'moodle_user_external',
128 'methodname' => 'update_users',
129 'classpath' => 'user/externallib.php',
fb79269b 130 'description' => 'Update users.',
131 'type' => 'write',
ef22c1b6 132 ),
e9b66095 133
134 'moodle_enrol_role_assign' => array(
135 'classname' => 'moodle_enrol_external',
136 'methodname' => 'role_assign',
137 'classpath' => 'enrol/externallib.php',
138 'description' => 'Enrol users.',
139 'type' => 'write',
140 ),
141
142 'moodle_enrol_role_unassign' => array(
143 'classname' => 'moodle_enrol_external',
144 'methodname' => 'role_unassign',
145 'classpath' => 'enrol/externallib.php',
146 'description' => 'Unenrol users.',
147 'type' => 'write',
148 ),
9a0df45a 149);