public UsersUsageController(ISecurityHelper securityHelper, IResourceRepository resourceRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController) { _resourceRepository = resourceRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public SettingsSubscriptionsController(ISystemSettingsRepository settingsRepository, ISecurityHelper securityHelper, IVolatileStorageController volatileStorageController, IKeyRepository keyRepository) { _settingsRepository = settingsRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; _keyRepository = keyRepository; }
public UsersBudgetController(ISecurityHelper securityHelper, IResourceRepository resourceRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController) { _resourceRepository = resourceRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public GroupsController(ISecurityHelper securityHelper, IGroupRepository groupRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController) { _groupRepository = groupRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public SettingsSubscriptionsController(ISystemSettingsRepository settingsRepository, ISecurityHelper securityHelper, IVolatileStorageController volatileStorageController, IKeyRepository keyRepository) { _settingsRepository = settingsRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; _keyRepository = keyRepository; }
public GroupsController(ISecurityHelper securityHelper, IGroupRepository groupRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController) { _groupRepository = groupRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public UserController(ISecurityHelper securityHelper, IResourceRepository resourceRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController, IGraphAPIProvider graphAPIProvider) { _resourceRepository = resourceRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; _graphAPIProvider = graphAPIProvider; }
public SettingsGroupAdminsController(ISystemSettingsRepository settingsRepository, IUserRepository userRepository, ISecurityHelper securityHelper, IGroupRepository groupRepository, IVolatileStorageController volatileStorageController) { _settingsRepository = settingsRepository; _userRepository = userRepository; _groupRepository = groupRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public UsersController(ISecurityHelper securityHelper, IResourceRepository resourceRepository, IUserRepository userRepository, IVolatileStorageController volatileStorageController, IGraphAPIProvider graphAPIProvider) { _resourceRepository = resourceRepository; _userRepository = userRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; _graphAPIProvider = graphAPIProvider; }
public SettingsGroupAdminsController(ISystemSettingsRepository settingsRepository, IUserRepository userRepository, ISecurityHelper securityHelper, IGroupRepository groupRepository, IVolatileStorageController volatileStorageController) { _settingsRepository = settingsRepository; _userRepository = userRepository; _groupRepository = groupRepository; _securityHelper = securityHelper; _volatileStorageController = volatileStorageController; }
public GroupResourcesController(ILinkHelper linkHelper, ISecurityHelper securityHelper, IResourceRepository resourceRepository, IGroupRepository groupRepository, IWebJobController webJobController, ISystemSettingsRepository settingsRepository, IVolatileStorageController volatileStorageController) { _linkHelper = linkHelper; _resourceRepository = resourceRepository; _securityHelper = securityHelper; _groupRepository = groupRepository; _groupRepository = groupRepository; _webJobController = webJobController; _settingsRepository = settingsRepository; _volatileStorageController = volatileStorageController; }
public GroupResourcesController(ILinkHelper linkHelper, ISecurityHelper securityHelper, IResourceRepository resourceRepository, IGroupRepository groupRepository, IWebJobController webJobController, ISystemSettingsRepository settingsRepository, IVolatileStorageController volatileStorageController) { _linkHelper = linkHelper; _resourceRepository = resourceRepository; _securityHelper = securityHelper; _groupRepository = groupRepository; _groupRepository = groupRepository; _webJobController = webJobController; _settingsRepository = settingsRepository; _volatileStorageController = volatileStorageController; }
// This function will get triggered/executed when a new message is written // on an Azure Queue called queue. public async static void ProcessQueueMessage([QueueTrigger("processorqueue")] QueueMessage message, TextWriter log) { Console.WriteLine(string.Format("Process Q Message: Resource[{0}] Action[{1}] RequestId[{2}]", message.ResourceId, message.Action, message.OperationGuid.ToString())); Console.WriteLine(string.Format("Start - Current Time: [{0}]", DateTime.UtcNow.ToLongTimeString())); // TODO - shouldn't be depending on ResourceController here var resourceController = Provider.GetService<IResourceController>(); if (_volatileStorageController == null) _volatileStorageController = Provider.GetService<IVolatileStorageController>(); var activity = new ResourceActivity(resourceController); if (!await activity.TryInitializeAsync(message.ResourceId)) { Console.WriteLine("Resource not found"); return; } if (activity.IsCreating) message.Action = ResourceAction.Create; // sometimes actions will throw exceptions, handle them gracefully: // example: // ConflictError: Another reboot or reimage operation is already in progress on role instance brent1. try { switch (message.Action) { case ResourceAction.Delete: await ActionDelete(activity); break; case ResourceAction.Stop: await ActionStop(activity); break; case ResourceAction.Start: await ActionStart(activity); break; case ResourceAction.Create: await ActionCreate(activity); break; default: Console.WriteLine("Unhandled action: " + message.Action); return; } /* the following is logging code. it will need to be uncommented after the previous code is stable enough */ var groupId = string.Empty; if (activity.Resource != null && activity.Resource.ResourceGroup != null) groupId = activity.Resource.ResourceGroup.Id; await _volatileStorageController.CreateActivityLog(new ActivityLog() { ResourceId = message.ResourceId, GroupId = groupId, RequestId = message.OperationGuid.ToString(), Action = message.Action.ToString(), UserId = "ProvisioningConsole" }); //Console.WriteLine(string.Format("My orginal message was: {0}", message)); } catch (Exception e) { Console.WriteLine(string.Format("Process Q Message FAILED!: Resource[{0}] Action[{1}] RequestId[{2}] Error[{3}]", message.ResourceId, message.Action, message.OperationGuid.ToString(), e.Message)); } Console.WriteLine(string.Format("End - Current Time: [{0}]", DateTime.UtcNow.ToLongTimeString())); }
// This function will get triggered/executed when a new message is written // on an Azure Queue called queue. public async static void ProcessQueueMessage([QueueTrigger("processorqueue")] QueueMessage message, TextWriter log) { Console.WriteLine(string.Format("Process Q Message: Resource[{0}] Action[{1}] RequestId[{2}]", message.ResourceId, message.Action, message.OperationGuid.ToString())); Console.WriteLine(string.Format("Start - Current Time: [{0}]", DateTime.UtcNow.ToLongTimeString())); // TODO - shouldn't be depending on ResourceController here var resourceController = Provider.GetService <IResourceController>(); if (_volatileStorageController == null) { _volatileStorageController = Provider.GetService <IVolatileStorageController>(); } var activity = new ResourceActivity(resourceController); if (!await activity.TryInitializeAsync(message.ResourceId)) { Console.WriteLine("Resource not found"); return; } if (activity.IsCreating) { message.Action = ResourceAction.Create; } // sometimes actions will throw exceptions, handle them gracefully: // example: // ConflictError: Another reboot or reimage operation is already in progress on role instance brent1. try { switch (message.Action) { case ResourceAction.Delete: await ActionDelete(activity); break; case ResourceAction.Stop: await ActionStop(activity); break; case ResourceAction.Start: await ActionStart(activity); break; case ResourceAction.Create: await ActionCreate(activity); break; default: Console.WriteLine("Unhandled action: " + message.Action); return; } /* * * the following is logging code. it will need to * be uncommented after the previous code is stable enough * */ var groupId = string.Empty; if (activity.Resource != null && activity.Resource.ResourceGroup != null) { groupId = activity.Resource.ResourceGroup.Id; } await _volatileStorageController.CreateActivityLog(new ActivityLog() { ResourceId = message.ResourceId, GroupId = groupId, RequestId = message.OperationGuid.ToString(), Action = message.Action.ToString(), UserId = "ProvisioningConsole" }); //Console.WriteLine(string.Format("My orginal message was: {0}", message)); } catch (Exception e) { Console.WriteLine(string.Format("Process Q Message FAILED!: Resource[{0}] Action[{1}] RequestId[{2}] Error[{3}]", message.ResourceId, message.Action, message.OperationGuid.ToString(), e.Message)); } Console.WriteLine(string.Format("End - Current Time: [{0}]", DateTime.UtcNow.ToLongTimeString())); }