Update rule
PUT/api/management/policy/rule/:id
Update rule template
Request
Path Parameters
id numberrequired
- application/json
Bodyrequired
idnumber
actionstring[]required
Example:
["READ","USE"]
assigneestring[]
Example:
["did:example:assignee"]
constraints object[]required
dutiesundefined[]required
typeRuleType (string)
Possible values: [PERMISSION
, PROHIBITION
, DUTY
]
targetstring
Responses
- 200
- 400
- 403
- 404
- 409
- application/json
- Schema
- Example (auto)
Schema
idnumber
actionstring[]required
Example:
["READ","USE"]
assigneestring[]
Example:
["did:example:assignee"]
constraints object[]required
dutiesundefined[]required
typeRuleType (string)
Possible values: [PERMISSION
, PROHIBITION
, DUTY
]
targetstring
{
"id": 0,
"action": [
"READ",
"USE"
],
"assignee": [
"did:example:assignee"
],
"constraints": [
{
"id": 0,
"type": "ATOMIC",
"title": "Constraint title",
"description": "Constraint description"
}
],
"duties": [
null
],
"type": "PERMISSION",
"target": "string"
}
Malformed request
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Forbidden
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Resource not found
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Resource already exists
- application/json
- Schema
- Example (auto)
Schema
namestringrequired
Example:
ResourceNotFound
statusstringrequired
Example:
404 Not Found
codenumberrequired
Example:
404
messageobject
Example:
The requested resource does not exist.
errorstring
Example:
Not Found
{
"name": "ResourceNotFound",
"status": "404 Not Found",
"code": 404,
"message": "The requested resource does not exist.",
"error": "Not Found"
}
Authorization: oauth2
name: oauth2type: oauth2scopes:controlplane_admin
flows: { "password": { "scopes": { "controlplane_admin": "controlplane_admin", "controlplane_dataplane": "controlplane_dataplane" } } }
- curl
- http
- CURL
curl -L -X PUT 'https://tsg.dataspac.es/api/management/policy/rule/:id' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"id": 0,
"action": [
"READ",
"USE"
],
"assignee": [
"did:example:assignee"
],
"constraints": [
{
"id": 0,
"type": "ATOMIC",
"title": "Constraint title",
"description": "Constraint description"
}
],
"duties": [
null
],
"type": "PERMISSION",
"target": "string"
}'