Create an endpoint
Previous:Create a process
Our purpose is to run the processScoreIrisData
, submitting our input data via the endpoint URL and obtaining the result of the process as output. To do so, we need to create an endpoint.
There are two methods, depending on yourendpoint infrastructure.
Note that aWeb API agentis a smart scoring agent. It communicates with RapidMiner AI Hub to learn about project updates, and it is subject to load-balancing within itsWeb API Group.
Use RapidMiner AI Hub's built-in Web API agent
If in doubt, you're probably using the built-in Web API agent. The advantage of using the built-in agent is clear during development: the processes connected to your endpoint URL can be automatically updated every time you update your project.
Moreover, since you're still working within the context of RapidMiner AI Hub, you benefit from all the infrastructure it provides, for example:
- all kinds of access control, including connections with injected parameters
- user-definedPython environmentsfor RapidMiner notebooks
Use an external scoring agent, independent of RapidMiner AI Hub.
This method requires more effort, both because you have toinstall the endpoint infrastructureand because the endpointprocessesarenotupdated automatically. Any time you want to update the endpoint, you have to:
- download a deployment ZIP from RapidMiner AI Hub,
- upload the ZIP file to your external endpoint infrastructure,
- place the ZIP in thedeploymentsfolder, and
- restart the scoring agent.
However, the benefit is also clear. You can have your endpoint anywhere you like: on your laptop, on a remote server, or on your Raspberry Pi! You no longer depend on RapidMiner AI Hub.
No matter how you want to create your endpoint, start by going into theprojects user interfaceof RapidMiner AI Hub. In the screenshot below, you can see the contents of the Iris folder, in thetest-1030-beta2
project, as described inCreate a process.
Where do you need an endpoint?
Click onCreate Endpoint(s).
At this stage, you must make a choice, depending on yourendpoint infrastructure:
this AI Hub- if you are using RapidMiner AI Hub's built-in Web API agent,
other device- if you are using an external scoring agent, independent of RapidMiner AI Hub
this AI Hub: deployment settings
use pre-defined users and groups and easily update
Clickthis AI Hub. A configuration dialog opens, and you have to define your deployment settings. Note that in this context, adeploymentis a collection of endpoints with the following shared settings. Once you define the deployment settings, you can create one or more endpoints.
Deployment path- We choose the value
iris
,这个值将会出现在endpoint URLas$deployment_path
. All endpoints belonging to the same deployment include the same$deployment_path
.Project- Assuming that you triggered the dialog from within theContenttab of the project, yourProjectname is pre-filled. Otherwise, select a project from the dropdown list.
Web API Group- Assuming that you triggered the dialog from within theContenttab of the project, yourWeb API Groupis pre-filled. There always exists a DEFAULT Web API Group, but the user may choose any Web API Group to which he or she has access. The
Web_API_Group美元
appears in theendpoint URL.Update automatically- If your context is development, you probably want to check the settingUpdate automatically, so that your endpoint process will be updated automatically whenever the project is updated. If not, choose the project snapshot that is relevant to your endpoint.
使用者的权限- pertain to the people or programs that will access your endpoint URL in search of a result. By default, the permissions are set to Public / Anonymous, but if you toggle the switch toRestrict access, you will see the following options:
- Basic authentication- create users and passwords
- AI Hub permissions- grant access to users or groups that have been pre-defined on AI Hub
- Long-living API token——创建一个令牌and select an expiration date / time
Add Endpoint Configuration
A deployment as described above is intimately connected to a project via a Web API agent that keeps track of project updates, and in general, that project can have multiple processes and multiple endpoints.
In what follows, we show how to configure each individual endpoint. There are three steps:
- Choose the endpoint process
- Configure any macros
- Include all dependencies
Zoom the screenshot below to see the details more clearly.
Choose the endpoint process
In the first step, click onAdd Endpoint Configuration, and select the process you want to have executed by the Web API agent. Notice that in this step, only RapidMiner processes (.rmp
) are displayed.
In addition, choose an alias for the endpoint. This alias could be the name of the process or any other name -- the$alias
will appear in theendpoint URL. Here we choose the aliasidentify
for the processScoreIrisData.rmp
.
Configure any macros
If you have a macro in your process, you can map its name to the URL query parameter that will appear in the endpoint URL.
Include all dependencies
Finally, you need to include all the dependencies of your process. In our example withScoreIrisData
, we need both the process and the modelIrisModel
. Don't forget to include any connections needed by your process.
ClickFinish, and your endpoint configuration is displayed, including both the alias and the endpoint URL.
If you wish to configure any additional endpoints, clickAdd Endpoint Configurationand repeat the process. If there are no additional endpoints, clickSave and Deployto complete the process.
The available endpoints are visible in two places in the RapidMiner AI Hub interface: underEndpointsand underProjects> project_name >Endpoints.
When an endpoint is available forqueries, a check mark appears beside its name.
Next:Request results