Create a module

post/modules
Internal-Use Only

Creates and loads a module from the provided module definition and returns a representation of the loaded module. Note that the name assigned to a module ID, package, public method, or submodule must not include any of the following characters: forward slash, backslash, period, and semicolon.

Request Samples

1

Response Samples

1{
2 "links": [
3 {
4 "method": "GET",
5 "rel": "up",
6 "href": "/microanalyticScore/modules",
7 "uri": "/microanalyticScore/modules",
8 "type": "application/vnd.sas.collection",
9 "itemType": "application/vnd.sas.microanalytic.module"
10 },
11 {
12 "method": "GET",
13 "rel": "self",
14 "href": "/microanalyticScore/modules/newmodule",
15 "uri": "/microanalyticScore/modules/newmoudue",
16 "type": "application/vnd.sas.microanalytic.module"
17 },
18 {
19 "method": "GET",
20 "rel": "source",
21 "href": "/microanalyticScore/modules/newmodule/source",
22 "uri": "/microanalyticScore/modules/newmodule/source",
23 "type": "application/vnd.sas.microanalytic.module.source"
24 },
25 {
26 "method": "GET",
27 "rel": "steps",
28 "href": "/microanalyticScore/modules/newmoudue/steps",
29 "uri": "/microanalyticScore/modules/newmodule/steps",
30 "type": "application/vnd.sas.collection",
31 "itemType": "application/vnd.sas.microanalytic.module.step"
32 },
33 {
34 "method": "GET",
35 "rel": "submodules",
36 "href": "/microanalyticScore/modules/newmodule/submodules",
37 "uri": "/microanalyticScore/modules/newmodule/submodules",
38 "type": "application/vnd.sas.collection",
39 "itemType": "application/vnd.sas.microanalytic.submodule"
40 },
41 {
42 "method": "PUT",
43 "rel": "update",
44 "href": "/microanalyticScore/modules/newmodule",
45 "uri": "/microanalyticScore/modules/newmodule",
46 "type": "application/vnd.sas.microanalytic.module",
47 "responseType": "application/vnd.sas.microanalytic.module"
48 },
49 {
50 "method": "DELETE",
51 "rel": "delete",
52 "href": "/microanalyticScore/modules/newmodule",
53 "uri": "/microanalyticScore/modules/newmoudule"
54 }
55 ],
56 "version": 2,
57 "createdBy": "sasdemo",
58 "creationTimeStamp": "2022-05-03T14:31:26.796Z",
59 "modifiedBy": "sasboot",
60 "modifiedTimeStamp": "2022-05-03T14:31:26.796Z",
61 "id": "newmodule",
62 "name": "variabletest",
63 "revision": 0,
64 "description": "New Module",
65 "scope": "public",
66 "language": "ds2",
67 "stepIds": [
68 "variable_test"
69 ],
70 "properties": [
71 {
72 "name": "NewModule property 1",
73 "value": "NewModule property value"
74 },
75 {
76 "name": "NewModule property 2",
77 "value": ""
78 }
79 ],
80 "warnings": []
81}

Request Body

A definition of the module to be created.

The representation of a module for module creation.

NameTypeRequiredDescription
id
string
false

An optional identifier for the module. If not specified, the source code of the module is parsed to determine the value of the module identifier.

description
string
false

Optional text that describes the logic or functionality of the module.

Default:
scope
string
true

The scope restricts how a module can be used. The value 'public' indicates the module is available to be called outside another module. The value 'private' indicates that a module can be called only from within another module.

Allowed values:
publicprivate
type
string
false

Optional text that describes the source code type. Currently, the only valid value is text/vnd.sas.source.ds2.

Allowed value:
text/vnd.sas.source.ds2
source
string
true

The source code of the module.

properties
array [Property]
false

Additional metadata about the module. If a property definition is not needed, this can be omitted or specified as an empty array.

submodules
array [Submodule Definition]
false

Optional list of submodules for this module.

version
integer
false

The media type's schema version number. The current version is 2.

Default:
2

Responses

StatusMeaningDescription
201CreatedThe module was created.HeadersSchema
400Bad RequestThe request was invalid. The module was not created.Schema