/// <summary>
 /// Modifies the Id property for the Container with the Id provided to the new
 /// value supplied.  Returns the modified Container.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container whose Id property is to be modified.  Must be double
 /// URL encoded.
 /// </param>
 /// <param name='newValue'>
 /// New Id value.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerModel> UpdateIdAsync(this IContainers operations, string id, string newValue, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateIdWithHttpMessagesAsync(id, newValue, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns all children (Value, Alarm, Trend or Container) parented by the
 /// Container with the Id provided.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container whose children are to be returned.  Must be double URL
 /// encoded.
 /// </param>
 /// <param name='type'>
 /// Return only those children which are of this type.  All returned by
 /// default. Possible values include: 'Container', 'Value', 'Trend', 'Alarm',
 /// 'Enum', 'AlarmEventType'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <IItem> > RetrieveChildrenAsync(this IContainers operations, string id, string type = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RetrieveChildrenWithHttpMessagesAsync(id, type, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Deletes the Container with the Id provided.  All children will also be
 /// deleted.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container to be deleted.  Must be double URL encoded.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> DeleteAsync(this IContainers operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns all Container which fit the filter criteria supplied. All filter
 /// parameters are optional. Container will be ordered and paged as requested.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// Return only Container whose name contains this value.
 /// </param>
 /// <param name='type'>
 /// Filter by Type. Possible values include: 'Folder', 'Server', 'Device',
 /// 'Structure', 'Service'
 /// </param>
 /// <param name='orderBy'>
 /// Container will be returned in this order.  NameAscending by default.
 /// Possible values include: 'NameAscending', 'NameDescending'
 /// </param>
 /// <param name='take'>
 /// Number of Container that should be returned.  200 by default.
 /// </param>
 /// <param name='skip'>
 /// Number of Container that should be skipped before items are returned.  0
 /// by default.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <ContainerModel> > RetrieveAsync(this IContainers operations, string name = default(string), string type = default(string), string orderBy = default(string), int?take = default(int?), int?skip = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RetrieveWithHttpMessagesAsync(name, type, orderBy, take, skip, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new Container and returns it.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='newItem'>
 /// Definition of how the Container will be created.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerModel> CreateAsync(this IContainers operations, NewContainerModel newItem, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(newItem, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns the parent Container for the Container with the Id supplied.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container whose parent Container is to be returned.  Must be
 /// double URL encoded.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ContainerModel> RetrieveParentAsync(this IContainers operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RetrieveParentWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #7
0
 public Events(IQueue queue, IWebhookOperations webhook, ILogTracer log, IContainers containers, ICreds creds)
 {
     _queue      = queue;
     _webhook    = webhook;
     _log        = log;
     _containers = containers;
     _creds      = creds;
 }
Beispiel #8
0
 public Config(ILogTracer logTracer, IOnefuzzContext context)
 {
     _context       = context;
     _logTracer     = logTracer;
     _containers    = _context.Containers;
     _serviceConfig = _context.ServiceConfiguration;
     _queue         = _context.Queue;
 }
Beispiel #9
0
 public Extensions(IServiceConfig config, ICreds creds, IQueue queue, IContainers containers, IConfigOperations instanceConfigOps, ILogAnalytics logAnalytics)
 {
     _serviceConfig     = config;
     _creds             = creds;
     _queue             = queue;
     _containers        = containers;
     _instanceConfigOps = instanceConfigOps;
     _logAnalytics      = logAnalytics;
 }
Beispiel #10
0
 public Scheduler(ITaskOperations taskOperations, IConfig config, IPoolOperations poolOperations, ILogTracer logTracer, IJobOperations jobOperations, IContainers containers)
 {
     _taskOperations = taskOperations;
     _config         = config;
     _poolOperations = poolOperations;
     _logTracer      = logTracer;
     _jobOperations  = jobOperations;
     _containers     = containers;
 }
Beispiel #11
0
 public static IContainers[] AddNewContainers(ref IContainers[] CurrentObject, IContainers AddingItem)
 {
     IContainers[] tempCurrentObject = new IContainers[CurrentObject.Length + 1];
     for (int i = 0; i < CurrentObject.Length; i++)
     {
         tempCurrentObject[i] = CurrentObject[i];
     }
     tempCurrentObject[tempCurrentObject.Length - 1] = AddingItem;
     return(CurrentObject = tempCurrentObject);
 }
Beispiel #12
0
 public Events(IQueue queue, IWebhookOperations webhook, ILogTracer log, IContainers containers, ICreds creds)
 {
     _queue      = queue;
     _webhook    = webhook;
     _log        = log;
     _containers = containers;
     _creds      = creds;
     _options    = new JsonSerializerOptions(EntityConverter.GetJsonSerializerOptions())
     {
         DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
     };
     _options.Converters.Add(new RemoveUserInfo());
 }
Beispiel #13
0
 public Config(IContainers containers, IServiceConfig serviceConfig, IQueue queue)
 {
     _containers    = containers;
     _serviceConfig = serviceConfig;
     _queue         = queue;
 }
Beispiel #14
0
 public Reports(ILogTracer log, IContainers containers)
 {
     _log        = log;
     _containers = containers;
 }
 /// <summary>
 /// Returns all Container which fit the filter criteria supplied. All filter
 /// parameters are optional. Container will be ordered and paged as requested.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// Return only Container whose name contains this value.
 /// </param>
 /// <param name='type'>
 /// Filter by Type. Possible values include: 'Folder', 'Server', 'Device',
 /// 'Structure', 'Service'
 /// </param>
 /// <param name='orderBy'>
 /// Container will be returned in this order.  NameAscending by default.
 /// Possible values include: 'NameAscending', 'NameDescending'
 /// </param>
 /// <param name='take'>
 /// Number of Container that should be returned.  200 by default.
 /// </param>
 /// <param name='skip'>
 /// Number of Container that should be skipped before items are returned.  0
 /// by default.
 /// </param>
 public static IList <ContainerModel> Retrieve(this IContainers operations, string name = default(string), string type = default(string), string orderBy = default(string), int?take = default(int?), int?skip = default(int?))
 {
     return(Task.Factory.StartNew(s => ((IContainers)s).RetrieveAsync(name, type, orderBy, take, skip), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #16
0
 public ContainerTestHooks(ILogTracer log, IConfigOperations configOps, IContainers containers)
 {
     _log        = log.WithTag("TestHooks", nameof(ContainerTestHooks));
     _configOps  = configOps;
     _containers = containers;
 }
 /// <summary>
 /// Deletes the Container with the Id provided.  All children will also be
 /// deleted.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container to be deleted.  Must be double URL encoded.
 /// </param>
 public static object Delete(this IContainers operations, string id)
 {
     return(Task.Factory.StartNew(s => ((IContainers)s).DeleteAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns all children (Value, Alarm, Trend or Container) parented by the
 /// Container with the Id provided.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container whose children are to be returned.  Must be double URL
 /// encoded.
 /// </param>
 /// <param name='type'>
 /// Return only those children which are of this type.  All returned by
 /// default. Possible values include: 'Container', 'Value', 'Trend', 'Alarm',
 /// 'Enum', 'AlarmEventType'
 /// </param>
 public static IList <IItem> RetrieveChildren(this IContainers operations, string id, string type = default(string))
 {
     return(Task.Factory.StartNew(s => ((IContainers)s).RetrieveChildrenAsync(id, type), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Modifies the Id property for the Container with the Id provided to the new
 /// value supplied.  Returns the modified Container.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// Id of the Container whose Id property is to be modified.  Must be double
 /// URL encoded.
 /// </param>
 /// <param name='newValue'>
 /// New Id value.
 /// </param>
 public static ContainerModel UpdateId(this IContainers operations, string id, string newValue)
 {
     return(Task.Factory.StartNew(s => ((IContainers)s).UpdateIdAsync(id, newValue), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a new Container and returns it.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='newItem'>
 /// Definition of how the Container will be created.
 /// </param>
 public static ContainerModel Create(this IContainers operations, NewContainerModel newItem)
 {
     return(Task.Factory.StartNew(s => ((IContainers)s).CreateAsync(newItem), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }