29 #ifndef SRC_DOCKER_SYSTEM_H_
30 #define SRC_DOCKER_SYSTEM_H_
39 #include <json-c/json_object.h>
60 #define free_docker_version(version) json_object_put((json_object*) version)
68 #define docker_version_version_get(version) get_attr_str((json_object*)version, "Version")
76 #define docker_version_os_get(version) get_attr_str((json_object*)version, "Os")
84 #define docker_version_kernel_version_get(version) get_attr_str((json_object*)version, "KernelVersion")
92 #define docker_version_go_version_get(version) get_attr_str((json_object*)version, "GoVersion")
100 #define docker_version_git_commit_get(version) get_attr_str((json_object*)version, "GitCommit")
108 #define docker_version_arch_get(version) get_attr_str((json_object*)version, "Arch")
116 #define docker_version_api_version_get(version) get_attr_str((json_object*)version, "ApiVersion")
124 #define docker_version_min_api_version_get(version) get_attr_str((json_object*)version, "MinAPIVersion")
132 #define docker_version_build_time_get(version) get_attr_str((json_object*)version, "BuildTime")
140 #define docker_version_experimental_get(version) get_attr_boolean((json_object*)version, "Experimental")
164 #define free_docker_info(info) json_object_put((json_object*) info)
172 #define docker_info_containers_get(info) get_attr_unsigned_long((json_object*)info, "Containers")
180 #define docker_info_containers_running_get(info) get_attr_unsigned_long((json_object*)info, "ContainersRunning")
188 #define docker_info_containers_paused_get(info) get_attr_unsigned_long((json_object*)info, "ContainersPaused")
196 #define docker_info_containers_stopped_get(info) get_attr_unsigned_long((json_object*)info, "ContainersStopped")
204 #define docker_info_images_get(info) get_attr_unsigned_long((json_object*)info, "Images")
212 #define docker_info_name_get(info) get_attr_str((json_object*)info, "Name")
220 #define docker_info_ncpu_get(info) get_attr_int((json_object*)info, "NCPU")
228 #define docker_info_mem_total_get(info) get_attr_unsigned_long((json_object*)info, "MemTotal")
253 #define free_docker_event_list(event_ls) arraylist_free(event_ls)
261 #define docker_event_list_length(event_ls) arraylist_length(event_ls)
270 #define docker_event_list_get_idx(event_ls, i) arraylist_get(event_ls, i)
282 #define free_docker_event(event) json_object_put((json_object*) event)
290 #define docker_event_type_get(event) get_attr_str((json_object*)event, "Type")
298 #define docker_event_action_get(event) get_attr_str((json_object*)event, "Action")
306 #define docker_event_time_get(event) get_attr_unsigned_long((json_object*)event, "time")
314 #define docker_event_actor_id_get(event) get_attr_str(get_attr_json_object((json_object*)event, "Actor"), "ID")
323 #define docker_event_attributes_get(event) get_attr_json_object(get_attr_json_object((json_object*)event, "Actor"), "Attributes")
330 #define docker_event_attributes_foreach(event) json_object_object_foreach(docker_event_attributes_get(event), key, val)
342 arraylist** events, time_t start_time, time_t end_time);
356 void (*docker_events_cb)(
docker_event* evt,
void* cbargs),
void* cbargs,
357 arraylist** events, time_t start_time, time_t end_time);
398 #define docker_df_image_id_get(img) get_attr_str((json_object*)img, "Id")
406 #define docker_df_image_parent_id_get(img) get_attr_str((json_object*)img, "ParentId")
414 #define docker_df_image_created_get(img) get_attr_unsigned_long((json_object*)img, "Created")
422 #define docker_df_image_size_get(img) get_attr_unsigned_long((json_object*)img, "Size")
430 #define docker_df_image_shared_size_get(img) get_attr_unsigned_long((json_object*)img, "SharedSize")
438 #define docker_df_image_virtual_size_get(img) get_attr_unsigned_long((json_object*)img, "VirtualSize")
446 #define docker_df_image_containers_get(img) get_attr_unsigned_long((json_object*)img, "Containers")
454 #define docker_df_image_repo_tags_get(img) get_attr_json_object((json_object*)img, "RepoTags")
462 #define docker_df_image_repo_tags_length(img) json_object_array_length(docker_df_image_repo_tags_get(img))
471 #define docker_df_image_repo_tags_get_idx(img, i) (const char*)json_object_array_get_idx(docker_df_image_repo_tags_get(img), i)
479 #define docker_df_image_repo_digests_get(img) get_attr_json_object((json_object*)img, "RepoDigests")
487 #define docker_df_image_repo_digests_length(img) json_object_array_length(docker_df_image_repo_digests_get(img))
496 #define docker_df_image_repo_digests_get_idx(img, i) (const char*)json_object_array_get_idx(docker_df_image_repo_digests_get(img), i)
504 #define docker_df_container_id_get(ctr) get_attr_str((json_object*)ctr, "Id")
512 #define docker_df_container_image_get(ctr) get_attr_str((json_object*)ctr, "Image")
520 #define docker_df_container_image_id_get(ctr) get_attr_str((json_object*)ctr, "ImageID")
528 #define docker_df_container_command_get(ctr) get_attr_str((json_object*)ctr, "Command")
536 #define docker_df_container_created_get(ctr) get_attr_unsigned_long((json_object*)ctr, "Created")
544 #define docker_df_container_size_rootfs_get(ctr) get_attr_unsigned_long((json_object*)ctr, "SizeRootFs")
552 #define docker_df_container_state_get(ctr) get_attr_str((json_object*)ctr, "State")
560 #define docker_df_container_status_get(ctr) get_attr_str((json_object*)ctr, "Status")
568 #define docker_df_volume_name_get(vol) get_attr_str((json_object*)vol, "Name")
576 #define docker_df_volume_driver_get(vol) get_attr_str((json_object*)vol, "Driver")
584 #define docker_df_volume_mountpoint_get(vol) get_attr_str((json_object*)vol, "Mountpoint")
592 #define docker_df_volume_scope_get(vol) get_attr_str((json_object*)vol, "Scope")
600 #define docker_df_volume_usage_data_get(vol) (docker_df_volume_usage_data*)get_attr_json_object((json_object*)vol, "UsageData")
608 #define docker_df_volume_usage_data_size_get(ud) get_attr_unsigned_long((json_object*)ud, "Size")
616 #define docker_df_volume_usage_data_ref_count_get(ud) get_attr_unsigned_long((json_object*)ud, "RefCount")
624 #define docker_df_container_names_get(ctr) get_attr_json_object((json_object*)ctr, "Names")
632 #define docker_df_container_names_length(ctr) json_object_array_length(docker_df_container_names_get(ctr))
641 #define docker_df_container_names_get_idx(ctr, i) (const char*)json_object_array_get_idx(docker_df_container_names_get(ctr), i)
649 #define docker_df_container_mounts_get(ctr) get_attr_json_object((json_object*)ctr, "Mounts")
657 #define docker_df_container_mounts_length(ctr) json_object_array_length(docker_df_container_mounts_get(ctr))
666 #define docker_df_container_mounts_get_idx(ctr, i) (const char*)json_object_array_get_idx(docker_df_container_mounts_get(ctr), i)
673 #define free_docker_df(df) json_object_put((json_object*) df)
681 #define docker_df_layers_size_get(df) get_attr_unsigned_long((json_object*)df, "LayersSize")
689 #define docker_df_images_get(df) get_attr_json_object((json_object*)df, "Images")
697 #define docker_df_images_length(df) json_object_array_length(docker_df_images_get(df))
706 #define docker_df_images_get_idx(df, i) (docker_df_image*)json_object_array_get_idx(docker_df_images_get(df), i)
714 #define docker_df_containers_get(df) get_attr_json_object((json_object*)df, "Containers")
722 #define docker_df_containers_length(df) json_object_array_length(docker_df_containers_get(df))
731 #define docker_df_containers_get_idx(df, i) (docker_df_container*)json_object_array_get_idx(docker_df_containers_get(df), i)
739 #define docker_df_volumes_get(df) get_attr_json_object((json_object*)df, "Volumes")
747 #define docker_df_volumes_length(df) json_object_array_length(docker_df_volumes_get(df))
756 #define docker_df_volumes_get_idx(df, i) (docker_df_volume*)json_object_array_get_idx(docker_df_volumes_get(df), i)
Includes all public API header files of clibdocker, thus exposing the entire public API via one heade...
enum _config_error d_err_t
Definition: docker_result.h:60
arraylist docker_event_list
Docker Event List json object.
Definition: docker_system.h:246
json_object docker_df_image
Docker image disk usage (image df) json object.
Definition: docker_system.h:375
json_object docker_event
Docker Event json object.
Definition: docker_system.h:275
json_object docker_df_container
Docker container disk usage (container df) json object.
Definition: docker_system.h:380
d_err_t docker_system_df(docker_context *ctx, docker_df **df)
Definition: docker_system.c:162
json_object docker_version
Docker Version json object.
Definition: docker_system.h:55
d_err_t docker_system_events_cb(docker_context *ctx, void(*docker_events_cb)(docker_event *evt, void *cbargs), void *cbargs, arraylist **events, time_t start_time, time_t end_time)
Definition: docker_system.c:101
d_err_t docker_system_events(docker_context *ctx, arraylist **events, time_t start_time, time_t end_time)
Definition: docker_system.c:88
d_err_t docker_system_info(docker_context *ctx, docker_info **info)
Definition: docker_system.c:62
d_err_t docker_system_version(docker_context *ctx, docker_version **version)
Definition: docker_system.c:49
json_object docker_df_volume_usage_data
Docker volume usage (volume usage df) json object.
Definition: docker_system.h:390
json_object docker_df_volume
Docker volume disk usage (volume df) json object.
Definition: docker_system.h:385
json_object docker_df
Docker disk usage (df) json object.
Definition: docker_system.h:370
json_object docker_info
Docker Info json object. This object represents the response returned from a docker system info call.
Definition: docker_system.h:159
d_err_t docker_ping(docker_context *ctx)
Ping the docker server. Returns E_SUCCESS(0) if the server is reachable.
Definition: docker_system.c:33
A docker context for a specific docker server.
Definition: docker_connection_util.h:141