Skip to content

2.4 Extension Types ​

Header file:

  • src/service/extension/include/extension_types.h

Implementation reference:

  • src/service/extension/service/extension_service.cpp
  • src/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:

json
{
  "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:

json
[
  {
    "extension": {},
    "state": {}
  }
]

Field names maintain server-side camelCase convention: scriptLang , isRunning are not converted to snake_case.

2.4.2 ExtensionBaseInfo ​

FieldTypeDescription
namestd::stringPlugin name
authorstd::stringAuthor
typestd::stringPlugin type
scriptLangstd::stringScript language, uses camelCase to align with Python
descriptionstd::stringDescription
versionstd::stringVersion
contactstd::stringContact
copyrightstd::stringCopyright
licensestd::stringLicense
entrystd::stringEntry file
urlstd::stringWeb plugin access URL

These fields all come from the extensionClient node in the returned JSON.

2.4.3 ExtensionState ​

FieldTypeDescription
enabledboolWhether enabled
isRunningboolWhether running, uses camelCase to align with Python
portint32_tService port; defaults to 0 when missing

These fields all come from the state node in the returned JSON.

2.4.4 ExtensionInfo ​

FieldTypeDescription
extensionClientExtensionBaseInfoBase info
stateExtensionStateRunning state

ExtensionInfo is the unified return structure of the ExtensionClient module:

  • GetList() returns std::vector<ExtensionInfo>
  • Get() returns a single ExtensionInfo
  • C99 Arm_Extension_GetList / Arm_Extension_Get return 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 / isRunning are missing, they default to false .
  • When port is missing or has invalid type, it defaults to 0 .

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 InterfaceOutput Content
Arm_Extension_GetListCompact JSON text of ExtensionInfo[]
Arm_Extension_GetCompact 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_CallService returns the JSON text of the service result result , not part of the ExtensionInfo structure family.

2.4.7 Related Method Pages ​

  • 3.12 ExtensionClient
  • 4.12 C99 Extension