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 -> {data: 'Cancel process'|| 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