Skip to content

create_knowledge_base_refresh_schedule

create_knowledge_base_refresh_schedule(
    aws_account_id: KbAwsAccountId,
    knowledge_base_id: KnowledgeBaseId,
    schedule_id: ScheduleId,
    schedule_frequency: KnowledgeBaseRefreshFrequency,
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    start_time: Optional[datetime] = None,
    state: Optional[ScheduleState] = None,
) -> CreateKnowledgeBaseRefreshScheduleResponse

Creates a schedule that periodically refreshes an Amazon Quick Sight knowledge base at the frequency that you specify.

A knowledge base can have only one refresh schedule. If the knowledge base already has a refresh schedule, the request fails with a LimitExceededException.

Parameters:

  • aws_account_id (KbAwsAccountId) –

    The ID of the Amazon Web Services account that contains the knowledge base.

  • knowledge_base_id (KnowledgeBaseId) –

    The unique identifier for the knowledge base.

  • schedule_id (ScheduleId) –

    A unique identifier for the knowledge base refresh schedule.

  • schedule_frequency (KnowledgeBaseRefreshFrequency) –

    The frequency configuration for the refresh schedule. The frequency configuration specifies how often the schedule runs and, for weekly or monthly schedules, the day on which it runs.

  • start_time (Optional[datetime], default: None ) –

    The date and time, in ISO 8601 format, after which the schedule can start refreshing the knowledge base. The first refresh runs at the next scheduled time after this date and time. If you don't specify a value, the schedule becomes active immediately, and the first refresh runs at the next scheduled time.

  • state (Optional[ScheduleState], default: None ) –

    The state that you want the refresh schedule to have when you create it. If you don't specify a state, the schedule is created in the ENABLED state. A schedule that isn't ENABLED doesn't run refreshes.

Raises:

Source code in docs_src/capo_quicksight/_services/quick_sight.py
def create_knowledge_base_refresh_schedule(
    self,
    aws_account_id: "capo_quicksight.types.kb_aws_account_id.KbAwsAccountId",
    knowledge_base_id: "capo_quicksight.types.knowledge_base_id.KnowledgeBaseId",
    schedule_id: "capo_quicksight.types.schedule_id.ScheduleId",
    schedule_frequency: "capo_quicksight.types.knowledge_base_refresh_frequency.KnowledgeBaseRefreshFrequency",
    *,
    config_overrides: Optional[QuickSightClientConfig] = None,
    start_time: Optional[datetime.datetime] = None,
    state: Optional["capo_quicksight.types.schedule_state.ScheduleState"] = None,
) -> "capo_quicksight.types.create_knowledge_base_refresh_schedule_response.CreateKnowledgeBaseRefreshScheduleResponse":
    """<p>Creates a schedule that periodically refreshes an Amazon Quick Sight knowledge base at the frequency that you specify.</p> <p>A knowledge base can have only one refresh schedule. If the knowledge base already has a refresh schedule, the request fails with a <code>LimitExceededException</code>.</p>

    Args:
        aws_account_id: <p>The ID of the Amazon Web Services account that contains the knowledge base.</p>
        knowledge_base_id: <p>The unique identifier for the knowledge base.</p>
        schedule_id: <p>A unique identifier for the knowledge base refresh schedule.</p>
        schedule_frequency: <p>The frequency configuration for the refresh schedule. The frequency configuration specifies how often the schedule runs and, for weekly or monthly schedules, the day on which it runs.</p>
        start_time: <p>The date and time, in ISO 8601 format, after which the schedule can start refreshing the knowledge base. The first refresh runs at the next scheduled time after this date and time. If you don't specify a value, the schedule becomes active immediately, and the first refresh runs at the next scheduled time.</p>
        state: <p>The state that you want the refresh schedule to have when you create it. If you don't specify a state, the schedule is created in the <code>ENABLED</code> state. A schedule that isn't <code>ENABLED</code> doesn't run refreshes.</p>

    Raises:
        capo_quicksight.errors.access_denied_exception.AccessDeniedException: <p>You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon Quick Sight service, that your policies have the correct permissions, and that you are using the correct credentials.</p>
        capo_quicksight.errors.internal_failure_exception.InternalFailureException: <p>An internal failure occurred.</p>
        capo_quicksight.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One or more parameters has a value that isn't valid.</p>
        capo_quicksight.errors.invalid_request_exception.InvalidRequestException: <p>You don't have this feature activated for your account. To fix this issue, contact Amazon Web Services support.</p>
        capo_quicksight.errors.limit_exceeded_exception.LimitExceededException: <p>A limit is exceeded.</p>
        capo_quicksight.errors.precondition_not_met_exception.PreconditionNotMetException: <p>One or more preconditions aren't met.</p>
        capo_quicksight.errors.resource_exists_exception.ResourceExistsException: <p>The resource specified already exists. </p>
        capo_quicksight.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_quicksight.errors.throttling_exception.ThrottlingException: <p>Access is throttled.</p>
        capo_quicksight.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_quicksight.types.create_knowledge_base_refresh_schedule_request.CreateKnowledgeBaseRefreshScheduleRequest]",
    ) -> OperationResponse[
        "capo_quicksight.types.create_knowledge_base_refresh_schedule_response.CreateKnowledgeBaseRefreshScheduleResponse"
    ]:
        import capo_quicksight._operations.quick_sight_20180401.create_knowledge_base_refresh_schedule

        output, http_response = (
            capo_quicksight._operations.quick_sight_20180401.create_knowledge_base_refresh_schedule.create_knowledge_base_refresh_schedule(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateKnowledgeBaseRefreshSchedule")
    )
    input_: capo_quicksight.types.create_knowledge_base_refresh_schedule_request.CreateKnowledgeBaseRefreshScheduleRequest = {
        "aws_account_id": aws_account_id,
        "knowledge_base_id": knowledge_base_id,
        "schedule_id": schedule_id,
        "schedule_frequency": schedule_frequency,
    }
    if start_time is not None:
        input_["start_time"] = start_time
    if state is not None:
        input_["state"] = state

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