github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/endpoint_client.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package endpoint 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 endpoint 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 endpoint API 21 */ 22 type Client struct { 23 transport runtime.ClientTransport 24 formats strfmt.Registry 25 } 26 27 /* 28 DeleteEndpointID deletes endpoint 29 30 Deletes the endpoint specified by the ID. Deletion is imminent and 31 atomic, if the deletion request is valid and the endpoint exists, 32 deletion will occur even if errors are encountered in the process. If 33 errors have been encountered, the code 202 will be returned, otherwise 34 200 on success. 35 36 All resources associated with the endpoint will be freed and the 37 workload represented by the endpoint will be disconnected.It will no 38 longer be able to initiate or receive communications of any sort. 39 40 */ 41 func (a *Client) DeleteEndpointID(params *DeleteEndpointIDParams) (*DeleteEndpointIDOK, *DeleteEndpointIDErrors, error) { 42 // TODO: Validate the params before sending 43 if params == nil { 44 params = NewDeleteEndpointIDParams() 45 } 46 47 result, err := a.transport.Submit(&runtime.ClientOperation{ 48 ID: "DeleteEndpointID", 49 Method: "DELETE", 50 PathPattern: "/endpoint/{id}", 51 ProducesMediaTypes: []string{"application/json"}, 52 ConsumesMediaTypes: []string{"application/json"}, 53 Schemes: []string{"http"}, 54 Params: params, 55 Reader: &DeleteEndpointIDReader{formats: a.formats}, 56 Context: params.Context, 57 Client: params.HTTPClient, 58 }) 59 if err != nil { 60 return nil, nil, err 61 } 62 switch value := result.(type) { 63 case *DeleteEndpointIDOK: 64 return value, nil, nil 65 case *DeleteEndpointIDErrors: 66 return nil, value, nil 67 } 68 return nil, nil, nil 69 70 } 71 72 /* 73 GetEndpoint retrieves a list of endpoints that have metadata matching the provided parameters 74 75 Retrieves a list of endpoints that have metadata matching the provided parameters, or all endpoints if no parameters provided. 76 77 */ 78 func (a *Client) GetEndpoint(params *GetEndpointParams) (*GetEndpointOK, error) { 79 // TODO: Validate the params before sending 80 if params == nil { 81 params = NewGetEndpointParams() 82 } 83 84 result, err := a.transport.Submit(&runtime.ClientOperation{ 85 ID: "GetEndpoint", 86 Method: "GET", 87 PathPattern: "/endpoint", 88 ProducesMediaTypes: []string{"application/json"}, 89 ConsumesMediaTypes: []string{"application/json"}, 90 Schemes: []string{"http"}, 91 Params: params, 92 Reader: &GetEndpointReader{formats: a.formats}, 93 Context: params.Context, 94 Client: params.HTTPClient, 95 }) 96 if err != nil { 97 return nil, err 98 } 99 return result.(*GetEndpointOK), nil 100 101 } 102 103 /* 104 GetEndpointID gets endpoint by endpoint ID 105 106 Returns endpoint information 107 108 */ 109 func (a *Client) GetEndpointID(params *GetEndpointIDParams) (*GetEndpointIDOK, error) { 110 // TODO: Validate the params before sending 111 if params == nil { 112 params = NewGetEndpointIDParams() 113 } 114 115 result, err := a.transport.Submit(&runtime.ClientOperation{ 116 ID: "GetEndpointID", 117 Method: "GET", 118 PathPattern: "/endpoint/{id}", 119 ProducesMediaTypes: []string{"application/json"}, 120 ConsumesMediaTypes: []string{"application/json"}, 121 Schemes: []string{"http"}, 122 Params: params, 123 Reader: &GetEndpointIDReader{formats: a.formats}, 124 Context: params.Context, 125 Client: params.HTTPClient, 126 }) 127 if err != nil { 128 return nil, err 129 } 130 return result.(*GetEndpointIDOK), nil 131 132 } 133 134 /* 135 GetEndpointIDConfig retrieves endpoint configuration 136 137 Retrieves the configuration of the specified endpoint. 138 139 */ 140 func (a *Client) GetEndpointIDConfig(params *GetEndpointIDConfigParams) (*GetEndpointIDConfigOK, error) { 141 // TODO: Validate the params before sending 142 if params == nil { 143 params = NewGetEndpointIDConfigParams() 144 } 145 146 result, err := a.transport.Submit(&runtime.ClientOperation{ 147 ID: "GetEndpointIDConfig", 148 Method: "GET", 149 PathPattern: "/endpoint/{id}/config", 150 ProducesMediaTypes: []string{"application/json"}, 151 ConsumesMediaTypes: []string{"application/json"}, 152 Schemes: []string{"http"}, 153 Params: params, 154 Reader: &GetEndpointIDConfigReader{formats: a.formats}, 155 Context: params.Context, 156 Client: params.HTTPClient, 157 }) 158 if err != nil { 159 return nil, err 160 } 161 return result.(*GetEndpointIDConfigOK), nil 162 163 } 164 165 /* 166 GetEndpointIDHealthz retrieves the status logs associated with this endpoint 167 */ 168 func (a *Client) GetEndpointIDHealthz(params *GetEndpointIDHealthzParams) (*GetEndpointIDHealthzOK, error) { 169 // TODO: Validate the params before sending 170 if params == nil { 171 params = NewGetEndpointIDHealthzParams() 172 } 173 174 result, err := a.transport.Submit(&runtime.ClientOperation{ 175 ID: "GetEndpointIDHealthz", 176 Method: "GET", 177 PathPattern: "/endpoint/{id}/healthz", 178 ProducesMediaTypes: []string{"application/json"}, 179 ConsumesMediaTypes: []string{"application/json"}, 180 Schemes: []string{"http"}, 181 Params: params, 182 Reader: &GetEndpointIDHealthzReader{formats: a.formats}, 183 Context: params.Context, 184 Client: params.HTTPClient, 185 }) 186 if err != nil { 187 return nil, err 188 } 189 return result.(*GetEndpointIDHealthzOK), nil 190 191 } 192 193 /* 194 GetEndpointIDLabels retrieves the list of labels associated with an endpoint 195 */ 196 func (a *Client) GetEndpointIDLabels(params *GetEndpointIDLabelsParams) (*GetEndpointIDLabelsOK, error) { 197 // TODO: Validate the params before sending 198 if params == nil { 199 params = NewGetEndpointIDLabelsParams() 200 } 201 202 result, err := a.transport.Submit(&runtime.ClientOperation{ 203 ID: "GetEndpointIDLabels", 204 Method: "GET", 205 PathPattern: "/endpoint/{id}/labels", 206 ProducesMediaTypes: []string{"application/json"}, 207 ConsumesMediaTypes: []string{"application/json"}, 208 Schemes: []string{"http"}, 209 Params: params, 210 Reader: &GetEndpointIDLabelsReader{formats: a.formats}, 211 Context: params.Context, 212 Client: params.HTTPClient, 213 }) 214 if err != nil { 215 return nil, err 216 } 217 return result.(*GetEndpointIDLabelsOK), nil 218 219 } 220 221 /* 222 GetEndpointIDLog retrieves the status logs associated with this endpoint 223 */ 224 func (a *Client) GetEndpointIDLog(params *GetEndpointIDLogParams) (*GetEndpointIDLogOK, error) { 225 // TODO: Validate the params before sending 226 if params == nil { 227 params = NewGetEndpointIDLogParams() 228 } 229 230 result, err := a.transport.Submit(&runtime.ClientOperation{ 231 ID: "GetEndpointIDLog", 232 Method: "GET", 233 PathPattern: "/endpoint/{id}/log", 234 ProducesMediaTypes: []string{"application/json"}, 235 ConsumesMediaTypes: []string{"application/json"}, 236 Schemes: []string{"http"}, 237 Params: params, 238 Reader: &GetEndpointIDLogReader{formats: a.formats}, 239 Context: params.Context, 240 Client: params.HTTPClient, 241 }) 242 if err != nil { 243 return nil, err 244 } 245 return result.(*GetEndpointIDLogOK), nil 246 247 } 248 249 /* 250 PatchEndpointID modifies existing endpoint 251 252 Applies the endpoint change request to an existing endpoint 253 254 */ 255 func (a *Client) PatchEndpointID(params *PatchEndpointIDParams) (*PatchEndpointIDOK, error) { 256 // TODO: Validate the params before sending 257 if params == nil { 258 params = NewPatchEndpointIDParams() 259 } 260 261 result, err := a.transport.Submit(&runtime.ClientOperation{ 262 ID: "PatchEndpointID", 263 Method: "PATCH", 264 PathPattern: "/endpoint/{id}", 265 ProducesMediaTypes: []string{"application/json"}, 266 ConsumesMediaTypes: []string{"application/json"}, 267 Schemes: []string{"http"}, 268 Params: params, 269 Reader: &PatchEndpointIDReader{formats: a.formats}, 270 Context: params.Context, 271 Client: params.HTTPClient, 272 }) 273 if err != nil { 274 return nil, err 275 } 276 return result.(*PatchEndpointIDOK), nil 277 278 } 279 280 /* 281 PatchEndpointIDConfig modifies mutable endpoint configuration 282 283 Update the configuration of an existing endpoint and regenerates & 284 recompiles the corresponding programs automatically. 285 286 */ 287 func (a *Client) PatchEndpointIDConfig(params *PatchEndpointIDConfigParams) (*PatchEndpointIDConfigOK, error) { 288 // TODO: Validate the params before sending 289 if params == nil { 290 params = NewPatchEndpointIDConfigParams() 291 } 292 293 result, err := a.transport.Submit(&runtime.ClientOperation{ 294 ID: "PatchEndpointIDConfig", 295 Method: "PATCH", 296 PathPattern: "/endpoint/{id}/config", 297 ProducesMediaTypes: []string{"application/json"}, 298 ConsumesMediaTypes: []string{"application/json"}, 299 Schemes: []string{"http"}, 300 Params: params, 301 Reader: &PatchEndpointIDConfigReader{formats: a.formats}, 302 Context: params.Context, 303 Client: params.HTTPClient, 304 }) 305 if err != nil { 306 return nil, err 307 } 308 return result.(*PatchEndpointIDConfigOK), nil 309 310 } 311 312 /* 313 PatchEndpointIDLabels sets label configuration of endpoint 314 315 Sets labels associated with an endpoint. These can be user provided or 316 derived from the orchestration system. 317 318 */ 319 func (a *Client) PatchEndpointIDLabels(params *PatchEndpointIDLabelsParams) (*PatchEndpointIDLabelsOK, error) { 320 // TODO: Validate the params before sending 321 if params == nil { 322 params = NewPatchEndpointIDLabelsParams() 323 } 324 325 result, err := a.transport.Submit(&runtime.ClientOperation{ 326 ID: "PatchEndpointIDLabels", 327 Method: "PATCH", 328 PathPattern: "/endpoint/{id}/labels", 329 ProducesMediaTypes: []string{"application/json"}, 330 ConsumesMediaTypes: []string{"application/json"}, 331 Schemes: []string{"http"}, 332 Params: params, 333 Reader: &PatchEndpointIDLabelsReader{formats: a.formats}, 334 Context: params.Context, 335 Client: params.HTTPClient, 336 }) 337 if err != nil { 338 return nil, err 339 } 340 return result.(*PatchEndpointIDLabelsOK), nil 341 342 } 343 344 /* 345 PutEndpointID creates endpoint 346 347 Creates a new endpoint 348 349 */ 350 func (a *Client) PutEndpointID(params *PutEndpointIDParams) (*PutEndpointIDCreated, error) { 351 // TODO: Validate the params before sending 352 if params == nil { 353 params = NewPutEndpointIDParams() 354 } 355 356 result, err := a.transport.Submit(&runtime.ClientOperation{ 357 ID: "PutEndpointID", 358 Method: "PUT", 359 PathPattern: "/endpoint/{id}", 360 ProducesMediaTypes: []string{"application/json"}, 361 ConsumesMediaTypes: []string{"application/json"}, 362 Schemes: []string{"http"}, 363 Params: params, 364 Reader: &PutEndpointIDReader{formats: a.formats}, 365 Context: params.Context, 366 Client: params.HTTPClient, 367 }) 368 if err != nil { 369 return nil, err 370 } 371 return result.(*PutEndpointIDCreated), nil 372 373 } 374 375 // SetTransport changes the transport on the client 376 func (a *Client) SetTransport(transport runtime.ClientTransport) { 377 a.transport = transport 378 }