Skip to content

Commit

Permalink
Update ADLS Upload documentation (#157)
Browse files Browse the repository at this point in the history
* Update ADLS Upload documentation

* Update Delete.java

* Update List.java

* Update Read.java

* Update Reads.java

* change data example

* change data example
  • Loading branch information
Ben8t authored Nov 28, 2024
1 parent 22c3f3c commit b6c926d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 48 deletions.
12 changes: 4 additions & 8 deletions src/main/java/io/kestra/plugin/azure/storage/adls/Delete.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@
code = """
id: azure_storage_datalake_delete
namespace: company.team
pluginDefaults:
- type: io.kestra.plugin.azure.storage.adls
values:
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
tasks:
- id: delete_file
type: io.kestra.plugin.azure.storage.adls.Delete
filePath: "full/path/to/file.txt"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
"""
)
}
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/io/kestra/plugin/azure/storage/adls/List.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@
id: azure_data_lake_storage_list
namespace: company.team
pluginDefaults:
- type: io.kestra.plugin.azure.storage.adls
values:
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
tasks:
- id: list_files_in_dir
type: io.kestra.plugin.azure.storage.adls.List
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
directoryPath: "path/to/my/directory/"
- id: for_each_file
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/io/kestra/plugin/azure/storage/adls/Read.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
id: azure_storage_datalake_read
namespace: company.team
pluginDefaults:
- type: io.kestra.plugin.azure.storage.adls
values:
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
tasks:
- id: read_file
type: io.kestra.plugin.azure.storage.adls.Read
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
filePath: "full/path/to/file.txt"
- id: log_size
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/io/kestra/plugin/azure/storage/adls/Reads.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,12 @@
id: azure_storage_datalake_readq
namespace: company.team
pluginDefaults:
- type: io.kestra.plugin.azure.storage.adls
values:
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
tasks:
- id: read_file
type: io.kestra.plugin.azure.storage.adls.Reads
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
directoryPath: "path/to/my/directory/"
"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@
tasks:
- id: download_request
type: io.kestra.plugin.core.http.Download
uri: https://pokeapi.co/api/v2/pokemon/pikachu
uri: https://dummyjson.com/products
- id: to_ion
type: io.kestra.plugin.serdes.json.JsonToIon
from: "{{ outputs.download_request.uri }}"
- id: upload_file
type: io.kestra.plugin.azure.storage.adls.Upload
fileName: "adls/pokemon/pikachu.json"
fileName: "adls/product_data/product.json"
from: "{{ outputs.to_ion.uri }}"
- id: shared_access
type: io.kestra.plugin.azure.storage.adls.SharedAccess
fileName: "adls/pokemon/pikachu.json"
fileName: "adls/product_data/product.json"
expirationDate: "{{ now() | dateAdd(1, 'DAYS') }}"
permissions:
- READ
Expand Down
24 changes: 8 additions & 16 deletions src/main/java/io/kestra/plugin/azure/storage/adls/Upload.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,23 @@
examples = {
@Example(
full = true,
title = "Download a json file, convert it to ion format, finally upload it to Azure Data Lake Storage.",
title = "Download a json file and upload it to Azure Data Lake Storage.",
code = """
id: azure_data_lake_storage_upload
namespace: company.team
pluginDefaults:
- type: io.kestra.plugin.azure.storage.adls
values:
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
tasks:
- id: download_request
type: io.kestra.plugin.core.http.Download
uri: https://pokeapi.co/api/v2/pokemon/pikachu
- id: to_ion
type: io.kestra.plugin.serdes.json.JsonToIon
from: "{{ outputs.download_request.uri }}"
uri: adls/product_data/product.json
- id: upload_file
type: io.kestra.plugin.azure.storage.adls.Upload
filePath: "path/to/file/pikachu.json"
from: "{{ outputs.to_ion.uri }}"
filePath: "path/to/file/product.json"
from: "{{ outputs.download_request.uri }}"
connectionString: "{{ secret('AZURE_CONNECTION_STRING') }}"
fileSystem: "tasks"
endpoint: "https://yourblob.blob.core.windows.net"
"""
)
}
Expand Down

0 comments on commit b6c926d

Please sign in to comment.