Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HubClientInfo module Interfaces #24

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions openapi/components/responses/ClientInfoResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: ClientInfo Response
content:
application/json:
schema:
allOf:
- $ref: ./BaseResponse.yaml
- properties:
data:
$ref: ../schemas/ClientInfo.yaml
19 changes: 19 additions & 0 deletions openapi/components/responses/ClientInfosResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: List of ClientInfo objects

headers:
Link:
$ref: ../headers/Link.yaml
X-Total-Count:
$ref: ../headers/X-Total-Count.yaml
X-Limit:
$ref: ../headers/X-Limit.yaml
content:
application/json:
schema:
allOf:
- $ref: ./BaseResponse.yaml
- properties:
data:
type: array
items:
$ref: ../schemas/ClientInfo.yaml
18 changes: 18 additions & 0 deletions openapi/components/schemas/ClientInfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type: object
required:
- party_id
- country_code
- role
- status
- last_updated
properties:
party_id:
$ref: ./PartyID.yaml
country_code:
$ref: ./CountryCode.yaml
role:
$ref: ./Role.yaml
status:
$ref: ./ConnectionStatus.yaml
last_updated:
$ref: ./DateTime.yaml
7 changes: 7 additions & 0 deletions openapi/components/schemas/ConnectionStatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary: ConnectionStatus enum
type: string
enum:
- CONNECTED
- OFFLINE
- PLANNED
- SUSPENDED
6 changes: 5 additions & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.1.0
info:
version: 0.0.14
version: 0.0.15
title: OCPI

contact:
Expand Down Expand Up @@ -80,6 +80,10 @@ paths:
$ref: paths/cdrs_{cdr_id}.yaml
/chargingprofiles/{session_id}:
$ref: paths/chargingprofiles_{session_id}.yaml
/clientinfo/{country_code}/{party_id}:
$ref: paths/clientinfo_{country_code}_{party_id}.yaml
/hubclientinfo:
$ref: paths/hubclientinfo.yaml

components:
securitySchemes:
Expand Down
54 changes: 54 additions & 0 deletions openapi/paths/clientinfo_{country_code}_{party_id}.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
get:
tags:
- HubClientInfo
summary: "Receiver: {clientinfo_endpoint_url}/{country_code}/{party_id}"
description: |
Retrieve a ClientInfo object as it is stored in the connected clients system.
operationId: getClientInfo
security:
- tokenAuth: []
parameters:
- $ref: ../components/parameters/countryCode.yaml
- $ref: ../components/parameters/partyId.yaml
responses:
"200":
description: OK
$ref: ../components/responses/ClientInfoResponse.yaml
"401":
description: Unauthorized
$ref: ../components/responses/Unauthorized.yaml
"404":
description: Not Found
$ref: ../components/responses/NotFound.yaml

put:
tags:
- HubClientInfo
summary: "Receiver: {clientinfo_endpoint_url}/{country_code}/{party_id}"
description: |
New or updated ClientInfo objects are pushed from the Hub to a connected client.
operationId: putClientInfo
security:
- tokenAuth: []
parameters:
- $ref: ../components/parameters/countryCode.yaml
- $ref: ../components/parameters/partyId.yaml
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/ClientInfo.yaml

responses:
"200":
description: Updated
$ref: ../components/responses/ClientInfoResponse.yaml
"201":
description: Created
$ref: ../components/responses/ClientInfoResponse.yaml
"400":
description: Bad Request
$ref: ../components/responses/BadRequest.yaml
"401":
description: Unauthorized
$ref: ../components/responses/Unauthorized.yaml
22 changes: 22 additions & 0 deletions openapi/paths/hubclientinfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
get:
tags:
- HubClientInfo
summary: "Sender: {locations_endpoint_url}"
description: |
Get the list of known ClientInfo objects, last updated between the {date_from} and {date_to} paginated)
operationId: getHubClientInfos
security:
- tokenAuth: []

parameters:
- $ref: ../components/parameters/collectionDateFrom.yaml
- $ref: ../components/parameters/collectionDateTo.yaml
- $ref: ../components/parameters/collectionOffset.yaml
- $ref: ../components/parameters/collectionLimit.yaml
responses:
"200":
$ref: ../components/responses/ClientInfosResponse.yaml
"400":
$ref: ../components/responses/BadRequest.yaml
"401":
$ref: ../components/responses/Unauthorized.yaml
Loading