private static void AllocatePartition(int commandTopics, int commandSubscriptions, string partitionArea, string serviceNamespace, string eventStore, string serviceOwner, string serviceOwnerSecret, string storageWriterConnection, string acsManagementServiceName, string acsManagementServiceSecret) { PartitionDescription pd; using (var iot = new InternetOfThings(commandTopics, commandSubscriptions)) { pd = new PartitionDescription(DateTime.UtcNow.ToLongDateString(), partitionArea, serviceNamespace, eventStore) { Owner = serviceOwner, OwnerSecret = serviceOwnerSecret, StorageAccount = storageWriterConnection, AccessControl = acsManagementServiceName, AccessControlSecret = acsManagementServiceSecret }; pd = iot.CreatePartition(pd); iot.ActivatePartition(pd); } }
private static Process RegisterThing(string thingPath, int commandTopics, int commandSubscriptions, string partitionArea) { ThingDescription td; using (var iot = new InternetOfThings(commandTopics, commandSubscriptions)) { td = new ThingDescription(DateTime.UtcNow.ToLongDateString(), partitionArea); td = iot.CreateThing(td); iot.ActivateThing(td); } return(StartThingProcess(thingPath, td.Id, td.CommandTopic, td.ConnectionString)); }