This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a session for the workspace specified in the configuration. | |
using (var session = new WorkspaceSession(_configuration)) | |
{ | |
// We'll authenticate using standard workspace token authentication with an example user. | |
await session.AuthenticateAsync("{username}", "{password}"); | |
// Insert example documents to ensure we have something to query. | |
await session.InsertDocumentAsync(new AnonymousCollection | |
{ | |
DocumentID = Guid.NewGuid().ToString(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a session for the workspace specified in the configuration. | |
using (var session = new WorkspaceSession(configuration)) | |
{ | |
// We'll authenticate using standard workspace token authentication with an example user. | |
await session.AuthenticateAsync("{username}", "{password}"); | |
var anonymousDocument = new AnonymousCollection | |
{ | |
DocumentID = Guid.NewGuid().ToString(), | |
Name = "Example Inserted Document" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a session for the workspace specified in the configuration. | |
using (var session = new WorkspaceSession(configuration)) | |
{ | |
// Define a new user to be registered, notice that we don't need to assign any audit column values. | |
var user = new User | |
{ | |
DocumentID = Guid.NewGuid().ToString(), | |
Username = "someusername", | |
Password = "s@m5p@ssw@rd" // Password will automatically be MD5'd using a trigger on the server. | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var configuration = new WorkspaceConfiguration | |
{ | |
QueryServiceUri = new Uri("https://query.odatahq.com/v3/{accountKey}/{workspaceUri}", UriKind.Absolute), | |
ClientID = "{clientId}", | |
ClientSecret = "{clientSecret}", | |
Username = "{username}", | |
Password = "{password}" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var configuration = new WorkspaceConfiguration | |
{ | |
QueryServiceUri = new Uri("https://query.odatahq.com/v3/{accountKey}/{workspaceUri}", UriKind.Absolute), | |
ClientID = "{clientId}", | |
ClientSecret = "{clientSecret}" | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"collectionUri": "garagedoor", | |
"title": "garagedoor", | |
"description": "Collection of garagedoor objects.", | |
"typeName": "garagedoor", | |
"enableTriggers": false, | |
"properties": [ | |
{ | |
"name": "Status", | |
"description": "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ODATAHQ_URL = "https://query.odatahq.com/v3/{accountkeyhere}/homemonitor/garagedoor?api-key={apikeyhere}"; | |
// Print light reading trigger URL | |
server.log("Sensor Agent URL: " + http.agenturl()); | |
// Define funtions | |
function requestHandler(request, response) | |
{ | |
// Handle an incoming web request for a reading | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using ODataHQ.Code.Common; | |
public class Triggers : ITriggers | |
{ | |
public void Create(ExecutionContext context) | |
{ | |
context.Execute(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"WorkspaceUri": "Sample", | |
"Title": "Sample Title", | |
"Description": "This is a sample workspace.", | |
"Anonymous": false, | |
"EnableTriggers": false, | |
"Records": 0, | |
"Collections": [ | |
{ | |
"CollectionUri": "Products", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDateTime(){ | |
local d = date(); | |
local datestring = format("%04d-%02d-%02dT%02d:%02d:%02d", d.year, d.month+1, d.day, d.hour, d.min, d.sec); //ISO 8601 | |
return datestring; | |
} | |
class RespInput extends InputPort | |
{ | |
name = "response"; | |
type = "string"; |
NewerOlder