Пример #1
0
        /// <summary>
        /// Undocumented helper method since the PowerShell Get-ServiceFabricRepairTask returns timestamps without second/millisecond info.
        /// Not intended for automation use. Use Get-ServiceFabricRepairTask instead.
        /// </summary>
        private Task <string> HandleCommandGetRepairTasksAsync(string args)
        {
            List <IRepairTask> repairTaskList;

            CoordinatorContext cc = CoordinatorContext;

            if (cc == null)
            {
                throw Trace.CreateException(
                          traceType,
                          NativeTypes.FABRIC_ERROR_CODE.FABRIC_E_NOT_READY,
                          "Job information is not available");
            }

            repairTaskList = cc.MappedRepairTasks.Values.Select(e => e.RepairTask).ToList();

            var json = repairTaskList.ToJson();

            return(Task.FromResult(json));
        }
Пример #2
0
        private Task <string> HandleCommandGetJobsAsync(string args)
        {
            traceType.WriteInfo("GetJobs requested");

            CoordinatorContext cc = CoordinatorContext;

            if (cc == null)
            {
                throw Trace.CreateException(
                          traceType,
                          NativeTypes.FABRIC_ERROR_CODE.FABRIC_E_NOT_READY,
                          "Job information is not available");
            }

            // for a full view, GetDoc could be used
            var jobs = new List <JobSummary>();

            foreach (var j in cc.MappedTenantJobs.Values)
            {
                jobs.Add(j.GetSummary());
            }

            return(Task.FromResult(jobs.ToJson()));
        }