clibdocker
0.1.0-alpha.0
A Docker API for C
|
Docker Networks API. More...
#include <stdlib.h>
#include "docker_result.h"
#include "docker_util.h"
#include "docker_connection_util.h"
Go to the source code of this file.
Macros | |
#define | docker_network_container_name_get(ctr) get_attr_str((json_object*)ctr, "Name") |
Get the name of the container from the docker container. More... | |
#define | docker_network_container_endpoint_id_get(ctr) get_attr_str((json_object*)ctr, "EndpointID") |
Get the endpoint id of the container from the docker container. More... | |
#define | docker_network_container_mac_address_get(ctr) get_attr_str((json_object*)ctr, "MacAddress") |
Get the mac address of the container from the docker container. More... | |
#define | docker_network_container_ipv4_address_get(ctr) get_attr_str((json_object*)ctr, "IPv4Address") |
Get the ipv4 of the container from the docker container. More... | |
#define | docker_network_container_ipv6_address_get(ctr) get_attr_str((json_object*)ctr, "IPv6Address") |
Get the ipv6 of the container from the docker container. More... | |
#define | docker_network_ipam_driver_get(ipam) get_attr_str((json_object*)ipam, "Driver") |
Get the ipam driver. More... | |
#define | docker_network_ipam_config_length(ipam) json_object_array_length(get_attr_json_object((json_object*)ipam, "Config")) |
Get the ipam config length. More... | |
#define | docker_network_ipam_config_get_idx(ipam, i) json_object_array_get_idx(get_attr_json_object((json_object*)ipam, "Config")) |
Get ith ipam config. More... | |
#define | free_docker_network(net) json_object_put((json_object*) net) |
Free the docker network object. More... | |
#define | docker_network_name_get(net) get_attr_str((json_object*)net, "Name") |
Get the name of the docker network. More... | |
#define | docker_network_id_get(net) get_attr_str((json_object*)net, "Id") |
Get the id of the docker network. More... | |
#define | docker_network_created_get(net) get_attr_str((json_object*)net, "Created") |
Get the created datetime of the docker network. More... | |
#define | docker_network_scope_get(net) get_attr_str((json_object*)net, "Scope") |
Get the scope of the docker network. More... | |
#define | docker_network_driver_get(net) get_attr_str((json_object*)net, "Driver") |
Get the network driver of the docker network. More... | |
#define | docker_network_enable_ipv6_get(net) get_attr_boolean((json_object*)net, "EnableIPv6") |
Get the EnableIPv6 flag of the docker network. More... | |
#define | docker_network_internal_get(net) get_attr_boolean((json_object*)net, "Internal") |
Get the Internal flag of the docker network. More... | |
#define | docker_network_attachable_get(net) get_attr_boolean((json_object*)net, "Attachable") |
Get the Attachable flag of the docker network. More... | |
#define | docker_network_ingress_get(net) get_attr_boolean((json_object*)net, "Ingress") |
Get the Ingress flag of the docker network. More... | |
#define | docker_network_options_get(net) get_attr_json_object((json_object*)net, "Options") |
Get the network options json object of the docker network. More... | |
#define | docker_network_options_foreach(net) json_object_object_foreach(docker_network_options_get(net), key, val) |
Iterate the network options of the docker network. More... | |
#define | docker_network_labels_get(net) get_attr_json_object((json_object*)net, "Labels") |
Get the labels list for the docker network. More... | |
#define | docker_network_labels_foreach(net) json_object_object_foreach(docker_network_labels_get(net), key, val) |
Iterate over the labels of the docker network. More... | |
#define | docker_network_ipam_get(net) (docker_network_ipam*)get_attr_json_object((json_object*)net, "IPAM") |
Get the ipam object for the docker network. More... | |
#define | docker_network_containers_get(net) get_attr_json_object((json_object*)net, "Containers") |
Get the containers list for the docker network. More... | |
#define | docker_network_containers_foreach(net) json_object_object_foreach(docker_network_containers_get(net), key, val) |
Iterate over the containers list for the docker network. More... | |
#define | free_docker_network_list(network_ls) json_object_put(network_ls) |
Free the docker network list. More... | |
#define | docker_network_list_length(network_ls) json_object_array_length(network_ls) |
Length of the docker network list. More... | |
#define | docker_network_list_get_idx(network_ls, i) (docker_network*) json_object_array_get_idx(network_ls, i) |
Get the ith network object from the docker networks list. More... | |
Typedefs | |
typedef json_object | docker_network_container |
Docker Network Container json object. More... | |
typedef json_object | docker_network_ipam |
Docker Network Ipam json object. | |
typedef json_object | docker_network |
Docker Network json object. | |
typedef json_object | docker_network_list |
docker network list object | |
Functions | |
d_err_t | docker_networks_list (docker_context *ctx, docker_network_list **networks, char *filter_driver, char *filter_id, char *filter_label, char *filter_name, char *filter_scope, char *filter_type) |
d_err_t | docker_network_inspect (docker_context *ctx, docker_network **net, char *id_or_name, int verbose, char *scope) |
Docker Networks API.
#define docker_network_attachable_get | ( | net | ) | get_attr_boolean((json_object*)net, "Attachable") |
Get the Attachable flag of the docker network.
net | docker network object |
#define docker_network_container_endpoint_id_get | ( | ctr | ) | get_attr_str((json_object*)ctr, "EndpointID") |
Get the endpoint id of the container from the docker container.
ctr | docker container |
#define docker_network_container_ipv4_address_get | ( | ctr | ) | get_attr_str((json_object*)ctr, "IPv4Address") |
Get the ipv4 of the container from the docker container.
ctr | docker container |
#define docker_network_container_ipv6_address_get | ( | ctr | ) | get_attr_str((json_object*)ctr, "IPv6Address") |
Get the ipv6 of the container from the docker container.
ctr | docker container |
#define docker_network_container_mac_address_get | ( | ctr | ) | get_attr_str((json_object*)ctr, "MacAddress") |
Get the mac address of the container from the docker container.
ctr | docker container |
#define docker_network_container_name_get | ( | ctr | ) | get_attr_str((json_object*)ctr, "Name") |
Get the name of the container from the docker container.
ctr | docker container |
#define docker_network_containers_foreach | ( | net | ) | json_object_object_foreach(docker_network_containers_get(net), key, val) |
Iterate over the containers list for the docker network.
net | docker network object |
#define docker_network_containers_get | ( | net | ) | get_attr_json_object((json_object*)net, "Containers") |
Get the containers list for the docker network.
net | docker network object |
#define docker_network_created_get | ( | net | ) | get_attr_str((json_object*)net, "Created") |
Get the created datetime of the docker network.
net | docker network object |
#define docker_network_driver_get | ( | net | ) | get_attr_str((json_object*)net, "Driver") |
Get the network driver of the docker network.
net | docker network object |
#define docker_network_enable_ipv6_get | ( | net | ) | get_attr_boolean((json_object*)net, "EnableIPv6") |
Get the EnableIPv6 flag of the docker network.
net | docker network object |
#define docker_network_id_get | ( | net | ) | get_attr_str((json_object*)net, "Id") |
Get the id of the docker network.
net | docker network object |
#define docker_network_ingress_get | ( | net | ) | get_attr_boolean((json_object*)net, "Ingress") |
Get the Ingress flag of the docker network.
net | docker network object |
#define docker_network_internal_get | ( | net | ) | get_attr_boolean((json_object*)net, "Internal") |
Get the Internal flag of the docker network.
net | docker network object |
#define docker_network_ipam_config_get_idx | ( | ipam, | |
i | |||
) | json_object_array_get_idx(get_attr_json_object((json_object*)ipam, "Config")) |
Get ith ipam config.
ipam | network ipam object |
i | index |
#define docker_network_ipam_config_length | ( | ipam | ) | json_object_array_length(get_attr_json_object((json_object*)ipam, "Config")) |
Get the ipam config length.
ipam | network ipam object |
#define docker_network_ipam_driver_get | ( | ipam | ) | get_attr_str((json_object*)ipam, "Driver") |
Get the ipam driver.
ipam | network ipam object |
#define docker_network_ipam_get | ( | net | ) | (docker_network_ipam*)get_attr_json_object((json_object*)net, "IPAM") |
Get the ipam object for the docker network.
net | docker network object |
#define docker_network_labels_foreach | ( | net | ) | json_object_object_foreach(docker_network_labels_get(net), key, val) |
Iterate over the labels of the docker network.
net | docker network object |
#define docker_network_labels_get | ( | net | ) | get_attr_json_object((json_object*)net, "Labels") |
Get the labels list for the docker network.
net | docker network object |
#define docker_network_list_get_idx | ( | network_ls, | |
i | |||
) | (docker_network*) json_object_array_get_idx(network_ls, i) |
Get the ith network object from the docker networks list.
network_ls | network list object |
i | index |
#define docker_network_list_length | ( | network_ls | ) | json_object_array_length(network_ls) |
Length of the docker network list.
network_ls | network list object |
#define docker_network_name_get | ( | net | ) | get_attr_str((json_object*)net, "Name") |
Get the name of the docker network.
net | docker network object |
#define docker_network_options_foreach | ( | net | ) | json_object_object_foreach(docker_network_options_get(net), key, val) |
Iterate the network options of the docker network.
net | docker network object |
#define docker_network_options_get | ( | net | ) | get_attr_json_object((json_object*)net, "Options") |
Get the network options json object of the docker network.
net | docker network object |
#define docker_network_scope_get | ( | net | ) | get_attr_str((json_object*)net, "Scope") |
Get the scope of the docker network.
net | docker network object |
#define free_docker_network | ( | net | ) | json_object_put((json_object*) net) |
Free the docker network object.
net | docker network object |
#define free_docker_network_list | ( | network_ls | ) | json_object_put(network_ls) |
Free the docker network list.
network_ls | network list object |
typedef json_object docker_network_container |
Docker Network Container json object.
This object represents the container details inside the response of the docker network api call response.
d_err_t docker_network_inspect | ( | docker_context * | ctx, |
docker_network ** | net, | ||
char * | id_or_name, | ||
int | verbose, | ||
char * | scope | ||
) |
Inspect details of a network looked up by name or id.
ctx | docker context |
net | details of the network returned |
id_or_name | id or name of the network to be looked up |
verbose | whether inspect output is verbose (0 means false, true otherwise) |
scope | filter by one of swarm, global, or local |
d_err_t docker_networks_list | ( | docker_context * | ctx, |
docker_network_list ** | networks, | ||
char * | filter_driver, | ||
char * | filter_id, | ||
char * | filter_label, | ||
char * | filter_name, | ||
char * | filter_scope, | ||
char * | filter_type | ||
) |
List all networks which match the filters given. If all filters are null, then all networks are listed.
ctx | docker context |
networks | the array_list of networks to be returned |
filter_driver | |
filter_id | |
filter_label | |
filter_name | |
filter_scope | |
filter_type |
References make_docker_call(), and docker_context_t::url.