User Tools
Writing /app/www/public/data/meta/development/snmp/rapid.meta failed
development:snmp:rapid
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| development:snmp:rapid [2018/10/19 16:21] – ashevyakov | development:snmp:rapid [2021/06/25 10:09] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Rapid Public Service Deployment ====== | ||
| + | Author: Andrey Shevyakov | ||
| + | |||
| + | Description: | ||
| + | A quick guide on how to implement an **SnmpManager** Grails service with which a client GUI can interact (regardless of the selected GUI framework). | ||
| + | |||
| + | Steps: | ||
| + | - Create a Grails service implementing the **DomainInteractor** trait that will provide the following CRUD methods: | ||
| + | * **getDomainInstance()** | ||
| + | * **getDomainInstanceBulk()** | ||
| + | * **newDomainInstance()** | ||
| + | * **newDomainInstanceBulk()** | ||
| + | * **updateDomainInstance()** | ||
| + | * **updateDomainInstanceBulk()** | ||
| + | * **deleteDomainInstance()** | ||
| + | * **deleteDomainInstanceBulk()** | ||
| + | - In the service constructor, | ||
| + | * **domainRefParam** - key referring to the domain name (same as **Class.simpleName**) in the received map (params) - example: " | ||
| + | * **domainEntriesRefParam** - key referring to the entries collection in the received map (params) - example: " | ||
| + | * **domainIdRefParam** - key referring to the ID of a single domain entry to be affected in the received map (params) - example: " | ||
| + | * **domainIdsRefParam** - key referring to the IDs of the domain entries to be affected in the received map (params) - example: " | ||
| + | * **allowedDomains** - names of the domains that are allowed for processing by the service - example: [" | ||
| + | - Create a Grails controller extending the **SecureController** | ||
| + | - In the controller, implement a service accepting the client-sent JSON payload (**must** contain the keys specified in the **Step 2** for the valid CRUD processing) and calling the relevant service method and returning the processing results to the client in the JSON format. | ||
| + | |||
| + | JSON-Request Example - Update CRUD: | ||
| + | < | ||
| + | var data = JSON.stringify({ | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | {' | ||
| + | {' | ||
| + | ] | ||
| + | }); | ||
| + | </ | ||
| + | |||
| + | JSON-Response Example - Update CRUD: | ||
| + | < | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Diagrams: | ||
| + | |||
| + | {{: | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | \\ | ||
| + | {{: | ||