Comments (4)
Why healthchecks
will not be an arg ?
def list_namespaced_healthchecks!(namespace, custom_resource, -opts) do
%Kazan.Request{
body: nil,
method: "get",
path: "/apis/group/v1alpha1/namespaces/#{namespace}/#{custom_resource}",
query_params: %{},
response_schema: %HealthcheckList{items: [%Healthcheck{}]} # here i don't know
}
end
from kazan.
Hi @drowzy - sorry for the delay getting back to you about this, the past month has been very busy at work and I've not had much spare time to focus on OS work.
This seems like a good idea to me. Seems like it might be easiest to expand Kazan.Request
with an optional response_decoder
field, which could just be a function that takes the response after it's been JSON decoded, and returns a struct of some sort. Would also let people override the decoding of built in types on a case by case basis if that's what they wanted to do.
I'd be happy to accept a PR around this if you're up for it - otherwise I'll try and get round to doing this at some point (though I can't guarantee when that'll be)
from kazan.
I understand and thank you for a great lib! I'll try making some time available and submit a PR
from kazan.
I've started some work on this in #65. Used a slightly different approach in the end - end users can now define their own CRDs by implementing the Kazan.Model
behaviour for each CRD.
By default you can just provide a model_desc
function that describes the format of your model, like so:
defmodule MyApp.MyCRD do
use Kazan.Model
alias Kazan.{ModelDesc, PropertyDesc}
defstruct [:id]
def model_desc() do
%ModelDesc{
properties: [
%PropertyDesc{field: "id", type: "string"}
]
}
end
end
If you want more control, you can provide encode
& decode
functions for the CRD that bypass the default behaviour.
Haven't had a chance to test it out yet, but would be interested in any feedback.
from kazan.
Related Issues (20)
- Write a CONTRIBUTING document.
- Consider utility functions for setting names etc. HOT 1
- Autolink module/api names in documentation
- Release a new version HOT 3
- Generate typespecs HOT 2
- Watcher fails with 410 "GONE" HOT 15
- Getting Kubernetes Logs HOT 2
- handling Kubernetes Errors HOT 5
- Support alternative swagger.json file HOT 4
- Expose function to pull config from application config
- Error handling strategy HOT 2
- Expose context in %Kazan.Server HOT 1
- Cannot read config HOT 3
- Watching CRDs is not supported
- Provide convenience functions for CRUD of custom resources
- Watcher process leaks if using old version of HTTPoison HOT 2
- Allow replacing of Kazan.Client.Imp via configuration HOT 1
- K8s api implementations are now significantly out of date HOT 1
- Compilation error with Elixir 1.14.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kazan.