Skip to content

describe_instance_sql_ha_states

describe_instance_sql_ha_states(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    instance_ids: Optional[InstanceIdStringList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[DescribeInstanceSqlHaStatesRequestMaxResultsInteger] = None,
    filters: Optional[FilterList] = None,
    dry_run: Optional[Boolean] = None,
) -> DescribeInstanceSqlHaStatesResult

Describes the 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 SQL Server High Availability states for all SQL Server High Availability instances.

  • 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_states(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    instance_ids: Optional[
        "capo_ec2.types.instance_id_string_list.InstanceIdStringList"
    ] = 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_states_result.DescribeInstanceSqlHaStatesResult":
    """<p>Describes the 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 SQL Server High Availability states for all SQL Server High Availability instances.</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_states_request.DescribeInstanceSqlHaStatesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_instance_sql_ha_states_result.DescribeInstanceSqlHaStatesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_instance_sql_ha_states

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceSqlHaStates")
    )
    input_: capo_ec2.types.describe_instance_sql_ha_states_request.DescribeInstanceSqlHaStatesRequest = {}
    if instance_ids is not None:
        input_["instance_ids"] = instance_ids
    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