Documentation ¶
Index ¶
- Constants
- func DefaultSockPath() string
- func FormatStatusResponse(w io.Writer, sr *models.StatusResponse, ...)
- func FormatStatusResponseBrief(w io.Writer, sr *models.StatusResponse)
- func Hint(err error) error
- type Client
- func (c *Client) ConfigGet() (*models.DaemonConfiguration, error)
- func (c *Client) ConfigPatch(cfg models.DaemonConfigurationSpec) error
- func (c *Client) DeletePrefilter(spec *models.PrefilterSpec) error
- func (c *Client) DeleteServiceID(id int64) error
- func (c *Client) EndpointConfigGet(id string) (*models.EndpointConfigurationStatus, error)
- func (c *Client) EndpointConfigPatch(id string, cfg *models.EndpointConfigurationSpec) error
- func (c *Client) EndpointCreate(ep *models.EndpointChangeRequest) error
- func (c *Client) EndpointDelete(id string) error
- func (c *Client) EndpointGet(id string) (*models.Endpoint, error)
- func (c *Client) EndpointHealthGet(id string) (*models.EndpointHealth, error)
- func (c *Client) EndpointLabelsGet(id string) (*models.LabelConfiguration, error)
- func (c *Client) EndpointLabelsPatch(id string, toAdd, toDelete models.Labels) error
- func (c *Client) EndpointList() ([]*models.Endpoint, error)
- func (c *Client) EndpointLogGet(id string) (models.EndpointStatusLog, error)
- func (c *Client) EndpointPatch(id string, ep *models.EndpointChangeRequest) error
- func (c *Client) GetPrefilter() (*models.Prefilter, error)
- func (c *Client) GetServiceID(id int64) (*models.Service, error)
- func (c *Client) GetServices() ([]*models.Service, error)
- func (c *Client) IPAMAllocate(family, owner string) (*models.IPAMResponse, error)
- func (c *Client) IPAMAllocateIP(ip, owner string) error
- func (c *Client) IPAMReleaseIP(ip string) error
- func (c *Client) IdentityGet(id string) (*models.Identity, error)
- func (c *Client) PatchPrefilter(spec *models.PrefilterSpec) (*models.Prefilter, error)
- func (c *Client) PolicyCacheGet() (models.SelectorCache, error)
- func (c *Client) PolicyDelete(labels []string) (*models.Policy, error)
- func (c *Client) PolicyGet(labels []string) (*models.Policy, error)
- func (c *Client) PolicyPut(policyJSON string) (*models.Policy, error)
- func (c *Client) PolicyResolveGet(traceSelector *models.TraceSelector) (*models.PolicyTraceResult, error)
- func (c *Client) PutServiceID(id int64, svc *models.ServiceSpec) (bool, error)
- type ClientError
Constants ¶
const ( AddressFamilyIPv6 = "ipv6" AddressFamilyIPv4 = "ipv4" )
Variables ¶
This section is empty.
Functions ¶
func DefaultSockPath ¶ added in v1.5.0
func DefaultSockPath() string
DefaultSockPath returns deafult UNIX domain socket path or path set using CILIUM_SOCK env variable
func FormatStatusResponse ¶ added in v1.5.0
func FormatStatusResponse(w io.Writer, sr *models.StatusResponse, allAddresses, allControllers, allNodes, allRedirects bool)
FormatStatusResponse writes a StatusResponse as a string to the writer.
The parameters 'allAddresses', 'allControllers', 'allNodes', respectively, cause all details about that aspect of the status to be printed to the terminal. For each of these, if they are false then only a summary will be printed, with perhaps some detail if there are errors.
func FormatStatusResponseBrief ¶ added in v1.5.0
func FormatStatusResponseBrief(w io.Writer, sr *models.StatusResponse)
FormatStatusResponseBrief writes a one-line status to the writer. If everything ok, this is "ok", otherwise a message of the form "error in ..."
Types ¶
type Client ¶
func NewClient ¶
NewClient creates a client for the given `host`. If host is nil then use SockPath provided by CILIUM_SOCK or the cilium default SockPath
func NewDefaultClient ¶
NewDefaultClient creates a client with default parameters connecting to UNIX domain socket.
func NewDefaultClientWithTimeout ¶ added in v1.5.0
NewDefaultClientWithTimeout creates a client with default parameters connecting to UNIX domain socket and waits for cilium-agent availability.
func (*Client) ConfigGet ¶
func (c *Client) ConfigGet() (*models.DaemonConfiguration, error)
ConfigGet returns a daemon configuration.
func (*Client) ConfigPatch ¶
func (c *Client) ConfigPatch(cfg models.DaemonConfigurationSpec) error
ConfigPatch modifies the daemon configuration.
func (*Client) DeletePrefilter ¶ added in v1.5.0
func (c *Client) DeletePrefilter(spec *models.PrefilterSpec) error
DeletePrefilter deletes a list of CIDR prefixes
func (*Client) DeleteServiceID ¶
DeleteServiceID deletes a service by ID.
func (*Client) EndpointConfigGet ¶
func (c *Client) EndpointConfigGet(id string) (*models.EndpointConfigurationStatus, error)
EndpointConfigGet returns endpoint configuration
func (*Client) EndpointConfigPatch ¶
func (c *Client) EndpointConfigPatch(id string, cfg *models.EndpointConfigurationSpec) error
EndpointConfigPatch modifies endpoint configuration
func (*Client) EndpointCreate ¶
func (c *Client) EndpointCreate(ep *models.EndpointChangeRequest) error
EndpointCreate creates a new endpoint
func (*Client) EndpointDelete ¶
EndpointDelete deletes endpoint
func (*Client) EndpointGet ¶
EndpointGet returns endpoint by ID
func (*Client) EndpointHealthGet ¶ added in v1.5.0
func (c *Client) EndpointHealthGet(id string) (*models.EndpointHealth, error)
EndpointHealthGet returns endpoint healthz
func (*Client) EndpointLabelsGet ¶
func (c *Client) EndpointLabelsGet(id string) (*models.LabelConfiguration, error)
EndpointLabelsGet returns endpoint label configuration
func (*Client) EndpointLabelsPatch ¶ added in v1.5.0
EndpointLabelsPut modifies endpoint label configuration add: List of labels to add and enable. If the label is an orchestration system label which has been disabled before, it will be removed from the disabled list and readded to the orchestration list. Otherwise it will be added to the custom label list.
delete: List of labels to delete. If the label is an orchestration system label, then it will be deleted from the orchestration list and added to the disabled list. Otherwise it will be removed from the custom list.
func (*Client) EndpointList ¶
EndpointList returns a list of all endpoints
func (*Client) EndpointLogGet ¶ added in v1.5.0
func (c *Client) EndpointLogGet(id string) (models.EndpointStatusLog, error)
EndpointLogGet returns endpoint log
func (*Client) EndpointPatch ¶
func (c *Client) EndpointPatch(id string, ep *models.EndpointChangeRequest) error
EndpointPatch modifies the endpoint
func (*Client) GetPrefilter ¶ added in v1.5.0
GetPrefilter returns a list of all CIDR prefixes
func (*Client) GetServiceID ¶
GetServiceID returns a service by ID.
func (*Client) GetServices ¶
GetServices returns a list of all services.
func (*Client) IPAMAllocate ¶
func (c *Client) IPAMAllocate(family, owner string) (*models.IPAMResponse, error)
IPAMAllocate allocates an IP address out of address family specific pool.
func (*Client) IPAMAllocateIP ¶
IPAMAllocateIP tries to allocate a particular IP address.
func (*Client) IPAMReleaseIP ¶
IPAMReleaseIP releases a IP address back to the pool.
func (*Client) IdentityGet ¶
IdentityGet returns a security identity.
func (*Client) PatchPrefilter ¶ added in v1.5.0
PatchPrefilter sets a list of CIDR prefixes
func (*Client) PolicyCacheGet ¶ added in v1.6.0
func (c *Client) PolicyCacheGet() (models.SelectorCache, error)
PolicyCacheGet returns the contents of a SelectorCache.
func (*Client) PolicyDelete ¶
PolicyDelete deletes policy rules
func (*Client) PolicyResolveGet ¶
func (c *Client) PolicyResolveGet(traceSelector *models.TraceSelector) (*models.PolicyTraceResult, error)
PolicyResolveGet resolves policy for a Trace Selector with source and destination identity.
func (*Client) PutServiceID ¶
PutServiceID creates or updates a service. Returns true if service was created.
type ClientError ¶ added in v1.5.0
type ClientError struct {
// contains filtered or unexported fields
}
ClientError is the error returned by all client functions which use Hint()
func (ClientError) Error ¶ added in v1.5.0
func (c ClientError) Error() string
Error returns the error message representing the error
func (ClientError) Recoverable ¶ added in v1.5.0
func (c ClientError) Recoverable() bool
Recoverable returns true if the error is likely to be recoverable