Example Single Site script
Sample script that provides two functions to update sites and subnets in the Content Distribution locations table: DeleteAllLocations and AddLocation(). This information can then be retrieved by Nomad at a later stage when implementing the Single Site Download and Single Site PBA features. You can view Nomad Sites in the Nomad Sites page.
The Nomad Sites page is primarily designed to show how the network is being used for content distribution in different locations. It focuses on the volume of content downloaded from peers vs over the WAN, rather than the status of specific Content Titles in a given site. You can see what content is available in a given site by looking at the Content tab for that site.
Note
A Nomad Site corresponds to Nomad Single Site Download (SSD) site. Customers that have implemented SSD and upgrade ActiveEfficiency to the Nomad app and Content Distribution will see their defined SSD locations displayed as Nomad Sites in the app.
Any subnets that are not included in a Nomad SSD Site definition will be represented in a site named Unknown. If no SSD sites have been defined, all subnets will be included in the 'Unknown' site.
Prerequisites
The ExampleSitesAndSubnets.ps1 script is available from the Scripts folder in the 1E Content Distribution Tools download zip.
Note
You can download the 1E Content Distribution Tools from the Releases page for your platform version at https://support.1e.com/.
Content Distribution 8.0 or above.
PowerShell version 5.0 or above.
Using the example Single Site script
The sample script includes an example of how the script can be used:
Clears all current sites and subnet information stored in the ContentDistribution database.
Adds the following 3 sites and subnets in the ContentDistribution database.
"HOMER.SIMPSON.Springfield" "192.148.226.0/24"
"HOMER.SIMPSON.Springfield" "192.148.228.0/24"
"MARGE.SIMPSON.Springfield" "192.168.227.0/24"
Before using it in your environment, you must edit the script to replace the example "HOMER" site and subnets with your own list. Over time, you will manually modify the script to reflect your environment.
Note
The example script does not support supernets.
Note
If you prefer to automatically add Sites and subnets by querying AD, then you should consider using Example Active Directory Single Site script instead.
Parameters
Note
This platform release requires the 1E Authentication Proxy. This means that when using this script you will need to enter your AuthProxy url when prompted for the PlatformURL.
The script uses the following parameters:
PlatformUrl as a mandatory parameter - you must provide your platform base URL.
Tls12 as an optional switch parameter - include this switch if TLS 1.2 is required to connect to your platform server.
For example, to run the script on a PowerShell command-line:
.\ExampleSitesandSubnets.ps1 -PlatformUrl https://tachyon.acme.local:443 -Tls12
How it works
The sample script provides the following two functions:
Script functions
function DeleteAllLocations() Description: Deletes all rows from the ContentDistribution locations table Params: none Return: $result(empty) function AddLocation() Description: Adds a new entry into the ContentDistribution locations table Params: site - [string] containing the site name subnet - [string] containing the ipv4subnet in CIDR notation Return: $result - newly created location object of the form # {"Id":"efa19226-266f-4bd0-8a9d-94fa5ac1b773","Site":"HOMER.SIMPSON.Springfield","Subnet":"192.148.226.0/24"}
You must edit this section with your own list of sites and subnets:
# optional will delete all existing entries DeleteAllLocations # sample adding 3 locations using the AddLocation function # duplicate entires will report an error: (409) conflict AddLocation "HOMER.SIMPSON.Springfield" "192.148.226.0/24" AddLocation "HOMER.SIMPSON.Springfield" "192.148.228.0/24" AddLocation "MARGE.SIMPSON.Springfield" "192.168.227.0/24"