This repository has been archived by the owner on Jul 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
HardwareVendor.pm
107 lines (61 loc) · 2.21 KB
/
HardwareVendor.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package Conch::Route::HardwareVendor;
use Mojo::Base -strict;
=pod
=head1 NAME
Conch::Route::HardwareVendor
=head1 METHODS
=head2 routes
Sets up the routes for /hardware_vendor.
=cut
sub routes {
my $class = shift;
my $hv = shift; # secured, under /hardware_vendor
$hv->to({ controller => 'hardware_vendor' });
# GET /hardware_vendor
$hv->get('/')->to('#get_all', response_schema => 'HardwareVendors');
{
my $with_hv = $hv->under('/:hardware_vendor_id_or_name')
->to('#find_hardware_vendor');
# GET /hardware_vendor/:hardware_vendor_id_or_name
$with_hv->get('/')->to('#get_one', response_schema => 'HardwareVendor');
# DELETE /hardware_vendor/:hardware_vendor_id_or_name
$with_hv->require_system_admin->delete('/')->to('#delete');
}
# POST /hardware_vendor/:hardware_vendor_name
$hv->require_system_admin->post('/:hardware_vendor_name')->to('#create', request_schema => 'Null');
}
1;
__END__
=pod
=head1 ROUTE ENDPOINTS
All routes require authentication.
=head2 C<GET /hardware_vendor>
=over 4
=item * Controller/Action: L<Conch::Controller::HardwareVendor/get_all>
=item * Response: F<response.yaml#/$defs/HardwareVendors>
=back
=head2 C<GET /hardware_vendor/:hardware_vendor_id_or_name>
=over 4
=item * Controller/Action: L<Conch::Controller::HardwareVendor/get_one>
=item * Response: F<response.yaml#/$defs/HardwareVendor>
=back
=head2 C<DELETE /hardware_vendor/:hardware_vendor_id_or_name>
=over 4
=item * Requires system admin authorization
=item * Controller/Action: L<Conch::Controller::HardwareVendor/delete>
=item * Response: C<204 No Content>
=back
=head2 C<POST /hardware_vendor/:hardware_vendor_name>
=over 4
=item * Requires system admin authorization
=item * Controller/Action: L<Conch::Controller::HardwareVendor/create>
=item * Request: F<request.yaml#/$defs/Null>
=item * Response: C<201 Created>, plus Location header
=back
=head1 LICENSING
Copyright Joyent, Inc.
This Source Code Form is subject to the terms of the Mozilla Public License,
v.2.0. If a copy of the MPL was not distributed with this file, You can obtain
one at L<https://www.mozilla.org/en-US/MPL/2.0/>.
=cut
# vim: set sts=2 sw=2 et :