Skip to content

Commit 935924a

Browse files
committed
Update README.md
1 parent 4117df1 commit 935924a

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,45 @@ ScriptCs.OctoClient
22
===================
33

44
Octopus Client Script Pack for ScriptCs
5+
6+
Example Usage:
7+
8+
``` csharp
9+
var octopus = Require<OctopusClientPack>();
10+
var repo = octopus.GetRepository("http://server/octopusdeploy/api", "API-XXXXXXXXXXXXXXXXXXXXXXXXXXX");
11+
Console.WriteLine("Getting the current user...");
12+
var user = repo.Users.GetCurrent();
13+
Console.WriteLine("Current user: {0}", user.DisplayName);
14+
Console.WriteLine("Getting your dashboard...");
15+
var dashboard = repo.Dashboards.GetDashboard();
16+
foreach(var item in dashboard.Items)
17+
{
18+
var project = repo.Projects.Get(item.ProjectId);
19+
var environment = repo.Environments.Get(item.EnvironmentId);
20+
Console.WriteLine("Project: {0} -> Environment: {1} -> Release Version: {2}", project.Name, environment.Name, item.ReleaseVersion);
21+
}
22+
```
23+
24+
---
25+
26+
The MIT License (MIT)
27+
28+
Copyright (c) 2014 Henrik Andersson
29+
30+
Permission is hereby granted, free of charge, to any person obtaining a copy
31+
of this software and associated documentation files (the "Software"), to deal
32+
in the Software without restriction, including without limitation the rights
33+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34+
copies of the Software, and to permit persons to whom the Software is
35+
furnished to do so, subject to the following conditions:
36+
37+
The above copyright notice and this permission notice shall be included in all
38+
copies or substantial portions of the Software.
39+
40+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46+
SOFTWARE.

0 commit comments

Comments
 (0)