github.com/kubearmor/cilium@v1.6.12/api/v1/client/daemon/daemon_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package daemon
     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 daemon 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 daemon API
    21  */
    22  type Client struct {
    23  	transport runtime.ClientTransport
    24  	formats   strfmt.Registry
    25  }
    26  
    27  /*
    28  GetClusterNodes gets nodes information stored in the cilium agent
    29  */
    30  func (a *Client) GetClusterNodes(params *GetClusterNodesParams) (*GetClusterNodesOK, error) {
    31  	// TODO: Validate the params before sending
    32  	if params == nil {
    33  		params = NewGetClusterNodesParams()
    34  	}
    35  
    36  	result, err := a.transport.Submit(&runtime.ClientOperation{
    37  		ID:                 "GetClusterNodes",
    38  		Method:             "GET",
    39  		PathPattern:        "/cluster/nodes",
    40  		ProducesMediaTypes: []string{"application/json"},
    41  		ConsumesMediaTypes: []string{"application/json"},
    42  		Schemes:            []string{"http"},
    43  		Params:             params,
    44  		Reader:             &GetClusterNodesReader{formats: a.formats},
    45  		Context:            params.Context,
    46  		Client:             params.HTTPClient,
    47  	})
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return result.(*GetClusterNodesOK), nil
    52  
    53  }
    54  
    55  /*
    56  GetConfig gets configuration of cilium daemon
    57  
    58  Returns the configuration of the Cilium daemon.
    59  
    60  */
    61  func (a *Client) GetConfig(params *GetConfigParams) (*GetConfigOK, error) {
    62  	// TODO: Validate the params before sending
    63  	if params == nil {
    64  		params = NewGetConfigParams()
    65  	}
    66  
    67  	result, err := a.transport.Submit(&runtime.ClientOperation{
    68  		ID:                 "GetConfig",
    69  		Method:             "GET",
    70  		PathPattern:        "/config",
    71  		ProducesMediaTypes: []string{"application/json"},
    72  		ConsumesMediaTypes: []string{"application/json"},
    73  		Schemes:            []string{"http"},
    74  		Params:             params,
    75  		Reader:             &GetConfigReader{formats: a.formats},
    76  		Context:            params.Context,
    77  		Client:             params.HTTPClient,
    78  	})
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return result.(*GetConfigOK), nil
    83  
    84  }
    85  
    86  /*
    87  GetDebuginfo retrieves information about the agent and evironment for debugging
    88  */
    89  func (a *Client) GetDebuginfo(params *GetDebuginfoParams) (*GetDebuginfoOK, error) {
    90  	// TODO: Validate the params before sending
    91  	if params == nil {
    92  		params = NewGetDebuginfoParams()
    93  	}
    94  
    95  	result, err := a.transport.Submit(&runtime.ClientOperation{
    96  		ID:                 "GetDebuginfo",
    97  		Method:             "GET",
    98  		PathPattern:        "/debuginfo",
    99  		ProducesMediaTypes: []string{"application/json"},
   100  		ConsumesMediaTypes: []string{"application/json"},
   101  		Schemes:            []string{"http"},
   102  		Params:             params,
   103  		Reader:             &GetDebuginfoReader{formats: a.formats},
   104  		Context:            params.Context,
   105  		Client:             params.HTTPClient,
   106  	})
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return result.(*GetDebuginfoOK), nil
   111  
   112  }
   113  
   114  /*
   115  GetHealthz gets health of cilium daemon
   116  
   117  Returns health and status information of the Cilium daemon and related
   118  components such as the local container runtime, connected datastore,
   119  Kubernetes integration.
   120  
   121  */
   122  func (a *Client) GetHealthz(params *GetHealthzParams) (*GetHealthzOK, error) {
   123  	// TODO: Validate the params before sending
   124  	if params == nil {
   125  		params = NewGetHealthzParams()
   126  	}
   127  
   128  	result, err := a.transport.Submit(&runtime.ClientOperation{
   129  		ID:                 "GetHealthz",
   130  		Method:             "GET",
   131  		PathPattern:        "/healthz",
   132  		ProducesMediaTypes: []string{"application/json"},
   133  		ConsumesMediaTypes: []string{"application/json"},
   134  		Schemes:            []string{"http"},
   135  		Params:             params,
   136  		Reader:             &GetHealthzReader{formats: a.formats},
   137  		Context:            params.Context,
   138  		Client:             params.HTTPClient,
   139  	})
   140  	if err != nil {
   141  		return nil, err
   142  	}
   143  	return result.(*GetHealthzOK), nil
   144  
   145  }
   146  
   147  /*
   148  GetMap lists all open maps
   149  */
   150  func (a *Client) GetMap(params *GetMapParams) (*GetMapOK, error) {
   151  	// TODO: Validate the params before sending
   152  	if params == nil {
   153  		params = NewGetMapParams()
   154  	}
   155  
   156  	result, err := a.transport.Submit(&runtime.ClientOperation{
   157  		ID:                 "GetMap",
   158  		Method:             "GET",
   159  		PathPattern:        "/map",
   160  		ProducesMediaTypes: []string{"application/json"},
   161  		ConsumesMediaTypes: []string{"application/json"},
   162  		Schemes:            []string{"http"},
   163  		Params:             params,
   164  		Reader:             &GetMapReader{formats: a.formats},
   165  		Context:            params.Context,
   166  		Client:             params.HTTPClient,
   167  	})
   168  	if err != nil {
   169  		return nil, err
   170  	}
   171  	return result.(*GetMapOK), nil
   172  
   173  }
   174  
   175  /*
   176  GetMapName retrieves contents of b p f map
   177  */
   178  func (a *Client) GetMapName(params *GetMapNameParams) (*GetMapNameOK, error) {
   179  	// TODO: Validate the params before sending
   180  	if params == nil {
   181  		params = NewGetMapNameParams()
   182  	}
   183  
   184  	result, err := a.transport.Submit(&runtime.ClientOperation{
   185  		ID:                 "GetMapName",
   186  		Method:             "GET",
   187  		PathPattern:        "/map/{name}",
   188  		ProducesMediaTypes: []string{"application/json"},
   189  		ConsumesMediaTypes: []string{"application/json"},
   190  		Schemes:            []string{"http"},
   191  		Params:             params,
   192  		Reader:             &GetMapNameReader{formats: a.formats},
   193  		Context:            params.Context,
   194  		Client:             params.HTTPClient,
   195  	})
   196  	if err != nil {
   197  		return nil, err
   198  	}
   199  	return result.(*GetMapNameOK), nil
   200  
   201  }
   202  
   203  /*
   204  PatchConfig modifies daemon configuration
   205  
   206  Updates the daemon configuration by applying the provided
   207  ConfigurationMap and regenerates & recompiles all required datapath
   208  components.
   209  
   210  */
   211  func (a *Client) PatchConfig(params *PatchConfigParams) (*PatchConfigOK, error) {
   212  	// TODO: Validate the params before sending
   213  	if params == nil {
   214  		params = NewPatchConfigParams()
   215  	}
   216  
   217  	result, err := a.transport.Submit(&runtime.ClientOperation{
   218  		ID:                 "PatchConfig",
   219  		Method:             "PATCH",
   220  		PathPattern:        "/config",
   221  		ProducesMediaTypes: []string{"application/json"},
   222  		ConsumesMediaTypes: []string{"application/json"},
   223  		Schemes:            []string{"http"},
   224  		Params:             params,
   225  		Reader:             &PatchConfigReader{formats: a.formats},
   226  		Context:            params.Context,
   227  		Client:             params.HTTPClient,
   228  	})
   229  	if err != nil {
   230  		return nil, err
   231  	}
   232  	return result.(*PatchConfigOK), nil
   233  
   234  }
   235  
   236  // SetTransport changes the transport on the client
   237  func (a *Client) SetTransport(transport runtime.ClientTransport) {
   238  	a.transport = transport
   239  }