Skip to content

Commit 7df099d

Browse files
Merge pull request #2 from brendandburns/add
Initial add of generated code, update readme, add settings file.
2 parents 08c4557 + f6433ca commit 7df099d

File tree

335 files changed

+208827
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+208827
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode
2+
obj/
3+
bin/

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
# csharp
22
Work In Progress
3+
4+
# Generating the client code
5+
6+
## Prerequisites
7+
8+
Check out the generator project into some other directory
9+
(henceforth `$GEN_DIR`)
10+
11+
```
12+
cd $GEN_DIR/..
13+
git clone https://github.com/kubernetes-client/gen
14+
```
15+
16+
Install the [`autorest` tool](https://github.com/azure/autorest):
17+
18+
```
19+
npm install autorest
20+
```
21+
22+
## Generating code
23+
24+
```
25+
# Where REPO_DIR points to the root of the csharp repository
26+
cd ${REPO_DIR}/csharp/src
27+
${GEN_DIR}/openapi/csharp.sh generated csharp.settings
28+
```

csharp.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export KUBERNETES_BRANCH=v1.6.0
2+
export CLIENT_VERSION=0.0.1
3+
export PACKAGE_NAME=k8s

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>

src/csharp.csproj

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

src/generated/IKubernetes.cs

Lines changed: 13775 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)