BlueXP分类API
通过Web UI提供的BlueXP分类功能也可通过Swagger API获得。
BlueXP分类中定义了四个类别、它们对应于用户界面中的选项卡:
-
调查
-
合规性
-
监管
-
Configuration
通过Swagger文档中的API、您可以搜索、聚合数据、跟踪扫描以及创建复制、移动等操作。
概述
通过API、您可以执行以下功能:
-
导出信息
-
用户界面中提供的所有内容均可通过API导出(报告除外)
-
数据以JSON格式导出(易于解析并推送到第三方应用程序、如Splunk)
-
-
使用"and"和"or"语句创建查询、包括和排除信息等。
例如、您可以查找files _without _ Specific Personal可识别信息(PII)(此功能在UI中不可用)。您还可以排除导出操作的特定字段。
-
执行操作
-
更新CIFS凭据
-
查看和取消操作
-
重新扫描目录
-
导出数据
-
此API非常安全、并且使用与用户界面相同的身份验证方法。有关身份验证的信息、请参见: https://docs.netapp.com/us-en/bluexp-automation/platform/get_identifiers.html
访问Swagger API引用
要进入Swagger、您需要BlueXP分类实例的IP地址。对于云部署、您将使用公共IP地址。然后、您需要进入此端点:
\https://https://documents/Documentation <classification_ip>
使用API的示例
以下示例显示了用于复制文件的API调用。
您最初需要获取工作环境的所有相关字段和选项、才能查看调查选项卡中的所有筛选器。
curl -X GET "http://{classification_ip}/api/{classification_version} /search/options?data_mode=ALL_EXTRACTABLE" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR……… " -H "x-agent-id: hOXsZNvnA5LsthwMILtjL9xZFYBQxAwMclients"
{
"options": [
{
"active_directory_affected": false,
"data_mode": "ALL_SCANNED",
"field": "string",
"is_rulable": true,
"name": "string",
"operators": [
"EQUALS"
],
"optional_values": [
{}
],
"secondary": {},
"server_data": false,
"type": "TEXT"
}
]
}
{
"options": [
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "POLICIES",
"name": "Policies",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "EXTRACTION_STATUS_RANGE",
"name": "Scan Analysis Status",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "SCAN_ANALYSIS_ERROR",
"name": "Scan Analysis Event",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "PUBLIC_ACCESS",
"name": "Open Permissions",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": true,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "USERS_PERMISSIONS_COUNT_RANGE",
"name": "Number of Users with Access",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": true,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "USER_GROUP_PERMISSIONS",
"name": "User / Group Permissions",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_OWNER",
"name": "File Owner",
"operators": [
"EQUALS",
"CONTAINS"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ENVIRONMENT_TYPE",
"name": "Working Environment Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ENVIRONMENT",
"name": "Working Environment",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_SCANNED",
"field": "SCAN_TASK",
"name": "Storage Repository",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_PATH",
"name": "File / Directory Path",
"operators": [
"MULTI_CONTAINS",
"MULTI_EXCLUDE"
],
"server_data": true,
"type": "MULTI_TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_DASHBOARD_EXTRACTABLE",
"field": "CATEGORY",
"name": "Category",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_SENSITIVITY_LEVEL",
"name": "Sensitivity Level",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "NUMBER_OF_IDENTIFIERS",
"name": "Number of identifiers",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_PERSONAL",
"name": "Personal Data",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "PATTERN_SENSITIVE",
"name": "Sensitive Personal Data",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "DATA_SUBJECT",
"name": "Data Subject",
"operators": [
"EQUALS",
"CONTAINS"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "DIRECTORIES",
"field": "DIRECTORY_TYPE",
"name": "Directory Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "FILE_TYPE",
"name": "File Type",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "FILE_SIZE_RANGE",
"name": "File Size",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_CREATION_RANGE_RETENTION",
"name": "Created Time",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "DISCOVERED_TIME_RANGE",
"name": "Discovered Time",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_LAST_MODIFICATION_RETENTION",
"name": "Last Modified",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_FILESYSTEM_EXTRACTABLE",
"field": "FILE_LAST_ACCESS_RANGE_RETENTION",
"name": "Last Accessed",
"operators": [
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "FILES",
"field": "IS_DUPLICATE",
"name": "Duplicates",
"operators": [
"EQUALS",
"IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "FILES",
"field": "FILE_HASH",
"name": "File Hash",
"operators": [
"EQUALS",
"IN"
],
"server_data": true,
"type": "TEXT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "USER_DEFINED_STATUS",
"name": "Tags",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
},
{
"active_directory_affected": false,
"data_mode": "ALL_EXTRACTABLE",
"field": "ASSIGNED_TO",
"name": "Assigned to",
"operators": [
"IN",
"NOT_IN"
],
"server_data": true,
"type": "SELECT"
}
]
}
我们将在请求参数中使用该响应来筛选要复制的所需文件。
您可以对多个项目应用操作。支持的操作类型包括:移动、删除、复制、分配到、FlexClone、 导出数据、重新扫描和标记。
我们将创建复制操作:
下一个API是操作API、它允许您创建多个操作。
curl -X POST "http:// {classification_ip}/api//{classification_version}/actions" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR……… " -H "x-agent-id: hOXsZNvnA5LsthwMILtjL9xZFYBQxAwMclients " -H "Content-Type: application/json" -d "{ \"action_type\": \"COPY\", \"data_mode\": \"FILES\", \"policy_id\": 0, \"request_params\": { destination_nfs_path: "{ontap_ip}:/{share_name} " }, \"requested_query\":{"condition":"AND","rules":[{"field":"ENVIRONMENT_TYPE","operator":"IN","value":["ONPREM"]},{"field":"CATEGORY","operator":"IN","value":["21"]}]}}"
此响应将返回action对象、因此您可以使用GET和DELETE API获取有关此操作的状态或取消此操作。
{
"action_type": "COPY",
"creation_time": "2023-08-08T12:37:21.705Z",
"data_mode": "FILES",
"end_time": "2023-08-08T12:37:21.705Z",
"estimated_time_to_complete": 0,
"id": 0,
"policy_id": 0,
"policy_name": "string",
"priority": 0,
"request_params": {},
"requested_query": {},
"result": {
"error_message": "string",
"failed": 0,
"in_progress": 0,
"succeeded": 0,
"total": 0
},
"start_time": "2023-08-08T12:37:21.705Z",
"status": "QUEUED",
"title": "string",
"user_id": "string"
}