Manipulate individual properties on an instance using JSON Patch requests

patch/updates/instances/{instanceId}
Internal-Use Only

Patch adds, updates, or removes properties on an instance. This endpoint currently only supports modifying entity instances; and only the following fields can be manipulated:

  • name
  • description
  • label
  • attributes. Only attributes defined on the type definition can be manipulated.

In order to patch an instance, the principal performing the operation must have one of the capabilities associated with the type definition properties (name, label, or description) or the attribute(s) being modified. See the requiredCapability field in the type and attribute definition media types. If the property or attribute does not have an assigned capability, or the capability is not one possessed by the principal, then the patch operation fails with a 403 Forbidden error. All the operations in the patch request succeed or fail as a unit.

Request Samples

1

Response Samples

1{
2 "creationTimeStamp": "2021-10-01T14:05:27.219Z",
3 "createdBy": "sasuser",
4 "modifiedTimeStamp": "2021-10-01T14:05:27.219Z",
5 "modifiedBy": "sasuser",
6 "id": "b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
7 "links": [
8 {
9 "method": "GET",
10 "rel": "self",
11 "href": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
12 "uri": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
13 "type": "application/vnd.sas.metadata.instance.entity"
14 },
15 {
16 "method": "GET",
17 "rel": "alternate",
18 "href": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
19 "uri": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
20 "type": "application/vnd.sas.summary"
21 },
22 {
23 "method": "GET",
24 "rel": "up",
25 "href": "/catalog/instances",
26 "uri": "/catalog/instances",
27 "type": "application/vnd.sas.collection",
28 "itemType": "application/vnd.sas.metadata.instance"
29 },
30 {
31 "method": "PUT",
32 "rel": "update",
33 "href": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
34 "uri": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
35 "type": "application/vnd.sas.metadata.instance.entity",
36 "responseType": "application/vnd.sas.metadata.instance.entity"
37 },
38 {
39 "method": "DELETE",
40 "rel": "delete",
41 "href": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf",
42 "uri": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf"
43 },
44 {
45 "method": "GET",
46 "rel": "definition",
47 "href": "/catalog/definitions/02b7102c-e997-465d-9f41-2491c3a4f05b",
48 "uri": "/catalog/definitions/02b7102c-e997-465d-9f41-2491c3a4f05b",
49 "type": "application/vnd.sas.metadata.definition.entity"
50 },
51 {
52 "method": "GET",
53 "rel": "history",
54 "href": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf/history",
55 "uri": "/catalog/instances/b7a9f8f7-e939-2f4d-bb4b-b6740702f2bf/history",
56 "type": "application/vnd.sas.collection",
57 "itemType": "application/vnd.sas.metadata.instance.entity"
58 },
59 {
60 "method": "GET",
61 "rel": "resource",
62 "href": "/dataTables/dataSources/Compute~fs~77191529-3947-401d-a883-0cc6055ecc8e~fs~SASHELP/tables/AACOMP",
63 "uri": "/dataTables/dataSources/Compute~fs~77191529-3947-401d-a883-0cc6055ecc8e~fs~SASHELP/tables/AACOMP",
64 "type": "application/json"
65 }
66 ],
67 "version": 1,
68 "instanceType": "entity",
69 "definition": "sasTable",
70 "name": "AACOMP",
71 "type": "sasTable",
72 "attributes": {
73 "analysisTimeStamp": "2021-10-01T14:05:24.247Z",
74 "columnCount": 4,
75 "completenessPercent": 100,
76 "creator": "sas",
77 "dataLocale": "ENUSA",
78 "dataSize": 458752,
79 "dateCreated": "2021-09-28T08:03:09.972Z",
80 "dateModified": "2021-09-28T08:03:09.972Z",
81 "encoding": "us-ascii ASCII (ANSI)",
82 "extension": "sas7bdat",
83 "informationPrivacy": "private",
84 "isView": false,
85 "reviewStatus": "none",
86 "rowCount": 2020,
87 "runStatus": "new",
88 "sourceSystem": "SAS"
89 },
90 "resourceId": "/dataTables/dataSources/Compute~fs~77191529-3947-401d-a883-0cc6055ecc8e~fs~SASHELP/tables/AACOMP"
91}

Path Parameters

NameTypeRequiredDescription
instanceId
string
true

The ID of the Instance

Header Parameters

NameTypeRequiredDescription
Content-Type
string
true

The representation in the request body.

Allowed values:
application/json-patch+jsonapplication/json
Default:
application/json-patch+json
If-Match
string
true

The ETag that was returned from a GET, POST, PUT, PATCH, or HEAD of this object. If the ETag does not match, the update will fail.

Accept
string
false

The desired representation for the response.

Allowed values:
application/vnd.sas.metadata.instance.entityapplication/vnd.sas.summaryapplication/vnd.sas.metadata.instanceapplication/json
Default:
application/vnd.sas.metadata.instance.entity

Request Body

A JSONPatch document containing the path of the item to add or remove.

NameTypeRequiredDescription
op
string
true

Operation to perform; either 'add' (which also updates), or 'remove'. Other patch operations are not supported.

Allowed values:
addremove
path
string
true

The JSON path to the property to be manipulated. The path should start with a leading slash ('/') and reference one of the following fields:

  • name
  • description
  • label
  • attributes. /attributes must be followed with another slash and the name of a single-valued attribute definition that is defined on object's type definition.
value
anyOfstringbooleannumberinteger
false

The new value of the property for 'add' operations. The value must be compatible with the type modeled on the attribute definition.

Responses

StatusMeaningDescription
200OKThe request succeeded, and the has been updated.HeadersSchema
400Bad RequestBad request (the request is not well-formed).Schema
401UnauthorizedNot authenticated.Schema
403ForbiddenThe user does not have permission to complete this request.Schema
404Not FoundThe specified resource was not found.Schema
412Precondition FailedPrecondition failed. The target has changed since it was last fetched.Schema
428Precondition RequiredPrecondition required. Include an If-Match header with the request.Schema