Skip to content

Latest commit

 

History

History
121 lines (82 loc) · 4.55 KB

TypesApi.md

File metadata and controls

121 lines (82 loc) · 4.55 KB

NgsiV2.TypesApi

All URIs are relative to http://orion.lab.fiware.org:1026/v2

Method HTTP request Description
retrieveEntityType GET /types/{entityType}
retrieveEntityTypes GET /types/

retrieveEntityType

EntityType retrieveEntityType(entityType)

This operation returns a JSON object with information about the type: * `attrs` : the set of attribute names along with all the entities of such type, represented in a JSON object whose keys are the attribute names and whose values contain information of such attributes (in particular a list of the types used by attributes with that name along with all the entities). * `count` : the number of entities belonging to that type. Response code: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.

Example

var NgsiV2 = require('ngsi_v2');
var defaultClient = NgsiV2.ApiClient.instance;

// Configure API key authorization: fiware_token
var fiware_token = defaultClient.authentications['fiware_token'];
fiware_token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//fiware_token.apiKeyPrefix = 'Token';

var apiInstance = new NgsiV2.TypesApi();

var entityType = "entityType_example"; // String | Entity Type


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.retrieveEntityType(entityType, callback);

Parameters

Name Type Description Notes
entityType String Entity Type

Return type

EntityType

Authorization

fiware_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

retrieveEntityTypes

[EntityType] retrieveEntityTypes(opts)

If the `values` option is not in use, this operation returns a JSON array with the entity types. Each element is a JSON object with information about the type: * `type` : the entity type name. * `attrs` : the set of attribute names along with all the entities of such type, represented in a JSON object whose keys are the attribute names and whose values contain information of such attributes (in particular a list of the types used by attributes with that name along with all the entities). * `count` : the number of entities belonging to that type. If the `values` option is used, the operation returns a JSON array with a list of entity type names as strings. Results are ordered by entity `type` in alphabetical order. Response code: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.

Example

var NgsiV2 = require('ngsi_v2');
var defaultClient = NgsiV2.ApiClient.instance;

// Configure API key authorization: fiware_token
var fiware_token = defaultClient.authentications['fiware_token'];
fiware_token.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//fiware_token.apiKeyPrefix = 'Token';

var apiInstance = new NgsiV2.TypesApi();

var opts = { 
  'limit': 1.2, // Number | Limit the number of types to be retrieved.
  'offset': 1.2, // Number | Skip a number of records.
  'options': "options_example" // String | Options dictionary.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.retrieveEntityTypes(opts, callback);

Parameters

Name Type Description Notes
limit Number Limit the number of types to be retrieved. [optional]
offset Number Skip a number of records. [optional]
options String Options dictionary. [optional]

Return type

[EntityType]

Authorization

fiware_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json