POST OAuth/UpdateRule
Updates an existing rule.
UpdateRule must express the complete configuration as desired. All fields in the structure will be stored when the request is received. If they are not set in the request, they will be defaulted.
A best practice is to get the current configuration using GetRules, modify that response as desired, and then pass the entire structure into the UpdateRule request.
Requirements
- Roles: Admin or Application Owner. See OAuth roles for more information.
- Token scope: Admin
Headers
-
Content type: Content-Type:application/json.
- Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.
Parameters
Name |
Description |
---|---|
Rule object |
(Required) The following are required to be passed in the Rule object:
|
Returns
Name |
Description |
---|---|
HTTP 200 |
See OAuth result codes. |
HTTP 400 |
For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:
|
HTTP 401 |
For authentication errors, this call returns HTTP 401 Unauthorized and the following data in the message body:
|
HTTP 403 |
If the response is HTTP 403 Forbidden, the requester's token does not include the admin scope. Call POST Authorize/Oauth with the correct scope and restriction. Update the header with the new token and retry.
|
Examples
Request
POST /vedsdk/oauth/enumeraterules HTTP/1.1 Host: tpp-server-url Content-Type: application/json Accept: application/json Authorization: Bearer 4MyGeneratedBearerTknz== { "Rule": { "ApplicationId": "SSH Discovery", "TrusteePrefixedUniversal": "local:{5371f67c-c194-49e2-9c1a-e25c8b0e2e32}", "AccessValidity": 21557600, "Description": "Rule for User 3", "GrantValidity": 2776000, "MaximumScope": "ssh:discover", "Renewable": true } }
Response
{ "Result": 0, "Success": true }