For every single of operation on the entities use the following templates and provide sample REST requests and responses.
Remember that the following Uniform Contract rules must be used :
Operation on Entities | Uniform API Operation | Description |
Query Entities | GET Resource | GET must be used to retrieve a representation of a resource. |
Create Entity | POST Resource | POST must be used to create a new resource |
Partial Update of an Entity | PATCH Resource | PATCH must be used to partially update a resource |
Complete Update of an Entity | PUT Resource | PUT must be used to completely update a resource identified by its resource URI |
Remove an Entity | DELETE Resource | DELETE must be used to remove a resource |
Filtering and attribute selection rules are described in the TMF REST Design Guidelines.
Notifications are also described in a subsequent section.
GET /inventoryApi/product/{ID}
This Uniform Contract operation is used to retrieve the representation of a product inventory.
Note that collections can be retrieved via GET /inventoryApi/product with no {ID}
Description :
- Allows to retrieve product inventory content
- Filtering is enabled on all attributes and field selection also
- The resource is a managed entity.
- The identifier is an hyperlink
Behavior :
- Returns HTTP/1.1 status code 200 if the request was successful.
Case : Querying the product inventory to retrieve an overview of all the top level products for a given customer
REQUEST |
GET /inventoryApi/product/?relatedParties.role=customer&relatedParties.reference=42&isTopLevel=true&fields=name, description, status |
RESPONSE |
200 |
PUT inventoryApi/product/{ID}
This Uniform Contract operation is used to completely update the representation of a product.
Description :
- Replaces a product entry inside the inventory
- The resource is a managed entity
Behavior :
- Returns HTTP/1.1 status code 201 if the request was successful.
- Standard error codes in case of errors.
REQUEST |
PUT inventoryApi/product/42 |
RESPONSE |
201 |
PATCH inventoryAPI/product/{ID}
Description :
- Partially updates a product entry in the inventory
- The resource is a managed entity
Behavior :
- Returns HTTP/1.1 status code 201 if the request was successful.
- Standard error codes in case of an error.
Case : Patch the product inventory entry once the service delivery is fully done, thus linking the service ID to the product instance
REQUEST |
PATCH inventoryApi/product/42 |
RESPONSE |
201 |
POST inventoryAPI/product
Description :
- Allows to create a new product entry in the inventory
- The resource is a managed entity
Behavior :
- Returns HTTP/1.1 status code 201 if the request was successful.
- Standard error codes in case of an error.
REQUEST |
POST inventoryApi/product |
RESPONSE |
201 |
DELETE inventoryApi/product/{ID}
Description :
- Delete a product in the inventory
Behavior :
- Returns HTTP/1.1 status code 200 if the request was successful.
- Standard error codes in case of an error.
- Under certain policies, some errors may be raised when using this operation (for example if integrity violations are forbidden in the inventory).
REQUEST |
DELETE inventoryApi/product/42 |
RESPONSE |
200 |
© TM Forum 2015. All Rights Reserved.