Skip to content

Commit

Permalink
Merge pull request #23 from plugoinc/feat/put_{chargingprofiles_endpo…
Browse files Browse the repository at this point in the history
…int_url}{session_id}

ChargingProfiles: PUT {chargingprofiles_endpoint_url}{session_id}
  • Loading branch information
ThaddeusJiang authored Jan 9, 2024
2 parents cdd3678 + 7f0f0ad commit c8e300b
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 2 deletions.
9 changes: 9 additions & 0 deletions openapi/components/responses/SetChargingProfileResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: SetChargingProfileResponse
content:
application/json:
schema:
allOf:
- $ref: ./BaseResponse.yaml
- properties:
data:
$ref: ../schemas/ChargingProfileResponse.yaml
16 changes: 16 additions & 0 deletions openapi/components/schemas/ChargingProfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: object
required:
- charging_rate_unit
properties:
start_date_time:
$ref: ./DateTime.yaml
duration:
type: integer
charging_rate_unit:
$ref: ./ChargingRateUnit.yaml
min_charging_rate:
$ref: ./number.yaml
charging_profile_period:
type: array
items:
$ref: ./ChargingProfilePeriod.yaml
9 changes: 9 additions & 0 deletions openapi/components/schemas/ChargingProfilePeriod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
required:
- start_period
- limit
properties:
start_period:
type: integer
limit:
$ref: ./number.yaml
10 changes: 10 additions & 0 deletions openapi/components/schemas/ChargingProfileResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
required:
- result
- timeout
properties:
result:
$ref: ./ChargingProfileResponseType.yaml
example: ACCEPTED
timeout:
type: integer
7 changes: 7 additions & 0 deletions openapi/components/schemas/ChargingProfileResponseType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: string
enum:
- ACCEPTED
- NOT_SUPPORTED
- REJECTED
- TOO_OFTEN
- UNKNOWN_SESSION
4 changes: 4 additions & 0 deletions openapi/components/schemas/ChargingRateUnit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type: string
enum:
- W
- A
2 changes: 1 addition & 1 deletion openapi/components/schemas/CommandResponse.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type: object
required:
- result
- timeout
type: object
properties:
result:
type: string
Expand Down
9 changes: 9 additions & 0 deletions openapi/components/schemas/SetChargingProfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
required:
- charging_profile
- response_url
properties:
charging_profile:
$ref: ./ChargingProfile.yaml
response_url:
$ref: ./URL.yaml
4 changes: 3 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.13
version: 0.0.14
title: OCPI

contact:
Expand Down Expand Up @@ -78,6 +78,8 @@ paths:
$ref: paths/cdrs.yaml
/cdrs/{cdr_id}:
$ref: paths/cdrs_{cdr_id}.yaml
/chargingprofiles/{session_id}:
$ref: paths/chargingprofiles_{session_id}.yaml

components:
securitySchemes:
Expand Down
28 changes: 28 additions & 0 deletions openapi/paths/chargingprofiles_{session_id}.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
put:
tags:
- ChargingProfiles
summary: "{chargingprofiles_endpoint_url}{session_id}"
description: |
Creates a new ChargingProfile on a session, or replaces an existing ChargingProfile on the EVSE.
operationId: updateChargingProfile
security:
- tokenAuth: []
parameters:
- $ref: ../components/parameters/sessionId.yaml
requestBody:
description: SetChargingProfile
required: true
content:
application/json:
schema:
$ref: ../components/schemas/SetChargingProfile.yaml
responses:
"200":
description: OK
$ref: ../components/responses/SetChargingProfileResponse.yaml
"401":
description: Unauthorized
$ref: ../components/responses/Unauthorized.yaml
"404":
description: Not Found
$ref: ../components/responses/NotFound.yaml

0 comments on commit c8e300b

Please sign in to comment.