cancel
Showing results for 
Search instead for 
Did you mean: 

Netbackup catalog API , image information

Hello,

I'm currently playing with the API to get all images from a specific period of time and sort them based on their usage.

Usually to get image size i used this command :

- bpimagelist -backupid -U <backup image>

you will get an output like this :

Backed Up Expires                    Files        KB             C Sched Type On Hold             Policy
---------------- ----------                 --------    --------            - ---------------         -------          ------------
03/10/2020 08:30 06/11/2020 3692550 3253310152 N Full Backup       0             <policy name>

Now , using the API you get an output like this :

{
    "data": {
        "links": {
            "self": {
                "href": "/catalog/images/<client_name>_1583843402"
            }
        },
        "type": "image",
        "id": "<client_name>_1583843402",
        "attributes": {
            "policyType": "Standard",
            "clientName": <client_name>,
            "policyName": < hostname >,
            "scheduleType": "FULL",
            "backupCopyType": "DEFAULT",
            "backupTime": "2020-03-10T12:30:02Z",
            "backupStatus": 0,
            "blockIncrementalFullTime": 0,
            "clientCharset": 0,
            "compression": false,
            "contentFile": "<policy_name>_1583843402_FULL.f",
            "contentFileSize": "111152647",
            "contentFileCompressed": "ZLIB",
            "creator": "root",
            "dataClassification": "Silver",
            "drMediaList": [],
            "elapsedTimeSeconds": 10,
            "encryption": "NONE",
            "expiration": "2020-06-11T12:30:02Z",
            "extendedSecurityInfo": false,
            "fileSystemOnly": false,
            "fragments": [
                {
                    "blockSize": 512,
                    "checkpoint": 0,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 256,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": -2147482648,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 3,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 133,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 0,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 128,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": -1,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 509448,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 157,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 1,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 190979072,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 2,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 402630656,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 3,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 450425344,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 4,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 454542592,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 5,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 386649088,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 6,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 354954752,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 7,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 358067712,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 1,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 8,
                    "host": < hostname >,
                    "mediaId": "@aaaad",
                    "kbytes64": 369555456,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "1;,
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                },
                {
                    "blockSize": 262144,
                    "checkpoint": 0,
                    "copyDate": "2020-03-14T01:52:59Z",
                    "copyNumber": 1,
                    "dataFormat": "UNDEFINED",
                    "density": 0,
                    "deviceWrittenOn": -1,
                    "expiration": "2020-06-11T12:30:02Z",
                    "fragmentFlags": 0,
                    "fileNumber": 0,
                    "firstBlock": 0,
                    "fragmentNumber": 9,
                    "host": <hostname>,
                    "mediaId": "@aaaad",
                    "kbytes64": 284996032,
                    "lastBlock": 0,
                    "mediaDate": 0,
                    "mediaDesc": "1;",
                    "mediaSequenceNumber": 0,
                    "mediaSubtype": 6,
                    "mediaType": 0,
                    "multiplex": 0,
                    "offset": 0,
                    "remainder": 0,
                    "resumeNumber": 0,
                    "retentionLevel": 1,
                    "slpTryToKeepDate": 0
                }
            ],
            "imageDumpLevel": 0,
            "imageType": "IMPORTED",
            "jobId": 115508,
            "kbytes": -1041657144,
            "keyword": "",
            "kbytesDataTransferred": 0,
            "mpx": false,
            "numCopies": 1,
            "numFiles": 3692550,
            "numberFragments": 11,
            "originMasterServer": <master server >,
            "primaryCopy": 1,
            "proxyClient": "",
            "remoteExpiration": 1591878602,
            "retentionLevel": 1,
            "scheduleName": "full_monthly",
            "slpVersion": 0,
            "slpCompleted": 3,
            "slpName": "",
            "tirExpiration": 0,
            "version": 13
        }
    }
}

To get the same "KB" usage value using the API, i need to  sum all "kbytes64" from each fragment. this will give me the exact number.

Now, my question is :

Whats the meaning of the following values ? 

_kbytes_: -1041657144   <--- this value is even negative sometimes, what is this ?
_kbytesDataTransferred_: 0  

i read the API guide but the explanation is very basic.

 

kind regards

 

Tags (1)
4 Replies

Re: Netbackup catalog API , image information

Run a test / dummy backup of say one 1KB file.  Then query the image via API.  What does that show?  Maybe you need to query a range of different sized, and different frag count, images in order to ascertain the behaviour.

Re: Netbackup catalog API , image information

Not sure I can answer your questions, but the "strange" results could be caused by looking at an image that has been imported or possibly not finished SLP processing?

For local backups (at least), that final kbytes value should be the size of the backup (such as you determine via bpimagelist, or summing the size of each fragment). 

Can you try again using a backup performed locally, and compare the results using bpimagelist with that same backup? Ideally if the image has to be part of an SLP, then all SLP processing should be complete before you try the command?

When I try something similar for a small image in my test lab, the final kbytes value (or the totals of the fragment kbytes64 - only one for my test) do equal the image size as shown using bpimagelist.

Re: Netbackup catalog API , image information

Can these negative values be from an expired copy?

Re: Netbackup catalog API , image information

The problem is the field type is wrong for some reason for "kbytes"...  The value is being converted to an signed integer, and should be an unsigned integer. 

If you convert a signed interger of 

-1041657144

to an unsigned integer you get 

3253310152