Upload a file

post/dataSources/{dataSourceId}/tables
Internal-Use Only

Creates a new table from an uploaded file. Note that this operation is synchronous, and blocks until the file upload is complete. It returns an application/vnd.sas.data.table.job+json resource when the upload succeeds or fails.

Request Samples

1

Response Samples

1{
2 "id": "cas~fs~jes~fs~9bb8f3b2-4787-4955-bc24-6635cd7c2e96",
3 "name": "AIRLINES",
4 "label": "Airlines",
5 "providerId": "cas",
6 "type": "dataTable",
7 "state": "running",
8 "duration": 0.255,
9 "createdBy": "sasjoe",
10 "modifiedBy": "sasjoe",
11 "creationTimeStamp": "0001-01-01T00:00:00Z",
12 "modifiedTimeStamp": "0001-01-01T00:00:00Z",
13 "version": 2,
14 "links": [
15 {
16 "method": "GET",
17 "rel": "self",
18 "href": "/dataTables/jobs/cas~fs~jes~fs~9bb8f3b2-4787-4955-bc24-6635cd7c2e96",
19 "uri": "/dataTables/jobs/cas~fs~jes~fs~9bb8f3b2-4787-4955-bc24-6635cd7c2e96",
20 "type": "application/vnd.sas.data.table.job"
21 },
22 {
23 "method": "GET",
24 "rel": "alternate",
25 "href": "/jobExecution/jobs/9bb8f3b2-4787-4955-bc24-6635cd7c2e96",
26 "uri": "/jobExecution/jobs/9bb8f3b2-4787-4955-bc24-6635cd7c2e96",
27 "type": "application/vnd.sas.job.execution.job"
28 },
29 {
30 "method": "GET",
31 "rel": "state",
32 "href": "/dataTables/jobs/cas~fs~jes~fs~9bb8f3b2-4787-4955-bc24-6635cd7c2e96/state",
33 "uri": "/dataTables/jobs/cas~fs~jes~fs~9bb8f3b2-4787-4955-bc24-6635cd7c2e96/state",
34 "type": "text/plain"
35 },
36 {
37 "method": "GET",
38 "rel": "sourceTable",
39 "href": "/dataTables/dataSources/cas~fs~cas-shared-default~fs~MYCASLIB/tables/AIRLINES",
40 "uri": "/dataTables/dataSources/cas~fs~cas-shared-default~fs~MYCASLIB/tables/AIRLINES",
41 "type": "application/vnd.sas.data.table"
42 },
43 {
44 "method": "GET",
45 "rel": "targetTable",
46 "href": "/dataTables/dataSources/cas~fs~cas-shared-default~fs~MYCASLIB/tables/AIRLINES",
47 "uri": "/dataTables/dataSources/cas~fs~cas-shared-default~fs~MYCASLIB/tables/AIRLINES",
48 "type": "application/vnd.sas.data.table"
49 },
50 {
51 "method": "GET",
52 "rel": "log",
53 "href": "/files/files/103a512d-0caf-4df0-a35f-68908be0aea1",
54 "uri": "/files/files/103a512d-0caf-4df0-a35f-68908be0aea1"
55 }
56 ]
57}

Path Parameters

NameTypeRequiredDescription
dataSourceId
string
true

The name of the data source. Its format is providerIdfssourceIdfslibraryName. The format is a tilda encoded form composed of the following: providerId: name of the provider. Examples: cas, Compute Use GET /dataSources/providers to see the list of available providers. sourceId: refers to server id in case of cas and computeContextId in case of compute. An example sourceId for cas is cas-shared-default. An example sourceId for Compute is 97751fe6-8313-487f-865a-f941c8a75f8f (SAS Studio Compute Context). Use GET /dataSources/providers/{providerId}/sources to see the list of available sources. libraryName: name of the library. Use GET /dataSources/providers/{providerId}/sources/{sourceId}/children to see the the list of available libraries. An example dataSourceId for cas is casfscas-shared-defaultfsmodels. An example dataSourceId for Compute is Computefs97751fe6-8313-487f-865a-f941c8a75f8ffssashelp.

Query Parameters

NameTypeRequiredDescription
sessionId
string
false

The unique identifier of the session used to access the data service provider's backing service. When this is not specified, the data service provider creates a temporary session, and then terminates it after the request is complete. If this is specified, all returned links, except the "self" link, have the sessionId query parameter added to their respective URIs. Also, they contain an additional session link to the application/vnd.sas.data.session resource that corresponds to the provided sessionId.

Header Parameters

NameTypeRequiredDescription
Content-Item-Type
string
true

The media type of the form data tableRequest member.

Allowed values:
application/vnd.sas.data.table.cas.sashdat.request+jsonapplication/vnd.sas.data.table.cas.data.set.request+jsonapplication/vnd.sas.data.table.cas.delimited.request+jsonapplication/vnd.sas.data.table.cas.excel.request+json
Content-Type
string
true

The media type of the form data tableRequest member.

Allowed value:
multipart/form-data

Request Body

The table create request details to use for creating the table using a file.

This represents the table job request.

NameTypeRequiredDescription
tableRequest
string
true

The list of job parameters passed in application/vnd.sas.data.table.request+json format.

file
string
true

The multi-part request file to use when creating the new table.

Responses

StatusMeaningDescription
201CreatedCreated. The requested table has both been created, and its respective job is in a terminal state (one of "completed", "canceled", "timedOut", "failed").HeadersSchema
400Bad RequestBad request (the request is not well formed).Schema
404Not FoundNot found - typically the data source could not be found.Schema