Subsections of provision

Base Provision

This is an abstract class, it must be extended to another class that defines the different actions of a specific provision. This class is responsible for managing the request to execute Norte OpenGate 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 create a entity of provision

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 entity of provision

Parámetros

Nombre Tipo Opcional Descripción
body *

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 entity of provision

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.organizationsBuilder().update()

Subsections of bulk

Bulk Execution Builder

This builder give you the necessary tools to create a bulk executions using our OpenGate REST

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 String with path of file or File (Blob)
extension string File format

Retorna

Tip

Tipo: *

Ejemplos

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

plan(rawFile, extension, numberOfEntriesToProcess)

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

Parámetros

Nombre Tipo Opcional Descripción
rawFile string,File String with path of file or File (Blob)
extension string File format
numberOfEntriesToProcess number Number of entries to be processed.

Retorna

Tip

Tipo: *

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 allow make get request to countries catalog resource into Opengate North API.

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

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

Bulk Builder

This class allow set simple values.

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 File with format string or Blob
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Retorna

Tip

Tipo: *

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 File with format string or Blob
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Retorna

Tip

Tipo: *

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 full operation

Parámetros

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

Retorna

Tip

Tipo: *

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 File with format string or Blob
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Retorna

Tip

Tipo: *

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 File with format string or Blob
csv_response boolean true if you want a response on format csv. False or null if you want a response on format json

Retorna

Tip

Tipo: *

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 set complex values. What is a complex value? It is simple, It is a value that need a communications module identifier to allow 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.

Retorna

Tip

Tipo: *


Csv Bulk Builder

Csv builder. This builder give you the necessary tools to create a csv bulk using our OpenGate REST.

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 give you the necessary tools to create a device 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 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 create a entity of provision

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 entity of provision and check if any subscriber/subscription exits or no. If a subscriber/subscription not exists then this entities will be created and after that will be added to entity box.

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.entityBuilder.devicesBuilder().update()

Entity Builder

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

constructor

Constructor

Parámetros

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

assetsBuilder(organization, timeout)

Get a AssetBuilder for 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 for operate with entities of type device

Parámetros

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

Retorna

Tip

Tipo: Promise

Ejemplos

ogapi.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 for 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 for 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 for 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 give you the necessary tools to create a json bulk using our OpenGate REST.

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 builder. This builder give you the necessary tools to create a json bulk using our OpenGate REST.

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 allow set 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 entity of provision

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 patch a entity of provision

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 entity of provision

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.

Retorna

Tip

Tipo: *


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

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