Get all assets that are deprecated¶
This example finds all assets that are marked as deprecated.
Get all deprecated assets | |
---|---|
1 2 3 4 5 6 7 |
|
- Start with a client to run the search through. For the default client, you can always use
Atlan.getDefaultClient()
. - To search across all assets, you can use the
assets.select()
convenience method on a client. -
The
.where()
method allows you to limit to only assets that have a particular value in a particular field. In this example, we are looking for values for the certificate status, so useAsset.CERTIFICATE_STATUS
.Since we only want assets that are deprecated, we will query where that certificate is set to the
CertificateStatus.DEPRECATED
value. (No need to try to remember or ever even know what the precise string values for the certificates are — we've provided enums for them in the SDK.) -
The search will only run when you call the
stream()
method, which will then lazily-load each page of results into a stream. - This is the pattern for iterating through all results (across pages) covered in the Searching for assets portion of the SDK documentation.
Get all deprecated assets | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- Start with a client to run the search through. For the default client, you can always use
AtlanClient()
. - To search across all assets, you can use a
FluentSearch
object. -
The
.where()
method allows you to limit to only assets that have a particular value in a particular field. In this example, we are looking for values for the certificate status, so useAsset.CERTIFICATE_STATUS
.Since we only want assets that are deprecated, we will query where that certificate is set to the
CertificateStatus.DEPRECATED
value. (No need to try to remember or ever even know what the precise string values for the certificates are — we've provided enums for them in the SDK.) -
You can then translate the fluent search into an index search request.
- This is the pattern for iterating through all results (across pages) covered in the Searching for assets portion of the SDK documentation.
Requires multiple API operations
Before you can search for classifications, you first need to have the Atlan-internal hashed-string representation of the classification. You will likely need to first retrieve the hashed-string representation.
POST /api/meta/search/indexsearch | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
- Run a search to find the assets.
- For a search with only a single condition, we can directly provide the condition.
- You can use the
term
query to exactly match a value on assets, for a given field. - Use the name of the field you want to match. In this example, since you want to match a specific certificate, you can use the
certificateStatus
field. - Provide the exact value you want to match in that field. In this example, you will be matching only assets with a certificate of
DEPRECATED
.