API-Docker

 view release on metacpan or  search on metacpan

lib/API/Docker/Network.pm  view on Meta::CPAN

=head2 Id

Network ID.

=head2 Name

Network name.

=head2 Driver

Network driver (e.g., C<bridge>, C<overlay>).

=head2 inspect

    my $updated = $network->inspect;

Get fresh network information.

=head2 remove

    $network->remove;

t/fixtures/container_inspect.json  view on Meta::CPAN

    "Dead": false,
    "Pid": 12345,
    "ExitCode": 0,
    "Error": "",
    "StartedAt": "2025-01-15T08:00:01.000000000Z",
    "FinishedAt": "0001-01-01T00:00:00Z"
  },
  "Image": "sha256:abc123def456",
  "Name": "/my-container",
  "RestartCount": 0,
  "Driver": "overlay2",
  "Platform": "linux",
  "HostConfig": {
    "NetworkMode": "default",
    "RestartPolicy": {
      "Name": "no",
      "MaximumRetryCount": 0
    }
  },
  "Config": {
    "Hostname": "abc123def456",

t/fixtures/system_info.json  view on Meta::CPAN

{
  "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS",
  "Containers": 14,
  "ContainersRunning": 3,
  "ContainersPaused": 1,
  "ContainersStopped": 10,
  "Images": 25,
  "Driver": "overlay2",
  "DriverStatus": [
    ["Backing Filesystem", "extfs"],
    ["Supports d_type", "true"],
    ["Using metacopy", "false"],
    ["Native Overlay Diff", "true"]
  ],
  "DockerRootDir": "/var/lib/docker",
  "SystemTime": "2025-01-15T10:30:00.000000000Z",
  "Name": "test-host",
  "ServerVersion": "27.4.1",

t/system.t  view on Meta::CPAN

  ok($info->{ServerVersion}, 'has ServerVersion');
  ok($info->{OperatingSystem}, 'has OperatingSystem');
  ok($info->{Architecture}, 'has Architecture');

  unless (is_live()) {
    is($info->{Containers}, 14, 'container count');
    is($info->{ContainersRunning}, 3, 'running containers');
    is($info->{ContainersPaused}, 1, 'paused containers');
    is($info->{ContainersStopped}, 10, 'stopped containers');
    is($info->{Images}, 25, 'image count');
    is($info->{Driver}, 'overlay2', 'storage driver');
    is($info->{Name}, 'test-host', 'hostname');
    is($info->{ServerVersion}, '27.4.1', 'server version');
    is($info->{OperatingSystem}, 'Debian GNU/Linux 12 (bookworm)', 'os');
    is($info->{Architecture}, 'x86_64', 'architecture');
    is($info->{NCPU}, 4, 'cpu count');
  }
};

subtest 'system version' => sub {
  my $docker = test_docker(



( run in 0.743 second using v1.01-cache-2.11-cpan-71847e10f99 )