Software AG Products 10.7 | Using CentraSite | Asset Management | Managing Assets through Command Line Interface | Importing an Asset | Importing OData Service
 
Importing OData Service
Pre-requisites:
To import an OData Service asset to the catalog through the CentraSite Command Line Interface, you must have the CentraSite Administrator role.
CentraSite provides a command tool named import Service for this purpose.
Note:
To update an existing OData service in CentraSite, you can use the import Service command and provide an edited EDMX file as input to the command along with the key that identifies the OData service that you want to update.
*To add an OData Service asset
*Run the command import Service.
The syntax is of the format C:\SoftwareAG\CentraSite\utilities>CentraSiteCommand 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 URL of the CentraSite registry. For example, http://localhost:53307/CentraSite/CentraSite.
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-ID.
ORGANIZATION
(Optional). The organization to which the newly imported OData service will belong.
TYPE
The type of service you want to import. Possible values are: RAML, Swagger, and OData.
Select OData. This reads the Service URL or the EDMX file and from it, creates an OData service with the corresponding metadata.
SERVICE-URI
The location of an EDMX file that you want to use for importing the OData 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 through the URL requires user authentication, type 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 OData 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 EDMX 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
Note:
CentraSite does not support this parameter for OData services.
Example (all in one line):
The command for importing an EDMX specification into CentraSite 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 OData -serviceUri C:/TripPinService.edmx -serviceUser INTERNAL\Claire -servicePassword Clairepwd -imports C:/imports.properties
The response to this command could be:
Executing the command : import Service
=================================================================
The service has been imported successfully with:
Name: TripPin OData Service
Id: b7377c94-2993-11e5-bad6-e9f07cabfe13
Organization: Default Organization
=================================================================
….
Successfully executed the command : import Service