# Search for VDBs.

Endpoint: POST /vdbs/search
Version: 3.17.0
Security: ApiKeyAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header Authorization

## Query parameters:

  - `limit` (integer)
    Maximum number of objects to return per query. The value must be between 1 and 1000. Default is 100.

  - `cursor` (string)
    Cursor to fetch the next or previous page of results. The value of this property must be extracted from the 'prev_cursor' or 'next_cursor' property of a PaginatedResponseMetadata which is contained in the response of list and search API endpoints.

  - `sort` (string)
    The field to sort results by. A property name with a prepended '-' signifies descending order.

  - `permission` (string)
    Restrict the objects, which are allowed.

## Request body:

  - `application/json` (unknown)
    A request body containing a filter expression. This enables searching
for items matching arbitrarily complex conditions. The list of
attributes which can be used in filter expressions is available
in the x-filterable vendor extension.
# Filter Expression Overview
**Note: All keywords are case-insensitive**
## Comparison Operators
| Operator | Description | Example |
|  --- | --- | --- |
| CONTAINS | Substring or membership testing for string and list attributes respectively. | field3 CONTAINS 'foobar', field4 CONTAINS TRUE |
| IN | Tests if field is a member of a list literal. List can contain a maximum of 100 values | field2 IN ['Goku', 'Vegeta'] |
| GE | Tests if a field is greater than or equal to a literal value | field1 GE 1.2e-2 |
| GT | Tests if a field is greater than a literal value | field1 GT 1.2e-2 |
| LE | Tests if a field is less than or equal to a literal value | field1 LE 9000 |
| LT | Tests if a field is less than a literal value | field1 LT 9.02 |
| NE | Tests if a field is not equal to a literal value | field1 NE 42 |
| EQ | Tests if a field is equal to a literal value | field1 EQ 42 |

## Search Operator
The SEARCH operator filters for items which have any filterable
attribute that contains the input string as a substring, comparison
is done case-insensitively. This is not restricted to attributes with
string values. Specifically `SEARCH '12'` would match an item with an
attribute with an integer value of `123`.
## Logical Operators
Ordered by precedence.
| Operator | Description | Example |
|  --- | --- | --- |
| NOT | Logical NOT (Right associative) | NOT field1 LE 9000 |
| AND | Logical AND (Left Associative) | field1 GT 9000 AND field2 EQ 'Goku' |
| OR | Logical OR (Left Associative) | field1 GT 9000 OR field2 EQ 'Goku' |

## Grouping
Parenthesis `()` can be used to override operator precedence.
For example:
NOT (field1 LT 1234 AND field2 CONTAINS 'foo')
## Literal Values
| Literal | Description | Examples |
|  --- | --- | --- |
| Nil | Represents the absence of a value | nil, Nil, nIl, NIL |
| Boolean | true/false boolean | true, false, True, False, TRUE, FALSE |
| Number | Signed integer and floating point numbers. Also supports scientific notation. | 0, 1, -1, 1.2, 0.35, 1.2e-2, -1.2e+2 |
| String | Single or double quoted | "foo", "bar", "foo bar", 'foo', 'bar', 'foo bar' |
| Datetime | Formatted according to [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) | 2018-04-27T18:39:26.397237+00:00 |
| List | Comma-separated literals wrapped in square brackets | [0], [0, 1], ['foo', "bar"] |

## Limitations
- A maximum of 8 unique identifiers may be used inside a filter expression.

## Request fields (application/json):

  - `filter_expression` (string)
    Example: string_field CONTAINS "over" AND numberic_field GT 9000 OR string_field2 EQ "Goku"

## Request examples:

  - `Nested Object Comparison` (unknown)
    An example of a nested Object comparison testing that at least one repository has a
version which is equal to 19.0.0.

  - `Relative comparison` (unknown)
    An example of a relative comparison testing that field1 has a
value which is less than 123.

  - `Absence of an attribute value` (unknown)
    An example of using nil to test for the absence of a value for field2.

  - `Existence of an attribute value` (unknown)
    An example of using nil to test for the existence of a value for field2.

  - `Use of the CONTAINS operator` (unknown)
    An example of using the 'CONTAINS' operator to check if
field2 contains the string 'foo'. If field2 is string valued
then this is checking if 'foo' is a substring of field2. If
field2 is a list of strings then this is checking if 'foo'
is a member of the list.

  - `Use of the IN operator` (unknown)
    An example of using the 'IN' operator to check if field1
is an element of a list literal.

  - `Use of the SEARCH operator` (unknown)
    An example of using the 'SEARCH' operator to retrieve all elements
for which 'foo' is a substring of a filterable attribute.

  - `Overriding operator precedence` (unknown)
    An example of parenthesis being used to group operators & override
operator precedence.

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `items` (array)

  - `items.id` (string)
    The VDB object entity ID.
    Example: vdb-123

  - `items.database_type` (string)
    The database type of this VDB.
    Example: Oracle

  - `items.name` (string)
    The logical name of this VDB.
    Example: prod01-copy01

  - `items.database_name` (string)
    The name of the database on the target environment or in the database management system.
    Example: prod01-copy01-dbname

  - `items.namespace_id` (string)
    The namespace id of this VDB.
    Example: 1-NAMESPACE-1

  - `items.namespace_name` (string)
    The namespace name of this VDB.
    Example: test-engine-1

  - `items.is_replica` (boolean)
    Is this a replicated object.
    Example: true

  - `items.is_locked` (boolean)
    Is this VDB locked.
    Example: true

  - `items.locked_by` (integer)
    The ID of the account that locked this VDB.
    Example: 1

  - `items.locked_by_name` (string)
    The name of the account that locked this VDB.
    Example: user-1

  - `items.database_version` (string)
    The database version of this VDB.
    Example: 10.2.0.5.0

  - `items.jdbc_connection_string` (string)
    The JDBC connection URL for this VDB.
    Example: jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=10.43.47.94)(PORT=1521))(CONNECT_DATA=(UR=A)(SID=production01)))

  - `items.size` (integer)
    The total size of this VDB, in bytes.
    Example: 339292672

  - `items.storage_size` (integer)
    The actual space used by this VDB, in bytes.
    Example: 12345678

  - `items.engine_id` (string)
    A reference to the Engine that this VDB belongs to.
    Example: engine-123

  - `items.status` (string)
    The runtime status of the VDB. 'Unknown' if all attempts to connect to the dataset failed.
    Example: RUNNING

  - `items.masked` (boolean)
    The VDB is masked or not.
    Example: false

  - `items.content_type` (string)
    The content type of the vdb.
    Example: PDB

  - `items.parent_timeflow_timestamp` (string)
    The timestamp for parent timeflow.
    Example: 2021-05-01T08:51:34.148Z

  - `items.parent_timeflow_timezone` (string)
    The timezone for parent timeflow.
    Example: America/Los_Angeles

  - `items.environment_id` (string)
    A reference to the Environment that hosts this VDB.
    Example: environment-123

  - `items.ip_address` (string)
    The IP address of the VDB's host.
    Example: 192.0.2.0

  - `items.fqdn` (string)
    The FQDN of the VDB's host.
    Example: virtual-dbs.myhost.com

  - `items.parent_id` (string)
    A reference to the parent dataset of this VDB.
    Example: vdb-122

  - `items.parent_dsource_id` (string)
    A reference to the parent dSource of this VDB.
    Example: dsource-id

  - `items.root_parent_id` (string)
    A reference to the root parent dataset of this VDB which could be a VDB or a dSource.
    Example: vdb-121

  - `items.group_name` (string)
    The name of the group containing this VDB.
    Example: VDBs

  - `items.engine_name` (string)
    Name of the Engine where this VDB is hosted
    Example: engine-123-name

  - `items.cdb_id` (string)
    A reference to the CDB or VCDB associated with this VDB.
    Example: cdb-123

  - `items.tags` (array)

  - `items.tags.key` (string, required)
    Key of the tag
    Example: key-1

  - `items.tags.value` (string, required)
    Value of the tag
    Example: value-1

  - `items.creation_date` (string)
    The date this VDB was created.
    Example: 2021-05-01T08:51:34.148Z

  - `items.hooks` (object)
    VDB operation hooks.

  - `items.hooks.pre_refresh` (array)
    The commands to execute on the target environment before refreshing the VDB.

  - `items.hooks.pre_refresh.name` (string)
    Example: Print the current user

  - `items.hooks.pre_refresh.command` (string, required)
    Example: whoami

  - `items.hooks.pre_refresh.shell` (string)
    Enum: "bash", "shell", "expect", "ps", "psd"

  - `items.hooks.pre_refresh.element_id` (string)
    Example: 0

  - `items.hooks.pre_refresh.has_credentials` (boolean)
    Example: false

  - `items.hooks.post_refresh` (array)
    The commands to execute on the target environment after refreshing the VDB.

  - `items.hooks.pre_self_refresh` (array)
    The commands to execute on the target environment before refreshing the VDB with data from itself.

  - `items.hooks.post_self_refresh` (array)
    The commands to execute on the target environment after refreshing the VDB with data from itself.

  - `items.hooks.pre_rollback` (array)
    The commands to execute on the target environment before rewinding the VDB.

  - `items.hooks.post_rollback` (array)
    The commands to execute on the target environment after rewinding the VDB.

  - `items.hooks.configure_clone` (array)
    The commands to execute on the target environment when the VDB is created or refreshed.

  - `items.hooks.pre_snapshot` (array)
    The commands to execute on the target environment before snapshotting a virtual source. These commands can quiesce any data prior to snapshotting.

  - `items.hooks.post_snapshot` (array)
    The commands to execute on the target environment after snapshotting a virtual source.

  - `items.hooks.pre_start` (array)
    The commands to execute on the target environment before starting a virtual source.

  - `items.hooks.post_start` (array)
    The commands to execute on the target environment after starting a virtual source.

  - `items.hooks.pre_stop` (array)
    The commands to execute on the target environment before stopping a virtual source.

  - `items.hooks.post_stop` (array)
    The commands to execute on the target environment after stopping a virtual source.

  - `items.appdata_source_params` (object)
    The JSON payload conforming to the DraftV4 schema based on the type of application data being manipulated.
    Example: {"param":"value","param2":"value2"}

  - `items.template_id` (string)
    A reference to the Database Template.
    Example: DATABASE_TEMPLATE-1

  - `items.config_params` (object)
    Database configuration parameter overrides.
    Example: {"param":"value","param2":"value2"}

  - `items.additional_mount_points` (array)
    Specifies additional locations on which to mount a subdirectory of an AppData container. Can only be updated while the VDB is disabled.

  - `items.additional_mount_points.shared_path` (string)
    Relative path within the container of the directory that should be mounted.
    Example: /

  - `items.additional_mount_points.mount_path` (string)
    Absolute path on the target environment were the filesystem should be mounted
    Example: /work/ws1

  - `items.additional_mount_points.environment_id` (string)
    The entity ID of the environment on which the file system will be mounted.
    Example: environment-123

  - `items.appdata_config_params` (object)
    The parameters specified by the source config schema in the toolkit
    Example: {"foo":"bar"}

  - `items.mount_point` (string)
    Mount point for the VDB (Oracle, ASE, AppData).
    Example: /var/mnt

  - `items.current_timeflow_id` (string)
    A reference to the currently active timeflow for this VDB.
    Example: timeflow-456

  - `items.previous_timeflow_id` (string)
    A reference to the previous timeflow for this VDB.
    Example: timeflow-123

  - `items.last_refreshed_date` (string)
    The date this VDB was last refreshed.
    Example: 2023-04-15T02:11:14.248Z

  - `items.vdb_restart` (boolean)
    Indicates whether the Engine should automatically restart this vdb when target host reboot is detected.
    Example: true

  - `items.is_appdata` (boolean)
    Indicates whether this VDB has an AppData database.
    Example: true

  - `items.exported_data_directory` (string)
    ZFS exported data directory path.
    Example: domain0/oracle_db_container-30/oracle_timeflow-32/datafile

  - `items.vcdb_exported_data_directory` (string)
    ZFS exported data directory path of the virtual CDB container (vCDB).
    Example: domain0/oracle_db_container-29/oracle_timeflow-31/datafile

  - `items.toolkit_id` (string)
    The ID of the toolkit associated with this VDB.
    Example: toolkit-1

  - `items.plugin_version` (string)
    The version of the plugin associated with this VDB.
    Example: 1.0.0

  - `items.primary_object_id` (string)
    The ID of the parent object from which replication was done.
    Example: 1-CONTAINER-1

  - `items.primary_engine_id` (string)
    The ID of the parent engine from which replication was done.
    Example: 1

  - `items.primary_engine_name` (string)
    The name of the parent engine from which replication was done.
    Example: source-engine

  - `items.replicas` (array)
    The list of replicas replicated from this object.

  - `items.replicas.replica_id` (string)
    The ID of the replicated object.
    Example: replica-1

  - `items.replicas.replica_engine_id` (string)
    The ID of the replicated object's engine.
    Example: 1

  - `items.replicas.replica_engine_name` (string)
    The name of the replicated object's engine.
    Example: replica-e1

  - `items.replicas.replica_namespace_id` (string)
    The namespace id of the replicated object.
    Example: namespace-1

  - `items.invoke_datapatch` (boolean)
    Indicates whether datapatch should be invoked.

  - `items.enabled` (boolean)
    True if VDB is enabled false if VDB is disabled.
    Example: true

  - `items.node_listeners` (array)
    The list of node listeners for this VDB.

  - `items.instance_name` (string)
    The instance name name of this single instance VDB.
    Example: VDBSID

  - `items.instance_number` (integer)
    The instance number of this single instance VDB.

  - `items.instances` (array)

  - `items.instances.instance_name` (string)
    The name of this instance.

  - `items.instances.instance_number` (integer)
    The number of this instance.

  - `items.instances.node_reference` (string)
    The reference to the cluster node which the instance is running on.

  - `items.oracle_services` (array)

  - `items.oracle_services.discovered` (boolean)
    Represents whether this jdbc connection string is auto discovered or not.

  - `items.oracle_services.jdbc_connection_string` (string)
    The jdbc connection string used to connect with the database.
    Example: jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=10.110.230.197)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=VDBOMSRBBDC6C_UJG)))

  - `response_metadata` (object)

  - `response_metadata.prev_cursor` (string)
    Pointer to the previous page of results. Use this value as a cursor query parameter in a subsequent request, along with limit, to navigate through the collection by virtual page.

  - `response_metadata.next_cursor` (string)
    Pointer to the next page of results. Use this value as a cursor query parameter in a subsequent request, along with limit, to navigate through the collection by virtual page.

  - `response_metadata.total` (integer)
    The total number of results. This value may not be provided.

