diff --git a/openapi/components/responses/ClientInfoResponse.yaml b/openapi/components/responses/ClientInfoResponse.yaml new file mode 100644 index 0000000..7c2961d --- /dev/null +++ b/openapi/components/responses/ClientInfoResponse.yaml @@ -0,0 +1,9 @@ +description: ClientInfo Response +content: + application/json: + schema: + allOf: + - $ref: ./BaseResponse.yaml + - properties: + data: + $ref: ../schemas/ClientInfo.yaml diff --git a/openapi/components/responses/ClientInfosResponse.yaml b/openapi/components/responses/ClientInfosResponse.yaml new file mode 100644 index 0000000..c5142a8 --- /dev/null +++ b/openapi/components/responses/ClientInfosResponse.yaml @@ -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 diff --git a/openapi/components/schemas/ClientInfo.yaml b/openapi/components/schemas/ClientInfo.yaml new file mode 100644 index 0000000..b0616d2 --- /dev/null +++ b/openapi/components/schemas/ClientInfo.yaml @@ -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 diff --git a/openapi/components/schemas/ConnectionStatus.yaml b/openapi/components/schemas/ConnectionStatus.yaml new file mode 100644 index 0000000..3937383 --- /dev/null +++ b/openapi/components/schemas/ConnectionStatus.yaml @@ -0,0 +1,7 @@ +summary: ConnectionStatus enum +type: string +enum: + - CONNECTED + - OFFLINE + - PLANNED + - SUSPENDED diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index f141f95..212654b 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.1.0 info: - version: 0.0.14 + version: 0.0.15 title: OCPI contact: @@ -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: diff --git a/openapi/paths/clientinfo_{country_code}_{party_id}.yaml b/openapi/paths/clientinfo_{country_code}_{party_id}.yaml new file mode 100644 index 0000000..d4fed4b --- /dev/null +++ b/openapi/paths/clientinfo_{country_code}_{party_id}.yaml @@ -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 diff --git a/openapi/paths/hubclientinfo.yaml b/openapi/paths/hubclientinfo.yaml new file mode 100644 index 0000000..e098504 --- /dev/null +++ b/openapi/paths/hubclientinfo.yaml @@ -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