Jump to: navigation, search

EfficientMetering/APIProposalv1

< EfficientMetering
Revision as of 22:55, 18 June 2012 by Doug (talk) (more detail about DB API calls used to build return data sets)

Notes:

  • All results are provided JSON or XML format.
  • [] denotes optional information
  • date_time is assumed to use ISO format and to use UTC
  • [start_time and end_time] are optional date_times for most of the request. It has previously been agreed that the range is exclusive for start and inclusive for end.
Verb URL Parameters Expected result
GET v1 - Returns detailed information about this specific version of the API.
GET v1/EXTENSIONS - Returns list of all available extensions
GET v1/EXTENSIONS/<ALIAS> - Gets details about a specific extension. Extensions enable the introduction of new features in the API without requiring a version change and they allow the introduction of vendor-specific functionality
GET v1/SOURCES [start_time and end_time] Returns list of sources which are known
GET v1/[SOURCES/<SOURCE>/]LIST - Returns list of information topic the server can provide
GET v1/[SOURCES/<SOURCE>/]LIST/COMPONENTS - Returns list of components which provide metering data
GET v1/[SOURCES/<SOURCE>/]LIST/<COMPONENT>/METERS - Returns list of meters which are provided for a given component
GET v1/[SOURCES/<SOURCE>/]LIST/METERS - Returns list of meters type which are known
GET v1/[SOURCES/<SOURCE>/]LIST/RESOURCES [start_time and end_time] Returns list of resource_ID type which are known along with meta data info for the last occurrence of this ressource
GET v1/[SOURCES/<SOURCE>/]USERS [start_time and end_time] Returns list of USERS_ID which are known
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID> [start_time and end_time] Returns list of raw events for given user
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/<METER> [start_time and end_time] Returns list of raw events for given user and a given meter
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/<METER>/VOLUME [start_time and end_time] Return sum of meter_volume for the given user and meter
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/<METER>/DURATION [start_time and end_time] Return sum of meter_duration for the given use and meter
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/RESOURCES [start_time and end_time] Returns list of resources for a given user along with meta data info for the last occurrence of this ressource
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/RESOURCES/<RESOURCE_ID>/ [start_time and end_time] Returns list of events for given user and a given resource
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/RESOURCES/<RESOURCE_ID>/<METER> [start_time and end_time] Returns list of events for given user, resource and meter
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/RESOURCES/<RESOURCE_ID>/<METER>/VOLUME [start_time and end_time] Return sum of meter_volume for the given user, resource and meter
GET v1/[SOURCES/<SOURCE>/]USERS/<USER_ID>/RESOURCES/<RESOURCE_ID>/<METER>/DURATION [start_time and end_time] Return sum of meter_duration for the given user, resource and meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS [start_time and end_time] Returns list of PROJECT_ID which are known
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID> [start_time and end_time] Returns list of raw events for given project
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/<METER> [start_time and end_time] Returns list of raw events for given project and a given meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/<METER>/VOLUME [start_time and end_time] Return sum of meter_volume for the given project and meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/<METER>/DURATION [start_time and end_time] Return sum of meter_duration for the given project and meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/RESOURCES [start_time and end_time] Returns list of resources for a given project along with meta data info for the last occurrence of this ressource
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/RESOURCES/<RESOURCE_ID>/ [start_time and end_time] Returns list of events for given project and a given resource
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/RESOURCES/<RESOURCE_ID>/<METER> [start_time and end_time] Returns list of events for given project, resource and meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/RESOURCES/<RESOURCE_ID>/<METER>/VOLUME [start_time and end_time] Return sum of meter_volume for the project, resource and meter
GET v1/[SOURCES/<SOURCE>/]PROJECTS/<PROJECT_ID>/RESOURCES/<RESOURCE_ID>/<METER>/DURATION [start_time and end_time] Return sum of meter_duration for the project, resource and meter