Reading File Data
Files stored by Vendia can be accessed from your existing cloud setup by executing a set of configuration steps, dependent on the Cloud Service Provider designated for the node when it was created.
AWS Nodes
Granting client permissions to access files in Vendia
In order to view the File stored in your Vendia Uni, you need to grant the client AWS account access to the Vendia Uni. You can do this using the setting the value for aws.s3ReadAccounts
within an updateVendia_Settings
mutation, providing your AWS Account ID.
Note: updateVendia_Settings
mutations will overwrite any existing settings prescribed by your request, so be sure
to account for the previous state of the node’s settings if necessary.
Note: anyone with access to the AWS Account you provide will have access to the Files in your Uni Node.
Now your AWS Account will be able to access the Files in your Vendia Uni. To do so, you’ll also need your Node’s Bucket name.
Getting your Node’s Bucket
To get the Node’s Bucket information you can access the Uni Dashboard and select your Uni. Under
your Node’s Resources will be a property for S3 Bucket ARN. The portion following the
arn:aws:s3:::
is your bucket’s name.
You can also get this information using the share CLI and executing the command:
As part of the output you will see a section called aws_FileStorage with a property name, this is the Node’s bucket name.
Querying File metadata
You can query the node for File metadata, e.g.:
Retrieving the File contents
To retrieve the File contents, use an S3 client to perform a GetObject request using the node bucket and DestinationKey attributes on the File metadata.
For example, using the AWS CLI,
If you are using a Free Tier Uni, you need to provide the Requester Pays header as part of any call. All Vendia Free Tier buckets are set up as Requester Pays buckets. We handle all costs except for accesses directly to the Uni File bucket.
For non-Free Tier unis, the File metadata will include a pre-signed temporaryUrl
that
can be used to retrieve the object directly using any HTTP client.
Azure Nodes
Create a multi-tenant app registration
Open a new terminal session, logging out of any previous Azure CLI session.
Log in as an user with permissions to create applications within your Azure Active Directory (AAD) tenant.
Make note of the tenant you will be operating against.
Run the following command to create a new multi-tenant application, replacing <app-registration-name>
with the desired name for your app registration.
Make a note of the appId
(client ID) value returned by the command.
Run the following command to create a client secret for the app registration, saving off the password
as a local variable for your terminal session:
Store the values for client ID and secret securely using Azure best practices (ex. within an Azure Key Vault).
Update your node’s settings
Since more than one application can be allowed to read your Vendia_File
storage, make note of the current settings configuration for azure.storageAccountReaders
for your node (by default, this value should be null
).
Craft a mutation to update the node’s Vendia_Settings
at the azure.storageAccountReaders
path, using the value from $MY_APPLICATION_ID
for the $applicationId
GraphQL variable:
Use your node’s storage container
Log out of any previous Azure CLI session.
Log into the Vendia Share CLI.
- See https://docs.vendia.com/cli/guide for more.
Set up your terminal session with the information for the uni and node for which you are configuring access.
Set up your terminal session with the information for the uni and node for which you are configuring access.
Log in as the multi-tenant app created earlier.
Run the following command to list the files within your node’s storage: