Package com.atlan.samples.reporters
Class AssetReporter
- java.lang.Object
-
- com.atlan.samples.reporters.AbstractReporter
-
- com.atlan.samples.reporters.AssetReporter
-
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestHandler<java.util.Map<java.lang.String,java.lang.String>,java.lang.String>
- Direct Known Subclasses:
ExportAllDataAssets
public abstract class AssetReporter extends AbstractReporter implements com.amazonaws.services.lambda.runtime.RequestHandler<java.util.Map<java.lang.String,java.lang.String>,java.lang.String>
-
-
Field Summary
-
Fields inherited from class com.atlan.samples.reporters.AbstractReporter
BYTES_IN_GB, TIMESTAMP_FORMAT
-
-
Constructor Summary
Constructors Constructor Description AssetReporter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>
envVarsAsEvent()
Translates environment variables into a pseudo-event, to have a common method (handleRequest(Map, Context)
) across both local workstation runtimes and AWS Lambda execution.abstract com.atlan.model.search.FluentSearch.FluentSearchBuilder<?,?>
getAssetsToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a query that will retrieve all the assets you want to extract.RowGenerator
getAssetToValueTranslator(java.util.Map<java.lang.String,java.lang.String> event)
Produces a function that will translate all the attributes from each asset to string-encoded results that can be placed into the CSV.abstract java.util.List<com.atlan.model.fields.AtlanField>
getAttributesToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a list of all the attributes that should be extracted for each asset, in the order they should be produced for each row of the output.java.util.List<com.atlan.model.fields.AtlanField>
getRelatedAttributesToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a list of all the attributes that should be extracted for each related asset that is retrieved through the search.java.lang.String
handleRequest(java.util.Map<java.lang.String,java.lang.String> event, com.amazonaws.services.lambda.runtime.Context context)
protected void
parseParametersFromEvent(java.util.Map<java.lang.String,java.lang.String> event)
Extract the configuration parameters to use from the lambda payload (or equivalent).-
Methods inherited from class com.atlan.samples.reporters.AbstractReporter
getAssetLink, getAtlanTags, getBatchSize, getBucket, getComplexList, getCount, getDelimitedList, getDelimiter, getDescription, getDirectAtlanTags, getFilename, getFormattedDateTime, getGroupOwners, getREADME, getRegion, getStringValueForField, getUserOwners, getValue, protectFromNull, serializeAssetRefToCSV, serializeStructToCSV, serializeValueToCSV, setFilename, setFilenameWithPrefix, setFilenameWithPrefix
-
-
-
-
Method Detail
-
getAssetsToExtract
public abstract com.atlan.model.search.FluentSearch.FluentSearchBuilder<?,?> getAssetsToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a query that will retrieve all the assets you want to extract.- Parameters:
event
- context passed through the Lambda invocation event (or environment variables)- Returns:
- a fluent search with all necessary conditions for selecting the set of assets to extract
-
getAttributesToExtract
public abstract java.util.List<com.atlan.model.fields.AtlanField> getAttributesToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a list of all the attributes that should be extracted for each asset, in the order they should be produced for each row of the output. The qualifiedName and type of every asset will automatically be included as the first two columns (as they are required), so you do not need to specify these.- Parameters:
event
- context passed through the Lambda invocation event (or environment variables)- Returns:
- list of attributes to include for each asset
-
getRelatedAttributesToExtract
public java.util.List<com.atlan.model.fields.AtlanField> getRelatedAttributesToExtract(java.util.Map<java.lang.String,java.lang.String> event)
Produce a list of all the attributes that should be extracted for each related asset that is retrieved through the search. The qualifiedName and type of every related asset will automatically be included, so you do not need to specify these. (You only need to override this class if you want any other related attributes.)- Parameters:
event
- context passed through the Lambda invocation event (or environment variables)- Returns:
- list of attributes to include for each related asset
-
getAssetToValueTranslator
public RowGenerator getAssetToValueTranslator(java.util.Map<java.lang.String,java.lang.String> event)
Produces a function that will translate all the attributes from each asset to string-encoded results that can be placed into the CSV.- Parameters:
event
- context passed through the Lambda invocation event (or environment variables)- Returns:
- a row generator that translates from asset to a row of strings for the CSV
-
handleRequest
public java.lang.String handleRequest(java.util.Map<java.lang.String,java.lang.String> event, com.amazonaws.services.lambda.runtime.Context context)
- Specified by:
handleRequest
in interfacecom.amazonaws.services.lambda.runtime.RequestHandler<java.util.Map<java.lang.String,java.lang.String>,java.lang.String>
-
envVarsAsEvent
public static java.util.Map<java.lang.String,java.lang.String> envVarsAsEvent()
Translates environment variables into a pseudo-event, to have a common method (handleRequest(Map, Context)
) across both local workstation runtimes and AWS Lambda execution.- Returns:
- a map of environment variables as if they are event context from AWS
-
parseParametersFromEvent
protected void parseParametersFromEvent(java.util.Map<java.lang.String,java.lang.String> event)
Description copied from class:AbstractReporter
Extract the configuration parameters to use from the lambda payload (or equivalent).- Overrides:
parseParametersFromEvent
in classAbstractReporter
- Parameters:
event
- configuration payload from the lambda function (or equivalent)
-
-