-
Notifications
You must be signed in to change notification settings - Fork 27
ConductorAPIResourceRepresentation
This page outlines the format Conductor API will use for representing resources. All examples are shown in XML, we will use equivalent representations for any other formats we support.
- XML
- JSON
These bullets are taken from the original Wiki page Conductor_Image_Management_API_design, from which the basis of our API design was created. This is largely based on XML (since this is our initial focus). When implementing JSON we should try our best to stick to the below points. If this is not possible, we should confer.
-
Resources are mapped to XML elements with a tag name equal to the resource type.
-
Attributes of resources are mapped to XML child elements with the tag name equal to the attribute name.
-
id and href attributes shall exist on all resources on the root element, where the id is the unique identifier of the resource and the href is an absolute URL pointing to the resource.
- This is not strictly correct. The URL should be the unique identifier of the resource.
-
Relationships should be included in the resource, and should be in the form resource type, including id and href only.
- Example: Instance with Image Relation
-
For one to many relations include a collection with href and show only relational (minimal) elements.
- Example: Image with one to many relationship with instance