controllers.stats_controller module¶
-
class
controllers.stats_controller.
StatsController
(config=None, client=None, call_back=None)[source]¶ Bases:
cohesity_management_sdk.controllers.base_controller.BaseController
A Controller to access Endpoints in the cohesity_management_sdk API.
-
get_active_alerts_stats
(start_time_usecs, end_time_usecs)[source]¶ Does a GET request to /public/stats/alerts.
Compute the statistics on the active Alerts generated on the cluster based on the provided time interval.
- Args:
- start_time_usecs (long|int): Specifies the start time Unix time
epoch in microseconds from which the active alerts stats are computed.
- end_time_usecs (long|int): Specifies the end time Unix time epoch
in microseconds to which the active alerts stats are computed.
- Returns:
ActiveAlertsStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_consumer_stats
(consumer_type=None, max_count=None, cookie=None, consumer_id_list=None, consumer_entity_id_list=None, fetch_view_box_name=None, fetch_tenant_name=None, fetch_protection_policy=None, fetch_protection_environment=None, view_boxes_id_list=None, organizations_id_list=None, tenant_ids=None, include_service_provider=None)[source]¶ Does a GET request to /public/stats/consumers.
Gets the statistics of consumers.
- Args:
- consumer_type (ConsumerTypeGetConsumerStatsEnum, optional):
Specifies the consumer type. Type of the consumer can be one of the following three, ‘kViews’, indicates the stats info of Views used per organization (tenant) per view box (storage domain). ‘kProtectionRuns’, indicates the stats info of Protection Runs used per organization (tenant) per view box (storage domain). ‘kReplicationRuns’, indicates the stats info of Replication In used per organization (tenant) per view box (storage domain).
- max_count (long|int, optional): Specifies a limit on the number of
stats groups returned.
- cookie (string, optional): Specifies the opaque string returned in
the previous response. If this is set, next set of active opens just after the previous response are returned. If this is not set, first set of active opens are returned.
- consumer_id_list (list of long|int, optional): Specifies a list of
consumer ids.
- consumer_entity_id_list (list of string, optional): Specifies a
list of consumer entity ids. If this field is specified, each entity id must corresponds to the id in ‘ConsumerIdList’ in the same index, and the length of ‘ConsumerEntityIdList’ and ‘ConsumerIdList’ must be the same.
- fetch_view_box_name (bool, optional): Specifies whether to fetch
view box (storage domain) name for each consumer.
- fetch_tenant_name (bool, optional): Specifies whether to fetch
tenant (organization) name for each consumer.
- fetch_protection_policy (bool, optional): Specifies whether to
fetch protection policy for each consumer. This field is applicable only if ‘consumerType’ is ‘kProtectionRuns’ or ‘kReplicationRuns’.
- fetch_protection_environment(bool, optional): Specifies whether
to fetch protection environment for each consumer. This field is applicable only if ‘consumerType’ is ‘kProtectionRuns’ or ‘kReplicationRuns’.
- view_boxes_id_list (list of long|int, optional): Specifies a list
of view boxes (storage domain) id.
- organizations_id_list (list of string, optional): Specifies a list
of organizations (tenant) id.
- tenant_ids (list of string, optional): Specifies a list of
organizations (tenant) id. This field is added to allow tenantIds json tag. This list will be concatenated with TenantsIdList to form full list of tenantsIdList.
- include_service_provider(bool, optional): Specifies whether to
fetch the consumption of external service providers. These information will be listed as a unique organization (tenant) in response. By default it is false.
- Returns:
GetConsumerStatsResult: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_file_distribution_stats
(entity_type)[source]¶ Does a GET request to /public/stats/files.
Compute the file distribution statistics on a given entity like cluster or storage domain.
- Args:
- entity_type (EntityTypeGetFileDistributionStatsEnum): Specifies
the entity type on which file distribution stats are computed.
- Returns:
list of FileDistributionStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_last_protection_run_stats
()[source]¶ Does a GET request to /public/stats/protectionRuns/lastRun.
Compute stats on last Protection Run for every job.
- Returns:
LastProtectionRunStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_protected_objects_summary
(exclude_types=None)[source]¶ Does a GET request to /public/stats/protectionSummary.
Computes the protected objects summary on the cluster.
- Args:
- exclude_types (list of ExcludeTypeGetProtectedObjectsSummaryEnum,
optional): Specifies the environment types to exclude.
- Returns:
ProtectedObjectsSummary: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_protection_runs_stats
(status, start_time_usecs, end_time_usecs)[source]¶ Does a GET request to /public/stats/protectionRuns.
Compute the statistics of the Protection Runs based on the input filters. This endpoint provides a snapshot of count of Protection Runs of a specified status on a specified time interval.
- Args:
- status (StatusGetProtectionRunsStatsEnum): Specifies the
Protection Run status for which stats has to be computed.
- start_time_usecs (long|int): Specifies the start time in Unix
timestamp epoch in microseconds where the end time of the Protection Run is greater than the specified value.
- end_time_usecs (long|int): Specifies the end time in Unix
timestamp epoch in microseconds where the end time of the Protection Run is lesser than the specified value.
- Returns:
ProtectionRunsStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_restore_stats
(start_time_usecs, end_time_usecs)[source]¶ Does a GET request to /public/stats/restores.
Compute the statistics on the Restore tasks on the cluster based on the provided time interval.
- Args:
- start_time_usecs (long|int): Specifies the start time Unix time
epoch in microseconds from which the restore stats are computed.
- end_time_usecs (long|int): Specifies the end time Unix time epoch
in microseconds to which the restore stats are computed.
- Returns:
RestoreStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_storage_stats
()[source]¶ Does a GET request to /public/stats/storage.
Computes the storage stats on the cluster.
- Returns:
StorageStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_tenant_stats
(consumer_type=None, skip_group_by_tenant=None, max_count=None, cookie=None, output_format=None, view_boxes_id_list=None, organizations_id_list=None, tenant_ids=None, include_service_provider=None)[source]¶ Does a GET request to /public/stats/tenants.
Gets the statistics of organizations (tenant).
- Args:
- consumer_type (ConsumerTypeGetTenantStatsEnum, optional):
Specifies the consumer type. Type of the consumer can be one of the following three, ‘kViews’, indicates the stats info of Views used per organization (tenant) per view box (storage domain). ‘kProtectionRuns’, indicates the stats info of Protection Runs used per organization (tenant) per view box (storage domain). ‘kReplicationRuns’, indicates the stats info of Replication In used per organization (tenant) per view box (storage domain). ‘kViewProtectionRuns’, indicates the stats info of View Protection Runs used per organization (tenant) per view box (storage domain).
- skip_group_by_tenant (bool, optional): Specifies if we should skip
grouping by tenant. If false, and tenant has multiple storage domains, then the stats for the storage domains will be aggregated. If true, then the response will return each storage domain cross tenant independently.
- max_count (long|int, optional): Specifies a limit on the number of
stats groups returned.
- cookie (string, optional): Specifies the opaque string returned in
the previous response. If this is set, next set of active opens just after the previous response are returned. If this is not set, first set of active opens are returned.
- output_format (string, optional): Specifies what format to return
the data in. Defaults to proto, but can select other options like csv.
- view_boxes_id_list (list of long|int, optional): Specifies a list
of view boxes (storage domain) id.
- organizations_id_list (list of string, optional): Specifies a list
of organizations (tenant) id.
- tenant_ids (list of string, optional): Specifies a list of
organizations (tenant) id. This field is added to allow tenantIds json tag. This list will be concatenated with TenantsIdList to form full list of tenantsIdList.
- include_service_provider(bool, optional): Specifies whether to
fetch the consumption of external service providers. These information will be listed as a unique organization (tenant) in response. By default it is false.
- Returns:
GetTenantStatsResult: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_vault_provider_stats
(run_type)[source]¶ Does a GET request to /public/stats/vaults/providers.
Compute the size and count of entities on vaults.
- Args:
- run_type (RunTypeGetVaultProviderStatsEnum): Specifies the type of
the runs.
- Returns:
list of VaultProviderStatsInfo: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_vault_run_stats
(run_type, start_time_usecs, end_time_usecs, interval)[source]¶ Does a GET request to /public/stats/vaults/runs.
Compute the statistics on protection runs to or from a vault and return a trend line of the result.
- Args:
- run_type (RunTypeGetVaultRunStatsEnum): Specifies the type of the
run.
- start_time_usecs (long|int): Specifies the start time Unix time
epoch in microseconds from which the vault run stats are computed.
- end_time_usecs (long|int): Specifies the end time Unix time epoch
in microseconds to which the vault run stats are computed.
- interval (IntervalEnum): Specifies the interval by which runs will
be grouped together in the returned trend line.
- Returns:
VaultRunStatsSummary: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_vault_stats
()[source]¶ Does a GET request to /public/stats/vaults.
Compute the statistics on vaults.
- Returns:
VaultStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_view_box_stats
(view_boxes_id_list=None, organizations_id_list=None, tenant_ids=None, include_service_provider=None)[source]¶ Does a GET request to /public/stats/viewBoxes.
Gets the statistics of view boxes (storage domain).
- Args:
- view_boxes_id_list (list of long|int, optional): Specifies a list
of view boxes (storage domain) id.
- organizations_id_list (list of string, optional): Specifies a list
of organizations (tenant) id.
- tenant_ids (list of string, optional): Specifies a list of
organizations (tenant) id. This field is added to allow tenantIds json tag. This list will be concatenated with TenantsIdList to form full list of tenantsIdList.
- include_service_provider(bool, optional): Specifies whether to
fetch the consumption of external service providers. These information will be listed as a unique organization (tenant) in response. By default it is false.
- Returns:
GetViewBoxStatsResult: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_view_protocol_stats
()[source]¶ Does a GET request to /public/stats/views/protocols.
Compute the protocol statistics on Views.
- Returns:
list of ViewProtocolStats: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-
get_view_stats
(metric=None, num_top_views=None)[source]¶ Does a GET request to /public/stats/views.
Compute the statistics on Views.
- Args:
- metric (MetricEnum, optional): Specifies the metric to which stats
has to be sorted.
- num_top_views (long|int, optional): Specifies the number of views
for which stats has to be computed. Specifying this field will return the Views sorted in the descending order on the metric specified. If specified, minimum value is 1. If not specified, all views will be returned. If metric is not specified, this parameter must also not be specified.
- Returns:
ViewStatsSnapshot: Response from the API. Success
- Raises:
- APIException: When an error occurs while fetching the data from
the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request.
-