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