Attributes and POD
[p5sagit/Oyster.git] / lib / Oyster / Provision / Rackspace.pm
1 package Oyster::Provision::Rackspace;
2 use Moose::Role;
3
4 has 'name'    => ( is => 'ro', isa => 'Str', required => 1 );
5 has 'size'    => ( is => 'ro', isa => 'Str', required => 1 );
6 has 'image'   => ( is => 'ro', isa => 'Str', required => 1 );
7 has 'pub_ssh' => ( is => 'ro', isa => 'Str', required => 1 );
8
9 requires 'config';
10
11 sub create {
12    my $self = shift;
13
14    $self->config();
15 }
16
17 sub delete {
18    my $self = shift;
19
20    $self->config();
21 }
22
23 sub resize {
24    my $self = shift;
25
26    $self->config();
27 }
28
29 1;
30
31 __END__
32
33 =head1 NAME
34
35 Oyster::Provision::Rackspace -- Provision your Oyster on Rackspace
36
37 =head1 SYNOPSIS
38
39 Use the Rackspace backend on your Oyster configuration file
40
41 =head1 REQUIRED PARAMETERS
42
43 The following are required to instantiate a backend:
44
45 =over
46
47 =item name
48
49 The name of your new/existing rackspace server.
50
51 =item size
52
53 The size ID of the rackspace server you want to create.
54 Use the following incantation to see them:
55
56     perl -MNet::RackSpace::CloudServers -e'
57         $r=Net::RackSpace::CloudServers->new(
58             user=>$ENV{CLOUDSERVERS_USER},
59             key=>$ENV{CLOUDSERVERS_KEY},
60         );
61         print map
62             { "id $_->{id} ram $_->{ram} disk $_->{disk}\n" }
63             $r->get_flavor_detail
64     '
65     id 1 ram 256 disk 10
66     id 2 ram 512 disk 20
67     id 3 ram 1024 disk 40
68     id 4 ram 2048 disk 80
69     id 5 ram 4096 disk 160
70     id 6 ram 8192 disk 320
71     id 7 ram 15872 disk 620
72
73 =item image
74
75 The image ID of the rackspace server you want to create.
76 Use the following incantation to see them:
77
78     perl -MNet::RackSpace::CloudServers -e'
79         $r=Net::RackSpace::CloudServers->new(
80             user=>$ENV{CLOUDSERVERS_USER},
81             key=>$ENV{CLOUDSERVERS_KEY},
82         );
83         print map
84             { "id $_->{id} name $_->{name}\n" }
85             $r->get_image_detail
86     '
87     id 29 name Windows Server 2003 R2 SP2 x86
88     id 69 name Ubuntu 10.10 (maverick)
89     id 41 name Oracle EL JeOS Release 5 Update 3
90     id 40 name Oracle EL Server Release 5 Update 4
91     id 187811 name CentOS 5.4
92     id 4 name Debian 5.0 (lenny)
93     id 10 name Ubuntu 8.04.2 LTS (hardy)
94     id 23 name Windows Server 2003 R2 SP2 x64
95     id 24 name Windows Server 2008 SP2 x64
96     id 49 name Ubuntu 10.04 LTS (lucid)
97     id 14362 name Ubuntu 9.10 (karmic)
98     id 62 name Red Hat Enterprise Linux 5.5
99     id 53 name Fedora 13
100     id 17 name Fedora 12
101     id 71 name Fedora 14
102     id 31 name Windows Server 2008 SP2 x86
103     id 51 name CentOS 5.5
104     id 14 name Red Hat Enterprise Linux 5.4
105     id 19 name Gentoo 10.1
106     id 28 name Windows Server 2008 R2 x64
107     id 55 name Arch 2010.05
108
109 Oyster only supports Linux images, specifically
110 Ubuntu 10.10 (maverick).
111
112 =item pub_ssh
113
114 The public ssh key you would like copied to the
115 new server's C</root/.ssh/authorized_keys> file
116 to allow you to ssh in the box without providing
117 a root password.
118
119 =back
120
121 =cut