SAS Data Loader 3.1 for Hadoop: REST API Reference
REST APIs provide access to resources, or data entities, using URI paths. To use a REST API, a request is made using standard HTTP methods such as GET, PUT, POST, and DELETE. Representations are returned as a JSON response accompanied by a status code. Note that the user must have appropriate credentials to access resources through the SAS Data Loader for Hadoop REST API.
The primary HTTP verbs that are used in the SAS Data Loader for Hadoop REST API are GET, PUT, POST, and DELETE. Here is a brief description.
GET is used to retrieve, or read, a representation of a resource. GET returns a representation in JSON with a response code of 200 (OK) . If an error occurs, HTTP returns a status of 400 (Bad request), 404 (Not found), or 500 (Internal server error).
PUT is used to update a resource. HTTP returns a status 201 (Success) if the update is successful or a status 404 (Not found) if the resource could not be found. If an error occurs, HTTP returns a status of 400 (Bad request), 404 (Not found), or 500 (Internal server error).
POST is used for creation of new resources. On successful creation, HTTP returns a status of 200 (OK). If there is an error in the request, HTTP returns status of 404 (Not found) or 500 (Internal server error).
DELETE is used to delete a resource identified by a URI. On successful deletion, HTTP returns status 204 (Server found and deleted). If the resource cannot be found, an HTTP status 500 (Internal server error) is returned.
The / resource is the root resource that is used to get top-level links.
Get Links returns the list of root level links. This resource supports the HEAD method as well.
GET http://www.example.com/SASDataLoader/rest/
The request also supports the Accept request headers, which supports the following media types:
| rel | HTTP Method | Description |
|---|---|---|
| directives | GET |
Gets the collection of directives.
URI: /directives Type: vnd.sas.collection |
The /directives collection is the collection of directives that have been created in SAS Data Loader for Hadoop.
Get Directives gets a list of all directives filtered by the query parameters.
GET http://www.example.com/SASDataLoader/rest/directives
| Name | Type | Description |
|---|---|---|
| ?directiveFolderPath | string | The full path to the directive to be returned. It includes the directive's name and returns a single directive. |
| ?sasFolderPath | string | The path to the SAS folder to be returned. It returns the collection of directives that the user has read-access to within the given folder. |
| ?start | integer | The starting index of the first item in a page. The index is 0-based. The default is 0. |
| ?limit | integer | The maximum number of items to return in this page of results. The actual number of returned items might be less if the collection has been exhausted. The default is 10. |
The request also supports the Accept request headers, which supports the following media types:
The /directives/{directiveId} resource gets information about the directive.
| Name | Type | Description |
|---|---|---|
| {directiveId} | string | The directive's ID. |
Get Directive gets information about a directive. HEAD is also supported for this resource.
GET http://www.example.com/SASDataLoader/rest/directives/{directiveId}
The request also supports the Accept request headers, which supports the following media types:
Last-Modified - the timestamp (EEE, dd MMM yyyy HH:mm:ss GMT) when the resource was last modified.
This operation can return the following media type representations by setting the Accept: header of the request:
The /jobs collection represents all the executions (past and present) of directives in SAS Data Loader for Hadoop.
The Run Directive runs a directive.
POST http://www.example.com/SASDataLoader/rest/jobs
| Name | Type | Description |
|---|---|---|
| ?directive | string | The ID of the directive to be executed. This is an optional parameter and is not needed if "directivePath" is specified. |
| ?directivePath | string | The path of the directive to be executed. This is an optional parameter and is not needed if "directive" is specified. |
The request also supports the Accept request headers, which supports the following media types:
Returns information about the job that was created including the job ID.
Location - The location of the new resource (for example, http://www.example.com/SASDataLoader/rest/jobs/1234)
Last-Modified - The timestamp (EEE, dd MMM yyyy HH:mm:ss GMT) when the resource was last modified.
Cache-Control - Because the elapsed time is updated for each request until the job is completed (stopTimeStamp is present), the Cache-Control is set to "no-cache."
This operation can return the following media type representations by setting the Accept: header of the request:
The /job/{jobId} resource represents an execution of a directive. Getting the job resource returns the state of the job.
| Name | Type | Description |
|---|---|---|
| {jobId} | string | The ID of the job. |
Get Job gets the job which is used to provide an update on the job's state. Supports the HEAD method as well.
GET http://www.example.com/SASDataLoader/rest/jobs/{jobId}
The request also supports the Accept request headers, which supports the following media types:
The current information about the job.
Last-Modified - the timestamp (EEE, dd MMM yyyy HH:mm:ss GMT) when the resource was last modified.
Cache-Control - Because the elapsed time is updated for each request until the job is completed (stopTimeStamp is present), the Cache-Control is set to "no-cache."
This operation can return the following media type representations by setting the Accept: header of the request:
Delete Job deletes the job. All information related to the job is deleted.
DELETE http://www.example.com/SASDataLoader/rest/jobs/{jobId}
The /job/{jobId} resource represents the state of the job.
| Name | Type | Description |
|---|---|---|
| {jobId} | string | The ID of the job. |
Get Job State gets the job's state. The state is a text value. For more information, see state in the application/vnd.sas.dataloader.job Members table.
GET http://www.example.com/SASDataLoader/rest/jobs/{jobId}/state
The request also supports the Accept request headers, which supports the following media type:
This operation returns the job state. The possible values are listed for the state member of application/vnd.dataloader.job.
This operation can return the following media type representations by setting the Accept: header of the request:
Cancel Job cancels the job.
| Name | Type | Description |
|---|---|---|
| ?value | string | The only valid value is canceled and is required. |
The request also supports the Accept request headers, which supports the following media type:
Returns the current state of the job. If the job was already complete, the state might be completed or failed or some other value. If the cancel request has not been processed, the state will not have changed. The state can also be canceling indicating the job has started canceling or canceled indicating the job has canceled.
This operation returns the following media type representation by setting the Accept: header of the request:
The /jobs/{jobId}/log resource is the job's log.
| Name | Type | Description |
|---|---|---|
| {jobId} | string | The job's ID. |
Get Job Log gets the job's log.
GET http://www.example.com/SASDataLoader/rest/jobs/{jobId}/log
The request also supports the Accept request headers, which supports the following media type:
Returns the job's log.
This operation can return the following media type representation by setting the Accept: header of the request:
The /jobs/{jobId}/error resource gets the error information for a job.
| Name | Type | Description |
|---|---|---|
| {jobId} | string | The job's ID. |
Gets the job's error.
GET http://www.example.com/SASDataLoader/rest/jobs/{jobId}/error
The request also supports the Accept request headers, which supports the following media types:
Returns an application/vnd.sas.error+json with the following values:
This operation can return the following media type representations by setting the Accept: header of the request:
The /jobs/{jobId}/results collection is the job's results.
| Name | Type | Description |
|---|---|---|
| {jobId} | string | The job's ID. |
Gets the collection of a job's results. This collection is not paged.
GET http://www.example.com/SASDataLoader/rest/jobs/{jobId}/results
The request also supports the Accept request headers, which supports the following media types:
The collection of the job's results which are instances of application/vnd.sas.dataloader.job.result. To view the result, use the view link.
This operation can return the following media type representations by setting the Accept: header of the request:
|
Documentation Feedback: yourturn@sas.com
|
Doc ID: Resources.html |