Network - Add URL Reservation

Octopus.Script exported 2014-05-27 by bobjwalker belongs to ‘HTTP’ category.

Creates an HTTP URL reservation (ACL) using NETSH.

Parameters

When steps based on the template are included in a project’s deployment process, the parameters below can be set.

URL

Url =

The URL to reserve. Example: http://+:8080

Allow delegation

Delegate = False

Indicates whether or not the user can delegate URLs. Example: True or False

User

User =

Specifies the user or group name. Example: DOMAIN\user

Script body

Steps based on this template will execute the following PowerShell script.

$url = $OctopusParameters['Url']
$user = $OctopusParameters['User']
$delegate = if ('True' -eq $OctopusParameters['Delegate']) { 'yes' } else { 'no'}

$delacl = "http delete urlacl url=$url"
$addacl = "http add urlacl url=$url user=""$user"" delegate=$delegate"

write-host "Removing ACL: $delacl"
$delacl | netsh | out-host

write-host "Creating ACL: $addacl"
$addacl | netsh | out-host

Provided under the Apache License version 2.0.

Report an issue

To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.

{
  "Id": "45eea99e-061c-45d2-bcc0-9320269a4ee4",
  "Name": "Network - Add URL Reservation",
  "Description": "Creates an HTTP URL reservation (ACL) using NETSH.",
  "Version": 11,
  "ExportedAt": "2014-05-27T18:53:32.929+00:00",
  "ActionType": "Octopus.Script",
  "Author": "bobjwalker",
  "Parameters": [
    {
      "Name": "Url",
      "Label": "URL",
      "HelpText": "The URL to reserve. Example: _http://+:8080_",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "Delegate",
      "Label": "Allow delegation",
      "HelpText": "Indicates whether or not the user can delegate URLs. Example: _True_ or _False_",
      "DefaultValue": "False",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "User",
      "Label": "User",
      "HelpText": "Specifies the user or group name. Example: _DOMAIN\\user_",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    }
  ],
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$url = $OctopusParameters['Url']\n$user = $OctopusParameters['User']\n$delegate = if ('True' -eq $OctopusParameters['Delegate']) { 'yes' } else { 'no'}\n\n$delacl = \"http delete urlacl url=$url\"\n$addacl = \"http add urlacl url=$url user=\"\"$user\"\" delegate=$delegate\"\n\nwrite-host \"Removing ACL: $delacl\"\n$delacl | netsh | out-host\n\nwrite-host \"Creating ACL: $addacl\"\n$addacl | netsh | out-host\n",
    "Octopus.Action.Script.Syntax": "PowerShell"
  },
  "Category": "HTTP",
  "HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/network-add-url-reservation.json",
  "Website": "/step-templates/45eea99e-061c-45d2-bcc0-9320269a4ee4",
  "Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB1dJREFUeNrsnc8uO18Yh1ERoRKJ+CYkLNljzwVwAXoBdQHs6V7t6wLaC+AC2GPPykJIxM6fECm/T3qS8zumM9PTabUz+jyr0Z7OTOc8877vnDlTw9/f30MA3WYYsQCxALEAsTgKgFiAWIBYAIgFiAWIBYBYgFiAWACIBYgFiAWAWIBYgFgAiAWIBYgFgFiAWIBYAIgFiAWIBYBYgFiAWACIBYgFiNXM19fX+/s7x25AGB8fHxkZafdTowm2JBfr9TpHfEBIltNGOHDwGyAWIBYgFiAWAGIBYgFiASAWIBYgFgBiAWIBYgEgFiAWIBYAYgFiAWIBIBYgFiAWAGIBYgFiASAWIBYgFkByRnu/ybe3N457hhgeHs7n8+kV6+vr6+npSVZNT0/ncjk6LCt8fHwkECvJD6/V6/V2o46suru7m52d/ffvH12VLWSIglZKxXp8fFSgmpmZoZ8GRKxeFO+fn58Kp1jFVWH3xVK44lgjFgBiAWIBYgEgFiAWIBYAYgFiAWIBIBYgFiAWAGJBahjNyo5eXl7a5aWlpampKTpPHBwc3N/fa2GrQWibarV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ygyhg+lRDZJV8W3NaIiRD7EyJtbz83PUu3rLncPTcjQ1NNX6PB7Y3xkNgy5WuzkiZpaV26ZcLke9G5gAGPUsvGcmjSqePOVDrF5QrVZ9njH0mTN4enoa+ssIetG9OVgsFkMv1qTOmkNgoo7P44E+8vWMQXwS2p1ooEBSKBT0ihaKDczrgc4rlUom6ugaPmZulgRS725vb5s7PNfX17VazZ1hIS30bic1XAqfTUWsyFRo8pQ7ZLDUwA1mpk1UeDNqDjUm6hwdHYW2UUEdNdunZchM87OppML/pdnf3w+tUQIprPk/i6qDQ4t0NY6f+aR3lXaT3RJu99nUvhdYWYpYZip6aJ4KYOetx6DyWc3U03beUrNDZkZypVJxB4e0ZsWk5h3QK8qVMkAfCUQ1KaVs27KzA7vtziBt99nUNIjVi/+wqsb6SL/mb/we7tx59ye77AN9cqUrg0k+02C0RRNKu7VRS7L/sDqINdZvYyYZd3GFPmtL2+RHBkgBsQCxALEAEAsQCwYZhhuSs7W1Ze8OpfaXlfsFA6TQgmQDpKRCoMYCxALEAkAsQCxALIBsilWv1znWiNVlxsfHYx7mBMRKuo2RkcnJydvbWw734NCLWzqGx8dHbWtxcXFsbIzjniGS3dLpnVji9fVVOfH9/R23MsTExMTCwkKqxYKMipXL5RhugEEabgDEAkAsQCxALADEAsQCxAJALEAsQCwAxALEAsQCQCxALEAsAMQCxALEAkAsQCxALADEAsSCv0qSR+wBEAsQCxALALEAsQCxABALEAsQCwCxALEAsQAQCxALEAsAsQCxALEAEAsQCxALALEAsQCxABALEAsQCwCxALEAsQAQCxALMsV/AgwA3l1/9Yi7khIAAAAASUVORK5CYII=",
  "$Meta": {
    "Type": "ActionTemplate"
  }
}

History

Page updated on Tuesday, May 27, 2014