appwrite/src/Appwrite/Utopia/Response/Model/UsageStorage.php

119 lines
3.7 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageStorage extends Model
{
public function __construct()
{
$this
->addRule('range', [
'type' => self::TYPE_STRING,
'description' => 'The time range of the usage stats.',
'default' => '',
'example' => '30d',
])
->addRule('storage', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for the occupied storage size (in bytes).',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
])
2021-11-09 05:10:06 +00:00
->addRule('filesCount', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated stats for total number of files.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
])
2021-11-09 05:10:06 +00:00
->addRule('bucketsCount', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 05:10:06 +00:00
'description' => 'Aggregated stats for total number of buckets.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 05:10:06 +00:00
])
->addRule('bucketsCreate', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 05:10:06 +00:00
'description' => 'Aggregated stats for buckets created.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 05:10:06 +00:00
])
->addRule('bucketsRead', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 05:10:06 +00:00
'description' => 'Aggregated stats for buckets read.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 05:10:06 +00:00
])
->addRule('bucketsUpdate', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 05:10:06 +00:00
'description' => 'Aggregated stats for buckets updated.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 05:10:06 +00:00
])
->addRule('bucketsDelete', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 05:10:06 +00:00
'description' => 'Aggregated stats for buckets deleted.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 05:10:06 +00:00
])
2021-11-09 06:07:01 +00:00
->addRule('filesCreate', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 06:07:01 +00:00
'description' => 'Aggregated stats for files created.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 06:07:01 +00:00
])
->addRule('filesRead', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 06:07:01 +00:00
'description' => 'Aggregated stats for files read.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 06:07:01 +00:00
])
->addRule('filesUpdate', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 06:07:01 +00:00
'description' => 'Aggregated stats for files updated.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 06:07:01 +00:00
])
->addRule('filesDelete', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2021-11-09 06:07:01 +00:00
'description' => 'Aggregated stats for files deleted.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +00:00
'array' => true
2021-11-09 06:07:01 +00:00
])
;
}
/**
* Get Name
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'StorageUsage';
}
/**
* Get Type
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getType(): string
{
return Response::MODEL_USAGE_STORAGE;
}
2022-05-23 14:54:50 +00:00
}