Skip to content

describe_instance_sql_ha_history_states

describe_instance_sql_ha_history_states(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    instance_ids: Optional[InstanceIdStringList] = None,
    start_time: Optional[MillisecondDateTime] = None,
    end_time: Optional[MillisecondDateTime] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[DescribeInstanceSqlHaStatesRequestMaxResultsInteger] = None,
    filters: Optional[FilterList] = None,
    dry_run: Optional[Boolean] = None,
) -> DescribeInstanceSqlHaHistoryStatesResult

Describes the historical SQL Server High Availability states for Amazon EC2 instances that are enabled for Amazon EC2 High Availability for SQL Server monitoring.

Parameters:

  • instance_ids (Optional[InstanceIdStringList], default: None ) –

    The IDs of the SQL Server High Availability instances to describe. If omitted, the API returns historical states for all SQL Server High Availability instances.

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

    The start data and time of the period for which to get the historical SQL Server High Availability states. If omitted, the API returns all available historical states.

    Timezone: UTC

    Format: YYYY-MM-DDThh:mm:ss.sssZ

  • end_time (Optional[MillisecondDateTime], default: None ) –

    The end data and time of the period for which to get historical SQL Server High Availability states. If omitted, the API returns historical states up to the current date and time.

    Timezone: UTC

    Format: YYYY-MM-DDThh:mm:ss.sssZ

  • next_token (Optional[NextToken], default: None ) –

    The token to use to retrieve the next page of results.

  • max_results (Optional[DescribeInstanceSqlHaStatesRequestMaxResultsInteger], default: None ) –

    The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value.

  • filters (Optional[FilterList], default: None ) –

    One or more filters to apply to the results. Supported filters include:

    • tag: - The tag key and value pair assigned to the instance. For example, to find all instances tagged with Owner:TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The tag key assigned to the instance.

    • haStatus - The SQL Server High Availability status of the SQL Server High Availability instance (processing | active | standby | invalid).

    • sqlServerLicenseUsage - The license type for the SQL Server license (full | waived).

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def describe_instance_sql_ha_history_states(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    instance_ids: Optional[
        "capo_ec2.types.instance_id_string_list.InstanceIdStringList"
    ] = None,
    start_time: Optional[
        "capo_ec2.types.millisecond_date_time.MillisecondDateTime"
    ] = None,
    end_time: Optional[
        "capo_ec2.types.millisecond_date_time.MillisecondDateTime"
    ] = None,
    next_token: Optional["capo_ec2.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_instance_sql_ha_states_request_max_results_integer.DescribeInstanceSqlHaStatesRequestMaxResultsInteger"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.describe_instance_sql_ha_history_states_result.DescribeInstanceSqlHaHistoryStatesResult":
    """<p>Describes the historical SQL Server High Availability states for Amazon EC2 instances that are enabled for Amazon EC2 High Availability for SQL Server monitoring.</p>

    Args:
        instance_ids: <p>The IDs of the SQL Server High Availability instances to describe. If omitted, the API returns historical states for all SQL Server High Availability instances.</p>
        start_time: <p>The start data and time of the period for which to get the historical SQL Server High Availability states. If omitted, the API returns all available historical states.</p> <p>Timezone: UTC</p> <p>Format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code> </p>
        end_time: <p>The end data and time of the period for which to get historical SQL Server High Availability states. If omitted, the API returns historical states up to the current date and time.</p> <p>Timezone: UTC</p> <p>Format: <code>YYYY-MM-DDThh:mm:ss.sssZ</code> </p>
        next_token: <p>The token to use to retrieve the next page of results.</p>
        max_results: <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value.</p>
        filters: <p>One or more filters to apply to the results. Supported filters include:</p> <ul> <li> <p> <code>tag:<key></code> - The tag key and value pair assigned to the instance. For example, to find all instances tagged with <code>Owner:TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The tag key assigned to the instance.</p> </li> <li> <p> <code>haStatus</code> - The SQL Server High Availability status of the SQL Server High Availability instance (<code>processing</code> | <code>active</code> | <code>standby</code> | <code>invalid</code>).</p> </li> <li> <p> <code>sqlServerLicenseUsage</code> - The license type for the SQL Server license (<code>full</code> | <code>waived</code>).</p> </li> </ul>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_instance_sql_ha_history_states_request.DescribeInstanceSqlHaHistoryStatesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_instance_sql_ha_history_states_result.DescribeInstanceSqlHaHistoryStatesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_instance_sql_ha_history_states

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_instance_sql_ha_history_states.describe_instance_sql_ha_history_states(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceSqlHaHistoryStates")
    )
    input_: capo_ec2.types.describe_instance_sql_ha_history_states_request.DescribeInstanceSqlHaHistoryStatesRequest = {}
    if instance_ids is not None:
        input_["instance_ids"] = instance_ids
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filters is not None:
        input_["filters"] = filters
    if dry_run is not None:
        input_["dry_run"] = dry_run

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