Requesting the available models from a database (Web Interface REST service)
The Models request returns resource URIs for the models that can be accessed from a database.
Note that the REST service cannot work with Models that have the percentage character (%) in their names.
Request
The syntax of the URI for a Models request is as follows.
<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models
Where:
• <Web Interface website> - is the URI for the Web Interface website.
• <server name> - is the name of the server.
If the server name contains reserved characters, those characters must be percent encoded in the URI. Use the Servers operation request to return the URI safe version of the server name.
• <repository name> - is the name of the database, against which the Models operation is being run.
If the database name contains reserved characters, those characters must be percent encoded in the URI. Use the Repositories operation request to return the URI safe version of the database name.
Returned XML
A Models request returns a URI for each model that can be accessed from the database.
The syntax of a returned URI is as follows.
<Web Interface website>/ModelerService/Servers/<server name>/Repositories/<repository name>/Models/<model name>
When you use the preceding URI for a model, the REST service returns URIs for operation requests that can be used against the model.
Example
In this example, the following Models request returns a resource URI for each model that can be accessed from the Example1 repository.
https://localhost:57850/ModelerService/Servers/Server101/Repository/Example1/Models
The returned XML is as follows (not all the returned code is shown). You can see that there is a URI for the Model1 model.
<?xml version="1.0"?>
<ArrayOfModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/StudioRESTService.ModelerRESTService">
<Model>
<RequestResult>SERVER101</RequestResult>
<RequestResultType>SERVER</RequestResultType>
<ID>SERVER101/Examples/Model1</ID>
<Name>Model1</Name>
<ResourceType>Model</ResourceType>
<URIs>
<URI>
<href>https://localhost:57850/ModelerService/Servers/Server101/Repositories/Examples/Models/Model1</href>
</URI>
</URIs>
<WebInterfaceLink>https://localhost:57850/showitem?srvNm=Server101+repNm=Models+modNm=Model1</WebInterfaceLink>
</Model>
</ArrayOfModel>