Conch API

Logo

Datacenter build and management service

View the Project on GitHub joyent/conch-api

Conch::Route::HardwareProduct

SOURCE

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

METHODS

routes

Sets up the routes for /hardware_product.

ROUTE ENDPOINTS

All routes require authentication.

GET /hardware_product

POST /hardware_product

GET /hardware_product/:hardware_product_id_or_other

Identifiers accepted: id, sku, name and alias.

POST /hardware_product/:hardware_product_id_or_other

Updates the indicated hardware product.

Identifiers accepted: id, sku, name and alias.

DELETE /hardware_product/:hardware_product_id_or_other

Deactivates the indicated hardware product, preventing it from being used. All devices using this hardware must be switched to other hardware first.

Identifiers accepted: id, sku, name and alias.

PUT /hardware_product/:hardware_product_id_or_other/specification?path=:path_to_data

Sets a specific part of the json blob data in the specification field, treating the URI query parameter path as the JSON pointer to the data to be added or modified. Existing data at the path is overwritten without regard to type, so long as the JSON Schema is respected. For example, this existing specification field and this request:

{
  "foo": { "bar": 123 },
  "x": { "y": [ 1, 2, 3 ] }
}

PUT /hardware_product/:hardware_product_id_or_other/specification?path=/foo/bar/baz  { "hello":1 }

Results in this data in specification, changing the data type at node /foo/bar:

{
  "foo": { "bar": { "baz": { "hello": 1 } } },
  "x": { "y": [ 1, 2, 3 ] }
}

DELETE /hardware_product/:hardware_product_id_or_other/specification?path=:path_to_data

Deletes a specific part of the json blob data in the specification field, treating the URI query parameter path as the JSON pointer to the data to be removed. All other properties in the json blob are left untouched.

After the delete operation, the specification property must validate against the schema available from GET /json_schema/hardware_product/specification/latest.

GET /hardware/:hardware_product_id_or_other/json_schema

Retrieves a summary of the JSON Schemas configured to be used as validations for the indicated hardware. Note the timestamp and user information are for when the JSON Schema was added for the hardware, not when the schema itself was created.

POST /hardware/:hardware_product_id_or_other/json_schema/:json_schema_id

POST /hardware/:hardware_product_id_or_other/json_schema/:json_schema_type/:json_schema_name/:json_schema_version

Adds the indicated JSON Schema to the list of validations for the indicated hardware.

DELETE /hardware/:hardware_product_id_or_other/json_schema/:json_schema_id

DELETE /hardware/:hardware_product_id_or_other/json_schema/:json_schema_type/:json_schema_name/:json_schema_version

Removes the indicated JSON Schema from the list of validations for the indicated hardware.

DELETE /hardware/:hardware_product_id_or_other/json_schema

Removes all the JSON Schemas from the list of validations for the indicated hardware.

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/.