aiosnow
aiosnow copied to clipboard
Add support for catalog requests
Requesting a way into an api for submitting a form to a catalog request and kicking off the REQ/RITM/SCTASK. There seems to have to do with glide records rather than tables like incidents, change records, cmdb, etc.
catalog item API is SIGNIFICANTLY different from the Table API. Both the process and data architecture are complicated which makes it much more challenging to implement. There are 24 API resources and all of them would have to be implemented to get to full functionality.
The process for it is so divergent from the table model that a separate project might be better. It could use this project as a dependency, but implementing it as part of this project might just mess up all of the nice clean logic of Table API.
https://developer.servicenow.com/dev.do#!/reference/api/paris/rest/c_ServiceCatalogAPI
Good points @manvillej, thanks.
aiosnow was designed to support multiple APIs, I think this can be implemented cleanly. I've created an investigation task and associated with this issue. You'll be notified when there's an update.
@rbw I'm positive you've been quite busy, just wondering if you've had any luck on the investigation side
There are 5 APIs that need to be mapped. Should be fairly easy if we build on top of aiosnow.models.table.BaseTableModel.
-
cart
- nested schema for recurring_frequency
- nested schema for recurring_frequency.items
- something custom for /sn_sc/servicecatalog/cart/delivery_address/{user_id}
-
catalogs
- something custom for /sn_sc/servicecatalog/catalogs/{sys_id}/categories
- categories
-
items
- something custom for /sn_sc/servicecatalog/items/{item_sys_id}/delegation/{user_sys_id}
- wishlist
It would be great if someone can help out creating schemas. We need one for each API, including nested items, such as cart.recurring_frequency.
Visit this URL for an example: https://developer.servicenow.com/dev.do#!/reference/api/quebec/rest/c_ServiceCatalogAPI#servicecat-GET-cart
...and scroll down to "Response body parameters (JSON or XML)" -- that's an example of what needs to be mapped into an aiosnow model-schema.
Here's an example of the IncidentModelSchema: https://aiosnow.readthedocs.io/en/latest/_modules/aiosnow/models/table/declared/incident.html#IncidentModelSchema
When it comes to naming, I suggest:
- ServiceCatalogModelSchema
- ServiceCatalogCartModelSchema
- ServiceCatalogCategoryModelSchema
- ServiceCatalogItemModelSchema
- ServiceCatalogWishlistModelSchema
When those have been created, I'll start working on implementing the models, which should be fairly straightforward - unless I've overlooked something.
I'll probably expose "sub APIs" (ServiceCatalogCartModel etc) via ServiceCatalogModel, to make things convenient.
I've created the service-catalog-api branch, let me know if you want to help out with this and I'll make you a collaborator.