Skip to content

Instantly share code, notes, and snippets.

View DamianMac's full-sized avatar
😃
Doing too much at once.

Damian Maclennan DamianMac

😃
Doing too much at once.
View GitHub Profile
var server = "http://yourserveraddress:8065/"; //Your server and IP address
var apiKey = "API-XXXXXXXXXXXXXXXXXXXXXXXXX"; // Get this from your 'profile' page in the Octopus web portal
var endpoint = new OctopusServerEndpoint(server, apiKey);
var repository = new OctopusRepository(endpoint);
var deployment = repository.Deployments.Get("deployments-774");
var newDeployment = new Octopus.Client.Model.DeploymentResource();
@DamianMac
DamianMac / gist:6dfa55f0c4762e52ecc1
Created October 24, 2014 14:50
Find a deployment for a project and environment
var deployment = repository.Deployments.FindOne(d => d.EnvironmentId == "Environments-65" && d.ProjectId == "projects-193");
$server = "http://blah"
$apiKey = "API-XXXXXXXXXXXXXXXX"
$command = $($server + "/api/tasks")
$task = @{}
$task.Name = "Backup"
$task.Description = "Backup requested via API"
$body = $task | ConvertTo-Json