github.com/kubearmor/cilium@v1.6.12/api/v1/health/client/restapi/restapi_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package restapi 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "github.com/go-openapi/runtime" 10 11 strfmt "github.com/go-openapi/strfmt" 12 ) 13 14 // New creates a new restapi API client. 15 func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { 16 return &Client{transport: transport, formats: formats} 17 } 18 19 /* 20 Client for restapi API 21 */ 22 type Client struct { 23 transport runtime.ClientTransport 24 formats strfmt.Registry 25 } 26 27 /* 28 GetHealthz gets health of cilium node 29 30 Returns health and status information of the local node including 31 load and uptime, as well as the status of related components including 32 the Cilium daemon. 33 34 */ 35 func (a *Client) GetHealthz(params *GetHealthzParams) (*GetHealthzOK, error) { 36 // TODO: Validate the params before sending 37 if params == nil { 38 params = NewGetHealthzParams() 39 } 40 41 result, err := a.transport.Submit(&runtime.ClientOperation{ 42 ID: "GetHealthz", 43 Method: "GET", 44 PathPattern: "/healthz", 45 ProducesMediaTypes: []string{"application/json"}, 46 ConsumesMediaTypes: []string{"application/json"}, 47 Schemes: []string{"http"}, 48 Params: params, 49 Reader: &GetHealthzReader{formats: a.formats}, 50 Context: params.Context, 51 Client: params.HTTPClient, 52 }) 53 if err != nil { 54 return nil, err 55 } 56 return result.(*GetHealthzOK), nil 57 58 } 59 60 // SetTransport changes the transport on the client 61 func (a *Client) SetTransport(transport runtime.ClientTransport) { 62 a.transport = transport 63 }