github.com/kubearmor/cilium@v1.6.12/api/v1/health/client/connectivity/connectivity_client.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package connectivity
     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 connectivity 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 connectivity API
    21  */
    22  type Client struct {
    23  	transport runtime.ClientTransport
    24  	formats   strfmt.Registry
    25  }
    26  
    27  /*
    28  GetStatus gets connectivity status of the cilium cluster
    29  
    30  Returns the connectivity status to all other cilium-health instances
    31  using interval-based probing.
    32  
    33  */
    34  func (a *Client) GetStatus(params *GetStatusParams) (*GetStatusOK, error) {
    35  	// TODO: Validate the params before sending
    36  	if params == nil {
    37  		params = NewGetStatusParams()
    38  	}
    39  
    40  	result, err := a.transport.Submit(&runtime.ClientOperation{
    41  		ID:                 "GetStatus",
    42  		Method:             "GET",
    43  		PathPattern:        "/status",
    44  		ProducesMediaTypes: []string{"application/json"},
    45  		ConsumesMediaTypes: []string{"application/json"},
    46  		Schemes:            []string{"http"},
    47  		Params:             params,
    48  		Reader:             &GetStatusReader{formats: a.formats},
    49  		Context:            params.Context,
    50  		Client:             params.HTTPClient,
    51  	})
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return result.(*GetStatusOK), nil
    56  
    57  }
    58  
    59  /*
    60  PutStatusProbe runs synchronous connectivity probe to determine status of the cilium cluster
    61  
    62  Runs a synchronous probe to all other cilium-health instances and
    63  returns the connectivity status.
    64  
    65  */
    66  func (a *Client) PutStatusProbe(params *PutStatusProbeParams) (*PutStatusProbeOK, error) {
    67  	// TODO: Validate the params before sending
    68  	if params == nil {
    69  		params = NewPutStatusProbeParams()
    70  	}
    71  
    72  	result, err := a.transport.Submit(&runtime.ClientOperation{
    73  		ID:                 "PutStatusProbe",
    74  		Method:             "PUT",
    75  		PathPattern:        "/status/probe",
    76  		ProducesMediaTypes: []string{"application/json"},
    77  		ConsumesMediaTypes: []string{"application/json"},
    78  		Schemes:            []string{"http"},
    79  		Params:             params,
    80  		Reader:             &PutStatusProbeReader{formats: a.formats},
    81  		Context:            params.Context,
    82  		Client:             params.HTTPClient,
    83  	})
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return result.(*PutStatusProbeOK), nil
    88  
    89  }
    90  
    91  // SetTransport changes the transport on the client
    92  func (a *Client) SetTransport(transport runtime.ClientTransport) {
    93  	a.transport = transport
    94  }