Conch API

Logo

Datacenter build and management service

View the Project on GitHub joyent/conch-api

Conch::Route

SOURCE

https://github.com/joyent/conch-api/blob/master/lib/Conch/Route.pm

DESCRIPTION

Set up all the routes for the Conch Mojo application.

METHODS

all_routes

Set up the full route structure

SHORTCUTS

These are available on all routes. See “Shortcuts” in Mojolicious::Guides::Routing.

require_system_admin

Chainable route that aborts with HTTP 403 if the user is not a system admin.

find_user_from_payload

Chainable route that looks up the user by user_id or email in the JSON payload, aborting with HTTP 410 or HTTP 404 if not found.

root

Returns the root node.

ROUTE ENDPOINTS

Unless otherwise specified, all routes require authentication.

Full access is granted to system admin users, regardless of build or other role entries.

Successful (HTTP 2xx code) response structures are as described for each endpoint.

Error responses will use:

GET /ping

GET /version

POST /login

POST /logout

POST /refresh_token

GET /me

* /dc, * /room, * /rack_role, * /rack, * /layout

See “routes” in Conch::Route::Datacenter

* /device

See “routes” in Conch::Route::Device

* /device_report

See “routes” in Conch::Route::DeviceReport

* /hardware_product

See “routes” in Conch::Route::HardwareProduct

* /hardware_vendor

See “routes” in Conch::Route::HardwareVendor

* /organization

See “routes” in Conch::Route::Organization

* /relay

See “routes” in Conch::Route::Relay

* /json_schema

See “unsecured_routes” in Conch::Route::JSONSchema

* /user

See “routes” in Conch::Route::User

* /validation_plan

See “routes” in Conch::Route::ValidationPlan

* /validation_state

See “routes” in Conch::Route::ValidationState

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 https://www.mozilla.org/en-US/MPL/2.0/.