Skip to content

start_sessions_statistics_aggregation

start_sessions_statistics_aggregation(
    farm_id: FarmId,
    resource_ids: SessionsStatisticsResources,
    start_time: Timestamp,
    end_time: Timestamp,
    group_by: UsageGroupBy,
    statistics: UsageStatistics,
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    timezone: Optional[Timezone] = None,
    period: Optional[Period] = None,
) -> StartSessionsStatisticsAggregationResponse

Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the GetSessionsStatisticsAggregation operation. You can only have one running aggregation for your Deadline Cloud farm. Call the GetSessionsStatisticsAggregation operation and check the status field to see if an aggregation is running. Statistics are available for 1 hour after you call the StartSessionsStatisticsAggregation operation.

Parameters:

  • farm_id (FarmId) –

    The identifier of the farm that contains queues or fleets to return statistics for.

  • resource_ids (SessionsStatisticsResources) –

    A list of fleet IDs or queue IDs to gather statistics for.

  • start_time (Timestamp) –

    The Linux timestamp of the date and time that the statistics start.

  • end_time (Timestamp) –

    The Linux timestamp of the date and time that the statistics end.

  • timezone (Optional[Timezone], default: None ) –

    The time zone to use for the statistics. Use UTC notation such as "UTC+8."

  • period (Optional[Period], default: None ) –

    The period to aggregate the statistics.

  • group_by (UsageGroupBy) –

    The field to use to group the statistics.

  • statistics (UsageStatistics) –

    One to four statistics to return.

Raises:

Source code in docs_src/capo_deadline/_services/deadline.py
def start_sessions_statistics_aggregation(
    self,
    farm_id: "capo_deadline.types.farm_id.FarmId",
    resource_ids: "capo_deadline.types.sessions_statistics_resources.SessionsStatisticsResources",
    start_time: "capo_deadline.types.timestamp.Timestamp",
    end_time: "capo_deadline.types.timestamp.Timestamp",
    group_by: "capo_deadline.types.usage_group_by.UsageGroupBy",
    statistics: "capo_deadline.types.usage_statistics.UsageStatistics",
    *,
    config_overrides: Optional[deadlineClientConfig] = None,
    timezone: Optional["capo_deadline.types.timezone.Timezone"] = None,
    period: Optional["capo_deadline.types.period.Period"] = None,
) -> "capo_deadline.types.start_sessions_statistics_aggregation_response.StartSessionsStatisticsAggregationResponse":
    """<p>Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the <code>GetSessionsStatisticsAggregation</code> operation. You can only have one running aggregation for your Deadline Cloud farm. Call the <code>GetSessionsStatisticsAggregation</code> operation and check the <code>status</code> field to see if an aggregation is running. Statistics are available for 1 hour after you call the <code>StartSessionsStatisticsAggregation</code> operation.</p>

    Args:
        farm_id: <p>The identifier of the farm that contains queues or fleets to return statistics for.</p>
        resource_ids: <p>A list of fleet IDs or queue IDs to gather statistics for.</p>
        start_time: <p>The Linux timestamp of the date and time that the statistics start.</p>
        end_time: <p>The Linux timestamp of the date and time that the statistics end.</p>
        timezone: <p>The time zone to use for the statistics. Use UTC notation such as "UTC+8."</p>
        period: <p>The period to aggregate the statistics.</p>
        group_by: <p>The field to use to group the statistics.</p>
        statistics: <p>One to four statistics to return.</p>

    Raises:
        capo_deadline.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action.</p>
        capo_deadline.errors.internal_server_error_exception.InternalServerErrorException: <p>Deadline Cloud can't process your request right now. Try again later.</p>
        capo_deadline.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_deadline.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a request rate quota.</p>
        capo_deadline.errors.validation_exception.ValidationException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.</p>
        capo_deadline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_deadline.types.start_sessions_statistics_aggregation_request.StartSessionsStatisticsAggregationRequest]",
    ) -> OperationResponse[
        "capo_deadline.types.start_sessions_statistics_aggregation_response.StartSessionsStatisticsAggregationResponse"
    ]:
        import capo_deadline._operations.deadline.start_sessions_statistics_aggregation

        output, http_response = (
            capo_deadline._operations.deadline.start_sessions_statistics_aggregation.start_sessions_statistics_aggregation(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartSessionsStatisticsAggregation")
    )
    input_: capo_deadline.types.start_sessions_statistics_aggregation_request.StartSessionsStatisticsAggregationRequest = {
        "farm_id": farm_id,
        "resource_ids": resource_ids,
        "start_time": start_time,
        "end_time": end_time,
        "group_by": group_by,
        "statistics": statistics,
    }
    if timezone is not None:
        input_["timezone"] = timezone
    if period is not None:
        input_["period"] = period

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output