Software AG Products 10.5 | Using CentraSite | Asset Management | Managing Assets through CentraSite Business UI | REST Service Management | Adding REST Service using Importer | Importing REST Service using a RAML File
 
Importing REST Service using a RAML File
Pre-requisites:
To add a REST Service asset to an organization's asset catalog, you must belong to a role that has the Create Assets or Manage Assets permission for that organization.
Note:
By default, users with the CentraSite Administrator or Asset Administrator role have this permission.
Before you import a REST Service asset to the catalog, you must have the RAML file that you want to import. This file can reside on the file system of the computer where your browser is running or it can reside anywhere on the network, as long as its location is addressable through a URL.
The CentraSite importer for RAML copies a RAML file to the repository, and creates a REST Service asset that best describes the RESTful Service representing the RAML specification.
The registry objects are as follows:
*A REST Service asset (REST Service) with RAML specification. This RAML specification is stored as a file attribute in the Documents field of the Specification profile.
*A REST endpoint URI object that refers to the REST Service.
*A REST Resource object that refers to the REST Service.
*A REST Method object that refers to the REST Service.
*A REST Parameter object that is referred to by the one of the above objects.
*A REST Request Content-Type (REST Payload) object that is referred to by the REST Service or REST Method object.
*A REST Response Content-Type (REST Payload) object that is referred to by the REST Service or REST Method object.
*A REST Status Code object that is referred to by the Response Content-Type object.
*To import a REST Service asset using RAML specification
1. In the CentraSite Business UI activity bar, click Create Asset.
This opens the Create New Asset wizard.
2. In the Basic Information profile, provide the required information for each of the displayed data fields.
Field
Description
Name
(Optional). Name of the REST Service.
Note:
This is the name that users will see when they view this REST Service asset in the CentraSite User Interfaces. Therefore, specify a meaningful name for each REST Service.
The name of a REST Service asset must be NCName-conformant, meaning that:
*The name must begin with a letter or the underscore character (_).
*The remainder of the name can contain any combination of letters, digits, or the following characters: . - _ (that is, period, dash, or underscore). It can also contain combining characters and extender characters (for example, diacriticals).
*The name cannot contain any spaces.
*Furthermore, if the REST Service name contains any non-conformant character, upon publishing the REST Service to any gateway, the non-conformant character is simply replaced with the underscore character (_) in Mediator. However, in CentraSite the REST Service name defined by you is displayed.
For more information about the NCName type, see http://www.w3.org/TR/xmlschema-2/#NCName
If you have not specified a Name for the REST Service, CentraSite automatically maps this field with the Service Title property, that is defined in the RAML specification.
Type
The asset type, REST Service.
Organization
The organization to which you want to add the REST Service. (The Organization list only displays organizations for which you have the Manage Assets permission or at least the Create Assets permission.)
Version
(Optional). The version identifier for the REST Service. You can enter any string in this field, that is, the version identifier does not need to be numeric. You can also leave the field blank. You can later create new versions of the REST Service. The default is 1.0.
Examples:
0.0a
1.0.0 (beta)
Pre-release 001
V1-2007.04.30
If you have not specified a Version for the REST Service, CentraSite automatically maps this field with the Service Version property, which is defined in the RAML specification.
Description
(Optional). The description for the REST Service.
Note:
This is the description information that users will see when they view this REST Service asset in the CentraSite User Interfaces. Therefore, specify a meaningful description for each REST Service.
If you have not specified a Description for the REST Service, CentraSite automatically maps this field with the Description property, that is defined in the RAML specification.
Import From Specification File
Select the specification file type, RAML-0.8.
Option
Description
URL
If the RAML file you are importing resides on the network, you can specify its URL.
File
If the specification resides in your local file system, specify the file name. You can use the Browse button to navigate to the required folder.
3. Click the Advanced Settings chevron to expand the additional options that are available for the Service asset. Provide the required information for each of the displayed fields:
Field
Description
Credentials
If you have specified a URL and the site you want to access through the URL requires user authentication, type a username and password for authentication at the URL site.
Resolution
Select a resolution strategy, which will allow you to specify how an already existing imported and included file is handled. For each of the imported and included files you have one of these options:
*Overwrite the importing file with new content.
*Create a new version of the file with the new content (if, for example, you want to modify a RAML file but want to retain its previous version).
Note:
Currently, CentraSite does not support this option for a REST Service with RAML specification.
4. Click Next.
You cannot navigate to the next screen unless all of its required attributes have been set.
5. In the Preview panel, review the basic information for the REST Service before you actually add to the CentraSite registry.
6. Click Save.
A REST Service asset instance is created in the specified organization and registered with the CentraSite registry/repository. The details page for the REST Service asset that you just created is displayed.
7. Configure the extended attributes of the REST Service as described later in this topic.
Tip:
If you had previously imported a RAML file that has an associated schema file and you now re-import just the schema file with modifications, your browser may not display the updated contents of the schema file. This can happen if the browser cache is not being updated automatically. To rectify the problem, you can change your browser settings so that pages are always updated on every visit.