-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgreen-button-openapi.json
More file actions
388 lines (388 loc) · 20.4 KB
/
green-button-openapi.json
File metadata and controls
388 lines (388 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
{
"openapi": "3.0.0",
"info": {
"title": "Green Button API Documentation",
"description": "Green Button API - ESPI 4.0",
"version": "1.0.0",
"contact": {
"name": "Green Button Alliance",
"url": "https://www.greenbuttonalliance.org"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"servers": [{
"url": "https://sandbox.greenbuttonalliance.org:8443/DataCustodian",
"description": "GBA Green Button Sandbox"
}],
"components": {
"schemas": {
"ApplicationInformation": {
"type": "object",
"description": "Contains information about a Third Party Application requesting access to DataCustodian services",
"xml": {"name": "ApplicationInformation", "namespace": "http://naesb.org/espi"},
"properties": {
"dataCustodianId": {"type": "string", "description": "Identifier for the Data Custodian"},
"dataCustodianApplicationStatus": {"type": "integer", "description": "Current status of the application (provided by Data Custodian)"},
"thirdPartyApplicationDescription": {"type": "string", "description": "Description of the Third Party Application"},
"thirdPartyApplicationStatus": {"type": "integer", "description": "Current status of the Third Party Application"},
"thirdPartyApplicationType": {"type": "integer", "description": "Type of application (1=Web, 2=Desktop, 3=Mobile, 4=Device)"},
"thirdPartyApplicationUse": {"type": "integer", "description": "Expected use of the application"},
"client_name": {"type": "string", "description": "Name of the application (OAuth client_name)"},
"client_id": {"type": "string", "description": "Identifier for the Third Party (OAuth client_id)"},
"client_secret": {"type": "string", "description": "Secret for the client (OAuth client_secret)"},
"redirect_uri": {"type": "array", "items": {"type": "string"}, "description": "OAuth redirect URIs"},
"scope": {"type": "array", "items": {"type": "string"}, "description": "OAuth scopes"},
"grant_types": {"type": "array", "items": {"type": "string"}, "description": "Supported OAuth grant types"}
}
},
"Authorization": {
"type": "object",
"description": "Represents a permission granted by an owner for access to a resource",
"xml": {"name": "Authorization", "namespace": "http://naesb.org/espi"},
"properties": {
"status": {"type": "integer", "description": "Status of the authorization (0=Revoked, 1=Active, 2=Denied)"},
"expires_at": {"type": "integer", "format": "int64", "description": "Expiration period for the access token (Unix timestamp)"},
"grant_type": {"type": "string", "description": "Type of grant being negotiated"},
"scope": {"type": "string", "description": "Negotiated scope of the authorization"},
"token_type": {"type": "string", "description": "Type of token (Bearer)"},
"resourceURI": {"type": "string", "format": "uri", "description": "URI to access the authorized resource"},
"authorizationURI": {"type": "string", "format": "uri", "description": "URI to update or delete this authorization"},
"customerResourceURI": {"type": "string", "format": "uri", "description": "URI to access PII data authorized for this customer"}
}
},
"UsagePoint": {
"type": "object",
"description": "Logical point on a network at which consumption or production is measured or estimated",
"xml": {"name": "UsagePoint", "namespace": "http://naesb.org/espi"},
"properties": {
"roleFlags": {"type": "string", "description": "Specifies roles assigned to this usage point"},
"ServiceCategory": {"type": "integer", "description": "Category of service (0=electricity, 1=gas, 2=water, etc.)"},
"status": {"type": "integer", "description": "Current status (0=off, 1=on)"},
"isSdp": {"type": "boolean", "description": "Whether this is a service delivery point"},
"isVirtual": {"type": "boolean", "description": "Whether this is a virtual (logical) usage point"},
"connectionState": {"type": "string", "description": "Connection state relative to network"}
}
},
"AtomLink": {
"type": "object",
"description": "Atom link element (RFC 4287)",
"xml": {"name": "link", "namespace": "http://www.w3.org/2005/Atom"},
"properties": {
"href": {"type": "string", "format": "uri", "description": "Link URI"},
"rel": {"type": "string", "description": "Link relationship type (e.g., 'self', 'up')"},
"type": {"type": "string", "description": "Media type (e.g., 'application/atom+xml')"}
}
},
"AtomContent": {
"type": "object",
"description": "Atom content element containing ESPI resource (RFC 4287)",
"xml": {"name": "content", "namespace": "http://www.w3.org/2005/Atom"},
"properties": {
"type": {"type": "string", "description": "Content media type (typically 'application/xml')"}
}
},
"AtomEntry": {
"type": "object",
"description": "Atom feed entry (RFC 4287) containing ESPI resource",
"xml": {"name": "entry", "namespace": "http://www.w3.org/2005/Atom"},
"properties": {
"id": {"type": "string", "format": "uri", "description": "Unique entry identifier"},
"title": {"type": "string", "description": "Entry title"},
"published": {"type": "string", "format": "date-time", "description": "ISO 8601 publication timestamp"},
"updated": {"type": "string", "format": "date-time", "description": "ISO 8601 last update timestamp"},
"link": {"type": "array", "items": {"$ref": "#/components/schemas/AtomLink"}, "description": "Entry links (minimum 2 required per Atom spec)"},
"content": {"$ref": "#/components/schemas/AtomContent"}
}
},
"AtomFeed": {
"type": "object",
"description": "Atom Feed (RFC 4287) containing ESPI resources",
"xml": {"name": "feed", "namespace": "http://www.w3.org/2005/Atom"},
"properties": {
"id": {"type": "string", "format": "uri", "description": "Feed identifier"},
"title": {"type": "string", "description": "Feed title"},
"updated": {"type": "string", "format": "date-time", "description": "ISO 8601 timestamp of last feed update"},
"link": {"type": "array", "items": {"$ref": "#/components/schemas/AtomLink"}, "description": "Feed links (minimum 1 required per Atom spec)"},
"entry": {"type": "array", "items": {"$ref": "#/components/schemas/AtomEntry"}, "description": "Feed entries containing ESPI resources"}
}
}
},
"securitySchemes": {
"oauth2": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://sandbox.greenbuttonalliance.org:8443/oauth/authorize",
"tokenUrl": "https://sandbox.greenbuttonalliance.org:8443/oauth/token",
"scopes": {}
},
"clientCredentials": {
"tokenUrl": "https://sandbox.greenbuttonalliance.org:8443/oauth/token",
"scopes": {}
}
}
}
}
},
"security": [{"oauth2": []}],
"tags": [
{"name": "ApplicationInformation", "description": "Application Information endpoints"},
{"name": "Authorization", "description": "Authorization endpoints"},
{"name": "Batch", "description": "Batch data transfer endpoints"},
{"name": "UsagePoint", "description": "Usage Point endpoints"}
],
"paths": {
"/espi/1_1/resource/ApplicationInformation": {
"get": {
"tags": ["ApplicationInformation"],
"summary": "Retrieve all Application Information [FB_33]",
"operationId": "findApplicationInformations",
"parameters": [
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/ApplicationInformation/{applicationInformationId}": {
"get": {
"tags": ["ApplicationInformation"],
"summary": "Retrieve Application Information by Id [FB_3]",
"operationId": "getApplicationInformation",
"parameters": [
{"name": "applicationInformationId", "in": "path", "required": true, "description": "Unique identifier for the ApplicationInformation resource", "schema": {"type": "string"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/ApplicationInformation"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/ApplicationInformation"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/Authorization": {
"get": {
"tags": ["Authorization"],
"summary": "Find all Authorizations [FB_3]",
"operationId": "findAuthorizations",
"parameters": [
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/Authorization/{authorizationId}": {
"get": {
"tags": ["Authorization"],
"summary": "Retrieve Authorization by Id [FB_3]",
"operationId": "getAuthorization",
"parameters": [
{"name": "authorizationId", "in": "path", "required": true, "description": "Unique identifier for the Authorization resource", "schema": {"type": "string"}},
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/Authorization"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/Authorization"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/Batch/Bulk/{bulkId}": {
"get": {
"tags": ["Batch"],
"summary": "Request Bulk transfer [FB_35]",
"operationId": "downloadBulkData",
"parameters": [
{"name": "bulkId", "in": "path", "required": true, "description": "Unique identifier for the Bulk transfer", "schema": {"type": "string"}},
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/UsagePoint": {
"get": {
"tags": ["UsagePoint"],
"summary": "Retrieve all Usage Points [FB_33]",
"operationId": "findUsagePoints",
"parameters": [
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/AtomFeed"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
},
"/espi/1_1/resource/UsagePoint/{usagePointId}": {
"get": {
"tags": ["UsagePoint"],
"summary": "Retrieve Usage Point by Id [FB_32]",
"operationId": "getUsagePoint",
"parameters": [
{"name": "usagePointId", "in": "path", "required": true, "description": "Unique identifier for the UsagePoint resource", "schema": {"type": "string"}},
{"name": "published-max", "in": "query", "description": "Maximum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "published-min", "in": "query", "description": "Minimum publication date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-max", "in": "query", "description": "Maximum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "updated-min", "in": "query", "description": "Minimum update date (RFC 3339 instant)", "schema": {"type": "string", "format": "date"}},
{"name": "max-results", "in": "query", "description": "Maximum number of results to return", "schema": {"type": "integer", "format": "int64"}},
{"name": "start-index", "in": "query", "description": "Index of first result (1-indexed)", "schema": {"type": "integer", "format": "int64"}},
{"name": "depth", "in": "query", "description": "Response depth control", "schema": {"type": "integer", "format": "int64"}}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/UsagePoint"}
}
}
},
"202": {
"description": "Accepted",
"content": {
"application/atom+xml": {
"schema": {"$ref": "#/components/schemas/UsagePoint"}
}
}
},
"400": {"description": "Bad Request"},
"403": {"description": "Forbidden"}
}
}
}
}
}