2.4 Extension Types
Header file:
src/service/extension/include/extension_types.h
Implementation reference:
src/service/extension/service/extension_service.cppsrc/api/c99/src/c_arm_extension.cpp
Overview
The ExtensionClient module uses a three-layer structure to represent plugin data: base info, running state, and complete details.
GetList() returns std::vector<ExtensionInfo> , Get(const std::string& name) returns a single ExtensionInfo , C99 Arm_Extension_GetList / Arm_Extension_Get serialize the same structure into compact JSON text.
2.4.1 JSON Shape
Single plugin details:
{
"extension": {
"name": "demo",
"author": "agilebot",
"type": "easyservice",
"scriptLang": "python",
"description": "demo extension",
"version": "1.0.0",
"contact": "",
"copyright": "",
"license": "",
"entry": "main.py",
"url": "http://127.0.0.1:9000"
},
"state": {
"enabled": true,
"isRunning": true,
"port": 9000
}
}Plugin list:
[
{
"extension": {},
"state": {}
}
]Field names maintain server-side camelCase convention: scriptLang , isRunning are not converted to snake_case.
2.4.2 ExtensionBaseInfo
| Field | Type | Description |
|---|---|---|
name | std::string | Plugin name |
author | std::string | Author |
type | std::string | Plugin type |
scriptLang | std::string | Script language, uses camelCase to align with Python |
description | std::string | Description |
version | std::string | Version |
contact | std::string | Contact |
copyright | std::string | Copyright |
license | std::string | License |
entry | std::string | Entry file |
url | std::string | Web plugin access URL |
These fields all come from the extensionClient node in the returned JSON.
2.4.3 ExtensionState
| Field | Type | Description |
|---|---|---|
enabled | bool | Whether enabled |
isRunning | bool | Whether running, uses camelCase to align with Python |
port | int32_t | Service port; defaults to 0 when missing |
These fields all come from the state node in the returned JSON.
2.4.4 ExtensionInfo
| Field | Type | Description |
|---|---|---|
extensionClient | ExtensionBaseInfo | Base info |
state | ExtensionState | Running state |
ExtensionInfo is the unified return structure of the ExtensionClient module:
GetList()returnsstd::vector<ExtensionInfo>Get()returns a singleExtensionInfo- C99
Arm_Extension_GetList/Arm_Extension_Getreturn JSON with the same field names
2.4.5 Default Value Conventions
- When the server returns with missing fields, string fields are filled with empty strings.
- When
enabled/isRunningare missing, they default tofalse. - When
portis missing or has invalid type, it defaults to0.
If top-level extensionClient / state nodes are missing, the SDK treats them as empty objects, then fills in default values field by field.
2.4.6 C99 Mapping Interface
| C99 Interface | Output Content |
|---|---|
Arm_Extension_GetList | Compact JSON text of ExtensionInfo[] |
Arm_Extension_Get | Compact JSON text of single ExtensionInfo |
Additional conventions:
- C99 output uses UTF-8 compact JSON without extra indentation.
- Field names are consistent with C++ structs, no case conversion.
Arm_Extension_CallServicereturns the JSON text of the service resultresult, not part of theExtensionInfostructure family.
2.4.7 Related Method Pages
- 3.12 ExtensionClient
- 4.12 C99 Extension