Eixo-Docker

 view release on metacpan or  search on metacpan

lib/Eixo/Docker/Container.pm  view on Meta::CPAN

    $self->__exec("restart", %args);

}

sub kill {
    my ($self, %args) = @_;

    $self->__exec("kill", %args);

}

sub copy{
	my ($self, %args) = @_;

	$args{id} = $self->Id unless($args{id});
	$args{action} = 'copy';

	$args{__format} = 'RAW';

	$self->api->postContainers(

		needed=>[qw(Resource)],

		args=>\%args,
	
		post_params=>[qw(Resource)],

		onProgress=>sub {
		},

		__callback=>sub {

			#use Data::Dumper; print Dumper(\@_);

			return $_[0] || $_[1]->buffer;

		}
	);
}

sub attach{
	my ($self, %args) = @_;

	$args{id} = $self->Id unless($args{id});

	$args{action} = 'attach';
	
	$args{$_} = $args{$_} || 0 foreach(qw(logs stream stdin stdout stderr));


    Eixo::Docker::RequestRawStream->new(

    	entity=>'containers',

    	id=>$args{id},

    	action=>'attach',

    	method=>'POST',

    	host=>$self->api->client->endpoint,

    	args=>\%args,

    	url_args=>[qw(logs stream stdin stdout stderr)],

    	f_line=>$args{f_line} || $Eixo::Docker::IDENTITY_FUNC,

        f_process => $args{f_process} || $Eixo::Docker::IDENTITY_FUNC,

        timeout => $args{timeout} || 60,

        tty_mode => $self->get(id => $args{id})->Config->Tty,

    )->process();

}

sub top{
	my ($self, %args) = @_;

	$args{id} = $self->Id unless($args{id});

	$args{__implicit_format} = 1;
	
	$args{action} = 'top';

	$self->api->getContainers(

		args=>\%args,

		get_params=>[qw(ps_args)],

		__callback=>sub{

			use Data::Dumper; print Dumper(\@_);

		}
		

	);

}

sub rename{
	my ($self, %args) = @_;

	$args{id} = $self->Id unless($args{id});

	$args{__implicit_format} = 1;

	$args{action} = 'rename';

	$self->api->postContainers(

		args=>\%args,

		get_params=>[qw(name)],

		needed=>[qw(name)],



( run in 1.505 second using v1.01-cache-2.11-cpan-524268b4103 )