Patch shares

patch/shares
Internal-Use Only

Performs a set of share management actions as specified in a JSON patch. The actions are performed synchronously and transactionally. A resource collection of all created and revised shares is returned. If the patch is not successfully applied, changes are rolled back.

For every action, the patch must specify an operation (add, replace, remove, test, or copy) and a target URI (for example, /authorization/shares/{shareId} or, to create a new share, /authorization/shares). Each add and replace operation requires a valid share representation.

Request Samples

1

Response Samples

1{
2 "value": [
3 {
4 "type": "read",
5 "sharedWith": "testUser",
6 "sharedWithType": "user",
7 "sharedBy": "currentUser",
8 "resourceUri": "/files/files/4288b305-981f-4b8d-b440-0911eabe3faf",
9 "name": "test file",
10 "enabled": true,
11 "version": 3,
12 "links": [
13 {
14 "method": "GET",
15 "rel": "self",
16 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
17 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
18 "type": "application/vnd.sas.authorization.share"
19 },
20 {
21 "method": "PUT",
22 "rel": "update",
23 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
24 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
25 "type": "application/vnd.sas.authorization.share",
26 "responseType": "application/vnd.sas.authorization.share"
27 },
28 {
29 "method": "DELETE",
30 "rel": "delete",
31 "href": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac",
32 "uri": "/authorization/shares/3288b305-981f-4b8d-b440-0911eabc3fac"
33 }
34 ],
35 "id": "3288b305-981f-4b8d-b440-0911eabc3fac",
36 "modifiedTimestamp": "2016-08-27T04:09:42.150Z",
37 "createdTimestamp": "2016-08-27T04:09:42.150Z",
38 "createdBy": "currentUser",
39 "modifiedBy": "currentUser"
40 },
41 {
42 "type": "read",
43 "sharedWith": "testUser",
44 "sharedWithType": "user",
45 "sharedBy": "currentUser",
46 "resourceUri": "/files/files/file2",
47 "name": "test file",
48 "enabled": true,
49 "version": 3,
50 "links": [
51 {
52 "method": "GET",
53 "rel": "self",
54 "href": "/authorization/shares/file2",
55 "uri": "/authorization/shares/file2",
56 "type": "application/vnd.sas.authorization.share"
57 },
58 {
59 "method": "PUT",
60 "rel": "update",
61 "href": "/authorization/shares/file2",
62 "uri": "/authorization/shares/file2",
63 "type": "application/vnd.sas.authorization.share",
64 "responseType": "application/vnd.sas.authorization.share"
65 },
66 {
67 "method": "DELETE",
68 "rel": "delete",
69 "href": "/authorization/shares/file2",
70 "uri": "/authorization/shares/file2"
71 }
72 ],
73 "id": "3288b305-981f-4b8d-b440-0911eabc3fac",
74 "modifiedTimestamp": "2016-08-27T04:09:42.150Z",
75 "createdTimestamp": "2016-08-27T04:09:42.150Z",
76 "createdBy": "currentUser",
77 "modifiedBy": "currentUser"
78 }
79 ]
80}

Request Body

JSON patch describing operations to perform and identifying the target shares.

Array of patch operations to apply to the existing shares.

NameTypeRequiredDescription
value
Share
false

A share that does not have a known ID or sharedBy value. The share has not been saved or the ID is unavailable for some other reason. Compare with SavedShare.

op
string
true

The type of operation to perform on the defined share.

Allowed values:
addreplaceremove
path
string
true

The URI of the share.

Responses

StatusMeaningDescription
200OKThe request succeeded. Returned if the patch was applied successfully.Schema
400Bad RequestThe request was invalid. Returned if the specified share patch is invalid.Schema
412Precondition FailedPrecondition failedSchema
422Unprocessable EntityUnprocessable Entity. Returned if the patch request is syntactically valid but would result in a resource state that is inconsistent or invalid.Schema
428Precondition RequiredPrecondition requiredSchema