Skip to content

Commit f6433ca

Browse files
committed
Add some example code.
1 parent d42da04 commit f6433ca

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

examples/simple/PodList.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
3+
using k8s;
4+
5+
namespace simple
6+
{
7+
class PodList
8+
{
9+
static void Main(string[] args)
10+
{
11+
IKubernetes client = new Kubernetes();
12+
client.BaseUri = new Uri("http://localhost:8001");
13+
var listTask = client.ListNamespacedPodWithHttpMessagesAsync("default");
14+
listTask.Wait();
15+
var list = listTask.Result.Body;
16+
foreach (var item in list.Items) {
17+
Console.WriteLine(item.Metadata.Name);
18+
}
19+
}
20+
}
21+
}

examples/simple/simple.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<ItemGroup>
4+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="3.0.3" />
5+
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
6+
<ProjectReference Include="..\..\src\csharp.csproj" />
7+
</ItemGroup>
8+
9+
<PropertyGroup>
10+
<OutputType>Exe</OutputType>
11+
<TargetFramework>netcoreapp1.1</TargetFramework>
12+
</PropertyGroup>
13+
14+
</Project>

0 commit comments

Comments
 (0)