Assign a fileref

post/sessions/{sessionId}/filerefs
Internal-Use Only

Creates or assigns a fileref for a session.

Request Samples

1

Response Samples

1{
2 "accessMethod": "DISK",
3 "modifiedTimeStamp": "2016-04-27T09:22:16Z",
4 "fileName": "myfile.txt",
5 "filePath": "/tmp/myfile.txt",
6 "fileSize": 44,
7 "id": "myref",
8 "isDirectory": false,
9 "links": [
10 {
11 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref",
12 "method": "GET",
13 "rel": "self",
14 "type": "application/vnd.sas.compute.fileref",
15 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref"
16 },
17 {
18 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref",
19 "method": "GET",
20 "rel": "alternate",
21 "type": "application/vnd.sas.compute.fileref.summary",
22 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref"
23 },
24 {
25 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref",
26 "method": "DELETE",
27 "rel": "deassign",
28 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref"
29 },
30 {
31 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref/content",
32 "method": "GET",
33 "rel": "content",
34 "type": "text/plain",
35 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref/content"
36 },
37 {
38 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref/content",
39 "method": "PUT",
40 "rel": "upload",
41 "type": "text/plain",
42 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref/content"
43 },
44 {
45 "href": "/compute/sessions/RKEY-ses0000/filerefs/myref/content",
46 "method": "DELETE",
47 "rel": "delete",
48 "uri": "/compute/sessions/RKEY-ses0000/filerefs/myref/content"
49 }
50 ],
51 "name": "myref",
52 "version": 2
53}

Path Parameters

NameTypeRequiredDescription
sessionId
string<object-id>
true

Specifies the ID of the session.

Query Parameters

NameTypeRequiredDescription
parent
string
false

To create a fileref to a member of a directory fileref, specify the directory fileref as the parent.

Request Body

Specifies a fileref creation request.

Enables you to create a new SAS fileref object.

Example:
{"version":1,"name":"myfref","path":"myfile.txt","accessMethod":"DISK","options":"encoding='utf8' recfm=D termstr=LF"}
NameTypeRequiredDescription
version
integer<int32>
false

Specifies the version number of this representation schema. This is version 1.

name
string
true

Specifies the name of this fileref.

path
string
true

Specifies the path to the file or directory that is referenced by this fileref.

accessMethod
string
false

Specifies the access method that is used for this fileref. Common values are "DISK" and "TEMP", but other values can be supported.

options
string
false

Specifies an options string for the creation of the fileref.

Responses

StatusMeaningDescription
201CreatedA fileref was created.HeadersSchema
400Bad RequestThe request was invalid.Schema
404Not FoundNo session exists at the requested path.Schema
415Unsupported Media TypeThe requested media type is not supported.Schema