diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-08-23 01:08:28 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-08-23 01:08:28 +0300 |
commit | 606a1d2d31aff69ddabe7e3794f61f3e778da3e8 (patch) | |
tree | bfaee792fd551070a3581c77bc52164610f03b2a /app/policies/namespace | |
parent | c65ea080ba8637f0e83ea97b091e4ab3ebbce635 (diff) |
Expose namespace storage statistics with GraphQL
Root namespaces have storage statistics.
This commit allows namespace owners to get those stats via GraphQL
queries like the following one
{
namespace(fullPath: "a_namespace_path") {
rootStorageStatistics {
storageSize
repositorySize
lfsObjectsSize
buildArtifactsSize
packagesSize
wikiSize
}
}
}
Diffstat (limited to 'app/policies/namespace')
-rw-r--r-- | app/policies/namespace/root_storage_statistics_policy.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/policies/namespace/root_storage_statistics_policy.rb b/app/policies/namespace/root_storage_statistics_policy.rb new file mode 100644 index 00000000000..63fcaf20dfe --- /dev/null +++ b/app/policies/namespace/root_storage_statistics_policy.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class Namespace::RootStorageStatisticsPolicy < BasePolicy + delegate { @subject.namespace } +end |