File Coverage

blib/lib/WebService/ProfitBricks/Storage.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4             # vim: set ts=3 sw=3 tw=0:
5             # vim: set expandtab:
6              
7             =head1 NAME
8              
9             WebService::ProfitBricks::Storage - Manage servers.
10              
11             =head1 DESCRIPTION
12              
13             Manage the storages of your datacenter.
14              
15             =head1 SYNOPSIS
16              
17             my $stor1 = $dc->storage->new(size => 50, storageName => "store01", mountImageId => $use_image, profitBricksImagePassword => $root_pw);
18             $stor1->save;
19              
20             =head1 METHODS
21              
22             =over 4
23              
24             =cut
25            
26             package WebService::ProfitBricks::Storage;
27              
28 1     1   1396 use strict;
  1         1  
  1         35  
29 1     1   4 use warnings;
  1         3  
  1         25  
30              
31 1     1   6 use WebService::ProfitBricks::Class;
  1         2  
  1         89  
32 1     1   5 use base qw(WebService::ProfitBricks);
  1         2  
  1         112  
33              
34             attrs qw/storageId
35             storageName
36             creationTime
37             lastModificationTime
38             provisioningState
39             size
40             serverId
41             mountImageId
42             profitBricksImagePassword
43             osType/;
44              
45              
46             serializer xml => { container => "arg0" };
47              
48             belongs_to datacenter => "WebService::ProfitBricks::DataCenter" => { through => "dataCenterId" };
49              
50             =item connect($server_id)
51              
52             Connect the storage to a server.
53              
54             $stor1->connect($srv->serverId);
55              
56             =cut
57             sub connect {
58             my ($self, $server_id) = @_;
59             my $data = $self->connection->call("connectStorageToServer", storageId => $self->storageId, serverId => $server_id);
60             $self->provisioningState($data);
61             }
62              
63             =back
64              
65             =cut
66              
67             "We've got brains!";