All URIs are relative to http://orion.lab.fiware.org:1026/v2
Method | HTTP request | Description |
---|---|---|
createANewSubscription | POST /subscriptions | |
deleteSubscription | DELETE /subscriptions/{subscriptionId} | |
retrieveSubscription | GET /subscriptions/{subscriptionId} | |
retrieveSubscriptions | GET /subscriptions | |
updateSubscription | PATCH /subscriptions/{subscriptionId} |
createANewSubscription(body)
Creates a new subscription. The subscription is represented by a JSON object as described at the beginning of this section. Response: * Successful operation uses 201 Created * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.
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.SubscriptionsApi();
var body = new NgsiV2.Subscription(); // Subscription |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.createANewSubscription(body, callback);
Name | Type | Description | Notes |
---|---|---|---|
body | Subscription |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
deleteSubscription(subscriptionId)
Cancels subscription. Response: * Successful operation uses 204 No Content * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.
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.SubscriptionsApi();
var subscriptionId = "subscriptionId_example"; // String | subscription Id.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.deleteSubscription(subscriptionId, callback);
Name | Type | Description | Notes |
---|---|---|---|
subscriptionId | String | subscription Id. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Subscription retrieveSubscription(subscriptionId)
The response is the subscription represented by a JSON object as described at the beginning of this section. Response: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.
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.SubscriptionsApi();
var subscriptionId = "subscriptionId_example"; // String | subscription Id.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.retrieveSubscription(subscriptionId, callback);
Name | Type | Description | Notes |
---|---|---|---|
subscriptionId | String | subscription Id. |
- Content-Type: Not defined
- Accept: application/json
[Subscription] retrieveSubscriptions(opts)
Returns a list of all the subscriptions present in the system. Response: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.
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.SubscriptionsApi();
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.retrieveSubscriptions(opts, callback);
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] |
- Content-Type: Not defined
- Accept: application/json
UpdateSubscriptionResponse updateSubscription(subscriptionId, body)
Only the fields included in the request are updated in the subscription. Response: * Successful operation uses 204 No Content * Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for more details.
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.SubscriptionsApi();
var subscriptionId = "subscriptionId_example"; // String | subscription Id.
var body = new NgsiV2.Subscription(); // Subscription |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.updateSubscription(subscriptionId, body, callback);
Name | Type | Description | Notes |
---|---|---|---|
subscriptionId | String | subscription Id. | |
body | Subscription |
- Content-Type: application/json
- Accept: application/json