diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 000000000..1fd676fd4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,22 @@ +--- +name: Question +about: Describe this issue template's purpose here. +title: '' +labels: question +assignees: '' + +--- + +When your question is related to code that isn't working as expected, please +enable debug logs: + +``` python +import logging +logging.basicConfig(level=logging.DEBUG) +``` + +More info can be found in the [Debugging +section](https://github.com/mobilityhouse/ocpp#debugging) of the README. + +If these actions didn't help to find the cause of your issue, please provide +code samples and logs with your question. diff --git a/.gitignore b/.gitignore index 67e8cb628..ff2f87e56 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,6 @@ venv.bak/ .mypy_cache/ .idea/* + +### OSX ### +*.DS_Store diff --git a/README.rst b/README.rst index a12910da8..dff20a978 100644 --- a/README.rst +++ b/README.rst @@ -163,6 +163,29 @@ Charge point if __name__ == '__main__': asyncio.run(main()) +Debugging +--------- + +Python's default log level is `logging.WARNING`. As result most of the logs +generated by this package are discarded. To see the log output of this package +lower the log level to `logging.DEBUG`. + +.. code-block:: python + + import logging + logging.basicConfig(level=logging.DEBUG) + +However, this approach defines the log level for the complete logging system. +In other words: the log level of all dependencies is set to `logging.DEBUG`. + +To lower the logs for this package only use the following code: + +.. code-block:: python + + import logging + logging.getLogger('ocpp').setLevel(level=logging.DEBUG) + logging.getLogger('ocpp').addHandler(logging.StreamHandler()) + License ------- diff --git a/ocpp/v16/call.py b/ocpp/v16/call.py index e07b57b49..0bb9c5b28 100644 --- a/ocpp/v16/call.py +++ b/ocpp/v16/call.py @@ -13,6 +13,10 @@ Reason, ResetType, UpdateType, + CertificateUse, + SignedFirmwareStatus, + Log, + UploadLogStatus, ) # Most types of CALL messages can originate from only 1 source, either @@ -38,6 +42,11 @@ class CancelReservationPayload: reservation_id: int +@dataclass +class CertificateSignedPayload: + certificate_chain: str + + @dataclass class ChangeAvailabilityPayload: connector_id: int @@ -63,6 +72,17 @@ class ClearChargingProfilePayload: stack_level: Optional[int] = None +@dataclass +class DeleteCertificatePayload: + certificate_hash_data: Dict + + +@dataclass +class ExtendedTriggerMessagePayload: + requested_message: MessageTrigger + connector_id: Optional[int] = None + + @dataclass class GetCompositeSchedulePayload: connector_id: int @@ -84,11 +104,31 @@ class GetDiagnosticsPayload: stop_time: Optional[str] = None +@dataclass +class GetInstalledCertificateIdsPayload: + certificate_type: CertificateUse + + @dataclass class GetLocalListVersionPayload: pass +@dataclass +class GetLogPayload: + log: Dict + log_type: Log + request_id: int + retries: Optional[int] = None + retry_interval: Optional[int] = None + + +@dataclass +class InstallCertificatePayload: + certificate_type: CertificateUse + certificate: str + + @dataclass class RemoteStartTransactionPayload: id_tag: str @@ -128,6 +168,14 @@ class SetChargingProfilePayload: cs_charging_profiles: Dict +@dataclass +class SignedUpdateFirmwarePayload: + request_id: int + firmware: Dict + retries: Optional[int] = None + retry_interval: Optional[int] = None + + @dataclass class TriggerMessagePayload: requested_message: MessageTrigger @@ -183,6 +231,12 @@ class HeartbeatPayload: pass +@dataclass +class LogStatusNotificationPayload: + status: UploadLogStatus + request_id: int + + @dataclass class MeterValuesPayload: connector_id: int @@ -190,6 +244,24 @@ class MeterValuesPayload: transaction_id: Optional[int] = None +@dataclass +class SecurityEventNotificationPayload: + type: str + timestamp: str + tech_info: Optional[str] + + +@dataclass +class SignCertificatePayload: + csr: str + + +@dataclass +class SignedFirmwareStatusNotificationPayload: + status: SignedFirmwareStatus + request_id: int + + @dataclass class StartTransactionPayload: connector_id: int diff --git a/ocpp/v16/call_result.py b/ocpp/v16/call_result.py index 60ddde6de..a9d11970a 100644 --- a/ocpp/v16/call_result.py +++ b/ocpp/v16/call_result.py @@ -16,6 +16,13 @@ TriggerMessageStatus, UpdateStatus, UnlockStatus, + CertificateSignedStatus, + CertificateStatus, + DeleteCertificateStatus, + GenericStatus, + GetInstalledCertificateStatus, + LogStatus, + UpdateFirmwareStatus ) # Most types of CALLRESULT messages can originate from only 1 source, either @@ -63,6 +70,21 @@ class HeartbeatPayload: current_time: str +@dataclass +class LogStatusNotificationPayload: + pass + + +@dataclass +class SecurityEventNotificationPayload: + pass + + +@dataclass +class SignCertificatePayload: + status: GenericStatus + + @dataclass class MeterValuesPayload: pass @@ -93,6 +115,11 @@ class CancelReservationPayload: status: CancelReservationStatus +@dataclass +class CertificateSignedPayload: + status: CertificateSignedStatus + + @dataclass class ChangeAvailabilityPayload: status: AvailabilityStatus @@ -113,6 +140,22 @@ class ClearChargingProfilePayload: status: ClearChargingProfileStatus +@dataclass +class DeleteCertificatePayload: + status: DeleteCertificateStatus + + +@dataclass +class ExtendedTriggerMessagePayload: + status: TriggerMessageStatus + + +@dataclass +class GetInstalledCertificateIdsPayload: + status: GetInstalledCertificateStatus + certificate_hash_data: Optional[List] = None + + @dataclass class GetCompositeSchedulePayload: status: GetCompositeScheduleStatus @@ -137,6 +180,17 @@ class GetLocalListVersionPayload: list_version: int +@dataclass +class GetLogPayload: + status: LogStatus + filename: Optional[str] = None + + +@dataclass +class InstallCertificatePayload: + status: CertificateStatus + + @dataclass class RemoteStartTransactionPayload: status: RemoteStartStopStatus @@ -167,6 +221,16 @@ class SetChargingProfilePayload: status: ChargingProfileStatus +@dataclass +class SignedFirmwareStatusNotificationPayload: + pass + + +@dataclass +class SignedUpdateFirmwarePayload: + status: UpdateFirmwareStatus + + @dataclass class TriggerMessagePayload: status: TriggerMessageStatus diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index e922371e2..41213261b 100644 --- a/ocpp/v16/enums.py +++ b/ocpp/v16/enums.py @@ -6,25 +6,36 @@ class Action(str, Enum): Authorize = "Authorize" BootNotification = "BootNotification" CancelReservation = "CancelReservation" + CertificateSigned = "CertificateSigned" ChangeAvailability = "ChangeAvailability" ChangeConfiguration = "ChangeConfiguration" ClearCache = "ClearCache" ClearChargingProfile = "ClearChargingProfile" DataTransfer = "DataTransfer" + DeleteCertificate = "DeleteCertificate" DiagnosticsStatusNotification = "DiagnosticsStatusNotification" + ExtendedTriggerMessage = "ExtendedTriggerMessage" FirmwareStatusNotification = "FirmwareStatusNotification" GetCompositeSchedule = "GetCompositeSchedule" GetConfiguration = "GetConfiguration" GetDiagnostics = "GetDiagnostics" + GetInstalledCertificateIds = "GetInstalledCertificateIds" GetLocalListVersion = "GetLocalListVersion" + GetLog = "GetLog" Heartbeat = "Heartbeat" + InstallCertificate = "InstallCertificate" + LogStatusNotification = "LogStatusNotification" MeterValues = "MeterValues" RemoteStartTransaction = "RemoteStartTransaction" RemoteStopTransaction = "RemoteStopTransaction" ReserveNow = "ReserveNow" Reset = "Reset" + SecurityEventNotification = "SecurityEventNotification" SendLocalList = "SendLocalList" SetChargingProfile = "SetChargingProfile" + SignCertificate = "SignCertificate" + SignedFirmwareStatusNotification = "SignedFirmwareStatusNotification" + SignedUpdateFirmware = "SignedUpdateFirmware" StartTransaction = "StartTransaction" StatusNotification = "StatusNotification" StopTransaction = "StopTransaction" @@ -73,6 +84,35 @@ class CancelReservationStatus(str, Enum): rejected = "Rejected" +class CertificateSignedStatus(str, Enum): + """ + CertificateSignedStatusEnumType is used by: CertificateSigned.conf + """ + + accepted = "Accepted" + rejected = "Rejected" + + +class CertificateStatus(str, Enum): + """ + CertificateStatusEnumType is used by: InstallCertificate.conf + """ + + accepted = "Accepted" + rejected = "Rejected" + failed = "Failed" + + +class CertificateUse(str, Enum): + """ + CertificateUseEnumType is used by: GetInstalledCertificateIds.req, + InstallCertificate.req + """ + + central_system_root_certificate = "CentralSystemRootCertificate" + manufacturer_root_certificate = "ManufacturerRootCertificate" + + class ChargePointErrorCode(str, Enum): """ Charge Point status reported in StatusNotification.req. @@ -270,6 +310,16 @@ class DataTransferStatus(str, Enum): unknownVendorId = "UnknownVendorId" +class DeleteCertificateStatus(str, Enum): + """ + DeleteCertificateStatusEnumType is used by: DeleteCertificate.conf + """ + + accepted = "Accepted" + failed = "Failed" + not_found = "NotFound" + + class DiagnosticsStatus(str, Enum): """ Status in DiagnosticsStatusNotification.req. @@ -302,6 +352,15 @@ class FirmwareStatus(str, Enum): installationFailed = "InstallationFailed" +class GenericStatus(str, Enum): + """ + Generic message response status + """ + + accepted = "Accepted" + rejected = "Rejected" + + class GetCompositeScheduleStatus(str, Enum): """ Status returned in response to GetCompositeSchedule.req @@ -311,6 +370,26 @@ class GetCompositeScheduleStatus(str, Enum): rejected = "Rejected" +class GetInstalledCertificateStatus(str, Enum): + """ + GetInstalledCertificateStatusEnumType is used by: + GetInstalledCertificateIds.conf + """ + + accepted = "Accepted" + not_found = "NotFound" + + +class HashAlgorithm(str, Enum): + """ + HashAlgorithmEnumType is used by: CertificateHashDataType + """ + + sha256 = "SHA256" + sha384 = "SHA384" + sha512 = "SHA512" + + class Location(str, Enum): """ Allowable values of the optional "location" field of a value element in @@ -324,6 +403,25 @@ class Location(str, Enum): ev = "EV" +class Log(str, Enum): + """ + LogEnumType is used by GetLog.req + """ + + diagnostics_log = "DiagnosticsLog" + security_log = "SecurityLog" + + +class LogStatus(str, Enum): + """ + LogStatusEnumType is used by: GetLog.conf + """ + + accepted = "Accepted" + rejected = "Rejected" + accepted_canceled = "AcceptedCanceled" + + class Measurand(str, Enum): """ Allowable values of the optional "measurand" field of a Value element, as @@ -379,13 +477,20 @@ class MessageTrigger(str, Enum): Type of request to be triggered in a TriggerMessage.req """ + # Common for TriggerMessagePayload and ExtendedTriggerMessagePayload boot_notification = "BootNotification" - diagnostics_status_notification = "DiagnosticsStatusNotification" firmware_status_notification = "FirmwareStatusNotification" heartbeat = "Heartbeat" meter_values = "MeterValues" status_notification = "StatusNotification" + # Only for TriggerMessagePayload + diagnostics_status_notification = "DiagnosticsStatusNotification" + + # Only for ExtendedTriggerMessagePayload + log_status_notification = "LogStatusNotification" + sign_charge_point_certificate = "SignChargePointCertificate" + # Soon to be deprecated enums bootNotification = "BootNotification" diagnosticsStatusNotification = "DiagnosticsStatusNotification" @@ -497,6 +602,7 @@ class RemoteStartStopStatus(str, Enum): The result of a RemoteStartTransaction.req or RemoteStopTransaction.req request. """ + accepted = "Accepted" rejected = "Rejected" @@ -531,6 +637,30 @@ class ResetType(str, Enum): soft = "Soft" +class SignedFirmwareStatus(str, Enum): + """ + FirmwareStatusEnumType is used by: SignedFirmwareStatusNotification.req + """ + + certificate_verified = "CertificateVerified" + downloaded = "Downloaded" + download_failed = "DownloadFailed" + downloading = "Downloading" + download_scheduled = "DownloadScheduled" + download_paused = "DownloadPaused" + idle = "Idle" + installation_failed = "InstallationFailed" + installing = "Installing" + installed = "Installed" + install_rebooting = "InstallRebooting" + install_scheduled = "InstallScheduled" + install_verification_failed = "InstallVerificationFailed" + invalid_signature = "InvalidSignature" + invalid_certificate = "InvalidCertificate" + revoked_certificate = "RevokedCertificate" + signature_verified = "SignatureVerified" + + class TriggerMessageStatus(str, Enum): """ Status in TriggerMessage.conf. @@ -584,6 +714,32 @@ class UnlockStatus(str, Enum): notSupported = "NotSupported" +class UpdateFirmwareStatus(str, Enum): + """ + UpdateFirmwareStatusEnumType is used by: SignedUpdateFirmware.conf + """ + + accepted = "Accepted" + rejected = "Rejected" + accepted_canceled = "AcceptedCanceled" + invalid_certificate = "InvalidCertificate" + revoked_certificate = "RevokedCertificate" + + +class UploadLogStatus(str, Enum): + """ + UploadLogStatusEnumType is used by: LogStatusNotification.req + """ + + bad_message = "BadMessage" + idle = "Idle" + not_supported_operation = "NotSupportedOperation" + permission_denied = "PermissionDenied" + uploaded = "Uploaded" + upload_failure = "UploadFailure" + uploading = "Uploading" + + class UpdateStatus(str, Enum): """ Type of update for a SendLocalList.req. diff --git a/ocpp/v16/schemas/CertificateSigned.json b/ocpp/v16/schemas/CertificateSigned.json new file mode 100644 index 000000000..e8a323ff3 --- /dev/null +++ b/ocpp/v16/schemas/CertificateSigned.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:CertificateSigned.req", + "type": "object", + "properties": { + "certificateChain": { + "type": "string", + "maxLength": 10000 + } + }, + "additionalProperties": false, + "required": [ + "certificateChain" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/CertificateSignedResponse.json b/ocpp/v16/schemas/CertificateSignedResponse.json new file mode 100644 index 000000000..49070304c --- /dev/null +++ b/ocpp/v16/schemas/CertificateSignedResponse.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:CertificateSigned.conf", + "definitions": { + "CertificateSignedStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Rejected" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/CertificateSignedStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/DeleteCertificate.json b/ocpp/v16/schemas/DeleteCertificate.json new file mode 100644 index 000000000..a0d5ad8ae --- /dev/null +++ b/ocpp/v16/schemas/DeleteCertificate.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:DeleteCertificate.req", + "definitions": { + "HashAlgorithmEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "SHA256", + "SHA384", + "SHA512" + ] + }, + "CertificateHashDataType": { + "type": "object", + "additionalProperties": false, + "properties": { + "hashAlgorithm": { + "$ref": "#/definitions/HashAlgorithmEnumType" + }, + "issuerNameHash": { + "type": "string", + "maxLength": 128 + }, + "issuerKeyHash": { + "type": "string", + "maxLength": 128 + }, + "serialNumber": { + "type": "string", + "maxLength": 40 + } + }, + "required": [ + "hashAlgorithm", + "issuerNameHash", + "issuerKeyHash", + "serialNumber" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "certificateHashData": { + "$ref": "#/definitions/CertificateHashDataType" + } + }, + "required": [ + "certificateHashData" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/DeleteCertificateResponse.json b/ocpp/v16/schemas/DeleteCertificateResponse.json new file mode 100644 index 000000000..75c30a2a8 --- /dev/null +++ b/ocpp/v16/schemas/DeleteCertificateResponse.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:DeleteCertificate.conf", + "definitions": { + "DeleteCertificateStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Failed", + "NotFound" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/DeleteCertificateStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/ExtendedTriggerMessage.json b/ocpp/v16/schemas/ExtendedTriggerMessage.json new file mode 100644 index 000000000..02735dd5e --- /dev/null +++ b/ocpp/v16/schemas/ExtendedTriggerMessage.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:ExtendedTriggerMessage.req", + "definitions": { + "MessageTriggerEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "BootNotification", + "LogStatusNotification", + "FirmwareStatusNotification", + "Heartbeat", + "MeterValues", + "SignChargePointCertificate", + "StatusNotification" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "requestedMessage": { + "$ref": "#/definitions/MessageTriggerEnumType" + }, + "connectorId": { + "type": "integer" + } + }, + "required": [ + "requestedMessage" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/ExtendedTriggerMessageResponse.json b/ocpp/v16/schemas/ExtendedTriggerMessageResponse.json new file mode 100644 index 000000000..a32f4c6ca --- /dev/null +++ b/ocpp/v16/schemas/ExtendedTriggerMessageResponse.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:ExtendedTriggerMessage.conf", + "definitions": { + "TriggerMessageStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Rejected", + "NotImplemented" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/TriggerMessageStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/GetInstalledCertificateIds.json b/ocpp/v16/schemas/GetInstalledCertificateIds.json new file mode 100644 index 000000000..b3c91f197 --- /dev/null +++ b/ocpp/v16/schemas/GetInstalledCertificateIds.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:GetInstalledCertificateIds.req", + "definitions": { + "CertificateUseEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "CentralSystemRootCertificate", + "ManufacturerRootCertificate" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "certificateType": { + "$ref": "#/definitions/CertificateUseEnumType" + } + }, + "required": [ + "certificateType" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/GetInstalledCertificateIdsResponse.json b/ocpp/v16/schemas/GetInstalledCertificateIdsResponse.json new file mode 100644 index 000000000..2e78d76ed --- /dev/null +++ b/ocpp/v16/schemas/GetInstalledCertificateIdsResponse.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:GetInstalledCertificateIds.conf", + "definitions": { + "GetInstalledCertificateStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "NotFound" + ] + }, + "HashAlgorithmEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "SHA256", + "SHA384", + "SHA512" + ] + }, + "CertificateHashDataType": { + "javaType": "CertificateHashData", + "type": "object", + "additionalProperties": false, + "properties": { + "hashAlgorithm": { + "$ref": "#/definitions/HashAlgorithmEnumType" + }, + "issuerNameHash": { + "type": "string", + "maxLength": 128 + }, + "issuerKeyHash": { + "type": "string", + "maxLength": 128 + }, + "serialNumber": { + "type": "string", + "maxLength": 40 + } + }, + "required": [ + "hashAlgorithm", + "issuerNameHash", + "issuerKeyHash", + "serialNumber" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "certificateHashData": { + "type": "array", + "additionalItems": false, + "items": { + "$ref": "#/definitions/CertificateHashDataType" + }, + "minItems": 1 + }, + "status": { + "$ref": "#/definitions/GetInstalledCertificateStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/GetLog.json b/ocpp/v16/schemas/GetLog.json new file mode 100644 index 000000000..f58a1a2c3 --- /dev/null +++ b/ocpp/v16/schemas/GetLog.json @@ -0,0 +1,59 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:GetLog.req", + "definitions": { + "LogEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "DiagnosticsLog", + "SecurityLog" + ] + }, + "LogParametersType": { + "type": "object", + "additionalProperties": false, + "properties": { + "remoteLocation": { + "type": "string", + "maxLength": 512 + }, + "oldestTimestamp": { + "type": "string", + "format": "date-time" + }, + "latestTimestamp": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "remoteLocation" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "log": { + "$ref": "#/definitions/LogParametersType" + }, + "logType": { + "$ref": "#/definitions/LogEnumType" + }, + "requestId": { + "type": "integer" + }, + "retries": { + "type": "integer" + }, + "retryInterval": { + "type": "integer" + } + }, + "required": [ + "logType", + "requestId", + "log" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/GetLogResponse.json b/ocpp/v16/schemas/GetLogResponse.json new file mode 100644 index 000000000..31003df99 --- /dev/null +++ b/ocpp/v16/schemas/GetLogResponse.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:GetLog.conf", + "definitions": { + "LogStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Rejected", + "AcceptedCanceled" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/LogStatusEnumType" + }, + "filename": { + "type": "string", + "maxLength": 255 + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/InstallCertificate.json b/ocpp/v16/schemas/InstallCertificate.json new file mode 100644 index 000000000..a99159351 --- /dev/null +++ b/ocpp/v16/schemas/InstallCertificate.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:InstallCertificate.req", + "definitions": { + "CertificateUseEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "CentralSystemRootCertificate", + "ManufacturerRootCertificate" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "certificateType": { + "$ref": "#/definitions/CertificateUseEnumType" + }, + "certificate": { + "type": "string", + "maxLength": 5500 + } + }, + "required": [ + "certificateType", + "certificate" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/InstallCertificateResponse.json b/ocpp/v16/schemas/InstallCertificateResponse.json new file mode 100644 index 000000000..f7afcb569 --- /dev/null +++ b/ocpp/v16/schemas/InstallCertificateResponse.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:InstallCertificate.conf", + "definitions": { + "InstallCertificateStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Failed", + "Rejected" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/InstallCertificateStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/LogStatusNotification.json b/ocpp/v16/schemas/LogStatusNotification.json new file mode 100644 index 000000000..6b3ea7ee6 --- /dev/null +++ b/ocpp/v16/schemas/LogStatusNotification.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:LogStatusNotification.req", + "definitions": { + "UploadLogStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "BadMessage", + "Idle", + "NotSupportedOperation", + "PermissionDenied", + "Uploaded", + "UploadFailure", + "Uploading" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/UploadLogStatusEnumType" + }, + "requestId": { + "type": "integer" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/LogStatusNotificationResponse.json b/ocpp/v16/schemas/LogStatusNotificationResponse.json new file mode 100644 index 000000000..2685517b3 --- /dev/null +++ b/ocpp/v16/schemas/LogStatusNotificationResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:LogStatusNotification.conf", + "type": "object", + "additionalProperties": false +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SecurityEventNotification.json b/ocpp/v16/schemas/SecurityEventNotification.json new file mode 100644 index 000000000..f1e484f6e --- /dev/null +++ b/ocpp/v16/schemas/SecurityEventNotification.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SecurityEventNotification.req", + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "maxLength": 50 + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "techInfo": { + "type": "string", + "maxLength": 255 + } + }, + "required": [ + "type", + "timestamp" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SecurityEventNotificationResponse.json b/ocpp/v16/schemas/SecurityEventNotificationResponse.json new file mode 100644 index 000000000..244ff7453 --- /dev/null +++ b/ocpp/v16/schemas/SecurityEventNotificationResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SecurityEventNotification.conf", + "type": "object", + "additionalProperties": false +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignCertificate.json b/ocpp/v16/schemas/SignCertificate.json new file mode 100644 index 000000000..b27650e95 --- /dev/null +++ b/ocpp/v16/schemas/SignCertificate.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignCertificate.req", + "type": "object", + "additionalProperties": false, + "properties": { + "csr": { + "type": "string", + "maxLength": 5500 + } + }, + "required": [ + "csr" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignCertificateResponse.json b/ocpp/v16/schemas/SignCertificateResponse.json new file mode 100644 index 000000000..449d5ff4d --- /dev/null +++ b/ocpp/v16/schemas/SignCertificateResponse.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignCertificate.conf", + "definitions": { + "GenericStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Rejected" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/GenericStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignedFirmwareStatusNotification.json b/ocpp/v16/schemas/SignedFirmwareStatusNotification.json new file mode 100644 index 000000000..a0ce83c2d --- /dev/null +++ b/ocpp/v16/schemas/SignedFirmwareStatusNotification.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignedFirmwareStatusNotification.req", + "definitions": { + "FirmwareStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Downloaded", + "DownloadFailed", + "Downloading", + "DownloadScheduled", + "DownloadPaused", + "Idle", + "InstallationFailed", + "Installing", + "Installed", + "InstallRebooting", + "InstallScheduled", + "InstallVerificationFailed", + "InvalidSignature", + "SignatureVerified" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/FirmwareStatusEnumType" + }, + "requestId": { + "type": "integer" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignedFirmwareStatusNotificationResponse.json b/ocpp/v16/schemas/SignedFirmwareStatusNotificationResponse.json new file mode 100644 index 000000000..3d9499e0c --- /dev/null +++ b/ocpp/v16/schemas/SignedFirmwareStatusNotificationResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignedFirmwareStatusNotification.conf", + "type": "object", + "additionalProperties": false +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignedUpdateFirmware.json b/ocpp/v16/schemas/SignedUpdateFirmware.json new file mode 100644 index 000000000..756c149cc --- /dev/null +++ b/ocpp/v16/schemas/SignedUpdateFirmware.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignedUpdateFirmware.req", + "definitions": { + "FirmwareType": { + "type": "object", + "additionalProperties": false, + "properties": { + "location": { + "type": "string", + "maxLength": 512 + }, + "retrieveDateTime": { + "type": "string", + "format": "date-time" + }, + "installDateTime": { + "type": "string", + "format": "date-time" + }, + "signingCertificate": { + "type": "string", + "maxLength": 5500 + }, + "signature": { + "type": "string", + "maxLength": 800 + } + }, + "required": [ + "location", + "retrieveDateTime", + "signingCertificate", + "signature" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "retries": { + "type": "integer" + }, + "retryInterval": { + "type": "integer" + }, + "requestId": { + "type": "integer" + }, + "firmware": { + "$ref": "#/definitions/FirmwareType" + } + }, + "required": [ + "requestId", + "firmware" + ] +} \ No newline at end of file diff --git a/ocpp/v16/schemas/SignedUpdateFirmwareResponse.json b/ocpp/v16/schemas/SignedUpdateFirmwareResponse.json new file mode 100644 index 000000000..e18d6b255 --- /dev/null +++ b/ocpp/v16/schemas/SignedUpdateFirmwareResponse.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "urn:OCPP:Cp:1.6:2020:3:SignedUpdateFirmware.conf", + "definitions": { + "UpdateFirmwareStatusEnumType": { + "type": "string", + "additionalProperties": false, + "enum": [ + "Accepted", + "Rejected", + "AcceptedCanceled", + "InvalidCertificate", + "RevokedCertificate" + ] + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/UpdateFirmwareStatusEnumType" + } + }, + "required": [ + "status" + ] +} \ No newline at end of file