Create a rule job

post/rules/jobs
Internal-Use Only

Creates an asynchronous job that performs one or more rule management actions (such as creating, updating, and deleting authorization rules. Each update and delete action must specify the rule ID for an existing rule. All actions are performed in a single request. The request returns a vnd.sas.authorization.rule.job that contains a 'self' and 'ruleJobState' links that can be used to retrieve the entire job or to check the current state of the running job.

Request Samples

1

Response Samples

1{
2 "id": "cc2cb37c-24e6-4398-b7c8-4b6603bc4608",
3 "createdBy": "user",
4 "status": "notStarted",
5 "version": 2,
6 "state": "pending",
7 "links": [
8 {
9 "method": "GET",
10 "rel": "self",
11 "href": "/authorization/rules/jobs/cc2cb37c-24e6-4398-b7c8-4b6603bc4608",
12 "uri": "/authorization/rules/jobs/cc2cb37c-24e6-4398-b7c8-4b6603bc4608",
13 "type": "application/vnd.sas.authorization.rule.job"
14 },
15 {
16 "method": "GET",
17 "rel": "ruleJobState",
18 "href": "/authorization/rules/jobs/cc2cb37c-24e6-4398-b7c8-4b6603bc4608/state",
19 "uri": "/authorization/rules/jobs/cc2cb37c-24e6-4398-b7c8-4b6603bc4608/state",
20 "type": "text/plain"
21 }
22 ],
23 "actions": [
24 {
25 "id": "29e69b13-7a0f-4939-a7e9-b4400f71f7d8",
26 "rule": {
27 "type": "prohibit",
28 "permissions": [
29 "add",
30 "create",
31 "delete",
32 "read",
33 "remove",
34 "secure",
35 "update"
36 ],
37 "principal": "testprincipal",
38 "principalType": "user",
39 "objectUri": "/foo/bar",
40 "mediaType": "application/vnd.sas.test",
41 "reason": "Because I'm testing",
42 "matchParams": false,
43 "version": 9,
44 "id": "0ee67d20-7b22-4d0f-af3e-fe29ef5b72ed",
45 "enabled": true
46 },
47 "type": "create",
48 "status": "pending",
49 "state": "pending",
50 "priority": 1
51 },
52 {
53 "id": "80379599-5ca6-4c80-8487-4d7e4fe62e7b",
54 "rule": {
55 "type": "prohibit",
56 "permissions": [
57 "add",
58 "create",
59 "delete",
60 "read",
61 "remove",
62 "secure",
63 "update"
64 ],
65 "principal": "testprincipal",
66 "principalType": "user",
67 "objectUri": "/foo/bar",
68 "mediaType": "application/vnd.sas.test",
69 "reason": "Because I'm testing",
70 "matchParams": false,
71 "version": 9,
72 "id": "0ee67d20-7b22-4d0f-af3e-fe29ef5b72ed",
73 "enabled": true
74 },
75 "type": "create",
76 "status": "pending",
77 "state": "pending",
78 "priority": 1
79 },
80 {
81 "id": "e479a954-4832-4e8c-a18e-b10ab3bf2950",
82 "rule": {
83 "type": "prohibit",
84 "permissions": [
85 "add",
86 "create",
87 "delete",
88 "read",
89 "remove",
90 "secure",
91 "update"
92 ],
93 "principal": "testprincipal",
94 "principalType": "user",
95 "objectUri": "/foo/bar",
96 "mediaType": "application/vnd.sas.test",
97 "reason": "Because I'm testing",
98 "matchParams": false,
99 "version": 9,
100 "id": "0ee67d20-7b22-4d0f-af3e-fe29ef5b72ed",
101 "enabled": true
102 },
103 "type": "update",
104 "status": "pending",
105 "state": "pending",
106 "priority": 1
107 }
108 ]
109}

Header Parameters

NameTypeRequiredDescription
Accept
string
false

Specifies the desired format of the returned rule job. Supported media types are: application/json application/vnd.sas.authorization.rule.job+json application/vnd.sas.authorization.rule.job+json;version=1 application/vnd.sas.authorization.rule.job+json;version=2

Content-Type
string
false

Specifies the format of the incoming rule job. Supported media types are: application/json application/vnd.sas.authorization.rule.job+json application/vnd.sas.authorization.rule.job+json;version=1 application/vnd.sas.authorization.rule.job+json;version=2

Request Body

Instructions to create, update, and delete specified rules.

Instructions for a set of actions to be performed asynchronously. Consists of a state that describes how the overall asynchronous job is performing and a set of actions to perform on defined rules.

NameTypeRequiredDescription
state
string
false

Defines the current state of an action.

Allowed values:
pendingrunningcompletedcompletedWithErrorsfailed
actions
array [Rule Action]
false

A set of actions to be performed on defined rules. These can be create, update, or delete actions. Actions are performed in their arrayed order.

links
array [Link]
false

Zero or more links that are to related resources and actions.

Responses

StatusMeaningDescription
202AcceptedAccepted. Returned if the rule job is created.HeadersSchema
400Bad RequestThe request was invalid. Returned if the specified rule job is invalid.Schema