Create a new score definition

post/definitions
Internal-Use Only

Creates a new score definition based on the representation in the request body.

Request Samples

1

Response Samples

1{
2 "createdBy": "sasdemo",
3 "creationTimeStamp": "2021-09-18T03:20:14.136294Z",
4 "id": "2e585929-9334-4db9-9f52-2dbc01fc6d0f",
5 "inputData": {
6 "type": "CASTable",
7 "serverName": "cas-shared-default",
8 "libraryName": "Public",
9 "tableName": "HMEQ_EN"
10 },
11 "links": [
12 {
13 "method": "GET",
14 "rel": "up",
15 "href": "/scoreDefinitions/definitions",
16 "uri": "/scoreDefinitions/definitions",
17 "type": "application/vnd.sas.collection"
18 },
19 {
20 "method": "GET",
21 "rel": "self",
22 "href": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
23 "uri": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
24 "type": "application/vnd.sas.score.definition"
25 },
26 {
27 "method": "GET",
28 "rel": "alternate",
29 "href": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
30 "uri": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
31 "type": "application/vnd.sas.summary"
32 },
33 {
34 "method": "DELETE",
35 "rel": "delete",
36 "href": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
37 "uri": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f"
38 },
39 {
40 "method": "PUT",
41 "rel": "update",
42 "href": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
43 "uri": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f",
44 "type": "application/vnd.sas.score.definition",
45 "responseType": "application/vnd.sas.score.definition"
46 },
47 {
48 "method": "POST",
49 "rel": "mappedCode",
50 "href": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f/mappedCode",
51 "uri": "/scoreDefinitions/definitions/2e585929-9334-4db9-9f52-2dbc01fc6d0f/mappedCode",
52 "type": "application/vnd.sas.score.code.generation.request",
53 "responseType": "application/vnd.sas.score.mapped.code"
54 }
55 ],
56 "mappings": [
57 {
58 "variableName": "findAllRetCode",
59 "mappingType": "datasource",
60 "mappingValue": "MORTDUE"
61 },
62 {
63 "variableName": "itemCount",
64 "mappingType": "datasource",
65 "mappingValue": "LOAN"
66 },
67 {
68 "variableName": "fired",
69 "mappingType": "datasource",
70 "mappingValue": "JOB"
71 }
72 ],
73 "modifiedBy": "sasdemo",
74 "modifiedTimeStamp": "2021-09-18T03:20:14.136294Z",
75 "name": "Code_file_9130_Test_1",
76 "objectDescriptor": {
77 "name": "Code_file_9130",
78 "type": "codeFile",
79 "uri": "http://decisions/codeFiles/5f7a0523-5fd8-4cba-90d1-a6971f12d220/revisions/2c99a55e-e4c9-4518-8f54-918ffc18c9a7"
80 },
81 "properties": {
82 "outputLibraryName": "Public",
83 "outputServerName": "cas-shared-default",
84 "tableBaseName": "Code_file_9130_Test_1_Code_file_9130",
85 "test": "true",
86 "version": "1.0"
87 },
88 "version": 2
89}

Query Parameters

NameTypeRequiredDescription
parentFolderUri
string
false

Adds the score definition as a member of a folder.

Request Body

Score definition details that need to be created.

A definition containing details about Input Data, Score Object and Mapping. This represents application/vnd.sas.score.definition media type (version 1).

NameTypeRequiredDescription
name
string
true

The score definition name

description
string
false

The score definition description

preprocessingCode
string
false

Preprocessing code that is executed before executing the Mapped Code.

objectDescriptor
Object Descriptor
true

Descriptor of a Score Object whose logic is used to produce a score for Input Data. This doesn't represent any top-level media type.

inputData
Input Data
true

Input Data that will be scored. This doesn't represent any top-level media type.

mappings
array [Mapping]
false

Array of mappings between Score Object variables and Input Data columns.

properties
object
false

The properties for this score definition that support scoring for decisions and business rules. outputServerName: The name of a Cloud Analytic Server. outputLibraryName: The name of a Cloud Analytic Server library. tableBaseName: The name of a table in the output library. test: A flag that indicates whether the score definition is used for test scoring. Valid values are "true" and "false". These additional properties support publish validation for decisions and business rules. asssetUri: The URI of the decision or business rule that is being validated. publishDestination: The name of a publish destination. publishType: The type of publish destination. publishName: The name for publishing the asset.

Responses

StatusMeaningDescription
201CreatedA score definition was created.HeadersSchema
400Bad RequestThe request was invalid.Schema