Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.ServiceClientAdapterNS.ServiceClientAdapter.GetJobs C# (CSharp) Method

GetJobs() public method

Lists jobs according to the parameters
public GetJobs ( string jobId, string status, string operation, System.DateTime startTime, System.DateTime endTime, string backupManagementType, int top = null, string skipToken = null ) : Microsoft.Azure.Management.RecoveryServices.Backup.Models.JobListResponse
jobId string ID of the job
status string Status of the job
operation string Operation represented by the job
startTime System.DateTime Time when the job started
endTime System.DateTime Time when the job finished
backupManagementType string Backup management type of the item represented by the job
top int Top pagination param
skipToken string Skip token pagination param
return Microsoft.Azure.Management.RecoveryServices.Backup.Models.JobListResponse
        public JobListResponse GetJobs(
            string jobId,
            string status,
            string operation,
            DateTime startTime,
            DateTime endTime,
            string backupManagementType,
            int? top = null,
            string skipToken = null)
        {
            string resourceName = BmsAdapter.GetResourceName();
            string resourceGroupName = BmsAdapter.GetResourceGroupName();

            // build pagination request
            PaginationRequest pagReq = new PaginationRequest()
            {
                SkipToken = skipToken
            };
            // respecting top if provided
            if (top.HasValue)
            {
                pagReq.Top = top.ToString();
            }

            CommonJobQueryFilters commonFilters = GetQueryObject(
                backupManagementType,
                startTime,
                endTime,
                jobId,
                status,
                operation);

            return BmsAdapter.Client.Jobs.ListAsync(
                resourceGroupName,
                resourceName,
                commonFilters,
                pagReq,
                BmsAdapter.GetCustomRequestHeaders(),
                BmsAdapter.CmdletCancellationToken).Result;
        }