OpenGate Libraries

Introduction to OpenGate Libraries

The OpenGate Libraries are a set of tools and utilities that provide a wide range of functionality for working with OpenGate data in different programming languages. These libraries are built on top of the OpenGate API and provide a simple and efficient way to access and manipulate data in your applications.

Index

Language Link
Javascript Javascript OGAPI.js
Python Python OGAPI.py

Subsections of OpenGate Libraries

OpenGate JS

Installation and Usage

Instalation

First of all you must install the library in your project. You can use npm or yarn to install the package.

If you use npm, you can install the package as follows:

npm install opengate-js

If you use yarn, you can install the package as follows:

yarn add opengate-js

Node.js (NPM)

To use the API in a Node.js environment, install the package and instantiate it as follows:

var OpengateAPI = require('opengate-js');

var ogapi = new OpengateAPI({
    url: 'your-api-url',
    port: 'your-port',
    version: 'your-version',
    apiKey: 'your-api-key',
    jwt: 'your-jwt',
    south: {
        url: 'your-south-api-url'
    }
});

Web (Bower)

To use the API in a web environment, include the script and instantiate it as follows:

import {} from 'opengate-js/dist/opengate-api-bower-16.0.0';

var ogapi = new window.OpenGateAPI({
    url: 'your-api-url',
    port: 'your-port',
    version: 'your-version',
    apiKey: 'your-api-key',
    jwt: 'your-jwt',
    south: {
        url: 'your-south-api-url'
    }
});

Note that opengate-api-bower uses babel to transpile the code to ES5 code.

API Reference

Subsections of OpenGate JS

JS Reference

Subsections of JS Reference

Subsections of alarms

Subsections of actions

Alarm Action Builder

Defines the builder to execute alarm actions

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
action string This action can be ATTEND or CLOSE

addAlarmId(alarmId)

Add alarmId to operation

Parámetros

Nombre Tipo Opcional Descripción
alarmId string AlarmId of Alarm

Retorna

Tip

Tipo: AlarmActionBuilder

Ejemplos

ogapi.alarms.builderFactory.newAlarmCloseBuilder().addAlarmId("")

build()

Build an instance of Operation

Retorna

Tip

Tipo: Operation

Ejemplos

ogapi.operations.builderFactory.newAlarmCloseBuilder().build()

withNotes(notes)

Add notes to operation

Parámetros

Nombre Tipo Opcional Descripción
notes string Notes about operation

Retorna

Tip

Tipo: AlarmActionBuilder

Ejemplos

ogapi.operations.builderFactory.newAlarmCloseBuilder().withNotes("")

Alarm Attend Builder

Defines the builder to execute alarm attend operation

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.

Alarm Close Builder

Defines the builder to execute alarm close operation

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.

Operation

This is an abstract class; it must be extended by another class that defines the specific request. This class is responsible for executing operation requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is a base url resource
postObj object it will be sent as a data on post action

execute()

This invokes a request to the OpenGate North API and the callback is managed by promises.

Retorna

Tip

Tipo: Promise


Alarm Actions

This class contains all alarms actions builders

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.

newAttendBuilder()

Create alarm attend action builder

Retorna

Tip

Tipo: AlarmAttendBuilder

Ejemplos

ogapi.alarms.newAttendBuilder()

newCloseBuilder()

Create alarm close action builder

Retorna

Tip

Tipo: AlarmCloseBuilder

Ejemplos

ogapi.alarms.newCloseBuilder()

Subsections of areas

Area Finder

This class allows making GET requests to the area resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndIdentifier(organization, identifier)

Downloads a specific area by its organization and identifier. This executes a GET HTTP method.

Parámetros

Nombre Tipo Opcional Descripción
organization string area organization .
identifier string area name.

Retorna

Tip

Tipo: Promise


Areas

This is a base object that contains everything you can do with an area.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withColor(color)

Set the color attribute

Parámetros

Nombre Tipo Opcional Descripción
color string required field

Retorna

Tip

Tipo: Areas


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Areas


withEntities(entities)

Set the entities attribute

Parámetros

Nombre Tipo Opcional Descripción
entities array required field

Retorna

Tip

Tipo: Areas


withGeometry(type, coordinates)

Set the geometry attribute

Parámetros

Nombre Tipo Opcional Descripción
type string required field
coordinates array required field

Retorna

Tip

Tipo: Areas


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Areas


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Areas


withOrder(order)

Set the order attribute

Parámetros

Nombre Tipo Opcional Descripción
order number required field

Retorna

Tip

Tipo: Areas


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: Areas


Subsections of bulk

Bulk Execution Finder

This class allows making GET requests to the bulk executions resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndId(organization, id, mimetype)

Downloads a specific entity by its organization and id. This executes a GET HTTP method.

Parámetros

Nombre Tipo Opcional Descripción
organization string organization.
id string bulk id.
mimetype string Format of file when get the result details of previously created bulk process.

Retorna

Tip

Tipo: Promise


Bulk Finder

This class allows making GET requests to the bulk resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndId(organization, id, format, accept)

Downloads a specific entity by its organization and id. This executes a GET HTTP method.

Parámetros

Nombre Tipo Opcional Descripción
organization string entity organization .
id string entity id.
format string format response flag.
accept string accept.

Retorna

Tip

Tipo: Promise


Subsections of bundles

Bundle Finder

This class allows making GET requests to the bundle resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByNameAndVersion(name, version)

Download a specific bundle by its name and version. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
name string bundle name .
version string bundle version.

Retorna

Tip

Tipo: Promise


Bundles

This is the base object for everything you can do with bundles.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

activate()

This invokes a request to the OpenGate North API and the callback is managed by promises. This function activates a bundle.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.bundlesBuilder().activate()

addDeploymentElement(progressEvent)

Create deployment element that is asociated to the Bundle

Retorna

Tip

Tipo: DeploymentElement

Ejemplos

ogapi.bundlesBuilder().newDeploymentElement()

create()

Creates a new bundle

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.bundlesBuilder().create()

deactivate()

This invokes a request to the OpenGate North API and the callback is managed by promises. This function deactivates a bundle.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.bundlesBuilder().deactivate()

deployAndActivate()

Deploy all elements of a bundle in only one method

Retorna

Tip

Tipo: DeploymentElement

Ejemplos

ogapi.bundlesBuilder().deployAndActivate()

update()

Updates a bundle

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.bundlesBuilder().update()

withActive(active)

Set the active attribute

Parámetros

Nombre Tipo Opcional Descripción
active string

Retorna

Tip

Tipo: Bundles


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Bundles


withHardware(hardware)

Set the hardware attribute

Parámetros

Nombre Tipo Opcional Descripción
hardware string

Retorna

Tip

Tipo: Bundles


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Bundles


withPostaction(postactions)

Set the postactions attribute

Parámetros

Nombre Tipo Opcional Descripción
postactions string

Retorna

Tip

Tipo: Bundles


withPreaction(preaction)

Set the preaction attribute

Parámetros

Nombre Tipo Opcional Descripción
preaction string

Retorna

Tip

Tipo: Bundles


withTimeout(ms)

The request will have a specific time out if it will be exceeded then the promise throw an exception

Parámetros

Nombre Tipo Opcional Descripción
ms number timeout in milliseconds

Retorna

Tip

Tipo: Bundles


withUserNotes(userNotes)

Set the userNotes attribute

Parámetros

Nombre Tipo Opcional Descripción
userNotes string

Retorna

Tip

Tipo: Bundles


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string

Retorna

Tip

Tipo: Bundles


withWorkgroup(workgroup)

Set the workgroup attribute

Parámetros

Nombre Tipo Opcional Descripción
workgroup string

Retorna

Tip

Tipo: Bundles


deployment

This section documents the deployment element used to attach files to a bundle.

Subsections of deployment

Deployment Element

This is the base object for everything you can do with a deployment element.

createWithFile(rawFile)

This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a deployment element.

Parámetros

Nombre Tipo Opcional Descripción
rawFile File this File is the deployment element

Retorna

Tip

Tipo: Promise


deploy()

This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a deployment element with the previously assigned file.

Retorna

Tip

Tipo: Promise


update()

This method invalidates the update option


withDownloadUrl(downloadUrl)

Set the downloadUrl attribute

Parámetros

Nombre Tipo Opcional Descripción
downloadUrl string

Retorna

Tip

Tipo: DeploymentElement


withFile(rawFile)

Sets the file to upload

Parámetros

Nombre Tipo Opcional Descripción
rawFile object

Retorna

Tip

Tipo: DeploymentElement


withFileName(fileName)

Set the fileName attribute

Parámetros

Nombre Tipo Opcional Descripción
fileName string

Retorna

Tip

Tipo: DeploymentElement


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: DeploymentElement


withOldName(name)

Sets the old name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string

Retorna

Tip

Tipo: DeploymentElement


withOldPath(path)

Sets the old path attribute

Parámetros

Nombre Tipo Opcional Descripción
path string

Retorna

Tip

Tipo: DeploymentElement


withOldVersion(version)

Sets the old version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string

Retorna

Tip

Tipo: DeploymentElement


withOperation(operation)

Set the operation attribute

Parámetros

Nombre Tipo Opcional Descripción
operation string required field

Retorna

Tip

Tipo: DeploymentElement


withOption(option)

Set the option attribute

Parámetros

Nombre Tipo Opcional Descripción
option string

Retorna

Tip

Tipo: DeploymentElement


withOrder(order)

Set the order attribute

Parámetros

Nombre Tipo Opcional Descripción
order string required field

Retorna

Tip

Tipo: DeploymentElement


withPath(path)

Set the path attribute

Parámetros

Nombre Tipo Opcional Descripción
path string required field

Retorna

Tip

Tipo: DeploymentElement


withTimeout(ms)

The request will have a specific time out if it will be exceeded then the promise throw an exception

Parámetros

Nombre Tipo Opcional Descripción
ms number timeout in milliseconds

Retorna

Tip

Tipo: Bundles


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string required field

Retorna

Tip

Tipo: DeploymentElement


withValidation(validation)

Set the validation attribute

Parámetros

Nombre Tipo Opcional Descripción
validation string

Retorna

Tip

Tipo: DeploymentElement


withValidators(validators)

Set the validators attribute

Parámetros

Nombre Tipo Opcional Descripción
validators Array

Retorna

Tip

Tipo: DeploymentElement


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: DeploymentElement


Subsections of channels

Channel Finder

This class allows making GET requests to the channel resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByDomainAndWorkgroup(domain, workgroup)

Performs a GET request that returns the channels related to the given domain and workgroup.

Parámetros

Nombre Tipo Opcional Descripción
domain string domain
workgroup string workgroup.

Retorna

Tip

Tipo: Promise


findByDomainAndWorkgroupAndOrganization(domain, workgroup, organization)

Performs a GET request that returns the channels related to the given domain, workgroup, and organization.

Parámetros

Nombre Tipo Opcional Descripción
domain string domain
workgroup string workgroup.
organization string organization.

Retorna

Tip

Tipo: Promise


findByOrganizationAndName(organization, name)

Downloads a specific channel by its organization and name. This executes a GET HTTP method.

Parámetros

Nombre Tipo Opcional Descripción
organization string channel organization .
name string channel name.

Retorna

Tip

Tipo: Promise


Channels

This is a base object that contains everything you can do with a channel.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withCertificate(certificate)

Set the certificate attribute

Parámetros

Nombre Tipo Opcional Descripción
certificate string

Retorna

Tip

Tipo: Channels


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Channels


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Channels


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string

Retorna

Tip

Tipo: Channels


Subsections of collection

Subsections of devices

Subsections of collect

Comms Module Message

This is a base object that allows the user to create a CommsModule.

withAntennaStatus(antennaStatus)

Set the antennaStatus attribute

Parámetros

Nombre Tipo Opcional Descripción
antennaStatus string optional field

Retorna

Tip

Tipo: CommsModule


withHardware(hardware)

Set the hardware attribute

Parámetros

Nombre Tipo Opcional Descripción
hardware Hardware optionals field

Retorna

Tip

Tipo: CommsModule


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string optional field

Retorna

Tip

Tipo: CommsModule


withMobile(mobile)

Set the mobile attribute

Retorna

Tip

Tipo: CommsModule


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string optional field

Retorna

Tip

Tipo: CommsModule


withOperationalStatus(operationalStatus)

Set the operationalStatus attribute

Parámetros

Nombre Tipo Opcional Descripción
operationalStatus string

Retorna

Tip

Tipo: CommsModule


withSoftware(software)

Set the software attribute

Retorna

Tip

Tipo: CommsModule


withSubscriber(subscriber)

Set the subscriber attribute

Retorna

Tip

Tipo: CommsModule


withSubscription(subscription)

Set the subscription attribute

Retorna

Tip

Tipo: CommsModule


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string optional field

Retorna

Tip

Tipo: CommsModule


Datapoint

This is a base object that allows the user to create a Datapoint.

withAt(at)

Sets the at attribute

Parámetros

Nombre Tipo Opcional Descripción
at number optional field

Retorna

Tip

Tipo: Datapoint


withFrom(from)

Sets the from attribute

Parámetros

Nombre Tipo Opcional Descripción
from number optional field

Retorna

Tip

Tipo: Datapoint


withSource(value)

Sets the source attribute

Parámetros

Nombre Tipo Opcional Descripción
value string optional field

Retorna

Tip

Tipo: Datapoint


withSourceInfo(value)

Sets the source attribute

Parámetros

Nombre Tipo Opcional Descripción
value string optional field

Retorna

Tip

Tipo: Datapoint


withTags(tags)

Sets the tags attribute

Parámetros

Nombre Tipo Opcional Descripción
tags Array

Retorna

Tip

Tipo: Datapoint


withValue(value)

Sets the value attribute

Parámetros

Nombre Tipo Opcional Descripción
value string required field

Retorna

Tip

Tipo: Datapoint


Datastream

This is a base object that allows the user to create a Datastream.

withDatapoint(datapoint)

Add a datapoint in datapoints

Parámetros

Nombre Tipo Opcional Descripción
datapoint Datapoint required field

Retorna

Tip

Tipo: Datastream


withFeed(feed)

Set the feed attribute

Parámetros

Nombre Tipo Opcional Descripción
feed string optionals field

Retorna

Tip

Tipo: Datastream


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Datastream


Event

This is a base object that allows the user to create an Event.

withCommsModule(communicationsModules)

Set the powerSupply attribute

Retorna

Tip

Tipo: Event


withCpuUsage(cpuUsage)

Set the cpuUsage attribute

Retorna

Tip

Tipo: Event


withCurrentTemperature(currentTemperature)

Set the currentTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
currentTemperature string optionals field

Retorna

Tip

Tipo: Event


withDateLocation(date)

Set the date attribute

Parámetros

Nombre Tipo Opcional Descripción
date string optionals field

Retorna

Tip

Tipo: Event


withDeviceId(deviceId)

Set the deviceId attribute

Parámetros

Nombre Tipo Opcional Descripción
deviceId string optionals field

Retorna

Tip

Tipo: Event


withEventDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string optionals field

Retorna

Tip

Tipo: Event


withEventId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string optionals field

Retorna

Tip

Tipo: Event


withEventName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string optionals field

Retorna

Tip

Tipo: Event


withHardware(hardware)

Set the hardware attribute

Parámetros

Nombre Tipo Opcional Descripción
hardware Hardware optionals field

Retorna

Tip

Tipo: Event


withLatitude(latitude)

Set the latitude attribute

Parámetros

Nombre Tipo Opcional Descripción
latitude number optionals field

Retorna

Tip

Tipo: Event


withLongitude(longitude)

Set the longitude attribute

Parámetros

Nombre Tipo Opcional Descripción
longitude number optionals field

Retorna

Tip

Tipo: Event


withMaximumTemperature(maximumTemperature)

Set the maximum attribute

Parámetros

Nombre Tipo Opcional Descripción
maximumTemperature string optionals field

Retorna

Tip

Tipo: Event


withMinimumTemperature(minimumTemperature)

Set the minimum attribute

Parámetros

Nombre Tipo Opcional Descripción
minimumTemperature string optionals field

Retorna

Tip

Tipo: Event


withNonVolatilStorage(nonVolatilStorage)

Set the nonVolatilStorage attribute

Retorna

Tip

Tipo: Event


withOperationalStatus(operationalStatus)

Set the operationalStatus attribute

Parámetros

Nombre Tipo Opcional Descripción
operationalStatus string

Retorna

Tip

Tipo: Event


withPath(path)

Set the path attribute

Parámetros

Nombre Tipo Opcional Descripción
path string optionals field

Retorna

Tip

Tipo: Event


withPowerSupply(powerSupply)

Set the powerSupply attribute

Retorna

Tip

Tipo: Event


withRam(ram)

Set the Ram attribute

Retorna

Tip

Tipo: Event


withSoftware(software)

Set the software attribute

Parámetros

Nombre Tipo Opcional Descripción
software software optionals field

Retorna

Tip

Tipo: Event


withStatusTemperature(unitTemperature)

Set the unitTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
unitTemperature string optionals field

Retorna

Tip

Tipo: Event


withTemperatureAverage(averageTemperature)

Set the average attribute

Parámetros

Nombre Tipo Opcional Descripción
averageTemperature string optionals field

Retorna

Tip

Tipo: Event


withTrendTemperature(unitTemperature)

Set the unitTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
unitTemperature string optionals field

Retorna

Tip

Tipo: Event


withUnitTemperature(unitTemperature)

Set the unitTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
unitTemperature string optionals field

Retorna

Tip

Tipo: Event


withUpTime(upTime)

Set the upTime attribute

Parámetros

Nombre Tipo Opcional Descripción
upTime number

Retorna

Tip

Tipo: Event


withVolatilStorage(volatilStorage)

Set the volatilStorage attribute

Retorna

Tip

Tipo: Event


Hardware

This is a base object that allows the user to create a Hardware object.

withClockDate(clockDate)

Set the clockDate attribute

Parámetros

Nombre Tipo Opcional Descripción
clockDate string

Retorna

Tip

Tipo: Hardware


withManufacturerName(manufacturerName)

Set the manufacturerName attribute

Parámetros

Nombre Tipo Opcional Descripción
manufacturerName string

Retorna

Tip

Tipo: Hardware


withManufacturerOui(manufacturerOui)

Set the manufacturerOui attribute

Parámetros

Nombre Tipo Opcional Descripción
manufacturerOui string

Retorna

Tip

Tipo: Hardware


withModelName(modelName)

Set the modelName attribute

Parámetros

Nombre Tipo Opcional Descripción
modelName string

Retorna

Tip

Tipo: Hardware


withModelVersion(modelVersion)

Set the modelVersion attribute

Parámetros

Nombre Tipo Opcional Descripción
modelVersion string

Retorna

Tip

Tipo: Hardware


withSerialnumber(serialnumber)

Set the serialnumber attribute

Parámetros

Nombre Tipo Opcional Descripción
serialnumber string

Retorna

Tip

Tipo: Hardware


Location

This is a base object that allows the user to create a Location object.

withDateLocation(date)

Set the date attribute

Parámetros

Nombre Tipo Opcional Descripción
date string optionals field

Retorna

Tip

Tipo: Location


withLatitude(latitude)

Set the latitude attribute

Parámetros

Nombre Tipo Opcional Descripción
latitude number optionals field

Retorna

Tip

Tipo: Location


withLongitude(longitude)

Set the longitude attribute

Parámetros

Nombre Tipo Opcional Descripción
longitude number optionals field

Retorna

Tip

Tipo: Location


Mobile

This is a base object that allows the user to create a Mobile object.

withApn(apn)

Set the apn attribute

Parámetros

Nombre Tipo Opcional Descripción
apn string optionals field

Retorna

Tip

Tipo: Mobile


withBcch(bcch)

Set the bcch attribute

Parámetros

Nombre Tipo Opcional Descripción
bcch string optionals field

Retorna

Tip

Tipo: Mobile


withCellId(cellId)

Set the cellId attribute

Parámetros

Nombre Tipo Opcional Descripción
cellId string optionals field

Retorna

Tip

Tipo: Mobile


withCgi(cgi)

Set the cgi attribute

Parámetros

Nombre Tipo Opcional Descripción
cgi string optionals field

Retorna

Tip

Tipo: Mobile


withLac(lac)

Set the lac attribute

Parámetros

Nombre Tipo Opcional Descripción
lac string optionals field

Retorna

Tip

Tipo: Mobile


withMr(mr)

Set the mr attribute

Parámetros

Nombre Tipo Opcional Descripción
mr string optionals field

Retorna

Tip

Tipo: Mobile


withPlmn(plmn)

Set the plmn attribute

Parámetros

Nombre Tipo Opcional Descripción
plmn string optionals field

Retorna

Tip

Tipo: Mobile


withRatType(ratType)

Set the ratType attribute

Parámetros

Nombre Tipo Opcional Descripción
ratType string optionals field

Retorna

Tip

Tipo: Mobile


withsignalQuality(signalQuality)

Set the signalQuality attribute

Parámetros

Nombre Tipo Opcional Descripción
signalQuality string optionals field

Retorna

Tip

Tipo: Mobile


withsignalQualityMax(signalQualityMax)

Set the signalQualityMax attribute

Parámetros

Nombre Tipo Opcional Descripción
signalQualityMax string optionals field

Retorna

Tip

Tipo: Mobile


withsignalQualityMin(signalQualityMin)

Set the signalQualityMin attribute

Parámetros

Nombre Tipo Opcional Descripción
signalQualityMin string optionals field

Retorna

Tip

Tipo: Mobile


withSignalStrength(signalStrength)

Set the signalStrength attribute

Parámetros

Nombre Tipo Opcional Descripción
signalStrength string optionals field

Retorna

Tip

Tipo: Mobile


withSignalStrengthMax(signalStrengthMax)

Set the signalStrengthMax attribute

Parámetros

Nombre Tipo Opcional Descripción
signalStrengthMax string optionals field

Retorna

Tip

Tipo: Mobile


withsignalStrengthMin(signalStrengthMin)

Set the signalStrengthMin attribute

Parámetros

Nombre Tipo Opcional Descripción
signalStrengthMin string optionals field

Retorna

Tip

Tipo: Mobile


withTimingAdvance(timingAdvance)

Set the timingAdvance attribute

Parámetros

Nombre Tipo Opcional Descripción
timingAdvance string optionals field

Retorna

Tip

Tipo: Mobile


Power Supply

This is a base object that allows the user to create a PowerSupply object.

withBatteryChargeLevelPercentage(percentage)

Set the BatteryChargeLevel percentage attribute

Parámetros

Nombre Tipo Opcional Descripción
percentage string optionals field

Retorna

Tip

Tipo: PowerSupply


withBatteryChargeLevelStatus(status)

Set the battery status attribute

Parámetros

Nombre Tipo Opcional Descripción
status string optionals field

Retorna

Tip

Tipo: PowerSupply


withBatteryChargeLevelTrend(trend)

Set the trend attribute

Parámetros

Nombre Tipo Opcional Descripción
trend string optionals field

Retorna

Tip

Tipo: PowerSupply


withOutageDate(outageDate)

Set the OutageDate attribute

Parámetros

Nombre Tipo Opcional Descripción
outageDate string optionals field

Retorna

Tip

Tipo: PowerSupply


withOutageDuration(duration)

Set the duration attribute

Parámetros

Nombre Tipo Opcional Descripción
duration number optionals field

Retorna

Tip

Tipo: PowerSupply


withSource(source)

Set the source attribute

Parámetros

Nombre Tipo Opcional Descripción
source string optionals field

Retorna

Tip

Tipo: PowerSupply


withStatus(status)

Set the status attribute

Parámetros

Nombre Tipo Opcional Descripción
status string optionals field

Retorna

Tip

Tipo: PowerSupply


Software

This is a base object that allows the user to create a Software object.

withDate(date)

Set the date attribute

Parámetros

Nombre Tipo Opcional Descripción
date string

Retorna

Tip

Tipo: Software


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string

Retorna

Tip

Tipo: Software


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: Software


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string

Retorna

Tip

Tipo: Software


Storage

This is a base object that allows the user to create a Storage object.

withTotal(total)

Set the total attribute

Parámetros

Nombre Tipo Opcional Descripción
total string optionals field

Retorna

Tip

Tipo: Storage


withUnit(unit)

Set the unit attribute

Parámetros

Nombre Tipo Opcional Descripción
unit string optionals field

Retorna

Tip

Tipo: Storage


Subscriber

This is a base object that allows the user to create a Subscriber object.

withHardware(hardware)

Set the hardware attribute

Parámetros

Nombre Tipo Opcional Descripción
hardware Hardware optionals field

Retorna

Tip

Tipo: Subscriber


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string optional field

Retorna

Tip

Tipo: Subscriber


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string optional field

Retorna

Tip

Tipo: Subscriber


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string optional field

Retorna

Tip

Tipo: Subscriber


Subscription

This is a base object that allows the user to create a Subscription.

withAddressApn(addressApn)

Set the addressApn attribute

Parámetros

Nombre Tipo Opcional Descripción
addressApn string optional field

Retorna

Tip

Tipo: Subscription


withAddressType(addressType)

Set the addressType attribute

Parámetros

Nombre Tipo Opcional Descripción
addressType string optional field

Retorna

Tip

Tipo: Subscription


withAddressValue(addressValue)

Set the addressValue attribute

Parámetros

Nombre Tipo Opcional Descripción
addressValue string optional field

Retorna

Tip

Tipo: Subscription


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string optional field

Retorna

Tip

Tipo: Subscription


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string optional field

Retorna

Tip

Tipo: Subscription


withImsi(imsi)

Set the imsi attribute

Parámetros

Nombre Tipo Opcional Descripción
imsi string optional field

Retorna

Tip

Tipo: Subscription


withMsisdn(msisdn)

Set the msisdn attribute

Parámetros

Nombre Tipo Opcional Descripción
msisdn string optional field

Retorna

Tip

Tipo: Subscription


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string optional field

Retorna

Tip

Tipo: Subscription


withOperator(operator)

Set the operator attribute

Parámetros

Nombre Tipo Opcional Descripción
operator string optional field

Retorna

Tip

Tipo: Subscription


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string optional field

Retorna

Tip

Tipo: Subscription


Temperature

This is a base object that allows the user to create a Temperature object.

withCurrentTemperature(currentTemperature)

Set the currentTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
currentTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withMaximumTemperature(maximumTemperature)

Set the maximum attribute

Parámetros

Nombre Tipo Opcional Descripción
maximumTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withMinimumTemperature(minimumTemperature)

Set the minimumTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
minimumTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withStatusTemperature(statusTemperature)

Set the statusTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
statusTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withTemperatureAverage(averageTemperature)

Set the averageTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
averageTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withTrendTemperature(trendTemperature)

Set the trendTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
trendTemperature string optionals field

Retorna

Tip

Tipo: Temperature


withUnitTemperature(unitTemperature)

Set the unitTemperature attribute

Parámetros

Nombre Tipo Opcional Descripción
unitTemperature string optionals field

Retorna

Tip

Tipo: Temperature


Usage

This is a base object that allows the user to create a Usage object.

withAverage(average)

Set the average attribute

Parámetros

Nombre Tipo Opcional Descripción
average string optionals field

Retorna

Tip

Tipo: Usage


withCurrent(current)

Set the current attribute

Parámetros

Nombre Tipo Opcional Descripción
current string optionals field

Retorna

Tip

Tipo: Usage


withMaximum(maximum)

Set the maximum attribute

Parámetros

Nombre Tipo Opcional Descripción
maximum string optionals field

Retorna

Tip

Tipo: Usage


withMinimum(minimum)

Set the minimum attribute

Parámetros

Nombre Tipo Opcional Descripción
minimum string optionals field

Retorna

Tip

Tipo: Usage


withUsageUnit(unit)

Set the unit attribute

Parámetros

Nombre Tipo Opcional Descripción
unit string optionals field

Retorna

Tip

Tipo: Usage


Device Message

This is a base object that contains methods to send unstructured IoT information to be processed and collected by the platform.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withDataStream(datastream)

Set the datastream attribute

Parámetros

Nombre Tipo Opcional Descripción
datastream Datastream required field

Retorna

Tip

Tipo: deviceMessages


withDataStreamVersion(version)

Set the dataStream version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: deviceMessages


withDeviceId(deviceId)

Set the deviceId attribute

Parámetros

Nombre Tipo Opcional Descripción
deviceId string optional field

Retorna

Tip

Tipo: deviceMessages


withDmmVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: deviceMessages


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: deviceMessages


Subsections of connectorsFunctions

Subsections of catalog

Connector Functions

This is a base object that contains everything you can do with a connector function catalog entry.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI
identifier String
connectorFunction Object

addNorthCriteria(northCriteria)

Add northCriteria to parameter northCriterias. Each element is defined by path and value

Parámetros

Nombre Tipo Opcional Descripción
northCriteria Object

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


addSouthCriteria(southCriteria)

Add southCriteria to parameter southCriterias. Each string can represent an URI, topic, OID…

Parámetros

Nombre Tipo Opcional Descripción
southCriteria String

Retorna

Tip

Tipo: ``


create()

Create a new connector function catalog

Retorna

Tip

Tipo: Promise


withCloneable(cloneable)

Indicates whether or not the Connector Function is cloneable.

Parámetros

Nombre Tipo Opcional Descripción
cloneable Boolean

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withDescription(description)

Description of the connector function. This field is optional.

Parámetros

Nombre Tipo Opcional Descripción
description String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withIdentifier(identifier)

Set the identifier

Parámetros

Nombre Tipo Opcional Descripción
identifier String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withJavascript(javascript)

Connector function javascript code

Parámetros

Nombre Tipo Opcional Descripción
javascript String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withName(name)

Descriptive and unique name

Parámetros

Nombre Tipo Opcional Descripción
name String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withNorthCriterias(northCriterias)

Connector Function selection criteria for operation requests. This field is mandatory if Connector Function type is REQUEST. ⮕ [ each element is defined by path and value ]

Parámetros

Nombre Tipo Opcional Descripción
northCriterias Array

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withOperationalStatus(operationalStatus)

Connector Function status Allowed: DISABLED┃PRODUCTION┃TEST

Parámetros

Nombre Tipo Opcional Descripción
operationalStatus String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withOperationName(operationName)

Used to filter connector functions by operation name. If Connector Function type is REQUEST, this field is mandatory and defined name must be an operation name available for specified Api Key. If the type is COLLECTION or RESPONSE, this field must be null.

Parámetros

Nombre Tipo Opcional Descripción
operationName String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withPayloadType(payloadType)

Enum of allowed types for connector function's payload data. Request Connector Functions only accept JSON. Allowed: TEXT┃JSON┃BINARY

Parámetros

Nombre Tipo Opcional Descripción
payloadType String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withSouthCriterias(southCriterias)

Connector Function selection criteria for operation responses and data collection. This field is mandatory if Connector Function type is COLLECTION or RESPONSE. ⮕ [ each string can represent an URI, topic, OID… ]. Each string can represent an URI, topic, OID…

Parámetros

Nombre Tipo Opcional Descripción
southCriterias Array

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


withType(type)

Type of connector function, this is mandatory. Keep in mind that you will be not allowed to modify it. Allowed: COLLECTION┃REQUEST┃RESPONSE

Parámetros

Nombre Tipo Opcional Descripción
type String

Retorna

Tip

Tipo: ConnectorFunctionsCatalog


Connector Functions Catalog

This class allows you to make GET requests to the connector functions catalog resource in the OpenGate North API.

getConnectorFunctionsCatalog()

Get connector functions catalog

Retorna

Tip

Tipo: Promise


Connector Functions Catalog Finder

This class allows you to make GET requests to a connector functions catalog resource in the OpenGate North API.

findByConnectorFunctionsId(connectorFunctionId)

Reading a Connector Function from catalog

Parámetros

Nombre Tipo Opcional Descripción
connectorFunctionId String

Retorna

Tip

Tipo: Promise


Subsections of configuration

Connector Functions

This is a base object that contains everything you can do with ConnectorFunctions.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

create()

Create a new Connector Function

Retorna

Tip

Tipo: Promise


delete()

Deletes the selected connector function

Retorna

Tip

Tipo: Promise


update()

Updates a connector function

Retorna

Tip

Tipo: Promise


withChannel(channel)

Set the channel attribute

Parámetros

Nombre Tipo Opcional Descripción
channel string required field

Retorna

Tip

Tipo: ConnectorFunctions


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: ConnectorFunctions


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: ConnectorFunctions


withJavascript(javascript)

Set the javascript attribute

Parámetros

Nombre Tipo Opcional Descripción
javascript string

Retorna

Tip

Tipo: ConnectorFunctions


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: ConnectorFunctions


withNorthCriterias(criterias)

Set the north criterias attribute

Parámetros

Nombre Tipo Opcional Descripción
criterias array

Retorna

Tip

Tipo: ConnectorFunctions


withOperationalStatus(operationalStatus)

Set the operational status attribute

Parámetros

Nombre Tipo Opcional Descripción
operationalStatus boolean

Retorna

Tip

Tipo: ConnectorFunctions


withOperationName(operationName)

Set the operation name attribute

Parámetros

Nombre Tipo Opcional Descripción
operationName string required field

Retorna

Tip

Tipo: ConnectorFunctions


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: ConnectorFunctions


withPayloadType(payloadType)

Set the payload type attribute

Parámetros

Nombre Tipo Opcional Descripción
payloadType string

Retorna

Tip

Tipo: ConnectorFunctions


withSouthCriterias(criterias)

Set the south criterias attribute

Parámetros

Nombre Tipo Opcional Descripción
criterias array

Retorna

Tip

Tipo: ConnectorFunctions


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: ConnectorFunctions


Connector Functions Finder

This class allows you to make GET requests to the ConnectorFunctions resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndChannel(organization, channel)

Performs a get that returns connectors functions related

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
channel string channel.

Retorna

Tip

Tipo: Promise


findByOrganizationAndChannelAndName(organization, channel, name)

Performs a get that returns connectors functions related

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
channel string channel.
name string Connector function name

Retorna

Tip

Tipo: Promise


Connector Functions Helper

This class allows you to make GET requests to the ConnectorFunctionsHelper resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getDocJavascriptFunctions()

Performs a get that returns documentation of javascript functions from rules service

Retorna

Tip

Tipo: Promise


getDocPrivateJavascriptFunctions()

Performs a get that returns documentation private of javascript functions from rules service

Retorna

Tip

Tipo: Promise


Subsections of datasets

Dataset Finder

This class allow make get request to DatasetFinder resource into Opengate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Performs a get that returns list of datasets

Parámetros

Nombre Tipo Opcional Descripción
organization string organization

Retorna

Tip

Tipo: Promise


findByOrganizationAndDatasetId(organization, datasetId)

Performs a get that returns a definition of dataset

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
datasetId string dataset identifier

Retorna

Tip

Tipo: Promise


findByOrganizationAndName(organization, name)

Performs a get that returns a definition of timeserie

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
name string timeserie name

Retorna

Tip

Tipo: Promise


Datasets

This is the base object for working with Datasets.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

optimizationPlan()

Request optimization plan

Retorna

Tip

Tipo: Promise


withColumns(columns)

Set the columns attribute

Parámetros

Nombre Tipo Opcional Descripción
columns array required field

Retorna

Tip

Tipo: Datasets


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Datasets


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Datasets


withIdentifierColumn(identifierColumn)

Set the identifierColumn attribute

Parámetros

Nombre Tipo Opcional Descripción
identifierColumn string required field

Retorna

Tip

Tipo: Datasets


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Datasets


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: Datasets


withSorts(sorts)

List of sorting fields

Parámetros

Nombre Tipo Opcional Descripción
sorts array required field

Retorna

Tip

Tipo: Datasets


Subsections of entities

Device Finder

This class allows you to make GET requests to the provisioned device resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

Entity Finder

This class allows you to make GET requests to the provisioned entity resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndId(organization, id, flattened)

Download a specific entity by its organization and id. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
organization string entity organization .
id string entity id.
flattened string flattened response flag.

Retorna

Tip

Tipo: Promise


Subscribers Finder

This class allows you to make GET requests to the provisioned subscribers resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

Subscriptions Finder

This class allows you to make GET requests to the provisioned subscription resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

Ticket Finder

This class allows you to make GET requests to the provisioned ticket resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

Generic Finder

This class allows making GET requests to a resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.
source string Relative url where is located the resource.
reponseJsonData string Relative url where is located the resource. Can be null
error_not_found string String error which will be thrown on not_found error.
serviceBaseURL string base of the uri petition

geocluster

This section covers the Geocluster model and the GeoclusterFinder class used to create, configure and query geoclusters and their features.

Subsections of geocluster

Geocluster

This is a base object that contains everything you can do with geoclusters.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Geocluster


Geocluster Finder

This class allows making GET requests to the geocluster resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findAll()

Find all available geocluster. This execute a GET http method

Retorna

Tip

Tipo: Promise


findById(id)

Find a specify geocluster by an identifier. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Identifier of the geocluster.

Retorna

Tip

Tipo: Promise


findFeatures(id, { zoom, topRight, bottomLeft })

Find features inside the coordinates. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Identifier of the geocluster.
coordinates Object square defined by the coordinates and the zoom used to find the inside features .

Retorna

Tip

Tipo: Promise


Internal Open Gate API

This is an abstract class. It must be extended by another class that defines the backend, and it is used to make requests to the OpenGate North API from a browser or a Node.js server.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
_options { url: string,port: string,version: string,apiKey: string} this is configuration about Opengate North API.
ampliaREST AmpliaREST this is a backend selected to manage a request to Opengate North API.

administrativeStateSearchBuilder()

This returns a AdministrativeStateSearchBuilder to build a specific AdministrativeStateSearchBuilder

Retorna

Tip

alarmsSearchBuilder()

This returns a AlarmsSearchBuilder to build a specific AlarmsSearch

Retorna

Tip

allowedResourceTypeSearchBuilder()

This returns a AllowedResourceTypeSearchBuilder to build a specific AllowedResourceTypeSearchBuilder

Retorna

Tip

areasBuilder()

This returns a AreasBuilder to build a specific area

Retorna

Tip

Tipo: Areas


areasSearchBuilder()

This returns a AreasSearchBuilder to build a specific AreasSearch

Retorna

Tip

assetsSearchBuilder()

This returns a AssetsSearchBuilder to build a specific AssetSearch

Retorna

Tip

bulkExecutionBuilder(organization, processorId, timeout)

This returns a util to create a bulk execution

Retorna

Tip

bulkExecutionSearchBuilder()

This returns a BulkExecutionSearchBuilder to build a specific bulk

Retorna

Tip

bulkSearchBuilder()

This returns a BulkSearchBuilder to build a specific BulkSearchBuilder

Retorna

Tip

bundlesBuilder()

This returns a BundlesBuilder to build a specific BundlesBuilder

Retorna

Tip

Tipo: Bundles


bundlesSearchBuilder()

This returns a BundlesSearchBuilder to build a specific BundlesSearchBuilder

Retorna

Tip

certificatesBuilder()

This returns a util to create a certificate

Retorna

Tip

Tipo: Certificates


certificatesSearchBuilder()

This returns a CertificatesSearchBuilder to build a specific CertificatesSearchBuilder

Retorna

Tip

channelsBuilder()

This returns a ChannelsBuilder to build a specific WorkgroupsSearch

Retorna

Tip

Tipo: Channels


channelsSearchBuilder()

This returns a ChannelsSearchBuilder to build a specific ChannelsSearch

Retorna

Tip

commsModuleMessageMessageBuilder()

Retorna

Tip

communicationsModuleTypeSearchBuilder()

This returns a CommunicationsModuleTypeSearchBuilder to build a specific CommunicationsModuleTypeSearch

Retorna

Tip

connectorFunctionsBuilder(organization, channel, identifier, connectorFunctionData)

This returns a ConnectorFunctions

Retorna

Tip

connectorFunctionsCatalogBuilder(identifier, connectorFunctionsCatalog)

Parámetros

Nombre Tipo Opcional Descripción
identifier String only update or delete
connectorFunctionsCatalog Object

Retorna

Tip

countryCodesSearchBuilder()

This returns a CountryCodesSearchBuilder to build a specific CountryCodesSearchBuilder

Retorna

Tip

datamodelsBuilder(organization)

This returns a Datamodels to build a specific Datamodels

Retorna

Tip

Tipo: Datamodels


datamodelsHelper(organization, datamodel)

This returns a DatamodelsHelper to build a specific DatamodelsHelper

Retorna

Tip

datamodelsSearchBuilder()

This returns a DatamodelsSearchBuilder to build a specific DatamodelsSearchBuilder

Retorna

Tip

datapointsBuilder()

This returns a datapointsBuilder to build a specific Datapoint

Retorna

Tip

Tipo: Datapoint


datapointsSearchBuilder()

This returns a DatapointsSearchBuilder to build a specific DatapointsSearchBuilder

Retorna

Tip

datasetEntitiesSearchBuilder(organization, dataset)

This returns a DatasetEntitiesSearchBuilder to build a specific DatasetEntitiesSearch

Retorna

Tip

datasetsBuilder()

This returns a DatasetBuilder to build a specific dataset

Retorna

Tip

Tipo: Datasets


datasetsCatalogSearchBuilder()

This returns a DatasetsCatalogSearchBuilder to build a specific DatasetsCatalogSearc

Retorna

Tip

datasetSearchBuilder(organization, dataset)

This returns a DatasetSearchBuilder to build a specific DatasetSearch

Retorna

Tip

datastreamBuilder()

This returns a datastreamBuilder to build a specific Datastream

Retorna

Tip

Tipo: Datastream


datastreamsBuilder()

This returns a datastream to build a specific Datastream

Retorna

Tip

Tipo: DatastreamsBuilder


datastreamsSearchBuilder()

This returns a DatastreamsSearchBuilder to build a specific DatastreamsSearchBuilder

Retorna

Tip

deviceMessageBuilder()

This returns a DevicesSouth to build a specific DevicesSouth

Retorna

Tip

devicePlansBuilder(organization)

This returns a DevicePlans to build a specific device plan

Parámetros

Nombre Tipo Opcional Descripción
organization *

Retorna

Tip

devicesSearchBuilder()

This returns a DevicesSearchBuilder to build a specific DeviceSearch

Retorna

Tip

entitiesSearchBuilder()

This returns a EntitiesSearchBuilder to build a specific EntitiesSearch

Retorna

Tip

executionsHistorySearchBuilder()

This returns a ExecutionsHistorySearchBuilder to build a specific ExecutionsSearch

Retorna

Tip

executionsSearchBuilder()

This returns a ExecutionsSearchBuilder to build a specific ExecutionsSearch

Retorna

Tip

feedsSearchBuilder()

This returns a FeedsSearchBuilder to build a specific FeedsSearchBuilder

Retorna

Tip

fieldsDefinitionSearchBuilder()

This returns a FieldsDefinitionSearchBuilder to build a specific FieldsDefinitionSearchBuilder

Retorna

Tip

geoclusterBuilder()

This returns a util to regenerate geloclouster

Retorna

Tip

Tipo: Geocluster


hardwareMessageBuilder()

Retorna

Tip

Tipo: Hardware


ioTDatastreamAccessSearchBuilder()

This returns a IoTDatastreamAccessSearchBuilder to build a specific IoTDatastreamAccessSearchBuilder

Retorna

Tip

ioTDatastreamPeriodSearchBuilder()

This returns a IoTDatastreamPeriodSearchBuilder to build a specific IoTDatastreamPeriodSearchBuilder

Retorna

Tip

ioTDatastreamStoragePeriodSearchBuilder()

This returns a IoTDatastreamStoragePeriodSearchBuilder to build a specific IoTDatastreamStoragePeriodSearchBuilder

Retorna

Tip

manufacturerModelsBuilder(manufacturerIdentifier)

This returns a ManufacturerModelsBuilder to build a specific ManufacturerModelsBuilder

Retorna

Tip

Tipo: ManufacturerModelsBuilder


manufacturersBuilder()

This returns a ManufacturersBuilder to build a specific ManufacturersBuilder

Retorna

Tip

Tipo: ManufacturersBuilder


mobileMessageMessageBuilder()

Retorna

Tip

Tipo: Mobile


mobilePhoneProviderSearchBuilder()

This returns a MobilePhoneProviderSearchBuilder to build a specific MobilePhoneProviderTypeSearch

Retorna

Tip

newAreaFinder()

This returns a util to find a area

Retorna

Tip

Tipo: AreaFinder


newBulkExecutionFinder()

This returns a util to find summary and download a bulk executions

Retorna

Tip

Tipo: BulkFinder


newBulkFinder()

This returns a util to find and download a bulk

Retorna

Tip

Tipo: BulkFinder


newBundleFinder()

This returns a util to find a bundle

Retorna

Tip

Tipo: BundleFinder


newCertificateFinder(organization, channel, name)

This return a util to launch actions on a rule This return a util to find a certificate

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name of the rule
channel string channel name of the rule
name string rule name

Retorna

Tip

newChannelFinder()

This returns a util to find a channel

Retorna

Tip

newConnectorFunctionsCatalog()

This returns a ConnectorFunctionsCatalog

Retorna

Tip

newConnectorFunctionsCatalogFinder()

This returns a ConnectorFunctionsCatalogFinder

Retorna

Tip

newConnectorFunctionsFinder()

This returns a ConnectorFunctionsFinder

Retorna

Tip

newConnectorFunctionsHelper()

This returns a ConnectorFunctionsHelper

Retorna

Tip

newCountriesCatalog()

This returns a util to find countries catalog

Retorna

Tip

newDatamodelsFinder()

This returns a util to find a datamodel

Retorna

Tip

newDatasetFinder()

This returns a to find Dataset configuration

Retorna

Tip

newDeviceFinder()

This returns a util to find a device

Retorna

Tip

Tipo: DeviceFinder


newDevicePlansFinder()

This returns a util to find device plans

Retorna

Tip

newDomainsFinder()

This returns a util to find a domains hierarchy

Retorna

Tip

Tipo: DomainsFinder


newFilterBuilder()

This returns a util to create your own filter to make searching

Retorna

Tip

newGeoclusterFinder()

This returns a util to find a user

Retorna

Tip

newManufacturersFinder()

This returns a util to find a hardware manufacturer

Retorna

Tip

newModelFinder()

This returns a util to find a hardware model

Retorna

Tip

Tipo: ModelFinder


newNotebookFinder()

This returns a util to find notebooks

Retorna

Tip

newNotebookSchedulerFinder()

This returns a util to find notebooks schedulers

Retorna

Tip

Tipo: NotebookSchedulerFinder


newOperationActions(operationId)

This returns a util to operation actions on an operation

Parámetros

Nombre Tipo Opcional Descripción
operationId string identifier of operation

Retorna

Tip

newOperationFinder()

This returns a util to find a operation

Retorna

Tip

newOperationTypeCatalog()

This returns a util to find Operation Types Templates

Retorna

Tip

Tipo: OperationTypeCatalog


newOperationTypeFinder()

This returns a util to find Operation Types

Retorna

Tip

newOrganizationFinder()

This returns a util to find a organization

Retorna

Tip

newOrganizationManufacturersFinder()

This returns a util to find a hardware manufacturer

Retorna

Tip

Tipo: OrganizationManufacturerFinder


newOrganizationModelFinder()

This returns a util to find a hardware model

Retorna

Tip

Tipo: OrganizationModelFinder


newOrganizationPlansFinder()

This returns a util to find organization plans

Retorna

Tip

newPeriodicityActions(taskId)

This returns a util to manage actions over periodicities

Parámetros

Nombre Tipo Opcional Descripción
taskId string identifier of operation

Retorna

Tip

newProvisionProcessorsFinder()

This returns a util to find a provision procesor

Retorna

Tip

Tipo: ProvisionProcessorsFinder


newRuleConfigurationsCatalog()

This returns a util to find Rule Configurations Templates

Retorna

Tip

newRuleConfigurationsFinder()

This returns a util to find Rule Configurations

Retorna

Tip

newRuleConfigurationsHelper()

This returns a util RuleConfigurationsHelper

Retorna

Tip

newScheduleHistoryFinder()

This returns a util to view schedule history

Retorna

Tip

newScheduleImageExecutionFinder()

This returns a util to view schedule image executions

Retorna

Tip

newSchedulePipelineFinder()

This returns a util to view schedule pipelines

Retorna

Tip

newScheduleRestRequestFinder()

This returns a util to view schedule rest requests

Retorna

Tip

newSelectBuilder()

This returns a util to create your own select to make searching

Retorna

Tip

newSoftwareFinder()

This returns a util to find an organization software

Retorna

Tip

newSubscribersFinder()

This returns a util to find a Subscriber

Retorna

Tip

newSubscriptionsFinder()

This returns a util to find a Subscription

Retorna

Tip

newTicketFinder()

This returns a util to find a ticket

Retorna

Tip

Tipo: TicketFinder


newTimeserieFinder()

This returns a to find Timeserie configuration

Retorna

Tip

Tipo: TimeserieFinder


newTimeseriesFunctionFinder()

This returns a util to find a timeseries function

Retorna

Tip

Tipo: TimeseriesFunctionsFinder


newTimeseriesFunctionsHelper()

This returns a TimeseriesFunctionsHelper

Retorna

Tip

newUserFinder()

This returns a util to find a user

Retorna

Tip

Tipo: UserFinder


newWorkgroupFinder()

This returns a util to find a workgroup

Retorna

Tip

newWorkgroupRelationsFinder()

This returns a WorkgroupRelationsFinder

Retorna

Tip

notebookLauncherBuilder()

This returns a NotebookLauncherBuilder to build a specific NotebookLauncherBuilder

Retorna

Tip

Tipo: NotebookLauncherBuilder


notebookSchedulerBuilder()

This returns a NotebookSchedulerBuilder to build a specific NotebookSchedulerBuilder

Retorna

Tip

Tipo: NotebookSchedulerBuilder


operationalStatusSearchBuilder()

This returns a OperationalStatusSearchBuilder to build a specific OperationalStatusSearchBuilder

Retorna

Tip

operationsSearchBuilder()

This returns a OperationsSearchBuilder to build a specific ExecutionssSearch

Retorna

Tip

operationTypeBuilder(organization, name, operationTypeObj)

This returns a util to update an Operation Type

Retorna

Tip

operationTypesSearchBuilder()

This returns a OperationTypesSearchBuilder to build a specific OperationTypesSearch

Retorna

Tip

Tipo: OperationTypesSearchBuilder


organizationManufacturerModelsBuilder(organization, manufacturerIdentifier)

This returns a OrganizationManufacturerModelsBuilder to build a specific OrganizationManufacturerModelsBuilder

Retorna

Tip

Tipo: OrganizationManufacturerModelsBuilder


organizationManufacturersBuilder(organization)

This returns a OrganizationManufacturersBuilder to build a specific OrganizationManufacturersBuilder

Retorna

Tip

Tipo: OrganizationManufacturersBuilder


organizationPlansBuilder(organization)

This returns a OrganizationPlans to build a specific organization plan

Parámetros

Nombre Tipo Opcional Descripción
organization *

Retorna

Tip

organizationsBuilder()

This returns a OrganizationsBuilder to build a specific OrganizationsBuilder

Retorna

Tip

organizationsSearchBuilder()

This returns a util to search organizations

Retorna

Tip

powerSupplyMessageBuilder()

Retorna

Tip

Tipo: PowerSupply


provisionProcessorsBuilder()

This returns a ProvisionsProcesorsBuilder to build a specific ProvisionsProcesorsBuilder

Retorna

Tip

Tipo: provisionProcessorsBuilder


qratingsBuilder()

This returns a Qrating to build a specific Qrating

Retorna

Tip

Tipo: QratingsBuilder


rawSearchBuilder()

Create custom search with custom url and raw filter

Retorna

Tip

resourceTypeSearchBuilder()

This returns a ResourceTypeSearchBuilder to build a specific ResourceTypeSearchBuilder

Retorna

Tip

ruleConfigurationBuilder(organization, channel, name, ruleConfigObj)

This returns a util to update a Rule Configuration

Retorna

Tip

rulesSearchBuilder()

This returns a RulesSearchBuilder to build a specific RulesSearch

Retorna

Tip

scheduleImageExecutionBuilder()

This returns a util to build schedule image executions

Retorna

Tip

schedulePipelineBuilder()

This returns a util to build a pipeline

Retorna

Tip

Tipo: SchedulePipeline


scheduleRestRequestBuilder()

This returns a util to build schedule rest requests

Retorna

Tip

Tipo: RestRequest


serviceGroupSearchBuilder()

This returns a ServiceGroupSearchBuilder to build a specific ServiceGroupSearchBuilder

Retorna

Tip

softwareMessageBuilder()

Retorna

Tip

Tipo: Software


softwaresBuilder(organization)

This returns a SoftwaresBuilder to build a specific SoftwaresBuilder

Retorna

Tip

Tipo: SoftwaresBuilder


softwaresSearchBuilder()

This returns a SoftwaresSearchBuilder to build a specific SoftwaresSearchBuilder

Retorna

Tip

storageMessageBuilder()

Retorna

Tip

Tipo: Storage


subscriberMessageBuilder()

Retorna

Tip

Tipo: SubscriberMessage


subscribersSearchBuilder()

This returns a SubscribersSearchBuilder to build a specific DeviceSearch

Retorna

Tip

subscriptionMessageBuilder()

Retorna

Tip

Tipo: SubscriptionMessage


subscriptionsSearchBuilder()

This returns a SubscriptionsSearchBuilder to build a specific DeviceSearch

Retorna

Tip

tasksSearchBuilder()

This returns a TasksSearchBuilder to build a specific TasksSearch

Retorna

Tip

ticketPrioritySearchBuilder()

This returns a TicketPrioritySearchBuilder to build a specific TicketPrioritySearchBuilder

Retorna

Tip

ticketSeveritySearchBuilder()

This returns a TicketSeveritySearchBuilder to build a specific TicketSeveritySearchBuilder

Retorna

Tip

ticketsSearchBuilder()

This returns a TicketsSearchBuilder to build a specific TicketSearch


ticketStatusSearchBuilder()

This returns a TicketStatusSearchBuilder to build a specific TicketStatusSearchBuilder

Retorna

Tip

timeserieDatasetBuilder(organization, timeserie)

This returns a TimeserieDatasetBuilder to build a specific TimeserieDataset

Retorna

Tip

timeserieDownsamplerBuilder(organization, timeserie, entityId)

This returns a TimeserieDownsamplerBuilder to build a specific TimeserieDownsampler

Retorna

Tip

timeseriesBuilder()

This returns a TimeserieBuilder to build a specific timeserie

Retorna

Tip

Tipo: Timeseries


timeserieSearchBuilder(organization, timeserie)

This returns a TimeserieSearchBuilder to build a specific TimeserieSearch

Retorna

Tip

timeseriesFunctionBuilder(organization, identifier)

This returns a TimeserieBuilder to build a specific timeserie

Retorna

Tip

timezoneSearchBuilder()

This returns a TimezoneSearchBuilder to build a specific TimezoneSearchBuilder

Retorna

Tip

usageMessageBuilder()

Retorna

Tip

Tipo: Usage


userLanguagesSearchBuilder()

This returns a UserLanguagesSearchBuilder to build a specific UserLanguagesSearchBuilder

Retorna

Tip

userProfilesSearchBuilder()

This returns a UserProfilesSearchBuilder to build a specific UserProfilesSearchBuilder

Retorna

Tip

usersBuilder()

This returns a util to create a user

Retorna

Tip

Tipo: User


usersSearchBuilder()

This returns a UsersSearchBuilder to build a specific UsersSearch

Retorna

Tip

workgroupRelationsBuilder()

This returns a WorkgroupRelationsBuilder to build a specific workgroup relation

Retorna

Tip

workgroupsBuilder()

This returns a WorkgroupsBuilder to build a specific workgroup

Retorna

Tip

Tipo: Workgroups


workgroupsSearchBuilder()

This returns a WorkgroupsSearchBuilder to build a specific WorkgroupsSearch

Retorna

Tip

Subsections of iot

Subsections of catalog

Category

Defines the builder used to configure a category of a datamodel, including the datastreams it groups.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.
identifier identifier of category
datastreams Array of category

addDatastream(datastream)

Add a datastream to the category

Parámetros

Nombre Tipo Opcional Descripción
datastream Object json object

Retorna

Tip

Tipo: Category


addDatastreams(datastreams)

Add a datastreams to the category

Parámetros

Nombre Tipo Opcional Descripción
datastreams Object of datastream json object

Retorna

Tip

Tipo: Category


Datastream

Defines the builder used to configure a datastream of an IoT datamodel.

addQrating(qrating)

Set the qrating attribute. Use {Qrating} utility for create this object

Parámetros

Nombre Tipo Opcional Descripción
qrating Object

Retorna

Tip

Tipo: Datastream


build()

Build a Datastream json object

Retorna

Tip

Tipo: Object
Datastream json object

Ejemplos

ogapi.DatastreamsBuilder().build()

withAccess(access)

Set the access object. Possible values: [READ, WRITE], [READ], [WRITE], []

Parámetros

Nombre Tipo Opcional Descripción
access Array

Retorna

Tip

Tipo: Datastream


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Datastream


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Datastream


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Datastream


withPeriod(period)

Set the period attribute. Possible values: PULSE, CUMULATIVE, INSTANT

Parámetros

Nombre Tipo Opcional Descripción
period string required field

Retorna

Tip

Tipo: Datastream


withSchema(schema)

Set the schema object attribute.

Parámetros

Nombre Tipo Opcional Descripción
schema Object

Retorna

Tip

Tipo: Datastream


withStorage(period, total)

Set the storage object.

Parámetros

Nombre Tipo Opcional Descripción
period string
total number

Retorna

Tip

Tipo: Datastream


withTags(tags)

Set the tags attribute.

Parámetros

Nombre Tipo Opcional Descripción
tags Array

Retorna

Tip

Tipo: Datastream


withUnit(type, label, symbol)

Set the unit object attribute

Parámetros

Nombre Tipo Opcional Descripción
type string required field
label string required field
symbol string required field

Retorna

Tip

Tipo: Datastream


Qrating

Defines the builder used to configure the quality rating (Qrating) of a datastream in an IoT datamodel.

build()

Build a Qrating json object

Retorna

Tip

Tipo: Object
Datastream json object

Ejemplos

ogapi.QratingsBuilder().build()

withConversionMatrix(conversionMatrix)

Set the conversionMatrix attribute

Parámetros

Nombre Tipo Opcional Descripción
conversionMatrix Object

Retorna

Tip

Tipo: Qrating


withCumulativePeriodDivisor(cumulativePeriodDivisor)

Set the cumulativePeriodDivisor attribute

Parámetros

Nombre Tipo Opcional Descripción
cumulativePeriodDivisor string

Retorna

Tip

Tipo: Qrating


withIdeal(label, value)

Set the ideal attribute

Parámetros

Nombre Tipo Opcional Descripción
label string required field
value number required field

Retorna

Tip

Tipo: Qrating


withMaxAllowed(label, value)

Set the maxAllowed attribute

Parámetros

Nombre Tipo Opcional Descripción
label string required field
value number required field

Retorna

Tip

Tipo: Qrating


withMaxDesired(label, value)

Set the maxDesired attribute

Parámetros

Nombre Tipo Opcional Descripción
label string required field
value number required field

Retorna

Tip

Tipo: Qrating


withMaxScore(maxScore)

Set the maxScore attribute

Parámetros

Nombre Tipo Opcional Descripción
maxScore number required field

Retorna

Tip

Tipo: Qrating


withMinDesired(label, value)

Set the minDesired attribute

Parámetros

Nombre Tipo Opcional Descripción
label string required field
value number required field

Retorna

Tip

Tipo: Qrating


withMinRequired(label, value)

Set the minRequired attribute

Parámetros

Nombre Tipo Opcional Descripción
label string required field
value number required field

Retorna

Tip

Tipo: Qrating


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: Qrating


Subsections of datamodels

Datamodels

This is a base object for creating an IoT Datamodel.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string Organization where the IoT datamodel will be created

addAllowedResourceType(resourceType)

Set the addAllowedResourceType attribute

Parámetros

Nombre Tipo Opcional Descripción
resourceType string required field

Retorna

Tip

Tipo: Datamodels


addCategory(category, datastreams)

Add a flavor. If the field datastreams have value, they will add to this flavor

Parámetros

Nombre Tipo Opcional Descripción
category Object
datastreams Array

Retorna

Tip

Tipo: Datamodels


addDatastream(category, datastream)

Add a datastream to the indicated category

Parámetros

Nombre Tipo Opcional Descripción
category string
datastream object

Retorna

Tip

Tipo: Datamodels


delete()

Delete not supported on this builder. Use IoTDatamodelHelper instead.


update()

Update not supported on this builder. Use IoTDatamodelHelper instead.


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Datamodels


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Datamodels


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Datamodels


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: Datamodels


Datamodels Finder

This class allows making GET requests to the IoT datamodel resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndId(organization, id)

Download a specific IoT Datamodel by its organization and id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
organization string datamodel organization .
id string datamodel id.

Retorna

Tip

Tipo: Promise


Datamodels Helper

This is a base object for updating and deleting an IoT Datamodel.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string Organization where the IoT datamodel was create
datamodel object Json object of IoT datamodel to modify or delete.

addCategory(category, datastreams)

Add a category. If the field datastreams have value, they will add to this category

Parámetros

Nombre Tipo Opcional Descripción
category Object
datastreams Array

Retorna

Tip

Tipo: DatamodelsHelper


addDatastream(category, datastream)

Add a datastream to the indicated category

Parámetros

Nombre Tipo Opcional Descripción
category string
datastream object

Retorna

Tip

Tipo: DatamodelsHelper


create()

Create not supported on this builder. Use IoTDatamodelHelper instead.


removeCategory(category)

Remove category

Parámetros

Nombre Tipo Opcional Descripción
category string

Retorna

Tip

Tipo: DatamodelsHelper


removeDatastream(category, id_datastream)

Remove datastream to the indicated category

Parámetros

Nombre Tipo Opcional Descripción
category string
id_datastream string of datastream

Retorna

Tip

Tipo: DatamodelsHelper


updateCategory(old_category, new_category)

Update category name

Parámetros

Nombre Tipo Opcional Descripción
old_category string name
new_category string name

Retorna

Tip

Tipo: DatamodelsHelper


updateDatastream(category, id_datastream, datastream)

Update datastream to the indicated category

Parámetros

Nombre Tipo Opcional Descripción
category string
id_datastream string of datastream
datastream Object json object

Retorna

Tip

Tipo: DatamodelsHelper


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: DatamodelsHelper


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Datamodels


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: DatamodelsHelper


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: DatamodelsHelper


Subsections of manufacturers

Manufacturer Finder

This class allows you to make GET requests to the hardware manufacturers resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findAll()

Download all manufacturers. This executes a GET HTTP method

Retorna

Tip

Tipo: Promise


findById(identifier)

Download a specific manufacturer by its id. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
identifier string manufacturer identifier .

Retorna

Tip

Tipo: Promise


findMediaById(manufacturerId, mediaIdentifier)

Download a specific manufacturer media by its ids. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturerId string manufacturer identifier .
mediaIdentifier string media identifier.

Retorna

Tip

Tipo: Promise


findMedias(manufacturerId)

Download manufacturer medias. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturerId string manufacturer identifier .

Retorna

Tip

Tipo: Promise


Manufacturer Media

This is a base object that contains everything you can do with ManufacturerMedia.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

create(rawFile)

This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a deployment element

Parámetros

Nombre Tipo Opcional Descripción
rawFile File this File is the deployment element

Retorna

Tip

Tipo: Promise


withFile(file)

Set the file attribute

Parámetros

Nombre Tipo Opcional Descripción
file string required field

Retorna

Tip

Tipo: ManufacturerMedia


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: ManufacturerMedia


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: ManufacturerMedia


Manufacturers

This is a base object that contains everything you can do with Manufacturers.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withAddress(address)

Set the address attribute

Parámetros

Nombre Tipo Opcional Descripción
address string

Retorna

Tip

Tipo: Manufacturers


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Manufacturers


withEmail(email)

Set the email attribute

Parámetros

Nombre Tipo Opcional Descripción
email string

Retorna

Tip

Tipo: Manufacturers


withFax(fax)

Set the fax attribute

Parámetros

Nombre Tipo Opcional Descripción
fax string

Retorna

Tip

Tipo: Manufacturers


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Manufacturers


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Manufacturers


withNotes(notes)

Set the notes attribute

Parámetros

Nombre Tipo Opcional Descripción
notes string

Retorna

Tip

Tipo: Manufacturers


withTelephone(telephone)

Set the telephone attribute

Parámetros

Nombre Tipo Opcional Descripción
telephone string

Retorna

Tip

Tipo: Manufacturers


withUrl(url)

Set the url attribute

Parámetros

Nombre Tipo Opcional Descripción
url string

Retorna

Tip

Tipo: Manufacturers


Model Finder

This class allows you to make GET requests to the hardware models resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByManufacturer(manufacturer)

Download all models from a manufacturer. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturer string manufacturer id .

Retorna

Tip

Tipo: Promise


findByManufacturerAndId(manufacturer, identifier)

Download a specific model by its id. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturer string manufacturer id .
identifier string model name .

Retorna

Tip

Tipo: Promise


findMediaByManufacturerAndModelAndId(manufacturer, modelId, mediaIdentifier)

Download a specific model media by its ids. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturer string manufacturer id .
modelId string model identifier .
mediaIdentifier string media identifier.

Retorna

Tip

Tipo: Promise


findMediasByManufacturerAndModel(manufacturer, identifier)

Download a specific model media by its ids. This executes a GET HTTP method

Parámetros

Nombre Tipo Opcional Descripción
manufacturer string manufacturer id .
identifier string model identifier .

Retorna

Tip

Tipo: Promise


Model Media

This is a base object that contains everything you can do with ModelMedia.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

create(rawFile)

This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a deployment element

Parámetros

Nombre Tipo Opcional Descripción
rawFile File this File is the deployment element

Retorna

Tip

Tipo: Promise


withFile(file)

Set the file attribute

Parámetros

Nombre Tipo Opcional Descripción
file string required field

Retorna

Tip

Tipo: ModelMedia


withFileName(fileName)

Set the file name attribute

Parámetros

Nombre Tipo Opcional Descripción
fileName string required field

Retorna

Tip

Tipo: ModelMedia


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: ModelMedia


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: ModelMedia


Models

This is a base object that contains everything you can do with Models.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Models


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Models


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Models


withNotes(notes)

Set the notes attribute

Parámetros

Nombre Tipo Opcional Descripción
notes string

Retorna

Tip

Tipo: Models


withUrl(url)

Set the url attribute

Parámetros

Nombre Tipo Opcional Descripción
url string

Retorna

Tip

Tipo: Models


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string

Retorna

Tip

Tipo: Models


Subsections of notebookScheduler

Notebook Finder

This class allows making GET requests to the planner resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findAll()

Download a complete list of notebooks for the user. This execute a GET http method

Retorna

Tip

Tipo: Promise


Notebook Launcher

This is the base object for everything you can do with a notebook launcher.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

generateReport(generateReport)

Sets the generateReport attribute

Parámetros

Nombre Tipo Opcional Descripción
generateReport boolean

Retorna

Tip

Tipo: NotebookLauncher


withIdentifier(identifier)

Sets the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string

Retorna

Tip

Tipo: NotebookLauncher


withReportRetentionDays(reportRetentionDays)

Sets the reportRetentionDays attribute

Parámetros

Nombre Tipo Opcional Descripción
reportRetentionDays number

Retorna

Tip

Tipo: NotebookLauncher


Notebook Scheduler

This is the base object for everything you can do with a notebook scheduler.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

generateReport(generateReport)

Sets the generateReport attribute

Parámetros

Nombre Tipo Opcional Descripción
generateReport boolean

Retorna

Tip

Tipo: NotebookScheduler


withCronPattern(cronPattern)

Sets the crontab pattern

Parámetros

Nombre Tipo Opcional Descripción
cronPattern string

Retorna

Tip

Tipo: NotebookScheduler


withIdentifier(identifier)

Sets the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string

Retorna

Tip

Tipo: NotebookScheduler


withNotebookId(notebookId)

Sets the notebookId attribute

Parámetros

Nombre Tipo Opcional Descripción
notebookId string

Retorna

Tip

Tipo: NotebookScheduler


withReportRetentionDays(reportRetentionDays)

Sets the reportRetentionDays attribute

Parámetros

Nombre Tipo Opcional Descripción
reportRetentionDays number

Retorna

Tip

Tipo: NotebookScheduler


Scheduler Finder

This class allows making GET requests to the planner resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findAll()

Download a complete list of notebook schedulers for the user. This execute a GET http method

Retorna

Tip

Tipo: Promise


Subsections of operations

Subsections of catalog

Append Entities By

Utility used by BaseOperationBuilder to append target entities in three different ways: by filter, by tags, or by entity list.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
parent BaseOperationBuilder this is a instance of BaseOperationBuilder

filter(filter, resourceType)

Append filter to operation target

Parámetros

Nombre Tipo Opcional Descripción
filter FilterBuilder
resourceType string

Retorna

Tip

Tipo: BaseOperationBuilder


list(entities)

Append entity list to operation target

Parámetros

Nombre Tipo Opcional Descripción
entities EntityListBuilder

Retorna

Tip

Tipo: BaseOperationBuilder


tag(tag)

Set tag to operation target

Parámetros

Nombre Tipo Opcional Descripción
tag string

Retorna

Tip

Tipo: BaseOperationBuilder


Base Operation Builder

Defines the builder used to configure and execute an operation defined in the catalog.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
config object this is configuration about operation.

build()

Build an instance of Operation

Retorna

Tip

Tipo: Operation

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().build()

executeAtDate(date, active)

The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder.

Parámetros

Nombre Tipo Opcional Descripción
date Date
active boolean If active is false, an operation is created in paused

Retorna

Tip

Tipo: BaseOperationBuilder|CronExpressionBuilder


executeEach(date, name, end, active, description)

The operation will execute with a period that you must define with ExecuteEachBuilder

Parámetros

Nombre Tipo Opcional Descripción
date Date Date when operation will be executed
name string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date
active boolean If active is false, an operation is created in paused
description string Description associated to periodicity

Retorna

Tip

Tipo: ExecuteEachBuilder


executeEvery(date, name, end, active, description)

The operation will execute with a period that you must define with ExecuteEveryBuilder

Parámetros

Nombre Tipo Opcional Descripción
date Date Date when operation will be executed
name string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date
active boolean If active is false, an operation is created in paused
description string Description associated to periodicity

Retorna

Tip

Tipo: ExecuteEveryBuilder


executeIDLE()

The operation will be created in IDLE state

Retorna

Tip

Tipo: BaseOperationBuilder


executeImmediately()

The operation will be executed immediately.

Retorna

Tip

Tipo: BaseOperationBuilder


executeLater(minutes, active)

The operation will be created with delayed start or if you not pass any argument then the method return a cron expression builder.

Parámetros

Nombre Tipo Opcional Descripción
minutes number
active boolean If active is false, an operation is created in paused

Retorna

Tip

Tipo: BaseOperationBuilder|CronExpressionBuilder


withAckTimeout(milliseconds, format)

Set ackTimeout to operation.

Parámetros

Nombre Tipo Opcional Descripción
milliseconds number
format string Can be 'milliseconds'

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withAckTimeout(11)

withCallback(url)

Set a callback to operation. If it is set also will be set notify with true value

Parámetros

Nombre Tipo Opcional Descripción
url string If null then parameter will be removed into builder

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withCallback("http://my.web")

withJobTimeout(milliseconds, format)

Set a timeout of job.

Parámetros

Nombre Tipo Opcional Descripción
milliseconds number if null then parameter will be removed into builder
format string Can be 'milliseconds'

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withJobTimeout(180)

withNotes(notes)

Set notes to operation

Parámetros

Nombre Tipo Opcional Descripción
notes string If null then parameter will be removed into builder

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withNotes("own notes")

withOperationRetries(operationRetries)

Set operation retries

Parámetros

Nombre Tipo Opcional Descripción
operationRetries Array

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withOperationRetries(11)

withParameters(parameters)

Set parameters of the operation

Parámetros

Nombre Tipo Opcional Descripción
parameters object

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withParameters({ param1: 'value1', param2: 'value2'})

withRetries(retriesNumber)

Set number of retries that operation will have.

Parámetros

Nombre Tipo Opcional Descripción
retriesNumber number

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withRetries(2)

withRetriesDelay(milliseconds, format)

Set delay between operation retries.

Parámetros

Nombre Tipo Opcional Descripción
milliseconds number
format string Can be 'milliseconds'

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withRetriesDelay(11)

withScatteringMaxSpread(percentage)

Set a scattering max spread to operation.

Parámetros

Nombre Tipo Opcional Descripción
percentage number if null then parameter will be removed into builder

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withScatteringMaxSpread(20)

withScatteringStrategy(factor, warningMaxRate)

Set a scattering strategy to operation.

Parámetros

Nombre Tipo Opcional Descripción
factor number if null then parameter will be removed into builder
warningMaxRate number

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withScatteringStrategy(20,4)

withTimeout(milliseconds, format)

Set timeout to operation.

Parámetros

Nombre Tipo Opcional Descripción
milliseconds number
format string Can be 'milliseconds'

Retorna

Tip

Tipo: BaseOperationBuilder

Ejemplos

ogapi.operations.builderFactory.newXXXBuilder().withTimeout(11)

Operation

This is an abstract class; it must be extended by another class that defines the specific request. This class is responsible for managing execute-operation requests to OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is a base url resource
postObj object it will be sent as a data on post action

execute()

This invoke a request to OpenGate North API and the callback is managed by promises

Retorna

Tip

Tipo: Promise


updatePeriodicity()

This invoke a request to OpenGate North API and the callback is managed by promises

Retorna

Tip

Tipo: Promise


Subsections of parameters

Base Parameter Builder With Parent

This class generates a builder from dynamic content describing a specific parameter of an operation.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
config object this is configuration about parameter operation.
parent BaseOperationBuilder this is a instance of BaseOperationBuilder

build()

This has all knowledge to make a object.

Retorna

Tip

Tipo: object


buildAndAppend()

This method will invoke build and then it will append the parameter to operationBuilder with the correct way

Retorna

Tip

Tipo: BaseOperationBuilder


Parameter Builder Factory

This class generates all the operation parameter builders from the “parameters” attribute in the operation’s configuration JSON.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
parameters object this is configuration about parameter operation.
parent BaseOperationBuilder this is a instance of BaseOperationBuilder

Subsections of period

Execute Each Builder

Defines the builder used to configure the periodicity of an operation. With this builder you can select how the operation repeats: by days, hours, or minutes.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date

days(days)

Set a difference of days in each repetition

Parámetros

Nombre Tipo Opcional Descripción
days number

Retorna

Tip

Tipo: BaseOperationBuilder


hours(hours)

Set a difference of hours in each repetition

Parámetros

Nombre Tipo Opcional Descripción
hours number

Retorna

Tip

Tipo: BaseOperationBuilder


minutes(minutes)

Set a difference of minutes in each repetition

Parámetros

Nombre Tipo Opcional Descripción
minutes number

Retorna

Tip

Tipo: BaseOperationBuilder


Execute Every Builder

Defines the builder used to configure the periodicity of an operation. With this builder you can select the period by day, week, month, or year.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity

day()

Every day at time defined will be the pattern

Retorna

Tip

Tipo: BaseOperationBuilder


month(months)

Each month at time and day defined will be the pattern

Parámetros

Nombre Tipo Opcional Descripción
months array months on will be execute the operation

Retorna

Tip

Tipo: ByMonth


Subsections of pattern

By Generic

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date

By Month

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity
months array Months on will be execute the operation
or number Date} end - When periodicity ends. By repetitions or by date

day(day)

At this day will be executed the operation

Parámetros

Nombre Tipo Opcional Descripción
day number

Retorna

Tip

Tipo: BaseOperationBuilder


By Week

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date

days(days)

At this days will be executed the operation

Parámetros

Nombre Tipo Opcional Descripción
days array

Retorna

Tip

Tipo: BaseOperationBuilder


By Year

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent BaseOperationBuilder this is a operationBaseBuilder.
date Date Date when operation will be executed
periodicityName string Name associated to periodicity
or number Date} end - When periodicity ends. By repetitions or by date

day(day)

At this day will be executed the operation

Parámetros

Nombre Tipo Opcional Descripción
day number

Retorna

Tip

Tipo: BaseOperationBuilder


month(month)

At this month will be executed the operation

Parámetros

Nombre Tipo Opcional Descripción
month string

Retorna

Tip

Tipo: BaseOperationBuilder|ByYear


Periodicity Update Builder

executeEach(date, end)

The operation will execute with a period that you must define with ExecuteEachBuilder

Parámetros

Nombre Tipo Opcional Descripción
date Date Date when operation will be executed
or number Date} end - When periodicity ends. By repetitions or by date

Retorna

Tip

Tipo: ExecuteEach


executeEvery(date, end)

The operation will execute with a period that you must define with ExecuteEveryBuilder

Parámetros

Nombre Tipo Opcional Descripción
date Date Date when operation will be executed
or number Date} end - When periodicity ends. By repetitions or by date

Retorna

Tip

Tipo: ExecuteEvery


Operation Actions

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
operationId string Identifier of the operation on which the action will be carried out

active()

This invoke a request to OpenGate North API and the callback is managed by promises This function active an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newOperationActions("xxxxx-xxx-xxxx-xxxxx").active()

activePeriodicity()

This invoke a request to OpenGate North API and the callback is managed by promises This function active periodicity of an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newOperationActions("xxxxx-xxx-xxxx-xxxxx").activePeriodicity()

cancel()

This invoke a request to OpenGate North API and the callback is managed by promises This function cancels an operation

Retorna

Tip

Tipo: Promise

Ejemplos

Actions("xxxxx-xxx-xxxx-xxxxx").cancel();

cancelPeriodicity()

This invoke a request to OpenGate North API and the callback is managed by promises This function cancel the periodicity of an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").cancelPeriodicity();

changeCallback(url)

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses (if it was active), updates the callback and passes the operation to the initial state (if activated, activated again)

Parámetros

Nombre Tipo Opcional Descripción
url string

Retorna

Tip

Tipo: promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").changeCallback("http://[your_application_address]/[your_URI]")

executeLater(minutes)

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses (if it was active), updates the delay and passes the operation to the initial state (if activated, activated again)

Parámetros

Nombre Tipo Opcional Descripción
minutes number

Retorna

Tip

Tipo: promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").executeLater(10)

executeNow()

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses the operation, updates its delay to zero, and activates it so it executes immediately

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").executeNow()

pause()

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").pause()

pausePeriodicity()

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses the periodicity of an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.OperationActions("xxxxx-xxx-xxxx-xxxxx").pausePeriodicity()

Operation Finder

This class allows making GET requests to the operation resource in OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findById(id)

Download a specific operation by its id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Operation id.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newOperationFinder().findById('xxx-xx-xxx-xxx').then().catch();

findExecutionsById(id, size, start)

Download a specific executions of an operation by its id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Operation id.
size number Defined the number of elements on response
start number Defined the offset on response

Retorna

Tip

Tipo: Promise


findPeriodicityById(id)

Download information of peridodicitiy of a specific operation by its id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Operation id.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newOperationFinder().findPeriodicityById('xxx-xx-xxx-xxx').then().catch();

findPeriodicityByPeriodicityId(periodicityId)

Download information of periodicitiy by its id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
periodicityId string Periodicity id.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newOperationFinder().findPeriodicityByPeriodicityId('xxx-xx-xxx-xxx').then().catch();

Operations

This class generates all operation builders from a response obtained by searching the catalog/operations resource.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.

builderByOperationName(name)

Create a builder to create an operation

Parámetros

Nombre Tipo Opcional Descripción
name String name of the operation to be created

Retorna

Tip

Tipo: Promise


updatePeriodicityBuilder(operationId)

Create a builder to update the periodicity of an operation

Parámetros

Nombre Tipo Opcional Descripción
operationId String identifier of the operation to be updated~

Retorna

Tip

Tipo: Promise


Periodicity Actions

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
taskId string Identifier of the periodicity on which the action will be carried out

activate()

This invoke a request to OpenGate North API and the callback is managed by promises This function active periodicity of an operation

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.newPeriodicityActions("xxxxx-xxx-xxxx-xxxxx").activate()

cancel()

This invoke a request to OpenGate North API and the callback is managed by promises This function cancel a periodicity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.periodicityActions("xxxxx-xxx-xxxx-xxxxx").cancelPeriodicity();

pause()

This invoke a request to OpenGate North API and the callback is managed by promises This function pauses a periodicity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.periodicityActions("xxxxx-xxx-xxxx-xxxxx").pausePeriodicity()

Subsections of operationTypes

Operation Type

This is a base object that contains all you can do about OperationType.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

applicableTo(applicableTo)

Allows the modification of the applicableTo

Parámetros

Nombre Tipo Opcional Descripción
applicableTo array

Retorna

Tip

Tipo: OperationType


create()

Create a new Rule

Retorna

Tip

Tipo: Promise


delete()

Deletes the selected RuleConfiguration

Retorna

Tip

Tipo: Promise


fromCatalog(fromCatalog)

Set the catalog

Parámetros

Nombre Tipo Opcional Descripción
fromCatalog string

Retorna

Tip

Tipo: OperationType


update()

Udpate a Rule

Retorna

Tip

Tipo: Promise


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: OperationType


withHistoryTtl(historyTtl)

Allows the modification of the operation history retention (TTL). If it is not set, the platform default is applied.

Parámetros

Nombre Tipo Opcional Descripción
historyTtl `@param {number} historyTtl.value - amount of retention time, minimum 1
* @param {string} historyTtl.unit - time unit: days, hours, months or years
*` object with the amount of retention time and its unit, e.g. { value: 30, unit: 'days' }

Retorna

Tip

Tipo: OperationType


withIdentifier(name)

Set the name for update attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: OperationType


withModels(models)

Allows the modification of the allowed models

Parámetros

Nombre Tipo Opcional Descripción
models array

Retorna

Tip

Tipo: OperationType


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: OperationType


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: OperationType


withParameters(parameters)

Allows the modification of the parameters

Parámetros

Nombre Tipo Opcional Descripción
parameters array

Retorna

Tip

Tipo: OperationType


withProfiles(profiles)

Allows the modification of the profiles allowed

Parámetros

Nombre Tipo Opcional Descripción
profiles array

Retorna

Tip

Tipo: OperationType


withSteps(steps)

Allows the modification of the steps

Parámetros

Nombre Tipo Opcional Descripción
steps array

Retorna

Tip

Tipo: OperationType


withTitle(title)

Set the title attribute

Parámetros

Nombre Tipo Opcional Descripción
title string required field

Retorna

Tip

Tipo: OperationType


Operation Type Finder

This class allows making GET requests to the OperationType resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndName(organization, name)

Performs a get that returns operation type

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
name string Rule Configuration name

Retorna

Tip

Tipo: Promise


Operation Types Catalog

This class allows making GET requests to the OperationType resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getOperationTypes()

Performs a get that returns operation types templates

Retorna

Tip

Tipo: Promise


Subsections of organization_manufacturer

Manufacturer Finder

This class allows making GET requests to the hardware manufacturers resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

administrable()

Marks visibility administrable for manufacturer list retrieval

Retorna

Tip

Tipo: this


assignable()

Marks visibility assignable for manufacturer list retrieval

Retorna

Tip

Tipo: this


findByOrganization(organization)

Retrieves all manufacturer from a organization

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .

Retorna

Tip

Tipo: Promise


findByOrganizationAndId(organization, identifier)

Retrieves a specific manufacturer

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .
identifier string manufacturer name .

Retorna

Tip

Tipo: Promise


Manufacturers

This is a base object that contains all you can do about Manufacturers.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withAddress(address)

Set the address attribute

Parámetros

Nombre Tipo Opcional Descripción
address string

Retorna

Tip

Tipo: Manufacturers


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Manufacturers


withEmail(email)

Set the email attribute

Parámetros

Nombre Tipo Opcional Descripción
email string

Retorna

Tip

Tipo: Manufacturers


withFax(fax)

Set the fax attribute

Parámetros

Nombre Tipo Opcional Descripción
fax string

Retorna

Tip

Tipo: Manufacturers


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Manufacturers


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Manufacturers


withNotes(notes)

Set the notes attribute

Parámetros

Nombre Tipo Opcional Descripción
notes string

Retorna

Tip

Tipo: Manufacturers


withTelephone(telephone)

Set the telephone attribute

Parámetros

Nombre Tipo Opcional Descripción
telephone string

Retorna

Tip

Tipo: Manufacturers


withUrl(url)

Set the url attribute

Parámetros

Nombre Tipo Opcional Descripción
url string

Retorna

Tip

Tipo: Manufacturers


Model Finder

This class allows making GET requests to the hardware models resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndManufacturerAndId(organization, manufacturer, identifier)

Download a specific model by its id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
organization string model organization .
manufacturer string model manufacturer .
identifier string model name .

Retorna

Tip

Tipo: Promise


Models

This is a base object that contains all you can do about Models.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Models


withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Models


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Models


withNotes(notes)

Set the notes attribute

Parámetros

Nombre Tipo Opcional Descripción
notes string

Retorna

Tip

Tipo: Models


withUrl(url)

Set the url attribute

Parámetros

Nombre Tipo Opcional Descripción
url string

Retorna

Tip

Tipo: Models


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string

Retorna

Tip

Tipo: Models


organization_software

This section covers the Software model and the SoftwareFinder class used to create, configure and query hardware software resources associated with an organization.

Subsections of organization_software

Software Finder

This class allows making GET requests to the hardware software resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

administrable()

Marks visibility administrable for software list retrieval

Retorna

Tip

Tipo: this


assignable()

Marks visibility assignable for software list retrieval

Retorna

Tip

Tipo: this


findByOrganization(organization)

Retrieves all software from a organization

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .

Retorna

Tip

Tipo: Promise


findByOrganizationAndId(organization, identifier)

Retrieves a specific software

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .
identifier string software name .

Retorna

Tip

Tipo: Promise


Softwares

This is a base object that contains everything you can do with Softwares.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withIdentifier(id)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field

Retorna

Tip

Tipo: Softwares


withModels(models)

Set the model attribute

Parámetros

Nombre Tipo Opcional Descripción
models Array

Retorna

Tip

Tipo: Softwares


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Softwares


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: Softwares


withVersion(version)

Set the version attribute

Parámetros

Nombre Tipo Opcional Descripción
version string required field

Retorna

Tip

Tipo: Softwares


Subsections of organizations

Domain Finder

This class allows making GET requests to the domains resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByNameWithHierarchy(name)

Constructor

Parámetros

Nombre Tipo Opcional Descripción
name string domain name.

Retorna

Tip

Tipo: Promise


Organization Finder

This class allows making GET requests to the organization resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByDomainAndWorkgroup(domain, workgroup)

Performs a get that returns organizations related

Parámetros

Nombre Tipo Opcional Descripción
domain string domain
workgroup string workgroup.

Retorna

Tip

Tipo: Promise


findByName(name)

Find a specify organization by a name. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
name string Organization name

Retorna

Tip

Tipo: Promise


Organizations

This is a base object that contains everything you can do with Organizations.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withAuth(auth)

Sets the auth security configuration

Parámetros

Nombre Tipo Opcional Descripción
auth object

Retorna

Tip

Tipo: Organizations


withCountryCode(countryCode)

Set the country code attribute

Parámetros

Nombre Tipo Opcional Descripción
countryCode string

Retorna

Tip

Tipo: Organizations


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Organizations


withDomain(domain)

Set the parent domain

Parámetros

Nombre Tipo Opcional Descripción
domain string

Retorna

Tip

Tipo: Organizations


withLangCode(langCode)

Set the lang code attribute

Parámetros

Nombre Tipo Opcional Descripción
langCode string

Retorna

Tip

Tipo: Organizations


withLocation(latitude, longitude)

Sets the map location attribute

Parámetros

Nombre Tipo Opcional Descripción
latitude number
longitude number

Retorna

Tip

Tipo: Organizations


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Organizations


withOnlyAssignedDomainCertificates(onlyDomainCerts)

Set the onlyAssignedDomainCertificates attribute

Parámetros

Nombre Tipo Opcional Descripción
onlyDomainCerts boolean required field

Retorna

Tip

Tipo: Organizations


withPasswordPolicy(passPolicy)

Sets the password poliicy configuration

Parámetros

Nombre Tipo Opcional Descripción
passPolicy object

Retorna

Tip

Tipo: Organizations


withPlan(plan)

Set the plan attribute

Parámetros

Nombre Tipo Opcional Descripción
plan string

Retorna

Tip

Tipo: Organizations


withTimeZone(timeZone)

Set the time zone attribute

Parámetros

Nombre Tipo Opcional Descripción
timeZone string

Retorna

Tip

Tipo: Organizations


withZoom(zoom)

Sets the map zoom attribute

Parámetros

Nombre Tipo Opcional Descripción
zoom number

Retorna

Tip

Tipo: Organizations


Subsections of plan

Device Plans

This is a base object that contains everything you can do with device plans.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withFlowRate(flowRate)

Set the flowRate attribute

Parámetros

Nombre Tipo Opcional Descripción
flowRate object {value: number, unit: [SECONDS, MINUTES, HOURS, DAYS, MONTHS, YEARS]}

Retorna

Tip

Tipo: OrganizationPlans


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: DevicePlans


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: DevicePlans


Device Plans Finder

This class allows making GET requests to the organization device plans resource in the OpenGate North API.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

administrable()

Marks visibility administrable for organization device plans list retrieval. ogapi.newDevicePlansFinder().administrable().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


assignable()

Marks visibility assignable for organization device plans list retrieval ogapi.newDevicePlansFinder().assignable().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


default()

Marks visibility default for organization device plans list list retrieval. ogapi.newDevicePlansFinder().default().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


findByOrganization(organization)

Retrieves all device plans from a organization ogapi.newDevicePlansFinder().findByOrganization('organization').then().catch();

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .

Retorna

Tip

Tipo: Promise


findByOrganizationAndId(organization, identifier)

Retrieves a specific device plan from a organization ogapi.newDevicePlansFinder().findByOrganizationAndId('organization', 'identifier').then().catch();

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .
identifier string plan name.

Retorna

Tip

Tipo: Promise


Organization Plans

This is a base object that contains everything you can do with organization plans.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withFlowRate(flowRate)

Set the flowRate attribute

Parámetros

Nombre Tipo Opcional Descripción
flowRate object {value: number, unit: [SECONDS, MINUTES, HOURS, DAYS, MONTHS, YEARS]}

Retorna

Tip

Tipo: OrganizationPlans


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: OrganizationPlans


withMaxDeviceAmount(maxDeviceAmount)

Set the maxDeviceAmount attribute

Parámetros

Nombre Tipo Opcional Descripción
maxDeviceAmount object optional and greater than 0

Retorna

Tip

Tipo: OrganizationPlans


withMaxStorageLifeTime(maxStorageLifeTime)

Set the maxStorageLifeTime attribute

Parámetros

Nombre Tipo Opcional Descripción
maxStorageLifeTime object required field: {total: number, period: [SECONDS, MINUTES, HOURS, DAYS, MONTHS, YEARS]}

Retorna

Tip

Tipo: OrganizationPlans


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: OrganizationPlans


Organization Plans Finder

This class allows making GET requests to the organization plans resource in the OpenGate North API.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

administrable()

Marks visibility administrable for organization plans list retrieval. ogapi.newOrganizationPlansFinder().administrable().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


assignable()

Marks visibility assignable for organization plans list retrieval ogapi.newOrganizationPlansFinder().assignable().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


default()

Marks visibility default for plans list list retrieval. ogapi.newOrganizationPlansFinder().default().findByOrganization('organization').then().catch();

Retorna

Tip

Tipo: this


findByOrganization(organization)

Retrieves all plans from a organization ogapi.newOrganizationPlansFinder().findByOrganization('organization').then().catch();

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .

Retorna

Tip

Tipo: Promise


findByOrganizationAndId(organization, identifier)

Retrieves a specific plan from a organization ogapi.newOrganizationPlansFinder().findByOrganizationAndId('organization', 'identifier').then().catch();

Parámetros

Nombre Tipo Opcional Descripción
organization string organization name .
identifier string plan name.

Retorna

Tip

Tipo: Promise


Subsections of provision

Base Provision

This is an abstract class; it must be extended by another class that defines the specific actions of a given provision. This class is responsible for managing requests to OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is a base url resource
timeout number timeout on request
requiredParameters array
serviceBaseURL string base of the uri petition

create()

This invoke a request to OpenGate North API and the callback is managed by promises This function creates a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().create()

delete(body)

This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().withName('delete_organization').delete();
ogapi.usersBuilder().withEmail('delete@user.com').delete();
ogapi.certificatesBuilder().withId('d3l3t3-c3rt1f1c4t3').delete();

update()

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().update()

Subsections of bulk

Bulk Execution Builder

This builder gives you the tools necessary to create bulk executions using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI required field. This is ogapi instance
organization string required field. This is the organization name
processorId string required field. This is the provision processor use for bulk provision
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception

bulk(rawFile, extension)

Do a bulk using specific Provision Processor.

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string File`
extension string File format

Ejemplos

ogapi.bulkExecutionBuilder('orgname', 'processorId', 10000).bulk(rawFile, extension)

plan(rawFile, extension, numberOfEntriesToProcess)

Instead of creating a bulk process, returns the provision process planning for the specified entries. This is a synchronous process that does not cause changes in the database.

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string File`
extension string File format
numberOfEntriesToProcess number Number of entries to be processed.

Ejemplos

ogapi.bulkExecutionBuilder('orgname', 'processorId', 10000).plan(rawFile, extension)
 ogapi.bulkExecutionBuilder('orgname', 'processorId', 10000).plan(rawFile, extension, numberOfEntriesToProcess)

Subsections of country

Countries Catalog

This class allows making GET requests to the countries catalog resource in OpenGate North API.

It needs the _internalCountriesFilter client option, and there is no default. It is built that way on purpose: the catalogue is not an endpoint but an asset entity with entityType WIRE and an identifier of the form DOMAIN_<domain>, so the caller has to say which entity to read, the same way it says which api key to use. There is an intention to replace this with a real catalogue endpoint and drop the option again.

new OpenGateAPI({ url, apiKey, _internalCountriesFilter: { organization: ‘myorg’, identifier: ‘DOMAIN_myorg’, ds: ‘provision.administration.countries’ } });

Without it, getCountries() used to die with Cannot read properties of undefined (reading 'organization'), which said nothing about the option that was missing.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getCountries()

Performs a get that returns countries

Retorna

Tip

Tipo: Promise


Subsections of entities

Asset Builder

Asset builder. This builder gives you the necessary tools to create an asset using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string this is the organization name where subscription will be created
allowedDatastreams array Allowed datastreams to add into the new subscription
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

Bulk Builder

This class provides the bulk create, update, patch, and delete operations shared by the CSV and JSON bulk builders.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI required field. This is ogapi instance
resource resource required field. This is the resource used for the bulk provision
extension extension required field. Type of file to send
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception

create(rawFile, csv_response)

Execute the bulk creation operation

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string Blob`
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).create(rawFile)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).create(new Blob(), true)

delete(rawFile, csv_response)

Execute the bulk delete operation

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string Blob`
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).delete(rawFile)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).delete(new Blob(), true)

deleteAll(rawFile, csv_response)

Execute the bulk delete-all operation

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string Blob`
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).deleteAll(rawFile)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).deleteAll(new Blob(), true)

patch(rawFile, csv_response)

Execute the bulk patch operation

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string Blob`
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).update(rawFile)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).update(new Blob(), true)

update(rawFile, csv_response)

Execute the bulk update operation

Parámetros

Nombre Tipo Opcional Descripción
rawFile `string Blob`
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).update(rawFile)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000).update(new Blob(), true)

Complex Builder

This class extends SimpleBuilder to allow setting complex values. What is a complex value? It is simply a value that needs a communications module identifier to be set into the box.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is the resource url where can be create/delete/update/read the entity
allowedDatastreams array Allowed datastreams to add into the new entity
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

withComplex(_id, idCommunicationModules, val)

Set a complex value to entity

Parámetros

Nombre Tipo Opcional Descripción
_id string Datastream identifier
idCommunicationModules string Communications module identifier
val object Value to set.

Csv Bulk Builder

CSV builder. This builder gives you the necessary tools to run a CSV bulk provisioning operation using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI required field. This is ogapi instance
organization string required field. This is the organization name where entities will be created, updated or deleted
resource resource required field. This is the resource used for the bulk provision
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Device Builder

Device builder. This builder gives you the necessary tools to create a device using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string this is the organization name where device will be created
allowedDatastreams array Allowed datastreams to add into the new device
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool
ms number timeout in milliseconds

create()

This invoke a request to OpenGate North API and the callback is managed by promises This function creates a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().create()

update()

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a provisioned entity and checks whether any subscriber/subscription already exists. If a subscriber/subscription does not exist, it will be created and then added to the entity box.

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.entityBuilder.devicesBuilder().update()

Entity Builder

This is a base object that gives you access to everything you can do to provision entities.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

assetsBuilder(organization, timeout)

Get an AssetBuilder to operate with entities of type asset

Parámetros

Nombre Tipo Opcional Descripción
organization string required field
timeout number timeout on request

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.assetsBuilder('orgname').then(function(assetBuilder){//...}).catch()

devicesBuilder(organization, timeout)

Get a DeviceBuilder to operate with entities of type device.

It resolves a builder rather than returning one, because the allowed datastreams and their schemas are read from the platform first. Note that `with()` ignores a datastream the organization does not allow, warning rather than throwing, so a typo in a datastream name produces an entity missing that value rather than an error.

A device that the platform will accept needs more than an identifier. This is a create that works, and every line of it was needed:

```js const builder = await ogapi.entityBuilder.devicesBuilder('sensehat'); await builder .with('provision.device.identifier', 'my-device') // the entity key .with('provision.administration.identifier', 'my-device') .with('provision.administration.organization', 'sensehat') .with('provision.administration.channel', 'default_channel') .with('provision.administration.plan', 'dev__100_per_day') .with('provision.administration.serviceGroup', 'emptyServiceGroup_onSession') .create(); ```

The platform rejects an omission one field at a time, so finding this set means a round trip per missing field:

  • without `plan`: 400 `0x010E10`, "Device plan is mandatory…"
  • without `serviceGroup`: 400 `0x010000`, "Required field."

These are not validated here on purpose. The plan message ties the requirement to the state of the organization, so a client-side rule would refuse calls that other organizations accept. `provision.device.identifier` is different: it is the entity key, and its absence is refused locally with `OGAPI_ENTITY_KEY_REQUIRED`.

List the plans an organization actually has with `ogapi.newDevicePlansFinder().findByOrganization(organization)`.

Parámetros

Nombre Tipo Opcional Descripción
organization string required field
timeout number timeout on request

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.entityBuilder.devicesBuilder('orgname').then(function(deviceBuilder){//...}).catch()

newCsvBulkBuilder(organization, resource, timeout, async)

Get a new CsvBulkBuilder

Parámetros

Nombre Tipo Opcional Descripción
organization string required field.
resource string required field. Type of resource: entities or tickets
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Retorna

Tip

Tipo: CsvBulkBuilder

Ejemplos

ogapi.newCsvBulkBuilder('orgname', 'entities', 10000, false)
 ogapi.newCsvBulkBuilder('orgname', 'entities', 10000, true)

newJsonBulkBuilder(organization, resource, timeout, async)

Get a new JsonBulkBuilder

Parámetros

Nombre Tipo Opcional Descripción
organization string required field.
resource string required field. Type of resource: entities or tickets
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Retorna

Tip

Tipo: JsonBulkBuilder

Ejemplos

ogapi.newJsonBulkBuilder('orgname', 'entities', 10000)

newJsonFlattenedBulkBuilder(organization, resource, timeout, async)

Get a new JsonFlattenedBulkBuilder

Parámetros

Nombre Tipo Opcional Descripción
organization string required field.
resource string required field. Type of resource: entities or tickets
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Retorna

Tip

Tipo: JsonFlattenedBulkBuilder

Ejemplos

ogapi.newJsonFlattenedBulkBuilder('orgname', 'entities', 10000)

subscribersBuilder(organization, timeout)

Get a SubscriberBuilder to operate with entities of type subscriber

Parámetros

Nombre Tipo Opcional Descripción
organization string required field
timeout number timeout on request

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.subscribersBuilder('orgname').then(function(subscriberBuilder){//...}).catch()

subscriptionsBuilder(organization, timeout)

Get a SubscriptionBuilder to operate with entities of type subscription

Parámetros

Nombre Tipo Opcional Descripción
organization string required field
timeout number timeout on request

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.subscriptionsBuilder('orgname').then(function(subscriptionBuilder){//...}).catch()

ticketsBuilder(organization, timeout)

Get a TicketBuilder to operate with entities of type ticket

Parámetros

Nombre Tipo Opcional Descripción
organization string required field
timeout number timeout on request

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.ticketsBuilder('orgname').then(function(ticketBuilder){//...}).catch()

Json Bulk Builder

JSON builder. This builder gives you the necessary tools to run a JSON bulk provisioning operation using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI required field. This is ogapi instance
organization string required field. This is the organization name where entities will be created, updated or deleted
resource resource required field. This is the resource used for the bulk provision
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Json Flattened Bulk Builder

JSON flattened builder. This builder gives you the necessary tools to run a flattened-JSON bulk provisioning operation using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI required field. This is ogapi instance
organization string required field. This is the organization name where entities will be created, updated or deleted
resource resource required field. This is the resource used for the bulk provision
timeout number timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async boolean forces async execution for the bulk operation

Simple Builder

This class allows setting simple values.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is the resource url where can be create/delete/update/read the entity
allowedDatastreams array Allowed datastreams to add into the new entity
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

deleteAll()

This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a provisioned entity

Retorna

Tip

Tipo: Promise


getAllowedDatastreams()

Retorna

Tip

Tipo: array

  • Allowed Datastream definition array

getEntityKey()

Retorna

Tip

Tipo: string

  • Entity identifier

patch()

This invoke a request to OpenGate North API and the callback is managed by promises This function patches a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().update()

update()

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a provisioned entity

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.organizationsBuilder().update()

with(_id, val)

Set new datastream value

Parámetros

Nombre Tipo Opcional Descripción
_id string Datastream identifier
val objecr Datastream value. If this value is null then datastream value will be removed.

Subscriber Builder

Subscriber builder. This builder give you the necessary tools to create a subscriber using our OpenGate REST.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string this is the organization name where subscriber will be created
allowedDatastreams array Allowed datastreams to add into the new subscriber
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

Subscription Builder

Subscription builder. This builder give you the necessary tools to create a subscription using our OpenGate REST.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string this is the organization name where subscription will be created
allowedDatastreams array Allowed datastreams to add into the new subscription
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

Ticket Builder

Ticket builder. This builder gives you the necessary tools to create a ticket using the OpenGate REST API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
organization string this is the organization name where subscription will be created
allowedDatastreams array Allowed datastreams to add into the new subscription
definedSchemas array Jsonschema about all OpenGate specific types
jsonSchemaValidator Validator Json schema validator tool

Provision Generic Finder

This class allows making GET requests to a resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.
source string Relative url where is located the resource.
reponseJsonData string Relative url where is located the resource.
error_not_found string String error which will be thrown on not_found error.

provisionProcessors

This section covers the Provision Processors class, for configuring a provision processor’s script and parameters, and the Provision Processors Finder class, for looking up provision processors by organization.

Subsections of provisionProcessors

Provision Processors

This object represents a provision processor and exposes all the attributes you can configure for it.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withConfigurationParams(configurationParams)

Set the ConfigurationParams attribute

Parámetros

Nombre Tipo Opcional Descripción
configurationParams object required field

Retorna

Tip

Tipo: ProvisionPrecessors


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: ProvisionPrecessors


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: ProvisionPrecessors


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: ProvisionPrecessors


withScriptProcessor(scriptProcessor)

Set the ScriptProcessor attribute

Parámetros

Nombre Tipo Opcional Descripción
scriptProcessor object required field

Retorna

Tip

Tipo: ProvisionPrecessors


provision Processors Finder

This class performs GET requests against the provision processors resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Performs a get that returns list of provision processors

Parámetros

Nombre Tipo Opcional Descripción
organization string organization

Retorna

Tip

Tipo: Promise


findByOrganizationAndProvisionProcessorId(organization, identifier)

Performs a get that returns a definition of provision Processors

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
identifier string Provision Processors identifier

Retorna

Tip

Tipo: Promise


Subsections of rulesConfiguration

Rule Configurations

This is a base object that contains everything you can do with RulesConfigurations.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

create()

Create a new Rule

Retorna

Tip

Tipo: Promise


delete()

Deletes the selected RuleConfiguration

Retorna

Tip

Tipo: Promise


update()

Update a Rule

Retorna

Tip

Tipo: Promise


updateParameters(newParameters)

Update a Rule's parameters

Retorna

Tip

Tipo: Promise


withActions(actions)

Allows the modification of the actions

Parámetros

Nombre Tipo Opcional Descripción
actions object

Retorna

Tip

Tipo: _RuleCondition


withActionsDelay(actionsDelay)

Set the actions delay attribute

Parámetros

Nombre Tipo Opcional Descripción
actionsDelay number

Retorna

Tip

Tipo: RulesConfigurations


withActive(active)

Set the active attribute

Parámetros

Nombre Tipo Opcional Descripción
active boolean

Retorna

Tip

Tipo: RulesConfigurations


withChannel(channel)

Set the channel attribute

Parámetros

Nombre Tipo Opcional Descripción
channel string required field

Retorna

Tip

Tipo: RulesConfigurations


withCondition(conditionFilter)

Allows the modification of a condition

Parámetros

Nombre Tipo Opcional Descripción
conditionFilter string

Retorna

Tip

Tipo: _RuleCondition


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: RulesConfigurations


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: RulesConfigurations


withJavascript(javascript)

Set the javascript attribute

Parámetros

Nombre Tipo Opcional Descripción
javascript string

Retorna

Tip

Tipo: RulesConfigurations


withMode(mode)

Set the mode attribute

Parámetros

Nombre Tipo Opcional Descripción
mode string

Retorna

Tip

Tipo: RulesConfigurations


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: RulesConfigurations


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: RulesConfigurations


withParameters(parameters)

Allows the modification of the actions

Parámetros

Nombre Tipo Opcional Descripción
parameters array

Retorna

Tip

Tipo: _RuleCondition


withType(type)

Set the type attribute

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: RulesConfigurations


Rule Configurations Actions

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
name string Identifier of the ryule configuration to operate

cloneTo(newRuleName, newRuleOpenAction, newRuleCloseAction, newRuleNotifications)

Clones a rule configuration into a new one

Parámetros

Nombre Tipo Opcional Descripción
newRuleName string
newRuleOpenAction boolean
newRuleCloseAction string
newRuleNotifications boolean

Retorna

Tip

Tipo: Promise


Rule Configurations Catalog

This class allows you to make GET requests to the RuleConfigurations resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getTemplates()

Performs a get that returns rule templates

Retorna

Tip

Tipo: Promise


Rule Configurations Finder

This class allows you to make GET requests to the RuleConfigurations resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganizationAndChannelAndName(organization, channel, name)

Performs a get that returns organizations related

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
channel string channel.
name string Rule Configuration name

Retorna

Tip

Tipo: Promise


Rule Configurations Helper

This class allows you to make GET requests to the RuleConfigurationsHelper resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getDocJavascriptFunctions()

Performs a get that returns documentation of javascript functions from rules service

Retorna

Tip

Tipo: Promise


getDocPrivateJavascriptFunctions()

Performs a get that returns documentation private of javascript functions from rules service

Retorna

Tip

Tipo: Promise


Subsections of schedule

History Finder

This class allows making GET requests to the planner resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Download a complete list of scheduler history for the organization. This execute a GET http method

Retorna

Tip

Tipo: Promise


findByOrganizationAndSchedulerId(organization, schedulerId)

Download a complete list of scheduler history for the organization and type selected. This execute a GET http method

Retorna

Tip

Tipo: Promise


findByOrganizationAndType(organization, type)

Download a complete list of scheduler history for the organization and type selected. This execute a GET http method

Retorna

Tip

Tipo: Promise


withLimit(limit)

Marks results limit

Retorna

Tip

Tipo: this


withSchedulerId(schedulerId)

Set parameter schedulerIds

Retorna

Tip

Tipo: this


withSchedulerType(schedulerType)

Set parameter schedulerIds

Retorna

Tip

Tipo: this


Image Execution

This is a base object that represents an image execution step within a scheduled pipeline.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withEnvFrom(imageExecutionEnvFrom)

Sets the env from for imageExecution

Parámetros

Nombre Tipo Opcional Descripción
imageExecutionEnvFrom array

Retorna

Tip

Tipo: ImageExecution


withEnvVars(imageExecutionEnvVars)

Sets the env vars for imageExecution

Parámetros

Nombre Tipo Opcional Descripción
imageExecutionEnvVars object

Retorna

Tip

Tipo: ImageExecution


withIdentifier(identifier)

Sets the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string

Retorna

Tip

Tipo: ImageExecution


withMaxTimeToWaitCallback(asyncResponseMaxTimeToWaitCallback)

Sets the async response with selected timeout

Parámetros

Nombre Tipo Opcional Descripción
asyncResponseMaxTimeToWaitCallback string

Retorna

Tip

Tipo: ImageExecution


withName(imageExecutionName)

Sets the name for imageExecution

Parámetros

Nombre Tipo Opcional Descripción
imageExecutionName string

Retorna

Tip

Tipo: ImageExecution


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string

Retorna

Tip

Tipo: ImageExecution


withScheduleCronExpression(cronExpression, timezone)

Sets the crontab expression for schedule

Parámetros

Nombre Tipo Opcional Descripción
cronExpression string
timezone string

Retorna

Tip

Tipo: ImageExecution


withScheduleExecuteNow(executeNow)

Sets the executeNow attribute

Parámetros

Nombre Tipo Opcional Descripción
executeNow boolean

Retorna

Tip

Tipo: ImageExecution


withScheduleFrom(from)

Sets the from attribute

Parámetros

Nombre Tipo Opcional Descripción
from string

Retorna

Tip

Tipo: ImageExecution


withScheduleMinutesInterval(interval)

Sets the interval for schedule in minutes

Parámetros

Nombre Tipo Opcional Descripción
interval number in minutes

Retorna

Tip

Tipo: ImageExecution


withScheduleTo(to)

Sets the to attribute

Parámetros

Nombre Tipo Opcional Descripción
to string

Retorna

Tip

Tipo: ImageExecution


withTag(imageExecutionTag)

Sets the tag for imageExecution

Parámetros

Nombre Tipo Opcional Descripción
imageExecutionTag string

Retorna

Tip

Tipo: ImageExecution


withTimeout(timeout)

Sets the execution timeout for imageExecution

Parámetros

Nombre Tipo Opcional Descripción
timeout string

Retorna

Tip

Tipo: ImageExecution


Image Execution Finder

This class allows making GET requests to the planner resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Download a complete list of image executions for the organization. This executes a GET HTTP method.

Retorna

Tip

Tipo: Promise


Pipeline

This is a base object that represents a pipeline of image executions and REST requests to run on a schedule.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

addImageExecution(imageExecution)

Adds an Image Execution to the pipeline

Parámetros

Nombre Tipo Opcional Descripción
imageExecution ImageExecution

Retorna

Tip

Tipo: Pipeline


addRestResquest(restRequest)

Adds a rest request to the pipeline

Parámetros

Nombre Tipo Opcional Descripción
restRequest RestRequest

Retorna

Tip

Tipo: Pipeline


withIdentifier(identifier)

Sets the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string

Retorna

Tip

Tipo: Pipeline


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string

Retorna

Tip

Tipo: Pipeline


withScheduleCronExpression(cronExpression, timezone)

Sets the crontab expression for schedule

Parámetros

Nombre Tipo Opcional Descripción
cronExpression string
timezone string

Retorna

Tip

Tipo: Pipeline


withScheduleExecuteNow(executeNow)

Sets the executeNow attribute

Parámetros

Nombre Tipo Opcional Descripción
executeNow boolean

Retorna

Tip

Tipo: Pipeline


withScheduleFrom(from)

Sets the from attribute

Parámetros

Nombre Tipo Opcional Descripción
from string

Retorna

Tip

Tipo: Pipeline


withScheduleMinutesInterval(interval)

Sets the interval for schedule in minutes

Parámetros

Nombre Tipo Opcional Descripción
interval number in minutes

Retorna

Tip

Tipo: Pipeline


withScheduleTo(to)

Sets the to attribute

Parámetros

Nombre Tipo Opcional Descripción
to string

Retorna

Tip

Tipo: Pipeline


Pipeline Finder

This class allows making GET requests to the planner resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Download a complete list of pipelines for the organization. This executes a GET HTTP method.

Retorna

Tip

Tipo: Promise


Rest Request

This is a base object that represents a REST request to run on a schedule.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withAsyncResponseMaxTimeToWaitCallback(asyncResponseMaxTimeToWaitCallback)

Sets the async response with selected timeout

Parámetros

Nombre Tipo Opcional Descripción
asyncResponseMaxTimeToWaitCallback string

Retorna

Tip

Tipo: RestRequest


withBody(restRequestBody)

Sets the body for restRequest

Parámetros

Nombre Tipo Opcional Descripción
restRequestBody string

Retorna

Tip

Tipo: RestRequest


withHeaders(restRequestHeaders)

Sets the header for restRequest

Parámetros

Nombre Tipo Opcional Descripción
restRequestHeaders string

Retorna

Tip

Tipo: RestRequest


withIdentifier(identifier)

Sets the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string

Retorna

Tip

Tipo: RestRequest


withMethod(restRequestMethod)

Sets the method for restRequest

Parámetros

Nombre Tipo Opcional Descripción
restRequestMethod string

Retorna

Tip

Tipo: RestRequest


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string

Retorna

Tip

Tipo: RestRequest


withScheduleCronExpression(cronExpression, timezone)

Sets the crontab expression for schedule

Parámetros

Nombre Tipo Opcional Descripción
cronExpression string
timezone string

Retorna

Tip

Tipo: RestRequest


withScheduleExecuteNow(executeNow)

Sets the executeNow attribute

Parámetros

Nombre Tipo Opcional Descripción
executeNow boolean

Retorna

Tip

Tipo: RestRequest


withScheduleFrom(from)

Sets the from attribute

Parámetros

Nombre Tipo Opcional Descripción
from string

Retorna

Tip

Tipo: RestRequest


withScheduleMinutesInterval(interval)

Sets the interval for schedule in minutes

Parámetros

Nombre Tipo Opcional Descripción
interval number in minutes

Retorna

Tip

Tipo: RestRequest


withScheduleTo(to)

Sets the to attribute

Parámetros

Nombre Tipo Opcional Descripción
to string

Retorna

Tip

Tipo: RestRequest


withSyncResponseTimeout(syncResponseTimeout)

Sets the sync response with selected timeout

Parámetros

Nombre Tipo Opcional Descripción
syncResponseTimeout string

Retorna

Tip

Tipo: RestRequest


withUrl(restRequestUrl)

Sets the url for restRequest

Parámetros

Nombre Tipo Opcional Descripción
restRequestUrl string

Retorna

Tip

Tipo: RestRequest


Rest Request Finder

This class allows making GET requests to the planner resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Download a complete list of REST requests for the organization. This executes a GET HTTP method.

Retorna

Tip

Tipo: Promise


Schedule History Finder

This class allows making GET requests to the planner resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Download a complete list of scheduler history for the organization. This execute a GET http method

Retorna

Tip

Tipo: Promise


findByOrganizationAndType(organization, type)

Download a complete list of scheduler history for the organization. This execute a GET http method

Retorna

Tip

Tipo: Promise


searching

This section documents the search classes, the FilterBuilder and SelectBuilder query builders, and the related search errors.

Subsections of searching

Asset Search

This class extends Search and allows requests to be made to any available resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this defined parameters to order the result of search
group object this defined the group by

execute()

This invokes a request to the OpenGate North API; the response is handled via promises.

Retorna

Tip

Tipo: Promise


Base Search

This is an abstract class that must be extended by another class defining the specific search. This class is responsible for managing and executing requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
resource string this is a base url resource
timeout number timeout on request
serviceBaseURL string base of the uri petition

downloadCsv()

Not implemented yet. This invoke a request to OpenGate North API and the callback is managed by promises This invoke a request to OpenGate North API and the callback is managed by promises

Retorna

Tip

Tipo: Promise


execute()

This invokes a request to the OpenGate North API; the response is handled via promises.

Retorna

Tip

Tipo: Promise


executeWithAsyncPaging(resource)

This invokes a request for asynchronous paging to the OpenGate North API; each page is returned via promises and a notify callback. To cancel the process, return `false` or a string with a custom message from the notify callback. When the process is canceled, the response will be 403: Forbidden -&gt; {data: &#x27;Cancel process&#x27;|| custom_message, statusCode: 403}

Parámetros

Nombre Tipo Opcional Descripción
resource string resource to find.

Retorna

Tip

Tipo: Promise


builder

Subsections of builder

Administrative State Search Builder

Defines a search over the administrative state catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.administrativeStateSearchBuilder().filter({and:[]}).build()

withEntityType(entityType)

Set entityType to search

Parámetros

Nombre Tipo Opcional Descripción
entityType string model name

Retorna

Tip

Tipo: AdministrativeStateSearchBuilder

Ejemplos

ogapi.administrativeStateSearchBuilder().withEntityType('myEntityType').build()

withId(administrativeStateId)

Sets id to search

Parámetros

Nombre Tipo Opcional Descripción
administrativeStateId string specific type id

Retorna

Tip

Tipo: AdministrativeStateSearchBuilder

Ejemplos

ogapi.administrativeStateSearchBuilder().withId('myId').build()

Alarms Search Builder

Defines a search over Alarms.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: AlarmsSearchBuilder

Ejemplos


Allowed Resource Type Search Builder

Defines a search over mobile phone provider catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.AllowedResourceTypeSearchBuilder().build()

withType(type)

Sets type to search

Parámetros

Nombre Tipo Opcional Descripción
type string type to searcg

Retorna

Tip

Tipo: AllowedResourceTypeSearchBuilder

Ejemplos

ogapi.AllowedResourceTypeSearchBuilder().withType('device').build()

Areas Search Builder

Defines a search over Areas.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Assets Search Builder

Defines a search over Assets.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.assetsSearchBuilder().onProvisioned().build()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: AssetsSearchBuilder

Ejemplos


select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: AssetsSearchBuilder

Ejemplos

ogapi.assetsSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.assetsSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "device.temperature.value","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

summary()

The response will only have a summary information

Retorna

Tip

Tipo: AssetsSearchBuilder

Ejemplos

ogapi.assetsSearchBuilder().summary()

Basic Types Search Builder

This is an abstract class; it must be extended by another class that defines the specific search. This class is responsible for managing and executing requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is ogapi instance
timeout number timeout on request

execute()

This invoke a request to OpenGate North API and the callback is managed by promises

Retorna

Tip

Tipo: Promise


withPath(path)

Sets path to search

Parámetros

Nombre Tipo Opcional Descripción
path string jsonSchemaPath

Retorna

Tip

Tipo: BasicTypesSearchBuilder

Ejemplos

ogapi.basicTypesSearchBuilder().withPath('string').build()

withPublicParameters(publicParameters)

Sets publicParameters to search

Parámetros

Nombre Tipo Opcional Descripción
publicParameters boolean boolean

Retorna

Tip

Tipo: BasicTypesSearchBuilder

Ejemplos

ogapi.basicTypesSearchBuilder().withPublicParameters(true).build()

Bulk Execution Search Builder

Searches over all created bulk processes, whether already completed or still in progress.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of WPSearch

Retorna

Tip

Tipo: WPSearch

Ejemplos

ogapi.bulkExecutionSearchBuilder().build()

Bulk Search Builder

Defines a search over bulk entity operations.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Bundles Search Builder

Defines a search over Bundles.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Certificates Search Builder

Defines a search over Certificates.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

administrable()

The search result will have all certificates which can be administered by the user

Retorna

Tip

Tipo: CertificatesSearchBuilder

Ejemplos

ogapi.certificatesSearchBuilder().administrable()

assignable()

The search result will have all certificates which can be assignable to some device ogapi.certificatesSearchBuilder().assignable()

Retorna

Tip

Tipo: CertificatesSearchBuilder


withFetch(flag)

Set fecth value

Parámetros

Nombre Tipo Opcional Descripción
flag flag

Retorna

Tip

Tipo: CertificatesSearchBuilder

Ejemplos

ogapi.certificatesSearchBuilder().withFetch(true)

Channels Search Builder

Defines a search over Channels.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: ChannelsSearchBuilder

Ejemplos

ogapi.channelsSearchBuilder().disableDefaultSorted()

summary()

The response will only have a summary information

Retorna

Tip

Tipo: SearchWithSummaryBuilder

Ejemplos

ogapi.channelsSearchBuilder().summary()

Communications Module Type Search Builder

Defines a search over the communications module type catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.administrativeStateSearchBuilder().filter({and:[]}).build()

withType(communicationsModuleType)

Sets id to search

Parámetros

Nombre Tipo Opcional Descripción
communicationsModuleType string specific type

Retorna

Tip

Tipo: CommunicationsModuleTypeSearchBuilder

Ejemplos

ogapi.communicationsModuleTypeSearchBuilder().withType('GENERIC').build()

Country Codes Search Builder

Defines a search over the country codes catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.countryCodesSearchBuilder().filter({and:[]}).build()

Datamodels Search Builder

Defines a search over Datamodels.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Datapoints Search Builder

Defines a search over Datapoints.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

betweenDates(fromDate, toDate)

Set time window to search

Parámetros

Nombre Tipo Opcional Descripción
fromDate date Add from date
toDate date Add to date

Retorna

Tip

Tipo: DatapointsSearchBuilder

Ejemplos

ogapi.datapointsSearchBuilder().withDeviceId('myDevice').build()

select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.entitiesSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "device.temperature.value","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

withDatastream(datastreamId)

Set datastreamId to search

Parámetros

Nombre Tipo Opcional Descripción
datastreamId string Datastream.id of Datapoint

Retorna

Tip

Tipo: DatapointsSearchBuilder

Ejemplos

ogapi.datapointsSearchBuilder().withDeviceId('myDevice').build()

withDeviceId(deviceId)

Set deviceId to search

Parámetros

Nombre Tipo Opcional Descripción
deviceId string Prov.customId of Device

Retorna

Tip

Tipo: DatapointsSearchBuilder

Ejemplos

ogapi.datapointsSearchBuilder().withDeviceId('myDevice').build()

withFeed(feedId)

Set feedName to search

Parámetros

Nombre Tipo Opcional Descripción
feedId string Datastream.id of Datapoint

Retorna

Tip

Tipo: DatapointsSearchBuilder

Ejemplos

ogapi.datapointsSearchBuilder().withDeviceId('myDevice').build()

Dataset Entities Search Builder

Defines a search over Executions.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.datasetEntitiesSearchBuilder()

disableCaseSensitive(flag)

The response will return a response by applying the filter with likes case-no-sensitive

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos

ogapi.datasetEntitiesSearchBuilder().disableCaseSensitive()

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos

ogapi.datasetEntitiesSearchBuilder().disableDefaultSorted()

flattened()

The response will return a flattened response

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos

ogapi.datasetEntitiesSearchBuilder().flattened()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos


removeCaseSensitive()

The response will return a response by deleteing the parameters with likes case-no-sensitive

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos

ogapi.datasetEntitiesSearchBuilder().disableCaseSensitive()

select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: DatasetEntitiesSearchBuilder

Ejemplos

ogapi.datasetEntitiesSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.datasetEntitiesSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "device.temperature.value","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

Dataset Search Builder

Defines a search over Executions.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.datasetSearchBuilder(organization, datasetId).build()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: DatasetSearchBuilder

Ejemplos


select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: DatasetSearchBuilder

Ejemplos

ogapi.datasetSearchBuilder(organization, datasetId).select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.datasetSearchBuilder(organization, datasetId).select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "device.temperature.value","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

sort(sort)

The search request will use this sort

Parámetros

Nombre Tipo Opcional Descripción
sort (string)

Retorna

Tip

Tipo: DatasetSearchBuilder

Ejemplos


Datasets Catalog Search Builder

Defines a search over Areas.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Datastreams Search Builder

Defines a search over Datastreams.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Devices Search Builder

Defines a search over Devices.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: DevicesSearchBuilder

Ejemplos


summary()

The response will only have a summary information

Retorna

Tip

Tipo: DevicesSearchBuilder

Ejemplos

ogapi.devicesSearchBuilder().summary()

Entities Search Builder

Defines a search over Entities.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.entitiesSearchBuilder()

disableCaseSensitive(flag)

The response will return a response by applying the filter with likes case-no-sensitive

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().disableCaseSensitive()

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().disableDefaultSorted()

flattened()

The response will return a flattened response

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().flattened()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos


removeCaseSensitive()

The response will return a response by deleteing the parameters with likes case-no-sensitive

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().disableCaseSensitive()

select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.entitiesSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "device.temperature.value","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

Executions History Search Builder

Defines a search over Executions.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Executions Search Builder

Defines a search over Executions.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Feeds Search Builder

Defines a search over Feeds.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Fields Definition Search Builder

Defines a search over the fields definition catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.FieldsDefinitionSearchBuilder().build()

withType(fieldDefinitionType)

Sets id to search

Parámetros

Nombre Tipo Opcional Descripción
fieldDefinitionType string specific type

Retorna

Tip

Tipo: fieldsDefinitionSearchBuilder

Ejemplos

ogapi.fieldsDefinitionSearchBuilder().withType('string').build()

Flattened Search Builder

This is an abstract class that extends the base builder to make flattened and summary search requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI this is ogapi instance
routes object this defined the routes. One of those routes must be called on Builder before call build method.

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.devicesSearchBuilder().onProvisioned().build()

flattened()

The response will return a flattened response

Retorna

Tip

Tipo: FlattenedSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().flattened()

Io T Datastream Access Search Builder

Defines a search over the IoT datastream access catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ioTDatastreamAccessSearchBuilder().build()

Io T Datastream Period Search Builder

Defines a search over the IoT datastream period catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ioTDatastreamPeriodSearchBuilder().build()

Io T Datastream Storage Period Search Builder

Defines a search over the IoT datastream storage period catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ioTDatastreamStoragePeriodSearchBuilder().build()

Mobile Phone Provider Search Builder

Defines a search over the mobile phone provider catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Operation Types Builder

Defines a search over operation types.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.devicesSearchBuilder().onProvisioned().build()

Operational Status Search Builder

Defines a search over operational status catalogs.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.operationalStatusSearchBuilder().filter({and:[]}).build()

withEntityType(entityType)

Set entityType to search

Parámetros

Nombre Tipo Opcional Descripción
entityType string model name

Retorna

Tip

Tipo: OperationalStatusSearchBuilder

Ejemplos

ogapi.operationalStatusSearchBuilder().withEntityType('myEntityType').build()

withId(operationalStatusId)

Sets id to search

Parámetros

Nombre Tipo Opcional Descripción
operationalStatusId string operational status id

Retorna

Tip

Tipo: OperationalStatusSearchBuilder

Ejemplos

ogapi.operationalStatusSearchBuilder().withId('myId').build()

Operations Search Builder

Defines a search over executions’ operations.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Organizations Search Builder

Defines a search over organizations.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: OrganizationsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().disableDefaultSorted()

flattened()

The response will return a flattened response

Retorna

Tip

Tipo: OrganizationsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().flattened()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: SearchBuilder

Ejemplos


select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.ticket.identifier", [[{"field": "value","alias": "identifier"}], ), SE.add("device.temperature.value", [[{"field": "value"}]))
 ) // Setting SelectBuilder
 ogapi.ticketsSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "provision.ticket.name","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

summary()

The response will only have a summary information

Retorna

Tip

Tipo: OrganizationsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().summary()

Pre Filtered Search Builder

This is an abstract class. It extends the base builder to make all kinds of summary search requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI this is ogapi instance
routes object this defined the routes. One of those routes must be called on Builder before call build method.

collected()

This option forces search api to add a filter of collected content

Retorna

Tip

Tipo: PreFilteredSearchBuilder

Ejemplos

ogapi.subscribersSearchBuilder().collected()

disableCaseSensitive(flag)

The response will return a response by applying the filter with likes case-no-sensitive

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().disableCaseSensitive()

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: PreFilteredSearchBuilder

Ejemplos

ogapi.assetsSearchBuilder().disableDefaultSorted()

provisioned()

This option forces search api to add a filter of provisioned content

Retorna

Tip

Tipo: PreFilteredSearchBuilder

Ejemplos

ogapi.subscribersSearchBuilder().provisioned()

removeCaseSensitive()

The response will return a response by applying the filter with likes case-no-sensitive

Retorna

Tip

Tipo: EntitiesSearchBuilder

Ejemplos

ogapi.entitiesSearchBuilder().removeCaseSensitive()

select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: PreFilteredSearchBuilder

Ejemplos

ogapi.devicesSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.device.identifier", ["value"], "id"), SE.add("device.temperature.value", ["value"]))
 ) // Setting SelectBuilder
 ogapi.devicesSearchBuilder().select({
     "elements": [
         {"name": "provision.device.identifier","fields": ["value"],"alias": "id"},
         {"name": "device.temperature.value","fields": ["value"]}
     ]
 }) //Custom select

Raw Search Builder

Defines a search over a custom resource with a custom filter.

build()

Create Search instance

Retorna

Tip

Tipo: ``
Search


filter(rawFilter)

Set raw filter

Parámetros

Nombre Tipo Opcional Descripción
rawFilter object raw filter

Retorna

Tip

Tipo: ``
RawSearchBuilder


from(url)

Set custom url

Parámetros

Nombre Tipo Opcional Descripción
url string custom Opengate North API url

Retorna

Tip

Tipo: ``
RawSearchBuilder


limit(rawLimit)

Set raw limit

Parámetros

Nombre Tipo Opcional Descripción
rawLimit object raw limit

Retorna

Tip

Tipo: ``
RawSearchBuilder


Resource Type Search Builder

Defines a search over the resource type catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ResourceTypeSearchBuilder().build()

Rule Configuration Severity Search Builder

Defines a search over the rule configuration severity catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ruleConfigurationSeveritySearchBuilder().build()

Rule Mode Search Builder

Defines a search over the rule mode catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ruleModeSearchBuilder().build()

Rule Type Search Builder

Defines a search over the rule type catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ruleTypeSearchBuilder().build()

Rules Search Builder

Defines a search over Rules.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Search Builder

This is an abstract class. It is the base class for making all kinds of search requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI this is ogapi instance
routes object this defined the routes. One of those routes must be called on Builder before call build method.

addSortAscendingBy(filterField)

Add ascending param into the sort search object

Parámetros

Nombre Tipo Opcional Descripción
filterField string This field must be allowed into the specific resource

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().addSortAscendingBy('prov.customid') // Order by prov.customid Ascending

addSortBy(filterField, typeSort)

Add ascending/descending param into the sort search object

Parámetros

Nombre Tipo Opcional Descripción
filterField string This field must be allowed into the specific resource
typeSort string

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().addSortBy('prov.customid','ASCENDING') // Order by prov.customid Ascending
 ogapi.devicesSearchBuilder().addSortBy('prov.customid','DESCENDING') // Order by prov.customid Descending

addSortDescendingBy(filterField)

Add descending param into the sort search object

Parámetros

Nombre Tipo Opcional Descripción
filterField string This field must be allowed into the specific resource

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.devicesSearchBuilder().addSortDescendingBy('prov.customid') // Order by prov.customid Descending

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.devicesSearchBuilder().onProvisioned().build()

filter(filter)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
filter `(FilterBuilder object)`

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().filter(
     ogapi.newFilterBuilder().and(Ex.like('prov.customid', 'SN32'), Ex.neq('entityId', '1124'))
 ) // Setting FilterBuilder
 ogapi.subscriptionsSearchBuilder().filter(
      {"and": [{"like": {"entityId": "0000000000000001"}}]}
 ) // Custom filter

findAllFields(input)

Return a promise which it will contains an array with fields recommended with complete structure

Retorna

Tip

Tipo: Promise


findFieldPath(field)

Return a promise which it will contains an string with the path of a field

Retorna

Tip

Tipo: Promise


findFields(input)

Return a promise which it will contains an array with fields recommended with only identifier

Retorna

Tip

Tipo: Promise


limit(size, start)

Set reponse pagination.

Parámetros

Nombre Tipo Opcional Descripción
size number Defined the number of elements on response
start number Defined the offset on response

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscribersSearchBuilder().limit(10) // Without offset
 ogapi.subscribersSearchBuilder().limit(25,50) //With offset value 50

removeSortBy(filterField)

Remove sort param from the search object

Parámetros

Nombre Tipo Opcional Descripción
filterField string This field must be allowed into the specific resource

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().removeSortBy('prov.customid') // Remove order by prov.customid
 ogapi.subscriptionsSearchBuilder().removeSortBy() // Remove all order by parameters

withTimeout(ms)

The request will have a specific time out if it will be exceeded then the promise throw an exception

Parámetros

Nombre Tipo Opcional Descripción
ms number timeout in milliseconds

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().withTimeout(2000)

Search With Summary Builder

This is an abstract class. It extends the base builder to make all kinds of summary search requests to the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI this is ogapi instance
routes object this defined the routes. One of those routes must be called on Builder before call build method.

summary()

The response will only have a summary information

Retorna

Tip

Tipo: SearchWithSummaryBuilder

Ejemplos

ogapi.subscriptionsSearchBuilder().summary()

Service Group Search Builder

Defines a search over service group catalogs.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.serviceGroupSearchBuilder().filter({and:[]}).build()

withEntityType(entityType)

Set entityType to search

Parámetros

Nombre Tipo Opcional Descripción
entityType string entity type

Retorna

Tip

Tipo: ServiceGroupSearchBuilder

Ejemplos

ogapi.serviceGroupSearchBuilder().withEntityType('myEntityType').build()

Softwares Search Builder

Defines a search over software entries.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

withHardwareId(hardwareId)

Sets hardware id to search

Parámetros

Nombre Tipo Opcional Descripción
hardwareId string hardware id

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.hardwareSearchBuilder().withHardwareId('myHardware').build()

withId(softwareId)

Sets softwareId to search

Parámetros

Nombre Tipo Opcional Descripción
softwareId string software id

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withId('mySoftwareId').build()

withManufacturer(manufacturerName)

Set feedName to search

Parámetros

Nombre Tipo Opcional Descripción
manufacturerName string manufacturer name

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withManufacturer('myManufacturer').build()

withModel(modelName)

Set modelName to search

Parámetros

Nombre Tipo Opcional Descripción
modelName string model name

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withModel('myModel').build()

withModelVersion(modelVersion)

Set modelVersion to search

Parámetros

Nombre Tipo Opcional Descripción
modelVersion string model version

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withModelVersion('myModelVersion).build()

withName(softwareName)

Set softwareName to search

Parámetros

Nombre Tipo Opcional Descripción
softwareName string software name

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withName('mySoftware').build()

withType(softwareType)

Set softwareType to search

Parámetros

Nombre Tipo Opcional Descripción
softwareType string software version

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withType('mySoftwareType).build()

withVersion(softwareVersion)

Set softwareVersion to search

Parámetros

Nombre Tipo Opcional Descripción
softwareVersion string software version

Retorna

Tip

Tipo: SoftwaresSearchBuilder

Ejemplos

ogapi.softwareSearchBuilder().withVersion('mySoftwareVersion).build()

Subscribers Search Builder

Defines a search over Subscribers.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Subscriptions Search Builder

Defines a search over Subscriptions.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Tasks Search Builder

Defines a search over periodic executions’ operations.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Ticket Priority Search Builder

Defines a search over the ticket priority catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ticketPrioritySearchBuilder().build()

Ticket Severity Search Builder

Defines a search over the ticket severity catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ticketSeveritySearchBuilder().build()

Ticket Status Search Builder

Defines a search over the ticket status catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.ticketStatusSearchBuilder().build()

Tickets Search Builder

Defines a search over Tickets.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

disableDefaultSorted()

The response will return a response without sorted

Retorna

Tip

Tipo: TicketsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().disableDefaultSorted()

flattened()

The response will return a flattened response

Retorna

Tip

Tipo: TicketsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().flattened()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: SearchBuilder

Ejemplos


select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: SearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().select(
     ogapi.newSelectBuilder().add(SE.element("provision.ticket.identifier", [[{"field": "value","alias": "identifier"}], ), SE.add("device.temperature.value", [[{"field": "value"}]))
 ) // Setting SelectBuilder
 ogapi.ticketsSearchBuilder().select({ "elements": [{"name": "provision.device.identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "provision.ticket.name","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

summary()

The response will only have a summary information

Retorna

Tip

Tipo: TicketsSearchBuilder

Ejemplos

ogapi.ticketsSearchBuilder().summary()

Timeserie Dataset Builder

Defines a search over time series datasets.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

addColumn(name, aggregation, alias)

Add column that will be requested

Parámetros

Nombre Tipo Opcional Descripción
name string
aggregation string
alias string

Retorna

Tip

Tipo: TimeserieDatasetBuilder


build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.timeserieDatasetBuilder(organization, timeserieId).build()

columns(columns)

Add columns that will be requested

Parámetros

Nombre Tipo Opcional Descripción
columns array

Retorna

Tip

Tipo: TimeserieDatasetBuilder


select(select)

The search request will have

Parámetros

Nombre Tipo Opcional Descripción
select object

Retorna

Tip

Tipo: TimeserieDatasetBuilder


Timeserie Downsampler Builder

Defines a downsampled search over time series data.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

addColumn(name, interpolation, aggregation, alias)

Add column that will be requested

Parámetros

Nombre Tipo Opcional Descripción
name string
interpolation string
aggregation string
alias string

Retorna

Tip

Tipo: TimeserieDownsamplerBuilder


bucketTime(bucketTime)

The bucket for the downsampling (must be higher than the time series bucket)

Parámetros

Nombre Tipo Opcional Descripción
bucketTime number

Retorna

Tip

Tipo: TimeserieDownsamplerBuilder


build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.timeserieDownsamplerBuilder(organization, timeserieId).build()

columns(columns)

Add columns that will be requested

Parámetros

Nombre Tipo Opcional Descripción
columns array

Retorna

Tip

Tipo: TimeserieDownsamplerBuilder


select(select)

The search request will have this select

Parámetros

Nombre Tipo Opcional Descripción
select object

Retorna

Tip

Tipo: TimeserieDownsamplerBuilder


start(start)

The start time for the downsampling

Parámetros

Nombre Tipo Opcional Descripción
start string

Retorna

Tip

Tipo: TimeserieDownsamplerBuilder


Timeserie Search Builder

Defines a search over time series data.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of Search

Retorna

Tip

Tipo: Search

Ejemplos

ogapi.timeserieSearchBuilder(organization, timeserieId).build()

group(group)

The search request will have this group by

Parámetros

Nombre Tipo Opcional Descripción
group (object)

Retorna

Tip

Tipo: TimeserieSearchBuilder

Ejemplos


select(select)

The search request will have this filter

Parámetros

Nombre Tipo Opcional Descripción
select `(SelectBuilder object)`

Retorna

Tip

Tipo: TimeserieSearchBuilder

Ejemplos

ogapi.timeserieSearchBuilder(organization, timeserieId).select(
     ogapi.newSelectBuilder().add(SE.element("Identifier", ["value"], "id"), SE.add("Temperature", ["value"]))
 ) // Setting SelectBuilder
 ogapi.timeserieSearchBuilder(organization, timeserieId).select({ "elements": [{"name": "Identifier",
	"fields": [{"field": "value","alias": "identifier"}]},
     {"name": "Temperature","fields": [{"field": "value","alias": "identifier"}]}]
  }) //Custom select

sort(sort)

The search request will use this sort

Parámetros

Nombre Tipo Opcional Descripción
sort (string)

Retorna

Tip

Tipo: TimeserieSearchBuilder

Ejemplos


Timezone Search Builder

Defines a search over the timezone catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.timezonesSearchBuilder().filter({and:[]}).build()

User Languages Search Builder

Defines a search over the user languages catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.userLanguagesSearchBuilder().filter({and:[]}).build()

User Profiles Search Builder

Defines a search over the user profiles catalog.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

build()

Build a instance of StaticSearch

Retorna

Tip

Tipo: StaticSearch

Ejemplos

ogapi.userProfileSearchBuilder().filter({and:[]}).build()

withId(userProfileId)

Sets id to search

Parámetros

Nombre Tipo Opcional Descripción
userProfileId string user profile id

Retorna

Tip

Tipo: userProfileSearchBuilder

Ejemplos

ogapi.userProfileSearchBuilder().withId('myId').build()

Users Search Builder

Defines a search over Users.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Workgroups Search Builder

Defines a search over Workgroups.

constructor

Parámetros

Nombre Tipo Opcional Descripción
parent InternalOpenGateAPI Instance of our InternalOpenGateAPI

Device Search

This class extends Search and allows requests to be made to any available resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this defined parameters to order the result of search
group object this defined the group by

execute()

This invokes a request to the OpenGate North API; the response is handled via promises.

Retorna

Tip

Tipo: Promise


Entity Search

This class extends Search and allows requests to be made to any resource under the /entities endpoint of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this define parameters to order the result of search
group object this define parameters to group
select object this define fields to retrieve

execute()

This invokes a request to the OpenGate North API; the response is handled via promises.

Retorna

Tip

Tipo: Promise


error

This section documents the errors thrown by the search builder classes.

Subsections of error

Search Builder Error

This defines a specific error that is thrown by the build method of the search builders.

constructor

Parámetros

Nombre Tipo Opcional Descripción
error string Error description

Filter Builder

constructor

Ejemplos

var fb = ogapi.newFilterBuilder()

and(args)

Parámetros

Nombre Tipo Opcional Descripción
args [Expression] The parameters will be operators of the class Expression

Ejemplos

fb.and(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))

or(args)

Parámetros

Nombre Tipo Opcional Descripción
args [Expression] The parameters will be operators of the class Expression

Ejemplos

fb.or(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))

Search

This class extends BaseSearch and allows requests to be made to any available resource in the OpenGate North API.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this defined parameters to order the result of search
group object
select object
timeout nubmer

Search Without Limit

This class extends BaseSearch and allows requests to be made to any available resource in the OpenGate North API.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this defined parameters to order the result of search
group object
select object
timeout nubmer

Select Builder

constructor

Ejemplos

var sb = ogapi.newSelectBuilder()

add(args)

Parámetros

Nombre Tipo Opcional Descripción
args SelectElement The parameters will be operators of the class SelectElement

Ejemplos

sb.add(Se.element('provision.device.identifier', ['value'], 'identifier'), sb.add(Se.element('device.temperature.value', ['value'])))

Static Search

This class extends Search and allows requests to be made to any available static resource of the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter

execute()

This invokes a dummy request to the OpenGate North API; the response is handled via promises.

Retorna

Tip

Tipo: Promise


WP Search

This class extends BaseSearch and allows requests to be made to any available resource in the OpenGate North API. Use this class when the resource does not have the ‘search’ prefix; otherwise, use the Search class.

constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the search
filter object this is the filter
limit object this is the pagination about the search
sort object this defined parameters to order the result of search
group object
select object
timeout nubmer

Subsections of security

Certificate Finder

This class allows making GET requests to the certificate resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findById(id)

Download a specific certificate by id. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Id of the certificate.

Retorna

Tip

Tipo: Promise


findByIdAndFormat(id, mimetype)

Download a certificate using id and in a specific format. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
id string Id of the certificate.
mimetype string Certificate format mimetype.

Retorna

Tip

Tipo: Promise


Certificates

This is a base object that contains everything you can do with Certificates.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

create(rawFile)

This invokes a request to the OpenGate North API, and the callback is managed via promises. This method creates a certificate element.

Parámetros

Nombre Tipo Opcional Descripción
rawFile File this File is the certificate

Retorna

Tip

Tipo: Promise


update()

This invokes a request to the OpenGate North API, and the callback is managed via promises. This method updates a certificate element.

Retorna

Tip

Tipo: Promise


withAdministrativeState(administrativeState)

Set the administrativeState attribute

Parámetros

Nombre Tipo Opcional Descripción
administrativeState string

Retorna

Tip

Tipo: Certificates


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string optional field

Retorna

Tip

Tipo: Certificates


withDomains(domains)

Set the domains attribute

Parámetros

Nombre Tipo Opcional Descripción
domains Array

Retorna

Tip

Tipo: Certificates


withId(id)

Set the id attribute

Parámetros

Nombre Tipo Opcional Descripción
id string required field on delete

Retorna

Tip

Tipo: Certificates


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Certificates


withParameters(parameters)

Set the parameters attribute

Parámetros

Nombre Tipo Opcional Descripción
parameters string optional field

Retorna

Tip

Tipo: Certificates


withTags(tags)

Set the tags attribute

Parámetros

Nombre Tipo Opcional Descripción
tags Array

Retorna

Tip

Tipo: Certificates


withUsages(usages)

Set the usages attribute

Parámetros

Nombre Tipo Opcional Descripción
usages Array

Retorna

Tip

Tipo: Certificates


Security

This extends BaseProvision and contains everything you can do with Security.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI this is configuration about Opengate North API.
url string this define a specific resource to make the provision

timeseries

This section covers the Timeseries class, for defining and configuring timeseries, and the Timeseries Finder class, for looking up timeseries by organization.

Subsections of timeseries

Timeseries

This object represents a timeseries and exposes all the attributes you can configure for it.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

onlyPlan()

Mark timeseries as plan only

Retorna

Tip

Tipo: Timeseries


optimizationPlan()

Request optimization plan

Retorna

Tip

Tipo: Promise


withBucketColumn(bucketColumn)

Name of generated column with bucket date.Required if timeBucket &gt; 0.

Parámetros

Nombre Tipo Opcional Descripción
bucketColumn string pattern: ^[a-zA-Z0-9 _-]*$

Retorna

Tip

Tipo: Timeseries


withBucketInitColumn(bucketInitColumn)

Name of generated column with bucket init date.

Parámetros

Nombre Tipo Opcional Descripción
bucketInitColumn string pattern: ^[a-zA-Z0-9 _-]*$

Retorna

Tip

Tipo: Timeseries


withColumns(columns)

List of data that is needed for each entity.

Parámetros

Nombre Tipo Opcional Descripción
columns array required field

Retorna

Tip

Tipo: Timeseries


withContext(context)

List of data that is needed for each entity.

Parámetros

Nombre Tipo Opcional Descripción
context array

Retorna

Tip

Tipo: Timeseries


withDescription(description)

Long text to explain timeserie definition

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: Timeseries


withIdentifier(identifier)

Set the identifier attribute

Parámetros

Nombre Tipo Opcional Descripción
identifier string required field

Retorna

Tip

Tipo: Timeseries


withIdentifierColumn(identifierColumn)

Set the identifierColumn attribute

Parámetros

Nombre Tipo Opcional Descripción
identifierColumn string required field

Retorna

Tip

Tipo: Datasets


withName(name)

Name which will be unique in each organization

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Timeseries


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: Timeseries


withOrigin(origin)

Initial date to first bucket with ISO date time format. Next bucket will be calcullated from this date. Default value is created date with time equals 00:00:00.000Z

Parámetros

Nombre Tipo Opcional Descripción
origin string

Retorna

Tip

Tipo: Timeseries


withRetention(retention)

Time that a row is stored to be got in searching. Default value is 1 month

Parámetros

Nombre Tipo Opcional Descripción
retention number

Retorna

Tip

Tipo: Timeseries


withSorts(sorts)

List of sorting fields

Parámetros

Nombre Tipo Opcional Descripción
sorts array required field

Retorna

Tip

Tipo: Timeseries


withTimeBucket(timeBucket)

Duration of buckets in seconds.

Parámetros

Nombre Tipo Opcional Descripción
timeBucket integer required field

Retorna

Tip

Tipo: Timeseries


Timeseries Finder

This class performs GET requests against the timeseries resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization, expand, dataStreams)

Performs a get that returns list of timeseries

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
expand Array ['columns', 'context']
dataStreams Array ["ds_id_1","ds_id_2"]

Retorna

Tip

Tipo: Promise


findByOrganizationAndName(organization, name)

Performs a get that returns a definition of timeserie

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
name string timeserie name

Retorna

Tip

Tipo: Promise


findByOrganizationAndTimeserieId(organization, timeserieId)

Performs a get that returns a definition of timeserie

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
timeserieId string timeserie identifier

Retorna

Tip

Tipo: Promise


Subsections of timeseriesFunctionsCatalog

Timeseries Function

This is a base object that contains everything you can do with TimeseriesFunction.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

delete()

Deletes the selected RuleConfiguration

Retorna

Tip

Tipo: Promise


update()

Updates a rule.

Retorna

Tip

Tipo: Promise


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string

Retorna

Tip

Tipo: TimeseriesFunction


withIdentifier(name)

Set the name for update attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: TimeseriesFunction


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: TimeseriesFunction


withOrganization(organization)

Set the organization attribute

Parámetros

Nombre Tipo Opcional Descripción
organization string required field

Retorna

Tip

Tipo: TimeseriesFunction


withReturnType(returnType)

Set the returnType attribute

Parámetros

Nombre Tipo Opcional Descripción
returnType String

Retorna

Tip

Tipo: TimeseriesFunction


withScript(script)

Set the script attribute

Parámetros

Nombre Tipo Opcional Descripción
script string

Retorna

Tip

Tipo: TimeseriesFunction


withValueTypes(valueTypes)

Set the valueTypes attribute

Parámetros

Nombre Tipo Opcional Descripción
valueTypes Array

Retorna

Tip

Tipo: TimeseriesFunction


Timeseries Function Finder

This class allows making GET requests to the TimeseriesFunction resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByOrganization(organization)

Performs a get that returns a list of timeseries function

Parámetros

Nombre Tipo Opcional Descripción
organization string organization

Retorna

Tip

Tipo: Promise


findByOrganizationAndName(organization, name, script)

Performs a get that returns a timeseries function metadata

Parámetros

Nombre Tipo Opcional Descripción
organization string organization
name string Timeseries function Configuration name
script boolean If true script content will be downloaded

Retorna

Tip

Tipo: Promise


Timeseries Functions Helper

This class allows making GET requests to the TimeseriesFunctionsHelper resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

getDocJavascriptFunctions()

Performs a GET that returns documentation of JavaScript functions from the rules service.

Retorna

Tip

Tipo: Promise


getDocPrivateJavascriptFunctions()

Performs a GET that returns documentation of private JavaScript functions from the rules service.

Retorna

Tip

Tipo: Promise


users

This section covers the User class, for managing account attributes and authentication actions, and the User Finder class, for looking up users by email.

Subsections of users

User

This class represents a user in the OpenGate North API and provides methods to manage authentication, credentials, and account attributes.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

changeApiKey(apiKey)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a apiKey of a user

Parámetros

Nombre Tipo Opcional Descripción
apiKey String required field

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);

changePassword(newPassword)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user

Parámetros

Nombre Tipo Opcional Descripción
newPassword String required field

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);

login(email, password, twoFaCode)

This invoke a request to OpenGate North API and the callback is managed by promises This function get a JWT for user with Two Factor Authorithation (optional)

Parámetros

Nombre Tipo Opcional Descripción
email String required field
password String required field
twoFaCode String optional field

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.usersBuilder().login(email, password);
 ogapi.usersBuilder().login(email, password, twoFaCode);

requestResetPassword()

This invoke a request to OpenGate North API and the callback is managed by promises This function request for new password when the user forgets it. Sends a password recovery email

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()

updatePassword(newPassword, tokenId)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user with a tokenId

Parámetros

Nombre Tipo Opcional Descripción
newPassword String required field
tokenId String required field

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);

with2FaType(twoFaType)

Set the 2FaType attribute

Parámetros

Nombre Tipo Opcional Descripción
twoFaType string required field

Retorna

Tip

Tipo: User


withApiKey(apiKey)

Set the apiKey attribute. Only on update user

Parámetros

Nombre Tipo Opcional Descripción
apiKey string required field

Retorna

Tip

Tipo: User


withCountryCode(countryCode)

Set the countryCode attribute

Parámetros

Nombre Tipo Opcional Descripción
countryCode string required field

Retorna

Tip

Tipo: User


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: User


withDomain(domain)

Set the domain attribute

Parámetros

Nombre Tipo Opcional Descripción
domain string required field

Retorna

Tip

Tipo: User


withEmail(email)

Set the email attribute

Parámetros

Nombre Tipo Opcional Descripción
email string required field

Retorna

Tip

Tipo: User


withForcePasswordChange(forcePasswordChange)

Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.

Parámetros

Nombre Tipo Opcional Descripción
forcePasswordChange boolean

Retorna

Tip

Tipo: User


withLangCode(langCode)

Set the langCode attribute

Parámetros

Nombre Tipo Opcional Descripción
langCode string required field

Retorna

Tip

Tipo: User


withLoginWithPassword(loginWithPassword)

Enable or disable login with password

Parámetros

Nombre Tipo Opcional Descripción
loginWithPassword boolean

Retorna

Tip

Tipo: User


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: User


withPassword(password)

Set the password attribute

Parámetros

Nombre Tipo Opcional Descripción
password string required field

Retorna

Tip

Tipo: User


withProfile(profile)

Set the profile attribute

Parámetros

Nombre Tipo Opcional Descripción
profile string required field

Retorna

Tip

Tipo: User


withSurname(surname)

Set the surname attribute

Parámetros

Nombre Tipo Opcional Descripción
surname string required field

Retorna

Tip

Tipo: User


withTimezone(timezone)

Set the timezone attribute

Parámetros

Nombre Tipo Opcional Descripción
timezone string required field

Retorna

Tip

Tipo: User


withWorkgroup(workgroup)

Set the workgroup attribute

Parámetros

Nombre Tipo Opcional Descripción
workgroup string required field

Retorna

Tip

Tipo: User


User Finder

This class performs GET requests against the user resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByEmail(email)

Find a specify user by a email. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
email string Email of the user.

Retorna

Tip

Tipo: Promise


findByEmailAndPassword(email, password)

Find a specific user with apiKey by a email and password. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
email string Email of the user.
password string password of the user.

Retorna

Tip

Tipo: Promise


Subsections of util

Expression

and(args)

Retorna

Tip

Tipo: object
This returns a json with the query of the logical operator "and" built.

Ejemplos

Ex.and(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  and : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}

eq(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "eq" built.

Ejemplos

Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  eq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

gt(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "gt" built.

Ejemplos

Ex.gt("collected.imei", "123456786543210")


returns:

{
  gt : {
    "collected.imei": "123456786543210"
  }
}

gte(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "gte" built.

Ejemplos

Ex.gte("collected.imei", "123456786543210")


{
  gte : {
    "collected.imei": "123456786543210"
  }
}

in(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "in" built.

Ejemplos

Ex.in("entityId", ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"])


{
  in : {
    "entityId": ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"]
  }
}

like(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "like" built.

Ejemplos

Ex.like("collected.serialNumber", "SN")


returns:

{
  like : {
    "collected.serialNumber": "SN"
  }
}

lt(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "lt" built.

Ejemplos

Ex.lt("collected.imei", "123456786543210")


returns:

{
  lt : {
    "collected.imei": "123456786543210"
  }
}

lte(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "lte" built.

Ejemplos

Ex.lte("collected.imei", "123456786543210")


{
  lte : {
    "collected.imei": "123456786543210"
  }
}

neq(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "neq" built.

Ejemplos

Ex.neq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  neq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

or(args)

Retorna

Tip

Tipo: object
This returns a json with the query of the logical operator "or" built.

Ejemplos

Ex.or(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  or : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}

Subsections of http

Request Spec

constructor

Parámetros

Nombre Tipo Opcional Descripción
method string the HTTP verb.
url string the whole URL, query string included.

abort()

Cancels the request. Works before `end()` too, in which case it never leaves.

Retorna

Tip

Tipo: RequestSpec


accept(type)

Sets Accept, accepting the same shorthands.

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: RequestSpec


addEventListener(event, callback)

component-emitter's alias for `on`, which is what superagent's browser request carries. Missed on the first pass because the surface was enumerated from client.js source text, and component-emitter mixes its methods in at runtime rather than assigning them there. Caught in review by Chema.

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


addListener(event, callback)

superagent's alias for `on` in Node, where the request is an EventEmitter.

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


agent()

Inert: there is no Node HTTP agent to configure.


attach(name, file, options)

Adds a multipart file. A string is a path, as it was under superagent.

Parámetros

Nombre Tipo Opcional Descripción
name string
file *
options `(string object)=`

Retorna

Tip

Tipo: RequestSpec


auth(user, pass, options)

Sets an Authorization header. Basic by default, as in a browser; `{ type: 'bearer' }` sends the first argument as a token.

Parámetros

Nombre Tipo Opcional Descripción
user string
pass `(string object)=`
options object&#x3D;

Retorna

Tip

Tipo: RequestSpec


buffer()

Inert: buffering was a Node response concern.


ca()

Inert: TLS material belonged to the Node agent.


cert()

Inert: TLS material belonged to the Node agent.


clearTimeout()

Cancels the timers without cancelling the request.

Retorna

Tip

Tipo: RequestSpec


emit(event)

Parámetros

Nombre Tipo Opcional Descripción
event string
args ...*

Retorna

Tip

Tipo: boolean
whether anything was listening.


end(callback)

Sends the request.

Parámetros

Nombre Tipo Opcional Descripción
callback function `(error, response)`, superagent's signature.

Retorna

Tip

Tipo: RequestSpec


eventNames()

Retorna

Tip

Tipo: Array&lt;string&gt;
the events with at least one listener.


field(name, value)

Adds a plain multipart field.

Parámetros

Nombre Tipo Opcional Descripción
name string
value *

Retorna

Tip

Tipo: RequestSpec


get(field)

Reads a header back, case-insensitively.

Parámetros

Nombre Tipo Opcional Descripción
field string

Retorna

Tip

Tipo: *


getHeader(field)

superagent's alias for `get`.

Parámetros

Nombre Tipo Opcional Descripción
field string

Retorna

Tip

Tipo: *


getMaxListeners()

Inert, for symmetry with setMaxListeners.

Retorna

Tip

Tipo: number


hasListeners(event)

component-emitter's own predicate.

Parámetros

Nombre Tipo Opcional Descripción
event string

Retorna

Tip

Tipo: boolean
whether anything is listening.


key()

Inert: TLS material belonged to the Node agent.


listenerCount(event)

Parámetros

Nombre Tipo Opcional Descripción
event string

Retorna

Tip

Tipo: number


listeners(event)

Parámetros

Nombre Tipo Opcional Descripción
event string

Retorna

Tip

Tipo: Array&lt;function&gt;


maxResponseSize()

Inert: the response is read whole, as it was in a browser.


off(event, callback)

Removes one listener, or every listener for the event when no function is given – which is what component-emitter's `off(event)` did.

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function&#x3D;

Retorna

Tip

Tipo: RequestSpec


ok(fn)

Overrides what counts as a successful response.

Parámetros

Nombre Tipo Opcional Descripción
fn function receives the response, returns whether to resolve.

Retorna

Tip

Tipo: RequestSpec


on(event, callback)

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


once(event, callback)

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


parse(fn)

Replaces the parser used on the response body.

Parámetros

Nombre Tipo Opcional Descripción
fn function receives the response text, returns the body.

Retorna

Tip

Tipo: RequestSpec


pfx()

Inert: TLS material belonged to the Node agent.


prependListener(event, callback)

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


prependOnceListener(event, callback)

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function

Retorna

Tip

Tipo: RequestSpec


query(value)

Appends to the query string. Takes an object or an already-encoded string.

Parámetros

Nombre Tipo Opcional Descripción
value `(string object)`

Retorna

Tip

Tipo: RequestSpec


rawListeners(event)

superagent's alias for `listeners`.

Parámetros

Nombre Tipo Opcional Descripción
event string

Retorna

Tip

Tipo: Array&lt;function&gt;


redirects()

Inert: XHR and fetch always follow redirects; superagent could not disable that in a browser.


removeAllListeners(event)

Parámetros

Nombre Tipo Opcional Descripción
event string&#x3D; every event when omitted.

Retorna

Tip

Tipo: RequestSpec


removeEventListener(event, callback)

component-emitter's alias for `off`.

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function&#x3D;

Retorna

Tip

Tipo: RequestSpec


removeListener(event, callback)

superagent's alias for `off`.

Parámetros

Nombre Tipo Opcional Descripción
event string
callback function&#x3D;

Retorna

Tip

Tipo: RequestSpec


responseType(type)

Parámetros

Nombre Tipo Opcional Descripción
type string `blob` is the only value the library uses.

Retorna

Tip

Tipo: RequestSpec


retry()

Inert: retrying is not reproduced, because half a retry policy is worse than none.


send(data)

Attaches a body, and picks the Content-Type the way superagent did – at this point, not at send time, so a `hooks.beforeStart` callback reading `get('Content-Type')` sees what it always saw. Repeated calls merge.

Parámetros

Nombre Tipo Opcional Descripción
data *

Retorna

Tip

Tipo: RequestSpec


serialize(fn)

Replaces the serializer used for an object body.

Parámetros

Nombre Tipo Opcional Descripción
fn function receives the body, returns a string.

Retorna

Tip

Tipo: RequestSpec


set(field, value)

Sets one header, or every header in an object.

Parámetros

Nombre Tipo Opcional Descripción
field `(string object)`
value *

Retorna

Tip

Tipo: RequestSpec
itself, for chaining.


setMaxListeners()

Inert: there is no listener ceiling to raise.

Retorna

Tip

Tipo: RequestSpec


sortQuery()

Inert: the query string is built by the caller, in order.


timeout(options)

Sets the deadline for the whole request, or `{ deadline, response }` for both that and the time allowed before a response starts arriving.

Parámetros

Nombre Tipo Opcional Descripción
options `(number object)`

Retorna

Tip

Tipo: RequestSpec


toJSON()

Retorna

Tip

Tipo: object
the request as data, as superagent's `toJSON` did.


type(type)

Sets Content-Type, accepting superagent's shorthands (`json`, `form`, …).

Parámetros

Nombre Tipo Opcional Descripción
type string

Retorna

Tip

Tipo: RequestSpec


unset(field)

Removes a header, whatever case it was set in.

Parámetros

Nombre Tipo Opcional Descripción
field string

Retorna

Tip

Tipo: RequestSpec


use(fn)

Applies a plugin, superagent's extension point.

Parámetros

Nombre Tipo Opcional Descripción
fn function receives this request.

Retorna

Tip

Tipo: RequestSpec


withCredentials(on)

Sends cookies and HTTP auth on cross-origin requests.

Parámetros

Nombre Tipo Opcional Descripción
on boolean&#x3D; defaults to true, as superagent's did.

Retorna

Tip

Tipo: RequestSpec


North Amplia REST

This is a JavaScript wrapper around a REST API client.

constructor

Constructor of the REST API client.

Parámetros

Nombre Tipo Opcional Descripción
_options { url: string,port: string,version: string,apiKey: string,JTW: string} this is configuration about Opengate North API.
backend function this is a backend selected to manage a request to Opengate North API.

default()

This return a default configuration object

Retorna

Tip

Tipo: object


delete(url, timeout, headers, parameters, body, serviceBaseURL)

Invoke DELETE action to url specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute DELETE
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
body object body of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


get(url, timeout, headers, parameters, asBlob, serviceBaseURL)

Invoke GET action to url specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute GET
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
asBlob boolean response body as Blob
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


patch(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke PATCH action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute PATCH
data object attach data to request PATCH
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


post(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke POST action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute POST
data object attach data to request POST
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


post_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL)

Invoke POST multipart action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute POST
formData FormData attach data to request POST
events object events allowed, xhr.process
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


put(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke PUT action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute PUT
data object attach data to request PUT
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


put_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL)

Invoke put multipart action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string url to execute POST
formData FormData attach data to request POST
events object events allowed, xhr.process
timeout number timeout in milliseconds
headers object headers of request
parameters object parameters of request
serviceBaseURL string base of the uri petition

Retorna

Tip

Tipo: Promise


Subsections of searchingFields

Field Finder

Select Element

element(name, fields)

Parámetros

Nombre Tipo Opcional Descripción
name String Indicates the datastream to show
fields [{field: field, alias:alias}] The fields that you want to show from that datastream

Retorna

Tip

Tipo: Object
This returns a json with the object element built.

Ejemplos

SE.element('provision.device.identifier', ['value'], 'identifier')
 returns:
 {
     name : 'provision.device.identifier',
     fields: ['value'],
     alias: 'identifier
 }

 SE.element('provision.device.identifier', ['value'])
 returns:
 {
     name : 'provision.device.identifier',
     fields: ['value']
 }

South Amplia REST

Subsections of workgroups

Workgroup Finder

This class allows making get requests to the workgroup resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByDomainAndName(domain, name)

Constructor

Parámetros

Nombre Tipo Opcional Descripción
domain string domain name
name string workgroup name

Retorna

Tip

Tipo: Promise


Workgroup Relations

This is a base object that contains all you can do about workgroups.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

update()

Update not allowed


withChannel(channel)

Set the channel attribute

Parámetros

Nombre Tipo Opcional Descripción
channel string required field for creation or update

Retorna

Tip

Tipo: WorkgroupRelations


withWorkgroup(workgroup)

Set the workgroup attribute

Parámetros

Nombre Tipo Opcional Descripción
workgroup string required field

Retorna

Tip

Tipo: WorkgroupRelations


Workgroup Relations Finder

This class allows making get requests to the workgroup relation resource in the OpenGate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

findByDomainAndName(domain, name)

Constructor

Parámetros

Nombre Tipo Opcional Descripción
domain string domain name
name string workgroup name

Retorna

Tip

Tipo: Promise


Workgroups

This is a base object that contains all you can do about workgroups.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
ogapi InternalOpenGateAPI Reference to the API object.

withAdministrative(administrative)

Set the administrative attribute

Parámetros

Nombre Tipo Opcional Descripción
administrative boolean

Retorna

Tip

Tipo: Workgroups


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: Workgroups


withDomainName(domainName)

Set the domain attribute

Parámetros

Nombre Tipo Opcional Descripción
domainName string required field

Retorna

Tip

Tipo: Workgroups


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: Workgroups


OpenGate Data Python

Opengate-data

This reference is generated from the docstrings of opengate-data 1.15.3.

Opengate-data is a Python library (requires Python 3.10+) that helps you integrate OpenGate into your Python projects.

Installation

To install the library, run:

pip install opengate-data

Or, if you are using uv:

uv add opengate-data

Quick Start: Searching Entities

Here is a simple example of how to search for entities using the EntitiesSearchBuilder:

from opengate_data import OpenGateClient

# Initialize the client
client = OpenGateClient(url="https://api.opengate.es", api_key="YOUR_API_KEY")

# Create a search builder
search = client.new_entities_search_builder()

# Build the query with filters and selection
search.with_filter(
    client.new_filter_builder().eq("provision.administration.organization", "your_org").build()
).with_select(
    client.new_select_builder().add("provision.device.identifier", ["value"]).build()
).with_limit(10, 0)

# Execute the search
results = search.execute()
print(results)

Basic use with user and password

To initialize the OpenGateClient using a username and password:

client = OpenGateClient(url="Url", user="User", password="Password")

Basic use with api-key

To initialize the client using an api_key:

client = OpenGateClient(url="Url", api_key="Api_Key")

Basic use token_jwt with .env

To initialize the client using a token_jwt with a .env file.

  1. Create a .env file with the following content: TOKEN_JWT="token_jwt"

  2. Load the environment variable and initialize the client:

    client = OpenGateClient()

By default, if you use OpenGateClient without parameters, and you set the environment variable TOKEN_JWT, OpenGateClient will be created with this value. If you want to use TOKEN_JWT from environment, you may delete the OPENGATE_API_KEY environment variable.

Basic use with environment variables

The most professional way to initialize the client is by using standard environment variables. If you set these, you can simply call OpenGateClient():

# export OPENGATE_URL="https://api.opengate.es"
# export OPENGATE_API_KEY="YOUR_API_KEY"

client = OpenGateClient()

Basic use of token_jwt with an environment variable

To initialize the client using a token_jwt from an environment variable, you can set the token_jwt directly in your environment without relying on a .env:

  1. Create environment variable

    • On UNIX systems, use:

      export TOKEN_JWT="token_jwt"
    • On Windows, use:

      set TOKEN_JWT="token_jwt"
  2. Initialize the client.

    client = OpenGateClient()

Similar to the previous example, if you use OpenGateClient without parameters, and you set the environment variable TOKEN_JWT, OpenGateClient will be created with this value. If you want to use TOKEN_JWT from environment, you may delete API_KEY variable environment.

Basic use without url for services K8s

To initialize the OpenGateClient without specifying a URL, you can either omit the url parameter or set it to None.

client = OpenGateClient(api_key="Api_Key")
# or
client = OpenGateClient(url=None, api_key="Api_Key")

Similar to the previous examples, you have the option to provide the api_key directly, set it to None, or omit it altogether. If you choose to omit it, the client will automatically retrieve the api_key from the environment variable if it is set. Additionally, you can also authenticate using a username and password by specifying those credentials instead.

Features

The library consists of the following modules:

  • IA
    • Models
    • Pipelines
    • Transformers
  • Collection
    • Collection
    • Bulk Collection
    • Pandas Collection
  • Provision
    • Asset
    • Bulk
    • Devices
    • Processor
  • Rules
    • Rules
  • Searching
    • Alarms
    • Datapoints
    • Data sets
    • Entities
    • Operations
    • Rules
    • Timeseries
  • File Connector
    • File Connector

Basic Examples of the OpenGate-Data Modules

The unit tests double as usage examples: opengate_data/test/unit/ holds one directory per module, each showing the configurations and use cases of its builders.

License

This project is licensed under the Apache License 2.0.

Subsections of OpenGate Data Python

Subsections of Python Reference

AI Models

opengate_data.ai_models.ai_models

AIModelsBuilder

AIModelsBuilder Objects

class AIModelsBuilder()

AI Model Builder


with_organization_name

def with_organization_name(organization_name: str) -> "AIModelsBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • AIModelsBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "AIModelsBuilder"

Specify the identifier for the pipeline.

Arguments:

  • identifier str - The identifier for the pipeline.

Returns:

  • AIModelsBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_env

def with_env(data_env: str) -> "AIModelsBuilder"

Specify the environment variable.

Arguments:

  • data_env str - The environment variable.

Returns:

  • AIModelsBuilder - Returns self for chaining.

Example:

builder.with_env('MODEL_ID')


with_find_by_name

def with_find_by_name(find_name: str) -> "AIModelsBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the model.

Returns:

  • AIModelsBuilder - Returns self for chaining.

Example:

builder.with_find_by_name('model_name.onnx')


with_config_file

def with_config_file(config_file: str, section: str,
                     config_key: str) -> "AIModelsBuilder"

Sets up the configuration file (.ini).

This method allows specifying a configuration file, a section within that file, and a key to retrieve a specific value from the section.

Arguments:

  • config_file str - The path to the.ini configuration file.
  • section str - The section name within the.ini file where the desired configuration is located.
  • config_key str - The key within the specified section whose value will be retrieved.

Raises:

  • TypeError - If the provided config_file is not a string.
  • TypeError - If the provided section is not a string.
  • TypeError - If the provided config_key is not a string.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining.

Example:

[id]
model_id = afe07216-14ec-4134-97ae-c483b11d965a
builder.with_config_file('model_config.ini', 'id', 'model_id')


add_file

def add_file(file: str) -> "AIModelsBuilder"

Attaches the model file to upload, in PMML or ONNX format.

Arguments:

  • file str - The path to the file to be added.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining.

Raises:

  • TypeError - If the provided file path is not a string.

Example:

builder.add_file('file.onnx')


with_prediction

def with_prediction(data_prediction: dict) -> "AIModelsBuilder"

Prediction with a model

Arguments:

  • data_prediction dict - Prediction

Raises:

  • TypeError - If the prediction is not a dict.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining.

Example:

prediction = {
- `"X"` - [
{
- `"input_8"` - [
[
-0.5391107438074961,
-0.15950019784171535,
]
]
}
]
}
builder.with_prediction(prediction)


with_output_file_path

def with_output_file_path(output_file_path: str) -> "AIModelsBuilder"

Sets the output file path for the model.

This method allows you to specify the path where the output file will be saved. It is particularly useful for operations that involve downloading or saving files.

Arguments:

  • output_file_path str - The path where the output file will be saved.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class.

Example:

builder.with_output_file_path("rute/prueba.onnx")


create

def create() -> "AIModelsBuilder"

Initiates the creation process of a new model.

This method prepares the AIModelsBuilder instance to create a new model by setting up the necessary parameters such as the organization name and the file to be associated with the model.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").add_file("example.onnx").create()


find_one

def find_one() -> "AIModelsBuilder"

Retrieve a single model.

This method sets up the AIModelsBuilder instance to retrieve a specific model associated with the specified organization and identifier.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name").with_identifier("model_identifier").find_one()


find_all

def find_all() -> "AIModelsBuilder"

Retrieve all models.

This method sets up the AIModelsBuilder instance to retrieve all models associated with the specified organization.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").find_all()


update

def update() -> "AIModelsBuilder"

Update an existing model.

This method sets up the AIModelsBuilder instance to update a specific model associated with the specified organization and identifier.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_identifier("model_identifier").add_file("updated_model.onnx").update()
builder.with_organization_name("MyOrganization").with_find_by_name("model_name.onnx").add_file("updated_model.onnx").update()
builder.with_organization_name("MyOrganization").with_config_file('model_config.ini', 'id', 'model').add_file("updated_model.onnx").update()


delete

def delete() -> "AIModelsBuilder"

Delete an existing model within the organization.

This method sets up the AIModelsBuilder instance to delete a specific model associated with the specified organization and identifier.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_identifier("model_identifier").delete()
builder.with_organization_name("MyOrganization").with_find_by_name("model_name.onnx").delete()
builder.with_organization_name("MyOrganization").with_config_file('model_config.ini', 'id', 'model').delete()


validate

def validate() -> "AIModelsBuilder"

Validate the model configuration.

This method sets up the AIModelsBuilder instance to validate the configuration of a model associated with the specified organization.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").add_file("model.onnx").validate()


download

def download() -> "AIModelsBuilder"

Download the model file.

This method sets up the AIModelsBuilder instance to download the file of a specific model associated with the specified organization and identifier.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_identifier("model_identifier").with_output_file_path("model.onnx").download()
builder.with_organization_name("MyOrganization").with_find_by_name("model_name.onnx").with_output_file_path("model.onnx").download()
builder.with_organization_name("MyOrganization").with_config_file('model_config.ini', 'id', 'model').with_output_file_path("model.onnx").download()


prediction

def prediction() -> "AIModelsBuilder"

Make a prediction using the model.

This method sets up the AIModelsBuilder instance to make a prediction using a specific model associated with the specified organization and identifier.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

prediction_data = {
- `"X"` - [
{
- `"input_8"` - [
[
-0.5391107438074961,
-0.15950019784171535,
]
]
}
]
}
builder.with_organization_name("MyOrganization").with_identifier("model_identifier").with_prediction(prediction_data).prediction()
builder.with_organization_name("MyOrganization").with_find_by_name("model_name.onnx").with_prediction(prediction_data).prediction()
builder.with_organization_name("MyOrganization").with_config_file('model_config.ini', 'id', 'model').with_prediction(prediction_data).prediction()


save

def save() -> "AIModelsBuilder"

Save the model configuration.

This method sets up the AIModelsBuilder instance to save the configuration of a model associated with the specified organization.

Returns:

  • AIModelsBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_env("env_var").save()
builder.with_organization_name("MyOrganization").with_config_file('model_config.ini', 'id', 'model').save()


set_config_file_identifier

def set_config_file_identifier() -> "AIModelsBuilder"

Selects the operation that writes the model identifier into a configuration file.

It stores the identifier given to with_identifier() under the section and key named with with_config_file(), so a later run can pick the model up from the file instead of carrying its identifier in the code. The key must already exist in the file.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("model_identifier").with_config_file(
'model_config.ini', 'id', 'model_id'
).set_config_file_identifier().build().execute()


set_env_identifier

def set_env_identifier() -> "AIModelsBuilder"

Selects the operation that writes the model identifier into the .env file.

It stores the identifier given to with_identifier() under the variable named with with_env(), so a later run can pick the model up from the environment. The variable must already exist in the .env file.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If the variable is not in the .env file.

Example:

builder.with_identifier("model_identifier").with_env(
"MODEL_ID"
).set_env_identifier().build().execute()


build

def build() -> "AIModelsBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • AIModelsBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> Response

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.ai_models

AI Pipelines

opengate_data.ai_pipelines.ai_pipelines

AIPipelinesBuilder

AIPipelinesBuilder Objects

class AIPipelinesBuilder()

Builder pipelines


with_organization_name

def with_organization_name(organization_name: str) -> "AIPipelinesBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • AIPipelinesBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "AIPipelinesBuilder"

Specify the identifier for the pipeline.

Arguments:

  • identifier str - The identifier for the pipeline.

Returns:

  • AIPipelinesBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_env

def with_env(data_env: str) -> "AIPipelinesBuilder"

Specify the environment variable.

Arguments:

  • data_env str - The environment variable.

Returns:

  • AIPipelinesBuilder - Returns self for chaining.

Example:

builder.with_env('PIPELINE_ID')


with_find_by_name

def with_find_by_name(find_name: str) -> "AIPipelinesBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the pipeline.

Returns:

  • AIPipelinesBuilder - Returns self for chaining.

Example:

builder.with_find_by_name('pipeline_name')


with_config_file

def with_config_file(config_file: str, section: str,
                     config_key: str) -> "AIPipelinesBuilder"

Sets up the configuration file (.ini).

This method allows specifying a configuration file, a section within that file, and a key to retrieve a specific value from the section.

Arguments:

  • config_file str - The path to the.ini configuration file.
  • section str - The section name within the.ini file where the desired configuration is located.
  • config_key str - The key within the specified section whose value will be retrieved.

Raises:

  • TypeError - If the provided config_file is not a string.
  • TypeError - If the provided section is not a string.
  • TypeError - If the provided config_key is not a string.

Example:

[id]
pipeline_id = afe07216-14ec-4134-97ae-c483b11d965a
config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_config_file(config_file_path, 'id', 'pipeline_id')

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.


with_prediction

def with_prediction(data_prediction: dict) -> "AIPipelinesBuilder"

Prediction with a model

Arguments:

  • data_prediction dict - Prediction

Raises:

  • TypeError - If the prediction is not a dict.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.

Example:

{
- `"input"` - {},
- `"collect"` - {
- `"deviceId"` - "123456",
- `"datastream"` - "PredictionDatastream"
}
}
builder.with_prediction(prediction)


with_name

def with_name(name: str) -> "AIPipelinesBuilder"

Name a new pipeline

Arguments:

  • name str - Name a new pipeline

Raises:

  • TypeError - If the name is not a string.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_name(name_prediction)


add_action

def add_action(file_name: str,
               type_action: str | None = None) -> "AIPipelinesBuilder"

Add action name and type of model or transform exist.

Arguments:

  • file_name str - The name of the file representing the action.
  • type_action str | None - The type of the action, either ‘MODEL’ or ‘TRANSFORMER’. If None, it will be inferred from the file extension.

Raises:

  • TypeError - If file_name is not a string.
  • TypeError - If type_action is not a string or None.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.

Example:

builder.add_action('transform.py', 'TRANSFORMER')
builder.add_action('test/file_create.onnx', 'MODEL')
builder.add_action('test/file_update.onnx')


build

def build() -> "AIPipelinesBuilder"

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Notes:

This method should be used as a final step before execute to prepare the operations search configuration. It does not modify the state but ensures that the builder’s state is ready for execution.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


create

def create() -> "AIPipelinesBuilder"

Creates a new pipeline.

This method prepares the request to create a new pipeline using the specified configuration in the object. It is necessary to define the name (with_name) and actions (add_action) before calling this method.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

builder.with_organization_name(organization)
.with_name('MyPipeline').add_action('transform.py', 'TRANSFORMER')
.add_action('test/file_create.onnx', 'MODEL')
.create()


find_all

def find_all() -> "AIPipelinesBuilder"

Retrieves all available pipelines.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

builder.with_organization_name('MyOrganization').find_all()


find_one

def find_one() -> "AIPipelinesBuilder"

Finds a specific pipeline by its identifier.

This method prepares the request to find a specific pipeline based on its identifier. The identifier is obtained automatically if not explicitly defined or can be obtained from a configuration file or environment variables.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_identifier('identifier').find_one()


update

def update() -> "AIPipelinesBuilder"

Updates an existing pipeline.

This method prepares the request to update an existing pipeline. It is necessary to define the organization’s name (with_organization_name) and the pipeline’s name (with_name) before calling this method.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

builder.with_organization_name('MyOrganization').with_identifier("pipeline_identifier").with_name('MyPipeline').update()
config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_organization_name('MyOrganization').with_find_by_name("pipeline_name").with_config_file(config_file_path, 'id', 'model').with_name('MyPipeline').update()
builder.with_organization_name('MyOrganization').with_name('MyPipeline').update()


delete

def delete() -> "AIPipelinesBuilder"

Deletes an existing pipeline.

This method prepares the request to delete an existing pipeline. It is necessary to define the organization’s name (with_organization_name) and the pipeline’s identifier (with_identifier) before calling this method.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

builder.with_organization_name('MyOrganization').with_identifier('pipeline_identifier').delete()


prediction

def prediction() -> "AIPipelinesBuilder"

Performs a prediction with a model.

This method prepares the request to perform a prediction using the model associated with the specified pipeline. It is necessary to define the organization’s name (with_organization_name), the pipeline’s identifier (with_identifier), and provide prediction data (with_prediction) before calling this method.

Returns:

  • AIPipelinesBuilder - Returns the same object to allow method chaining.

Example:

- `builder.with_organization_name('MyOrganization').with_identifier('pipeline_identifier').with_prediction({'input'` - {}, 'collect': {'deviceId': '123456', 'datastream': 'PredictionDatastream'}}).prediction()


save

def save() -> "AIPipelinesBuilder"

Save the model configuration.

This method sets up the AIPipelinesBuilder instance to save the configuration of a model associated with the specified organization. It configures the URL endpoint for the save operation and sets the operation type to ‘save’.

Returns:

  • AIPipelinesBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_env("MODEL_ENV_VAR").save().build().execute()
config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_organization_name("MyOrganization").with_config_file(config_file_path, 'id', 'model').save().build().execute()


set_config_file_identifier

def set_config_file_identifier() -> "AIPipelinesBuilder"

Selects the operation that writes the pipeline identifier into a configuration file.

It stores the identifier given to with_identifier() under the section and key named with with_config_file(), so a later run can pick the pipeline up from the file instead of carrying its identifier in the code. The key must already exist in the file.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("pipeline_identifier").with_config_file(
'pipeline_config.ini', 'id', 'pipeline_id'
).set_config_file_identifier().build().execute()


set_env_identifier

def set_env_identifier() -> "AIPipelinesBuilder"

Selects the operation that writes the pipeline identifier into the .env file.

It stores the identifier given to with_identifier() under the variable named with with_env(), so a later run can pick the pipeline up from the environment. The variable must already exist in the .env file.

Returns:

  • AIPipelinesBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If the variable is not in the .env file.

Example:

builder.with_identifier("pipeline_identifier").with_env(
"PIPELINE_ID"
).set_env_identifier().build().execute()


execute

def execute()

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.ai_pipelines

AI Transformers

opengate_data.ai_transformers.ai_transformers

AITransformersBuilder

AITransformersBuilder Objects

class AITransformersBuilder()

Class transformer builder


with_organization_name

def with_organization_name(organization_name: str) -> "AITransformersBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • AITransformersBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "AITransformersBuilder"

Specify the identifier for the pipeline.

Arguments:

  • identifier str - The identifier for the pipeline.

Returns:

  • AITransformersBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_env

def with_env(data_env: str) -> "AITransformersBuilder"

Specify the environment variable.

Arguments:

  • data_env str - The environment variable.

Returns:

  • AITransformersBuilder - Returns self for chaining.

Example:

builder.with_env('TRANSFORMER_ID')


with_config_file

def with_config_file(config_file: str, section: str,
                     config_key: str) -> "AITransformersBuilder"

This method allows specifying a configuration file, a section within that file, and a key to retrieve a specific value from the section.

Arguments:

  • config_file str - The path to the.ini configuration file.
  • section str - The section name within the.ini file where the desired configuration is located.
  • config_key str - The key within the specified section whose value will be retrieved.

Raises:

  • TypeError - If the provided config_file is not a string.
  • TypeError - If the provided section is not a string.
  • TypeError - If the provided config_key is not a string.

Returns:

AITransformersBuilder

Example:

[id]
model_id = afe07216-14ec-4134-97ae-c483b11d965a

config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_config_file(config_file_path, 'id', 'model_id')


add_file

def add_file(file_path: str, filetype: str = None)

Adds a file to the transformer resource.

This method allows specifying one or more files to be included in the transformer resource being created. The content type for each file can be specified if needed.

Arguments:

  • file_path str - Full path to the file to add.
  • filetype str, optional - Content type of the file. Defaults to None, meaning the content type will be automatically inferred.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

ai_transformer_create = client.new_ai_transformers_builder().with_organization_name('organization')
.add_file('exittransformer.py', 'text/python')
.add_file('pkl_encoder.pkl')


with_find_by_name

def with_find_by_name(find_name: str) -> "AITransformersBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the transformer.

Returns:

  • AITransformersBuilder - Returns self for chaining.

Example:

builder.with_find_by_name('transformer_name')


with_evaluate

def with_evaluate(data_evaluate: dict) -> "AITransformersBuilder"

Evaluate with transformer

Arguments:

  • data_evaluate dict - Evaluate

Raises:

  • TypeError - If to evaluate is not a dict.

Returns:

  • AITransformersBuilder - Returns itself to allow for method chaining.

Example:

evaluate_data = {
- `"data"` - {
- `"PPLast12H"` - 0,
- `"PPLast24H"` - 0,
- `"PPLast72H"` - 1,
- `"currentTemp"` - -2,
- `"changeTemp"` - -2
},
- `"date"` - "2022-06-13T13:59:34.779+02:00"
}
builder.with_evaluate(evaluate_data)


with_output_file_path

def with_output_file_path(output_file_path: str) -> "AITransformersBuilder"

Sets the output file path for the transformer.

This method allows you to specify the path where the output file will be saved. It is particularly useful for operations that involve downloading or saving files.

Arguments:

  • output_file_path str - The path where the output file will be saved.

Returns:

  • AITransformersBuilder - The instance of the AIModelsBuilder class.

Example:

builder.with_output_file_path("rute/prueba.onnx")


with_file_name

def with_file_name(file_name: str) -> "AITransformersBuilder"

Specifies the name of the file to be processed.

This method allows you to specify the name of the file that will be used in operations such as download or evaluation. It is particularly useful when working with specific files that require unique identifiers or names for processing.

Arguments:

  • file_name str - The name of the file to be processed.

Returns:

  • AITransformersBuilder - Returns self for chaining.

Example:

builder.with_file_name('pkl_encoder.pkl')


create

def create() -> "AITransformersBuilder"

Prepares the creation of the transformer resource.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('organization').add_file(
'exittransformer.py', 'text/python'
).add_file('pkl_encoder.pkl').create().build().execute()


find_all

def find_all() -> "AITransformersBuilder"

Searches for all available transformer resources.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').find_all()


find_one

def find_one() -> "AITransformersBuilder"

Searches for a single transformer resource by its identifier.

This method prepares the request to find a specific transformer based on its identifier. The identifier is obtained automatically if not explicitly defined or can be obtained from a configuration file or environment variables.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_identifier('identifier').find_one()


update

def update() -> "AITransformersBuilder"

Updates an existing transformer resource.

This method prepares the URL and HTTP method necessary to send a PUT request to the API to update an existing transformer. It is necessary to configure the relevant attributes of the AITransformersBuilder instance, including the identifier of the transformer to update, before calling this method.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_identifier('identifier').update()


delete

def delete() -> "AITransformersBuilder"

Deletes an existing transformer resource.

This method prepares the URL and HTTP method necessary to send a DELETE request to the API to delete an existing transformer. It is necessary to configure the identifier attribute of the AITransformersBuilder instance before calling this method.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_identifier('identifier').delete()


download

def download() -> "AITransformersBuilder"

Download the model file.

This method sets up the AIModelsBuilder instance to download the file of a specific model associated with the specified organization and identifier. It configures the URL endpoint for the download operation and sets the operation type to ‘download’.

Returns:

  • AITransformersBuilder - The instance of the AIModelsBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("MyOrganization").with_identifier("model_identifier").with_output_file_path("model.onnx").download().build().execute()
builder.with_organization_name("MyOrganization").with_find_by_name("model_name.onnx").with_output_file_path("model.onnx").download().build().execute()
config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_organization_name("MyOrganization").with_config_file(config_file_path, 'id', 'model').with_output_file_path("model.onnx").download().build().execute()


evaluate

def evaluate() -> "AITransformersBuilder"

Prepares the evaluation of the transformer with provided data.

This method sets up the URL and method for evaluating the transformer using the provided data. The evaluation data should be set using the with_evaluate method before calling this method.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_identifier('identifier').with_evaluate(evaluate_data).evaluate()


save

def save() -> "AITransformersBuilder"

Saves the transformer configuration.

This method prepares the URL and method for saving the transformer configuration. It checks if the identifier is set from the environment or configuration file and then either updates or creates the transformer accordingly.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_env('TRANSFORMER_ID').save()


set_config_file_identifier

def set_config_file_identifier() -> "AITransformersBuilder"

Sets the transformer identifier in the configuration file.

This method sets the transformer identifier in the specified configuration file. It reads the configuration file, updates the identifier, and writes the changes back to the file.

Returns:

  • AITransformersBuilder - Returns the current instance to allow method chaining.

Example:

config_file_path = os.path.join(os.path.dirname(__file__), 'config_test.ini')
builder.with_config_file(config_file_path, 'id', 'transformer_id').set_config_file_identifier()


set_env_identifier

def set_env_identifier() -> "AITransformersBuilder"

Selects the operation that writes the transformer identifier into the .env file.

It stores the identifier held by the builder under the variable named with with_env(), so a later run can pick the transformer up from the environment. The variable must already exist in the .env file.

Returns:

  • AITransformersBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If the variable is not in the .env file.

Example:

builder.with_identifier("transformer_identifier").with_env(
"TRANSFORMER_ID"
).set_env_identifier().build().execute()


build

def build() -> "AITransformersBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • AITransformersBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> requests.Response

Sends the selected operation to the platform.

Which request goes out depends on the operation chosen in the chain: create, find, update, delete, download, evaluate, save, or resolving the identifier from a configuration file or from the environment.

Returns:

requests.Response | dict | str: Whatever the selected operation produces — the transformer payload, the contents of a downloaded file, or a dict carrying status_code and either data or error.

Raises:

  • ValueError - If no operation was selected in the chain.

Example:

builder.with_organization_name("organization").find_all().build().execute()

opengate_data.ai_transformers

Collection

opengate_data.collection.iot_bulk_collection

IotBulkCollectionBuilder Objects

class IotBulkCollectionBuilder()

Collection Bulk Builder


add_device_datastream_datapoints

def add_device_datastream_datapoints(
        device_id: str,
        datastream_id: str,
        datapoints: list[tuple[
            int | float | bool | dict | list | str,
            None | datetime | int,
            None | str,
            None | str,
        ]],
        feed: str | None = None) -> "IotBulkCollectionBuilder"

Add the datastream identifier and a list of datapoints with their value and at for data collection.

add_device_datastream_datapoints(“device_id”, “datastream_identifier”, [(value, at, source, source_info)])

Multiple datastreams can be grouped under a single identifier

Arguments:

  • device_id str - The identifier of the device the datapoints belong to.
  • datastream_id str - The identifier for the datastream to which the datapoints will be added.
  • datapoints list[tuple[int | float | bool | dict | list, None | datetime | int, None | datetime | int]] - A list of tuples where each tuple represents a datapoint. Each tuple contains the datapoint value and an optional timestamp (‘at’):
  • value - Collected value
  • at - Number with the time in miliseconds from epoch of the measurement. If this field is None, the platform will assign the server current time to the datapoint whe data is received.
  • feed str | None - The feed to collect the datapoints under. Optional.

Returns:

  • IotBulkCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.add_datastream_datapoints("datastream_identifier_1", [(value1, datetime.now()), (value2, None, "HTTP-Basic", "OK")])
builder.add_datastream_datapoints("datastream_identifier_2", [(value3, None), (value4, 1431602523123)])


add_device_datastream_datapoints_with_from

def add_device_datastream_datapoints_with_from(
        device_id: str,
        datastream_id: str,
        datapoints: list[tuple[
            int | float | bool | dict | list | str,
            None | datetime | int,
            None | datetime | int,
            None | str,
            None | str,
        ]],
        feed: str | None = None) -> "IotBulkCollectionBuilder"

Add the datastream identifier and a list of datapoints with their value, at and from for data collection.

add_datastream_datapoints_with_from(“datastream_identifier”, [(value, at, from, Source, SourceInfo)])

Multiple datastreams can be grouped under a single identifier

Arguments:

  • device_id str - The identifier of the device the datapoints belong to.
  • datastream_id str - The identifier for the datastream to which the datapoints will be added.
  • datapoints list[tuple[int | float | bool | dict, None | datetime | int, None | datetime | int]] - A list of tuples where each tuple represents a datapoint. Each tuple contains the datapoint value and an optional timestamp (‘at’) (‘from):
  • value - Collected value
  • at - Number with the time in miliseconds from epoch of the measurement. If this field is None, the platform will assign the server current time to the datapoint whe data is received.
  • from - Number with the time in miliseconds from epoch of the start period of measurement. This indicates that value is the same within this time interval (from, at).
  • feed str | None - The feed to collect the datapoints under. Optional.

Returns:

  • IotBulkCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.add_datastream_datapoints_with_from("datastream_identifier_1", [(value, 1431602523123, None), (value, None, None, "HTTP-Basic", "OK")])
builder.add_datastream_datapoints_with_from("datastream_identifier_2", [(value, None, datetime.now()), (value, 1431602523123, datetime.now())])


from_dataframe

def from_dataframe(df: pd.DataFrame) -> "IotBulkCollectionBuilder"

Processes a DataFrame to extract device, data and datapoints, and adds them to the payload.

Arguments:

  • df pd.DataFrame - The DataFrame containing the device data and datapoints. The DataFrame is expected to have columns that match the expected structure for device datastreams and datapoints.

Returns:

  • IotBulkCollectionBuilder - Returns itself to allow for method chaining.

Example:

import pandas as pd

df = pd.DataFrame({
- `'device_id'` - ['device'], ['device2'],
- `'datastream'` - ['1'],['2'],
- `'value'` - [value, value2],
- `'at'` - [datetime.now(), 2000]
})
builder.from_dataframe(df)


from_spreadsheet

def from_spreadsheet(
        path: str, sheet_name_index: int | str) -> "IotBulkCollectionBuilder"

Loads data from a spreadsheet, processes it, and adds the resulting device data and datapoints to the payload. This method is particularly useful for bulk data operations where data is stored in spreadsheet format.

Arguments:

  • path str - The file path to the spreadsheet to load.
  • sheet_name_index int | str - The sheet name or index to load from the spreadsheet.

Returns:

  • IotBulkCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.from_spreadsheet("file.xslx", "sheet_name)
builder.from_spreadsheet("file.xslx", 1)


build

def build() -> "IotBulkCollectionBuilder"

Finalizes the construction of the entities search configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • IotBulkCollectionBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute(include_payload=False)

This method is a shortcut that combines building and executing in a single step.

Arguments:

  • include_payload bool - Whether the response should carry the payload that was sent. Defaults to False.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

import pandas as pd
from datetime import datetime

data = {
- `"device_id"` - ['entity'],
- `"data_stream_id"` - ["device.temperature.value"],
- `"origin_device_identifier"` - ['entity2'],
- `"value"` - [40],
- `"version"` - ["4.0.0"],
- `"path"` - ["entityTesting3"],
- `"at"` - [datetime.now()],
- `"from"` - [datetime.now()],
}
new_iot_bulk_collection_builder().from_dataframe(df).from_spreadsheet("collect.xslx",0).add_device_datastream_datapoints_with_from("device_identifier", "device.temperature.value", [(300, datetime.now(), datetime.now())])
.add_device_datastream_datapoints("entity", "device.temperature.value", [(300, datetime.now())])
.build_execute()


to_dict

def to_dict() -> dict

This method is used to retrieve the entire payload that has been constructed by the builder. The payload includes all devices, their respective datastreams, and the datapoints that have been added to each datastream. This is particularly useful for inspecting the current state of the payload after all configurations and additions have been made, but before any execution actions (like sending data to a server) are taken.

Returns:

  • dict - A dictionary representing the current state of the payload within the IotBulkCollectionBuilder. This dictionary includes all devices, datastreams, and datapoints that have been configured.

Raises:

  • Exception - If the build method was not called before this method.

Example:

builder.to_dict()


execute

def execute(include_payload=False)

Executes the IoT collection based on the current configuration of the builder.

Arguments:

  • include_payload bool - Determine if the payload should be included in the response.

Returns:

  • dict - A dictionary containing the results of the execution, including success messages for each device ID if the data was successfully sent, or error messages detailing what went wrong.

Raises:

  • Exception - If build() has not been called before execute(), or if it was not the last method invoked prior to execute().

Example:

import pandas as pd
from datetime import datetime

data = {
- `"device_id"` - ['entity', entity2],
- `"data_stream_id"` - ["device.temperature.value", "device.name"],
- `"origin_device_identifier"` - ['entity2', None],
- `"value"` - [40, "Name"],
- `"version"` - ["4.0.0", "2.0.0],
- `"path"` - ["entityTesting3", entityTesting4],
- `"at"` - [datetime.now(), datetime.now()],
- `"from"` - [datetime.now(), datetime.now()],
}
builder.new_iot_bulk_collection_builder().from_dataframe(df).from_spreadsheet("collect.xslx",0).add_device_datastream_datapoints_with_from("device_identifier", "device.temperature.value", [(300, datetime.now(), datetime.now())])
.add_device_datastream_datapoints("entity", "device.temperature.value", [(300, datetime.now())])
.build().execute())

opengate_data.collection.iot_collection

IotCollectionBuilder Objects

class IotCollectionBuilder()

Iot Collection Builder


with_device_identifier

def with_device_identifier(device_identifier: str) -> "IotCollectionBuilder"

Add the device identifier to the constructor and validates the type.

Arguments:

  • device_identifier str - The unique identifier for the device.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_device_identifier('device_identifier')


with_origin_device_identifier

def with_origin_device_identifier(
        origin_device_identifier: str) -> "IotCollectionBuilder"

Origin Device Identifier in case of be different that the device Identifier that sends information (included in the URI).

Add the origin_device_identifier to the constructor and validates the type.

Arguments:

  • origin_device_identifier str - The unique identifier for the device.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_origin_device_identifier('origin_device_identifier')


with_version

def with_version(version: str) -> "IotCollectionBuilder"

Indicates the version of the structure

Add the version to the constructor and validates the type.

Arguments:

  • version str - The version string to be set.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_version('1.0.0')


with_path

def with_path(path: list[str]) -> "IotCollectionBuilder"

Identifier of the gateway or gateways that has been used by the asset for sending the information.

This method adds the path gateway to the constructor and validates the type.

Arguments:

  • path list - The list of gateway identifiers.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_path(["path"])


with_device

def with_device(device: str) -> "IotCollectionBuilder"

Device Identifier in case of be different that the device Identifier that sends information (included in the URI).

Arguments:

  • device str - The unique identifier for the device.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_device("sub-device-001")


with_trustedboot

def with_trustedboot(trustedboot: str) -> "IotCollectionBuilder"

Indicates that a validation of the Trusted_boot type is required, it is not necessary to enter the value of the field but if you enter it, the entire message received by the platform will compare the value of TrustedBoot with the provisioned value, if they are different the message will not be collected.

Add the trustedboot to the constructor and validates the type.

Arguments:

  • trustedboot str - The unique identifier for the device.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.with_trustedboot("trustedboot")


add_datastream_datapoints

def add_datastream_datapoints(
        datastream_id: str,
        datapoints: list[tuple[
            int | float | bool | dict | list | str,
            None | datetime | int,
            None | str,
            None | str,
        ]],
        feed: str | None = None) -> "IotCollectionBuilder"

Add the datastream identifier and a list of datapoints with their value and at for data collection.

add_datastream_datapoints(“datastream_identifier”, [(value, at, source, source_info)])

Multiple datastreams can be grouped under a single identifier

Arguments:

  • datastream_id str - The identifier for the datastream to which the datapoints will be added.
  • datapoints list[tuple[int | float | bool | dict | list, None | datetime | int, None | datetime | int]] - A list of tuples where each tuple represents a datapoint. Each tuple contains the datapoint value and an optional timestamp (‘at’):
  • value - Collected value
  • at - Number with the time in miliseconds from epoch of the measurement. If this field is None, the platform will assign the server current time to the datapoint whe data is received.
  • feed str | None - The feed to collect the datapoints under. Optional.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.add_datastream_datapoints("datastream_identifier_1", [(value1, datetime.now()), (value2, None, "HTTP-Basic", "OK")])
builder.add_datastream_datapoints("datastream_identifier_2", [(value3, None), (value4, 1431602523123)])


add_datastream_datapoints_with_from

def add_datastream_datapoints_with_from(
        datastream_id: str,
        datapoints: list[tuple[
            int | float | bool | dict | list | str,
            None | datetime | int,
            None | datetime | int,
            None | str,
            None | str,
        ]],
        feed: str | None = None) -> "IotCollectionBuilder"

Add the datastream identifier and a list of datapoints with their value, at and from for data collection.

add_datastream_datapoints_with_from(“datastream_identifier”, [(value, at, from, Source, SourceInfo)])

Multiple datastreams can be grouped under a single identifier

Arguments:

  • datastream_id str - The identifier for the datastream to which the datapoints will be added.
  • datapoints list[tuple[int | float | bool | dict, None | datetime | int, None | datetime | int]] - A list of tuples where each tuple represents a datapoint. Each tuple contains the datapoint value and an optional timestamp (‘at’) (‘from):
  • value - Collected value
  • at - Number with the time in miliseconds from epoch of the measurement. If this field is None, the platform will assign the server current time to the datapoint whe data is received.
  • from - Number with the time in miliseconds from epoch of the start period of measurement. This indicates that value is the same within this time interval (from, at).
  • feed str | None - The feed to collect the datapoints under. Optional.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Example:

builder.add_datastream_datapoints_with_from("datastream_identifier_1", [(value, 1431602523123, None), (value, None, None, "HTTP-Basic", "OK")])
builder.add_datastream_datapoints_with_from("datastream_identifier_2", [(value, None, datetime.now()), (value, 1431602523123, datetime.now())])


from_dict

def from_dict(payload: dict[str, Any]) -> "IotCollectionBuilder"

Constructs the collection configuration from a dictionary input.

This method dynamically applies builder methods based on the keys in the input dictionary. It should be used after the build() method has been called to ensure that the builder is in a proper state to accept configuration from a dictionary.

Arguments:

  • payload dict[str, Any] - The dictionary containing the configuration Args.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If required keys are missing in the payload or if the ‘datastreams’ field is empty.

Example:

builder.build().from_dict({
- `'version'` - '1.0.0',
- `'path'` - ["mews"],
- `'trustedBoot'` - "trustedBoot",
- `'origin_device_identifier'` - 'device123',
- `'datastreams'` - [
- `{'id'` - 'temp', 'datapoints': [(22, 1609459200000)]}
]
})


build

def build() -> "IotCollectionBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • IotCollectionBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Notes:

This method should be used as a final step before execute to prepare the IoT collection configuration. It does not modify the state but ensures that the builder’s state is ready for execution.

Example:

builder.build()


to_dict

def to_dict() -> dict

This method is used to retrieve the entire payload that has been constructed by the builder. The payload includes all devices, their respective datastreams, and the datapoints that have been added to each datastream. This is particularly useful for inspecting the current state of the payload after all configurations and additions have been made, but before any execution actions (like sending data to a server) are taken.

Returns:

  • dict - A dictionary representing the current state of the payload within the IotCollectionBuilder. This dictionary includes all devices, datastreams, and datapoints that have been configured.

Raises:

  • Exception - If the build() method was not called before this method.

Example:

builder.build().to_dict()


build_execute

def build_execute(include_payload: bool = False)

Executes the IoT collection immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step. It should be used when you want to build and execute the configuration without modifying the builder state in between these operations.

It first validates the build configuration and then executes the collection if the validation is successful.

Arguments:

  • include_payload bool - Determine if the payload should be included in the response.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance, indicating that build_execute is being incorrectly used after build.
  • Exception - If there are issues during the execution process, including network or API errors.

Example:

new_iot_collection_builder().with_device_identifier("entity").with_version("2.0.0").add_datastream_datapoints("device.temperature.value", [(100, None), (50, datetime.now())]).build_execute(True)


execute

def execute(include_payload: bool = False)

Executes the IoT collection based on the current configuration of the builder.

Arguments:

  • include_payload bool - Determine if the payload should be included in the response.

Returns:

  • Dict - A dictionary containing the execution response which includes the status code and, optionally, the payload. If an error occurs, a string describing the error is returned.

Raises:

  • Exception - If build() has not been called before execute(), or if it was not the last method invoked prior to execute().

Example:

builder.with_device_identifier("device_identifier").with_version("2.0.0").add_datastream_datapoints("device.temperature.value", [(100, None), (50, datetime.now())]).build().execute(True)

opengate_data.collection.iot_pandas_collection

PandasIotCollectionBuilder Objects

class PandasIotCollectionBuilder()

Builder class to process a pandas DataFrame into IoT collections and send them to a specified endpoint.


from_dataframe

def from_dataframe(df: pd.DataFrame) -> "PandasIotCollectionBuilder"

Set the input DataFrame that contains the IoT data to process.

The DataFrame must include a ‘device_id’ and ‘at’ column. Additional columns are considered as potential datastream values. If ‘at’ is empty or None, a timestamp will be assigned.

Arguments:

  • df pd.DataFrame - The DataFrame with ‘device_id’ and ‘at’ columns.

Returns:

  • PandasIotCollectionBuilder - The current builder instance.

Raises:

  • Exception - If ‘device_id’ or ‘at’ column is missing in the DataFrame.


with_columns

def with_columns(columns: list[str]) -> "PandasIotCollectionBuilder"

Specify the columns from the DataFrame that should be included as datastreams in the IoT payload.

If this method is not called, all available datastream columns (except required/optional ones) are used. If it is called, only the specified columns will be considered.

Arguments:

  • columns list[str] - The list of column names to include as datastreams.

Returns:

  • PandasIotCollectionBuilder - The current builder instance.

Raises:

  • Exception - If any specified column does not exist in the DataFrame.


with_max_bytes_per_request

def with_max_bytes_per_request(max_bytes: int) -> "PandasIotCollectionBuilder"

Set the maximum number of bytes per request for IoT collection.

This controls how the payload is batched when sending to the endpoint.

Arguments:

  • max_bytes int - The maximum request size in bytes.

Returns:

  • PandasIotCollectionBuilder - The current builder instance.


build

def build() -> "PandasIotCollectionBuilder"

Build the request payload after the DataFrame and columns have been configured.

This method processes the DataFrame, converting columns into the appropriate IoT datastream format. It must be called before execute() if not using build_execute().

Returns:

  • PandasIotCollectionBuilder - The current builder instance.

Raises:

  • Exception - If build() and build_execute() are used together.


build_execute

def build_execute(
        include_payload: bool = False) -> dict[str, list[dict[str, Any]]]

Build the payload and execute the request in a single step.

This method is a shortcut for users who want to build and then immediately execute. It cannot be used together with build() or execute().

Arguments:

  • include_payload bool - Whether to include the payload in the result. Defaults to False.

Returns:

dict[str, list[dict[str, Any]]]: The results of the IoT collection request.

Raises:

  • ValueError - If build_execute() is used together with build() or execute().


execute

def execute(include_payload: bool = False) -> Union[str, pd.DataFrame]

Execute the request after building it with build() or build_execute().

If include_payload is True, it returns a JSON string with the payload and results. Otherwise, it returns a pandas DataFrame with a status column summarizing the results.

Arguments:

  • include_payload bool - Whether to include the payload in the result. Defaults to False.

Returns:

Union[str, pd.DataFrame]: The result of the IoT collection request.

Raises:

  • Exception - If the required method invocation order is not respected.

opengate_data.collection

Datasets

opengate_data.datasets.find_datasets

FindDatasetsBuilder Objects

class FindDatasetsBuilder()

Find Datasets Builder


with_organization_name

def with_organization_name(organization_name: str) -> "FindDatasetsBuilder"

Set organization name

Arguments:

  • organization_name str - The name of the organization that owns the data sets.

Returns:

  • FindDatasetsBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization_name")


with_format

def with_format(format_data: str) -> "FindDatasetsBuilder"

Formats the flat entities data based on the specified format (‘dict’, or ‘pandas’). By default, the data is returned as a dictionary.

Arguments:

  • format_data str - The format to use for the data.

Example:

builder.with_format(‘dict’) builder.with_format(‘pandas’)

Returns:

  • FindDatasetsBuilder - Returns itself to allow for method chaining.


with_identifier

def with_identifier(identifier: str) -> "FindDatasetsBuilder"

set the dataset identifier.

Arguments:

  • identifier str - The identifier of the dataset.

Returns:

  • FindDatasetsBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("dataset_id")


with_config_file

def with_config_file(config_file: str,
                     section: str,
                     config_key: str,
                     prefer: str = "auto") -> "FindDatasetsBuilder"

Reads a value from the INI and saves it as a source. ‘prefer’ controls whether the value will be interpreted as identifier, name, or auto (first id, then name).

Arguments:

  • config_file str - Path to the INI file to read.
  • section str - The section of the INI file the value lives in.
  • config_key str - The key holding the value.
  • prefer str - How to read the value: ‘identifier’, ’name’, or ‘auto’ to try the identifier first and fall back to the name. Defaults to ‘auto’.


with_name

def with_name(find_name: str) -> "FindDatasetsBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the dataset.

Returns:

  • FindDatasetsBuilder - Returns self for chaining.

Example:

builder.with_name('dataset_name')


with_env

def with_env(env_key: str, prefer: str = "auto") -> "FindDatasetsBuilder"

Use an environment variable as the source. ‘prefer’ can be:

  • ‘identifier’ -> treat the value as an identifier
  • ’name’ -> treat the value as a name
  • ‘auto’ -> try identifier and, if not, name

Arguments:

  • env_key str - The name of the environment variable to read.
  • prefer str - How to read the value: ‘identifier’, ’name’, or ‘auto’ to try the identifier first and fall back to the name. Defaults to ‘auto’.


find_all

def find_all() -> "FindDatasetsBuilder"

Searches for all available data sets resources.

Returns:

  • FindDatasetsBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').find_all()


find_one

def find_one() -> "FindDatasetsBuilder"

Searches for a single dataset resource by its identifier.

This method prepares the request to find a specific dataset based on its identifier. The identifier is obtained automatically if not explicitly defined or can be obtained from a configuration file or environment variables.

Returns:

  • FindDatasetsBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_organization_name("organization_name").with_format("dict").with_identifier("identifier").find_one().build().execute()


build

def build() -> "FindDatasetsBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • FindDatasetsBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> Response

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.datasets

File Connector

opengate_data.file_connector.file_connector

FileConnectorBuilder Objects

class FileConnectorBuilder()

File Connector Builder


with_organization_name

def with_organization_name(organization_name: str) -> "FileConnectorBuilder"

Set organization name

Arguments:

  • organization_name str - The name of the organization the files belong to.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization_name")


with_overwrite_files

def with_overwrite_files(overwrite_files: bool) -> "FileConnectorBuilder"

Set the overwrite file.

Arguments:

  • overwrite_files bool - Whether an upload replaces a file that already exists.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.


add_local_file

def add_local_file(local_file: str) -> "FileConnectorBuilder"

Add a single local file to be uploaded.

You can call this method multiple times or combine it with add_local_multiple_files().

Arguments:

  • local_file str - Local file path to be uploaded.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.add_local_file("data/file1.csv")


add_local_multiple_files

def add_local_multiple_files(local_files: list[str]) -> "FileConnectorBuilder"

Add multiple local files to be uploaded.

The provided list can include one or more filesystem paths. They will be appended to the same internal collection used by add_local_file, so you can freely combine both methods:

builder.add_local_file(“foo.zip”).add_local_multiple_files([“bar.zip”, “baz.tar”])

Arguments:

  • local_files list[str] - List of file paths to upload.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.


with_format

def with_format(format_data: str) -> "FileConnectorBuilder"

Formats the flat entities data based on the specified format (‘dict’, or ‘pandas’). By default, the data is returned as a dictionary.

Arguments:

  • format_data str - The format to use for the data.

Example:

builder.with_format(‘dict’) builder.with_format(‘pandas’)

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.


with_destiny_path

def with_destiny_path(path: str) -> "FileConnectorBuilder"

Set destiny path

Arguments:

  • path str - The remote directory the operation works on. A trailing slash is added if missing.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.with_destiny_path("path")


with_find_name

def with_find_name(find_file_name: str) -> "FileConnectorBuilder"

Set find by name

Arguments:

  • find_file_name str - The name of the file to look for.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.with_find_name("file.csv")


with_output_path

def with_output_path(output_path: str) -> "FileConnectorBuilder"

Set output path so that when downloading the file it is saved in that path

Arguments:

  • output_path str - The local directory a download is saved into. A trailing slash is added if missing.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.with_output_path("output_path")


add_remote_file

def add_remote_file(file: str) -> "FileConnectorBuilder"

Adds one remote file to the operation.

Call it as many times as needed, or combine it with add_remote_multiple_files().

Arguments:

  • file str - The name of the remote file.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.add_remote_file("file.csv")


add_remote_multiple_files

def add_remote_multiple_files(files: list) -> "FileConnectorBuilder"

Adds several remote files to the operation at once.

The list is appended to the same collection add_remote_file() fills, so both can be combined.

Arguments:

  • files list - The names of the remote files.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.add_remote_multiple_files(["file1.csv", "file2.csv"])


from_dataframe

def from_dataframe(df: "pd.DataFrame",
                   *,
                   defaults: dict | None = None) -> "FileConnectorBuilder"

Assign a DataFrame that describes operations per row. Expected columns (depending on method):

  • upload: local_file [req], destiny_path [opt], ​​overwrite [opt]
  • If there is no destiny_path, use defaults[‘destiny_path’] or defaults[‘path’] or with_destiny_path(…) or “/”
  • default overwrite = False
  • download: path [req], filename [req], output_path [opt]
  • path can come from column, defaults[‘path’], with_destiny_path(…)
  • delete: path [req], filename [opt] (empty or absent -> delete the entire path)

Supported defaults: {“destiny_path”: str, “path”: str, “overwrite”: bool, “output_path”: str}

NOTE: if you mix from_dataframe with setters in download (path/filenames/output_path), then you must use all THREE setters; if not, use only from_dataframe.

Arguments:

  • df pandas.DataFrame - The DataFrame holding the files to upload.
  • defaults dict | None - Values to fall back on when a row leaves a column out: “destiny_path”, “path”, “overwrite” and “output_path”.


upload

def upload() -> "FileConnectorBuilder"

Configures the builder to upload a file to the specified organization.

This method sets the internal state of the builder to prepare for a file upload operation. It does not execute the operation immediately but prepares the necessary configurations for when the execute method is called.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.upload()


list_all

def list_all() -> "FileConnectorBuilder"

Configures the builder to list files available in the specified organization.

This method sets the internal state of the builder to prepare for a file listing operation. It does not execute the operation immediately but prepares the necessary configurations for when the execute method is called.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.list_all()


list_one

def list_one() -> "FileConnectorBuilder"

Configures the builder to list a single file from the specified organization.

This method sets the internal state of the builder to prepare for a single file listing operation. It does not execute the operation immediately but prepares the necessary configurations for when the execute method is called.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.list_one()


download

def download() -> "FileConnectorBuilder"

Configures the builder to download a file from the specified organization.

This method sets the internal state of the builder to prepare for a file download operation. It does not execute the operation immediately but prepares the necessary configurations for when the execute method is called.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.download()


delete

def delete() -> "FileConnectorBuilder"

Selects the operation that deletes files from the file connector.

Requires with_destiny_path(). Name the files to remove with add_remote_file() or add_remote_multiple_files(); with none named, the whole path is deleted.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization").with_destiny_path(
"/to/delete"
).add_remote_file("file.csv").delete().build().execute()


build

def build() -> "FileConnectorBuilder"

Closes the chain and checks it, without sending the request.

Call it last, immediately before execute(). Use build_execute() instead to do both in one step; mixing the two raises.

Returns:

  • FileConnectorBuilder - Returns itself to allow for method chaining.

Raises:

  • RuntimeError - If called more than once.
  • Exception - If combined with build_execute().
  • ValueError - If the chain is missing a method the selected operation requires, or carries one it forbids.

Example:

builder.upload().build()


build_execute

def build_execute()

Closes the chain, checks it and sends the request in one step.

Returns:

requests.Response | dict | pandas.DataFrame: The same result as execute().

Raises:

  • RuntimeError - If combined with build() or with execute().
  • ValueError - If the chain is missing a method the selected operation requires, or carries one it forbids.

Example:

builder.with_organization_name("organization").with_destiny_path(
"/path"
).add_local_file("file.csv").upload().build_execute()


execute

def execute() -> Response

Sends the selected operation to the file connector.

Which request goes out depends on the operation chosen in the chain: upload(), list_all(), list_one(), download() or delete(). The two listing operations default to the “dict” format when with_format() was not called.

Returns:

requests.Response | dict | str | pandas.DataFrame: The listing in the requested format, the contents of a download, or a dict carrying status_code and either data or error.

Raises:

  • RuntimeError - If build() was not the last call before execute(), or if neither build() nor build_execute() was called.
  • ValueError - If no operation was selected in the chain.

Example:

builder.with_organization_name("organization").with_destiny_path(
"/path"
).list_all().build().execute()

opengate_data.file_connector

Provision

opengate_data.provision.devices.provision_device

ProvisionDeviceBuilder

ProvisionDeviceBuilder Objects

class ProvisionDeviceBuilder()

Class Provision builder


with_organization_name

def with_organization_name(organization_name: str) -> "ProvisionDeviceBuilder"

Specify the organization for the device.

Arguments:

  • organization_name str - The organization for the device.

Returns:

  • ProvisionDeviceBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "ProvisionDeviceBuilder"

Specify the identifier for the device.

Arguments:

  • identifier str - The identifier for the device.

Returns:

  • ProvisionDeviceBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_flattened

def with_flattened() -> "ProvisionDeviceBuilder"

Flatten the data

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_flattened()


with_utc

def with_utc() -> "ProvisionDeviceBuilder"

Set UTC flag

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_utc()


with_provision_identifier

def with_provision_identifier(identifier: str) -> "ProvisionDeviceBuilder"

Set provision identifier

Arguments:

  • identifier str - The identifier to provision the device with.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_identifier("identifier")


with_provision_channel

def with_provision_channel(channel: str) -> "ProvisionDeviceBuilder"

Set provision channel

Arguments:

  • channel str - The channel to provision the device into.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_channel("channel")


with_provision_service_group

def with_provision_service_group(
        service_group: str) -> "ProvisionDeviceBuilder"

Set provision servicegroup

Arguments:

  • service_group str - The service group to provision the device into.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_service_group("emptyServiceGroup")


with_provision_organization

def with_provision_organization(organization: str) -> "ProvisionDeviceBuilder"

Set provision organization

Arguments:

  • organization str - The organization to provision the device into.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_service_group("organization_name")


add_provision_datastream_value

def add_provision_datastream_value(datastream: str,
                                   value: Any) -> "ProvisionDeviceBuilder"

Add a datastream value to the payload.

Arguments:

  • datastream str - The datastream identifier.
  • value Any - The value to be added. It Can be a primitive type or a complex object.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

location_value = {
- `"position"` - {
- `"coordinates"` - [
-3.66131084,
40.458442
]
}
}
builder.add_provision_datastream_value("provision.device.location", location_value)
builder.add_provision_datastream_value("provision.device.name", "Name")


from_dict

def from_dict(dct: dict[str, Any]) -> "ProvisionDeviceBuilder"

Loads data as a python dictionary. If you want to enter the dictionary in flattened mode, you need to use with_flattened().

Arguments:

  • dct dict - The dictionary variable.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

# Mode flattened
builder.with_flattened().from_dict(
{"resourceType":{"_value":{"_current":{"value":"entity.device"}}},
"provision.device.identifier":{"_value":{"_current":{"value":"identifier"}}},
"provision.administration.organization":{"_value":{"_current":{"value":"organization"}}},
"provision.administration.channel":{"_value":{"_current":{"value":"default_channel"}}},
"provision.administration.serviceGroup":{"_value":{"_current":{"value":"emptyServiceGroup"}}},
"provision.device.location":{"_value":{"_current":{"value":{"position":{"coordinates":[-3.66131084,40.458442]}}}}},

# Mode without flattened
builder.from_dict({
- `"resourceType"` - {
- `"_current"` - {
- `"value"` - "entity.device"
}
},
- `"provision"` - {
- `"administration"` - {
- `"channel"` - {
- `"_current"` - {
- `"value"` - "battery_channel"
}
},
- `"organization"` - {
- `"_current"` - {
- `"value"` - "battery_organization"
}
},
- `"serviceGroup"` - {
- `"_current"` - {
- `"value"` - "emptyServiceGroup"
}
}
},
- `"device"` - {
- `"identifier"` - {
- `"_current"` - {
- `"value"` - "worker_battery_id"
}
}
}
}
})


from_dataframe

def from_dataframe(df: pd.DataFrame) -> "ProvisionDeviceBuilder"

Loads data as a pandas DataFrame. Columns must be the names of the datastreams separated with ‘_’ or ‘.’.

Arguments:

  • df pd.DataFrame - The DataFrame variable.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining.

Example:

import pandas as pd
data = {
- `'provision_administration_organization_current_value'` - ['base_organization','test_organization'],
- `'provision_device_location_current_value_position_type'` - ['Point','Other_Point'],
- `'provision_device_location_current_value_position_coordinates'` - [[-3.7028,40.41675],[-5.7028,47.41675]],
- `'provision_device_location_current_value_postal'` - ['28013','28050']
}
df = pd.DataFrame(df)
builder.from_dataframe(df)


find_one

def find_one() -> "ProvisionDeviceBuilder"

Retrieve a single device.

This method sets up the ProvisionDeviceBuilder instance to retrieve a specific assey associated with the specified organization and identifier.

Returns:

  • ProvisionDeviceBuilder - The instance of the ProvisionDeviceBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name").with_identifier("model_identifier").find_one()


create

def create() -> "ProvisionDeviceBuilder"

Initiates the creation process of a new device.

This method prepares the ProvisionDeviceBuilder instance to create a new device.

Returns:

  • ProvisionDeviceBuilder - The instance of the ProvisionDeviceBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name")
.with_provision_identifier("provision_identifier")
.with_provision_organization("provision_organization")
.with_provision_channel("provision_channel")
.with_provision_service_group("provision_service_group")
.add_provision_datastream_value("provision.device.name", "Name")
.create()


update

def update() -> "ProvisionDeviceBuilder"

Update an existing device.

This method sets up the ProvisionDeviceBuilder instance to update a specific device associated with the specified organization and identifier.

You can update a device with a flattened format sending a PUT request using the URL above. You must replace {identifier} with the identifier of the device you want to update. Also, it is sent a boolean parameter, flattened, to allow sending a flattened JSON format

Returns:

  • ProvisionDeviceBuilder - The instance of the ProvisionDeviceBuilder class itself, allowing for method chaining.

Example:

dict_flatenned = {“resourceType”:{"_value":{"_current":{“value”:“entity.device”}}}, “provision.device.identifier”:{"_value":{"_current":{“value”:“ManuEntityTests”}}}, “provision.administration.organization”:{"_value":{"_current":{“value”:“orgnization_name”}}}, “provision.administration.channel”:{"_value":{"_current":{“value”:“default_channel”}}}, “provision.administration.serviceGroup”:{"_value":{"_current":{“value”:“emptyServiceGroup”}}},

builder.with_organization_name("organization_name").with_identifier("model_identifier").with_flattened().from_dict(dict_flatenned).update()


delete

def delete() -> "ProvisionDeviceBuilder"

Delete an existing device.

This method sets up the ProvisionDeviceBuilder instance to delete a specific device associated with the specified organization and identifier.

Returns:

  • ProvisionDeviceBuilder - The instance of the ProvisionDeviceBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name('organization_name').with_identifier("identifier").delete()


build

def build() -> "ProvisionDeviceBuilder"

Finalizes the construction of the device configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • ProvisionDeviceBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> str | dict[str, str | int]

Execute the configured device and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.provision.devices

opengate_data.provision.bulk.provision_bulk

ProvisionBulkBuilder Objects

class ProvisionBulkBuilder()

Provision Bulk Builder

Provisions many entities in a single request, which is the way to go when a per-entity call would mean thousands of them. The payload can come from a file — from_json(), from_csv(), from_excel() — or from memory, with from_dataframe() or from_dict().

with_bulk_action() chooses what to do with the rows — CREATE by default, UPDATE, PATCH or DELETE — and with_bulk_type() what they are, ENTITIES by default or TICKETS. Close the chain with build() and execute(), or with build_execute().

Example:

builder = client.new_provision_bulk_builder()
builder.with_organization_name("organization").from_csv(
"entities.csv"
).with_bulk_action("CREATE").build().execute()


with_organization_name

def with_organization_name(organization_name: str) -> "ProvisionBulkBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization name that we want to bulk data.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name('organization_name')


with_bulk_action

def with_bulk_action(bulk_action: str) -> "ProvisionBulkBuilder"

Adds the bulk action to the constructor and validates the type.

Arguments:

  • bulk_action str - The bulk action. You can choose between these actions:
    • CREATE (default)
    • UPDATE
    • PATCH
    • DELETE

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If the bulk action isn’t one of the mentioned above.

Example:

builder.with_bulk_action('bulk_action')


with_bulk_type

def with_bulk_type(bulk_type: str) -> "ProvisionBulkBuilder"

Adds the bulk type to the constructor and validates the type.

Arguments:

  • bulk_type str - The bulk type. You can choose between these types:
    • ENTITIES (default)
    • TICKETS

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If the bulk type isn’t one of the mentioned above.

Example:

builder.with_bulk_type('bulk_type')


from_json

def from_json(path: str) -> "ProvisionBulkBuilder"

Loads data as a json file.

Arguments:

  • path str - The path to the json file.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Raises:

  • FileNotFoundError - If the path isn’t correct or the file doesn’t exist in the selected folder.

Example:

builder.from_json('path_to_json.json')


from_csv

def from_csv(path: str) -> "ProvisionBulkBuilder"

Loads data as a csv file.

Arguments:

  • path str - The path to the csv file.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Raises:

  • FileNotFoundError - If the path isn’t correct or the file doesn’t exist in the selected folder.

Example:

builder.from_csv('path_to_csv.csv')


from_excel

def from_excel(path: str) -> "ProvisionBulkBuilder"

Loads data as an Excel file (supports xls and xlsx).

Arguments:

  • path str - The path to the Excel file.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Raises:

  • FileNotFoundError - If the path isn’t correct or the file doesn’t exist in the selected folder.

Example:

builder.from_excel('path_to_excel.xls')


from_dataframe

def from_dataframe(df: pd.DataFrame) -> "ProvisionBulkBuilder"

Loads data as a pandas DataFrame. Columns must be the names of the datastreams separated with ‘_’ or ‘.’.

Arguments:

  • df pd.DataFrame - The DataFrame variable.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Example:

import pandas as pd
data = {
- `'provision_administration_organization_current_value'` - ['base_organization','test_organization'],
- `'provision_device_location_current_value_position_type'` - ['Point','Other_Point'],
- `'provision_device_location_current_value_position_coordinates'` - [[-3.7028,40.41675],[-5.7028,47.41675]],
- `'provision_device_location_current_value_postal'` - ['28013','28050']
}
df = pd.DataFrame(df)
builder.from_dataframe(df)


from_dict

def from_dict(dct: dict[str, Any]) -> "ProvisionBulkBuilder"

Loads data as a python dictionary (same structure as ‘from_json’).

Arguments:

  • dct dict - The dictionary variable.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining.

Example:

builder.from_dict({ … “entities”: [ … { … “provision”: { … “administration”: { … “organization”: {"_current": {“value”: “my_org”}} … }, … “asset”: { … “identifier”: {"_current": {“value”: “asset_123”}} … } … } … } … ] … })


build

def build() -> "ProvisionBulkBuilder"

Finalizes the construction of the provision bulk configuration.

This method prepares the builder to execute the request by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the request to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the organization name are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • ProvisionBulkBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute(include_payload=False)

Executes the provision bulk immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step. It should be used when you want to build and execute the configuration without modifying the builder state in between these operations.

It first validates the build configuration and then executes the request if the validation is successful.

Arguments:

  • include_payload bool - Determine if the payload should be included in the response.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance, indicating that build_execute is being incorrectly used after build.
  • Exception - If there are issues during the execution process, including network or API errors.

Example:

response = builder.build_execute()


execute

def execute(include_payload=False)

Executes the provision bulk based on the current configuration of the builder.

Arguments:

  • include_payload bool - Determine if the payload should be included in the response.

Returns:

  • Dict - A dictionary containing the execution response which includes the status code and, optionally, the payload. If an error occurs, a string describing the error is returned.

Raises:

  • Exception - If build() has not been called before execute(), or if it was not the last method invoked prior to execute().

Example:

builder.build()
response = builder.execute(True)

opengate_data.provision.bulk

opengate_data.provision.processor

opengate_data.provision.processor.provision_processor

ProvisionProcessorBuilder

ProvisionProcessorBuilder Objects

class ProvisionProcessorBuilder()

Provision Processor Builder


with_organization_name

def with_organization_name(
        organization_name: str) -> "ProvisionProcessorBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(
        provision_processor_id: str) -> "ProvisionProcessorBuilder"

Specify the identifier for the provision processor.

Arguments:

  • provision_processor_id str - The identifier for the pipeline.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_name

def with_name(provision_processor_name: str) -> "ProvisionProcessorBuilder"

Specify the name for the provision processor.

Arguments:

  • provision_processor_name str - The name for the provision processor.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_name('name')


with_bulk_file

def with_bulk_file(bulk_file: str) -> "ProvisionProcessorBuilder"

Specify the file for bulk processing.

Arguments:

  • bulk_file str - The path to the file to be uploaded for bulk processing.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

bulk_file_path = os.path.join(os.path.dirname(__file__), 'file.xlsx')
builder.with_bulk_file('bulk_file_path')


with_bulk_process_identitifer

def with_bulk_process_identitifer(
        bulk_process_id: str) -> "ProvisionProcessorBuilder"

Specify the identifier for the bulk process identifier.

Arguments:

  • bulk_process_id str - The identifier for the bulk process.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_bulk_process_identitifer('identifier')


bulk

def bulk() -> "ProvisionProcessorBuilder"

Configure the builder for bulk provisioning.

This method sets the necessary headers and URL for performing a bulk provisioning operation.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

bulk_file_path = os.path.join(os.path.dirname(__file__), 'file.xlsx')
builder.with_organization_name('organization_name').with_identifier('identifier').with_bulk_file(bulk_file_path).bulk()


find_by_name

def find_by_name() -> "ProvisionProcessorBuilder"

Configure the builder to find a provision processor by name.

This method sets the necessary headers and URL for finding a provision processor by its name.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name').with_name('provision_processor_name').find_by_name()


bulk_status

def bulk_status() -> "ProvisionProcessorBuilder"

Configure the builder to check the status of a bulk process.

This method sets the necessary headers and URL for checking the status of a bulk process.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name').with_bulk_process_identitifer('bulk_process_id').bulk_status()


bulk_details

def bulk_details() -> "ProvisionProcessorBuilder"

Configure the builder to get the details of a bulk process.

This method sets the necessary headers and URL for retrieving the details of a bulk process.

Returns:

  • ProvisionProcessorBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name').with_bulk_process_identitifer('bulk_process_id').bulk_details()


build

def build() -> "ProvisionProcessorBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • ProvisionProcessorBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> requests.Response

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.build_execute()

opengate_data.provision.asset.provision_asset

ProvisionAssetBuilder Objects

class ProvisionAssetBuilder()

Provision Asset Builder

Provisions assets: creates them, reads one, updates and deletes. Describe the asset with the with_provision_* setters and add_provision_datastream_value(), or hand over a whole payload with from_dict() or from_dataframe(). Then pick the operation — create(), find_one(), update(), delete() — and close the chain with build() and execute(), or with build_execute().

Example:

builder = client.new_provision_asset_builder()
builder.with_organization_name("organization").with_provision_identifier(
"asset_identifier"
).with_provision_channel("channel").create().build().execute()


with_organization_name

def with_organization_name(organization_name: str) -> "ProvisionAssetBuilder"

Specify the organization for the asset.

Arguments:

  • organization_name str - The organization for the asset.

Returns:

  • ProvisionAssetBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "ProvisionAssetBuilder"

Specify the identifier for the asset.

Arguments:

  • identifier str - The identifier for the asset.

Returns:

  • ProvisionAssetBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_flattened

def with_flattened() -> "ProvisionAssetBuilder"

Flatten the data

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_flattened()


with_utc

def with_utc() -> "ProvisionAssetBuilder"

Set UTC flag

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_utc()


with_provision_identifier

def with_provision_identifier(identifier: str) -> "ProvisionAssetBuilder"

Set provision identifier

Arguments:

  • identifier str - The identifier to provision the asset with.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_identifier("identifier")


with_provision_channel

def with_provision_channel(channel: str) -> "ProvisionAssetBuilder"

Set provision channel

Arguments:

  • channel str - The channel to provision the asset into.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_channel("channel")


with_provision_service_group

def with_provision_service_group(
        service_group: str) -> "ProvisionAssetBuilder"

Set provision servicegroup

Arguments:

  • service_group str - The service group to provision the asset into.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_service_group("emptyServiceGroup")


with_provision_organization

def with_provision_organization(organization: str) -> "ProvisionAssetBuilder"

Set provision organization

Arguments:

  • organization str - The organization to provision the asset into.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

builder.with_provision_service_group("organization_name")


add_provision_datastream_value

def add_provision_datastream_value(datastream: str,
                                   value: Any) -> "ProvisionAssetBuilder"

Add a datastream value to the payload.

Arguments:

  • datastream str - The datastream identifier.
  • value Any - The value to be added. It Can be a primitive type or a complex object.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

location_value = {
- `"position"` - {
- `"coordinates"` - [
-3.66131084,
40.458442
]
}
}
builder.add_provision_datastream_value("provision.asset.location", location_value)
builder.add_provision_datastream_value("provision.asset.name", "Name")


from_dict

def from_dict(dct: dict[str, Any]) -> "ProvisionAssetBuilder"

Loads data as a python dictionary. If you want to enter the dictionary in flattened mode, you need to use with_flattened().

Arguments:

  • dct dict - The dictionary variable.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

# Mode flattened
builder.with_flattened().from_dict(
{"resourceType":{"_value":{"_current":{"value":"entity.asset"}}},
"provision.asset.identifier":{"_value":{"_current":{"value":"identifier"}}},
"provision.administration.organization":{"_value":{"_current":{"value":"organization"}}},
"provision.asset.description":{"_value":{"_current":{"value":"Descripcion"}}},
"provision.administration.channel":{"_value":{"_current":{"value":"default_channel"}}},
"provision.administration.serviceGroup":{"_value":{"_current":{"value":"emptyServiceGroup"}}},
"provision.asset.location":{"_value":{"_current":{"value":{"position":{"coordinates":[-3.66131084,40.458442]}}}}},
"provision.human.name":{"_value":{"_current":{"value":"Name"}}},
"provision.human.surname":{"_value":{"_current":{"value":"Surname"}}}})

# Mode without flattened
builder.from_dict({
- `"resourceType"` - {
- `"_current"` - {
- `"value"` - "entity.asset"
}
},
- `"provision"` - {
- `"administration"` - {
- `"channel"` - {
- `"_current"` - {
- `"value"` - "battery_channel"
}
},
- `"organization"` - {
- `"_current"` - {
- `"value"` - "battery_organization"
}
},
- `"serviceGroup"` - {
- `"_current"` - {
- `"value"` - "emptyServiceGroup"
}
}
},
- `"asset"` - {
- `"identifier"` - {
- `"_current"` - {
- `"value"` - "worker_battery_id"
}
}
}
}
})


from_dataframe

def from_dataframe(df: pd.DataFrame) -> "ProvisionAssetBuilder"

Loads data as a pandas DataFrame. Columns must be the names of the datastreams separated with ‘_’ or ‘.’.

Arguments:

  • df pd.DataFrame - The DataFrame variable.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining.

Example:

import pandas as pd
data = {
- `'provision_administration_organization_current_value'` - ['base_organization','test_organization'],
- `'provision_device_location_current_value_position_type'` - ['Point','Other_Point'],
- `'provision_device_location_current_value_position_coordinates'` - [[-3.7028,40.41675],[-5.7028,47.41675]],
- `'provision_device_location_current_value_postal'` - ['28013','28050']
}
df = pd.DataFrame(df)
builder.from_dataframe(df)


find_one

def find_one() -> "ProvisionAssetBuilder"

Retrieve a single asset.

This method sets up the ProvisionAssetBuilder instance to retrieve a specific assey associated with the specified organization and identifier.

Returns:

  • ProvisionAssetBuilder - The instance of the ProvisionDeviceBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name").with_identifier("model_identifier").find_one()


create

def create() -> "ProvisionAssetBuilder"

Initiates the creation process of a new asset.

This method prepares the ProvisionAssetBuilder instance to create a new asset.

Returns:

  • ProvisionAssetBuilder - The instance of the ProvisionAssetBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name")
.with_provision_identifier("provision_identifier")
.with_provision_organization("provision_organization")
.with_provision_channel("provision_channel")
.with_provision_service_group("provision_service_group")
.add_provision_datastream_value("provision.asset.name", "Name")
.create()


update

def update() -> "ProvisionAssetBuilder"

Update an existing asset.

This method sets up the ProvisionAssetBuilder instance to update a specific asset associated with the specified organization and identifier.

You can update an asset with a flattened format sending a PUT request using the URL above. You must replace {identifier} with the identifier of the asset you want to update. Also, it is sent a boolean parameter, flattened, to allow sending a flattened JSON format

Returns:

  • ProvisionAssetBuilder - The instance of the ProvisionAssetBuilder class itself, allowing for method chaining.

Example:

dict_flatenned = {“resourceType”:{"_value":{"_current":{“value”:“entity.asset”}}}, “provision.asset.identifier”:{"_value":{"_current":{“value”:“EntityTest”}}}, “provision.administration.organization”:{"_value":{"_current":{“value”:“orgnization_name”}}}, “provision.administration.channel”:{"_value":{"_current":{“value”:“default_channel”}}}, “provision.administration.serviceGroup”:{"_value":{"_current":{“value”:“emptyServiceGroup” }}},

builder.with_organization_name("organization_name").with_identifier("model_identifier").with_flattened().from_dict(dict_flatenned).update()


delete

def delete() -> "ProvisionAssetBuilder"

Delete an existing asset.

This method sets up the ProvisionAssetBuilder instance to delete a specific asset associated with the specified organization and identifier.

Returns:

  • ProvisionAssetBuilder - The instance of the ProvisionAssetBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name('organization_name').with_identifier("identifier").delete()


modify

def modify() -> "ProvisionAssetBuilder"

Modify an existing asset.

This method sets up the ProvisionAssetBuilder instance to update a specific asset associated with the specified organization and identifier.

You can update an asset with a flattened format sending a Patch request using the URL above. You must replace {identifier} with the identifier of the asset you want to update. Also, it is sent a boolean parameter, flattened, to allow sending a flattened JSON format

Returns:

  • ProvisionAssetBuilder - The instance of the ProvisionAssetBuilder class itself, allowing for method chaining.

Example:

dict_flatenned = {"resourceType":{"_value":{"_current":{"value":"entity.asset"}}},
"provision.asset.identifier":{"_value":{"_current":{"value":"EntityTest"}}},
"provision.administration.organization":{"_value":{"_current":{"value":"orgnization_name"}}},
"provision.administration.channel":{"_value":{"_current":{"value":"default_channel"}}},
"provision.administration.serviceGroup":{"_value":{"_current":{"value":"emptyServiceGroup" }}},


builder.with_organization_name("organization_name").with_identifier("model_identifier").with_flattened().from_dict(dict_flatenned).modify()


build

def build() -> "ProvisionAssetBuilder"

Finalizes the construction of the asset configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • ProvisionAssetBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> str | dict[str, str | int]

Execute the configured asset and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.provision.asset

opengate_data.provision

Rules

opengate_data.rules.rules

RulesBuilder

RulesBuilder Objects

class RulesBuilder()

Rules builder


with_organization_name

def with_organization_name(organization_name: str) -> "RulesBuilder"

Specify the organization name.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_organization_name('organization_name')


with_identifier

def with_identifier(identifier: str) -> "RulesBuilder"

Specify the identifier for the rule.

Arguments:

  • identifier str - The identifier for the rules.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_identifier('identifier')


with_actions

def with_actions(actions: dict[str, Any]) -> "RulesBuilder"

Specify the actions in rules.

Arguments:

  • actions dict - Actions

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

rule = {
- `"actions"` - {
- `"close"` - [
{
- `"enabled"` - False,
- `"ruleToClose"` - "rule_name",
- `"alarmToClose"` - "alarmToClose"
}
]
}
}
with_actions = rule["actions"]
builder.with_actions(with_actions)


with_actions_delay

def with_actions_delay(actions_delay: int) -> "RulesBuilder"

Waiting threshold before actions are executed. Allows cancellation of the execution of actions if another rule exists with a subsequent delay cancellation action.

Arguments:

  • actions_delay int - Delay option in milliseconds

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_actions(1000)


with_active

def with_active(active: bool) -> "RulesBuilder"

Specify the active in rules.

Arguments:

  • active bool - Activate or deactivate action

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_active(False)
builder.with_active(True)


with_channel

def with_channel(channel: str) -> "RulesBuilder"

Specify the channel in rules.

Arguments:

  • channel str - Channel

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_channel('default_channel')


with_condition

def with_condition(condition: dict[str, Any]) -> "RulesBuilder"

Specify the condition for the rule. Mandatory for EASY mode and not applicable for ADVANCED mode. JSON filter which follows the same filter structure of the Opengate platform. It can contain rule parameters.

Arguments:

  • condition dict - Specify the identifier for the rule.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

filter_builder_build = FilterBuilder().and_(FilterBuilder().eq("provision.administration.organization","Organization")).build()
builder.with_condition('filter_builder_build)
builder.with_condition({device.cpu.usage._current.value:
"$datastream:device.cpu.usage._current.value"})


with_mode

def with_mode(mode: str) -> "RulesBuilder"

Specify rule type mode

Arguments:

  • mode str - Advanced or basic.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_mode('EASY')
builder.with_mode('ADVANCED')


with_name

def with_name(name: str) -> "RulesBuilder"

Specify the name for the rule.

Arguments:

  • name str - The identifier for the rules.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_mode('name_rule')


with_description

def with_description(description: str) -> "RulesBuilder"

Specify the description.

Arguments:

  • description str - The description for the rules.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_organization_name('description')


with_type

def with_type(rule_type: dict[str, Any]) -> "RulesBuilder"

Specify the description.

Arguments:

  • rule_type dict - The description for the rules.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

- `"rule"` - {
- `"type"` - {
- `"datastreams"` - [
{
- `"name"` - "device.cpu.usage",
- `"fields"` - [
{
- `"field"` - "value",
- `"alias"` - "CPU usage"
}
],
- `"prefilter"` - False
}
],
- `"name"` - "DATASTREAM"
}
}
type = rule["type"]
builder.with_type(type)


with_parameters

def with_parameters(parameters: list[dict[str, str]]) -> "RulesBuilder"

Specify the parameters for rules.

Arguments:

  • parameters dict - The parameters for the rules.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

parameters = [
{
- `"name"` - "name",
- `"schema"` - "string",
- `"value"` - "2"
}
]
builder.with_parameters(parameters)


with_code

def with_code(code: str) -> "RulesBuilder"

Specify the JavaScript code for advanced rules.

Arguments:

  • code str - The JavaScript code to be used in the rule.

Returns:

  • RulesBuilder - Returns self for chaining.

Raises:

  • Exception - If the mode is not set to ‘ADVANCED’.

Example:

code = '''
function add(a, b) {
// This is a comment
return a + b;
}
'''
builder.with_mode('ADVANCED').with_code(code).with_code_file('code')


with_code_file

def with_code_file(code_file: str) -> "RulesBuilder"

Specify the JavaScript code for advanced rules from a file.

This method reads the JavaScript code from a specified file and converts it into a single line to be used in the rule.

Arguments:

  • code_file str - The path to the file containing the JavaScript code.

Returns:

  • RulesBuilder - Returns self for chaining.

Raises:

  • ValueError - If the file does not exist or is not a valid file.
  • ValueError - If the mode is not set to ‘ADVANCED’.

Example:

builder.with_mode('ADVANCED').with_code_file('path/to/code.js')


with_env

def with_env(data_env: str) -> "RulesBuilder"

Specify the environment variable.

Arguments:

  • data_env str - The environment variable.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_env('RULE_ID')


with_config_file

def with_config_file(config_file: str, section: str,
                     config_key: str) -> "RulesBuilder"

Sets up the configuration file (.ini).

This method allows specifying a configuration file, a section within that file, and a key to retrieve a specific value from the section.

Arguments:

  • config_file str - The path to the.ini configuration file.
  • section str - The section name within the.ini file where the desired configuration is located.
  • config_key str - The key within the specified section whose value will be retrieved.

Returns:

  • RulesBuilder - Returns itself to allow for method chaining.

Example:

[id]
rule_id = afe07216-14ec-4134-97ae-c483b11d965a
builder.with_config_file('model_config.ini', 'id', 'rule_id')


with_find_by_name

def with_find_by_name(find_name: str) -> "RulesBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the pipeline.

Returns:

  • RulesBuilder - Returns self for chaining.

Example:

builder.with_find_by_name('name_rule')


find_all

def find_all() -> "RulesBuilder"

Retrieve all models.

This method sets up the RulesBuilder instance to retrieve all rules associated with the specified organization.

Returns:

  • RulesBuilder - The instance of the RulesBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization_name").find_all()


find_one

def find_one() -> "RulesBuilder"

Retrieve all models.

This method sets up the RulesBuilder instance to retrieve all rules associated with the specified organization.

Returns:

  • RulesBuilder - The instance of the RulesBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name('organization').with_channel(
'default_channel'
).with_identifier('4ae733b0-2dc6-4ad4-9d2c-9ab426c9f32d').find_one().build().execute()


create

def create() -> "RulesBuilder"

Initiates the creation process of a new model.

This method prepares the RulesBuilder instance to create a new model by setting up the necessary parameters such as the organization name and the file to be associated with the model. It also specifies the URL endpoint for creating the model and sets the operation type to ‘create’.

Returns:

  • RulesBuilder - The instance of the RulesBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name("organization").with_channel(
"default_channel"
).with_name("rule_name").with_mode("EASY").create().build().execute()


update

def update() -> "RulesBuilder"

Update an existing rule.

This method sets up the RulesBuilder instance to update a specific rule associated with the specified organization and identifier.

Returns:

  • RulesBuilder - The instance of the RulesBuilder class itself, allowing for method chaining.

Example:

rule = {
- `"identifier"` - "9482a13d-ade5-46ec-b6c9-1cfc23f1f2c6",
- `"name"` - "avanzado22",
- `"active"` - False,
- `"mode"` - "ADVANCED",
- `"type"` - {
- `"datastreams"` - [
{
- `"name"` - "device.cpu.usage",
- `"fields"` - [
{
- `"field"` - "value",
- `"alias"` - "CPU usage"
}
],
- `"prefilter"` - False
}
],
- `"name"` - "DATASTREAM"
},
- `"actionsDelay"` - 1000
}

with_type = rule["type"]
with_type(with_type).
with_actions_delay(rule["actionsDelay"]).
with_code_file('reglas_update.js').
update()


delete

def delete() -> "RulesBuilder"

Delete an existing model within the organization.

This method sets up the RulesBuilder instance to delete a specific model associated with the specified organization and identifier. It configures the URL endpoint for the delete operation and sets the operation type to ‘delete’.

Returns:

  • RulesBuilder - The instance of the RulesBuilder class itself, allowing for method chaining.

Example:

builder.with_organization_name('organization_name').with_channel(
'default_channel'
).with_identifier("45ddc1a9-4de2-4d5f-a9fe-7972aa4555a4").delete().build().execute()


update_parameters

def update_parameters() -> "RulesBuilder"

Updates the parameters of an existing rule.

This function prepares the RulesBuilder instance to update the parameters of a specific rule associated with the specified organization and channel.

Returns:

  • RulesBuilder - The RulesBuilder instance itself, allowing method chaining.

Example:

builder.with_organization_name("organization_name").with_channel("default_channel").
with_name("rule_name").with_active(True).with_mode("ADVANCED").
- `with_parameters({"parameter1"` - "value1", "parameter2": "value2"}).update_parameters()


catalog

def catalog() -> "RulesBuilder"

Retrieves the rules catalog.

This function prepares the RulesBuilder instance to retrieve the catalog of rules

Returns:

  • RulesBuilder - The RulesBuilder instance itself, allowing method chaining.

Example:

builder.catalog()


save

def save() -> "RulesBuilder"

Selects the create-or-update operation.

It reads the rule identifier from the .env variable set with with_env(), or from the file set with with_config_file(), and then decides on its own: if a rule with that identifier already exists it is updated, and if it does not, it is created and the resulting identifier written back to the same place. Use it when a script has to be safe to run more than once.

Returns:

  • RulesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization").with_config_file(
"rules_config.ini", "id", "rule_id"
).save().build().execute()


set_config_file_identifier

def set_config_file_identifier() -> "RulesBuilder"

Selects the operation that writes the rule identifier into a configuration file.

It stores the identifier given to with_identifier() under the section and key named with with_config_file(), so a later run can pick the rule up from the file instead of carrying its identifier in the code. The key must already exist in the file.

Returns:

  • RulesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("rule_identifier").with_config_file(
'rules_config.ini', 'id', 'rule_id'
).set_config_file_identifier().build().execute()


set_env_identifier

def set_env_identifier() -> "RulesBuilder"

Selects the operation that writes the rule identifier into the .env file.

It stores the identifier given to with_identifier() under the variable named with with_env(), so a later run can pick the rule up from the environment. The variable must already exist in the .env file.

Returns:

  • RulesBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If there is no identifier to write, or if the variable is not in the .env file.

Example:

builder.with_identifier("rule_identifier").with_env(
"RULE_ID"
).set_env_identifier().build().execute()


build

def build() -> "RulesBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • RulesBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the data sets search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute()

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.rules

Searching

opengate_data.searching.filter

FilterBuilder Objects

class FilterBuilder(Expressions)

Filter Builder


and_

def and_(*conditions)

Combines conditions using the logical AND operator.

Arguments:

  • *conditions - The conditions to combine.

Returns:

  • FilterBuilder - Returns itself to allow for method chaining.

Example:

builder.and_(eq(“device.operationalStatus”, “NORMAL”), like(“device.name”, “device_.*”) )


or_

def or_(*conditions)

Combines conditions using the logical OR operator.

Arguments:

  • *conditions - The conditions to combine.

Returns:

  • FilterBuilder - Returns itself to allow for method chaining.

Example:

builder.or_(eq(“device.operationalStatus”, “NORMAL”), like(“device.name”, “device_.*”) )


build

def build()

Builds the final filter.

Returns:

  • dict - The final filter.

Raises:

  • ValueError - If there is an incomplete condition.

Example:

builder.build()

opengate_data.searching.search_base

SearchBuilderBase Objects

class SearchBuilderBase()

Search Base Builder


build

def build()

Finalizes the construction of the search configuration.


build_execute

def build_execute()

Short-cut for build().execute()


with_format

def with_format(format_data: str) -> "SearchBuilderBase"

Formats the flat entities data based on the specified format (‘csv’, ‘dict’, or ‘pandas’).

Arguments:

  • format_data str - The format to use for the data.

Example:

builder.with_format(‘dict’) builder.with_format(‘csv’) builder.with_format(‘pandas’)

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.


with_flattened

def with_flattened() -> "SearchBuilderBase"

Flatten the data

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.


with_utc

def with_utc() -> "SearchBuilderBase"

Set UTC flag

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.


with_summary

def with_summary() -> "SearchBuilderBase"

Set summary flag

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.


with_default_sorted

def with_default_sorted() -> "SearchBuilderBase"

Set default sorted flag

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.


with_case_sensitive

def with_case_sensitive() -> "SearchBuilderBase"

Set case-sensitive flag

Returns:

  • SearchBuilderBase - Returns itself to allow for method chaining.

opengate_data.searching.select

SelectBuilder Objects

class SelectBuilder()

A flexible builder for constructing SELECT clauses for several OpenGate entities.

This builder supports three independent modes, which cannot be mixed inside the same instance:

  1. Simple mode (Datasets, Timeseries search):
  • .add("field_name")
  • Produces: [“field1”, “field2”, …]
  1. Extended mode (Structured search):
  • .add("path.to.resource", ["field", ("other", "alias")])
  • Produces: [ { “name”: “…”, “fields”: [{ “field”: “…”, “alias”: “…” }] } ]
  1. Column mode (Timeseries EXPORT):
  • .add_column("FIRST")
  • .add_column("bucket_id", output={"parquet": {"type": "INT"}})
  • Produces: [ { “column”: “FIRST” }, { “column”: “bucket_id”, “output”: {…} } ]

You cannot mix modes. Each builder instance must use only one mode.

Examples:

Simple mode: SelectBuilder().add(“Gross”).add(“Temp”)

Extended mode: SelectBuilder().add(“provision.device.identifier”, [(“value”, “id”), “date”])

Column mode (Timeseries Export): SelectBuilder().add_column(“FIRST”).add_column(“LAST”)

Use .build() to retrieve the final SELECT list.


add

def add(name: str, fields=None)

Add a SELECT entry in either simple or extended mode.

Arguments:

  • name str - Field name (simple mode) or entity name (extended mode).
  • fields list, optional - Only for extended mode; list of strings or tuples (field, alias).

Returns:

  • SelectBuilder - fluent API.


add_column

def add_column(column_name: str, output: dict | None = None)

Add a Timeseries Export column entry.

Produces backend-compatible objects like: { “column”: “FIRST” } { “column”: “bucket_id”, “output”: {…} }

Arguments:

  • column_name str - Name of the export column.
  • output dict, optional - Optional output descriptor such as: { “parquet”: { “type”: “INT” } } { “name”: “serial_number”, “parquet”: { “type”: “STRING” } }

Returns:

  • SelectBuilder - fluent API.


build

def build()

Return the constructed SELECT list.

Raises:

  • ValueError - If no select elements were added.

Returns:

  • list - Dicts (column mode), strings (simple mode) or dicts (extended mode).

RulesSearchBuilder

RulesSearchBuilder Objects

class RulesSearchBuilder(SearchBuilderBase, SearchBuilder)

Rules Search Builder


with_format

def with_format(format_data: str) -> "RulesSearchBuilder"

Formats the flat entities data based on the specified format (‘dict’, or ‘pandas’).

Arguments:

  • format_data str - The format to use for the data.

Returns:

  • RulesSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_format("dict")
builder.with_format("pandas")


execute

def execute()

Executes the rule search based on the built configuration.

Returns:

  • dict - The response data.

Raises:

  • Exception - If the build() method was not called before execute().

Example:

new_rules_search_builder.with_filter(filter).with_format("dict").build_execute()
new_rules_search_builder.with_filter(filter).with_format("pandas").build_execute()

AlarmSearchBuilder

AlarmSearchBuilder Objects

class AlarmSearchBuilder(SearchBuilderBase, SearchBuilder)

Alarm Search Builder

Searches the alarms raised by the platform’s rules, over /v80/search/entities/alarms. Compose the query with the inherited with_filter, with_select, with_limit and with_format methods, then close it with build() and execute(), or with build_execute().

Example:

builder = client.new_alarm_search_builder()
filter_open = client.new_filter_builder().eq("alarm.status", "OPEN").build()
builder.with_filter(filter_open).with_format("pandas").build_execute()


validate_builds

def validate_builds()

Checks the combination of methods called before the search is sent.

Returns:

  • AlarmSearchBuilder - Returns itself to allow for method chaining.

Raises:

  • ValueError - If with_format received something other than “dict”, “csv” or “pandas”.
  • Exception - If “csv” is combined with with_limit, or used without with_select — the CSV output needs to know its columns.


execute

def execute()

Executes the alarm search based on the built configuration.

with_summary() switches the request to /search/entities/alarms/summary and returns the aggregated counters instead of the alarms themselves.

Returns:

str | pandas.DataFrame: A JSON string for the “dict” format, raw text for “csv”, or a DataFrame of flattened records for “pandas”.

Raises:

  • Exception - If build() was not the last call before execute(), or if neither build() nor build_execute() was called.

Example:

builder.with_filter(filter_open).with_format("dict").build().execute()

OperationsBuilder

OperationsSearchBuilder Objects

class OperationsSearchBuilder(SearchBuilderBase, SearchBuilder)

Builder Operations Search


execute

def execute()

Executes the operation search based on the built configuration.

Returns:

dict, csv or dataframe: The response data in the specified format.

Raises:

  • Exception - If the build() method was not called before execute().

Example:

new_operations_search_builder.with_format("csv").build().execute()
new_operations_search_builder.with_filter(filter).with_format("pandas").build().execute()
new_operations_search_builder.with_filter(filter).with_format("dict").build().execute()

DatasetsSearchBuilder

DatasetsSearchBuilder Objects

class DatasetsSearchBuilder(SearchBuilderBase, SearchBuilder)

Dataset Search Builder


with_organization_name

def with_organization_name(organization_name: str) -> "DatasetsSearchBuilder"

Set organization name

Arguments:

  • organization_name str - The name of the organization that owns the data set.

Returns:

  • DatasetsSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization_name")


with_identifier

def with_identifier(identifier: str) -> "DatasetsSearchBuilder"

Set identifier

Arguments:

  • identifier str - The identifier of the data set to query.

Returns:

  • DatasetsSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("identifier")


with_utc

def with_utc() -> "DatasetsSearchBuilder"

Set UTC

Returns:

  • DatasetsSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_utc()


with_format

def with_format(format_data: str) -> "DatasetsSearchBuilder"

Formats the flat entities data based on the specified format (‘csv’, ‘dict’, or ‘pandas’).

Arguments:

  • format_data str - The format to use for the data.

Returns:

  • DatasetsSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_format("dict")
builder.with_format("pandas")
builder.with_format("csv")


with_sort

def with_sort(sort: str) -> "DatasetsSearchBuilder"

Set the sort identifier.

The value must be the identifier of one of the sorts declared in the dataset definition “sorts” section (the auto-generated reverse sorts are also valid). When omitted, results are sorted by the identifier column ascending.

The sort is sent in the payload for every format. NOTE: the platform currently ignores the sort for ‘csv’ and ‘pandas’ exports (a server/database limitation, not an SDK decision); it is still sent so the SDK stays forward-compatible if the backend starts honoring it.

Arguments:

  • sort str - The sort identifier declared in the dataset definition.

Returns:

  • DatasetsSearchBuilder - Returns itself to allow for method chaining.

Example:

builder.with_sort("sortByProvIdentifierDesc")


add_sort_by

def add_sort_by(field_name: str, order: str) -> "DatasetsSearchBuilder"

Deprecated for datasets. The dataset search API no longer accepts the object-based sort format; sorts are now declared in the dataset definition and referenced by identifier.

Raises:

  • NotImplementedError - Always. Use with_sort() instead.


execute

def execute()

Executes the data set search based on the built configuration.

Returns:

dict, csv or dataframe: The response data in the specified format.

Raises:

  • Exception - If the build() method was not called before execute().

Example:

new_data_sets_search_builder.with_format("csv").with_organization_name(organization).build().execute()
new_data_sets_search_builder.with_filter(filter).with_organization_name(organization).with_format("pandas").build().execute()
new_data_sets_search_builder.with_filter(filter).with_organization_name(organization).with_format("dict").build().execute()

DataPointsSearchBuilder Objects

class DataPointsSearchBuilder(SearchBuilderBase, SearchBuilder)

Datapoints Search Builder


with_transpose

def with_transpose() -> "DataPointsSearchBuilder"

Enables transposing the data in the result.

This function allows the data returned by the search to be transposed, meaning that rows and columns are swapped. This can be useful for certain data analyses where it is preferred to have datastreams as columns and entities as rows.

Notes:

This function can only be used with the ‘pandas’ format.

Returns:

  • DataPointsSearchBuilder - Returns the builder instance to allow for method chaining.

Example:

builder.with_transpose()


with_mapped_transpose

def with_mapped_transpose(
        mapping: dict[str, dict[str, str]]) -> "DataPointsSearchBuilder"

Enables transposing the data with a specific mapping.

This function allows the data returned by the search to be transposed and mapped according to a provided mapping dictionary. The mapping specifies how complex data should be transformed into flat columns.

Arguments:

  • mapping dict[str, dict[str, str]] - The mapping of complex data to flat columns. The main key is the column name, and its value another dictionary defining the mapping of the substructures.

Notes:

This function can only be used with the ‘pandas’ format.

Returns:

  • DataPointsSearchBuilder - Returns the builder instance to allow for method chaining.

Example:

complexData = {
- `'device.communicationModules[].subscription.address'` - {
- `'type'` - 'type',
- `'IP'` - 'value'
}
}
builder.with_mapped_transpose(complexData)


execute

def execute()

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

Exception: If the build method has not been called or if it is not the last method invoked before execute.

  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

TimeseriesSearchBuilder Objects

class TimeseriesSearchBuilder(SearchBuilderBase, SearchBuilder)

Timeseries Search Builder


with_organization_name

def with_organization_name(
        organization_name: str) -> "TimeseriesSearchBuilder"

Set organization name

Arguments:

  • organization_name str - The name of the organization that owns the timeseries.


with_identifier

def with_identifier(identifier: str) -> "TimeseriesSearchBuilder"

Set identifier

Arguments:

  • identifier str - The identifier of the timeseries to query.


with_utc

def with_utc() -> "TimeseriesSearchBuilder"

Set UTC flag for date-time parsing


with_format

def with_format(format_data: str) -> "TimeseriesSearchBuilder"

Formats the timeseries data based on the specified format (‘csv’, ‘dict’, or ‘pandas’).

Arguments:

  • format_data str - The format to return the data in: ‘dict’, ‘csv’ or ‘pandas’.


with_sort

def with_sort(sort: str) -> "TimeseriesSearchBuilder"

Set sort identifier

Arguments:

  • sort str - The identifier of a sort declared in the timeseries definition.


execute

def execute()

Executes the timeseries search based on the built configuration.

opengate_data.searching.builder

EntitiesSearchBuilder

EntitiesSearchBuilder Objects

class EntitiesSearchBuilder(SearchBuilderBase, SearchBuilder)

Entities Search Builder


execute

def execute()

Executes the entities search based on the built configuration.

Returns:

dict, csv or dataframe: The response data in the specified format.

Raises:

  • Exception - If the build() method was not called before execute().

Example:

new_entities_search_builder.with_format("csv").with_select(select).build().execute()
new_entities_search_builder.with_filter(filter).with_format("pandas").build().execute()
new_entities_search_builder.with_filter(filter).with_format("dict").build().execute()

opengate_data.searching.search

SearchBuilder

SearchBuilder Objects

class SearchBuilder()

Search Builder


with_filter

def with_filter(filter_data: dict) -> "SearchBuilder"

Adds a filter to the search.

Arguments:

  • filter_data Union[dict, FilterBuilder] - The filter data to apply. Can be a dictionary or a FilterBuilder instance.

Returns:

  • SearchBuilder - Returns itself to allow for method chaining.

Example:

search_builder.with_filter(filter_builder.build()) search_builder.with_filter({

  • "and" - [
  • {"eq" - {“device.operationalStatus”: “NORMAL”}},
  • {"like" - {“device.communicationModules[].mobile.imei”: “351873000102290”}} ] })


with_select

def with_select(select_data: list[dict]) -> "SearchBuilder"

Adds selection criteria to the search.

Arguments:

  • select_data list[dict] | SelectBuilder - The selection criteria to apply. Can be a list of dictionaries or a SelectBuilder instance.

Returns:

  • SearchBuilder - Returns itself to allow for method chaining.


with_limit

def with_limit(size: int, start: int = None) -> "SearchBuilder"

Adds pagination parameters to the search.

Arguments:

  • size int - The number of entities to retrieve per page. Limit size value 1000
  • start int, optional - Page number you request. By default, is 1.

Returns:

  • SearchBuilder - Returns itself to allow for method chaining.

Example:

search_builder.with_limit(1000, 2)


add_by_group

def add_by_group(field_name: str) -> "SearchBuilder"

Adds a field to the group.

Arguments:

  • field_name str - The name of the field to group by.

Returns:

  • SearchBuilder - Returns itself to allow for method chaining.

Example:

builder.add_by_group(“provision.device.model”) builder.add_by_group(“provision.device.software”)


add_sort_by

def add_sort_by(field_name: str, order: str) -> "SearchBuilder"

Adds a field to the sort.

Arguments:

  • field_name str - The name of the field to sort by.
  • order str - The order of sorting, either ‘ASCENDING’ or ‘DESCENDING’.

Returns:

  • SearchBuilder - Returns itself to allow for method chaining.

Example:

builder.add_sort_by(“datapoints._current.at”, “DESCENDING”) builder.add_sort_by(“devices._current.at”, “ASCENDING”)

opengate_data.searching

Timeseries

opengate_data.timeseries.timeseries

Provision Timeseries Builder

TimeseriesBuilder Objects

class TimeseriesBuilder(SearchBuilder)

Timeseries Builder

Exports the data of a timeseries to a file — Parquet unless you ask for another content type — and reports the state of an export already running. Both operations work over the same endpoint, /v80/timeseries/provision/organizations/{organization}/{identifier}/export: export() starts one with a POST, export_status() asks about it with a GET.

Pick the operation, then close the chain with build() and execute(), or with build_execute(). Only one export per timeseries can run at a time.

To read rows instead of exporting them, use client.new_timeseries_search_builder().

Example:

builder = client.new_timeseries_builder()
builder.with_organization_name("organization").with_identifier(
"timeseries_identifier"
).with_output_file("export.parquet").export().build().execute()


with_organization_name

def with_organization_name(organization_name: str) -> "TimeseriesBuilder"

Sets the organization that owns the timeseries. Required.

Arguments:

  • organization_name str - The name of the organization.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization")


with_identifier

def with_identifier(identifier: str) -> "TimeseriesBuilder"

Sets the identifier of the timeseries to export. Required.

Arguments:

  • identifier str - The identifier of the timeseries.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("timeseries_identifier")


with_callback

def with_callback(callback_url: str) -> "TimeseriesBuilder"

Sets a URL to be notified when the export finishes, sent as the callback header. Optional: without it, poll with export_status().

Arguments:

  • callback_url str - The URL to notify.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_callback("https://your-application/export-done")


with_output_file

def with_output_file(filename: str,
                     content_type: str | None = None) -> "TimeseriesBuilder"

Names the file the export writes to, and optionally its content type.

Arguments:

  • filename str - The name of the output file.
  • content_type str | None - The content type to produce. Defaults to application/vnd.apache.parquet.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_output_file("export.parquet")
builder.with_output_file("export.csv", "text/csv")


with_sort

def with_sort(sort: str) -> "TimeseriesBuilder"

Not supported for the Parquet export. The export endpoint decides the output order internally and cannot be changed, and any ‘sort’ field in the payload makes the platform reject the request as “Json is malformed”.

To read timeseries data in a given order, use the search builder instead: client.new_timeseries_search_builder().with_sort(""), where the identifier is one of the sorts declared in the timeseries definition (or its automatically exposed reverse). Note that sorting is also disabled server-side for CSV output.

Raises:

  • NotImplementedError - Always.


export

def export() -> "TimeseriesBuilder"

Selects the operation that starts an export of the timeseries data.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization").with_identifier(
"timeseries_identifier"
).export().build().execute()


export_status

def export_status() -> "TimeseriesBuilder"

Selects the operation that reports the state of the current export.

Unlike export(), it accepts no request body, so with_filter, with_select, with_limit and with_output_file are rejected here.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization").with_identifier(
"timeseries_identifier"
).export_status().build().execute()


build

def build() -> "TimeseriesBuilder"

Closes the chain and checks it, without sending the request.

Call it last, immediately before execute(). Use build_execute() instead to do both in one step; mixing the two raises.

Returns:

  • TimeseriesBuilder - Returns itself to allow for method chaining.

Raises:

  • Exception - If the chain is incomplete — no operation selected, or a required or forbidden method for that operation.

Example:

builder.export().build()


build_execute

def build_execute()

Closes the chain, checks it and sends the request in one step.

Returns:

dict[str, Any]: The same response as execute().

Raises:

  • ValueError - If combined with build() or with execute().

Example:

builder.with_organization_name("organization").with_identifier(
"timeseries_identifier"
).export().build_execute()


execute

def execute() -> Any

Sends the selected operation to the platform.

Returns:

dict[str, Any]: Always carries status_code, plus data on success or error with the response body on failure. For export(), 202 means the export was accepted and runs in the background, 204 that the timeseries holds no data, and 409 that another process is already exporting it. For export_status(), 200 carries the parsed state of the export; a 406 is retried for up to 20 seconds before being returned.

Raises:

  • Exception - If build() or build_execute() was not called first.
  • ValueError - If no operation was selected.

Example:

builder.with_organization_name("organization").with_identifier(
"timeseries_identifier"
).export().build().execute()

opengate_data.timeseries.find_timeseries

FindTimeseriesBuilder Objects

class FindTimeseriesBuilder(SearchBuilder)

Find time series Builder


with_expand

def with_expand(expand: str) -> "FindTimeseriesBuilder"

With expand, select the data field to show information, columns, context or columns.context.

Arguments:

  • expand str - The extra information to include: “columns”, “context” or “columns.context” for both.

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining.

Raises:

  • TypeError - If the value is not a string.
  • ValueError - If the value is not one of the three accepted.

Example:

builder.with_expand("columns.context")


with_datastreams

def with_datastreams(datastreams: str) -> "FindTimeseriesBuilder"

With dataStreams, select the dataStreams to filter the Timeseries. To be accept and intepreted by the System the dataStream will be in format URL.

Arguments:

  • datastreams str - The datastreams to filter the timeseries by, as a comma-separated list in URL format.

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining.

Raises:

  • TypeError - If the value is not a string.

Example:

builder.with_datastreams("provision.device.identifier")


with_organization_name

def with_organization_name(organization_name: str) -> "FindTimeseriesBuilder"

Set organization name

Arguments:

  • organization_name str - The name of the organization that owns the timeseries.

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_organization_name("organization_name")


with_format

def with_format(format_data: str) -> "FindTimeseriesBuilder"

Formats the flat entities data based on the specified format (‘csv’, ‘dict’, or ‘pandas’). By default, the data is returned as a dictionary.

Arguments:

  • format_data str - The format to use for the data.

Example:

builder.with_format(‘dict’) builder.with_format(‘pandas’)

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining.


with_sort

def with_sort(sort: str) -> "FindTimeseriesBuilder"

Set sort identifier

Arguments:

  • sort str - The identifier of a sort declared in the timeseries definition.


with_identifier

def with_identifier(identifier: str) -> "FindTimeseriesBuilder"

set the timeseries identifier.

Arguments:

  • identifier str - The identifier of the timeseries.

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining.

Example:

builder.with_identifier("timeseries_id")


with_config_file

def with_config_file(config_file: str,
                     section: str,
                     config_key: str,
                     prefer: str = "auto") -> "FindTimeseriesBuilder"

Reads a value from the INI and saves it as a source. ‘prefer’ controls whether the value will be interpreted as identifier, name, or auto (first id, then name).

Arguments:

  • config_file str - Path to the INI file to read.
  • section str - The section of the INI file the value lives in.
  • config_key str - The key holding the value.
  • prefer str - How to read the value: ‘identifier’, ’name’, or ‘auto’ to try the identifier first and fall back to the name. Defaults to ‘auto’.


with_name

def with_name(find_name: str) -> "FindTimeseriesBuilder"

Specify the name to find.

Arguments:

  • find_name str - The name of the timeseries.

Returns:

  • FindTimeseriesBuilder - Returns self for chaining.

Example:

builder.with_name('timeseries_name')


with_env

def with_env(env_key: str, prefer: str = "auto") -> "FindTimeseriesBuilder"

Use an environment variable as the source. ‘prefer’ can be:

  • ‘identifier’ -> treat the value as an identifier
  • ’name’ -> treat the value as a name
  • ‘auto’ -> try identifier and, if not, name

Arguments:

  • env_key str - The name of the environment variable to read.
  • prefer str - How to read the value: ‘identifier’, ’name’, or ‘auto’ to try the identifier first and fall back to the name. Defaults to ‘auto’.


find_all

def find_all() -> "FindTimeseriesBuilder"

Searches for all available timeseries resources.

Returns:

  • FindTimeseriesBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').find_all()


find_one

def find_one() -> "FindTimeseriesBuilder"

Searches for a single timeseries resource by its identifier.

This method prepares the request to find a specific timeseries based on its identifier. The identifier is obtained automatically if not explicitly defined or can be obtained from a configuration file or environment variables.

Returns:

  • FindTimeseriesBuilder - Returns the current instance to allow method chaining.

Example:

builder.with_organization_name('my_organization').with_organization_name("organization_name").with_format("dict").with_identifier("identifier").find_one().build().execute()


build

def build() -> "FindTimeseriesBuilder"

Finalizes the construction of the IoT collection configuration.

This method prepares the builder to execute the collection by ensuring all necessary configurations are set and validates the overall integrity of the build. It should be called before executing the collection to ensure that the configuration is complete and valid.

The build process involves checking that mandatory fields such as the device identifier are set. It also ensures that method calls that are incompatible with each other (like build and build_execute) are not both used.

Returns:

  • FindTimeseriesBuilder - Returns itself to allow for method chaining, enabling further actions like execute.

Raises:

  • ValueError - If required configurations are missing or if incompatible methods are used together.

Example:

builder.build()


build_execute

def build_execute()

Executes the timeseries search immediately after building the configuration.

This method is a shortcut that combines building and executing in a single step.

Returns:

  • dict - A dictionary containing the execution response which includes the status code and potentially other metadata about the execution.

Raises:

  • ValueError - If build has already been called on this builder instance.

Example:

builder.build_execute()


execute

def execute() -> Response

Execute the configured operation and return the response.

This method executes the operation that has been configured using the builder pattern. It ensures that the build method has been called and that it is the last method invoked before execute. Depending on the configured method (e.g., create, find, update, delete), it calls the appropriate internal execution method.

Returns:

  • requests.Response - The response object from the executed request.

Raises:

  • Exception - If the build method has not been called or if it is not the last method invoked before execute.
  • ValueError - If the configured method is unsupported.

Example:

builder.execute()

opengate_data.timeseries

Utils

opengate_data.utils.expressions

Expressions Objects

class Expressions()

Expressions

The filter conditions a search accepts, as static methods returning plain dicts: eq, neq, like, gt, lt, gte, lte, in_, nin and exists. FilterBuilder extends this class, so in practice you reach them through client.new_filter_builder() and combine them with and_ / or_ before calling build().

Example:

filter = client.new_filter_builder().and_(
Expressions.eq("provision.administration.organization", "organization"),
Expressions.exists("provision.device.identifier", True),
).build()


eq

def eq(field, value)

Adds an equality condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The equality condition.

Example:

eq(“device.operationalStatus”, “NORMAL”)


neq

def neq(field, value)

Adds a not-equal condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The not-equal condition.

Example:

neq(“device.operationalStatus”, “ERROR”)


like

def like(field, value)

Adds a like condition to the filter.

Arguments:

  • field str - The field to compare.
  • value str - The regex pattern to match.

Returns:

  • dict - The like condition.

Example:

like(“device.name”, “device_.*”)


gt

def gt(field, value)

Adds a greater-than condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The greater-than condition.

Example:

gt(“device.batteryLevel”, 50)


lt

def lt(field, value)

Adds a less-than condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The less-than condition.

Example:

lt(“device.batteryLevel”, 20)


gte

def gte(field, value)

Adds a greater-than-or-equal condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The greater-than-or-equal condition.

Example:

gte(“device.batteryLevel”, 80)


lte

def lte(field, value)

Adds a less-than-or-equal condition to the filter.

Arguments:

  • field str - The field to compare.
  • value any - The value to compare against.

Returns:

  • dict - The less-than-or-equal condition.

Example:

lte(“device.batteryLevel”, 30)


in_

def in_(field, values)

Adds an in condition to the filter.

Arguments:

  • field str - The field to compare.
  • values list - The list of values to compare against.

Returns:

  • dict - The in condition.

Example:

in_(“device.name”, [“device_1”, “device_2”])


nin

def nin(field, values)

Adds a not-in condition to the filter.

Arguments:

  • field str - The field to compare.
  • values list - The list of values to compare against.

Returns:

  • dict - The not-in condition.

Example:

nin(“device.name”, [“device_3”, “device_4”])


exists

def exists(field, value)

Adds an existence condition to the filter.

Arguments:

  • field str - The field to check for existence.
  • value bool - True to match the entities that have the field, False to match the ones that do not.

Returns:

  • dict - The existence condition.

Example:

exists("device.location", True)

opengate_data.utils.utils


validate_type

def validate_type(variable: Any, expected_type: Any,
                  variable_name: str) -> None

Validates that the given variable is of the expected type or types.

This function checks if the variable matches the expected type or any type in a tuple of expected types. It raises a TypeError if the variable does not match the expected type(s).

Arguments:

  • variable Any - The variable to be checked.
  • expected_type Any - The expected type or a tuple of expected types.
  • variable_name str - The name of the variable, used in the error message to identify the variable.

Raises:

  • TypeError - If the variable is not of the expected type(s).

Returns:

  • None - This function does not return a value; it raises an exception if the type check fails.


set_method_call

def set_method_call(method)

Decorates a method to ensure it is properly registered and tracked within the builder’s workflow.

This decorator adds the method’s name to a set that tracks method calls

Arguments:

  • method function - The method to be decorated.

Returns:

  • function - The wrapped method with added functionality to register its call.

Raises:

  • None - This decorator does not raise exceptions by itself but ensures the method call is registered.


parse_json

def parse_json(value)

Attempts to convert a string into a Python object by interpreting it as JSON.

Arguments:

  • value str | Any - The value to attempt to convert. If the value is not a string, it is returned directly without attempting conversion.

Returns:

  • Any - The Python object resulting from the JSON conversion if value is a valid JSON string. If the conversion fails due to a formatting error (ValueError), the original value is returned. If value is not a string, it is returned as is.


send_request

def send_request(method: str,
                 headers: dict | None = None,
                 url: str = "",
                 data: dict[str, Any] | str | None = None,
                 files: Any = None,
                 json_payload: dict[str, Any] | None = None,
                 params: Any = None,
                 verify: bool = False,
                 timeout: int = 3000,
                 stream: bool = False) -> Response | dict[str, Any]

Helper function to make HTTP requests using the requests library.

Arguments:

  • method str - HTTP method (e.g., ‘GET’, ‘POST’, ‘PUT’, ‘DELETE’, ‘PATCH’).
  • headers dict, optional - Request headers.
  • url str - The URL for the request.
  • data dict | str, optional - Payload for the request body.
  • files Any, optional - Files for multipart encoding upload.
  • json_payload dict, optional - JSON payload for the request body.
  • params dict | Any, optional - URL parameters.
  • verify bool - Whether to verify SSL certificates. Defaults to False.
  • timeout int - Request timeout in seconds. Defaults to 3000.
  • stream bool - Whether to keep the response body unread until it is consumed, which is what a file download needs. Defaults to False.

Returns:

Response | dict[str, Any]: The response object if successful, or an error dictionary.


handle_basic_response

def handle_basic_response(response: requests.Response) -> dict[str, Any]

Handle basic HTTP response.

This function processes the HTTP response and returns a dictionary containing the status code. If the response indicates an error, it also includes the error message.

Arguments:

  • response requests.Response - The response object to process.

Returns:

dict[str, Any]: A dictionary containing the status code and, if applicable, the error message.


handle_error_response

def handle_error_response(response: requests.Response) -> dict[str, Any]

Turn a failed HTTP response into the dictionary the builders return.

Nothing is raised: the caller gets the status code and, when the platform sent one, the body as the error.

Arguments:

  • response requests.Response - The response object to process.

Returns:

dict[str, Any]: The status code and, if the response carried a body, the error.


handle_exception

def handle_exception(e)

Turn a transport failure into the dictionary the builders return.

A request that never reached the platform has no status code, so the result names the kind of failure instead: connection, timeout, request or unexpected.

Arguments:

  • e Exception - The exception raised while sending the request.

Returns:

dict[str, str]: The kind of failure and its details.


validate_build_method_calls_execute

def validate_build_method_calls_execute(method_calls)

Check that a chain was closed properly before execute() runs.

Every builder has to be closed with build() or with build_execute(), and build() has to be the last call before execute() — otherwise a setter called after it would never be validated.

Arguments:

  • method_calls list[str] - The methods called on the builder, in order.

Raises:

  • Exception - If build() was called more than once, if it was not the last call before execute(), or if neither build() nor build_execute() was called.


validate_build

def validate_build(*,
                   method: str,
                   state: dict,
                   spec: dict,
                   used_methods: list[str] | None = None,
                   allowed_method_calls: set[str] | None = None,
                   field_aliases: dict[str, str] | None = None,
                   method_aliases: dict[str, str] | None = None) -> None

Generic builder validator with messages intended for the end user.

The two alias maps exist so the errors name what the caller wrote, not the internals: without them a missing with_destiny_path() would be reported as a missing ‘path’.

Arguments:

  • method str - The operation selected in the chain, which picks its entry in the spec.
  • state dict - The current value of each field of the builder, by internal name.
  • spec dict - The rules per operation: ‘required’ and ‘forbidden’ field names, ‘choices’ mapping a field to its allowed values, and ‘custom’ holding extra checks called with the state.
  • used_methods list[str] | None - The methods called on the builder, in order. Needed to catch two operations in the same chain.
  • allowed_method_calls set[str] | None - The method names that select an operation, of which a chain may use exactly one, once.
  • field_aliases dict[str, str] | None - Maps internal fields to public setter names (e.g., ‘path’ → ‘with_path’).
  • method_aliases dict[str, str] | None - Maps logical method names to public method names (e.g., ’list_one’ → ’list_one()’).

Raises:

  • RuntimeError - If the chain combines several operations, or repeats one.
  • ValueError - If no operation was selected, if it is not in the spec, or if the state misses a required field, carries a forbidden one, or holds a value outside its choices.


build_headers

def build_headers(client_headers: dict | None,
                  *,
                  accept: str | None = None,
                  content_type: str | None = None) -> dict

Build request headers starting from client headers (auth preserved) and optionally overriding Accept / Content-Type.

This function NEVER mutates client headers.

Arguments:

  • client_headers dict | None - The headers of the client, holding the authentication. They are copied, never modified.
  • accept str | None - The Accept header to set. Left untouched if None.
  • content_type str | None - The Content-Type header to set. Left untouched if None.

Returns:

  • dict - A new set of headers.

opengate_data.utils