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 "version": 1,
46 "instanceType": "entity",
47 "definition": "sasTable",
48 "name": "AACOMP",
49 "type": "sasTable",
50 "attributes": {
51 "analysisTimeStamp": "2021-10-01T14:05:24.247Z",
52 "columnCount": 4,
53 "completenessPercent": 100,
54 "creator": "sas",
55 "dataLocale": "ENUSA",
56 "dataSize": 458752,
57 "dateCreated": "2021-09-28T08:03:09.972Z",
58 "dateModified": "2021-09-28T08:03:09.972Z",
59 "encoding": "us-ascii ASCII (ANSI)",
60 "extension": "sas7bdat",
61 "informationPrivacy": "private",
62 "isView": false,
63 "reviewStatus": "none",
64 "rowCount": 2020,
65 "runStatus": "new",
66 "sourceSystem": "SAS"
67 }
68}

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