Package: greenbyteapi
Getting startedHow to BuildYou must have Python2 >=2.7.9or Python3 >=3.4installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc.
These dependencies are defined in therequirements.txtfile that comes with the SDK.
To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps athttps://pip.pypa.io/en/stable/installing/.Python and PIP executables should be defined in your PATH. Open command prompt and typepip --version.
This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.Using command line, navigate to the directory containing the generated files (includingrequirements.txt) for the SDK.Run the commandpip install -r requirements.txt. This should install all the required dependencies.How to UseThe following section explains how to use the Greenbyteapi SDK package in a new project.1. Open Project in an IDEOpen up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.Click onOpenin PyCharm to browse to your generated SDK directory and then clickOK.The project files will be displayed in the side bar as follows:2. Add a new Test ProjectCreate a new directory by right clicking on the solution name as shown below:Name the directory as "test"Add a python file to this project with the name "testsdk"Name it "testsdk"In your python file you will be required to import the generated python library using the following code linesfromgreenbyteapi.greenbyteapi_clientimportGreenbyteapiClientAfter this you can write code to instantiate an API client object, get a controller object and  make API calls. Sample code is given in the subsequent sections.3. Run the Test ProjectTo run the file within your test project, right click on your Python file inside your Test project and click onRunHow to TestYou can test the generated SDK and the server with automatically generated test
cases. unittest is used as the testing framework and nose is used as the test
runner. You can run the tests as follows:From terminal/cmd navigate to the root directory of the SDK.Invokepip install -r test-requirements.txtInvokenosetestsInitializationAuthenticationIn order to setup authentication and initialization of the API client, you need the following information.ParameterDescriptionx_api_keyTODO: add a descriptionAPI client can be initialized as following.# Configuration parameters and credentialsx_api_key='x_api_key'client=GreenbyteapiClient(x_api_key)Class ReferenceList of ControllersDataControllerStatusesControllerConfigurationDataControllerAssetsControllerAlertsControllerPlanControllerPredictControllerDataControllerGet controller instanceAn instance of theDataControllerclass can be accessed from the API Client.data_controller=client.dataget_data_signalsGets authorized data signals for one or more devices.🔐 This endpoint requires theDataendpoint permission.This request can also be made using the POST method,
with a request todatasignals.jsonand
a JSON request body instead of query parameters.defget_data_signals(self,device_ids)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhat devices to get data signals for.Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)result=data_controller.get_data_signals(device_ids)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_dataGets data for multiple devices and data signals in the given
resolution. The timestamps are in the time zone configured in the Greenbyte Platform.
Use the useUtc flag to get timestamps in UTC for all resolutions other than daily, weekly, monthly and yearly.🔐 This endpoint requires theDataendpoint permission.This request can also be made using the POST method,
with a request todata.jsonand
a JSON request body instead of query parameters.defget_data(self,device_ids,data_signal_ids,timestamp_start,timestamp_end,use_utc=False,resolution='10minute',aggregate='device',aggregate_level=0,calculation=None)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get data for.dataSignalIdsRequiredCollectionWhich data signals to get data for.timestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. UTC timestamps are available for all resolutions other than daily, weekly, monthly and yearly. |
| resolution |OptionalDefaultValue| The desired data resolution. |
| aggregate |OptionalDefaultValue| How the data should be aggregated with regards to device(s) or site(s). |
| aggregateLevel |OptionalDefaultValue| When AggregateModesiteLevelis used this parameter controls down to which level in the hierarchy to aggregate. |
| calculation |Optional| The calculation used when aggregating data, both over time and across devices. The default is the data signal default. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)data_signal_ids_value="[1,5]"data_signal_ids=json.loads(data_signal_ids_value)timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zuse_utc=Falseresolution=ResolutionEnum.ENUM_10MINUTEaggregate=AggregateModeEnum.DEVICEaggregate_level=0calculation=CalculationModeEnum.SUMresult=data_controller.get_data(device_ids,data_signal_ids,timestamp_start,timestamp_end,use_utc,resolution,aggregate,aggregate_level,calculation)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_real_time_dataGets the most recent data point for each
specified device and data signal. The timestamps are in UTC.🔐 This endpoint requires theDataendpoint permission.This request can also be made using the POST method,
with a request torealtimedata.jsonand
a JSON request body instead of query parameters.defget_real_time_data(self,device_ids,data_signal_ids,aggregate='device',aggregate_level=0,calculation=None)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get data for.dataSignalIdsRequiredCollectionWhich data signals to get data for.aggregateOptionalDefaultValueHow the data should be aggregated with regards to device(s) or site(s).aggregateLevelOptionalDefaultValueWhen AggregateModesiteLevelis used this parameter controls down to which level in the hierarchy to aggregate.calculationOptionalThe calculation used when aggregating data, both over time and across devices. The default is the data signal default.Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)data_signal_ids_value="[1,5]"data_signal_ids=json.loads(data_signal_ids_value)aggregate=AggregateModeEnum.DEVICEaggregate_level=0calculation=CalculationModeRealTimeEnum.SUMresult=data_controller.get_real_time_data(device_ids,data_signal_ids,aggregate,aggregate_level,calculation)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_data_per_categoryGets signal data aggregated per availability contract category.🔐 This endpoint requires theDataandStatusesendpoint permissions.This request can also be made using the POST method,
with a request todatapercategory.jsonand
a JSON request body instead of query parameters.defget_data_per_category(self,device_ids,data_signal_id,timestamp_start,timestamp_end,aggregate='device',aggregate_level=0,category=None,contract_type='service')ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get data for.dataSignalIdRequiredWhich signal to get data for; only Lost Production signals are supported at the moment.timestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| aggregate |OptionalDefaultValue| How the data should be aggregated with regards to device(s) or site(s). |
| aggregateLevel |OptionalDefaultValue| When AggregateModesiteLevelis used this parameter controls down to which level in the hierarchy to aggregate. |
| category |OptionalCollection| Which status categories to include. By default all categories are included. |
| contractType |OptionalDefaultValue| Which contract type to use if using multiple availability contracts. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)data_signal_id=248timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zaggregate=AggregateModeEnum.DEVICEaggregate_level=0category=[StatusCategoryEnum.STOP]contract_type=ContractTypeEnum.SERVICEresult=data_controller.get_data_per_category(device_ids,data_signal_id,timestamp_start,timestamp_end,aggregate,aggregate_level,category,contract_type)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_high_res_dataGets high resolution data for a data signal for each
specified device. The timestamps are in UTC.The endpoint returns up to an hour's worth of high resolution data for the provided device IDs and data signal ID.
It is possible to request data for up to 10 separate devices and one data signal ID.
Timestamp start and end are optional. The default time span returned is the latest hour.
If supplied, timestamp start must be within the past 12 hours.
Timestamp end will by default be an hour after timestamp start but can be set for shorter intervals.There is no high resolution data available for data signals that are calculated.
The data for those signals can be retrieved through the data endpoint.🔐 This endpoint requires theHighResolutionendpoint permission.defget_high_res_data(self,device_ids,data_signal_id,timestamp_start=None,timestamp_end=None)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get data for.dataSignalIdRequiredWhich data signal to get data for.timestampStartOptionalThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Optional| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)data_signal_id=1timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zresult=data_controller.get_high_res_data(device_ids,data_signal_id,timestamp_start,timestamp_end)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersStatusesControllerGet controller instanceAn instance of theStatusesControllerclass can be accessed from the API Client.statuses_controller=client.statusesget_statusesGets statuses for multiple devices during the given time period.
The timestamps are in the time zone configured in the Greenbyte Platform.
Use the useUtc flag to get timestamps in UTC.🔐 This endpoint requires theStatusesendpoint permission.This request can also be made using the POST method,
with a request tostatus.jsonand
a JSON request body instead of query parameters.defget_statuses(self,device_ids,timestamp_start,timestamp_end,category=None,lost_production_signal_id=None,fields=None,sort_by=None,sort_asc=False,page_size=50,page=1,use_utc=False,contract_type='service')ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get statuses for.timestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| category |OptionalCollection| Which status categories to get statuses for. |
| lostProductionSignalId |Optional| Which data signal to use for calculating lost production. Defaults to the configured default lost production signal. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theStatusItemschema (See Response Type). By default all fields are included. |
| sortBy |OptionalCollection| Which fields to sort the response items by. |
| sortAsc |OptionalDefaultValue| Whether to sort the items in ascending order. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |
| contractType |OptionalDefaultValue| Which contract type to use if using multiple availability contracts. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zcategory=[StatusCategoryEnum.STOP]lost_production_signal_id=432fields_value='["deviceId","message","lostProduction"]'fields=json.loads(fields_value)sort_by=['sortBy']sort_asc=Falsepage_size=50page=1use_utc=Falsecontract_type=ContractTypeEnum.SERVICEresult=statuses_controller.get_statuses(device_ids,timestamp_start,timestamp_end,category,lost_production_signal_id,fields,sort_by,sort_asc,page_size,page,use_utc,contract_type)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_active_statusesGets active statuses for multiple devices.
The timestamps are in the time zone configured in the Greenbyte Platform.
Use the useUtc flag to get timestamps in UTC.🔐 This endpoint requires theStatusesendpoint permission.This request can also be made using the POST method,
with a request toactivestatus.jsonand
a JSON request body instead of query parameters.defget_active_statuses(self,device_ids,category=None,lost_production_signal_id=None,fields=None,sort_by=None,sort_asc=False,page_size=50,page=1,use_utc=False,contract_type='service')ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhich devices to get statuses for.categoryOptionalCollectionWhich status categories to get statuses for.lostProductionSignalIdOptionalWhich data signal to use for calculating lost production. Defaults to the configured default lost production signal.fieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theStatusItemschema (See Response Type). By default all fields are included.sortByOptionalCollectionWhich fields to sort the response items by.sortAscOptionalDefaultValueWhether to sort the items in ascending order.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.contractTypeOptionalDefaultValueWhich contract type to use if using multiple availability contracts.Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)category=[StatusCategoryEnum.STOP]lost_production_signal_id=432fields_value='["deviceId","message","lostProduction"]'fields=json.loads(fields_value)sort_by=['sortBy']sort_asc=Falsepage_size=50page=1use_utc=Falsecontract_type=ContractTypeEnum.SERVICEresult=statuses_controller.get_active_statuses(device_ids,category,lost_production_signal_id,fields,sort_by,sort_asc,page_size,page,use_utc,contract_type)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersConfigurationDataControllerGet controller instanceAn instance of theConfigurationDataControllerclass can be accessed from the API Client.configuration_data_controller=client.configuration_dataget_configurationGets your system-wide configuration data.🔐 This endpoint requires theConfigurationendpoint permission.This request can also be made using the POST method,
with a request toconfiguration.jsonand
a JSON request body instead of query parameters.defget_configuration(self)Example Usageresult=configuration_data_controller.get_configuration()ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersAssetsControllerGet controller instanceAn instance of theAssetsControllerclass can be accessed from the API Client.assets_controller=client.assetsget_devicesGets a list of devices that the API key has permissions for.🔐 This endpoint requires theAssetsendpoint permission.This request can also be made using the POST method,
with a request todevices.jsonand
a JSON request body instead of query parameters.defget_devices(self,device_type_ids=None,site_ids=None,parent_ids=None,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiondeviceTypeIdsOptionalCollectionOnly include devices of these types.Examples:1 - Wind turbine2 - Production meter3 - Met mast4 - Inverter10 - Device group11 - Grid meter12 - Combiner box23 - String27 - Virtual Meteo Sensor |
| siteIds |OptionalCollection| Only include devices at these sites. |
| parentIds |OptionalCollection| Only include devices with these parent devices. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theDeviceschema (See Response Type). By default all fields are included. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagedevice_type_ids_value="[1,2,3]"device_type_ids=json.loads(device_type_ids_value)site_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)parent_ids_value="[1,2,3]"parent_ids=json.loads(parent_ids_value)fields=['fields']page_size=50page=1use_utc=Falseresult=assets_controller.get_devices(device_type_ids,site_ids,parent_ids,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_devices_published_after_dateGets the number of devices published on a site after a certain date as well as the IDs of the authorized devices.🔐 This endpoint requires theAssetsendpoint permission.defget_devices_published_after_date(self,site_id,date)ParametersParameterTagsDescriptionsiteIdRequiredTODO: Add a parameter descriptiondateRequiredDate after which published devices will be fetched.Example Usagesite_id=200date=datetime.now()result=assets_controller.get_devices_published_after_date(site_id,date)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_sitesGets a list of sites that the API key has permissions
for.🔐 This endpoint requires theAssetsendpoint permission.This request can also be made using the POST method,
with a request tosites.jsonand
a JSON request body instead of query parameters.defget_sites(self,fields=None,page_size=50,page=1)ParametersParameterTagsDescriptionfieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theSiteWithDataschema (See Response Type). By default all fields are included.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.Example Usagefields_value='["siteId","title"]'fields=json.loads(fields_value)page_size=50page=1result=assets_controller.get_sites(fields,page_size,page)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_power_curvesGets the default or learned power curves for wind turbines.
Other device types are not supported.🔐 This endpoint requires thePowerCurvesendpoint permission.This request can also be made using the POST method,
with a request topowercurves.jsonand
a JSON request body instead of query parameters.defget_power_curves(self,device_ids,timestamp=None,learned=False)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhat devices to get power curves for. Only wind turbines are supported.timestampOptionalThe date for which to get power curves. The default is the current date.learnedOptionalDefaultValueWhether to get learned power curves instead of default power curves.Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)timestamp=2023-03-01learned=Falseresult=assets_controller.get_power_curves(device_ids,timestamp,learned)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersAlertsControllerGet controller instanceAn instance of theAlertsControllerclass can be accessed from the API Client.alerts_controller=client.alertsget_active_alertsGets active alerts for multiple devices.
The timestamps are in the time zone configured in the Greenbyte Platform.
Use the useUtc flag to get timestamps in UTC.🔐 This endpoint requires theAlertsendpoint permission.This request can also be made using the POST method,
with a request toactivealerts.jsonand
a JSON request body instead of query parameters.defget_active_alerts(self,device_ids,fields=None,sort_by=None,sort_asc=False,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhat devices to get alerts for.fieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theAlertItemschema (See Response Type). By default all fields are included.sortByOptionalCollectionWhich fields to sort the response items by.sortAscOptionalDefaultValueWhether to sort the items in ascending order.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)fields_value='["ruleId","timestampStart"]'fields=json.loads(fields_value)sort_by=['sortBy']sort_asc=Falsepage_size=50page=1use_utc=Falseresult=alerts_controller.get_active_alerts(device_ids,fields,sort_by,sort_asc,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_alertsGets alerts for multiple devices and the given time period.
The timestamps are in the time zone configured in the Greenbyte Platform.
Use the useUtc flag to get timestamps in UTC.🔐 This endpoint requires theAlertsendpoint permission.This request can also be made using the POST method,
with a request toalerts.jsonand
a JSON request body instead of query parameters.defget_alerts(self,device_ids,timestamp_start,timestamp_end,fields=None,sort_by=None,sort_asc=False,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhat devices to get alerts for.timestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theAlertItemschema (See Response Type). By default all fields are included. |
| sortBy |OptionalCollection| Which fields to sort the response items by. |
| sortAsc |OptionalDefaultValue| Whether to sort the items in ascending order. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zfields_value='["ruleId","timestampStart"]'fields=json.loads(fields_value)sort_by=['sortBy']sort_asc=Falsepage_size=50page=1use_utc=Falseresult=alerts_controller.get_alerts(device_ids,timestamp_start,timestamp_end,fields,sort_by,sort_asc,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersPlanControllerGet controller instanceAn instance of thePlanControllerclass can be accessed from the API Client.plan_controller=client.planlist_tasksGets a list of tasks.🔐 This endpoint requires thePlanendpoint permission.deflist_tasks(self,timestamp_start,timestamp_end,device_ids=None,site_ids=None,category_ids=None,state=None,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiontimestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| deviceIds |OptionalCollection| What devices to get tasks for. |
| siteIds |OptionalCollection| What sites to get tasks for. |
| categoryIds |OptionalCollection| What task categories to include. |
| state |Optional| What state of tasks to get: resolved and unresolved. If not set, both resolved and unresolved tasks are included. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theTaskschema (See Response Type). By default all fields are included. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagetimestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zdevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)site_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)category_ids_value="[1,2,3]"category_ids=json.loads(category_ids_value)state=TaskStateEnum.UNRESOLVEDfields_value='["taskId","title"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=plan_controller.list_tasks(timestamp_start,timestamp_end,device_ids,site_ids,category_ids,state,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_taskGet a single task by ID.🔐 This endpoint requires thePlanendpoint permission.defget_task(self,task_id,use_utc=False)ParametersParameterTagsDescriptiontaskIdRequiredThe id of the task to get.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagetask_id=200use_utc=Falseresult=plan_controller.get_task(task_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_task_categoriesGets a list of task categories.🔐 This endpoint requires thePlanendpoint permission.deflist_task_categories(self)Example Usageresult=plan_controller.list_task_categories()ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_comments_for_multiple_tasksGets a list of comments belonging to one or more tasks with given taskIds.🔐 This endpoint requires thePlanendpoint permission.deflist_comments_for_multiple_tasks(self,task_ids,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiontaskIdsRequiredCollectionAn array of taskIds.fieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theTaskCommentschema (See Response Type). By default all fields are included.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagetask_ids_value="[1,2,3]"task_ids=json.loads(task_ids_value)fields_value='["commentId","text"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=plan_controller.list_comments_for_multiple_tasks(task_ids,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_task_filesGets a list of files belonging to a task.🔐 This endpoint requires thePlanendpoint permission.deflist_task_files(self,task_id,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiontaskIdRequiredThe id of the task.fieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theTaskFileschema (See Response Type). By default all fields are included.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagetask_id=200fields=['fields']page_size=50page=1use_utc=Falseresult=plan_controller.list_task_files(task_id,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.download_task_fileDownloads a file belonging to a task.🔐 This endpoint requires thePlanendpoint permission.defdownload_task_file(self,task_id,file_id)ParametersParameterTagsDescriptiontaskIdRequiredThe id of the task.fileIdRequiredThe id of the file.Example Usagetask_id=200file_id=200result=plan_controller.download_task_file(task_id,file_id)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_site_accessesGets a list of site accesses.🔐 This endpoint requires thePlanendpoint permission.deflist_site_accesses(self,timestamp_start,timestamp_end,device_ids=None,site_ids=None,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiontimestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| deviceIds |OptionalCollection| What devices to get site accesses for. |
| siteIds |OptionalCollection| What sites to get site accesses for. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theSiteAccessschema (See Response Type). By default all fields are included. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagetimestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zdevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)site_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)fields_value='["siteAccessId","timestampStart"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=plan_controller.list_site_accesses(timestamp_start,timestamp_end,device_ids,site_ids,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_site_accessGets a specific site access.🔐 This endpoint requires thePlanendpoint permission.defget_site_access(self,site_access_id,use_utc=False)ParametersParameterTagsDescriptionsiteAccessIdRequiredThe id of the site access.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagesite_access_id=200use_utc=Falseresult=plan_controller.get_site_access(site_access_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_device_accesses_for_multiple_site_accessesGets a list of device accesses belonging to site accesses with specified SiteAccessIds.🔐 This endpoint requires thePlanendpoint permission.deflist_device_accesses_for_multiple_site_accesses(self,site_access_ids,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptionsiteAccessIdsRequiredCollectionAn array of siteAccessIds.fieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in theDeviceAccessschema (See Response Type). By default all fields are included.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagesite_access_ids_value="[1,2]"site_access_ids=json.loads(site_access_ids_value)fields_value='["deviceAccessId","siteId"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=plan_controller.list_device_accesses_for_multiple_site_accesses(site_access_ids,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_device_accessGet a single device access by ID.🔐 This endpoint requires thePlanendpoint permission.defget_device_access(self,device_access_id,use_utc=False)ParametersParameterTagsDescriptiondeviceAccessIdRequiredThe id of the device access to get.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagedevice_access_id=200use_utc=Falseresult=plan_controller.get_device_access(device_access_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_downtime_eventsGets a list of downtime events.🔐 This endpoint requires thePlanendpoint permission.deflist_downtime_events(self,timestamp_start,timestamp_end,device_ids=None,site_ids=None,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiontimestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| deviceIds |OptionalCollection| What devices to get downtime events for. |
| siteIds |OptionalCollection| What sites to get downtime events for. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in theDowntimeEventschema (See Response Type). By default all fields are included. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagetimestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zdevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)site_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)fields_value='["deviceIds","timestampStart"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=plan_controller.list_downtime_events(timestamp_start,timestamp_end,device_ids,site_ids,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_downtime_eventGets a single downtime event by ID.🔐 This endpoint requires thePlanendpoint permission.defget_downtime_event(self,downtime_event_id,use_utc=False)ParametersParameterTagsDescriptiondowntimeEventIdRequiredThe id of the downtime event to get.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagedowntime_event_id=109use_utc=Falseresult=plan_controller.get_downtime_event(downtime_event_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_personnelGets a list of personnel.🔐 This endpoint requires thePlanendpoint permission.deflist_personnel(self,fields=None,page_size=50,page=1)ParametersParameterTagsDescriptionfieldsOptionalCollectionWhich fields to include in the response. Valid fields are those defined in thePersonnelschema (See Response Type). By default all fields are included.pageSizeOptionalDefaultValueThe number of items to return per page.pageOptionalDefaultValueWhich page to return when the number of items exceed the page size.Example Usagefields_value='["lastName","phone"]'fields=json.loads(fields_value)page_size=50page=1result=plan_controller.list_personnel(fields,page_size,page)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_personnelGets a single personnel by ID.🔐 This endpoint requires thePlanendpoint permission.defget_personnel(self,personnel_id)ParametersParameterTagsDescriptionpersonnelIdRequiredThe id of the personnel to get.Example Usagepersonnel_id=109result=plan_controller.get_personnel(personnel_id)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_organizationsGets a list of organizations.🔐 This endpoint requires thePlanendpoint permission.deflist_organizations(self)Example Usageresult=plan_controller.list_organizations()ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_hse_incidentsGets a list of HSE incidents.🔐 This endpoint requires thePlanendpoint permission.This is a beta feature. Some details might change before it is released as a stable version.deflist_hse_incidents(self,timestamp_start,timestamp_end,site_ids=None,state=None,category=None,use_utc=False)ParametersParameterTagsDescriptiontimestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| siteIds |OptionalCollection| Which sites to get HSE incidents for. |
| state |Optional| Retrieve HSE incidents with state: resolved or unresolved.
If not set, both resolved and unresolved HSE incidents are included. |
| category |Optional| Retrieve HSE incidents with a specific category.
If not set, HSE incidents of all categories are included. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagetimestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zsite_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)state=StateEnum.UNRESOLVEDcategory=HSECategoryEnum.ACCIDENTuse_utc=Falseresult=plan_controller.list_hse_incidents(timestamp_start,timestamp_end,site_ids,state,category,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_hse_incidentGet a single HSE incident by ID.🔐 This endpoint requires thePlanendpoint permission.This is a beta feature. Some details might change before it is released as a stable version.defget_hse_incident(self,hse_incident_id,use_utc=False)ParametersParameterTagsDescriptionhseIncidentIdRequiredThe id of the HSE incident to get.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usagehse_incident_id=109use_utc=Falseresult=plan_controller.get_hse_incident(hse_incident_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.list_worklog_itemsGets a list of worklog items.🔐 This endpoint requires thePlanendpoint permission.This is a beta feature. Some details might change before it is released as a stable version.deflist_worklog_items(self,timestamp_start,timestamp_end,site_ids=None,use_utc=False)ParametersParameterTagsDescriptiontimestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| siteIds |OptionalCollection| What sites to get worklog items for. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagetimestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zsite_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)use_utc=Falseresult=plan_controller.list_worklog_items(timestamp_start,timestamp_end,site_ids,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.get_worklog_itemGet a single worklog item by ID.🔐 This endpoint requires thePlanendpoint permission.This is a beta feature. Some details might change before it is released as a stable version.defget_worklog_item(self,worklog_item_id,use_utc=False)ParametersParameterTagsDescriptionworklogItemIdRequiredThe id of the worklog item to get.useUtcOptionalDefaultValueSet to true to get timestamps in UTC.Example Usageworklog_item_id=109use_utc=Falseresult=plan_controller.get_worklog_item(worklog_item_id,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.404The requested resource could not be found.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of ControllersPredictControllerGet controller instanceAn instance of thePredictControllerclass can be accessed from the API Client.predict_controller=client.predictget_predict_alertsGets a list of Predict alerts based on filter criteria. The timestamps are in the time zone configured in the Greenbyte Platform. Use the useUtc flag to get timestamps in UTC.🔐 This endpoint requires thePredictendpoint permission.This is a beta feature. Some details might change before it is
released as a stable version.defget_predict_alerts(self,device_ids,timestamp_start,timestamp_end,site_ids=None,component_ids=None,status=None,severity=None,fields=None,page_size=50,page=1,use_utc=False)ParametersParameterTagsDescriptiondeviceIdsRequiredCollectionWhat devices to get alerts for.timestampStartRequiredThe beginning of the time interval to get data for (inclusive),inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The start timestampisincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| timestampEnd |Required| The end of the time interval to get data for (exclusive),
inRFC 3339, section 5.6date-timeformat:Timestamps ending with 'Z' are treated as UTC. Example: "2020-01-01T00:00:00Z"Time zone (UTC) offset timestamps ending with '+HH:mm'/"-HH:mm" are also supported. Example: "2020-01-01T02:00:00-02:00"Other timestamps are treated as being in the time zone configured in the Greenbyte Platform. Example: "2020-01-01T00:00:00"The end timestamp isnotincluded in the time interval: for
example, to select the full month of March 2020, settimestampStartto "2020-03-01T00:00:00" andtimestampEndto
"2020-04-01T00:00:00".Timestamps selected in the portal will by default be in UTC. |
| siteIds |OptionalCollection| What sites to get alerts for. |
| componentIds |OptionalCollection| What components to get alerts for. |
| status |Optional| Which alert status to get alerts for. |
| severity |Optional| What severity of alerts to get: high severity or low severity. If
not set, both high and low severity alerts are included. |
| fields |OptionalCollection| Which fields to include in the response. Valid fields are those defined in thePredictAlertschema (See Response Type). By default all fields are included. |
| pageSize |OptionalDefaultValue| The number of items to return per page. |
| page |OptionalDefaultValue| Which page to return when the number of items exceed the page size. |
| useUtc |OptionalDefaultValue| Set to true to get timestamps in UTC. |Example Usagedevice_ids_value="[1,2,3]"device_ids=json.loads(device_ids_value)timestamp_start=2023-04-01T00:00:00Ztimestamp_end=2023-04-08T00:00:00Zsite_ids_value="[1,2,3]"site_ids=json.loads(site_ids_value)component_ids_value="[1,2,3]"component_ids=json.loads(component_ids_value)status=PredictStatusEnum.ACTIVEseverity=PredictSeverityEnum.HIGHfields_value='["deviceId","highSeverity"]'fields=json.loads(fields_value)page_size=50page=1use_utc=Falseresult=predict_controller.get_predict_alerts(device_ids,timestamp_start,timestamp_end,site_ids,component_ids,status,severity,fields,page_size,page,use_utc)ErrorsError CodeError Description400The request cannot be fulfilled due to bad syntax.401The request is missing a valid API key.403One of the following:* The API key does not authorize access to the requested endpoint because of a missing endpoint permission.* The API key does not authorize access to the requested data. Devices, sites or data signals can be limited.405The HTTP method is not allowed for the endpoint.429The API key has been used in too many requests in a given amountof time. The following headers will be set in the response:*X-Rate-Limit-Limit– The rate limit period (for example"1m", "12h", or "1d").*X-Rate-Limit-Remaining– The remaining number of requestsfor this period.*X-Rate-Limit-Reset– The UTC timestamp string (in ISO 8601format) when the remaining number of requests resets.The limit is currently 1,000 requests/minute per API key and IPaddress.Back to List of Controllers