github.com/kubearmor/cilium@v1.6.12/api/v1/client/metrics/metrics_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package metrics
     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 metrics 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 metrics API
    21  */
    22  type Client struct {
    23  	transport runtime.ClientTransport
    24  	formats   strfmt.Registry
    25  }
    26  
    27  /*
    28  GetMetrics retrieves cilium metrics
    29  */
    30  func (a *Client) GetMetrics(params *GetMetricsParams) (*GetMetricsOK, error) {
    31  	// TODO: Validate the params before sending
    32  	if params == nil {
    33  		params = NewGetMetricsParams()
    34  	}
    35  
    36  	result, err := a.transport.Submit(&runtime.ClientOperation{
    37  		ID:                 "GetMetrics",
    38  		Method:             "GET",
    39  		PathPattern:        "/metrics/",
    40  		ProducesMediaTypes: []string{"application/json"},
    41  		ConsumesMediaTypes: []string{"application/json"},
    42  		Schemes:            []string{"http"},
    43  		Params:             params,
    44  		Reader:             &GetMetricsReader{formats: a.formats},
    45  		Context:            params.Context,
    46  		Client:             params.HTTPClient,
    47  	})
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	return result.(*GetMetricsOK), nil
    52  
    53  }
    54  
    55  // SetTransport changes the transport on the client
    56  func (a *Client) SetTransport(transport runtime.ClientTransport) {
    57  	a.transport = transport
    58  }