client

package
v0.0.0-...-8216aeb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

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.

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.

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.

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.

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.

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.

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.

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.

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

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

func NewClient(host string, transport *http.Transport) (*Client, error)

NewClient creates and returns a client that will send requests to host, using the http.Client httpCli with transport and httpHeaders.

func NewDefaultClient

func NewDefaultClient() (*Client, error)

NewDefaultClient creates and returns a client that will talk with common.CiliumStock.

func (Client) AllocateIP

func (cli Client) AllocateIP(ipamType ipam.IPAMType, options ipam.IPAMReq) (*ipam.IPAMRep, error)

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

func (cli Client) DeleteLabelsBySHA256(sha256sum, contID string) error

DeleteLabelsBySHA256 sends a DELETE request with the sha256sum to the daemon.

func (Client) DeleteLabelsByUUID

func (cli Client) DeleteLabelsByUUID(id uint32, contID string) error

DeleteLabelsByUUID sends a DELETE request with id to the daemon.

func (Client) EndpointGet

func (cli Client) EndpointGet(epID uint16) (*types.Endpoint, error)

EndpointGet sends a GET request with epID to the daemon.

func (Client) EndpointGetByDockerEPID

func (cli Client) EndpointGetByDockerEPID(dockerEPID string) (*types.Endpoint, error)

EndpointGetByDockerEPID sends a GET request with dockerEPID to the daemon.

func (Client) EndpointJoin

func (cli Client) EndpointJoin(ep types.Endpoint) error

EndpointJoin sends a endpoint POST request with ep to the daemon.

func (Client) EndpointLabelsGet

func (cli Client) EndpointLabelsGet(epID uint16) (*types.OpLabels, error)

func (Client) EndpointLabelsUpdate

func (cli Client) EndpointLabelsUpdate(epID uint16, labelOp types.LabelOp) error

func (Client) EndpointLeave

func (cli Client) EndpointLeave(epID uint16) error

EndpointLeave sends a DELETE request with epID to the daemon.

func (Client) EndpointLeaveByDockerEPID

func (cli Client) EndpointLeaveByDockerEPID(dockerEPID string) error

EndpointLeaveByDockerEPID sends a DELETE request with dockerEPID to the daemon.

func (Client) EndpointSave

func (cli Client) EndpointSave(ep types.Endpoint) error

EndpointSave sends a endpoint POST request with ep to the daemon.

func (Client) EndpointUpdate

func (cli Client) EndpointUpdate(epID uint16, opts types.OptionMap) error

EndpointUpdate sends a POST request with epID and opts to the daemon.

func (Client) EndpointsGet

func (cli Client) EndpointsGet() ([]types.Endpoint, error)

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

func (cli Client) GetMaxID() (uint32, error)

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

func (cli Client) PolicyDelete(path string) error

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.

func (Client) PutLabels

func (cli Client) PutLabels(labels types.Labels, contID string) (*types.SecCtxLabel, bool, error)

PutLabels sends POST request with labels to the daemon. Returns

func (Client) ReleaseIP

func (cli Client) ReleaseIP(ipamType ipam.IPAMType, options ipam.IPAMReq) error

ReleaseIP sends a POST request to release the IP of the given options.

func (*Client) SyncState

func (cli *Client) SyncState(path string, clean bool) error

func (Client) Update

func (cli Client) Update(opts types.OptionMap) error

Update sends a SET request to the daemon to update its configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL