Write requests using the URL API
You can use the URL API to send administration, expression, or function requests to the server. Use the URL API for testing the health of the server, rather than for creating web-based applications. This section describes sending requests via the URL API.
The URL API is most useful for such tasks as checking server health, retrieving version information, or checking job status. It does not support sending or receiving binary objects.
The URL API accesses five services. The functions you can use to access these services are described in detail, with examples, in the URL API help, available from your server’s landing page http://servername:port/<service_name>. (Ask your server administrator if you are not sure of the exact URL.)
- Sending TERR expressions that perform I/O to the file system or the internet.
- Spawning new OS processes by calling the
system
function. - Calling into Java using the terrJava package, or using functions in the parallel package.
- Loading new packages, except for those included with TERR.
- Calling
.C
or.Fortran
. - Send expressions to the server using the Expression Service.
- Calling
ExtendedServerInfo
or sending other expressions that read from, or write to, your server. - Sending potentially malicious expressions to the server using the URL API.
Service | Description |
---|---|
Administration service | Contains a subset of functions found in the Java and C# APIs. This service is meant to be used for simple server administration. Includes functions to get information about the server, a list of jobs, or specific job details. Users can also use the URL API to interrupt jobs in the queue or to delete existing jobs. |
Expression service | Contains two functions:eval , which sends an expression to the server to evaluate; andgetJobDetails , which retrieves the details about a specific job. (This function is deprecated; use the
jobs function instead.)
Note: By default, the Expression Service is not enabled. See your server administrator for more information.
|
Function service | Contains two functions:
function , which sends the call to a function on the server to evaluate; and
getJobDetails , which retrieves the details about a specific job. (This function is deprecated; use the
jobs function instead.)
Note: The function service can handle only strings and numbers as arguments.
|
Authentication service | Contains one function,
validateUserCredentials , for checking whether the current user is authorized to use the server.
|
Public service | Contains functions for discovering information about the server, including server configuration and version information, and whether it has authentication turned on. You can also use a Public service API to check job status for one or all jobs |
Also included in the URL API is the function
jobs
, which, when combined with various resources, can provide information about jobs on the server.
- Server Information
Notice in the examples that the server version number is required as part of the URL for the Authentication, Administration, Expression, and Function services. - URL Authentication
You can use the Public service to check whether authentication is activated on the server, and therefore requires you to supply credentials. - Administration Tasks
The URL API is most useful for checking server health and performing simple administrative tasks, such as checking for server information, getting the server time and name, interrupting jobs, and deleting jobs if the job list gets too long. For example: - Retrieve the Job List
Use the jobs function to get a list of all jobs on the server. - Expression and Function Requests
Use the Expression and Function services to send requests to the server, and then examine the resulting XML.
- Server Information
Notice in the examples that the server version number is required as part of the URL for the Authentication, Administration, Expression, and Function services. - URL Authentication
You can use the Public service to check whether authentication is activated on the server, and therefore requires you to supply credentials. - Administration Tasks
The URL API is most useful for checking server health and performing simple administrative tasks, such as checking for server information, getting the server time and name, interrupting jobs, and deleting jobs if the job list gets too long. For example: - Retrieve the Job List
Use the jobs function to get a list of all jobs on the server. - Expression and Function Requests
Use the Expression and Function services to send requests to the server, and then examine the resulting XML.