Documentation ¶
Overview ¶
Copyright 2016 Authors of Cilium
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Client
- func (cli Client) AllocateIP(ipamType ipam.IPAMType, options ipam.IPAMReq) (*ipam.IPAMRep, error)
- func (cli Client) DeleteLabelsBySHA256(sha256sum, contID string) error
- func (cli Client) DeleteLabelsByUUID(id uint32, contID string) error
- func (cli Client) EndpointGet(epID uint16) (*types.Endpoint, error)
- func (cli Client) EndpointGetByDockerEPID(dockerEPID string) (*types.Endpoint, error)
- func (cli Client) EndpointJoin(ep types.Endpoint) error
- func (cli Client) EndpointLabelsGet(epID uint16) (*types.OpLabels, error)
- func (cli Client) EndpointLabelsUpdate(epID uint16, labelOp types.LabelOp) error
- func (cli Client) EndpointLeave(epID uint16) error
- func (cli Client) EndpointLeaveByDockerEPID(dockerEPID string) error
- func (cli Client) EndpointSave(ep types.Endpoint) error
- func (cli Client) EndpointUpdate(epID uint16, opts types.OptionMap) error
- func (cli Client) EndpointsGet() ([]types.Endpoint, error)
- func (cli Client) GetIPAMConf(ipamType ipam.IPAMType, options ipam.IPAMReq) (*ipam.IPAMConfigRep, error)
- func (cli Client) GetLabels(id uint32) (*types.SecCtxLabel, error)
- func (cli Client) GetLabelsBySHA256(sha256sum string) (*types.SecCtxLabel, error)
- func (cli Client) GetMaxID() (uint32, error)
- func (cli Client) Ping() (*types.PingResponse, error)
- func (cli Client) PolicyAdd(path string, node *types.PolicyNode) error
- func (cli Client) PolicyCanConsume(ctx *types.SearchContext) (*types.SearchContextReply, error)
- func (cli Client) PolicyDelete(path string) error
- func (cli Client) PolicyGet(path string) (*types.PolicyNode, error)
- func (cli Client) PutLabels(labels types.Labels, contID string) (*types.SecCtxLabel, bool, error)
- func (cli Client) ReleaseIP(ipamType ipam.IPAMType, options ipam.IPAMReq) error
- func (cli *Client) SyncState(path string, clean bool) error
- func (cli Client) Update(opts types.OptionMap) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*resty.Client
}
Client has the internal details necessary to talk with the daemon.
func NewClient ¶
NewClient creates and returns a client that will send requests to host, using the http.Client httpCli with transport and httpHeaders.
func NewDefaultClient ¶
NewDefaultClient creates and returns a client that will talk with common.CiliumStock.
func (Client) AllocateIP ¶
AllocateIP sends a POST request to allocate a new IP for the given options to the daemon. Returns an IPAMConfig if the daemon returns a http.StatusCreated, which means the allocation was successfully made.
func (Client) DeleteLabelsBySHA256 ¶
DeleteLabelsBySHA256 sends a DELETE request with the sha256sum to the daemon.
func (Client) DeleteLabelsByUUID ¶
DeleteLabelsByUUID sends a DELETE request with id to the daemon.
func (Client) EndpointGet ¶
EndpointGet sends a GET request with epID to the daemon.
func (Client) EndpointGetByDockerEPID ¶
EndpointGetByDockerEPID sends a GET request with dockerEPID to the daemon.
func (Client) EndpointJoin ¶
EndpointJoin sends a endpoint POST request with ep to the daemon.
func (Client) EndpointLabelsGet ¶
func (Client) EndpointLabelsUpdate ¶
func (Client) EndpointLeave ¶
EndpointLeave sends a DELETE request with epID to the daemon.
func (Client) EndpointLeaveByDockerEPID ¶
EndpointLeaveByDockerEPID sends a DELETE request with dockerEPID to the daemon.
func (Client) EndpointSave ¶
EndpointSave sends a endpoint POST request with ep to the daemon.
func (Client) EndpointUpdate ¶
EndpointUpdate sends a POST request with epID and opts to the daemon.
func (Client) EndpointsGet ¶
EndpointsGet sends a GET request to the daemon.
func (Client) GetIPAMConf ¶
func (cli Client) GetIPAMConf(ipamType ipam.IPAMType, options ipam.IPAMReq) (*ipam.IPAMConfigRep, error)
GetIPAMConf sends a POST request to retrieve the IPAM configuration for the given ipamType.
func (Client) GetLabels ¶
func (cli Client) GetLabels(id uint32) (*types.SecCtxLabel, error)
GetLabels sends a GET request with id to the daemon. Returns the types.SecCtxLabels with the given id. If it's not found, types.SecCtxLabels and error are booth nil.
func (Client) GetLabelsBySHA256 ¶
func (cli Client) GetLabelsBySHA256(sha256sum string) (*types.SecCtxLabel, error)
GetLabelsBySHA256 sends a GET request with sha256sum to the daemon. Returns the types.SecCtxLabels with the given id. If it's not found, types.SecCtxLabels and error are booth nil.
func (Client) GetMaxID ¶
GetMaxID sends a GET request to the daemon. Returns the next, possible, free UUID.
func (Client) Ping ¶
func (cli Client) Ping() (*types.PingResponse, error)
Ping sends a GET request to the daemon. Returns "Pong" if the communication between the client and the server was successful.
func (Client) PolicyAdd ¶
func (cli Client) PolicyAdd(path string, node *types.PolicyNode) error
PolicyAdd sends a POST request with node to the "/policy/+path" endpoint to the daemon.
func (Client) PolicyCanConsume ¶
func (cli Client) PolicyCanConsume(ctx *types.SearchContext) (*types.SearchContextReply, error)
func (Client) PolicyDelete ¶
PolicyDelete sends a DELETE request to the "/policy/+path" endpoint to the daemon.
func (Client) PolicyGet ¶
func (cli Client) PolicyGet(path string) (*types.PolicyNode, error)
PolicyGet sends a GET request to the "/policy/+path" endpoint to the daemon. If the daemon returns a http.StatusOK means the policy was found and is returned. If the daemon returns a http.StatusNoContent the policy was not found and *types.PolicyNode is nil.