Container backup expiry ignored

lxd v. 4.11
zfs

POST
/1.0/instances//X6/backups
{
“name”: “backupName2”,
“expiry”: 3600, // tried 1d, 1m as well
“volume_only”: true,
“optimized_storage”: true // also tried false, though it probabely doesnt relate
}

---------------------------------- RESULT --------------------------------------
Array
(
[health] => Array
(
[type] => async
[status_code] => 100
[status] => Operation created
[error_code] => 0
[error] =>
)

[meta] => Array
    (
        [id] => d85b43fb-9785-4af8-9aef-78328ef523c3
        [class] => task
        [description] => Backing up instance
        [created_at] => 2021-02-22T07:44:11.092645029+01:00
        [updated_at] => 2021-02-22T07:44:11.092645029+01:00
        [status] => Running
        [status_code] => 103
        [resources] => Array
            (
                [backups] => Array
                    (
                        [0] => /1.0/backups/backupName2
                    )

                [containers] => Array
                    (
                        [0] => /1.0/containers/X6
                    )

                [instances] => Array
                    (
                        [0] => /1.0/instances/X6
                    )

            )

        [metadata] => 
        [may_cancel] => 
        [err] => 
        [location] => none
    )

)

GET
/1.0/instances/X6/backups/backupName2?project=101
[1] => Array
(
[name] => backupName2
[created_at] => 2021-02-22T07:44:11+01:00
[expires_at] => 0001-01-01T00:09:21+00:09
[instance_only] =>
[container_only] =>
[optimized_storage] => 1
)

It has worked by replacing 'expiry" through “expires_at with real time value”

    {
            "name": "bk1",
            "expires_at": "2021-02-23T08:52:35.357627613+01:00",
            "instance_only": true,
            "container_only": true,
            "optimized_storage": false,
            "compression_algorithm": "xz"
    }

BTW, the “compression_algorithm” can be passed as well, which not mentioned in api docs.
What does expiry achieve anyway? Is it deleting the backup tarball file? Or just removing the db entry?

It looks like the docs are out of sync with the API (one of the reasons we are working on auto generating the API docs by the way):

See


The auto expiry will remove the backup from the host’s filesystem as well as the DB entry.
If the backup has been exported before that to another file then that file will still remain.

I’ll send a PR to fix the docs.

BTW, the current API structures are in here:

So the current instance backup structures are here:

This fixes it:

Thanks Thomas for super fast reaction.