Create the FPolicy configuration for an SVM
Configures an FPolicy policy for a specified SVM to monitor and manage file access events. Use this endpoint to define the policy's scope and events, ensuring appropriate file access control within your storage environment.
HTTP method and endpoint
POST /protocols/fpolicy/{svm.uuid}/policies
Introduced in
ONTAP 9.6
Usage notes
Creates an FPolicy policy configuration for the specified SVM. To create an FPolicy policy, you must specify the policy scope and the FPolicy events to be monitored.
Important notes:
-
A single policy can monitor multiple events.
-
An FPolicy engine is an optional field whose default value is set to native. A native engine can be used to simply block the file access based on the file extensions specified in the policy scope.
-
To enable a policy, the policy priority must be specified. If the priority is not specified, the policy is created but it is not enabled.
-
The "mandatory" field, if set to true, blocks the file access when the primary or secondary FPolicy servers are down.
Required properties
-
svm.uuid- Existing SVM in which to create the FPolicy policy. -
events- Name of the events to monitior. -
name- Name of the FPolicy policy. -
scope- Scope of the policy. Can be limited to exports, volumes, shares or file extensions. -
priority- Priority of the policy (ranging from 1 to 10).
Default property values
-
mandatory- true -
engine- native
Related ONTAP commands
-
fpolicy policy scope create -
fpolicy policy create -
fpolicy enable
Learn more
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
return_records |
boolean |
query |
False |
The default is false. If set to true, the records are returned.
|
svm.uuid |
string |
path |
True |
UUID of the SVM to which this object belongs. |
Request Body
| Name | Type | Description |
|---|---|---|
engine |
FPolicy external engine |
|
events |
array[fpolicy_event_reference] |
|
mandatory |
boolean |
Specifies what action to take on a file access event in a case when all primary and secondary servers are down or no response is received from the FPolicy servers within a given timeout period. When this parameter is set to true, file access events will be denied under these circumstances. |
name |
string |
Specifies the name of the policy. |
passthrough_read |
boolean |
Specifies whether passthrough-read should be allowed for FPolicy servers registered for the policy. Passthrough-read is a way to read data for offline files without restoring the files to primary storage. Offline files are files that have been moved to secondary storage. |
priority |
integer |
Specifies the priority that is assigned to this policy. |
privileged_user |
string |
Specifies the privileged user name for accessing files on the cluster using a separate data channel with privileged access. The input for this field should be in "domain\username" format. |
scope |
||
svm |
Example request
{
"enabled": null,
"engine": {
"name": "string"
},
"events": [
"event_nfs_close",
"event_open"
],
"name": "fp_policy_1",
"privileged_user": "mydomain\\testuser",
"scope": {
"exclude_export_policies": [
"string"
],
"exclude_extension": [
"string"
],
"exclude_shares": [
"string"
],
"exclude_volumes": [
"vol1",
"vol_svm1",
"*"
],
"include_export_policies": [
"string"
],
"include_extension": [
"string"
],
"include_shares": [
"sh1",
"share_cifs"
],
"include_volumes": [
"vol1",
"vol_svm1"
]
},
"svm": {
"uuid": "string"
}
}
Response
Status: 201, Created
| Name | Type | Description |
|---|---|---|
num_records |
integer |
Number of Records |
records |
array[fpolicy_policy] |
Example response
{
"records": [
{
"enabled": null,
"engine": {
"name": "string"
},
"events": [
"event_nfs_close",
"event_open"
],
"name": "fp_policy_1",
"privileged_user": "mydomain\\testuser",
"scope": {
"exclude_export_policies": [
"string"
],
"exclude_extension": [
"string"
],
"exclude_shares": [
"string"
],
"exclude_volumes": [
"vol1",
"vol_svm1",
"*"
],
"include_export_policies": [
"string"
],
"include_extension": [
"string"
],
"include_shares": [
"sh1",
"share_cifs"
],
"include_volumes": [
"vol1",
"vol_svm1"
]
},
"svm": {
"uuid": "string"
}
}
]
}
Error
Status: Default
ONTAP Error Response Codes
| Error Code | Description |
|---|---|
9765027 |
FPolicy creation is successful but it cannot be enabled as the priority is already in use by another policy |
9764898 |
An FPolicy policy cannot be created without defining its scope |
9765037 |
FPolicy creation failed as passthrough-read cannot be enabled for policy without privileged user |
Definitions
See Definitions
href
| Name | Type | Description |
|---|---|---|
href |
string |
_links
fpolicy_engine_reference
FPolicy external engine
| Name | Type | Description |
|---|---|---|
name |
string |
The name of the FPolicy external engine. |
fpolicy_event_reference
FPolicy events
| Name | Type | Description |
|---|---|---|
name |
string |
scope
| Name | Type | Description |
|---|---|---|
exclude_export_policies |
array[string] |
|
exclude_extension |
array[string] |
|
exclude_shares |
array[string] |
|
exclude_volumes |
array[string] |
|
include_export_policies |
array[string] |
|
include_extension |
array[string] |
|
include_shares |
array[string] |
|
include_volumes |
array[string] |
svm
| Name | Type | Description |
|---|---|---|
uuid |
string |
SVM UUID |
fpolicy_policy
| Name | Type | Description |
|---|---|---|
engine |
FPolicy external engine |
|
events |
array[fpolicy_event_reference] |
|
mandatory |
boolean |
Specifies what action to take on a file access event in a case when all primary and secondary servers are down or no response is received from the FPolicy servers within a given timeout period. When this parameter is set to true, file access events will be denied under these circumstances. |
name |
string |
Specifies the name of the policy. |
passthrough_read |
boolean |
Specifies whether passthrough-read should be allowed for FPolicy servers registered for the policy. Passthrough-read is a way to read data for offline files without restoring the files to primary storage. Offline files are files that have been moved to secondary storage. |
priority |
integer |
Specifies the priority that is assigned to this policy. |
privileged_user |
string |
Specifies the privileged user name for accessing files on the cluster using a separate data channel with privileged access. The input for this field should be in "domain\username" format. |
scope |
||
svm |
error_arguments
| Name | Type | Description |
|---|---|---|
code |
string |
Argument code |
message |
string |
Message argument |
error
| Name | Type | Description |
|---|---|---|
arguments |
array[error_arguments] |
Message arguments |
code |
string |
Error code |
message |
string |
Error message |
target |
string |
The target parameter that caused the error. |