GET Job in CV11 not pulling most recent jobs

Last post 03-15-2018, 3:09 PM by Yashwanth. 12 replies.
Sort Posts: Previous Next
  • GET Job in CV11 not pulling most recent jobs
    Posted: 03-12-2018, 3:52 PM

    A while back I wrote a monitoring check using the commvault API to help keep track of backup jobs in our environment.  Part of this check uses the GET Job API to pull a list of backup jobs to attach to each client.  Example:

    http://commvaultserver:81/SearchSvc/CVWebService.svc/Job?clientId=265&j
    obFilter=backup

    After updating from Commvault 10 to Commvault 11, the behavior of GET Job is inconsistent.  This query pulls a list of 100 backup jobs, but it won't necessarily be the most recent jobs for that client.  In one case, I got a random list of 100 jobs from May.  Is this a bug in the API?  Any way to work around this to just pull the 100 most recent jobs?

     

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-12-2018, 4:28 PM

    What if you supply the parameter completedJobLookupTime with a value of, say, 1440?

    http://commvaultserver:81/SearchSvc/CVWebService.svc/Job?clientId=265&jobFilter=backup&completedJobLookupTime=1440


    Cheers,
    Luke
    (@cv_skywalker)
  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-12-2018, 4:48 PM

    Sky:

    What if you supply the parameter completedJobLookupTime with a value of, say, 1440?

    http://commvaultserver:81/SearchSvc/CVWebService.svc/Job?clientId=265&jobFilter=backup&completedJobLookupTime=1440

    Setting it to 1440 typically won't pull any results (unless the client has been backed up in the last 24 minutes).  I could try to make it work using a much larger lookup time, but it's still not ideal since we have a very wide range of backup increments that I'd need to account for.

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-12-2018, 4:53 PM

    Oops, my bad.  I meant 86400... but fair point on the backup increments.

    Let me ask internally as to whether we have other filters that can be applied.


    Cheers,
    Luke
    (@cv_skywalker)
  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-14-2018, 10:19 AM

    Hi metanaut - can you try controlling the paging configuration as per JSON/XML payloads below?

    https://api.commvault.com/#17736755-e86f-9a27-75c5-6c5e999bec80 

    Sample:

    POST <webservice>//Jobs HTTP/1.1

    Host: <webservice>

    Accept: application/json

    AuthToken: QSDK <your token here>

    Content-Type: application/json

    {

                    "scope": 1,

                    "category": 2,

                    "pagingConfig": {

                                    "sortDirection": 1,

                                    "offset": 0,

                                    "sortField": "jobStartTime",

                                    "limit": 100

                    },

                    "jobFilter": {

                                    "completedJobLookupTime": 86400,

                                    "jobTypeList": [

                                                    4

                                    ],

                                    "entity": {

                                                    "clientId": 2

                                    }

                    }

    }

     

    -or-

     

    POST <webservice>/Jobs HTTP/1.1

    Host: <webservice>

    Accept: application/xml

    AuthToken: QSDK <your token here>

    <JobManager_JobListRequest scope="1" category="2">

                    <pagingConfig sortField="jobStartTime" sortDirection="1" offset="1" limit="100" />

                    <jobFilter completedJobLookupTime="86400" showAgedJobs="0">

                                    <clientList clientId="2"/>

                                    <jobTypeList val="4"/>

                    </jobFilter>

    </JobManager_JobListRequest>



    Cheers,
    Luke
    (@cv_skywalker)
  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-14-2018, 2:48 PM

    I'm not having any luck getting results out of this.  All I'm getting back is this:

    {"totalRecordsWithoutPaging":0}

    Also, is there somewhere I can find a description of what some of these variables do?  (scope,category,jobTypelist,etc)

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 12:25 PM

    Hi Metanaut,

    https://api.commvault.com/#17736755-e86f-9a27-75c5-6c5e999bec80

    "scope" is always 1. I've updated the description for few of the other important variables in the above doc link.

    Could you please try with a larger "completedJobLookupTime" of value: 31536000, which is for the last one year and see if you get any results.


    Thanks,

    Yash

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 1:40 PM

    Still not having any luck.  Here is the json I'm passing:

     

    {
    "scope": 1,
    "category": 2,
    "pagingConfig": {
    "offset": 0,
    "limit": 100,
    "sortDirection": 1,
    "sortField": "jobStartTime"
    },
    "jobfilter": {
    "jobTypeList": [
    4
    ],
    "entity": {
    "clientId": 5
    },
    "completedJobLookupTime": 31536000
    }
    }
     
  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 1:51 PM

    Could you please try with "category" value 0

     

    Thanks,

    Yash

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 1:59 PM

    Same results with category set to 0

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 2:26 PM

    Wondering if its happening only for this client. Could you please try with below JSON with multiple clients?

     

    {
    "scope": 1,
    "category": 0,
    "pagingConfig": {
    "sortDirection": 1,
    "offset": 0,
    "sortField": "jobStartTime",
    "limit": 100
    },
    "jobFilter": {
    "completedJobLookupTime": 31536000,
    "showAgedJobs": true,
    "jobTypeList": [
    4
    ],
    "clientList": [
    {
    "clientId": 5
    },
    {
    "clientId": 2
    }
    ]
    }
    }
  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 2:34 PM

    I've tested against a few clients and have gotten the same result.  Just tested with your json, still getting 0 records returned.

  • Re: GET Job in CV11 not pulling most recent jobs
    Posted: 03-15-2018, 3:09 PM

    Could you please escalate with Web Server debug log level at 10.

     

    Thanks,

    Yash

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2018 Commvault | All Rights Reserved. | Legal | Privacy Policy