NAME

Podman::Client - Podman service client.

SYNOPSIS

# 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');

DESCRIPTION

Inheritance

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.

ATTRIBUTES

connection_url

$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.

METHODS

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.

delete

my $res = $client->delete('images/docker.io/library/hello-world');

Perform DELETE request and return resulting content.

get

my $res = $client->get('version');

Perform GET request and return resulting content.

post

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.

AUTHORS

    Tobias Schäfer, <tschaefer@blackox.org>

COPYRIGHT AND LICENSE

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.