2017-05-12 10:18:12 -07:00
|
|
|
# csharp
|
|
|
|
|
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
|
|
|
|
|
[Nuget Package](https://www.nuget.org/packages/KubernetesClient/0.1.0-beta)
|
|
|
|
|
|
|
|
|
|
```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
|
|
|
|
|
|
|
|
|
|
## Prerequisities
|
|
|
|
|
|
|
|
|
|
* [OpenSSL](https://www.openssl.org/)
|
|
|
|
|
* For Linux/Mac:
|
|
|
|
|
* LibCurl built with OpenSSL (Mac: `brew install curl --with-nghttp2`)
|
2017-09-13 14:33:06 -07:00
|
|
|
* For Windows:
|
|
|
|
|
* The easiest option is to use [choco](https://chocolatey.org) `choco install openssl.light`
|
|
|
|
|
|
|
|
|
|
Make sure that the `openssl` executable is in your path, by running `openssl` before trying to use the library.
|
2017-08-09 16:49:45 -07:00
|
|
|
|
|
|
|
|
## 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
|
|
|
|
|
dotnet xunit
|
2017-09-13 14:33:06 -07:00
|
|
|
```
|