How to pre-import files from Swift object storage - Video CDN
How to pre-import files from Swift object storage - Video CDN
This guide relates to Swift object storage.
Preparations
Let’s assume you already have a file uploaded to a Swift bucket and you want to distribute it via a CDN.
First, you need access to the storage. In our example, we have the following rclone configuration:
[My_Swift_Storage]
tenant = 92284723 # <= project
tenant_domain = default
domain = default
auth_version = 3
type = swift
endpoint_type = public
user = 89347832 # <= user
key = WMTle7-FzsHu4Vpbm2qL # <= password
auth = https://swift.example.com/v3 # <= endpoint (web domain and path)
These are generic Swift credentials. They don’t specify which particular bucket we can access. However, we know the bucket we’ll be uploading files to is called ballads.
We can form the storage URL in the following format: swift://<user>:<project>:<password>@<endpoint>/<bucket>/
swift://89347832:92284723:WMTle7-FzsHu4Vpbm2qL@swift.example.com/v3/ballads/Save this URL somewhere — we’ll need it later.
Configuring files import from origin
Go to Resources.
Select the required resource
Then open the File Import tab and click Add new source:
A dialog will appear:
In it, select the Storage sync tab and choose Import from: Swift.
Paste the Swift storage URL into the form.
Click Add new source. You will be redirected to the import settings page for the resource:
Here, you can see the newly added origin.
Now, wait for the files to be processed. If your files are not massive (i.e., not tens of gigabytes), 5–10 minutes should be enough for the import to complete.
Check the result
Once the origin has been scanned and the files imported, you’ll find them listed in the Files section — ready for Video CDN to distribute.
Now you can fetch the files via HTTP. You should form the download url in the following format: https://<domain>/<filename>
In our tutorial, we assume we get system domain vcdn10000000.blazingcdn2.net and file SampleVideo_640x360_10mb.mp4. So the final url will be:
https://vcdn10000000.blazingcdn2.net/SampleVideo_640x360_10mb.mp4