# Find Database Instance By Uid

Launch stage: Public Preview

`GET /api/2.0/database/instances:findByUid`

Find a Database Instance by uid.

API scopes: postgres

## Query parameters

- `uid` (string, optional)
  UID of the cluster to get.

## Returns

- `uid` (string, optional)
  An immutable UUID identifier for the instance.
- `name` (string, optional)
  The name of the instance. This is the unique identifier for the instance.
- `creator` (string, optional)
  The email of the creator of the instance.
- `read_write_dns` (string, optional)
  The DNS endpoint to connect to the instance for read+write access.
- `creation_time` (string, optional)
  The timestamp when the instance was created.
- `state` (string, optional)
  The current state of the instance.
  Possible values: `STATE_UNSPECIFIED`, `STARTING`, `AVAILABLE`, `DELETING`, `STOPPED`, `UPDATING`, `FAILING_OVER`
- `pg_version` (string, optional)
  The version of Postgres running on the instance.
- `capacity` (string, optional)
  The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8".
- `effective_capacity` (string, optional)
  Deprecated. The sku of the instance; this field will always match the value of capacity.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `stopped` (boolean, optional)
  Whether to stop the instance. An input only param, see effective_stopped for the output.
- `effective_stopped` (boolean, optional)
  Whether the instance is stopped.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `node_count` (int32, optional)
  The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
   1 primary and 0 secondaries. This field is input only, see effective_node_count for the output.
- `effective_node_count` (int32, optional)
  The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
   1 primary and 0 secondaries.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `enable_readable_secondaries` (boolean, optional)
  Whether to enable secondaries to serve read-only traffic. Defaults to false.
- `effective_enable_readable_secondaries` (boolean, optional)
  Whether secondaries serving read-only traffic are enabled. Defaults to false.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `read_only_dns` (string, optional)
  The DNS endpoint to connect to the instance for read only access. This is only available if
   enable_readable_secondaries is true.
- `retention_window_in_days` (int32, optional)
  The retention window for the instance. This is the time window in days
   for which the historical data is retained. The default value is 7 days.
   Valid values are 2 to 35 days.
- `effective_retention_window_in_days` (int32, optional)
  The retention window for the instance. This is the time window in days
   for which the historical data is retained.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `parent_instance_ref` (object, optional)
  The ref of the parent instance. This is only available if the instance is
   child instance.
   Input: For specifying the parent instance to create a child instance. Optional.
   Output: Only populated if provided as input to create a child instance.
  - `uid` (string, optional)
    Id of the ref database instance.
  - `name` (string, optional)
    Name of the ref database instance.
  - `lsn` (string, optional)
    User-specified WAL LSN of the ref database instance.
    
     Input: For specifying the WAL LSN to create a child instance. Optional.
     Output: Only populated if provided as input to create a child instance.
  - `effective_lsn` (string, optional)
    For a parent ref instance, this is the LSN on the parent instance from which the
     instance was created.
     For a child ref instance, this is the LSN on the instance from which the child instance
     was created.
     This is an output only field that contains the value computed from the input field combined with
     server side defaults. Use the field without the effective_ prefix to set the value.
  - `branch_time` (string, optional)
    Branch time of the ref database instance.
     For a parent ref instance, this is the point in time on the parent instance from which the
     instance was created.
     For a child ref instance, this is the point in time on the instance from which the child
     instance was created.
     Input: For specifying the point in time to create a child instance. Optional.
     Output: Only populated if provided as input to create a child instance.
- `child_instance_refs` (array of object, optional)
  The refs of the child instances. This is only available if the instance is
   parent instance.
  - `uid` (string, optional)
    Id of the ref database instance.
  - `name` (string, optional)
    Name of the ref database instance.
  - `lsn` (string, optional)
    User-specified WAL LSN of the ref database instance.
    
     Input: For specifying the WAL LSN to create a child instance. Optional.
     Output: Only populated if provided as input to create a child instance.
  - `effective_lsn` (string, optional)
    For a parent ref instance, this is the LSN on the parent instance from which the
     instance was created.
     For a child ref instance, this is the LSN on the instance from which the child instance
     was created.
     This is an output only field that contains the value computed from the input field combined with
     server side defaults. Use the field without the effective_ prefix to set the value.
  - `branch_time` (string, optional)
    Branch time of the ref database instance.
     For a parent ref instance, this is the point in time on the parent instance from which the
     instance was created.
     For a child ref instance, this is the point in time on the instance from which the child
     instance was created.
     Input: For specifying the point in time to create a child instance. Optional.
     Output: Only populated if provided as input to create a child instance.
- `enable_pg_native_login` (boolean, optional)
  Whether to enable PG native password login on the instance. Defaults to false.
- `effective_enable_pg_native_login` (boolean, optional)
  Whether the instance has PG native password login enabled.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `usage_policy_id` (string, optional, Beta)
  The desired usage policy to associate with the instance.
- `effective_usage_policy_id` (string, optional, Beta)
  The policy that is applied to the instance.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
- `custom_tags` (array of object, optional, Beta)
  Custom tags associated with the instance. This field is only included on create and update responses.
  - `key` (string, optional, Beta)
    The key of the custom tag.
  - `value` (string, optional, Beta)
    The value of the custom tag.
- `effective_custom_tags` (array of object, optional, Beta)
  The recorded custom tags associated with the instance.
   This is an output only field that contains the value computed from the input field combined with
   server side defaults. Use the field without the effective_ prefix to set the value.
  - `key` (string, optional, Beta)
    The key of the custom tag.
  - `value` (string, optional, Beta)
    The value of the custom tag.

## Response

```json
{
  "uid": "string",
  "name": "string",
  "creator": "string",
  "read_write_dns": "string",
  "creation_time": "string",
  "state": "string",
  "pg_version": "string",
  "capacity": "string",
  "effective_capacity": "string",
  "stopped": true,
  "effective_stopped": true,
  "node_count": 0,
  "effective_node_count": 0,
  "enable_readable_secondaries": true,
  "effective_enable_readable_secondaries": true,
  "read_only_dns": "string",
  "retention_window_in_days": 0,
  "effective_retention_window_in_days": 0,
  "parent_instance_ref": {
    "uid": "string",
    "name": "string",
    "lsn": "string",
    "effective_lsn": "string",
    "branch_time": "string"
  },
  "child_instance_refs": [
    {
      "uid": "string",
      "name": "string",
      "lsn": "string",
      "effective_lsn": "string",
      "branch_time": "string"
    }
  ],
  "enable_pg_native_login": true,
  "effective_enable_pg_native_login": true,
  "usage_policy_id": "string",
  "effective_usage_policy_id": "string",
  "custom_tags": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "effective_custom_tags": [
    {
      "key": "string",
      "value": "string"
    }
  ]
}
```

