nymea/tests/auto/api.json

496 lines
15 KiB
JSON

3
{
"methods": {
"Actions.ExecuteAction": {
"description": "Execute a single action.",
"params": {
"actionTypeId": "uuid",
"deviceId": "uuid",
"o:params": [
"$ref:Param"
]
},
"returns": {
"errorMessage": "string",
"success": "bool"
}
},
"Actions.GetActionType": {
"description": "Get the ActionType for the given ActionTypeId",
"params": {
"actionTypeId": "uuid"
},
"returns": {
"errorMessage": "string",
"o:actionType": {
"id": "uuid",
"name": "string",
"paramTypes": [
"$ref:ParamType"
]
},
"success": "bool"
}
},
"Devices.AddConfiguredDevice": {
"description": "Add a configured device with a setupMethod of SetupMethodJustAdd. For devices with a setupMethod different than SetupMethodJustAdd, use PairDevice. Use deviceDescriptorId or deviceParams, depending on the createMethod of the device class. CreateMethodJustAdd takes the parameters you want to have with that device. CreateMethodDiscovery requires the use of a deviceDescriptorId.",
"params": {
"deviceClassId": "uuid",
"o:deviceDescriptorId": "uuid",
"o:deviceParams": [
"$ref:Param"
]
},
"returns": {
"errorMessage": "string",
"o:deviceId": "uuid",
"success": "bool"
}
},
"Devices.ConfirmPairing": {
"description": "Confirm an ongoing pairing. In case of SetupMethodEnterPin also provide the pin in the params.",
"params": {
"o:secret": "string",
"pairingTransactionId": "uuid"
},
"returns": {
"errorMessage": "string",
"o:deviceId": "uuid",
"success": "bool"
}
},
"Devices.GetActionTypes": {
"description": "Get action types for a specified deviceClassId.",
"params": {
"deviceClassId": "uuid"
},
"returns": {
"actionTypes": [
"$ref:ActionType"
]
}
},
"Devices.GetConfiguredDevices": {
"description": "Returns a list of configured devices.",
"params": {
},
"returns": {
"devices": [
"$ref:Device"
]
}
},
"Devices.GetDiscoveredDevices": {
"description": "Performs a device discovery and returns the results. This function may take a while to return.",
"params": {
"deviceClassId": "uuid",
"o:discoveryParams": [
"$ref:Param"
]
},
"returns": {
"errorMessage": "string",
"o:deviceDescriptors": [
"$ref:DeviceDescriptor"
],
"success": "bool"
}
},
"Devices.GetEventTypes": {
"description": "Get event types for a specified deviceClassId.",
"params": {
"deviceClassId": "uuid"
},
"returns": {
"eventTypes": [
"$ref:EventType"
]
}
},
"Devices.GetPluginConfiguration": {
"description": "Get a plugin's params.",
"params": {
"pluginId": "uuid"
},
"returns": {
"errorMessage": "string",
"o:configuration": [
"$ref:Param"
],
"success": "bool"
}
},
"Devices.GetPlugins": {
"description": "Returns a list of loaded plugins.",
"params": {
},
"returns": {
"plugins": [
"$ref:Plugin"
]
}
},
"Devices.GetStateTypes": {
"description": "Get state types for a specified deviceClassId.",
"params": {
"deviceClassId": "uuid"
},
"returns": {
"stateTypes": [
"$ref:StateType"
]
}
},
"Devices.GetStateValue": {
"description": "Get the value of the given device and the given stateType",
"params": {
"deviceId": "uuid",
"stateTypeId": "uuid"
},
"returns": {
"errorMessage": "string",
"o:value": "variant",
"success": "bool"
}
},
"Devices.GetSupportedDevices": {
"description": "Returns a list of supported Device classes, optionally filtered by vendorId.",
"params": {
"o:vendorId": "uuid"
},
"returns": {
"deviceClasses": [
"$ref:DeviceClass"
]
}
},
"Devices.GetSupportedVendors": {
"description": "Returns a list of supported Vendors.",
"params": {
},
"returns": {
"vendors": [
"$ref:Vendor"
]
}
},
"Devices.PairDevice": {
"description": "Pair a device. Use this for DeviceClasses with a setupMethod different than SetupMethodJustAdd.Use deviceDescriptorId or deviceParams, depending on the createMethod of the device class. CreateMethodJustAdd takes the parameters you want to have with that device. CreateMethodDiscovery requires the use of a deviceDescriptorId. If success is true, the return values will contain a pairingTransactionId, a displayMessage and the setupMethod. Depending on the setupMethod you should either proceed with AddConfiguredDevice or PairDevice.",
"params": {
"deviceClassId": "uuid",
"o:deviceDescriptorId": "uuid",
"o:deviceParams": [
"$ref:Param"
]
},
"returns": {
"errorMessage": "string",
"o:displayMessage": "string",
"o:pairingTransactionId": "uuid",
"o:setupMethod": "$ref:SetupMethodType",
"success": "bool"
}
},
"Devices.RemoveConfiguredDevice": {
"description": "Remove a device from the system.",
"params": {
"deviceId": "uuid",
"o:removePolicyList": [
{
"policy": "$ref:RemovePolicyType",
"ruleId": "uuid"
}
]
},
"returns": {
"errorMessage": "string",
"success": "bool"
}
},
"Devices.SetPluginConfiguration": {
"description": "Set a plugin's params.",
"params": {
"configuration": [
"$ref:Param"
],
"pluginId": "uuid"
},
"returns": {
"errorMessage": "string",
"success": "bool"
}
},
"JSONRPC.Introspect": {
"description": "Introspect this API.",
"params": {
},
"returns": {
"methods": "object",
"types": "object"
}
},
"JSONRPC.SetNotificationStatus": {
"description": "Enable/Disable notifications for this connections.",
"params": {
"enabled": "bool"
},
"returns": {
"enabled": "bool",
"errorMessage": "string",
"success": "bool"
}
},
"JSONRPC.Version": {
"description": "Version of this Guh/JSONRPC interface.",
"params": {
},
"returns": {
"protocol version": "string",
"version": "string"
}
},
"Rules.AddRule": {
"description": "Add a rule.",
"params": {
"actions": [
"$ref:Action"
],
"o:eventDescriptor": "$ref:EventDescriptor",
"o:eventDescriptorList": [
"$ref:EventDescriptor"
],
"o:stateEvaluator": "$ref:StateEvaluator"
},
"returns": {
"errorMessage": "string",
"o:ruleId": "uuid",
"success": "bool"
}
},
"Rules.FindRules": {
"description": "Find a list of rules containing any of the given parameters.",
"params": {
"deviceId": "uuid"
},
"returns": {
"ruleIds": [
"uuid"
]
}
},
"Rules.GetRuleDetails": {
"description": "Get details for the rule identified by ruleId",
"params": {
"ruleId": "uuid"
},
"returns": {
"rule": "$ref:Rule"
}
},
"Rules.GetRules": {
"description": "Get all configured rules",
"params": {
},
"returns": {
"ruleIds": [
"uuid"
]
}
},
"Rules.RemoveRule": {
"description": "Remove a rule",
"params": {
"ruleId": "uuid"
},
"returns": {
"errorMessage": "string",
"success": "bool"
}
}
},
"notifications": {
"Devices.StateChanged": {
"description": "Emitted whenever a State of a device changes.",
"params": {
"deviceId": "uuid",
"stateTypeId": "uuid",
"variant": "value"
}
},
"Events.EventTriggered": {
"description": "Emitted whenever an Event is triggered.",
"params": {
"event": "$ref:Event"
}
}
},
"types": {
"Action": {
"actionTypeId": "uuid",
"deviceId": "uuid",
"o:params": [
"$ref:Param"
]
},
"ActionType": {
"id": "uuid",
"name": "string",
"paramTypes": [
"$ref:ParamType"
]
},
"BasicType": [
"uuid",
"string",
"integer",
"double",
"bool"
],
"CreateMethodType": [
"CreateMethodUser",
"CreateMethodAuto",
"CreateMethodDiscovery"
],
"Device": {
"deviceClassId": "uuid",
"id": "uuid",
"name": "string",
"params": [
"$ref:Param"
],
"setupComplete": "bool"
},
"DeviceClass": {
"actionTypes": [
"$ref:ActionType"
],
"createMethod": "$ref:CreateMethodType",
"discoveryParamTypes": [
"$ref:ParamType"
],
"eventTypes": [
"$ref:EventType"
],
"id": "uuid",
"name": "string",
"paramTypes": [
"$ref:ParamType"
],
"setupMethod": "$ref:SetupMethodType",
"stateTypes": [
"$ref:StateType"
],
"vendorId": "uuid"
},
"DeviceDescriptor": {
"description": "string",
"id": "uuid",
"title": "string"
},
"Event": {
"deviceId": "uuid",
"eventTypeId": "uuid",
"o:params": [
"$ref:Param"
]
},
"EventDescriptor": {
"deviceId": "uuid",
"eventTypeId": "uuid",
"o:paramDescriptors": [
"$ref:ParamDescriptor"
]
},
"EventType": {
"id": "uuid",
"name": "string",
"paramTypes": [
"$ref:ParamType"
]
},
"Param": {
"name": "string",
"value": "$ref:BasicType"
},
"ParamDescriptor": {
"name": "string",
"operator": "$ref:ValueOperatorType",
"value": "$ref:BasicType"
},
"ParamType": {
"name": "string",
"o:defaultValue": "variant",
"o:maxValue": "variant",
"o:minValue": "variant",
"type": "$ref:BasicType"
},
"Plugin": {
"id": "uuid",
"name": "string",
"params": [
"$ref:Param"
]
},
"RemovePolicyType": [
"RemovePolicyCascade",
"RemovePolicyUpdate"
],
"Rule": {
"actions": [
"$ref:Action"
],
"eventDescriptors": [
"$ref:EventDescriptor"
],
"id": "uuid",
"stateEvaluator": "$ref:StateEvaluator"
},
"SetupMethodType": [
"SetupMethodJustAdd",
"SetupMethodDisplayPin",
"SetupMethodEnterPin",
"SetupMethodPushButton"
],
"State": {
"deviceId": "uuid",
"stateTypeId": "uuid",
"value": "variant"
},
"StateDescriptor": {
"deviceId": "uuid",
"operator": "$ref:ValueOperatorType",
"stateTypeId": "uuid",
"value": "variant"
},
"StateEvaluator": {
"o:childEvaluators": [
"$ref:StateEvaluator"
],
"o:operator": "$ref:StateOperatorType",
"o:stateDescriptor": "$ref:StateDescriptor"
},
"StateOperatorType": [
"StateOperatorAnd",
"StateOperatorOr"
],
"StateType": {
"defaultValue": "variant",
"id": "uuid",
"name": "string",
"type": "$ref:BasicType"
},
"ValueOperatorType": [
"OperatorTypeEquals",
"OperatorTypeNotEquals",
"OperatorTypeLess",
"OperatorTypeGreater",
"OperatorTypeLessThan",
"OperatorTypeGreaterThan"
],
"Vendor": {
"id": "uuid",
"name": "string"
}
}
}