openapi: 3.2.0 info: title: Openadr Alliance Vens API license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html version: '1.0' description: 'Operations tagged vens across 4 of this provider''s published API definitions: openadr-3-0-0-openapi.yaml, openadr-3-0-1-openapi.yaml, openadr-3-1-0-openapi.yaml, openadr-3-1-1-openapi.yaml. Each path carries the servers of the definition it was published in.' servers: - description: base path url: http://localhost:8081/openadr3 - description: base path url: http://localhost:8081/openadr3/3.0.1 - description: SwaggerHub API Auto Mocking url: https://virtserver.swaggerhub.com/OPENADR3_1/openADR3.1.0/1.0.0 tags: - name: vens paths: /vens: get: tags: - vens summary: search vens operationId: searchVens description: 'List all vens. Use skip and pagination query params to limit response size. ' security: - oAuth2ClientCredentials: - read_all - bearerAuth: [] parameters: - name: targetType in: query description: Indicates targeting type, e.g. GROUP required: false schema: type: string - name: targetValues in: query description: List of target values, e.g. group names required: false schema: type: array items: type: string - name: skip in: query description: number of records to skip for pagination. required: false style: form explode: true schema: minimum: 0 type: integer format: int32 - name: limit in: query description: maximum number of records to return. required: false style: form explode: true schema: maximum: 50 minimum: 0 type: integer format: int32 responses: '200': description: OK. content: application/json: schema: type: array items: $ref: '#/components/schemas/ven' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' post: tags: - vens summary: create ven operationId: createVen description: Create a new ven. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ven' responses: '201': description: Created. content: application/json: schema: $ref: '#/components/schemas/ven' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '409': description: Conflict. Implementation dependent response if ven with same venIdentifier already exists. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' servers: - description: base path url: http://localhost:8081/openadr3 /vens/{venID}: parameters: - name: venID in: path schema: $ref: '#/components/schemas/objectID' description: object ID of ven. required: true get: tags: - vens summary: search vens by ID operationId: searchVenByID description: Return the ven specified by venID specified in path. security: - oAuth2ClientCredentials: - read_all - bearerAuth: [] responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/ven' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' put: tags: - vens summary: update ven operationId: updateVen description: Update the ven specified by venID specified in path. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/ven' description: ven item to update. responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/ven' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '409': description: Conflict. Implementation dependent response if program with the same programName exists. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' delete: tags: - vens summary: delete ven operationId: deleteVen description: Delete the ven specified by venID specified in path. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/ven' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' servers: - description: base path url: http://localhost:8081/openadr3 /vens/{venID}/resources: parameters: - name: venID in: path schema: $ref: '#/components/schemas/objectID' description: Numeric ID of ven. required: true get: tags: - vens summary: search ven resources operationId: searchVenResources description: Return the ven resources specified by venID specified in path. security: - oAuth2ClientCredentials: - read_all - bearerAuth: [] parameters: - name: targetType in: query description: Indicates targeting type, e.g. GROUP required: false schema: type: string - name: targetValues in: query description: List of target values, e.g. group names required: false schema: type: array items: type: string - name: skip in: query description: number of records to skip for pagination. required: false style: form explode: true schema: minimum: 0 type: integer format: int32 - name: limit in: query description: maximum number of records to return. required: false style: form explode: true schema: maximum: 50 minimum: 0 type: integer format: int32 responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/resource' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' post: tags: - vens summary: create resource operationId: createResource description: Create a new resource. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/resource' responses: '201': description: Created. content: application/json: schema: $ref: '#/components/schemas/resource' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '409': description: Conflict. Implementation dependent response if resource with same resourceIdentifier already exists. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' servers: - description: base path url: http://localhost:8081/openadr3 /vens/{venID}/resources/{resourceID}: parameters: - name: venID in: path schema: $ref: '#/components/schemas/objectID' description: object ID of the associated ven. required: true - name: resourceID in: path schema: $ref: '#/components/schemas/objectID' description: object ID of the resource. required: true get: tags: - vens summary: search ven resources by ID operationId: searchVenResourceByID description: Return the ven resource specified by venID and resourceID specified in path. security: - oAuth2ClientCredentials: - read_all - bearerAuth: [] responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/resource' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' put: tags: - vens summary: update ven resource operationId: updateVenResource description: Update the ven resource specified by venID and resourceID specified in path. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/resource' description: resource item to update. responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/resource' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '409': description: Conflict. Implementation dependent response if program with the same programName exists. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' delete: tags: - vens summary: delete ven resource operationId: deleteVenResource description: Delete the ven resource specified by venID and resourceID specified in path. security: - oAuth2ClientCredentials: - write_vens - bearerAuth: [] responses: '200': description: OK. content: application/json: schema: $ref: '#/components/schemas/resource' '400': description: Bad Request. content: application/json: schema: $ref: '#/components/schemas/problem' '403': description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/problem' '500': description: Internal Server Error. content: application/json: schema: $ref: '#/components/schemas/problem' servers: - description: base path url: http://localhost:8081/openadr3 components: schemas: valuesMap: type: object description: 'Represents one or more values associated with a type. E.g. a type of PRICE contains a single float value. ' required: - type - values properties: type: type: string description: 'Enumerated or private string signifying the nature of values. E.G. "PRICE" indicates value is to be interpreted as a currency. ' example: PRICE values: type: array description: A list of data points. Most often a singular value such as a price. example: - 0.17 items: anyOf: - type: number - type: integer - type: string - type: boolean - $ref: '#/components/schemas/point' ven: type: object description: Ven represents a client with the ven role. required: - venName properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime' modificationDateTime: $ref: '#/components/schemas/dateTime' objectType: type: string description: Used as discriminator, e.g. notification.object. enum: - VEN venName: type: - string - 'null' description: User generated identifier, may be VEN identifier provisioned during program enrollment. example: VEN-999 default: null attributes: type: array description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap' targets: type: array description: A list of valuesMap objects describing target criteria. items: $ref: '#/components/schemas/valuesMap' resources: type: - array - 'null' description: A list of resource objects representing end-devices or systems. default: null items: $ref: '#/components/schemas/resource' dateTime: type: - string - 'null' description: datetime in ISO 8601 format example: 2023-06-15 09:30:00+00:00 default: null resource: type: object description: 'A resource is an energy device or system subject to control by a VEN. ' required: - resourceName properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime' modificationDateTime: $ref: '#/components/schemas/dateTime' objectType: type: string description: Used as discriminator, e.g. notification.object enum: - RESOURCE resourceName: type: - string - 'null' description: User generated identifier, resource may be configured with identifier out-of-band. example: RESOURCE-999 default: null venID: $ref: '#/components/schemas/objectID' attributes: type: array description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap' targets: type: array description: A list of valuesMap objects describing target criteria. items: $ref: '#/components/schemas/valuesMap' problem: type: object description: 'reusable error response. From https://opensource.zalando.com/problem/schema.yaml. ' properties: type: type: string format: uri description: 'An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). ' default: about:blank example: https://zalando.github.io/problem/constraint-violation title: type: string description: 'A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable. ' status: type: integer format: int32 description: 'The HTTP status code generated by the origin server for this occurrence of the problem. ' minimum: 100 example: 503 exclusiveMaximum: 600 detail: type: string description: 'A human readable explanation specific to this occurrence of the problem. ' example: Connection to database timed out instance: type: string format: uri description: 'An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ' objectID: type: string pattern: ^[a-zA-Z0-9_-]*$ minLength: 1 maxLength: 128 description: URL safe VTN assigned object ID. example: object-999 point: type: object description: A pair of floats typically used as a point on a 2 dimensional grid. required: - x - y properties: x: type: - number - 'null' format: float description: A value on an x axis. example: 1.0 default: null y: type: - number - 'null' format: float description: A value on a y axis. example: 2.0 default: null valuesMap_2: type: object description: 'Represents one or more values associated with a type. E.g. a type of PRICE contains a single float value. ' required: - type - values properties: type: type: string minLength: 1 maxLength: 128 description: 'Enumerated or private string signifying the nature of values. E.G. "PRICE" indicates value is to be interpreted as a currency. ' example: PRICE values: type: array description: A list of data points. Most often a singular value such as a price. example: - 0.17 items: anyOf: - type: number - type: integer - type: string - type: boolean - $ref: '#/components/schemas/point_2' ven_2: type: object description: Ven represents a client with the ven role. required: - venName properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime_2' modificationDateTime: $ref: '#/components/schemas/dateTime_2' objectType: type: string description: Used as discriminator. enum: - VEN venName: type: string description: 'User generated identifier, may be VEN identifier provisioned out-of-band. venName is expected to be unique within the scope of a VTN ' minLength: 1 maxLength: 128 example: VEN-999 attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_2' default: null targets: type: - array - 'null' description: A list of valuesMap objects describing target criteria. items: $ref: '#/components/schemas/valuesMap_2' default: null resources: type: - array - 'null' description: A list of resource objects representing end-devices or systems. items: $ref: '#/components/schemas/resource_2' default: null dateTime_2: type: string format: date-time description: datetime in ISO 8601 format example: 2023-06-15 09:30:00+00:00 resource_2: type: object description: 'A resource is an energy device or system subject to control by a VEN. ' required: - resourceName properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime_2' modificationDateTime: $ref: '#/components/schemas/dateTime_2' objectType: type: string description: Used as discriminator. enum: - RESOURCE resourceName: type: string description: 'User generated identifier, resource may be configured with identifier out-of-band. resourceName is expected to be unique within the scope of the associated VEN. ' minLength: 1 maxLength: 128 example: RESOURCE-999 venID: $ref: '#/components/schemas/objectID' attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_2' default: null targets: type: - array - 'null' description: A list of valuesMap objects describing target criteria. items: $ref: '#/components/schemas/valuesMap_2' default: null point_2: type: object description: A pair of floats typically used as a point on a 2 dimensional grid. required: - x - y properties: x: type: number format: float description: A value on an x axis. example: 1.0 y: type: number format: float description: A value on a y axis. example: 2.0 valuesMap_3: type: object description: 'Represents one or more values associated with a type. See enumerations in Definitions for defined string values, or use privately defined strings ' required: - type - values properties: type: type: string minLength: 1 maxLength: 128 description: 'Represents the nature of values. See enumerations in Definitions for defined string values, or use privately defined strings ' example: PRICE values: type: array description: A list of data points. Most often a singular value such as a price. example: - 0.17 items: anyOf: - type: number - type: integer - type: string - type: boolean - $ref: '#/components/schemas/point_3' venRequest: oneOf: - $ref: '#/components/schemas/VenVenRequest' - $ref: '#/components/schemas/BlVenRequest' target: type: string minLength: 1 maxLength: 128 description: User generated target string. example: group-1 objectTypes: type: string description: Types of objects addressable through API. example: EVENT enum: - PROGRAM - EVENT - REPORT - SUBSCRIPTION - VEN - RESOURCE objectMetadata: type: object description: metadata common to all addressable objects. Values provided by VTN on object creation. required: - id - createdDateTime - modificationDateTime - objectType properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime_3' modificationDateTime: $ref: '#/components/schemas/dateTime_3' objectType: $ref: '#/components/schemas/objectTypes' BlVenRequest: type: object description: Business Logic provided representation of ven. required: - objectType - clientID - venName properties: objectType: type: string description: Used as discriminator. enum: - BL_VEN_REQUEST clientID: $ref: '#/components/schemas/clientID' targets: type: - array - 'null' description: A list of targets. items: $ref: '#/components/schemas/target' default: null - venName: $ref: '#/components/schemas/venName' attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_3' default: null point_3: type: object description: A pair of floats typically used as a point on a 2 dimensional grid. required: - x - y properties: x: type: number format: float description: A value on an x axis. example: 1.0 y: type: number format: float description: A value on a y axis. example: 2.0 dateTime_3: type: string format: date-time description: datetime in RFC 3339 format example: 2023-06-15 09:30:00+00:00 VenVenRequest: type: object description: VEN provided representation of ven. required: - objectType - venName properties: objectType: type: string description: Used as discriminator. enum: - VEN_VEN_REQUEST venName: $ref: '#/components/schemas/venName' attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_3' default: null clientID: type: string description: 'ClientID as provisioned by Auhtentication Service and associated with client''s bearer token ' minLength: 1 maxLength: 128 example: 249rj49jiej venName: type: string description: 'User generated identifier, may be VEN identifier provisioned out-of-band. venName is expected to be unique within the scope of a VTN ' minLength: 1 maxLength: 128 example: VEN-999 ven_3: type: object description: Server provided representation of ven allOf: - $ref: '#/components/schemas/objectMetadata' - $ref: '#/components/schemas/BlVenRequest' problem_2: type: object description: 'reusable error response. From https://opensource.zalando.com/problem/schema.yaml. ' properties: type: type: string format: uri minLength: 2 maxLength: 8000 description: 'An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). ' default: about:blank example: https://zalando.github.io/problem/constraint-violation title: type: string description: 'A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable. ' status: type: integer format: int32 description: 'The HTTP status code generated by the origin server for this occurrence of the problem. ' minimum: 100 example: 503 exclusiveMaximum: 600 detail: type: string description: 'A human readable explanation specific to this occurrence of the problem. ' example: Connection to database timed out instance: type: string minLength: 3 maxLength: 8000 format: uri description: 'An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ' valuesMap_4: type: object description: 'Represents one or more values associated with a type. See enumerations in Definitions for defined string values, or use privately defined strings ' required: - type - values properties: type: type: string minLength: 1 maxLength: 128 description: 'Represents the nature of values. See enumerations in Definitions for defined string values, or use privately defined strings ' example: PRICE values: type: array description: A list of data points. Most often a singular value such as a price. example: - 0.17 items: anyOf: - type: number - type: integer - type: string - type: boolean - $ref: '#/components/schemas/point_4' objectMetadata_2: type: object description: metadata common to all addressable objects. Values provided by VTN on object creation. required: - id - createdDateTime - modificationDateTime - objectType properties: id: $ref: '#/components/schemas/objectID' createdDateTime: $ref: '#/components/schemas/dateTime_4' modificationDateTime: $ref: '#/components/schemas/dateTime_4' objectType: $ref: '#/components/schemas/objectTypes' BlVenRequest_2: type: object description: Business Logic provided representation of ven. required: - objectType - clientID - venName properties: objectType: type: string description: Used as discriminator. enum: - BL_VEN_REQUEST clientID: $ref: '#/components/schemas/clientID' targets: type: - array - 'null' description: A list of targets. items: $ref: '#/components/schemas/target' venName: $ref: '#/components/schemas/venName' attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_4' default: null point_4: type: object description: A pair of floats typically used as a point on a 2 dimensional grid. required: - x - y properties: x: type: number format: float description: A value on an x axis. example: 1.0 y: type: number format: float description: A value on a y axis. example: 2.0 dateTime_4: type: string format: date-time description: datetime in RFC 3339 format example: 2023-06-15 09:30:00+00:00 VenVenRequest_2: type: object description: VEN provided representation of ven. required: - objectType - venName properties: objectType: type: string description: Used as discriminator. enum: - VEN_VEN_REQUEST venName: $ref: '#/components/schemas/venName' attributes: type: - array - 'null' description: A list of valuesMap objects describing attributes. items: $ref: '#/components/schemas/valuesMap_4' default: null ven_4: type: object description: Server provided representation of ven allOf: - $ref: '#/components/schemas/objectMetadata_2' - $ref: '#/components/schemas/BlVenRequest_2' problem_3: type: object description: 'reusable error response. From https://opensource.zalando.com/problem/schema.yaml. ' properties: type: type: string format: uri minLength: 2 maxLength: 8000 description: 'An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). ' default: about:blank example: https://zalando.github.io/problem/constraint-violation title: type: string description: 'A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable. ' status: type: integer format: int32 description: 'The HTTP status code generated by the origin server for this occurrence of the problem. ' minimum: 100 example: 503 exclusiveMaximum: 600 detail: type: string description: 'A human readable explanation specific to this occurrence of the problem. ' example: Connection to database timed out instance: type: string minLength: 3 maxLength: 8000 format: uri description: 'An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ' responses: internalServerError: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/problem_2' unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/problem_2' forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/problem_2' conflict: description: Conflict. Could for example be a violation of a foreign key constraint or of a unique constraint on a name or id. content: application/json: schema: $ref: '#/components/schemas/problem_2' notFound: description: The specified resource was not found content: application/json: schema: $ref: '#/components/schemas/problem_2' badRequest: description: The request is malformed or invalid content: application/json: schema: $ref: '#/components/schemas/problem_2' internalServerError_2: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/problem_3' unauthorized_2: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/problem_3' forbidden_2: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/problem_3' conflict_2: description: 'Conflict. Could for example be a violation of a foreign key constraint or of a unique constraint on a name or id. ' content: application/json: schema: $ref: '#/components/schemas/problem_3' notFound_2: description: The specified resource was not found content: application/json: schema: $ref: '#/components/schemas/problem_3' badRequest_2: description: The request is malformed or invalid content: application/json: schema: $ref: '#/components/schemas/problem_3' securitySchemes: oAuth2ClientCredentials: type: oauth2 description: Client credential flow. flows: clientCredentials: tokenUrl: auth/token scopes: read_all: VENs and BL can read all resources write_programs: Only BL can write to programs write_events: Only BL can write to events write_reports: only VENs can write to reports write_subscriptions: VENs and BL can write to subscriptions write_vens: VENS and BL can write to vens and resources bearerAuth: type: http scheme: bearer bearerFormat: JWT x-refined-from: - openadr-3-0-0-openapi.yaml - openadr-3-0-1-openapi.yaml - openadr-3-1-0-openapi.yaml - openadr-3-1-1-openapi.yaml