2017-10-13 03:44:59 +08:00
|
|
|
# Kubernetes C# Client
|
2017-05-12 10:18:12 -07:00
|
|
|
Work In Progress
|
2017-07-25 17:16:34 +02:00
|
|
|
|
|
|
|
|
[](https://travis-ci.org/kubernetes-client/csharp)
|
2017-06-06 23:02:14 -07:00
|
|
|
|
2017-09-13 14:49:35 -07:00
|
|
|
# Usage
|
2017-10-20 21:20:52 -07:00
|
|
|
[Nuget Package](https://www.nuget.org/packages/KubernetesClient/)
|
2017-09-13 14:49:35 -07:00
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
dotnet add package KubernetesClient
|
|
|
|
|
```
|
|
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
# Generating the Client Code
|
2017-06-06 23:02:14 -07:00
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
|
|
Check out the generator project into some other directory
|
|
|
|
|
(henceforth `$GEN_DIR`)
|
|
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
```bash
|
2017-06-06 23:02:14 -07:00
|
|
|
cd $GEN_DIR/..
|
|
|
|
|
git clone https://github.com/kubernetes-client/gen
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Install the [`autorest` tool](https://github.com/azure/autorest):
|
|
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
```bash
|
2017-06-06 23:02:14 -07:00
|
|
|
npm install autorest
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Generating code
|
|
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
```bash
|
2017-06-06 23:02:14 -07:00
|
|
|
# Where REPO_DIR points to the root of the csharp repository
|
|
|
|
|
cd ${REPO_DIR}/csharp/src
|
|
|
|
|
${GEN_DIR}/openapi/csharp.sh generated csharp.settings
|
|
|
|
|
```
|
2017-06-22 22:41:42 +02:00
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
# Usage
|
|
|
|
|
|
|
|
|
|
## Running the Examples
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
git clone git@github.com:kubernetes-client/csharp.git
|
|
|
|
|
cd csharp\examples\simple
|
|
|
|
|
dotnet run
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Testing
|
2017-06-22 22:41:42 +02:00
|
|
|
|
|
|
|
|
The project uses [XUnit](https://xunit.github.io) as unit testing framework.
|
|
|
|
|
|
2017-08-09 16:49:45 -07:00
|
|
|
To run the tests
|
2017-06-22 22:41:42 +02:00
|
|
|
|
|
|
|
|
```bash
|
2017-08-09 16:49:45 -07:00
|
|
|
cd csharp\tests
|
2017-06-22 22:41:42 +02:00
|
|
|
dotnet restore
|
2017-10-13 03:44:59 +08:00
|
|
|
dotnet test
|
2017-09-13 14:33:06 -07:00
|
|
|
```
|