github.com/cilium/cilium@v1.16.2/api/v1/client/daemon/daemon_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package daemon 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "fmt" 13 "io" 14 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/strfmt" 17 ) 18 19 // New creates a new daemon API client. 20 func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { 21 return &Client{transport: transport, formats: formats} 22 } 23 24 /* 25 Client for daemon API 26 */ 27 type Client struct { 28 transport runtime.ClientTransport 29 formats strfmt.Registry 30 } 31 32 // ClientOption is the option for Client methods 33 type ClientOption func(*runtime.ClientOperation) 34 35 // ClientService is the interface for Client methods 36 type ClientService interface { 37 GetCgroupDumpMetadata(params *GetCgroupDumpMetadataParams, opts ...ClientOption) (*GetCgroupDumpMetadataOK, error) 38 39 GetClusterNodes(params *GetClusterNodesParams, opts ...ClientOption) (*GetClusterNodesOK, error) 40 41 GetConfig(params *GetConfigParams, opts ...ClientOption) (*GetConfigOK, error) 42 43 GetDebuginfo(params *GetDebuginfoParams, opts ...ClientOption) (*GetDebuginfoOK, error) 44 45 GetHealthz(params *GetHealthzParams, opts ...ClientOption) (*GetHealthzOK, error) 46 47 GetMap(params *GetMapParams, opts ...ClientOption) (*GetMapOK, error) 48 49 GetMapName(params *GetMapNameParams, opts ...ClientOption) (*GetMapNameOK, error) 50 51 GetMapNameEvents(params *GetMapNameEventsParams, writer io.Writer, opts ...ClientOption) (*GetMapNameEventsOK, error) 52 53 GetNodeIds(params *GetNodeIdsParams, opts ...ClientOption) (*GetNodeIdsOK, error) 54 55 PatchConfig(params *PatchConfigParams, opts ...ClientOption) (*PatchConfigOK, error) 56 57 SetTransport(transport runtime.ClientTransport) 58 } 59 60 /* 61 GetCgroupDumpMetadata retrieves cgroup metadata for all pods 62 */ 63 func (a *Client) GetCgroupDumpMetadata(params *GetCgroupDumpMetadataParams, opts ...ClientOption) (*GetCgroupDumpMetadataOK, error) { 64 // TODO: Validate the params before sending 65 if params == nil { 66 params = NewGetCgroupDumpMetadataParams() 67 } 68 op := &runtime.ClientOperation{ 69 ID: "GetCgroupDumpMetadata", 70 Method: "GET", 71 PathPattern: "/cgroup-dump-metadata", 72 ProducesMediaTypes: []string{"application/json"}, 73 ConsumesMediaTypes: []string{"application/json"}, 74 Schemes: []string{"http"}, 75 Params: params, 76 Reader: &GetCgroupDumpMetadataReader{formats: a.formats}, 77 Context: params.Context, 78 Client: params.HTTPClient, 79 } 80 for _, opt := range opts { 81 opt(op) 82 } 83 84 result, err := a.transport.Submit(op) 85 if err != nil { 86 return nil, err 87 } 88 success, ok := result.(*GetCgroupDumpMetadataOK) 89 if ok { 90 return success, nil 91 } 92 // unexpected success response 93 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 94 msg := fmt.Sprintf("unexpected success response for GetCgroupDumpMetadata: API contract not enforced by server. Client expected to get an error, but got: %T", result) 95 panic(msg) 96 } 97 98 /* 99 GetClusterNodes gets nodes information stored in the cilium agent 100 */ 101 func (a *Client) GetClusterNodes(params *GetClusterNodesParams, opts ...ClientOption) (*GetClusterNodesOK, error) { 102 // TODO: Validate the params before sending 103 if params == nil { 104 params = NewGetClusterNodesParams() 105 } 106 op := &runtime.ClientOperation{ 107 ID: "GetClusterNodes", 108 Method: "GET", 109 PathPattern: "/cluster/nodes", 110 ProducesMediaTypes: []string{"application/json"}, 111 ConsumesMediaTypes: []string{"application/json"}, 112 Schemes: []string{"http"}, 113 Params: params, 114 Reader: &GetClusterNodesReader{formats: a.formats}, 115 Context: params.Context, 116 Client: params.HTTPClient, 117 } 118 for _, opt := range opts { 119 opt(op) 120 } 121 122 result, err := a.transport.Submit(op) 123 if err != nil { 124 return nil, err 125 } 126 success, ok := result.(*GetClusterNodesOK) 127 if ok { 128 return success, nil 129 } 130 // unexpected success response 131 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 132 msg := fmt.Sprintf("unexpected success response for GetClusterNodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) 133 panic(msg) 134 } 135 136 /* 137 GetConfig gets configuration of cilium daemon 138 139 Returns the configuration of the Cilium daemon. 140 */ 141 func (a *Client) GetConfig(params *GetConfigParams, opts ...ClientOption) (*GetConfigOK, error) { 142 // TODO: Validate the params before sending 143 if params == nil { 144 params = NewGetConfigParams() 145 } 146 op := &runtime.ClientOperation{ 147 ID: "GetConfig", 148 Method: "GET", 149 PathPattern: "/config", 150 ProducesMediaTypes: []string{"application/json"}, 151 ConsumesMediaTypes: []string{"application/json"}, 152 Schemes: []string{"http"}, 153 Params: params, 154 Reader: &GetConfigReader{formats: a.formats}, 155 Context: params.Context, 156 Client: params.HTTPClient, 157 } 158 for _, opt := range opts { 159 opt(op) 160 } 161 162 result, err := a.transport.Submit(op) 163 if err != nil { 164 return nil, err 165 } 166 success, ok := result.(*GetConfigOK) 167 if ok { 168 return success, nil 169 } 170 // unexpected success response 171 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 172 msg := fmt.Sprintf("unexpected success response for GetConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) 173 panic(msg) 174 } 175 176 /* 177 GetDebuginfo retrieves information about the agent and environment for debugging 178 */ 179 func (a *Client) GetDebuginfo(params *GetDebuginfoParams, opts ...ClientOption) (*GetDebuginfoOK, error) { 180 // TODO: Validate the params before sending 181 if params == nil { 182 params = NewGetDebuginfoParams() 183 } 184 op := &runtime.ClientOperation{ 185 ID: "GetDebuginfo", 186 Method: "GET", 187 PathPattern: "/debuginfo", 188 ProducesMediaTypes: []string{"application/json"}, 189 ConsumesMediaTypes: []string{"application/json"}, 190 Schemes: []string{"http"}, 191 Params: params, 192 Reader: &GetDebuginfoReader{formats: a.formats}, 193 Context: params.Context, 194 Client: params.HTTPClient, 195 } 196 for _, opt := range opts { 197 opt(op) 198 } 199 200 result, err := a.transport.Submit(op) 201 if err != nil { 202 return nil, err 203 } 204 success, ok := result.(*GetDebuginfoOK) 205 if ok { 206 return success, nil 207 } 208 // unexpected success response 209 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 210 msg := fmt.Sprintf("unexpected success response for GetDebuginfo: API contract not enforced by server. Client expected to get an error, but got: %T", result) 211 panic(msg) 212 } 213 214 /* 215 GetHealthz gets health of cilium daemon 216 217 Returns health and status information of the Cilium daemon and related 218 219 components such as the local container runtime, connected datastore, 220 Kubernetes integration and Hubble. 221 */ 222 func (a *Client) GetHealthz(params *GetHealthzParams, opts ...ClientOption) (*GetHealthzOK, error) { 223 // TODO: Validate the params before sending 224 if params == nil { 225 params = NewGetHealthzParams() 226 } 227 op := &runtime.ClientOperation{ 228 ID: "GetHealthz", 229 Method: "GET", 230 PathPattern: "/healthz", 231 ProducesMediaTypes: []string{"application/json"}, 232 ConsumesMediaTypes: []string{"application/json"}, 233 Schemes: []string{"http"}, 234 Params: params, 235 Reader: &GetHealthzReader{formats: a.formats}, 236 Context: params.Context, 237 Client: params.HTTPClient, 238 } 239 for _, opt := range opts { 240 opt(op) 241 } 242 243 result, err := a.transport.Submit(op) 244 if err != nil { 245 return nil, err 246 } 247 success, ok := result.(*GetHealthzOK) 248 if ok { 249 return success, nil 250 } 251 // unexpected success response 252 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 253 msg := fmt.Sprintf("unexpected success response for GetHealthz: API contract not enforced by server. Client expected to get an error, but got: %T", result) 254 panic(msg) 255 } 256 257 /* 258 GetMap lists all open maps 259 */ 260 func (a *Client) GetMap(params *GetMapParams, opts ...ClientOption) (*GetMapOK, error) { 261 // TODO: Validate the params before sending 262 if params == nil { 263 params = NewGetMapParams() 264 } 265 op := &runtime.ClientOperation{ 266 ID: "GetMap", 267 Method: "GET", 268 PathPattern: "/map", 269 ProducesMediaTypes: []string{"application/json"}, 270 ConsumesMediaTypes: []string{"application/json"}, 271 Schemes: []string{"http"}, 272 Params: params, 273 Reader: &GetMapReader{formats: a.formats}, 274 Context: params.Context, 275 Client: params.HTTPClient, 276 } 277 for _, opt := range opts { 278 opt(op) 279 } 280 281 result, err := a.transport.Submit(op) 282 if err != nil { 283 return nil, err 284 } 285 success, ok := result.(*GetMapOK) 286 if ok { 287 return success, nil 288 } 289 // unexpected success response 290 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 291 msg := fmt.Sprintf("unexpected success response for GetMap: API contract not enforced by server. Client expected to get an error, but got: %T", result) 292 panic(msg) 293 } 294 295 /* 296 GetMapName retrieves contents of b p f map 297 */ 298 func (a *Client) GetMapName(params *GetMapNameParams, opts ...ClientOption) (*GetMapNameOK, error) { 299 // TODO: Validate the params before sending 300 if params == nil { 301 params = NewGetMapNameParams() 302 } 303 op := &runtime.ClientOperation{ 304 ID: "GetMapName", 305 Method: "GET", 306 PathPattern: "/map/{name}", 307 ProducesMediaTypes: []string{"application/json"}, 308 ConsumesMediaTypes: []string{"application/json"}, 309 Schemes: []string{"http"}, 310 Params: params, 311 Reader: &GetMapNameReader{formats: a.formats}, 312 Context: params.Context, 313 Client: params.HTTPClient, 314 } 315 for _, opt := range opts { 316 opt(op) 317 } 318 319 result, err := a.transport.Submit(op) 320 if err != nil { 321 return nil, err 322 } 323 success, ok := result.(*GetMapNameOK) 324 if ok { 325 return success, nil 326 } 327 // unexpected success response 328 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 329 msg := fmt.Sprintf("unexpected success response for GetMapName: API contract not enforced by server. Client expected to get an error, but got: %T", result) 330 panic(msg) 331 } 332 333 /* 334 GetMapNameEvents retrieves the recent event logs associated with this endpoint 335 */ 336 func (a *Client) GetMapNameEvents(params *GetMapNameEventsParams, writer io.Writer, opts ...ClientOption) (*GetMapNameEventsOK, error) { 337 // TODO: Validate the params before sending 338 if params == nil { 339 params = NewGetMapNameEventsParams() 340 } 341 op := &runtime.ClientOperation{ 342 ID: "GetMapNameEvents", 343 Method: "GET", 344 PathPattern: "/map/{name}/events", 345 ProducesMediaTypes: []string{"application/json"}, 346 ConsumesMediaTypes: []string{"application/json"}, 347 Schemes: []string{"http"}, 348 Params: params, 349 Reader: &GetMapNameEventsReader{formats: a.formats, writer: writer}, 350 Context: params.Context, 351 Client: params.HTTPClient, 352 } 353 for _, opt := range opts { 354 opt(op) 355 } 356 357 result, err := a.transport.Submit(op) 358 if err != nil { 359 return nil, err 360 } 361 success, ok := result.(*GetMapNameEventsOK) 362 if ok { 363 return success, nil 364 } 365 // unexpected success response 366 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 367 msg := fmt.Sprintf("unexpected success response for GetMapNameEvents: API contract not enforced by server. Client expected to get an error, but got: %T", result) 368 panic(msg) 369 } 370 371 /* 372 GetNodeIds lists information about known node i ds 373 374 Retrieves a list of node IDs allocated by the agent and their 375 376 associated node IP addresses. 377 */ 378 func (a *Client) GetNodeIds(params *GetNodeIdsParams, opts ...ClientOption) (*GetNodeIdsOK, error) { 379 // TODO: Validate the params before sending 380 if params == nil { 381 params = NewGetNodeIdsParams() 382 } 383 op := &runtime.ClientOperation{ 384 ID: "GetNodeIds", 385 Method: "GET", 386 PathPattern: "/node/ids", 387 ProducesMediaTypes: []string{"application/json"}, 388 ConsumesMediaTypes: []string{"application/json"}, 389 Schemes: []string{"http"}, 390 Params: params, 391 Reader: &GetNodeIdsReader{formats: a.formats}, 392 Context: params.Context, 393 Client: params.HTTPClient, 394 } 395 for _, opt := range opts { 396 opt(op) 397 } 398 399 result, err := a.transport.Submit(op) 400 if err != nil { 401 return nil, err 402 } 403 success, ok := result.(*GetNodeIdsOK) 404 if ok { 405 return success, nil 406 } 407 // unexpected success response 408 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 409 msg := fmt.Sprintf("unexpected success response for GetNodeIds: API contract not enforced by server. Client expected to get an error, but got: %T", result) 410 panic(msg) 411 } 412 413 /* 414 PatchConfig modifies daemon configuration 415 416 Updates the daemon configuration by applying the provided 417 418 ConfigurationMap and regenerates & recompiles all required datapath 419 components. 420 */ 421 func (a *Client) PatchConfig(params *PatchConfigParams, opts ...ClientOption) (*PatchConfigOK, error) { 422 // TODO: Validate the params before sending 423 if params == nil { 424 params = NewPatchConfigParams() 425 } 426 op := &runtime.ClientOperation{ 427 ID: "PatchConfig", 428 Method: "PATCH", 429 PathPattern: "/config", 430 ProducesMediaTypes: []string{"application/json"}, 431 ConsumesMediaTypes: []string{"application/json"}, 432 Schemes: []string{"http"}, 433 Params: params, 434 Reader: &PatchConfigReader{formats: a.formats}, 435 Context: params.Context, 436 Client: params.HTTPClient, 437 } 438 for _, opt := range opts { 439 opt(op) 440 } 441 442 result, err := a.transport.Submit(op) 443 if err != nil { 444 return nil, err 445 } 446 success, ok := result.(*PatchConfigOK) 447 if ok { 448 return success, nil 449 } 450 // unexpected success response 451 // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue 452 msg := fmt.Sprintf("unexpected success response for PatchConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) 453 panic(msg) 454 } 455 456 // SetTransport changes the transport on the client 457 func (a *Client) SetTransport(transport runtime.ClientTransport) { 458 a.transport = transport 459 }