Skip to content

Commit

Permalink
Merge pull request #24 from plugoinc/feat/hubclientinfo
Browse files Browse the repository at this point in the history
HubClientInfo module Interfaces
  • Loading branch information
ThaddeusJiang authored Feb 19, 2024
2 parents c8e300b + 90ea706 commit 5e16b55
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 1 deletion.
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

0 comments on commit 5e16b55

Please sign in to comment.