List Object Storage buckets

List buckets with size cap in GiB and storage class in one pass

yc storage bucket list --format json | jq -r '.[] | "\(.name)\t\(.max_size/1073741824)GiB\t\(.default_storage_class)"'

tool
yc32 commands
tags
ycclouddisk

More yc commands

  • aws --endpoint-url=https://storage.yandexcloud.net s3api put-bucket-lifecycle-configuration --bucket <name> --lifecycle-configuration '{"Rules":[{"ID":"expire-logs","Status":"Enabled","Filter":{"Prefix":"logs/"},"Expiration":{"Days":30}}]}'

    Auto-expire objects under prefix after 30d to cut storage cost

  • yc container registry create --name <name> && yc container registry configure-docker

    Create CR and wire docker creds helper; modern: uses yc as a credential helper, no docker login

  • docker tag <name>:<id> cr.yandex/$(yc container registry get --name <name> --format json | jq -r .id)/<name>:<id> && docker push cr.yandex/$(yc container registry get --name <name> --format json | jq -r .id)/<name>:<id>

    Tag with resolved registry id then push; avoids hardcoding the cr.yandex/<reg-id>

  • yc container repository list --format json | jq -r '.[].name' | while read r; do yc container image list --repository-name "$r" --format json | jq -r '.[] | "\(.name):\(.tags[]? // "<none>")"'; done

    Enumerate every tag across all repos; useful before a registry GC sweep

  • yc serverless container create --name <name>; yc serverless container revision deploy --container-name <name> --image cr.yandex/<id>/<name>:<id> --cores 1 --memory 512M --service-account-id <id> --concurrency 4

    Roll out a new revision from a CR image; note: concurrency caps in-flight requests per instance

all 32 yc commands