/// <summary> /// Get a list of all queues in a project. By default, 30 queues are listed at a time. To see more, use the page parameter or the per_page parameter. Up to 100 queues may be listed on a single page. /// </summary> /// <param name="projectId">Project identifier available from the HUD</param> /// <param name="token">Token available from the HUD</param> /// <param name="page">Page index (zero based)</param> /// <param name="perPage">Number of results per page</param> /// <returns>An IList of queue names</returns> public static IList<string> Queues(string projectId = null, string token = null, int page = 0, int perPage = 30) { var client = new IronClient("IronWorker .NET", "0.1", "iron_mq", projectId: projectId, token: token); var url = string.Format("{0}?page={1}&per_page={2}", QueueCore, page, perPage); var json = client.Get(url); var template = new[] { new { id = string.Empty, name = string.Empty, projectId = string.Empty } }; var queues = JsonConvert.DeserializeAnonymousType(json, template); return queues.Select(q => q.name).ToList(); }
/// <summary> /// Get a list of all queues in a project. By default, 30 queues are listed at a time. To see more, use the page parameter or the per_page parameter. Up to 100 queues may be listed on a single page. /// </summary> /// <param name="projectId">Project identifier available from the HUD</param> /// <param name="token">Token available from the HUD</param> /// <param name="page">Page index (zero based)</param> /// <param name="perPage">Number of results per page</param> /// <returns>An IList of queue names</returns> public static IList <string> Queues(string projectId = null, string token = null, int page = 0, int perPage = 30) { var client = new IronClient("IronWorker .NET", "0.1", "iron_mq", projectId: projectId, token: token); var url = string.Format("{0}?page={1}&per_page={2}", QueueCore, page, perPage); var json = client.Get(url); var template = new[] { new { id = string.Empty, name = string.Empty, projectId = string.Empty } }; var queues = JsonConvert.DeserializeAnonymousType(json, template); return(queues.Select(q => q.name).ToList()); }
public void IronClientConstructorTest() { string name = "Iron Tools Client"; // TODO: Initialize to an appropriate value string version = "0.1"; // TODO: Initialize to an appropriate value string product = string.Empty; // TODO: Initialize to an appropriate value string host = string.Empty; // TODO: Initialize to an appropriate value int port = 0; // TODO: Initialize to an appropriate value string projectId = string.Empty; // TODO: Initialize to an appropriate value string token = string.Empty; // TODO: Initialize to an appropriate value string protocol = string.Empty; // TODO: Initialize to an appropriate value int apiVersion = 0; // TODO: Initialize to an appropriate value string configFile = string.Empty; // TODO: Initialize to an appropriate value IronClient target = new IronClient(name, version, product, host, port, projectId, token, protocol, apiVersion, configFile); Assert.IsNotNull(target); }
/// <summary> /// Initializes a new instance of the <see cref="IronMQ" /> class. /// </summary> /// <param name="name">Queue name</param> /// <param name="projectId">Project identifier available from the HUD</param> /// <param name="token">Token available from the HUD</param> public IronMQ(string name, string projectId = null, string token = null) { this.client = new IronClient("IronWorker .NET", "0.2", "iron_mq", projectId: projectId, token: token); this.name = name; }
/// <summary> /// Initializes a new instance of the <see cref="IronWorker" /> class. /// </summary> /// <param name="projectId">Project identifier available from the HUD</param> /// <param name="token">Token available from the HUD</param> public IronWorker(string projectId = null, string token = null) { this.client = new IronClient("IronWorker .NET", "0.2", "iron_worker", projectId: projectId, token: token); }
/// <summary> /// Initializes a new instance of the <see cref="IronCache" /> class. /// </summary> /// <param name="projectId">Project Id obtained from the HUD</param> /// <param name="token">Token obtained from the HUD</param> public IronCache(string projectId = null, string token = null) { this.client = new IronClient("IronCache .NET", "0.2", "iron_cache", projectId: projectId, token: token); }