This is a translation of the original English documentation page. Help us make it better.

module.get

Description

integer/array module.get(object parameters)

The method allows to retrieve modules according to the given parameters.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
moduleids string/array Return only modules with the given IDs.
sortfield string/array Sort the result by the given properties.

Possible values: moduleid, relative_path.
countOutput boolean These parameters being common for all get methods are described in detail in the Reference commentary page.
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

戻り値

(integer/array) 次のいずれかを返します:

  • オブジェクトの配列
  • countOutputパラメータが使用されている場合、取得されたオブジェクトの数

Retrieving a module by ID

Retrieve all data about modules "1", "2", and "25".

Request:

{
           "jsonrpc": "2.0",
           "method": "module.get",
           "params": {
               "output": "extend",
               "moduleids": [
                   "1",
                   "2",
                   "25"
               ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "moduleid": "1",
                   "id": "actionlog",
                   "relative_path": "widgets/actionlog",
                   "status": "1",
                   "config": []
               },
               {
                   "moduleid": "2",
                   "id": "clock",
                   "relative_path": "widgets/clock",
                   "status": "1",
                   "config": []
               },
               {
                   "moduleid": "25",
                   "id": "example",
                   "relative_path": "modules/example_module",
                   "status": "1",
                   "config": []
               }
           ],
           "id": 1
       }

参照

ソース

CModule::get() in ui/include/classes/api/services/CModule.php.