github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/endpoint/get_endpoint_id_labels_parameters.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 endpoint 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 "net/http" 13 14 "github.com/go-openapi/errors" 15 "github.com/go-openapi/runtime/middleware" 16 "github.com/go-openapi/strfmt" 17 ) 18 19 // NewGetEndpointIDLabelsParams creates a new GetEndpointIDLabelsParams object 20 // 21 // There are no default values defined in the spec. 22 func NewGetEndpointIDLabelsParams() GetEndpointIDLabelsParams { 23 24 return GetEndpointIDLabelsParams{} 25 } 26 27 // GetEndpointIDLabelsParams contains all the bound params for the get endpoint ID labels operation 28 // typically these are obtained from a http.Request 29 // 30 // swagger:parameters GetEndpointIDLabels 31 type GetEndpointIDLabelsParams struct { 32 33 // HTTP Request Object 34 HTTPRequest *http.Request `json:"-"` 35 36 /*String describing an endpoint with the format ``[prefix:]id``. If no prefix 37 is specified, a prefix of ``cilium-local:`` is assumed. Not all endpoints 38 will be addressable by all endpoint ID prefixes with the exception of the 39 local Cilium UUID which is assigned to all endpoints. 40 41 Supported endpoint id prefixes: 42 - cilium-local: Local Cilium endpoint UUID, e.g. cilium-local:3389595 43 - cilium-global: Global Cilium endpoint UUID, e.g. cilium-global:cluster1:nodeX:452343 44 - cni-attachment-id: CNI attachment ID, e.g. cni-attachment-id:22222:eth0 45 - container-id: Container runtime ID, e.g. container-id:22222 (deprecated, may not be unique) 46 - container-name: Container name, e.g. container-name:foobar (deprecated, may not be unique) 47 - pod-name: pod name for this container if K8s is enabled, e.g. pod-name:default:foobar (deprecated, may not be unique) 48 - cep-name: cep name for this container if K8s is enabled, e.g. pod-name:default:foobar-net1 49 - docker-endpoint: Docker libnetwork endpoint ID, e.g. docker-endpoint:4444 50 51 Required: true 52 In: path 53 */ 54 ID string 55 } 56 57 // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface 58 // for simple values it will use straight method calls. 59 // 60 // To ensure default values, the struct must have been initialized with NewGetEndpointIDLabelsParams() beforehand. 61 func (o *GetEndpointIDLabelsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { 62 var res []error 63 64 o.HTTPRequest = r 65 66 rID, rhkID, _ := route.Params.GetOK("id") 67 if err := o.bindID(rID, rhkID, route.Formats); err != nil { 68 res = append(res, err) 69 } 70 if len(res) > 0 { 71 return errors.CompositeValidationError(res...) 72 } 73 return nil 74 } 75 76 // bindID binds and validates parameter ID from path. 77 func (o *GetEndpointIDLabelsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { 78 var raw string 79 if len(rawData) > 0 { 80 raw = rawData[len(rawData)-1] 81 } 82 83 // Required: true 84 // Parameter is provided by construction from the route 85 o.ID = raw 86 87 return nil 88 }