Skip to content

Manage files in tenant object store

You can use the SDK's FileClient to manage your files within Atlan's tenant object store by leveraging presigned URLs.

Upload a file to the object store

2.1.7

To upload a file to the tenant object store:

Coming soon

Upload a file to the tenant object store
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.file import PresignedURLRequest

client = AtlanClient()

presigned_url = client.files.generate_presigned_url(
    request=PresignedURLRequest( # (1)
        key="my-folder/my-file.txt",
        expiry="30s",
        method=PresignedURLRequest.Method.PUT,
    )
)

client.files.upload_file( # (2)
    presigned_url=presigned_url,
    file_path="user/some-folder/upload-file.txt"
)
  1. Begin by generating a presigned URL for the object store. You need to specify:

    • actual object name where you want to upload the file (e.g: prefix/object_name).
    • expiration time interval for the presigned URL.
    • presigned URL method (PUT for upload).
  2. Finally, upload the file to the object store by providing:

    • any valid presigned URL.
    • path to the file to be uploaded to the object store.

Coming soon

POST /api/service/files/presignedUrl
1
2
3
4
5
{
   "method": "PUT", // (1)
   "key": "my-folder/my-file.txt", // (2)
   "expiry": "30s" // (3)
}
  1. The presigned URL method (PUT for upload).
  2. The actual object name where you want to upload the file (e.g: prefix/object_name).
  3. An expiration time interval for the presigned URL.

Download a file from the object store

2.1.7

To download a file from the tenant object store:

Coming soon

Download a file from the tenant object store
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.file import PresignedURLRequest

client = AtlanClient()

presigned_url = client.files.generate_presigned_url(
    request=PresignedURLRequest( # (1)
        key="my-folder/my-file.txt",
        expiry="30s",
        method=PresignedURLRequest.Method.GET,
    )
)

client.files.download_file( # (2)
    presigned_url=presigned_url,
    file_path="user/some-folder/download-file.txt"
)
  1. Begin by generating a presigned URL for the object store. You need to specify:

    • actual object name you want to download (e.g: prefix/object_name).
    • expiration time interval for the presigned URL.
    • presigned URL method (GET for download).
  2. Finally, download the file from the object store by providing:

    • any valid presigned URL.
    • path to the location where you want to save the downloaded file.

Coming soon

POST /api/service/files/presignedUrl
1
2
3
4
5
{
   "method": "GET", // (1)
   "key": "my-folder/my-file.txt", // (2)
   "expiry": "30s" // (3)
}
  1. The presigned URL method (GET for download).
  2. The actual object name you want to download (e.g: prefix/object_name).
  3. An expiration time interval for the presigned URL.