Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
JSON-RPC

Classes

class  JSONRPC::CJSONRPC
 JSON RPC handler. More...
 
struct  JSONRPC::JsonRpcStatusDescription
 Describes a JSONRPC_STATUS that is reported to a client as an error. More...
 
class  JSONRPC::JSONSchemaTypeDefinition
 Class for a parameter of a json rpc method. More...
 
class  JSONRPC::JsonRpcMethod
 Structure for a published json rpc method. More...
 
struct  JSONRPC::JsonRpcMethodMap
 Structure mapping a json rpc method definition to an actual method implementation. More...
 
class  JSONRPC::CJSONServiceDescription
 Helper class for json schema service descriptor based service descriptions for the json rpc API. More...
 
class  JSONRPC::CJSONUtils
 Helper class containing utility methods to handle json rpc method calls. More...
 

Enumerations

enum  JSONRPC::JSONRPC_STATUS {
  JSONRPC::OK = 0 , JSONRPC::ACK = -1 , JSONRPC::InvalidRequest = -32600 , JSONRPC::MethodNotFound = -32601 ,
  JSONRPC::InvalidParams = -32602 , JSONRPC::InternalError = -32603 , JSONRPC::ParseError = -32700 , JSONRPC::BadPermission = -32099 ,
  JSONRPC::NotFound = -32098 , JSONRPC::Unavailable = -32097 , JSONRPC::FailedToExecute = -32100
}
 Possible status codes of a response to a JSON-RPC request. More...
 
enum  JSONRPC::OperationPermission {
  JSONRPC::ReadData = 0x1 , JSONRPC::ControlPlayback = 0x2 , JSONRPC::ControlNotify = 0x4 , JSONRPC::ControlPower = 0x8 ,
  JSONRPC::UpdateData = 0x10 , JSONRPC::RemoveData = 0x20 , JSONRPC::Navigate = 0x40 , JSONRPC::WriteFile = 0x80 ,
  JSONRPC::ControlSystem = 0x100 , JSONRPC::ControlGUI = 0x200 , JSONRPC::ManageAddon = 0x400 , JSONRPC::ExecuteAddon = 0x800 ,
  JSONRPC::ControlPVR = 0x1000
}
 Permission categories for json rpc methods. More...
 

Variables

constexpr std::array< JsonRpcStatusDescription, 9 > JSONRPC::JSONRPC_STATUS_DESCRIPTIONS
 The error taxonomy of the JSON-RPC API.
 

Detailed Description

Everything around the json-rpc interface

Everything around the json-rpc interface

Enumeration Type Documentation

◆ JSONRPC_STATUS

Possible status codes of a response to a JSON-RPC request.

Enumerator
OK 
ACK 
InvalidRequest 
MethodNotFound 
InvalidParams 
InternalError 
ParseError 
BadPermission 
NotFound 
Unavailable 
FailedToExecute 

◆ OperationPermission

Permission categories for json rpc methods.

A JSON-RPC method will only be called if the caller has the correct permissions to execute the method. The method call needs to be perfectly threadsafe.

Enumerator
ReadData 
ControlPlayback 
ControlNotify 
ControlPower 
UpdateData 
RemoveData 
Navigate 
WriteFile 
ControlSystem 
ControlGUI 
ManageAddon 
ExecuteAddon 
ControlPVR 

Variable Documentation

◆ JSONRPC_STATUS_DESCRIPTIONS

std::array<JsonRpcStatusDescription, 9> JSONRPC::JSONRPC_STATUS_DESCRIPTIONS
inlineconstexpr
Initial value:
{{
{ParseError, "ParseError", "Parse error.", "The request could not be parsed as JSON.", false},
{InvalidRequest, "InvalidRequest", "Invalid request.",
"The request parsed as JSON but is not a well-formed JSON-RPC 2.0 request object.", false},
{MethodNotFound, "MethodNotFound", "Method not found.",
"The requested method does not exist, or the client lacks the permission to see it.", false},
{InvalidParams, "InvalidParams", "Invalid params.",
"The given parameters do not validate against the schema of the method. The \"data\" member "
"names the offending parameter and the constraint it failed.",
true},
{InternalError, "InternalError", "Internal error.",
"The method failed for a reason that no other status describes.", false},
{FailedToExecute, "FailedToExecute", "Failed to execute method.",
"The method was called correctly but the operation it requested did not succeed. Note that "
"-32100 sits one code point below the -32099..-32000 range that JSON-RPC 2.0 reserves for "
"implementation-defined server errors; this is long-standing and is retained for "
"compatibility with existing clients.",
false},
{BadPermission, "BadPermission", "Bad client permission.",
"The client does not hold every permission the method requires.", false},
{NotFound, "NotFound", "Not found.", "The requested item does not exist.", false},
{Unavailable, "Unavailable", "Requested item is unavailable.",
"The requested item exists but cannot be provided at the moment.", false},
}}
@ FailedToExecute
Definition JSONRPCUtils.h:44
@ InvalidParams
Definition JSONRPCUtils.h:37
@ BadPermission
Definition JSONRPCUtils.h:41
@ NotFound
Definition JSONRPCUtils.h:42
@ ParseError
Definition JSONRPCUtils.h:39
@ Unavailable
Definition JSONRPCUtils.h:43
@ InternalError
Definition JSONRPCUtils.h:38
@ InvalidRequest
Definition JSONRPCUtils.h:35

The error taxonomy of the JSON-RPC API.

Every JSONRPC_STATUS that reaches a client as an error appears here exactly once. OK and ACK are absent because they produce a result rather than an error.