Create a code file revision with code(Deprecated)

post/codeFiles/{codeFileId}/revisions
Internal-Use Only

Creates a new code file revision based on the representation in the request body. This is deprecated. Please use endpoint /codeFiles/{codeFileId}/revisions with Content-Type header as application/vnd.sas.decision.code.file.with.code+json.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2021-05-06T20:21:04.490Z",
3 "modifiedTimeStamp": "2021-05-06T20:21:04.490Z",
4 "createdBy": "sasdemo",
5 "modifiedBy": "sasdemo",
6 "id": "f02aa26d-af06-4198-9705-2306bad711a1",
7 "name": "add_cf",
8 "majorRevision": 1,
9 "minorRevision": 0,
10 "checkout": false,
11 "locked": true,
12 "type": "decisionDS2CodeFile",
13 "signature": [
14 {
15 "name": "a",
16 "dataType": "decimal",
17 "direction": "input"
18 },
19 {
20 "name": "b",
21 "dataType": "decimal",
22 "direction": "input"
23 },
24 {
25 "name": "c",
26 "dataType": "decimal",
27 "direction": "output"
28 }
29 ],
30 "status": "valid",
31 "links": [
32 {
33 "method": "GET",
34 "rel": "up",
35 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions",
36 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions",
37 "type": "application/vnd.sas.collection",
38 "itemType": "application/vnd.sas.decision.code.file"
39 },
40 {
41 "method": "GET",
42 "rel": "self",
43 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
44 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
45 "type": "application/vnd.sas.decision.code.file"
46 },
47 {
48 "method": "PUT",
49 "rel": "update",
50 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
51 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
52 "type": "application/vnd.sas.decision.code.file"
53 },
54 {
55 "method": "GET",
56 "rel": "alternate",
57 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
58 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
59 "type": "application/vnd.sas.summary"
60 },
61 {
62 "method": "GET",
63 "rel": "content",
64 "href": "/files/files/2110f410-bb15-41d4-a0a5-e707fececfe9/content",
65 "uri": "/files/files/2110f410-bb15-41d4-a0a5-e707fececfe9/content"
66 },
67 {
68 "method": "GET",
69 "rel": "decisionStepCode",
70 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
71 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
72 "type": "application/vnd.sas.decision.step.code"
73 },
74 {
75 "method": "DELETE",
76 "rel": "delete",
77 "href": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1",
78 "uri": "/decisions/codeFiles/cd404a82-af5b-4835-9672-9730470a6be8/revisions/f02aa26d-af06-4198-9705-2306bad711a1"
79 }
80 ],
81 "sourceRevisionUri": "/decisions/codeFiles/57d3b887-472b-4bd5-a021-b6f336efed41/revisions/200b0999-08ae-4371-a06c-f08d8c246f64",
82 "copyTimeStamp": "2021-05-06T20:21:04.490Z",
83 "fileUri": "/files/files/2110f410-bb15-41d4-a0a5-e707fececfe9",
84 "version": 2
85}

Path Parameters

NameTypeRequiredDescription
codeFileId
string
true

The unique identifier for the code file.

Query Parameters

NameTypeRequiredDescription
revisionType
string
false

Valid values are major or minor. This value determines how the server generates the major and minor numbers. If a major number is provided, the next available major version number is started. For example, if the code file has revisions 1.0, 1.1, 1.2, 2.0, and 2.1, creating a new major revision results in 3.0. If a minor number is provided, then the next available minor revision number is reserved based on the existing revisions. For example, if the existing revisions have major and minor numbers of 1.1, 1.2, 1.3, 2.1, 2.2, and a user requests a new minor revision, then 2.3 is assigned. This parameter defaults to minor if not supplied.

Allowed values:
majorminor
fromRevisionUri
string</decisions/codeFiles/{codeFileId}/revisions/{revisionId}>
false

This value specifies the URI of the code file revision from which the new code file revision is created. This property enables you to trace the lineage of a code file. The valid format for this parameter is '/decisions/codeFiles/${codeFileId}/revisions/${revisionId}'

Request Body

The details of the code file revision that needs to be created.

A code file that accepts its code as a property. This represents application/vnd.sas.decision.code.file.with.code media type (version 1).

This variant of code file is useful for creating a code file revision without managing the creation of the underlying file resources used to store the code.

NameTypeRequiredDescription
id
string
false

The system-assigned unique ID for this object

name
string
false

The code file name

description
string
false

The code file description

createdBy
string
false

The user who created the code file.

creationTimeStamp
string<date-time>
false

The date and time that the code file was created.

modifiedBy
string
false

The user ID of the authenticated user who last updated the code file.

modifiedTimeStamp
string<date-time>
false

The date and time that the code file was last modified.

majorRevision
integer
false

Major version number of the revision being viewed of the code file. This value is assigned by the service, the user only has control on whether the major number or minor number is incremented when creating a new revision. This is a derived field that is generated on POST.

minorRevision
integer
false

Minor version number of the current revision of the code file. This value is assigned by the service, the user only has control on whether the major number or minor number is incremented when creating a new revision. This is a derived field that is generated on POST.

checkout
boolean
false

Flag indicating that the code file is the user's working copy of another code file.

locked
boolean
false

Flag which indicates whether the content of the revision being viewed is locked or editable.

type
string<enumeration>
true

Type of the code.

Allowed values:
decisionDS2CodeFiledecisionSQLCodeFiledecisionPythonFile
status
string<enumeration>
false

Status of the code content.

Allowed values:
validerror
errorCode
integer
false

Error code when parsing code content.

errorMessage
string
false

Error message when parsing code content.

signature
array [Code File Signature Term]
false

Array of signature terms.

folderType
string
false

Indicates the type of folder where the code file is located.

sourceRevisionUri
string
false

The URI of the code file revision this code file is being created from.

copyTimeStamp
string<date-time>
false

The time stamp when the code file revision was copied.

links
array [Link]
false

Zero or more links to related resources or operations.

code
string
true

The code that defines the code file's behavior.

version
integer
false

This media type's schema version number. This representation is version 1.

Responses

StatusMeaningDescription
201CreatedA code file revision was created.HeadersSchema
400Bad RequestThe request was invalid.HeadersSchema