Skip to content

Initial add of generated code, update readme, add settings file. #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode
obj/
bin/
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# csharp
Work In Progress

# Generating the client code

## Prerequisites

Check out the generator project into some other directory
(henceforth `$GEN_DIR`)

```
cd $GEN_DIR/..
git clone https://github.com/kubernetes-client/gen
```

Install the [`autorest` tool](https://github.com/azure/autorest):

```
npm install autorest
```

## Generating code

```
# Where REPO_DIR points to the root of the csharp repository
cd ${REPO_DIR}/csharp/src
${GEN_DIR}/openapi/csharp.sh generated csharp.settings
```
3 changes: 3 additions & 0 deletions csharp.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export KUBERNETES_BRANCH=v1.6.0
export CLIENT_VERSION=0.0.1
export PACKAGE_NAME=k8s
21 changes: 21 additions & 0 deletions examples/simple/PodList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

using k8s;

namespace simple
{
class PodList
{
static void Main(string[] args)
{
IKubernetes client = new Kubernetes();
client.BaseUri = new Uri("http://localhost:8001");
var listTask = client.ListNamespacedPodWithHttpMessagesAsync("default");
listTask.Wait();
var list = listTask.Result.Body;
foreach (var item in list.Items) {
Console.WriteLine(item.Metadata.Name);
}
}
}
}
14 changes: 14 additions & 0 deletions examples/simple/simple.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="3.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<ProjectReference Include="..\..\src\csharp.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

</Project>
10 changes: 10 additions & 0 deletions src/csharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="3.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
</ItemGroup>
</Project>
13,775 changes: 13,775 additions & 0 deletions src/generated/IKubernetes.cs

Large diffs are not rendered by default.

Loading