CentraSite Documentation : CentraSite Administrator’s Guide : Importing Objects Using the API : Invoking an Importer From the Command Line : Importing a REST Service
Importing a REST Service
Use the import Service command to import a REST service using RAML or Swagger file into CentraSite.
The syntax for the command is:
C:\SoftwareAG\CentraSite\utilities>CentraSiteCommand.cmd|sh import Service [-url <CENTRASITE-URL>] -user <USER-ID> -password <PASSWORD> -organization <ORGANIZATION> -type <TYPE> -serviceUri <SERVICE-URI> [-serviceUser <SERVICE-USER>] [-servicePassword <SERVICE-PASSWORD>] [-update <ASSET-ID>] [-imports <IMPORTS-DESCRIPTOR>] [-batch <BATCH-MODE>]
The input parameters are:
Parameter
Description
CENTRASITE-URL
(Optional) The fully qualified URL of the CentraSite registry/repository. Default value is http://localhost:53307.
USER-ID
The user ID of a registered CentraSite user who has the CentraSite Administrator role. For example, Administrator.
PASSWORD
The password for the CentraSite user identified by the parameter -user.
ORGANIZATION
(Optional) The organization to which the newly imported REST service will belong.
TYPE
The type of REST service you want to import. Possible values are:
*RAML - Reads a RAML specification file and from it, creates a REST Service with RAML metadata.
*Swagger - Reads a Swagger specification file and from it, creates a REST Service with Swagger metadata.
SERVICE-URI
The location of a specification file that you want to use for importing the REST service in CentraSite.
*If the import file resides on a remote network, specify its URL.
*If the import file resides on your local system, specify the absolute or relative path to the file. If relative, the path should be relative to the location from where the command is executed.
SERVICE-USER
(Optional) If you have specified a URL in the above parameter -serviceUri, and the import file you want to access via the URL requires user authentication, enter a user ID that CentraSite is to use for authentication at the URL site.
SERVICE-PASSWORD
(Optional) The password that CentraSite is to use for authentication at the URL site.
ASSET-ID
(Optional) The ID of the REST service you want to update. You can specify the UDDI key of the service using an optional prefix “uddi:”. For example:
uddi:207ff1cc-25c5-544c-415c-d98ea91060c
IMPORTS-DESCRIPTOR
(Optional) The absolute or relative path to the imports descriptor file that contains all referenced objects to which the RAML/Swagger import file has an association.
The imports descriptor file contains a map of key-value pairs and defines the referenced objects as <import-alias>=<import-uri>.
BATCH-MODE
(Optional) Determines how referenced schemas are handled when the schema that is referred to in the imports descriptor file does not exist in the registry. Possible values are true and false.
*If the parameter value is set to true, then CentraSite ignores any missing referenced schemas.
*If the parameter value is set to false, then you will be prompted at runtime to specify the referenced schema file’s location.
The default value is false.
Example:
The command for importing a REST service of the RAML specification with an administrator account INTERNAL\Admin and password AdminPW would be:
C:\SoftwareAG\CentraSite\utilities>CentraSiteCommand.cmd import Service -url http://localhost:53307/CentraSite/CentraSite -user INTERNAL\Admin -password AdminPW -organization “Default Organization” -type RAML -serviceUri C:/include-resource-types.yaml -serviceUser INTERNAL\Claire -servicePassword Clairepwd -imports C:/imports.properties -batch true
The response to this command could be:
Executing the command : import Service
=================================================================
The service has been imported successfully with:
Name: RAML RESTful API
Id: b7377c94-2993-11e5-bad6-e9f07cabfe13
Organization: Default Organization
=================================================================
….
Successfully executed the command : import Service
Note:  
To update an existing REST Service in CentraSite, you can use the import Service command and provide an edited specification file as input to the command along with the key that identifies the REST service that you want to update.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback