Software AG Products 10.7 | Using CentraSite | Asset Management | Managing Assets through CentraSite Business UI | REST Service Management | Adding REST Service from Scratch | Adding Components Objects to Resources and Methods
 
Adding Components Objects to Resources and Methods
An API may have several common component objects, such as schemas, links, callbacks, requests, responses, parameters, example, and headers. You can use these components in resources and methods by adding references where required.
*To add Components Objects to Resources and Methods
1. In CentraSite Business UI, access the Advanced Search panel in one of the following ways:
*Click the Browse link in the upper-left corner of the menu bar.
*Click the Search icon next to the Scope list. The default search scope is Assets.
This displays a list of assets in the Search Results page.
2. In the Additional Search Criteria list, select Asset Types.
3. To search for the assets of type, REST Service, click Choose.
This opens the Choose Asset Types dialog box.
4. In the Choose Asset Types dialog box, select the Assets option button, and then follow these steps:
a. Click the chevron next to Assets option button.
A list of defined asset types in CentraSite is displayed.
b. In the list of asset types, select REST Service.
c. Click OK.
A list of defined REST Service assets is displayed in the Search Results page.
5. Click the REST Service you want to add the components.
This opens the REST Service details page. Also, the Actions bar displays a set of actions that are available for working with the REST Service.
6. On the Actions bar of the REST Service details page, click Edit.
7. Select the Resource and Methods profile.
8. Locate the resource or method for which you want to add the components.
9. Click the Add Resource or Add Method link.
This opens the Add Resource or Add Method dialog box.
10. In the Add Resource and Add Method dialog box, choose the component objects to be reused as mentioned below:.
Field
Description
Parameters - Add Parameter (link)
(Optional). Parameters for the REST Resource and REST Method.
To add an existing parameter from components
a. On the Add Parameter dialog box, click Choose.
b. On the Choose a Parameter dialog box, enter search text and click the search icon.
c. A list of parameters is displayed. Select the desired parameter and click OK.
d. Add parameter dialog box appears with the parameter details.
e. Click OK.
Requests - Add Request (link)
(Optional). The HTTP requests to the Resources of the REST Service.
To add an existing request from components
a. On the Add Request dialog box, click Choose.
b. On the Choose a Request dialog box, enter search text and click the search icon.
c. A list of requests is displayed. Select the desired request and click OK.
d. Add request dialog box appears with the request details.
e. Click OK.
Responses - Add Response (link)
(Optional). The HTTP responses to the Resources of the REST Service.
To add an existing response from components
a. On the Add Response dialog box, click Choose.
b. On the Choose a Response dialog box, enter search text and click the search icon.
c. A list of responses is displayed. Select the desired response and click OK.
d. Add response dialog box appears with the response details.
e. Click OK.
Callbacks - Add Callback (link)
(Optional). The Callbacks that are supported by the HTTP method.
To add an existing callback from components
a. On the Add Callback dialog box, click Choose.
b. On the Choose a Callback dialog box, enter search text and click the search icon.
c. A list of callbacks is displayed. Select the desired callback and click OK.
d. Add callbacks dialog box appears with the callback details.
e. Click OK.
Requests - Add Request (link) - Request Content - Add Request Content (link)
(Optional). The REST Payload using a JSON schema.
To add an existing schema from components
a. On the Add Request Content dialog box, click Choose.
b. On the Choose a Schema dialog box, enter search text and click the search icon.
c. A list of schemas is displayed. Select the desired schema and click OK.
d. Add schema dialog box appears with the schema details.
e. Click OK.
Requests - Add Request (link) - Request Content - Add Request Content (link) - Example - Add Example (link)
(Optional) The REST Payload with suitable examples to demonstrate the usage of a schema. An example is an JSON code.
To add an existing example from components
a. On the Add Example dialog box, click Choose.
b. On the Choose a Example dialog box, enter search text and click the search icon.
c. A list of examples is displayed. Select the desired example and click OK.
d. Add example dialog box appears with the example details.
e. Click OK.
Response Content-Add Response Content (link) - Headers - Add Header (link)
(Optional). A header specifies REST Parameter objects, each representing the headers of a response or a REST Encoding object.
To add an existing header from components
a. On the Add Header dialog box, click Choose.
b. On the Choose a Header dialog box, enter search text and click the search icon.
c. A list of headers is displayed. Select the desired header and click OK.
d. Add header dialog box appears with the header details.
e. Click OK.
Response Content-Add Response Content (link) - Links-Add Link (link)
(Optional). A Link specifies REST Link objects, each representing the relationship between responses (which can serve as inputs to another) and REST methods.
To add an existing link from components
a. On the Add Link dialog box, click Choose.
b. On the Choose a Link dialog box, enter search text and click the search icon.
c. A list of links is displayed. Select the desired link and click OK.
d. Add link dialog box appears with the link details.
e. Click OK.
Note: 
*You cannot edit the component objects referred from Components in Resource and Methods.
*Deleting the component objects from Resource and Methods removes it only from the REST Resource and REST Method.
*You cannot delete a component object in Components, if it is referred in the Resource and Methods. You can delete the component objects from Components after every association is removed from the Resource and Methods.
11. Click Save.