E.g. All versions that are not LIVE (and 30 days old) to be deleted. All other versions to be moved to COLDLINE (after 365 day)

{"lifecycle": 
  { "rule": 
     [ { "action": { "type": "Delete"}, "condition": { "age": 30, "IsLive": false } }, 
    { "action": { "type": "SetStorageClass", "storageClass": "COLDLINE" }, "condition": { "age": 365, "matchesStorageClass": ["NEARLINE"] } }]}}
  1. Run the gsutil lifecycle set command as following.  gsutil lifecycle set [JSON file] gs://[YOUR CLOUD ...

A lifecycle rule includes conditions which an object must meet before the action defined in the rule occurs on the object. Lifecycle rules support the following conditions: