/// <summary>
 /// Creates or updates a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 /// <param name='location'>
 /// location of the resource?
 /// </param>
 /// <param name='tags'>
 /// resource tags
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway id which will manage this node
 /// </param>
 /// <param name='connectionName'>
 /// myhost.domain.com
 /// </param>
 /// <param name='userName'>
 /// User name to be used to connect to node
 /// </param>
 /// <param name='password'>
 /// Password associated with user name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <NodeResource> CreateAsync(this INodeOperations operations, string resourceGroupName, string nodeName, string location = default(string), object tags = default(object), string gatewayId = default(string), string connectionName = default(string), string userName = default(string), string password = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, nodeName, location, tags, gatewayId, connectionName, userName, password, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #2
0
 public TimerWorkers(ILogTracer log, IOnefuzzContext context)
 {
     _log         = log;
     _scaleSetOps = context.ScalesetOperations;
     _poolOps     = context.PoolOperations;
     _nodeOps     = context.NodeOperations;
 }
Beispiel #3
0
 /// <summary>
 /// Returns nodes in a resource group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <NodeResource> > ListForResourceGroupAsync(this INodeOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListForResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #4
0
 public OperationsFactory(IStructureOperations StructureOperations, INodeOperations NodeOperations, IFieldOperations FieldOperations, IUserOperations UserOperations)
 {
     _structureoperations = StructureOperations ?? _structureoperations;
     _nodeoperations      = NodeOperations ?? _nodeoperations;
     _fieldoperations     = FieldOperations ?? _fieldoperations;
     _useroperations      = UserOperations ?? _useroperations;
 }
Beispiel #5
0
 /// <summary>
 /// Returns nodes in a subscription
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <NodeResource> > ListNextAsync(this INodeOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// gets a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <NodeResource> GetAsync(this INodeOperations operations, string resourceGroupName, string nodeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, nodeName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #7
0
 public AgentCanSchedule(ILogTracer log, IStorage storage, INodeOperations nodeOperations, ITaskOperations taskOperations, IScalesetOperations scalesetOperations)
 {
     _log                = log;
     _storage            = storage;
     _nodeOperations     = nodeOperations;
     _taskOperations     = taskOperations;
     _scalesetOperations = scalesetOperations;
 }
Beispiel #8
0
    //TODO: suggest by Cheick: this can probably be optimize by query all NodesTasks then query the all machine in single request
    public async IAsyncEnumerable <Node> GetNodesByTaskId(Guid taskId, INodeOperations nodeOps)
    {
        await foreach (var entry in QueryAsync($"task_id eq '{taskId}'"))
        {
            var node = await nodeOps.GetByMachineId(entry.MachineId);

            if (node is not null)
            {
                yield return(node);
            }
        }
    }
Beispiel #9
0
    public async IAsyncEnumerable <NodeAssignment> GetNodeAssignments(Guid taskId, INodeOperations nodeOps)
    {
        await foreach (var entry in QueryAsync($"task_id eq '{taskId}'"))
        {
            var node = await nodeOps.GetByMachineId(entry.MachineId);

            if (node is not null)
            {
                var nodeAssignment = new NodeAssignment(node.MachineId, node.ScalesetId, entry.State);
                yield return(nodeAssignment);
            }
        }
    }
 public NodeOperationsTestHooks(ILogTracer log, IConfigOperations configOps, INodeOperations nodeOps)
 {
     _log       = log.WithTag("TestHooks", nameof(NodeOperationsTestHooks));
     _configOps = configOps;
     _nodeOps   = nodeOps;
 }
 /// <summary>
 /// Returns nodes in a resource group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Microsoft.Rest.Azure.IPage <NodeResource> > ListForResourceGroupNextAsync(this INodeOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ListForResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns nodes in a resource group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static Microsoft.Rest.Azure.IPage <NodeResource> ListForResourceGroupNext(this INodeOperations operations, string nextPageLink)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((INodeOperations)s).ListForResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates or updates a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 /// <param name='location'>
 /// location of the resource?
 /// </param>
 /// <param name='tags'>
 /// resource tags
 /// </param>
 /// <param name='gatewayId'>
 /// Gateway id which will manage this node
 /// </param>
 /// <param name='connectionName'>
 /// myhost.domain.com
 /// </param>
 /// <param name='userName'>
 /// User name to be used to connect to node
 /// </param>
 /// <param name='password'>
 /// Password associated with user name
 /// </param>
 public static NodeResource Create(this INodeOperations operations, string resourceGroupName, string nodeName, string location = default(string), object tags = default(object), string gatewayId = default(string), string connectionName = default(string), string userName = default(string), string password = default(string))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((INodeOperations)s).CreateAsync(resourceGroupName, nodeName, location, tags, gatewayId, connectionName, userName, password), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 public ZebraController(NodeOperations nodeOperations)
 {
     _nodeop = nodeOperations;
 }
 /// <summary>
 /// gets a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 public static NodeResource Get(this INodeOperations operations, string resourceGroupName, string nodeName)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((INodeOperations)s).GetAsync(resourceGroupName, nodeName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// deletes a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task DeleteAsync(this INodeOperations operations, string resourceGroupName, string nodeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     await operations.DeleteWithHttpMessagesAsync(resourceGroupName, nodeName, null, cancellationToken).ConfigureAwait(false);
 }
Beispiel #17
0
 /// <summary>
 /// deletes a management node
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name uniquely identifies the resource group within the
 /// user subscriptionId.
 /// </param>
 /// <param name='nodeName'>
 /// The node name (256 characters maximum).
 /// </param>
 public static void Delete(this INodeOperations operations, string resourceGroupName, string nodeName)
 {
     Task.Factory.StartNew(s => ((INodeOperations)s).DeleteAsync(resourceGroupName, nodeName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
Beispiel #18
0
 public NodeServiceController() : base()
 {
     _structops = OperationsFactory.StructureOperations;
     _nodeops   = OperationsFactory.NodeOperations;
     _fieldops  = OperationsFactory.FieldOperations;
 }
Beispiel #19
0
 /// <summary>
 /// Returns nodes in a resource group
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <NodeResource> ListForResourceGroupNext(this INodeOperations operations, string nextPageLink)
 {
     return(Task.Factory.StartNew(s => ((INodeOperations)s).ListForResourceGroupNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }