Add first version of generated client
This commit is contained in:
8
kubernetes/.gitignore
vendored
Normal file
8
kubernetes/.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.stack-work
|
||||||
|
src/highlight.js
|
||||||
|
src/style.css
|
||||||
|
dist
|
||||||
|
dist-newstyle
|
||||||
|
cabal.project.local
|
||||||
|
.cabal-sandbox
|
||||||
|
cabal.sandbox.config
|
||||||
23
kubernetes/.swagger-codegen-ignore
Normal file
23
kubernetes/.swagger-codegen-ignore
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Swagger Codegen Ignore
|
||||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
||||||
2
kubernetes/.swagger-codegen/COMMIT
Normal file
2
kubernetes/.swagger-codegen/COMMIT
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Requested Commit: 5b76151a874009605f5ac5d4e6dc1aaa389339ed
|
||||||
|
Actual Commit: 5b76151a874009605f5ac5d4e6dc1aaa389339ed
|
||||||
1
kubernetes/.swagger-codegen/VERSION
Normal file
1
kubernetes/.swagger-codegen/VERSION
Normal file
@@ -0,0 +1 @@
|
|||||||
|
2.3.0-SNAPSHOT
|
||||||
16
kubernetes/.travis.yml
Normal file
16
kubernetes/.travis.yml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
sudo: false
|
||||||
|
language: c
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libgmp-dev
|
||||||
|
before_install:
|
||||||
|
- mkdir -p ~/.local/bin
|
||||||
|
- export PATH=$HOME/.local/bin:$PATH
|
||||||
|
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||||
|
script:
|
||||||
|
- stack --install-ghc --no-haddock-deps haddock
|
||||||
|
- stack test
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.stack
|
||||||
196
kubernetes/README.md
Normal file
196
kubernetes/README.md
Normal file
@@ -0,0 +1,196 @@
|
|||||||
|
## Swagger Auto-Generated [http-client](https://www.stackage.org/lts-9.0/package/http-client-0.5.7.0) Bindings to `Kubernetes`
|
||||||
|
|
||||||
|
The library in `lib` provides auto-generated-from-Swagger [http-client](https://www.stackage.org/lts-9.0/package/http-client-0.5.7.0) bindings to the Kubernetes API.
|
||||||
|
|
||||||
|
Targeted swagger version: 2.0
|
||||||
|
|
||||||
|
OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Installation follows the standard approach to installing Stack-based projects.
|
||||||
|
|
||||||
|
1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README).
|
||||||
|
2. To build the package, and generate the documentation (recommended):
|
||||||
|
```
|
||||||
|
stack haddock
|
||||||
|
```
|
||||||
|
which will generate docs for this lib in the `docs` folder.
|
||||||
|
|
||||||
|
To generate the docs in the normal location (to enable hyperlinks to external libs), remove
|
||||||
|
```
|
||||||
|
build:
|
||||||
|
haddock-arguments:
|
||||||
|
haddock-args:
|
||||||
|
- "--odir=./docs"
|
||||||
|
```
|
||||||
|
from the stack.yaml file and run `stack haddock` again.
|
||||||
|
|
||||||
|
3. To run unit tests:
|
||||||
|
```
|
||||||
|
stack test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Swagger-Codegen
|
||||||
|
|
||||||
|
The code generator that produced this library, and which explains how
|
||||||
|
to obtain and use the swagger-codegen cli tool lives at
|
||||||
|
|
||||||
|
https://github.com/swagger-api/swagger-codegen
|
||||||
|
|
||||||
|
The _language_ argument (`--lang`) passed to the cli tool used should be
|
||||||
|
|
||||||
|
```
|
||||||
|
haskell-http-client
|
||||||
|
```
|
||||||
|
|
||||||
|
### Unsupported Swagger Features
|
||||||
|
|
||||||
|
* Model Inheritance
|
||||||
|
|
||||||
|
This is beta software; other cases may not be supported.
|
||||||
|
|
||||||
|
### Codegen "additional properties" parameters
|
||||||
|
|
||||||
|
These options allow some customization of the code generation process.
|
||||||
|
|
||||||
|
**haskell-http-client additional properties:**
|
||||||
|
|
||||||
|
| OPTION | DESCRIPTION | DEFAULT | ACTUAL |
|
||||||
|
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------- |
|
||||||
|
| allowFromJsonNulls | allow JSON Null during model decoding from JSON | true | true |
|
||||||
|
| allowToJsonNulls | allow emitting JSON Null during model encoding to JSON | false | false |
|
||||||
|
| dateFormat | format string used to parse/render a date | %Y-%m-%d | %Y-%m-%d |
|
||||||
|
| dateTimeFormat | format string used to parse/render a datetime. (Defaults to [formatISO8601Millis][1] when not provided) | | |
|
||||||
|
| generateEnums | Generate specific datatypes for swagger enums | true | true |
|
||||||
|
| generateFormUrlEncodedInstances | Generate FromForm/ToForm instances for models used by x-www-form-urlencoded operations (model fields must be primitive types) | true | true |
|
||||||
|
| generateLenses | Generate Lens optics for Models | true | true |
|
||||||
|
| generateModelConstructors | Generate smart constructors (only supply required fields) for models | true | true |
|
||||||
|
| inlineMimeTypes | Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option | false | false |
|
||||||
|
| modelDeriving | Additional classes to include in the deriving() clause of Models | | |
|
||||||
|
| strictFields | Add strictness annotations to all model fields | true | true |
|
||||||
|
| useMonadLogger | Use the monad-logger package to provide logging (if instead false, use the katip logging package) | false | false |
|
||||||
|
|
||||||
|
[1]: https://www.stackage.org/haddock/lts-9.0/iso8601-time-0.1.4/Data-Time-ISO8601.html#v:formatISO8601Millis
|
||||||
|
|
||||||
|
An example setting _strictFields_ and _dateTimeFormat_:
|
||||||
|
|
||||||
|
```
|
||||||
|
java -jar swagger-codegen-cli.jar generate -i petstore.yaml -l haskell-http-client -o output/haskell-http-client -DstrictFields=true -DdateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z"
|
||||||
|
```
|
||||||
|
|
||||||
|
View the full list of Codegen "config option" parameters with the command:
|
||||||
|
|
||||||
|
```
|
||||||
|
java -jar swagger-codegen-cli.jar config-help -l haskell-http-client
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage Notes
|
||||||
|
|
||||||
|
### Example SwaggerPetstore Haddock documentation
|
||||||
|
|
||||||
|
An example of the generated haddock documentation targeting the server http://petstore.swagger.io/ (SwaggerPetstore) can be found [here][2]
|
||||||
|
|
||||||
|
[2]: https://hackage.haskell.org/package/swagger-petstore
|
||||||
|
|
||||||
|
### Example SwaggerPetstore App
|
||||||
|
|
||||||
|
An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3]
|
||||||
|
|
||||||
|
[3]: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/haskell-http-client/example-app
|
||||||
|
|
||||||
|
This library is intended to be imported qualified.
|
||||||
|
|
||||||
|
### Modules
|
||||||
|
|
||||||
|
| MODULE | NOTES |
|
||||||
|
| ------------------- | --------------------------------------------------- |
|
||||||
|
| Kubernetes.Client | use the "dispatch" functions to send requests |
|
||||||
|
| Kubernetes.Core | core funcions, config and request types |
|
||||||
|
| Kubernetes.API | construct api requests |
|
||||||
|
| Kubernetes.Model | describes api models |
|
||||||
|
| Kubernetes.MimeTypes | encoding/decoding MIME types (content-types/accept) |
|
||||||
|
| Kubernetes.ModelLens | lenses for model fields |
|
||||||
|
| Kubernetes.Logging | logging functions and utils |
|
||||||
|
|
||||||
|
|
||||||
|
### MimeTypes
|
||||||
|
|
||||||
|
This library adds type safety around what swagger specifies as
|
||||||
|
Produces and Consumes for each Operation (e.g. the list of MIME types an
|
||||||
|
Operation can Produce (using 'accept' headers) and Consume (using 'content-type' headers).
|
||||||
|
|
||||||
|
For example, if there is an Operation named _addFoo_, there will be a
|
||||||
|
data type generated named _AddFoo_ (note the capitalization), which
|
||||||
|
describes additional constraints and actions on the _addFoo_ operation
|
||||||
|
via its typeclass instances. These typeclass instances can be viewed
|
||||||
|
in GHCi or via the Haddocks.
|
||||||
|
|
||||||
|
* required parameters are included as function arguments to _addFoo_
|
||||||
|
* optional non-body parameters are included by using `applyOptionalParam`
|
||||||
|
* optional body parameters are set by using `setBodyParam`
|
||||||
|
|
||||||
|
Example code generated for pretend _addFoo_ operation:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
data AddFoo
|
||||||
|
instance Consumes AddFoo MimeJSON
|
||||||
|
instance Produces AddFoo MimeJSON
|
||||||
|
instance Produces AddFoo MimeXML
|
||||||
|
instance HasBodyParam AddFoo FooModel
|
||||||
|
instance HasOptionalParam AddFoo FooName
|
||||||
|
instance HasOptionalParam AddFoo FooId
|
||||||
|
```
|
||||||
|
|
||||||
|
this would indicate that:
|
||||||
|
|
||||||
|
* the _addFoo_ operation can consume JSON
|
||||||
|
* the _addFoo_ operation produces JSON or XML, depending on the argument passed to the dispatch function
|
||||||
|
* the _addFoo_ operation can set it's body param of _FooModel_ via `setBodyParam`
|
||||||
|
* the _addFoo_ operation can set 2 different optional parameters via `applyOptionalParam`
|
||||||
|
|
||||||
|
If the swagger spec doesn't declare it can accept or produce a certain
|
||||||
|
MIME type for a given Operation, you should either add a Produces or
|
||||||
|
Consumes instance for the desired MIME types (assuming the server
|
||||||
|
supports it), use `dispatchLbsUnsafe` or modify the swagger spec and
|
||||||
|
run the generator again.
|
||||||
|
|
||||||
|
New MIME type instances can be added via MimeType/MimeRender/MimeUnrender
|
||||||
|
|
||||||
|
Only JSON instances are generated by default, and in some case
|
||||||
|
x-www-form-urlencoded instances (FromFrom, ToForm) will also be
|
||||||
|
generated if the model fields are primitive types, and there are
|
||||||
|
Operations using x-www-form-urlencoded which use those models.
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
A haskell data type will be generated for each swagger authentication type.
|
||||||
|
|
||||||
|
If for example the AuthMethod `AuthOAuthFoo` is generated for OAuth operations, then
|
||||||
|
`addAuthMethod` should be used to add the AuthMethod config.
|
||||||
|
|
||||||
|
When a request is dispatched, if a matching auth method is found in
|
||||||
|
the config, it will be applied to the request.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
mgr <- newManager defaultManagerSettings
|
||||||
|
config0 <- withStdoutLogging =<< newConfig
|
||||||
|
let config = config0
|
||||||
|
`addAuthMethod` AuthOAuthFoo "secret-key"
|
||||||
|
|
||||||
|
let addFooRequest =
|
||||||
|
addFoo
|
||||||
|
(ContentType MimeJSON)
|
||||||
|
(Accept MimeXML)
|
||||||
|
(ParamBar paramBar)
|
||||||
|
(ParamQux paramQux)
|
||||||
|
modelBaz
|
||||||
|
`applyOptionalParam` FooId 1
|
||||||
|
`applyOptionalParam` FooName "name"
|
||||||
|
`setHeader` [("qux_header","xxyy")]
|
||||||
|
addFooResult <- dispatchMime mgr config addFooRequest
|
||||||
|
```
|
||||||
|
|
||||||
|
See the example app and the haddocks for details.
|
||||||
2
kubernetes/Setup.hs
Normal file
2
kubernetes/Setup.hs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import Distribution.Simple
|
||||||
|
main = defaultMain
|
||||||
52
kubernetes/git_push.sh
Normal file
52
kubernetes/git_push.sh
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
|
#
|
||||||
|
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||||
|
|
||||||
|
git_user_id=$1
|
||||||
|
git_repo_id=$2
|
||||||
|
release_note=$3
|
||||||
|
|
||||||
|
if [ "$git_user_id" = "" ]; then
|
||||||
|
git_user_id="GIT_USER_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$git_repo_id" = "" ]; then
|
||||||
|
git_repo_id="GIT_REPO_ID"
|
||||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$release_note" = "" ]; then
|
||||||
|
release_note="Minor update"
|
||||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Initialize the local directory as a Git repository
|
||||||
|
git init
|
||||||
|
|
||||||
|
# Adds the files in the local repository and stages them for commit.
|
||||||
|
git add .
|
||||||
|
|
||||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||||
|
git commit -m "$release_note"
|
||||||
|
|
||||||
|
# Sets the new remote
|
||||||
|
git_remote=`git remote`
|
||||||
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
else
|
||||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
git pull origin master
|
||||||
|
|
||||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||||
|
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
||||||
|
git push origin master 2>&1 | grep -v 'To https'
|
||||||
|
|
||||||
99
kubernetes/kubernetes.cabal
Normal file
99
kubernetes/kubernetes.cabal
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
name: kubernetes
|
||||||
|
version: 0.1.0.0
|
||||||
|
synopsis: Auto-generated kubernetes API Client
|
||||||
|
description: .
|
||||||
|
Client library for calling the kubernetes API based on http-client.
|
||||||
|
.
|
||||||
|
host:
|
||||||
|
.
|
||||||
|
base path: https://localhost
|
||||||
|
.
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
.
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
.
|
||||||
|
OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
||||||
|
.
|
||||||
|
category: Web
|
||||||
|
homepage: https://github.com/swagger-api/swagger-codegen#readme
|
||||||
|
author: Author Name Here
|
||||||
|
maintainer: author.name@email.com
|
||||||
|
copyright: YEAR - AUTHOR
|
||||||
|
license: UnspecifiedLicense
|
||||||
|
build-type: Simple
|
||||||
|
cabal-version: >= 1.10
|
||||||
|
|
||||||
|
extra-source-files:
|
||||||
|
README.md
|
||||||
|
swagger.yaml
|
||||||
|
|
||||||
|
library
|
||||||
|
hs-source-dirs:
|
||||||
|
lib
|
||||||
|
ghc-options: -Wall -funbox-strict-fields
|
||||||
|
build-depends:
|
||||||
|
base >=4.7 && <5.0
|
||||||
|
, transformers >=0.4.0.0
|
||||||
|
, mtl >=2.2.1
|
||||||
|
, unordered-containers
|
||||||
|
, aeson >=1.0 && <2.0
|
||||||
|
, bytestring >=0.10.0 && <0.11
|
||||||
|
, base64-bytestring >1.0 && <2.0
|
||||||
|
, containers >=0.5.0.0 && <0.6
|
||||||
|
, http-types >=0.8 && <0.11
|
||||||
|
, http-client >=0.5 && <0.6
|
||||||
|
, http-client-tls
|
||||||
|
, http-api-data >= 0.3.4 && <0.4
|
||||||
|
, http-media >= 0.4 && < 0.8
|
||||||
|
, text >=0.11 && <1.3
|
||||||
|
, time >=1.5 && <1.9
|
||||||
|
, iso8601-time >=0.1.3 && <0.2.0
|
||||||
|
, vector >=0.10.9 && <0.13
|
||||||
|
, network >=2.6.2 && <2.7
|
||||||
|
, random >=1.1
|
||||||
|
, exceptions >= 0.4
|
||||||
|
, katip >=0.4 && < 0.6
|
||||||
|
, safe-exceptions <0.2
|
||||||
|
, case-insensitive
|
||||||
|
, microlens >= 0.4.3 && <0.5
|
||||||
|
, deepseq >= 1.4 && <1.6
|
||||||
|
exposed-modules:
|
||||||
|
Kubernetes
|
||||||
|
Kubernetes.API
|
||||||
|
Kubernetes.Client
|
||||||
|
Kubernetes.Core
|
||||||
|
Kubernetes.Logging
|
||||||
|
Kubernetes.MimeTypes
|
||||||
|
Kubernetes.Model
|
||||||
|
Kubernetes.ModelLens
|
||||||
|
other-modules:
|
||||||
|
Paths_kubernetes
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
test-suite tests
|
||||||
|
type: exitcode-stdio-1.0
|
||||||
|
main-is: Test.hs
|
||||||
|
hs-source-dirs:
|
||||||
|
tests
|
||||||
|
ghc-options: -Wall -fno-warn-orphans
|
||||||
|
build-depends:
|
||||||
|
base >=4.7 && <5.0
|
||||||
|
, transformers >=0.4.0.0
|
||||||
|
, mtl >=2.2.1
|
||||||
|
, unordered-containers
|
||||||
|
, kubernetes
|
||||||
|
, bytestring >=0.10.0 && <0.11
|
||||||
|
, containers
|
||||||
|
, hspec >=1.8
|
||||||
|
, text
|
||||||
|
, time
|
||||||
|
, iso8601-time
|
||||||
|
, aeson
|
||||||
|
, vector
|
||||||
|
, semigroups
|
||||||
|
, QuickCheck
|
||||||
|
other-modules:
|
||||||
|
ApproxEq
|
||||||
|
Instances
|
||||||
|
PropMime
|
||||||
|
default-language: Haskell2010
|
||||||
31
kubernetes/lib/Kubernetes.hs
Normal file
31
kubernetes/lib/Kubernetes.hs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{-
|
||||||
|
Kubernetes
|
||||||
|
|
||||||
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||||
|
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-|
|
||||||
|
Module : Kubernetes
|
||||||
|
-}
|
||||||
|
|
||||||
|
module Kubernetes
|
||||||
|
( module Kubernetes.API
|
||||||
|
, module Kubernetes.Client
|
||||||
|
, module Kubernetes.Core
|
||||||
|
, module Kubernetes.Logging
|
||||||
|
, module Kubernetes.MimeTypes
|
||||||
|
, module Kubernetes.Model
|
||||||
|
, module Kubernetes.ModelLens
|
||||||
|
) where
|
||||||
|
|
||||||
|
import Kubernetes.API
|
||||||
|
import Kubernetes.Client
|
||||||
|
import Kubernetes.Core
|
||||||
|
import Kubernetes.Logging
|
||||||
|
import Kubernetes.MimeTypes
|
||||||
|
import Kubernetes.Model
|
||||||
|
import Kubernetes.ModelLens
|
||||||
38133
kubernetes/lib/Kubernetes/API.hs
Normal file
38133
kubernetes/lib/Kubernetes/API.hs
Normal file
File diff suppressed because it is too large
Load Diff
217
kubernetes/lib/Kubernetes/Client.hs
Normal file
217
kubernetes/lib/Kubernetes/Client.hs
Normal file
@@ -0,0 +1,217 @@
|
|||||||
|
{-
|
||||||
|
Kubernetes
|
||||||
|
|
||||||
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||||
|
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-|
|
||||||
|
Module : Kubernetes.Client
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE DeriveFunctor #-}
|
||||||
|
{-# LANGUAGE DeriveFoldable #-}
|
||||||
|
{-# LANGUAGE DeriveTraversable #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
|
||||||
|
|
||||||
|
module Kubernetes.Client where
|
||||||
|
|
||||||
|
import Kubernetes.Core
|
||||||
|
import Kubernetes.Logging
|
||||||
|
import Kubernetes.MimeTypes
|
||||||
|
|
||||||
|
import qualified Control.Exception.Safe as E
|
||||||
|
import qualified Control.Monad.IO.Class as P
|
||||||
|
import qualified Control.Monad as P
|
||||||
|
import qualified Data.Aeson.Types as A
|
||||||
|
import qualified Data.ByteString.Char8 as BC
|
||||||
|
import qualified Data.ByteString.Lazy as BL
|
||||||
|
import qualified Data.ByteString.Lazy.Char8 as BCL
|
||||||
|
import qualified Data.Proxy as P (Proxy(..))
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import qualified Data.Text.Encoding as T
|
||||||
|
import qualified Network.HTTP.Client as NH
|
||||||
|
import qualified Network.HTTP.Client.MultipartFormData as NH
|
||||||
|
import qualified Network.HTTP.Types as NH
|
||||||
|
import qualified Web.FormUrlEncoded as WH
|
||||||
|
import qualified Web.HttpApiData as WH
|
||||||
|
|
||||||
|
import Data.Function ((&))
|
||||||
|
import Data.Monoid ((<>))
|
||||||
|
import Data.Text (Text)
|
||||||
|
import GHC.Exts (IsString(..))
|
||||||
|
|
||||||
|
-- * Dispatch
|
||||||
|
|
||||||
|
-- ** Lbs
|
||||||
|
|
||||||
|
-- | send a request returning the raw http response
|
||||||
|
dispatchLbs
|
||||||
|
:: (Produces req accept, MimeType contentType)
|
||||||
|
=> NH.Manager -- ^ http-client Connection manager
|
||||||
|
-> KubernetesConfig -- ^ config
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ request
|
||||||
|
-> IO (NH.Response BCL.ByteString) -- ^ response
|
||||||
|
dispatchLbs manager config request = do
|
||||||
|
initReq <- _toInitRequest config request
|
||||||
|
dispatchInitUnsafe manager config initReq
|
||||||
|
|
||||||
|
-- ** Mime
|
||||||
|
|
||||||
|
-- | pair of decoded http body and http response
|
||||||
|
data MimeResult res =
|
||||||
|
MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body
|
||||||
|
, mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response
|
||||||
|
}
|
||||||
|
deriving (Show, Functor, Foldable, Traversable)
|
||||||
|
|
||||||
|
-- | pair of unrender/parser error and http response
|
||||||
|
data MimeError =
|
||||||
|
MimeError {
|
||||||
|
mimeError :: String -- ^ unrender/parser error
|
||||||
|
, mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response
|
||||||
|
} deriving (Eq, Show)
|
||||||
|
|
||||||
|
-- | send a request returning the 'MimeResult'
|
||||||
|
dispatchMime
|
||||||
|
:: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType)
|
||||||
|
=> NH.Manager -- ^ http-client Connection manager
|
||||||
|
-> KubernetesConfig -- ^ config
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ request
|
||||||
|
-> IO (MimeResult res) -- ^ response
|
||||||
|
dispatchMime manager config request = do
|
||||||
|
httpResponse <- dispatchLbs manager config request
|
||||||
|
let statusCode = NH.statusCode . NH.responseStatus $ httpResponse
|
||||||
|
parsedResult <-
|
||||||
|
runConfigLogWithExceptions "Client" config $
|
||||||
|
do if (statusCode >= 400 && statusCode < 600)
|
||||||
|
then do
|
||||||
|
let s = "error statusCode: " ++ show statusCode
|
||||||
|
_log "Client" levelError (T.pack s)
|
||||||
|
pure (Left (MimeError s httpResponse))
|
||||||
|
else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of
|
||||||
|
Left s -> do
|
||||||
|
_log "Client" levelError (T.pack s)
|
||||||
|
pure (Left (MimeError s httpResponse))
|
||||||
|
Right r -> pure (Right r)
|
||||||
|
return (MimeResult parsedResult httpResponse)
|
||||||
|
|
||||||
|
-- | like 'dispatchMime', but only returns the decoded http body
|
||||||
|
dispatchMime'
|
||||||
|
:: (Produces req accept, MimeUnrender accept res, MimeType contentType)
|
||||||
|
=> NH.Manager -- ^ http-client Connection manager
|
||||||
|
-> KubernetesConfig -- ^ config
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ request
|
||||||
|
-> IO (Either MimeError res) -- ^ response
|
||||||
|
dispatchMime' manager config request = do
|
||||||
|
MimeResult parsedResult _ <- dispatchMime manager config request
|
||||||
|
return parsedResult
|
||||||
|
|
||||||
|
-- ** Unsafe
|
||||||
|
|
||||||
|
-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented)
|
||||||
|
dispatchLbsUnsafe
|
||||||
|
:: (MimeType accept, MimeType contentType)
|
||||||
|
=> NH.Manager -- ^ http-client Connection manager
|
||||||
|
-> KubernetesConfig -- ^ config
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ request
|
||||||
|
-> IO (NH.Response BCL.ByteString) -- ^ response
|
||||||
|
dispatchLbsUnsafe manager config request = do
|
||||||
|
initReq <- _toInitRequest config request
|
||||||
|
dispatchInitUnsafe manager config initReq
|
||||||
|
|
||||||
|
-- | dispatch an InitRequest
|
||||||
|
dispatchInitUnsafe
|
||||||
|
:: NH.Manager -- ^ http-client Connection manager
|
||||||
|
-> KubernetesConfig -- ^ config
|
||||||
|
-> InitRequest req contentType res accept -- ^ init request
|
||||||
|
-> IO (NH.Response BCL.ByteString) -- ^ response
|
||||||
|
dispatchInitUnsafe manager config (InitRequest req) = do
|
||||||
|
runConfigLogWithExceptions src config $
|
||||||
|
do _log src levelInfo requestLogMsg
|
||||||
|
_log src levelDebug requestDbgLogMsg
|
||||||
|
res <- P.liftIO $ NH.httpLbs req manager
|
||||||
|
_log src levelInfo (responseLogMsg res)
|
||||||
|
_log src levelDebug ((T.pack . show) res)
|
||||||
|
return res
|
||||||
|
where
|
||||||
|
src = "Client"
|
||||||
|
endpoint =
|
||||||
|
T.pack $
|
||||||
|
BC.unpack $
|
||||||
|
NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req
|
||||||
|
requestLogMsg = "REQ:" <> endpoint
|
||||||
|
requestDbgLogMsg =
|
||||||
|
"Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <>
|
||||||
|
(case NH.requestBody req of
|
||||||
|
NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs)
|
||||||
|
_ -> "<RequestBody>")
|
||||||
|
responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus
|
||||||
|
responseLogMsg res =
|
||||||
|
"RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")"
|
||||||
|
|
||||||
|
-- * InitRequest
|
||||||
|
|
||||||
|
-- | wraps an http-client 'Request' with request/response type parameters
|
||||||
|
newtype InitRequest req contentType res accept = InitRequest
|
||||||
|
{ unInitRequest :: NH.Request
|
||||||
|
} deriving (Show)
|
||||||
|
|
||||||
|
-- | Build an http-client 'Request' record from the supplied config and request
|
||||||
|
_toInitRequest
|
||||||
|
:: (MimeType accept, MimeType contentType)
|
||||||
|
=> KubernetesConfig -- ^ config
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ request
|
||||||
|
-> IO (InitRequest req contentType res accept) -- ^ initialized request
|
||||||
|
_toInitRequest config req0 =
|
||||||
|
runConfigLogWithExceptions "Client" config $ do
|
||||||
|
parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0))
|
||||||
|
req1 <- P.liftIO $ _applyAuthMethods req0 config
|
||||||
|
P.when
|
||||||
|
(configValidateAuthMethods config && (not . null . rAuthTypes) req1)
|
||||||
|
(E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1)
|
||||||
|
let req2 = req1 & _setContentTypeHeader & _setAcceptHeader
|
||||||
|
reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2)
|
||||||
|
reqQuery = NH.renderQuery True (paramsQuery (rParams req2))
|
||||||
|
pReq = parsedReq { NH.method = (rMethod req2)
|
||||||
|
, NH.requestHeaders = reqHeaders
|
||||||
|
, NH.queryString = reqQuery
|
||||||
|
}
|
||||||
|
outReq <- case paramsBody (rParams req2) of
|
||||||
|
ParamBodyNone -> pure (pReq { NH.requestBody = mempty })
|
||||||
|
ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs })
|
||||||
|
ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl })
|
||||||
|
ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) })
|
||||||
|
ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq
|
||||||
|
|
||||||
|
pure (InitRequest outReq)
|
||||||
|
|
||||||
|
-- | modify the underlying Request
|
||||||
|
modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept
|
||||||
|
modifyInitRequest (InitRequest req) f = InitRequest (f req)
|
||||||
|
|
||||||
|
-- | modify the underlying Request (monadic)
|
||||||
|
modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept)
|
||||||
|
modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req)
|
||||||
|
|
||||||
|
-- ** Logging
|
||||||
|
|
||||||
|
-- | Run a block using the configured logger instance
|
||||||
|
runConfigLog
|
||||||
|
:: P.MonadIO m
|
||||||
|
=> KubernetesConfig -> LogExec m
|
||||||
|
runConfigLog config = configLogExecWithContext config (configLogContext config)
|
||||||
|
|
||||||
|
-- | Run a block using the configured logger instance (logs exceptions)
|
||||||
|
runConfigLogWithExceptions
|
||||||
|
:: (E.MonadCatch m, P.MonadIO m)
|
||||||
|
=> T.Text -> KubernetesConfig -> LogExec m
|
||||||
|
runConfigLogWithExceptions src config = runConfigLog config . logExceptions src
|
||||||
544
kubernetes/lib/Kubernetes/Core.hs
Normal file
544
kubernetes/lib/Kubernetes/Core.hs
Normal file
@@ -0,0 +1,544 @@
|
|||||||
|
{-
|
||||||
|
Kubernetes
|
||||||
|
|
||||||
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||||
|
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-|
|
||||||
|
Module : Kubernetes.Core
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE DeriveDataTypeable #-}
|
||||||
|
{-# LANGUAGE ExistentialQuantification #-}
|
||||||
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||||
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
|
{-# LANGUAGE NamedFieldPuns #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE TupleSections #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds #-}
|
||||||
|
|
||||||
|
module Kubernetes.Core where
|
||||||
|
|
||||||
|
import Kubernetes.MimeTypes
|
||||||
|
import Kubernetes.Logging
|
||||||
|
|
||||||
|
import qualified Control.Arrow as P (left)
|
||||||
|
import qualified Control.DeepSeq as NF
|
||||||
|
import qualified Control.Exception.Safe as E
|
||||||
|
import qualified Data.Aeson as A
|
||||||
|
import qualified Data.ByteString as B
|
||||||
|
import qualified Data.ByteString.Base64.Lazy as BL64
|
||||||
|
import qualified Data.ByteString.Builder as BB
|
||||||
|
import qualified Data.ByteString.Char8 as BC
|
||||||
|
import qualified Data.ByteString.Lazy as BL
|
||||||
|
import qualified Data.ByteString.Lazy.Char8 as BCL
|
||||||
|
import qualified Data.CaseInsensitive as CI
|
||||||
|
import qualified Data.Data as P (Data, Typeable, TypeRep, typeRep)
|
||||||
|
import qualified Data.Foldable as P
|
||||||
|
import qualified Data.Ix as P
|
||||||
|
import qualified Data.Maybe as P
|
||||||
|
import qualified Data.Proxy as P (Proxy(..))
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import qualified Data.Text.Encoding as T
|
||||||
|
import qualified Data.Time as TI
|
||||||
|
import qualified Data.Time.ISO8601 as TI
|
||||||
|
import qualified GHC.Base as P (Alternative)
|
||||||
|
import qualified Lens.Micro as L
|
||||||
|
import qualified Network.HTTP.Client.MultipartFormData as NH
|
||||||
|
import qualified Network.HTTP.Types as NH
|
||||||
|
import qualified Prelude as P
|
||||||
|
import qualified Web.FormUrlEncoded as WH
|
||||||
|
import qualified Web.HttpApiData as WH
|
||||||
|
import qualified Text.Printf as T
|
||||||
|
|
||||||
|
import Control.Applicative ((<|>))
|
||||||
|
import Control.Applicative (Alternative)
|
||||||
|
import Data.Function ((&))
|
||||||
|
import Data.Foldable(foldlM)
|
||||||
|
import Data.Monoid ((<>))
|
||||||
|
import Data.Text (Text)
|
||||||
|
import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, mempty, pure, return, show, IO, Monad, Functor)
|
||||||
|
|
||||||
|
-- * KubernetesConfig
|
||||||
|
|
||||||
|
-- |
|
||||||
|
data KubernetesConfig = KubernetesConfig
|
||||||
|
{ configHost :: BCL.ByteString -- ^ host supplied in the Request
|
||||||
|
, configUserAgent :: Text -- ^ user-agent supplied in the Request
|
||||||
|
, configLogExecWithContext :: LogExecWithContext -- ^ Run a block using a Logger instance
|
||||||
|
, configLogContext :: LogContext -- ^ Configures the logger
|
||||||
|
, configAuthMethods :: [AnyAuthMethod] -- ^ List of configured auth methods
|
||||||
|
, configValidateAuthMethods :: Bool -- ^ throw exceptions if auth methods are not configured
|
||||||
|
}
|
||||||
|
|
||||||
|
-- | display the config
|
||||||
|
instance P.Show KubernetesConfig where
|
||||||
|
show c =
|
||||||
|
T.printf
|
||||||
|
"{ configHost = %v, configUserAgent = %v, ..}"
|
||||||
|
(show (configHost c))
|
||||||
|
(show (configUserAgent c))
|
||||||
|
|
||||||
|
-- | constructs a default KubernetesConfig
|
||||||
|
--
|
||||||
|
-- configHost:
|
||||||
|
--
|
||||||
|
-- @https://localhost@
|
||||||
|
--
|
||||||
|
-- configUserAgent:
|
||||||
|
--
|
||||||
|
-- @"swagger-haskell-http-client/1.0.0"@
|
||||||
|
--
|
||||||
|
newConfig :: IO KubernetesConfig
|
||||||
|
newConfig = do
|
||||||
|
logCxt <- initLogContext
|
||||||
|
return $ KubernetesConfig
|
||||||
|
{ configHost = "https://localhost"
|
||||||
|
, configUserAgent = "swagger-haskell-http-client/1.0.0"
|
||||||
|
, configLogExecWithContext = runDefaultLogExecWithContext
|
||||||
|
, configLogContext = logCxt
|
||||||
|
, configAuthMethods = []
|
||||||
|
, configValidateAuthMethods = True
|
||||||
|
}
|
||||||
|
|
||||||
|
-- | updates config use AuthMethod on matching requests
|
||||||
|
addAuthMethod :: AuthMethod auth => KubernetesConfig -> auth -> KubernetesConfig
|
||||||
|
addAuthMethod config@KubernetesConfig {configAuthMethods = as} a =
|
||||||
|
config { configAuthMethods = AnyAuthMethod a : as}
|
||||||
|
|
||||||
|
-- | updates the config to use stdout logging
|
||||||
|
withStdoutLogging :: KubernetesConfig -> IO KubernetesConfig
|
||||||
|
withStdoutLogging p = do
|
||||||
|
logCxt <- stdoutLoggingContext (configLogContext p)
|
||||||
|
return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt }
|
||||||
|
|
||||||
|
-- | updates the config to use stderr logging
|
||||||
|
withStderrLogging :: KubernetesConfig -> IO KubernetesConfig
|
||||||
|
withStderrLogging p = do
|
||||||
|
logCxt <- stderrLoggingContext (configLogContext p)
|
||||||
|
return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt }
|
||||||
|
|
||||||
|
-- | updates the config to disable logging
|
||||||
|
withNoLogging :: KubernetesConfig -> KubernetesConfig
|
||||||
|
withNoLogging p = p { configLogExecWithContext = runNullLogExec}
|
||||||
|
|
||||||
|
-- * KubernetesRequest
|
||||||
|
|
||||||
|
-- | Represents a request.
|
||||||
|
--
|
||||||
|
-- Type Variables:
|
||||||
|
--
|
||||||
|
-- * req - request operation
|
||||||
|
-- * contentType - 'MimeType' associated with request body
|
||||||
|
-- * res - response model
|
||||||
|
-- * accept - 'MimeType' associated with response body
|
||||||
|
data KubernetesRequest req contentType res accept = KubernetesRequest
|
||||||
|
{ rMethod :: NH.Method -- ^ Method of KubernetesRequest
|
||||||
|
, rUrlPath :: [BCL.ByteString] -- ^ Endpoint of KubernetesRequest
|
||||||
|
, rParams :: Params -- ^ params of KubernetesRequest
|
||||||
|
, rAuthTypes :: [P.TypeRep] -- ^ types of auth methods
|
||||||
|
}
|
||||||
|
deriving (P.Show)
|
||||||
|
|
||||||
|
-- | 'rMethod' Lens
|
||||||
|
rMethodL :: Lens_' (KubernetesRequest req contentType res accept) NH.Method
|
||||||
|
rMethodL f KubernetesRequest{..} = (\rMethod -> KubernetesRequest { rMethod, ..} ) <$> f rMethod
|
||||||
|
{-# INLINE rMethodL #-}
|
||||||
|
|
||||||
|
-- | 'rUrlPath' Lens
|
||||||
|
rUrlPathL :: Lens_' (KubernetesRequest req contentType res accept) [BCL.ByteString]
|
||||||
|
rUrlPathL f KubernetesRequest{..} = (\rUrlPath -> KubernetesRequest { rUrlPath, ..} ) <$> f rUrlPath
|
||||||
|
{-# INLINE rUrlPathL #-}
|
||||||
|
|
||||||
|
-- | 'rParams' Lens
|
||||||
|
rParamsL :: Lens_' (KubernetesRequest req contentType res accept) Params
|
||||||
|
rParamsL f KubernetesRequest{..} = (\rParams -> KubernetesRequest { rParams, ..} ) <$> f rParams
|
||||||
|
{-# INLINE rParamsL #-}
|
||||||
|
|
||||||
|
-- | 'rParams' Lens
|
||||||
|
rAuthTypesL :: Lens_' (KubernetesRequest req contentType res accept) [P.TypeRep]
|
||||||
|
rAuthTypesL f KubernetesRequest{..} = (\rAuthTypes -> KubernetesRequest { rAuthTypes, ..} ) <$> f rAuthTypes
|
||||||
|
{-# INLINE rAuthTypesL #-}
|
||||||
|
|
||||||
|
-- * HasBodyParam
|
||||||
|
|
||||||
|
-- | Designates the body parameter of a request
|
||||||
|
class HasBodyParam req param where
|
||||||
|
setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => KubernetesRequest req contentType res accept -> param -> KubernetesRequest req contentType res accept
|
||||||
|
setBodyParam req xs =
|
||||||
|
req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader
|
||||||
|
|
||||||
|
-- * HasOptionalParam
|
||||||
|
|
||||||
|
-- | Designates the optional parameters of a request
|
||||||
|
class HasOptionalParam req param where
|
||||||
|
{-# MINIMAL applyOptionalParam | (-&-) #-}
|
||||||
|
|
||||||
|
-- | Apply an optional parameter to a request
|
||||||
|
applyOptionalParam :: KubernetesRequest req contentType res accept -> param -> KubernetesRequest req contentType res accept
|
||||||
|
applyOptionalParam = (-&-)
|
||||||
|
{-# INLINE applyOptionalParam #-}
|
||||||
|
|
||||||
|
-- | infix operator \/ alias for 'addOptionalParam'
|
||||||
|
(-&-) :: KubernetesRequest req contentType res accept -> param -> KubernetesRequest req contentType res accept
|
||||||
|
(-&-) = applyOptionalParam
|
||||||
|
{-# INLINE (-&-) #-}
|
||||||
|
|
||||||
|
infixl 2 -&-
|
||||||
|
|
||||||
|
-- | Request Params
|
||||||
|
data Params = Params
|
||||||
|
{ paramsQuery :: NH.Query
|
||||||
|
, paramsHeaders :: NH.RequestHeaders
|
||||||
|
, paramsBody :: ParamBody
|
||||||
|
}
|
||||||
|
deriving (P.Show)
|
||||||
|
|
||||||
|
-- | 'paramsQuery' Lens
|
||||||
|
paramsQueryL :: Lens_' Params NH.Query
|
||||||
|
paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery
|
||||||
|
{-# INLINE paramsQueryL #-}
|
||||||
|
|
||||||
|
-- | 'paramsHeaders' Lens
|
||||||
|
paramsHeadersL :: Lens_' Params NH.RequestHeaders
|
||||||
|
paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders
|
||||||
|
{-# INLINE paramsHeadersL #-}
|
||||||
|
|
||||||
|
-- | 'paramsBody' Lens
|
||||||
|
paramsBodyL :: Lens_' Params ParamBody
|
||||||
|
paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody
|
||||||
|
{-# INLINE paramsBodyL #-}
|
||||||
|
|
||||||
|
-- | Request Body
|
||||||
|
data ParamBody
|
||||||
|
= ParamBodyNone
|
||||||
|
| ParamBodyB B.ByteString
|
||||||
|
| ParamBodyBL BL.ByteString
|
||||||
|
| ParamBodyFormUrlEncoded WH.Form
|
||||||
|
| ParamBodyMultipartFormData [NH.Part]
|
||||||
|
deriving (P.Show)
|
||||||
|
|
||||||
|
-- ** KubernetesRequest Utils
|
||||||
|
|
||||||
|
_mkRequest :: NH.Method -- ^ Method
|
||||||
|
-> [BCL.ByteString] -- ^ Endpoint
|
||||||
|
-> KubernetesRequest req contentType res accept -- ^ req: Request Type, res: Response Type
|
||||||
|
_mkRequest m u = KubernetesRequest m u _mkParams []
|
||||||
|
|
||||||
|
_mkParams :: Params
|
||||||
|
_mkParams = Params [] [] ParamBodyNone
|
||||||
|
|
||||||
|
setHeader :: KubernetesRequest req contentType res accept -> [NH.Header] -> KubernetesRequest req contentType res accept
|
||||||
|
setHeader req header =
|
||||||
|
req `removeHeader` P.fmap P.fst header &
|
||||||
|
L.over (rParamsL . paramsHeadersL) (header P.++)
|
||||||
|
|
||||||
|
removeHeader :: KubernetesRequest req contentType res accept -> [NH.HeaderName] -> KubernetesRequest req contentType res accept
|
||||||
|
removeHeader req header =
|
||||||
|
req &
|
||||||
|
L.over
|
||||||
|
(rParamsL . paramsHeadersL)
|
||||||
|
(P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header))
|
||||||
|
where
|
||||||
|
cifst = CI.mk . P.fst
|
||||||
|
|
||||||
|
|
||||||
|
_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => KubernetesRequest req contentType res accept -> KubernetesRequest req contentType res accept
|
||||||
|
_setContentTypeHeader req =
|
||||||
|
case mimeType (P.Proxy :: P.Proxy contentType) of
|
||||||
|
Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)]
|
||||||
|
Nothing -> req `removeHeader` ["content-type"]
|
||||||
|
|
||||||
|
_setAcceptHeader :: forall req contentType res accept. MimeType accept => KubernetesRequest req contentType res accept -> KubernetesRequest req contentType res accept
|
||||||
|
_setAcceptHeader req =
|
||||||
|
case mimeType (P.Proxy :: P.Proxy accept) of
|
||||||
|
Just m -> req `setHeader` [("accept", BC.pack $ P.show m)]
|
||||||
|
Nothing -> req `removeHeader` ["accept"]
|
||||||
|
|
||||||
|
setQuery :: KubernetesRequest req contentType res accept -> [NH.QueryItem] -> KubernetesRequest req contentType res accept
|
||||||
|
setQuery req query =
|
||||||
|
req &
|
||||||
|
L.over
|
||||||
|
(rParamsL . paramsQueryL)
|
||||||
|
((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query))
|
||||||
|
where
|
||||||
|
cifst = CI.mk . P.fst
|
||||||
|
|
||||||
|
addForm :: KubernetesRequest req contentType res accept -> WH.Form -> KubernetesRequest req contentType res accept
|
||||||
|
addForm req newform =
|
||||||
|
let form = case paramsBody (rParams req) of
|
||||||
|
ParamBodyFormUrlEncoded _form -> _form
|
||||||
|
_ -> mempty
|
||||||
|
in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form))
|
||||||
|
|
||||||
|
_addMultiFormPart :: KubernetesRequest req contentType res accept -> NH.Part -> KubernetesRequest req contentType res accept
|
||||||
|
_addMultiFormPart req newpart =
|
||||||
|
let parts = case paramsBody (rParams req) of
|
||||||
|
ParamBodyMultipartFormData _parts -> _parts
|
||||||
|
_ -> []
|
||||||
|
in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts))
|
||||||
|
|
||||||
|
_setBodyBS :: KubernetesRequest req contentType res accept -> B.ByteString -> KubernetesRequest req contentType res accept
|
||||||
|
_setBodyBS req body =
|
||||||
|
req & L.set (rParamsL . paramsBodyL) (ParamBodyB body)
|
||||||
|
|
||||||
|
_setBodyLBS :: KubernetesRequest req contentType res accept -> BL.ByteString -> KubernetesRequest req contentType res accept
|
||||||
|
_setBodyLBS req body =
|
||||||
|
req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body)
|
||||||
|
|
||||||
|
_hasAuthType :: AuthMethod authMethod => KubernetesRequest req contentType res accept -> P.Proxy authMethod -> KubernetesRequest req contentType res accept
|
||||||
|
_hasAuthType req proxy =
|
||||||
|
req & L.over rAuthTypesL (P.typeRep proxy :)
|
||||||
|
|
||||||
|
-- ** Params Utils
|
||||||
|
|
||||||
|
toPath
|
||||||
|
:: WH.ToHttpApiData a
|
||||||
|
=> a -> BCL.ByteString
|
||||||
|
toPath = BB.toLazyByteString . WH.toEncodedUrlPiece
|
||||||
|
|
||||||
|
toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header]
|
||||||
|
toHeader x = [fmap WH.toHeader x]
|
||||||
|
|
||||||
|
toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form
|
||||||
|
toForm (k,v) = WH.toForm [(BC.unpack k,v)]
|
||||||
|
|
||||||
|
toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem]
|
||||||
|
toQuery x = [(fmap . fmap) toQueryParam x]
|
||||||
|
where toQueryParam = T.encodeUtf8 . WH.toQueryParam
|
||||||
|
|
||||||
|
-- *** Swagger `CollectionFormat` Utils
|
||||||
|
|
||||||
|
-- | Determines the format of the array if type array is used.
|
||||||
|
data CollectionFormat
|
||||||
|
= CommaSeparated -- ^ CSV format for multiple parameters.
|
||||||
|
| SpaceSeparated -- ^ Also called "SSV"
|
||||||
|
| TabSeparated -- ^ Also called "TSV"
|
||||||
|
| PipeSeparated -- ^ `value1|value2|value2`
|
||||||
|
| MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form')
|
||||||
|
|
||||||
|
toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header]
|
||||||
|
toHeaderColl c xs = _toColl c toHeader xs
|
||||||
|
|
||||||
|
toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form
|
||||||
|
toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs
|
||||||
|
where
|
||||||
|
pack (k,v) = (CI.mk k, v)
|
||||||
|
unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v)
|
||||||
|
|
||||||
|
toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query
|
||||||
|
toQueryColl c xs = _toCollA c toQuery xs
|
||||||
|
|
||||||
|
_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)]
|
||||||
|
_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs))
|
||||||
|
where fencode = fmap (fmap Just) . encode . fmap P.fromJust
|
||||||
|
{-# INLINE fencode #-}
|
||||||
|
|
||||||
|
_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)]
|
||||||
|
_toCollA c encode xs = _toCollA' c encode BC.singleton xs
|
||||||
|
|
||||||
|
_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]
|
||||||
|
_toCollA' c encode one xs = case c of
|
||||||
|
CommaSeparated -> go (one ',')
|
||||||
|
SpaceSeparated -> go (one ' ')
|
||||||
|
TabSeparated -> go (one '\t')
|
||||||
|
PipeSeparated -> go (one '|')
|
||||||
|
MultiParamArray -> expandList
|
||||||
|
where
|
||||||
|
go sep =
|
||||||
|
[P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList]
|
||||||
|
combine sep x y = x <> sep <> y
|
||||||
|
expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs
|
||||||
|
{-# INLINE go #-}
|
||||||
|
{-# INLINE expandList #-}
|
||||||
|
{-# INLINE combine #-}
|
||||||
|
|
||||||
|
-- * AuthMethods
|
||||||
|
|
||||||
|
-- | Provides a method to apply auth methods to requests
|
||||||
|
class P.Typeable a =>
|
||||||
|
AuthMethod a where
|
||||||
|
applyAuthMethod
|
||||||
|
:: KubernetesConfig
|
||||||
|
-> a
|
||||||
|
-> KubernetesRequest req contentType res accept
|
||||||
|
-> IO (KubernetesRequest req contentType res accept)
|
||||||
|
|
||||||
|
-- | An existential wrapper for any AuthMethod
|
||||||
|
data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable)
|
||||||
|
|
||||||
|
instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req
|
||||||
|
|
||||||
|
-- | indicates exceptions related to AuthMethods
|
||||||
|
data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable)
|
||||||
|
|
||||||
|
instance E.Exception AuthMethodException
|
||||||
|
|
||||||
|
-- | apply all matching AuthMethods in config to request
|
||||||
|
_applyAuthMethods
|
||||||
|
:: KubernetesRequest req contentType res accept
|
||||||
|
-> KubernetesConfig
|
||||||
|
-> IO (KubernetesRequest req contentType res accept)
|
||||||
|
_applyAuthMethods req config@(KubernetesConfig {configAuthMethods = as}) =
|
||||||
|
foldlM go req as
|
||||||
|
where
|
||||||
|
go r (AnyAuthMethod a) = applyAuthMethod config a r
|
||||||
|
|
||||||
|
-- * Utils
|
||||||
|
|
||||||
|
-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)
|
||||||
|
_omitNulls :: [(Text, A.Value)] -> A.Value
|
||||||
|
_omitNulls = A.object . P.filter notNull
|
||||||
|
where
|
||||||
|
notNull (_, A.Null) = False
|
||||||
|
notNull _ = True
|
||||||
|
|
||||||
|
-- | Encodes fields using WH.toQueryParam
|
||||||
|
_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text])
|
||||||
|
_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x
|
||||||
|
|
||||||
|
-- | Collapse (Just "") to Nothing
|
||||||
|
_emptyToNothing :: Maybe String -> Maybe String
|
||||||
|
_emptyToNothing (Just "") = Nothing
|
||||||
|
_emptyToNothing x = x
|
||||||
|
{-# INLINE _emptyToNothing #-}
|
||||||
|
|
||||||
|
-- | Collapse (Just mempty) to Nothing
|
||||||
|
_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a
|
||||||
|
_memptyToNothing (Just x) | x P.== P.mempty = Nothing
|
||||||
|
_memptyToNothing x = x
|
||||||
|
{-# INLINE _memptyToNothing #-}
|
||||||
|
|
||||||
|
-- * DateTime Formatting
|
||||||
|
|
||||||
|
newtype DateTime = DateTime { unDateTime :: TI.UTCTime }
|
||||||
|
deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData,TI.ParseTime,TI.FormatTime)
|
||||||
|
instance A.FromJSON DateTime where
|
||||||
|
parseJSON = A.withText "DateTime" (_readDateTime . T.unpack)
|
||||||
|
instance A.ToJSON DateTime where
|
||||||
|
toJSON (DateTime t) = A.toJSON (_showDateTime t)
|
||||||
|
instance WH.FromHttpApiData DateTime where
|
||||||
|
parseUrlPiece = P.left T.pack . _readDateTime . T.unpack
|
||||||
|
instance WH.ToHttpApiData DateTime where
|
||||||
|
toUrlPiece (DateTime t) = T.pack (_showDateTime t)
|
||||||
|
instance P.Show DateTime where
|
||||||
|
show (DateTime t) = _showDateTime t
|
||||||
|
instance MimeRender MimeMultipartFormData DateTime where
|
||||||
|
mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
|
||||||
|
-- | @_parseISO8601@
|
||||||
|
_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
|
||||||
|
_readDateTime =
|
||||||
|
_parseISO8601
|
||||||
|
{-# INLINE _readDateTime #-}
|
||||||
|
|
||||||
|
-- | @TI.formatISO8601Millis@
|
||||||
|
_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String
|
||||||
|
_showDateTime =
|
||||||
|
TI.formatISO8601Millis
|
||||||
|
{-# INLINE _showDateTime #-}
|
||||||
|
|
||||||
|
-- | parse an ISO8601 date-time string
|
||||||
|
_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t
|
||||||
|
_parseISO8601 t =
|
||||||
|
P.asum $
|
||||||
|
P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$>
|
||||||
|
["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"]
|
||||||
|
{-# INLINE _parseISO8601 #-}
|
||||||
|
|
||||||
|
-- * Date Formatting
|
||||||
|
|
||||||
|
newtype Date = Date { unDate :: TI.Day }
|
||||||
|
deriving (P.Enum,P.Eq,P.Data,P.Ord,P.Ix,NF.NFData,TI.ParseTime,TI.FormatTime)
|
||||||
|
instance A.FromJSON Date where
|
||||||
|
parseJSON = A.withText "Date" (_readDate . T.unpack)
|
||||||
|
instance A.ToJSON Date where
|
||||||
|
toJSON (Date t) = A.toJSON (_showDate t)
|
||||||
|
instance WH.FromHttpApiData Date where
|
||||||
|
parseUrlPiece = P.left T.pack . _readDate . T.unpack
|
||||||
|
instance WH.ToHttpApiData Date where
|
||||||
|
toUrlPiece (Date t) = T.pack (_showDate t)
|
||||||
|
instance P.Show Date where
|
||||||
|
show (Date t) = _showDate t
|
||||||
|
instance MimeRender MimeMultipartFormData Date where
|
||||||
|
mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
|
||||||
|
-- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@
|
||||||
|
_readDate :: (TI.ParseTime t, Monad m) => String -> m t
|
||||||
|
_readDate =
|
||||||
|
TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"
|
||||||
|
{-# INLINE _readDate #-}
|
||||||
|
|
||||||
|
-- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@
|
||||||
|
_showDate :: TI.FormatTime t => t -> String
|
||||||
|
_showDate =
|
||||||
|
TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"
|
||||||
|
{-# INLINE _showDate #-}
|
||||||
|
|
||||||
|
-- * Byte/Binary Formatting
|
||||||
|
|
||||||
|
|
||||||
|
-- | base64 encoded characters
|
||||||
|
newtype ByteArray = ByteArray { unByteArray :: BL.ByteString }
|
||||||
|
deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
|
||||||
|
|
||||||
|
instance A.FromJSON ByteArray where
|
||||||
|
parseJSON = A.withText "ByteArray" _readByteArray
|
||||||
|
instance A.ToJSON ByteArray where
|
||||||
|
toJSON = A.toJSON . _showByteArray
|
||||||
|
instance WH.FromHttpApiData ByteArray where
|
||||||
|
parseUrlPiece = P.left T.pack . _readByteArray
|
||||||
|
instance WH.ToHttpApiData ByteArray where
|
||||||
|
toUrlPiece = _showByteArray
|
||||||
|
instance P.Show ByteArray where
|
||||||
|
show = T.unpack . _showByteArray
|
||||||
|
instance MimeRender MimeMultipartFormData ByteArray where
|
||||||
|
mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
|
||||||
|
-- | read base64 encoded characters
|
||||||
|
_readByteArray :: Monad m => Text -> m ByteArray
|
||||||
|
_readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8
|
||||||
|
{-# INLINE _readByteArray #-}
|
||||||
|
|
||||||
|
-- | show base64 encoded characters
|
||||||
|
_showByteArray :: ByteArray -> Text
|
||||||
|
_showByteArray = T.decodeUtf8 . BL.toStrict . BL64.encode . unByteArray
|
||||||
|
{-# INLINE _showByteArray #-}
|
||||||
|
|
||||||
|
-- | any sequence of octets
|
||||||
|
newtype Binary = Binary { unBinary :: BL.ByteString }
|
||||||
|
deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData)
|
||||||
|
|
||||||
|
instance A.FromJSON Binary where
|
||||||
|
parseJSON = A.withText "Binary" _readBinaryBase64
|
||||||
|
instance A.ToJSON Binary where
|
||||||
|
toJSON = A.toJSON . _showBinaryBase64
|
||||||
|
instance WH.FromHttpApiData Binary where
|
||||||
|
parseUrlPiece = P.left T.pack . _readBinaryBase64
|
||||||
|
instance WH.ToHttpApiData Binary where
|
||||||
|
toUrlPiece = _showBinaryBase64
|
||||||
|
instance P.Show Binary where
|
||||||
|
show = T.unpack . _showBinaryBase64
|
||||||
|
instance MimeRender MimeMultipartFormData Binary where
|
||||||
|
mimeRender _ = unBinary
|
||||||
|
|
||||||
|
_readBinaryBase64 :: Monad m => Text -> m Binary
|
||||||
|
_readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8
|
||||||
|
{-# INLINE _readBinaryBase64 #-}
|
||||||
|
|
||||||
|
_showBinaryBase64 :: Binary -> Text
|
||||||
|
_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
|
||||||
|
{-# INLINE _showBinaryBase64 #-}
|
||||||
|
|
||||||
|
-- * Lens Type Aliases
|
||||||
|
|
||||||
|
type Lens_' s a = Lens_ s s a a
|
||||||
|
type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t
|
||||||
118
kubernetes/lib/Kubernetes/Logging.hs
Normal file
118
kubernetes/lib/Kubernetes/Logging.hs
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
{-
|
||||||
|
Kubernetes
|
||||||
|
|
||||||
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||||
|
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-|
|
||||||
|
Module : Kubernetes.Logging
|
||||||
|
Katip Logging functions
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
|
||||||
|
module Kubernetes.Logging where
|
||||||
|
|
||||||
|
import qualified Control.Exception.Safe as E
|
||||||
|
import qualified Control.Monad.IO.Class as P
|
||||||
|
import qualified Control.Monad.Trans.Reader as P
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import qualified Lens.Micro as L
|
||||||
|
import qualified System.IO as IO
|
||||||
|
|
||||||
|
import Data.Text (Text)
|
||||||
|
import GHC.Exts (IsString(..))
|
||||||
|
|
||||||
|
import qualified Katip as LG
|
||||||
|
|
||||||
|
-- * Type Aliases (for compatibility)
|
||||||
|
|
||||||
|
-- | Runs a Katip logging block with the Log environment
|
||||||
|
type LogExecWithContext = forall m. P.MonadIO m =>
|
||||||
|
LogContext -> LogExec m
|
||||||
|
|
||||||
|
-- | A Katip logging block
|
||||||
|
type LogExec m = forall a. LG.KatipT m a -> m a
|
||||||
|
|
||||||
|
-- | A Katip Log environment
|
||||||
|
type LogContext = LG.LogEnv
|
||||||
|
|
||||||
|
-- | A Katip Log severity
|
||||||
|
type LogLevel = LG.Severity
|
||||||
|
|
||||||
|
-- * default logger
|
||||||
|
|
||||||
|
-- | the default log environment
|
||||||
|
initLogContext :: IO LogContext
|
||||||
|
initLogContext = LG.initLogEnv "Kubernetes" "dev"
|
||||||
|
|
||||||
|
-- | Runs a Katip logging block with the Log environment
|
||||||
|
runDefaultLogExecWithContext :: LogExecWithContext
|
||||||
|
runDefaultLogExecWithContext = LG.runKatipT
|
||||||
|
|
||||||
|
-- * stdout logger
|
||||||
|
|
||||||
|
-- | Runs a Katip logging block with the Log environment
|
||||||
|
stdoutLoggingExec :: LogExecWithContext
|
||||||
|
stdoutLoggingExec = runDefaultLogExecWithContext
|
||||||
|
|
||||||
|
-- | A Katip Log environment which targets stdout
|
||||||
|
stdoutLoggingContext :: LogContext -> IO LogContext
|
||||||
|
stdoutLoggingContext cxt = do
|
||||||
|
handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2
|
||||||
|
LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt
|
||||||
|
|
||||||
|
-- * stderr logger
|
||||||
|
|
||||||
|
-- | Runs a Katip logging block with the Log environment
|
||||||
|
stderrLoggingExec :: LogExecWithContext
|
||||||
|
stderrLoggingExec = runDefaultLogExecWithContext
|
||||||
|
|
||||||
|
-- | A Katip Log environment which targets stderr
|
||||||
|
stderrLoggingContext :: LogContext -> IO LogContext
|
||||||
|
stderrLoggingContext cxt = do
|
||||||
|
handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
|
||||||
|
LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
|
||||||
|
|
||||||
|
-- * Null logger
|
||||||
|
|
||||||
|
-- | Disables Katip logging
|
||||||
|
runNullLogExec :: LogExecWithContext
|
||||||
|
runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le)
|
||||||
|
|
||||||
|
-- * Log Msg
|
||||||
|
|
||||||
|
-- | Log a katip message
|
||||||
|
_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m ()
|
||||||
|
_log src level msg = do
|
||||||
|
LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg)
|
||||||
|
|
||||||
|
-- * Log Exceptions
|
||||||
|
|
||||||
|
-- | re-throws exceptions after logging them
|
||||||
|
logExceptions
|
||||||
|
:: (LG.Katip m, E.MonadCatch m, Applicative m)
|
||||||
|
=> Text -> m a -> m a
|
||||||
|
logExceptions src =
|
||||||
|
E.handle
|
||||||
|
(\(e :: E.SomeException) -> do
|
||||||
|
_log src LG.ErrorS ((T.pack . show) e)
|
||||||
|
E.throw e)
|
||||||
|
|
||||||
|
-- * Log Level
|
||||||
|
|
||||||
|
levelInfo :: LogLevel
|
||||||
|
levelInfo = LG.InfoS
|
||||||
|
|
||||||
|
levelError :: LogLevel
|
||||||
|
levelError = LG.ErrorS
|
||||||
|
|
||||||
|
levelDebug :: LogLevel
|
||||||
|
levelDebug = LG.DebugS
|
||||||
|
|
||||||
201
kubernetes/lib/Kubernetes/MimeTypes.hs
Normal file
201
kubernetes/lib/Kubernetes/MimeTypes.hs
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
{-
|
||||||
|
Kubernetes
|
||||||
|
|
||||||
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
||||||
|
|
||||||
|
OpenAPI spec version: 2.0
|
||||||
|
Kubernetes API version: v1.9.1
|
||||||
|
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-|
|
||||||
|
Module : Kubernetes.MimeTypes
|
||||||
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE ConstraintKinds #-}
|
||||||
|
{-# LANGUAGE ExistentialQuantification #-}
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
{-# LANGUAGE FlexibleInstances #-}
|
||||||
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}
|
||||||
|
|
||||||
|
module Kubernetes.MimeTypes where
|
||||||
|
|
||||||
|
import qualified Control.Arrow as P (left)
|
||||||
|
import qualified Data.Aeson as A
|
||||||
|
import qualified Data.ByteString as B
|
||||||
|
import qualified Data.ByteString.Builder as BB
|
||||||
|
import qualified Data.ByteString.Char8 as BC
|
||||||
|
import qualified Data.ByteString.Lazy as BL
|
||||||
|
import qualified Data.ByteString.Lazy.Char8 as BCL
|
||||||
|
import qualified Data.Data as P (Typeable)
|
||||||
|
import qualified Data.Proxy as P (Proxy(..))
|
||||||
|
import qualified Data.String as P
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import qualified Data.Text.Encoding as T
|
||||||
|
import qualified Network.HTTP.Media as ME
|
||||||
|
import qualified Web.FormUrlEncoded as WH
|
||||||
|
import qualified Web.HttpApiData as WH
|
||||||
|
|
||||||
|
import Prelude (($), (.),(<$>),(<*>),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty)
|
||||||
|
import qualified Prelude as P
|
||||||
|
|
||||||
|
-- * ContentType MimeType
|
||||||
|
|
||||||
|
data ContentType a = MimeType a => ContentType { unContentType :: a }
|
||||||
|
|
||||||
|
-- * Accept MimeType
|
||||||
|
|
||||||
|
data Accept a = MimeType a => Accept { unAccept :: a }
|
||||||
|
|
||||||
|
-- * Consumes Class
|
||||||
|
|
||||||
|
class MimeType mtype => Consumes req mtype where
|
||||||
|
|
||||||
|
-- * Produces Class
|
||||||
|
|
||||||
|
class MimeType mtype => Produces req mtype where
|
||||||
|
|
||||||
|
-- * Default Mime Types
|
||||||
|
|
||||||
|
data MimeJSON = MimeJSON deriving (P.Typeable)
|
||||||
|
data MimeXML = MimeXML deriving (P.Typeable)
|
||||||
|
data MimePlainText = MimePlainText deriving (P.Typeable)
|
||||||
|
data MimeFormUrlEncoded = MimeFormUrlEncoded deriving (P.Typeable)
|
||||||
|
data MimeMultipartFormData = MimeMultipartFormData deriving (P.Typeable)
|
||||||
|
data MimeOctetStream = MimeOctetStream deriving (P.Typeable)
|
||||||
|
data MimeNoContent = MimeNoContent deriving (P.Typeable)
|
||||||
|
data MimeAny = MimeAny deriving (P.Typeable)
|
||||||
|
|
||||||
|
-- | A type for responses without content-body.
|
||||||
|
data NoContent = NoContent
|
||||||
|
deriving (P.Show, P.Eq, P.Typeable)
|
||||||
|
|
||||||
|
|
||||||
|
-- * MimeType Class
|
||||||
|
|
||||||
|
class P.Typeable mtype => MimeType mtype where
|
||||||
|
{-# MINIMAL mimeType | mimeTypes #-}
|
||||||
|
|
||||||
|
mimeTypes :: P.Proxy mtype -> [ME.MediaType]
|
||||||
|
mimeTypes p =
|
||||||
|
case mimeType p of
|
||||||
|
Just x -> [x]
|
||||||
|
Nothing -> []
|
||||||
|
|
||||||
|
mimeType :: P.Proxy mtype -> Maybe ME.MediaType
|
||||||
|
mimeType p =
|
||||||
|
case mimeTypes p of
|
||||||
|
[] -> Nothing
|
||||||
|
(x:_) -> Just x
|
||||||
|
|
||||||
|
mimeType' :: mtype -> Maybe ME.MediaType
|
||||||
|
mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype)
|
||||||
|
mimeTypes' :: mtype -> [ME.MediaType]
|
||||||
|
mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype)
|
||||||
|
|
||||||
|
-- Default MimeType Instances
|
||||||
|
|
||||||
|
-- | @application/json; charset=utf-8@
|
||||||
|
instance MimeType MimeJSON where
|
||||||
|
mimeType _ = Just $ P.fromString "application/json"
|
||||||
|
-- | @application/xml; charset=utf-8@
|
||||||
|
instance MimeType MimeXML where
|
||||||
|
mimeType _ = Just $ P.fromString "application/xml"
|
||||||
|
-- | @application/x-www-form-urlencoded@
|
||||||
|
instance MimeType MimeFormUrlEncoded where
|
||||||
|
mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded"
|
||||||
|
-- | @multipart/form-data@
|
||||||
|
instance MimeType MimeMultipartFormData where
|
||||||
|
mimeType _ = Just $ P.fromString "multipart/form-data"
|
||||||
|
-- | @text/plain; charset=utf-8@
|
||||||
|
instance MimeType MimePlainText where
|
||||||
|
mimeType _ = Just $ P.fromString "text/plain"
|
||||||
|
-- | @application/octet-stream@
|
||||||
|
instance MimeType MimeOctetStream where
|
||||||
|
mimeType _ = Just $ P.fromString "application/octet-stream"
|
||||||
|
-- | @"*/*"@
|
||||||
|
instance MimeType MimeAny where
|
||||||
|
mimeType _ = Just $ P.fromString "*/*"
|
||||||
|
instance MimeType MimeNoContent where
|
||||||
|
mimeType _ = Nothing
|
||||||
|
|
||||||
|
-- * MimeRender Class
|
||||||
|
|
||||||
|
class MimeType mtype => MimeRender mtype x where
|
||||||
|
mimeRender :: P.Proxy mtype -> x -> BL.ByteString
|
||||||
|
mimeRender' :: mtype -> x -> BL.ByteString
|
||||||
|
mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x
|
||||||
|
|
||||||
|
|
||||||
|
mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString
|
||||||
|
mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam
|
||||||
|
|
||||||
|
-- Default MimeRender Instances
|
||||||
|
|
||||||
|
-- | `A.encode`
|
||||||
|
instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode
|
||||||
|
-- | @WH.urlEncodeAsForm@
|
||||||
|
instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm
|
||||||
|
|
||||||
|
-- | @P.id@
|
||||||
|
instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id
|
||||||
|
-- | @BL.fromStrict . T.encodeUtf8@
|
||||||
|
instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8
|
||||||
|
-- | @BCL.pack@
|
||||||
|
instance MimeRender MimePlainText String where mimeRender _ = BCL.pack
|
||||||
|
|
||||||
|
-- | @P.id@
|
||||||
|
instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id
|
||||||
|
-- | @BL.fromStrict . T.encodeUtf8@
|
||||||
|
instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8
|
||||||
|
-- | @BCL.pack@
|
||||||
|
instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack
|
||||||
|
|
||||||
|
instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id
|
||||||
|
|
||||||
|
instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||||
|
|
||||||
|
-- | @P.Right . P.const NoContent@
|
||||||
|
instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty
|
||||||
|
|
||||||
|
|
||||||
|
-- * MimeUnrender Class
|
||||||
|
|
||||||
|
class MimeType mtype => MimeUnrender mtype o where
|
||||||
|
mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o
|
||||||
|
mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o
|
||||||
|
mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x
|
||||||
|
|
||||||
|
-- Default MimeUnrender Instances
|
||||||
|
|
||||||
|
-- | @A.eitherDecode@
|
||||||
|
instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode
|
||||||
|
-- | @P.left T.unpack . WH.urlDecodeAsForm@
|
||||||
|
instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm
|
||||||
|
-- | @P.Right . P.id@
|
||||||
|
|
||||||
|
instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id
|
||||||
|
-- | @P.left P.show . TL.decodeUtf8'@
|
||||||
|
instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict
|
||||||
|
-- | @P.Right . BCL.unpack@
|
||||||
|
instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack
|
||||||
|
|
||||||
|
-- | @P.Right . P.id@
|
||||||
|
instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id
|
||||||
|
-- | @P.left P.show . T.decodeUtf8' . BL.toStrict@
|
||||||
|
instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict
|
||||||
|
-- | @P.Right . BCL.unpack@
|
||||||
|
instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack
|
||||||
|
|
||||||
|
-- | @P.Right . P.const NoContent@
|
||||||
|
instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
|
||||||
21299
kubernetes/lib/Kubernetes/Model.hs
Normal file
21299
kubernetes/lib/Kubernetes/Model.hs
Normal file
File diff suppressed because it is too large
Load Diff
12610
kubernetes/lib/Kubernetes/ModelLens.hs
Normal file
12610
kubernetes/lib/Kubernetes/ModelLens.hs
Normal file
File diff suppressed because it is too large
Load Diff
8
kubernetes/stack.yaml
Normal file
8
kubernetes/stack.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
resolver: lts-9.10
|
||||||
|
build:
|
||||||
|
haddock-arguments:
|
||||||
|
haddock-args:
|
||||||
|
- "--odir=./docs"
|
||||||
|
extra-deps: []
|
||||||
|
packages:
|
||||||
|
- '.'
|
||||||
78356
kubernetes/swagger.json
Normal file
78356
kubernetes/swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
85340
kubernetes/swagger.json.unprocessed
Normal file
85340
kubernetes/swagger.json.unprocessed
Normal file
File diff suppressed because it is too large
Load Diff
234280
kubernetes/swagger.yaml
Normal file
234280
kubernetes/swagger.yaml
Normal file
File diff suppressed because it is too large
Load Diff
81
kubernetes/tests/ApproxEq.hs
Normal file
81
kubernetes/tests/ApproxEq.hs
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{-# LANGUAGE DefaultSignatures #-}
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE TypeOperators #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||||
|
|
||||||
|
module ApproxEq where
|
||||||
|
|
||||||
|
import Data.Text (Text)
|
||||||
|
import Data.Time.Clock
|
||||||
|
import Test.QuickCheck
|
||||||
|
import GHC.Generics as G
|
||||||
|
|
||||||
|
(==~)
|
||||||
|
:: (ApproxEq a, Show a)
|
||||||
|
=> a -> a -> Property
|
||||||
|
a ==~ b = counterexample (show a ++ " !=~ " ++ show b) (a =~ b)
|
||||||
|
|
||||||
|
class GApproxEq f where
|
||||||
|
gApproxEq :: f a -> f a -> Bool
|
||||||
|
|
||||||
|
instance GApproxEq U1 where
|
||||||
|
gApproxEq U1 U1 = True
|
||||||
|
|
||||||
|
instance (GApproxEq a, GApproxEq b) =>
|
||||||
|
GApproxEq (a :+: b) where
|
||||||
|
gApproxEq (L1 a) (L1 b) = gApproxEq a b
|
||||||
|
gApproxEq (R1 a) (R1 b) = gApproxEq a b
|
||||||
|
gApproxEq _ _ = False
|
||||||
|
|
||||||
|
instance (GApproxEq a, GApproxEq b) =>
|
||||||
|
GApproxEq (a :*: b) where
|
||||||
|
gApproxEq (a1 :*: b1) (a2 :*: b2) = gApproxEq a1 a2 && gApproxEq b1 b2
|
||||||
|
|
||||||
|
instance (ApproxEq a) =>
|
||||||
|
GApproxEq (K1 i a) where
|
||||||
|
gApproxEq (K1 a) (K1 b) = a =~ b
|
||||||
|
|
||||||
|
instance (GApproxEq f) =>
|
||||||
|
GApproxEq (M1 i t f) where
|
||||||
|
gApproxEq (M1 a) (M1 b) = gApproxEq a b
|
||||||
|
|
||||||
|
class ApproxEq a where
|
||||||
|
(=~) :: a -> a -> Bool
|
||||||
|
default (=~) :: (Generic a, GApproxEq (Rep a)) => a -> a -> Bool
|
||||||
|
a =~ b = gApproxEq (G.from a) (G.from b)
|
||||||
|
|
||||||
|
instance ApproxEq Text where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq Char where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq Bool where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq Int where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq Double where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq a =>
|
||||||
|
ApproxEq (Maybe a)
|
||||||
|
|
||||||
|
instance ApproxEq UTCTime where
|
||||||
|
(=~) = (==)
|
||||||
|
|
||||||
|
instance ApproxEq a =>
|
||||||
|
ApproxEq [a] where
|
||||||
|
as =~ bs = and (zipWith (=~) as bs)
|
||||||
|
|
||||||
|
instance (ApproxEq l, ApproxEq r) =>
|
||||||
|
ApproxEq (Either l r) where
|
||||||
|
Left a =~ Left b = a =~ b
|
||||||
|
Right a =~ Right b = a =~ b
|
||||||
|
_ =~ _ = False
|
||||||
|
|
||||||
|
instance (ApproxEq l, ApproxEq r) =>
|
||||||
|
ApproxEq (l, r) where
|
||||||
|
(=~) (l1, r1) (l2, r2) = l1 =~ l2 && r1 =~ r2
|
||||||
4182
kubernetes/tests/Instances.hs
Normal file
4182
kubernetes/tests/Instances.hs
Normal file
File diff suppressed because it is too large
Load Diff
51
kubernetes/tests/PropMime.hs
Normal file
51
kubernetes/tests/PropMime.hs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
{-# LANGUAGE ConstraintKinds #-}
|
||||||
|
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
|
||||||
|
|
||||||
|
module PropMime where
|
||||||
|
|
||||||
|
import Data.Aeson
|
||||||
|
import Data.Aeson.Types (parseEither)
|
||||||
|
import Data.Monoid ((<>))
|
||||||
|
import Data.Typeable (Proxy(..), typeOf, Typeable)
|
||||||
|
import qualified Data.ByteString.Lazy.Char8 as BL8
|
||||||
|
import Test.Hspec
|
||||||
|
import Test.QuickCheck
|
||||||
|
import Test.QuickCheck.Property
|
||||||
|
import Test.Hspec.QuickCheck (prop)
|
||||||
|
|
||||||
|
import Kubernetes.MimeTypes
|
||||||
|
|
||||||
|
import ApproxEq
|
||||||
|
|
||||||
|
-- * Type Aliases
|
||||||
|
|
||||||
|
type ArbitraryMime mime a = ArbitraryRoundtrip (MimeUnrender mime) (MimeRender mime) a
|
||||||
|
|
||||||
|
type ArbitraryRoundtrip from to a = (from a, to a, Arbitrary' a)
|
||||||
|
|
||||||
|
type Arbitrary' a = (Arbitrary a, Show a, Typeable a)
|
||||||
|
|
||||||
|
-- * Mime
|
||||||
|
|
||||||
|
propMime
|
||||||
|
:: forall a b mime.
|
||||||
|
(ArbitraryMime mime a, Testable b)
|
||||||
|
=> String -> (a -> a -> b) -> mime -> Proxy a -> Spec
|
||||||
|
propMime eqDescr eq m _ =
|
||||||
|
prop
|
||||||
|
(show (typeOf (undefined :: a)) <> " " <> show (typeOf (undefined :: mime)) <> " roundtrip " <> eqDescr) $
|
||||||
|
\(x :: a) ->
|
||||||
|
let rendered = mimeRender' m x
|
||||||
|
actual = mimeUnrender' m rendered
|
||||||
|
expected = Right x
|
||||||
|
failMsg =
|
||||||
|
"ACTUAL: " <> show actual <> "\nRENDERED: " <> BL8.unpack rendered
|
||||||
|
in counterexample failMsg $
|
||||||
|
either reject property (eq <$> actual <*> expected)
|
||||||
|
where
|
||||||
|
reject = property . const rejected
|
||||||
|
|
||||||
|
propMimeEq :: (ArbitraryMime mime a, Eq a) => mime -> Proxy a -> Spec
|
||||||
|
propMimeEq = propMime "(EQ)" (==)
|
||||||
515
kubernetes/tests/Test.hs
Normal file
515
kubernetes/tests/Test.hs
Normal file
@@ -0,0 +1,515 @@
|
|||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE PartialTypeSignatures #-}
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import Data.Typeable (Proxy(..))
|
||||||
|
import Test.Hspec
|
||||||
|
import Test.Hspec.QuickCheck
|
||||||
|
|
||||||
|
import PropMime
|
||||||
|
import Instances ()
|
||||||
|
|
||||||
|
import Kubernetes.Model
|
||||||
|
import Kubernetes.MimeTypes
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main =
|
||||||
|
hspec $ modifyMaxSize (const 10) $ do
|
||||||
|
describe "JSON instances" $ do
|
||||||
|
pure ()
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AdmissionregistrationV1beta1ServiceReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ApiregistrationV1beta1ServiceReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1Deployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentRollback)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1DeploymentStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1RollbackConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1RollingUpdateDeployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1Scale)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1ScaleSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy AppsV1beta1ScaleStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1Deployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentRollback)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1DeploymentStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1RollbackConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1RollingUpdateDeployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1Scale)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1ScaleSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy ExtensionsV1beta1ScaleStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy RuntimeRawExtension)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1APIGroup)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1APIGroupList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1APIResource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1APIResourceList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1APIVersions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AWSElasticBlockStoreVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Affinity)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AggregationRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AttachedVolume)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AzureDiskVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AzureFilePersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1AzureFileVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Binding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1CSIPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Capabilities)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1CephFSPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1CephFSVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1CinderVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ClientIPConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ClusterRole)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ClusterRoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ClusterRoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ClusterRoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ComponentCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ComponentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ComponentStatusList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMap)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMapEnvSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMapKeySelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMapList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMapProjection)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ConfigMapVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Container)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerImage)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerPort)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerState)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerStateRunning)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerStateTerminated)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerStateWaiting)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ContainerStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ControllerRevision)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ControllerRevisionList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1CrossVersionObjectReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonEndpoint)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DaemonSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeleteOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Deployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeploymentCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeploymentList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeploymentSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeploymentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DeploymentStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DownwardAPIProjection)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DownwardAPIVolumeFile)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1DownwardAPIVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EmptyDirVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EndpointAddress)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EndpointPort)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EndpointSubset)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Endpoints)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EndpointsList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EnvFromSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EnvVar)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EnvVarSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Event)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EventList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EventSeries)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1EventSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ExecAction)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1FCVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1FlexVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1FlockerVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1GCEPersistentDiskVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1GitRepoVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1GlusterfsVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1GroupVersionForDiscovery)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HTTPGetAction)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HTTPHeader)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Handler)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HorizontalPodAutoscaler)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HorizontalPodAutoscalerList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HorizontalPodAutoscalerSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HorizontalPodAutoscalerStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HostAlias)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1HostPathVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1IPBlock)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ISCSIPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ISCSIVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Initializer)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Initializers)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Job)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1JobCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1JobList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1JobSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1JobStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1KeyToPath)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LabelSelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LabelSelectorRequirement)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Lifecycle)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LimitRange)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LimitRangeItem)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LimitRangeList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LimitRangeSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ListMeta)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LoadBalancerIngress)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LoadBalancerStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LocalObjectReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LocalSubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1LocalVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NFSVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Namespace)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NamespaceList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NamespaceSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NamespaceStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicyEgressRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicyIngressRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicyList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicyPeer)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicyPort)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NetworkPolicySpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Node)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeAddress)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeAffinity)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeConfigSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeDaemonEndpoints)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeSelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeSelectorRequirement)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeSelectorTerm)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NodeSystemInfo)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NonResourceAttributes)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1NonResourceRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ObjectFieldSelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ObjectMeta)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ObjectReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1OwnerReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolume)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaim)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaimCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaimList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaimSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaimStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeClaimVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PersistentVolumeStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PhotonPersistentDiskVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Pod)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodAffinity)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodAffinityTerm)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodAntiAffinity)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodDNSConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodDNSConfigOption)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodSecurityContext)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodTemplate)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodTemplateList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PodTemplateSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PolicyRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PortworxVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Preconditions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1PreferredSchedulingTerm)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Probe)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ProjectedVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1QuobyteVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RBDPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RBDVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicaSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicaSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicaSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicaSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicaSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicationController)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicationControllerCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicationControllerList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicationControllerSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ReplicationControllerStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceAttributes)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceFieldSelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceQuota)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceQuotaList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceQuotaSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceQuotaStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceRequirements)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ResourceRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Role)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RoleRef)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RollingUpdateDaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RollingUpdateDeployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1RollingUpdateStatefulSetStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SELinuxOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Scale)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ScaleIOPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ScaleIOVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ScaleSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ScaleStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Secret)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretEnvSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretKeySelector)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretProjection)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecretVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SecurityContext)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SelfSubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SelfSubjectAccessReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SelfSubjectRulesReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SelfSubjectRulesReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServerAddressByClientCIDR)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Service)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServiceAccount)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServiceAccountList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServiceList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServicePort)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServiceSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1ServiceStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SessionAffinityConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatefulSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Status)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatusCause)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StatusDetails)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StorageClass)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StorageClassList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StorageOSPersistentVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1StorageOSVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Subject)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SubjectAccessReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SubjectAccessReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1SubjectRulesReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1TCPSocketAction)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Taint)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1TokenReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1TokenReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1TokenReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Toleration)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1UserInfo)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1Volume)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1VolumeDevice)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1VolumeMount)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1VolumeProjection)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1VsphereVirtualDiskVolumeSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1WatchEvent)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1WeightedPodAffinityTerm)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1AggregationRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1ClusterRole)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1ClusterRoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1ClusterRoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1ClusterRoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1Initializer)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1InitializerConfiguration)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1InitializerConfigurationList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PodPreset)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PodPresetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PodPresetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PolicyRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PriorityClass)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1PriorityClassList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1Role)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1RoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1RoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1RoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1RoleRef)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1Rule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1Subject)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeAttachment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeAttachmentList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeAttachmentSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeAttachmentSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeAttachmentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1alpha1VolumeError)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1APIService)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1APIServiceCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1APIServiceList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1APIServiceSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1APIServiceStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1AggregationRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1AllowedFlexVolume)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1AllowedHostPath)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CertificateSigningRequest)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CertificateSigningRequestCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CertificateSigningRequestList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CertificateSigningRequestSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CertificateSigningRequestStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ClusterRole)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ClusterRoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ClusterRoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ClusterRoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ControllerRevision)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ControllerRevisionList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CronJob)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CronJobList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CronJobSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CronJobStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinitionCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinitionList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinitionNames)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinitionSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceDefinitionStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1CustomResourceValidation)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1DaemonSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Event)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1EventList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1EventSeries)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Eviction)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ExternalDocumentation)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1FSGroupStrategyOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1HTTPIngressPath)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1HTTPIngressRuleValue)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1HostPortRange)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IDRange)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IPBlock)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Ingress)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressBackend)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1IngressTLS)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JSON)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JSONSchemaProps)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JSONSchemaPropsOrArray)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JSONSchemaPropsOrBool)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JSONSchemaPropsOrStringArray)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1JobTemplateSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1LocalSubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1MutatingWebhookConfiguration)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1MutatingWebhookConfigurationList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicyEgressRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicyIngressRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicyList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicyPeer)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicyPort)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NetworkPolicySpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NonResourceAttributes)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1NonResourceRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodDisruptionBudget)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodDisruptionBudgetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodDisruptionBudgetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodDisruptionBudgetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodSecurityPolicy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodSecurityPolicyList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PodSecurityPolicySpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1PolicyRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ReplicaSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ReplicaSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ReplicaSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ReplicaSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ReplicaSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ResourceAttributes)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ResourceRule)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Role)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RoleBinding)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RoleBindingList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RoleList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RoleRef)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RollingUpdateDaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RollingUpdateStatefulSetStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RuleWithOperations)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1RunAsUserStrategyOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SELinuxStrategyOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SelfSubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SelfSubjectAccessReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SelfSubjectRulesReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SelfSubjectRulesReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StatefulSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StorageClass)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1StorageClassList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Subject)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SubjectAccessReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SubjectAccessReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SubjectAccessReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SubjectRulesReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1SupplementalGroupsStrategyOptions)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1TokenReview)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1TokenReviewSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1TokenReviewStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1UserInfo)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ValidatingWebhookConfiguration)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1ValidatingWebhookConfigurationList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1Webhook)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta1WebhookClientConfig)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ControllerRevision)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ControllerRevisionList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DaemonSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2Deployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DeploymentCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DeploymentList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DeploymentSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DeploymentStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2DeploymentStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ReplicaSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ReplicaSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ReplicaSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ReplicaSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ReplicaSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2RollingUpdateDaemonSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2RollingUpdateDeployment)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2RollingUpdateStatefulSetStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2Scale)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ScaleSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2ScaleStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSet)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSetCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSetList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSetSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSetStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V1beta2StatefulSetUpdateStrategy)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2alpha1CronJob)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2alpha1CronJobList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2alpha1CronJobSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2alpha1CronJobStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2alpha1JobTemplateSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1CrossVersionObjectReference)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1HorizontalPodAutoscaler)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1HorizontalPodAutoscalerCondition)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1HorizontalPodAutoscalerList)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1HorizontalPodAutoscalerSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1HorizontalPodAutoscalerStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1MetricSpec)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1MetricStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1ObjectMetricSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1ObjectMetricStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1PodsMetricSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1PodsMetricStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1ResourceMetricSource)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy V2beta1ResourceMetricStatus)
|
||||||
|
propMimeEq MimeJSON (Proxy :: Proxy VersionInfo)
|
||||||
|
|
||||||
Reference in New Issue
Block a user