Podman::Client - Podman service client.
# Send service requests my $client = Podman::Client->new; my $res = $client->delete('images/docker.io/library/hello-world'); my $res = $client->get('version'); my $res = $client->post('containers/prune');
Podman::Client wrap Mojo::UserAgent
Podman::Client is a HTTP client (user agent) with the needed support to connect to and query the Podman service.
$client->connection_url('https://127.0.0.1:1234');
URL to connect to Podman service, defaults to user UNIX domain socket in rootless mode e.g. http+unix://run/user/1000/podman/podman.sock otherwise http+unix:///run/podman/podman.sock. Customize via the value of PODMAN_CONNECTION_URL environment variable.
http+unix://run/user/1000/podman/podman.sock
http+unix:///run/podman/podman.sock
PODMAN_CONNECTION_URL
Podman::Client provides the valid HTTP requests to query the Podman service. All methods take a relative endpoint path, optional header parameters and path parameters. if the response has a HTTP code unequal 2xx a Podman::Exception is raised.
2xx
my $res = $client->delete('images/docker.io/library/hello-world');
Perform DELETE request and return resulting content.
DELETE
my $res = $client->get('version');
Perform GET request and return resulting content.
GET
my $res = $client->post( 'build', data => $archive_file, # Mojo::File object parameters => { 'file' => 'Dockerfile', 't' => 'localhost/goodbye', }, headers => { 'Content-Type' => 'application/x-tar' }, );
Perform POST request and return resulting content, takes additional optional request data.
POST
Tobias Schäfer, <tschaefer@blackox.org>
Copyright (C) 2022-2022, Tobias Schäfer.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
To install Podman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Podman
CPAN shell
perl -MCPAN -e shell install Podman
For more information on module installation, please visit the detailed CPAN module installation guide.