# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetDatabaseInsightsResult',
    'AwaitableGetDatabaseInsightsResult',
    'get_database_insights',
    'get_database_insights_output',
]

@pulumi.output_type
class GetDatabaseInsightsResult:
    """
    A collection of values returned by getDatabaseInsights.
    """
    def __init__(__self__, compartment_id=None, compartment_id_in_subtree=None, database_ids=None, database_insights_collections=None, database_types=None, enterprise_manager_bridge_id=None, exadata_insight_id=None, fields=None, filters=None, id=None, opsi_private_endpoint_id=None, states=None, statuses=None):
        if compartment_id and not isinstance(compartment_id, str):
            raise TypeError("Expected argument 'compartment_id' to be a str")
        pulumi.set(__self__, "compartment_id", compartment_id)
        if compartment_id_in_subtree and not isinstance(compartment_id_in_subtree, bool):
            raise TypeError("Expected argument 'compartment_id_in_subtree' to be a bool")
        pulumi.set(__self__, "compartment_id_in_subtree", compartment_id_in_subtree)
        if database_ids and not isinstance(database_ids, list):
            raise TypeError("Expected argument 'database_ids' to be a list")
        pulumi.set(__self__, "database_ids", database_ids)
        if database_insights_collections and not isinstance(database_insights_collections, list):
            raise TypeError("Expected argument 'database_insights_collections' to be a list")
        pulumi.set(__self__, "database_insights_collections", database_insights_collections)
        if database_types and not isinstance(database_types, list):
            raise TypeError("Expected argument 'database_types' to be a list")
        pulumi.set(__self__, "database_types", database_types)
        if enterprise_manager_bridge_id and not isinstance(enterprise_manager_bridge_id, str):
            raise TypeError("Expected argument 'enterprise_manager_bridge_id' to be a str")
        pulumi.set(__self__, "enterprise_manager_bridge_id", enterprise_manager_bridge_id)
        if exadata_insight_id and not isinstance(exadata_insight_id, str):
            raise TypeError("Expected argument 'exadata_insight_id' to be a str")
        pulumi.set(__self__, "exadata_insight_id", exadata_insight_id)
        if fields and not isinstance(fields, list):
            raise TypeError("Expected argument 'fields' to be a list")
        pulumi.set(__self__, "fields", fields)
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if opsi_private_endpoint_id and not isinstance(opsi_private_endpoint_id, str):
            raise TypeError("Expected argument 'opsi_private_endpoint_id' to be a str")
        pulumi.set(__self__, "opsi_private_endpoint_id", opsi_private_endpoint_id)
        if states and not isinstance(states, list):
            raise TypeError("Expected argument 'states' to be a list")
        pulumi.set(__self__, "states", states)
        if statuses and not isinstance(statuses, list):
            raise TypeError("Expected argument 'statuses' to be a list")
        pulumi.set(__self__, "statuses", statuses)

    @property
    @pulumi.getter(name="compartmentId")
    def compartment_id(self) -> Optional[str]:
        """
        Compartment identifier of the database
        """
        return pulumi.get(self, "compartment_id")

    @property
    @pulumi.getter(name="compartmentIdInSubtree")
    def compartment_id_in_subtree(self) -> Optional[bool]:
        return pulumi.get(self, "compartment_id_in_subtree")

    @property
    @pulumi.getter(name="databaseIds")
    def database_ids(self) -> Optional[Sequence[str]]:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database.
        """
        return pulumi.get(self, "database_ids")

    @property
    @pulumi.getter(name="databaseInsightsCollections")
    def database_insights_collections(self) -> Sequence['outputs.GetDatabaseInsightsDatabaseInsightsCollectionResult']:
        """
        The list of database_insights_collection.
        """
        return pulumi.get(self, "database_insights_collections")

    @property
    @pulumi.getter(name="databaseTypes")
    def database_types(self) -> Optional[Sequence[str]]:
        """
        Operations Insights internal representation of the database type.
        """
        return pulumi.get(self, "database_types")

    @property
    @pulumi.getter(name="enterpriseManagerBridgeId")
    def enterprise_manager_bridge_id(self) -> Optional[str]:
        """
        OPSI Enterprise Manager Bridge OCID
        """
        return pulumi.get(self, "enterprise_manager_bridge_id")

    @property
    @pulumi.getter(name="exadataInsightId")
    def exadata_insight_id(self) -> Optional[str]:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata insight.
        """
        return pulumi.get(self, "exadata_insight_id")

    @property
    @pulumi.getter
    def fields(self) -> Optional[Sequence[str]]:
        return pulumi.get(self, "fields")

    @property
    @pulumi.getter
    def filters(self) -> Optional[Sequence['outputs.GetDatabaseInsightsFilterResult']]:
        return pulumi.get(self, "filters")

    @property
    @pulumi.getter
    def id(self) -> Optional[str]:
        """
        Database insight identifier
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="opsiPrivateEndpointId")
    def opsi_private_endpoint_id(self) -> Optional[str]:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint
        """
        return pulumi.get(self, "opsi_private_endpoint_id")

    @property
    @pulumi.getter
    def states(self) -> Optional[Sequence[str]]:
        """
        The current state of the database.
        """
        return pulumi.get(self, "states")

    @property
    @pulumi.getter
    def statuses(self) -> Optional[Sequence[str]]:
        """
        Indicates the status of a database insight in Operations Insights
        """
        return pulumi.get(self, "statuses")


class AwaitableGetDatabaseInsightsResult(GetDatabaseInsightsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDatabaseInsightsResult(
            compartment_id=self.compartment_id,
            compartment_id_in_subtree=self.compartment_id_in_subtree,
            database_ids=self.database_ids,
            database_insights_collections=self.database_insights_collections,
            database_types=self.database_types,
            enterprise_manager_bridge_id=self.enterprise_manager_bridge_id,
            exadata_insight_id=self.exadata_insight_id,
            fields=self.fields,
            filters=self.filters,
            id=self.id,
            opsi_private_endpoint_id=self.opsi_private_endpoint_id,
            states=self.states,
            statuses=self.statuses)


def get_database_insights(compartment_id: Optional[str] = None,
                          compartment_id_in_subtree: Optional[bool] = None,
                          database_ids: Optional[Sequence[str]] = None,
                          database_types: Optional[Sequence[str]] = None,
                          enterprise_manager_bridge_id: Optional[str] = None,
                          exadata_insight_id: Optional[str] = None,
                          fields: Optional[Sequence[str]] = None,
                          filters: Optional[Sequence[pulumi.InputType['GetDatabaseInsightsFilterArgs']]] = None,
                          id: Optional[str] = None,
                          opsi_private_endpoint_id: Optional[str] = None,
                          states: Optional[Sequence[str]] = None,
                          statuses: Optional[Sequence[str]] = None,
                          opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatabaseInsightsResult:
    """
    This data source provides the list of Database Insights in Oracle Cloud Infrastructure Opsi service.

    Gets a list of database insights based on the query parameters specified. Either compartmentId or id query parameter must be specified.
    When both compartmentId and compartmentIdInSubtree are specified, a list of database insights in that compartment and in all sub-compartments will be returned.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_database_insights = oci.Opsi.get_database_insights(compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        compartment_id_in_subtree=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        database_ids=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        database_types=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        enterprise_manager_bridge_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        exadata_insight_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        fields=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        opsi_private_endpoint_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        states=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        statuses=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str compartment_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
    :param bool compartment_id_in_subtree: A flag to search all resources within a given compartment and all sub-compartments.
    :param Sequence[str] database_ids: Optional list of database [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated DBaaS entity.
    :param Sequence[str] database_types: Filter by one or more database type. Possible values are ADW-S, ATP-S, ADW-D, ATP-D, EXTERNAL-PDB, EXTERNAL-NONCDB.
    :param str enterprise_manager_bridge_id: Unique Enterprise Manager bridge identifier
    :param str exadata_insight_id: [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of exadata insight resource.
    :param Sequence[str] fields: Specifies the fields to return in a database summary response. By default all fields are returned if omitted.
    :param str id: Optional list of database insight resource [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
    :param str opsi_private_endpoint_id: Unique Operations Insights PrivateEndpoint identifier
    :param Sequence[str] states: Lifecycle states
    :param Sequence[str] statuses: Resource Status
    """
    __args__ = dict()
    __args__['compartmentId'] = compartment_id
    __args__['compartmentIdInSubtree'] = compartment_id_in_subtree
    __args__['databaseIds'] = database_ids
    __args__['databaseTypes'] = database_types
    __args__['enterpriseManagerBridgeId'] = enterprise_manager_bridge_id
    __args__['exadataInsightId'] = exadata_insight_id
    __args__['fields'] = fields
    __args__['filters'] = filters
    __args__['id'] = id
    __args__['opsiPrivateEndpointId'] = opsi_private_endpoint_id
    __args__['states'] = states
    __args__['statuses'] = statuses
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:Opsi/getDatabaseInsights:getDatabaseInsights', __args__, opts=opts, typ=GetDatabaseInsightsResult).value

    return AwaitableGetDatabaseInsightsResult(
        compartment_id=__ret__.compartment_id,
        compartment_id_in_subtree=__ret__.compartment_id_in_subtree,
        database_ids=__ret__.database_ids,
        database_insights_collections=__ret__.database_insights_collections,
        database_types=__ret__.database_types,
        enterprise_manager_bridge_id=__ret__.enterprise_manager_bridge_id,
        exadata_insight_id=__ret__.exadata_insight_id,
        fields=__ret__.fields,
        filters=__ret__.filters,
        id=__ret__.id,
        opsi_private_endpoint_id=__ret__.opsi_private_endpoint_id,
        states=__ret__.states,
        statuses=__ret__.statuses)


@_utilities.lift_output_func(get_database_insights)
def get_database_insights_output(compartment_id: Optional[pulumi.Input[Optional[str]]] = None,
                                 compartment_id_in_subtree: Optional[pulumi.Input[Optional[bool]]] = None,
                                 database_ids: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                 database_types: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                 enterprise_manager_bridge_id: Optional[pulumi.Input[Optional[str]]] = None,
                                 exadata_insight_id: Optional[pulumi.Input[Optional[str]]] = None,
                                 fields: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                 filters: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetDatabaseInsightsFilterArgs']]]]] = None,
                                 id: Optional[pulumi.Input[Optional[str]]] = None,
                                 opsi_private_endpoint_id: Optional[pulumi.Input[Optional[str]]] = None,
                                 states: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                 statuses: Optional[pulumi.Input[Optional[Sequence[str]]]] = None,
                                 opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatabaseInsightsResult]:
    """
    This data source provides the list of Database Insights in Oracle Cloud Infrastructure Opsi service.

    Gets a list of database insights based on the query parameters specified. Either compartmentId or id query parameter must be specified.
    When both compartmentId and compartmentIdInSubtree are specified, a list of database insights in that compartment and in all sub-compartments will be returned.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_database_insights = oci.Opsi.get_database_insights(compartment_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        compartment_id_in_subtree=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        database_ids=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        database_types=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        enterprise_manager_bridge_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        exadata_insight_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        fields=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        opsi_private_endpoint_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        states=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        statuses=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str compartment_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
    :param bool compartment_id_in_subtree: A flag to search all resources within a given compartment and all sub-compartments.
    :param Sequence[str] database_ids: Optional list of database [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the associated DBaaS entity.
    :param Sequence[str] database_types: Filter by one or more database type. Possible values are ADW-S, ATP-S, ADW-D, ATP-D, EXTERNAL-PDB, EXTERNAL-NONCDB.
    :param str enterprise_manager_bridge_id: Unique Enterprise Manager bridge identifier
    :param str exadata_insight_id: [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of exadata insight resource.
    :param Sequence[str] fields: Specifies the fields to return in a database summary response. By default all fields are returned if omitted.
    :param str id: Optional list of database insight resource [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
    :param str opsi_private_endpoint_id: Unique Operations Insights PrivateEndpoint identifier
    :param Sequence[str] states: Lifecycle states
    :param Sequence[str] statuses: Resource Status
    """
    ...
