# Search snapshots.

Endpoint: POST /snapshots/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.

## 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 Snapshot ID.
    Example: snapshot-123

  - `items.engine_id` (string)
    The id of the engine the snapshot belongs to.
    Example: 1

  - `items.namespace` (string)
    Alternate namespace for this object, for replicated and restored snapshots.
    Example: NAMESPACE-1

  - `items.name` (string)
    The snapshot's name.
    Example: @2023-02-02T14:30:00.589

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

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

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

  - `items.consistency` (string)
    Indicates what type of recovery strategies must be invoked when provisioning from this snapshot.
    Enum: "CONSISTENT", "INCONSISTENT", "CRASH_CONSISTENT", "PLUGGABLE"

  - `items.missing_non_logged_data` (boolean)
    Indicates if a virtual database provisioned from this snapshot will be missing nologging changes.
    Example: false

  - `items.dataset_id` (string)
    The ID of the Snapshot's dSource or VDB.
    Example: dataset-123

  - `items.creation_time` (string)
    The time when the snapshot was created.
    Example: 2023-02-02T19:30:00.589Z

  - `items.start_timestamp` (string)
    The timestamp within the parent TimeFlow at which this snapshot was initiated. 
No recovery earlier than this point needs to be applied in order to provision a database from 
this snapshot. If start_timestamp equals timestamp, then no recovery needs to be 
applied in order to provision a database.
    Example: 2021-05-01T08:51:34.148Z

  - `items.start_location` (string)
    The database specific indentifier within the parent TimeFlow at which this snapshot was initiated. 
No recovery earlier than this point needs to be applied in order to provision a database from 
this snapshot. If start_location equals location, then no recovery needs to be 
applied in order to provision a database.
    Example: 1178883

  - `items.timestamp` (string)
    The logical time of the data contained in this Snapshot.
    Example: 2021-05-01T08:51:34.148Z

  - `items.location` (string)
    Database specific identifier for the data contained in this Snapshot, such as the Log Sequence Number (LSN) for MSsql databases, System Change Number (SCN) for Oracle databases.
    Example: 1178883

  - `items.retention` (integer)
    Retention policy, in days. A value of -1 indicates the snapshot should be kept forever. Deprecated in favor of expiration and retain_forever.
    Example: -1

  - `items.expiration` (string)
    The expiration date of this snapshot. If this is unset and retain_forever is false, and the snapshot is not included in a Bookmark, the snapshot is subject to the retention policy of its dataset.
    Example: 2021-07-04T00:00:00.000Z

  - `items.retain_forever` (boolean)
    Indicates that the snapshot is protected from retention, i.e it will be kept forever. If false, see expiration.
    Example: false

  - `items.effective_expiration` (string)
    The effective expiration is that max of the snapshot expiration and the expiration of any Bookmark which includes this snapshot.
    Example: 2021-07-04T00:00:00.000Z

  - `items.effective_retain_forever` (boolean)
    True if retain_forever is set or a Bookmark retains this snapshot forever.
    Example: false

  - `items.timeflow_id` (string)
    The TimeFlow this snapshot was taken on.
    Example: 1-ORACLE_TIMEFLOW-1

  - `items.timezone` (string)
    Time zone of the source database at the time the snapshot was taken.
    Example: America/New_York,EST-0500

  - `items.version` (string)
    Version of database source repository at the time the snapshot was taken.
    Example: 11.2.0.4.0

  - `items.temporary` (boolean)
    Indicates that this snapshot is in a transient state and should not be user visible.
    Example: false

  - `items.appdata_toolkit` (string)
    The toolkit associated with this snapshot.
    Example: APPDATA_TOOLKIT-1

  - `items.appdata_metadata` (string)
    The JSON payload conforming to the DraftV4 schema based on the type of application data being manipulated.
    Example: {}

  - `items.ase_db_encryption_key` (string)
    Database encryption key present for this snapshot.
    Example: keyname

  - `items.mssql_internal_version` (integer)
    Internal version of the source database at the time the snapshot was taken.
    Example: 706

  - `items.mssql_backup_set_uuid` (string)
    UUID of the source database backup that was restored for this snapshot.
    Example: 54290b71-58cd-463d-bd62-7219d4c4d2d5

  - `items.mssql_backup_software_type` (string)
    Backup software used to restore the source database backup for this snapshot
    Enum: "AZURE_NATIVE", "NATIVE", "LITESPEED", "REDGATE", "NETBACKUP", "COMMVAULT"

  - `items.mssql_backup_location_type` (string)
    Backup software used to restore the source database backup for this snapshot
    Enum: "DISK", "AZURE", "BACKUP_SERVER"

  - `items.mssql_empty_snapshot` (boolean)
    True if the staging push dSource snapshot is empty.
    Example: true

  - `items.oracle_from_physical_standby_vdb` (boolean)
    True if this snapshot was taken of a standby database.
    Example: false

  - `items.oracle_redo_log_size_in_bytes` (integer)
    Online redo log size in bytes when this snapshot was taken.
    Example: 314572800

  - `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

  - `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.

