diff --git a/templates/documentation/_assets/get-started/migration-guide/Google-Storage-Logo.svg b/templates/documentation/_assets/get-started/migration-guide/Google-Storage-Logo.svg new file mode 100644 index 00000000..d30e0030 --- /dev/null +++ b/templates/documentation/_assets/get-started/migration-guide/Google-Storage-Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-1-api-services.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-1-api-services.png new file mode 100644 index 00000000..b3800d6b Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-1-api-services.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-10-export-json.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-10-export-json.png new file mode 100644 index 00000000..ca7dbec8 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-10-export-json.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-11-json-confirmation.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-11-json-confirmation.png new file mode 100644 index 00000000..15c800d7 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-11-json-confirmation.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-12-open-json.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-12-open-json.png new file mode 100644 index 00000000..5844620c Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-12-open-json.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-13-copy-to-env-file.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-13-copy-to-env-file.png new file mode 100644 index 00000000..42cd6827 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-13-copy-to-env-file.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-14-env-file.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-14-env-file.png new file mode 100644 index 00000000..3235bd6e Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-14-env-file.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-2-enable-api.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-2-enable-api.png new file mode 100644 index 00000000..ba4de0bf Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-2-enable-api.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-3-cloud-storage.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-3-cloud-storage.png new file mode 100644 index 00000000..27cdb198 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-3-cloud-storage.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-4-create-service-account.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-4-create-service-account.png new file mode 100644 index 00000000..18042fa8 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-4-create-service-account.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-5-add-service-account.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-5-add-service-account.png new file mode 100644 index 00000000..b64c8ffd Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-5-add-service-account.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-6-add-roles.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-6-add-roles.png new file mode 100644 index 00000000..9d246551 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-6-add-roles.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-7-grant-user-access.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-7-grant-user-access.png new file mode 100644 index 00000000..14dc6b64 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-7-grant-user-access.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-8-navigate-to-service-account.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-8-navigate-to-service-account.png new file mode 100644 index 00000000..f06f7298 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-8-navigate-to-service-account.png differ diff --git a/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-9-navigate-to-keys-add-key.png b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-9-navigate-to-keys-add-key.png new file mode 100644 index 00000000..911a8390 Binary files /dev/null and b/templates/documentation/_assets/vod/backup-and-cold-storage/gcp-9-navigate-to-keys-add-key.png differ diff --git a/templates/documentation/vod/amazon-cold-storage-backup.md b/templates/documentation/vod/amazon-cold-storage-backup.md new file mode 100644 index 00000000..37a2ab75 --- /dev/null +++ b/templates/documentation/vod/amazon-cold-storage-backup.md @@ -0,0 +1,92 @@ +--- +title: "Backup your videos to Amazon S3" +slug: "amazon-cold-storage-backup" +meta: + description: Backup videos uploaded to api.video to Amazon Storage account with a simple script. +--- +# Video backup to Azure + +At [api.video](https://api.video/) we understand that sometimes, you want to make sure that your videos are safe and secure. Although api.video has a backup and disaster recovery plan, it’s up to you to decide if you want an extra backup resource or if you would like to use api.video just to transcode your videos but eventually store them on a different resource. + +That’s why, we’ve created this guide so you can store the videos you’ve already transcoded with [api.video](https://api.video/) on a file storage resource. + +## How it’s done? + +This guide will explain how you can store your transcoded videos on Amazon S3 Account. In short, all you need to do is run a small script that will copy the videos from [api.video](https://api.video/) to Azure. The videos will be kept on api.video as well, however, if you wish to delete them you can do so by leveraging the `DELETE /videos` endpoint, more information can be found [here](https://docs.api.video/vod/delete-a-video). + +## Preparation + +**What we will need to run the script?** + +1. **[api.video](https://api.video/) API key**, you can find the information on how to retrieve the API key in the Retrieve your api.video API key guide +2. Amazon S3 credentials +3. Copy the Amazon S3 region from the console +4. api.video Cold Storage script, +5. **Node.js** and **npm**, you can find the installation instructions here +6. **Typescript**, you can find the installation instructions here + +### Getting the Amazon S3 credentials + +You can find the guide of getting the Amazon S3 Access Key id and Secret Key [here](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-started-nodejs.html#getting-started-nodejs-credentials) + +## Getting Started + +After you’ve got all the keys and installed node.js, npm and typescript, you can proceed with cloning the script from GitHub. + +### Cloning the Cold Storage script + +1. In the command line enter the following + +```bash +$ git clone https://github.com/apivideo/backup-cold-storage +``` + +1. Once the script is cloned, you can navigate the script directory + +```bash +$ cd back-cold-storage +``` + +### Setting up the script + +Once you are in the script directory, install the dependencies + +```bash +$ npm install +``` + +After the dependencies are installed, we will need to enter the credentials we have copied in the preparation phase. + +Edit the `.env` file and replace the following with the keys you've received from Azure and [api.video](https://api.video/). + +```bash +# possible providers: google, aws, azure +PROVIDER = "aws" + +# api.video API key +APIVIDEO_API_KEY = "api_video_api_key" + +# the name of the bucket on Google Amazon S3 or the container on Azure Storage +SPACE_NAME = "your_bucket_name" + +# Amazon S3 credentials +AWS_ACCESS_KEY_ID = "amazon_access_key_id" +AWS_SECRET_ACCESS_KEY = "amazon_secret_key" +AWS_REGION = "s3_bucket_region" +``` + +Don’t forget to save the file. + +## Running the backup + +Once you've got all the keys in place in the `.env` file, it's time to run the script. As we are running the script on TypeScript, we will need to build it first, hence, the first command you need to run in the script folder is: + +```bash +$ npm run build +``` + +After the script was built, it’s time to run it: + +```bash +$ npm run backup +``` \ No newline at end of file diff --git a/templates/documentation/vod/azure-cold-storage-backup.md b/templates/documentation/vod/azure-cold-storage-backup.md index 961d1567..930914a5 100644 --- a/templates/documentation/vod/azure-cold-storage-backup.md +++ b/templates/documentation/vod/azure-cold-storage-backup.md @@ -21,7 +21,7 @@ This guide will explain how you can store your transcoded videos on Azure Storag 1. **[api.video](https://api.video/) API key**, you can find the information on how to retrieve the API key in the Retrieve your api.video API key guide 2. Azure Account Key, or use any other credential system that Azure provides 3. Azure storage account name -4. api.video Cold Storage script, +4. api.video Cold Storage script, 5. **Node.js** and **npm**, you can find the installation instructions here 6. **Typescript**, you can find the installation instructions here @@ -40,13 +40,13 @@ After you’ve got all the keys and installed node.js, npm and typescript, you c 1. In the command line enter the following ```bash -$ git clone https://github.com/apivideo/azure-cold-storage +$ git clone https://github.com/apivideo/backup-cold-storage ``` -1. Once the script is cloned, you can navigate the script directory +2. Once the script is cloned, you can navigate the script directory ```bash -$ cd azure-cold-storage +$ cd backup-cold-storage ``` ### Setting up the script @@ -62,9 +62,18 @@ After the dependencies are installed, we will need to enter the credentials we h Edit the `.env` file and replace the following with the keys you've received from Azure and [api.video](https://api.video/). ```bash -APIVIDEO_API_KEY = "apivideo_api_key" -AZURE_ACCOUNT_KEY = "Azure_account_key" -AZURE_STORAGE_ACCOUNT = "Your_azure_storage_account" +# possible providers: google, aws, azure +PROVIDER = "azure" + +# api.video API key +APIVIDEO_API_KEY = "api_video_api_key" + +# the name of the bucket on Google Amazon S3 or the container on Azure Storage +SPACE_NAME = "azure_container_name" + +# Azure credentials +AZURE_ACCOUNT_KEY = "azure_account_key" +AZURE_STORAGE_ACCOUNT_NAME = "azure_storage_account_name" ``` Don’t forget to save the file. diff --git a/templates/documentation/vod/backup-and-cold-storage.md b/templates/documentation/vod/backup-and-cold-storage.md index 331b2022..1f1d608d 100644 --- a/templates/documentation/vod/backup-and-cold-storage.md +++ b/templates/documentation/vod/backup-and-cold-storage.md @@ -24,6 +24,8 @@ Below, you will find the scripts that are available for your disposale in order
+{% include "_partials/hagrid-item.md" title: "Amazon", image: "/_assets/get-started/migration-guide/Amazon-S3-Logo.svg", subtitle: "S3", link: "./amazon-cold-storage-backup.md" %} +{% include "_partials/hagrid-item.md" title: "Google", image: "/_assets/get-started/migration-guide/Google-Storage-Logo.svg", subtitle: "Storage account", link: "./google-cold-storage-backup.md" %} {% include "_partials/hagrid-item.md" title: "Azure", image: "/_assets/get-started/migration-guide/Microsoft_Azure.svg", subtitle: "Storage account", link: "./azure-cold-storage-backup.md" %}
diff --git a/templates/documentation/vod/google-cold-storage-backup.md b/templates/documentation/vod/google-cold-storage-backup.md new file mode 100644 index 00000000..aed0daef --- /dev/null +++ b/templates/documentation/vod/google-cold-storage-backup.md @@ -0,0 +1,118 @@ +--- +title: "Backup your videos to Google Storage account" +slug: "google-cold-storage-backup" +meta: + description: Backup videos uploaded to api.video to Google Storage account with a simple script. +--- +# Video backup to Azure + +At [api.video](https://api.video/) we understand that sometimes, you want to make sure that your videos are safe and secure. Although api.video has a backup and disaster recovery plan, it’s up to you to decide if you want an extra backup resource or if you would like to use api.video just to transcode your videos but eventually store them on a different resource. + +That’s why, we’ve created this guide so you can store the videos you’ve already transcoded with [api.video](https://api.video/) on a file storage resource. + +## How it’s done? + +This guide will explain how you can store your transcoded videos on Amazon S3 Account. In short, all you need to do is run a small script that will copy the videos from [api.video](https://api.video/) to Azure. The videos will be kept on api.video as well, however, if you wish to delete them you can do so by leveraging the `DELETE /videos` endpoint, more information can be found [here](https://docs.api.video/vod/delete-a-video). + +## Preparation + +**What we will need to run the script?** + +1. **[api.video](https://api.video/) API key**, you can find the information on how to retrieve the API key in the Retrieve your api.video API key guide +2. Preparing to the backup to Google account, you can follow the below steps. You will need to create a service account for the Storage account +4. api.video Cold Storage script, +5. **Node.js** and **npm**, you can find the installation instructions here +6. **Typescript**, you can find the installation instructions here + +### Setting up service account and getting the credentials + +- On Google Cloud Platform, navigate to the menu and select `APIs and services` +- Select `Enabled APIs and services` +![](/_assets/vod/backup-and-cold-storage//gcp-1-api-services.png) +- Click on `+ ENABLE APIS AND SERVICES` +![](/_assets/vod/backup-and-cold-storage/gcp-2-enable-api.png) +- Search for `Storage` and select `Storage Cloud` +![](/_assets/vod/backup-and-cold-storage/gcp-3-cloud-storage.png) +- If the API is not enabled, click on `Enable API`, and `Manage` +- In the `API services details` click on `+ Create credentials` +- Select `Service account` +![](/_assets/vod/backup-and-cold-storage/gcp-4-create-service-account.png) +- Fill out the details in the `Create Service Account` screen, click on `Create and Continue` +![](/_assets/vod/backup-and-cold-storage/gcp-5-add-service-account.png) +- In the optional pane `Grant this service account access to the project` grant the Storage Admin role and click continue +![](/_assets/vod/backup-and-cold-storage/gcp-6-add-roles.png) +- Add the user to the service account and click `Done` +![](/_assets/vod/backup-and-cold-storage/gcp-7-grant-user-access.png) +- On the `API/Service details` click on the Service account that was just created, under Service Accounts +![](/_assets/vod/backup-and-cold-storage/gcp-8-navigate-to-service-account.png) +- In the Service Account screen, navigate to the `Keys`tab +![](/_assets/vod/backup-and-cold-storage/gcp-9-navigate-to-keys-add-key.png) +- Click on `Add Key` and `Create new key`, a pop-up will appear, select `JSON` and then `Create`. +![](/_assets/vod/backup-and-cold-storage/gcp-10-export-json.png) +- This action will trigger a download of a JSON file that will storage on your machine/ +![](/_assets/vod/backup-and-cold-storage/gcp-11-json-confirmation.png) +- Copy the content of the JSON file +![](/_assets/vod/backup-and-cold-storage/gcp-12-open-json.png) +- Copy the content into the `.env` in the `GCP_KEY` parameter. Note that the parameter should be a string, so encapsulate the JSON into `''` +![](/_assets/vod/backup-and-cold-storage/gcp-14-env-file.png) + +## Getting Started + +After you’ve got all the keys and installed node.js, npm and typescript, you can proceed with cloning the script from GitHub. + +### Cloning the Cold Storage script + +1. In the command line enter the following + +```bash +$ git clone https://github.com/apivideo/backup-cold-storage +``` + +1. Once the script is cloned, you can navigate the script directory + +```bash +$ cd back-cold-storage +``` + +### Setting up the script + +Once you are in the script directory, install the dependencies + +```bash +$ npm install +``` + +After the dependencies are installed, we will need to enter the credentials we have copied in the preparation phase. + +Edit the `.env` file and replace the following with the keys you've received from Azure and [api.video](https://api.video/). + +```bash +# possible providers: google, aws, azure +PROVIDER = "google" + +# api.video API key +APIVIDEO_API_KEY = "apivideo_api_key" + +# the name of the bucket on Google Amazon S3 or the container on Azure Storage +SPACE_NAME = "google_bucket_name" + +# Google credentails +GCP_KEY = '{ google json key +}' +``` + +Don’t forget to save the file. + +## Running the backup + +Once you've got all the keys in place in the `.env` file, it's time to run the script. As we are running the script on TypeScript, we will need to build it first, hence, the first command you need to run in the script folder is: + +```bash +$ npm run build +``` + +After the script was built, it’s time to run it: + +```bash +$ npm run backup +``` \ No newline at end of file diff --git a/templates/documentation/vod/navigation.yaml b/templates/documentation/vod/navigation.yaml index adf1ba39..41c49164 100644 --- a/templates/documentation/vod/navigation.yaml +++ b/templates/documentation/vod/navigation.yaml @@ -52,7 +52,11 @@ href: /vod/backup-and-cold-storage.md collapsed: true items: - - label: Video backup to Azure + - label: Video backup to Amazon S3 + href: /vod/amazon-cold-storage-backup.md + - label: Video backup to Google Storage account + href: /vod/google-cold-storage-backup.md + - label: Video backup to Azure Storage account href: /vod/azure-cold-storage-backup.md - heading: Video management