API-ParallelsWPB

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

    Holder, and derivatives of that collection of files created through
    textual modification. 
  - "Standard Version" refers to such a Package if it has not been modified,
    or has been modified in accordance with the wishes of the Copyright
    Holder. 
  - "Copyright Holder" is whoever is named in the copyright or copyrights for
    the package. 
  - "You" is you, if you're thinking about copying or distributing this Package.
  - "Reasonable copying fee" is whatever you can justify on the basis of media
    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

lib/API/ParallelsWPB.pm  view on Meta::CPAN

    my $self = {
        username    => '',
        password    => '',
        server      => '',
        api_version => '5.3',
        debug       => 0,
        timeout     => 30,
        (@_)
    };

    map { confess "Field '" . $_ . "' required!" unless $self->{ $_ } } qw/username password server/;

    return bless $self, $class;
}

# "free" request. Basic method for requests



sub f_request {
    my ( $self, $url_array, $data ) = @_;

lib/API/ParallelsWPB/Requests.pm  view on Meta::CPAN

uuid

    Site UUID. This parameter is mandatory.

L<Retrieving Information About a Specific Site|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=69690.htm>

=head2 B<get_sites_info($self)>

Retrieving information about all sites.

No parameters are required.

L<Retrieving Information About All Sites|http://download1.parallels.com/WPB/Doc/11.5/en-US/online/presence-builder-standalone-installation-administration-guide/index.htm?fileName=71285.htm>

=head2 B<change_site_properties($self, %param)>

Changes site properties.

%param:

state

t/04_requests.t  view on Meta::CPAN


    like( $p->{url}, qr{/api/5.3/system/version/},
        'URL for get version is ok' );

    is( $p->{data}->{req_type}, 'GET', 'Reqtype for get_version is ok' );
};

subtest 'create_site' => sub {
    plan tests => 3;

    # after site creation uuid goes to $client, and methods with uuid required can be called without uuid in params
    my $client = t::lib::Mock->new(
        username => 'test',
        password => 'passw0rd',
        server   => '127.0.0.1'
    );

    $client->create_site( state => 'regular' );
    my $p = $client->get_request_params;

    like( $p->{url}, qr{/api/5.3/sites/}, 'URL for create_site is ok' );



( run in 0.373 second using v1.01-cache-2.11-cpan-0a6323c29d9 )