# DIRECT DLM

## DLM Metadata Creation Script Usage

125 views 01/07/2020 05/11/2020 Gammy Pichardo 1

## Install Script Prerequisites

The metadata creation script require Python 2.7.13, the Requests module1, and the PyJWT module2. If you have Python 2.7 and those modules installed, you can proceed directly to the next step. Note that these scripts will also run on macOS.

To install the pre-requisite modules, simply run the install.py script that is included in the release package. Open a command line and navigate to your python directory, then use the following arguments:

python.exe c:\path\to\install.py

## Edit Configuration File Template

Within the script directory, navigate to the samples\config folder and edit deploy_local.json.

Specify values for the following options. Note that all directories and URLs should end with a trailing forward slash /.

• source_directory: Full path to the directory containing the files you want the DLM to download
• output_directory: Full path to a directory where the script will write the metadata to
• metafile_url: URL where you will be uploading this medata to. If you are not signing the data, then this must be an HTTPS URL (see below).
• download_url: URL where the DLM will retrieve your files from (we recommend this URL be listed twice in an array for optimal performance)
• repository_name: Friendly name for the set of files or package you are deploying. Examples: product_name, gamename, awesomepackage, etc... (DO NOT USE PERIODS IN REPOSITORY NAMES)
• build_version: Version number associated for the iteration of the files. Examples: "0.0.1" or "1.0.1"
• fileBoolean that denotes the DLM will be retrieving files in their raw form from the CDN. This is required and should NOT be modified or removed.

Optional configuration options:

• certificate_path: Full path to your code-signing certificate

### Sample Configuration File

{
"source_directory": "D:/ssn/deployscripts/source/",
"output_directory": "D:/ssn/deployscripts/catalog-metafile-only/output/",
"metafile_url": "https://solidstatenetworks.akamaized.net/qa/dlmdemo/meta/",
"http://netstorage.solidstatenetworks.com/qa/dlmdemo/files/",
"http://netstorage.solidstatenetworks.com/qa/dlmdemo/files/"
],
"certificate_path" : "D:/bits/certs/ssnqa.pfx",
"repository_name": "deploy_demo",
"build_version": "1.0.7",
"file": true
}


The metadata generated by this script MUST be secured in one of the following ways:

Option 1 -  The data can be signed when it is generated. This is done by specifying a certificate path and password as referenced above.
Option 2 - The data can be hosted on a domain protected by an SSL certificate (e.g. https://companyname.cdn.com/)

While both options can be used, only one is required. The JSON files are signed and JWT encoded.

When running the script, use the --config argument to specify the path to deploy_local.json file. Example:

 deploy_local.py --config=D:\ssn\deployscripts\dlm_metadata\samples\config\deploy_local.json

The script will output its progress.

### Script Output

The script outputs two files to the specified output_directory:

1. repository_name.build_version.catalog.json
2. repository_name.build_version.metafile.json