| 1 | package Net::Fastly::Director; | ||
| 2 | |||
| 3 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use base qw(Net::Fastly::BelongsToServiceAndVersion); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 5 | Net::Fastly::Director->mk_accessors(qw(service_id name comment type capacity retries quorum comment)); | |
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Net::Fastly::Director - Representation of an a logical collection of backends - for example all the asset servers in one data center | ||
| 11 | |||
| 12 | =head1 ACCESSORS | ||
| 13 | |||
| 14 | =head2 service | ||
| 15 | |||
| 16 | The id of the service this belongs to. | ||
| 17 | |||
| 18 | =head2 version | ||
| 19 | |||
| 20 | The number of the version this belongs to. | ||
| 21 | |||
| 22 | =head2 name | ||
| 23 | |||
| 24 | The domain name of this domain | ||
| 25 | |||
| 26 | =head2 type | ||
| 27 | |||
| 28 | what kind of Load Balancer group (currently always 1 meaning random) | ||
| 29 | |||
| 30 | =head2 retries | ||
| 31 | |||
| 32 | how many backends to search if it fails (default 5) | ||
| 33 | |||
| 34 | =head2 quorum | ||
| 35 | |||
| 36 | the percentage of capacity that needs to be up for a director to be considered up (default 75) | ||
| 37 | |||
| 38 | =head2 comment | ||
| 39 | |||
| 40 | a free form comment field | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | =head2 add_backend <backend object> | ||
| 45 | |||
| 46 | Add a Backend to a Director. | ||
| 47 | |||
| 48 | Returns true on success and false on failure. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | 0 | ▶ | sub add_backend { |
|
Subroutine
add_backend: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my $self = shift; | |
| 53 | 0 | my $backend = shift; | |
| 54 | 0 | my $hash = $self->_fetcher->client->_post($self->_put_path($self)."/backend/".$backend->name); | |
| 55 | 0 | return !!(keys %$hash); | |
| 56 | } | ||
| 57 | |||
| 58 | =head2 delete_backend <backend object> | ||
| 59 | |||
| 60 | Delete a Backend from a Director | ||
| 61 | |||
| 62 | Returns true on success and false on failure. | ||
| 63 | |||
| 64 | =cut | ||
| 65 | 0 | ▶ | sub delete_backend { |
|
Subroutine
delete_backend: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 66 | 0 | my $self = shift; | |
| 67 | 0 | my $backend = shift; | |
| 68 | 0 | my $hash = $self->_fetcher->client->_delete($self->_put_path($self)."/backend/".$backend->name); | |
| 69 | 0 | return !!(keys %$hash); | |
| 70 | } | ||
| 71 | |||
| 72 | 5 | 1; | |