From b1ca6d27bfae3f44327f9bed10ee671fb361555c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2026 18:37:15 +0300 Subject: [PATCH] 085 s3 report --- Application.cfc | 2 +- inc/menu.cfm | 1 + s3_ls.cfm | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 s3_ls.cfm diff --git a/Application.cfc b/Application.cfc index 4d9abe2..fb8074d 100644 --- a/Application.cfc +++ b/Application.cfc @@ -87,7 +87,7 @@ - + diff --git a/inc/menu.cfm b/inc/menu.cfm index 7beaa6b..88620ff 100644 --- a/inc/menu.cfm +++ b/inc/menu.cfm @@ -19,6 +19,7 @@ + diff --git a/s3_ls.cfm b/s3_ls.cfm new file mode 100644 index 0000000..3806685 --- /dev/null +++ b/s3_ls.cfm @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + select + + u.id + ,u.owner + ,(select count(*) from s3billing.bucket_stat b where b.timestamp_addition=t.timestamp_addition AND b.owner=u.owner) as bucket_cnt + ,(select sum(b.usage_rgw_main_size_actual) from s3billing.bucket_stat b where b.timestamp_addition=t.timestamp_addition AND b.owner=u.owner) as size_byte + ,(select STRING_AGG(i.name ||'['|| + case + when ( p.name = 'default-placement') then 'HOT' + else p.name + end || ']', ', ' order by i.name) + from s3billing.bucket_stat b + join s3billing.bucket_info i on (b.bucket_id= i.id) + join s3billing.placement p on (i.placement_id = p.id) + where b.timestamp_addition=t.timestamp_addition AND b.owner=u.owner + ) as buckets + ,'WZ' || lpad(u.name, 5, '0') as wz + from s3billing.user_info u + cross join (select max(timestamp_addition) as timestamp_addition from s3billing.bucket_stat) t + + + + + + +select count(*) as cnt from s3billing.user_info where 1=1 + + + + select upper(trim(k.id_klienta)) as wz, k.__id::text as contragent_uid, k.__name as contragent, + c.__name as responsible, c.email as responsible_email, c.__status_status as responsible_status + from elma.companies k + LEFT OUTER JOIN elma.comp_users_ext c on (k.responsible=c.__id) + where k."__deletedAt" IS NULL + + + + + + + + +select + + s.id + s.owner + s.bucket_cnt + s.size_byte + s.buckets + c.wz + c.contragent + c.contragent_uid + c.responsible + c.responsible_email + +from qS3 s +left outer join qContragent c on (s.wz=c.wz) +where 1=1 +order by + + + + + + + + + + + + Учетки S3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + class="err">#owner# + + + + + + + + + + + +
#id##wz##contragent##responsible##responsible_email##bucket_cnt##size_byte##buckets#
+ + #gridFooter# + +
+