GET /api/compliance/policies
列出策略

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

search
选填

过滤结果

Validations:

  • Must be a String

order
选填

排序项和顺序,例如 ‘id DESC’

Validations:

  • Must be a String

page
选填

页号,从 1 开始

Validations:

  • Must be a number.

per_page
选填

每页中显示的返回结果数

Validations:

  • Must be a number.

搜索字段

字段名 类型 可能的值
content
location
location_id
name
organization
organization_id
profile
tailoring_file
tailoring_file_profile

GET /api/compliance/policies/:id
显示策略

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/compliance/policies
创建策略

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

policy
必填

Validations:

  • Must be a Hash

policy[name]
必填

策略名称

Validations:

  • Must be a String

policy[description]
选填 , 允许空值

策略描述

Validations:

  • Must be a String

policy[scap_content_id]
必填

策略 SCAP 内容 ID

Validations:

  • Must be a Integer

policy[scap_content_profile_id]
必填

策略 SCAP 内容配置文件 ID

Validations:

  • Must be a Integer

policy[period]
选填 , 允许空值

策略调度时段(周、月、自定义)

Validations:

  • Must be a String

policy[weekday]
选填 , 允许空值

策略调度工作日(只在时段 = “每周”时适用)

Validations:

  • Must be a String

policy[day_of_month]
选填 , 允许空值

每月的策略调度日(只在时段 = “每月”时适用)

Validations:

  • Must be a Integer

policy[cron_line]
选填 , 允许空值

策略调度 cron 行(只在时段 = “自定义”时适用)

Validations:

  • Must be a String

policy[hostgroup_ids]
选填 , 允许空值

应用策略到主机组

Validations:

  • Must be an array of any type

policy[host_ids]
选填 , 允许空值

对主机应用策略

Validations:

  • Must be an array of any type

policy[tailoring_file_id]
选填 , 允许空值

定制文件 ID

Validations:

  • Must be a Integer

policy[tailoring_file_profile_id]
选填 , 允许空值

定制文件配置文件 ID

Validations:

  • Must be a Integer

policy[deploy_by]
必填

How the policy should be deployed

Validations:

  • Must be one of: puppet, ansible, manual.

policy[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

policy[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


PUT /api/compliance/policies/:id
更新策略

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

policy
必填

Validations:

  • Must be a Hash

policy[name]
选填

策略名称

Validations:

  • Must be a String

policy[description]
选填 , 允许空值

策略描述

Validations:

  • Must be a String

policy[scap_content_id]
选填

策略 SCAP 内容 ID

Validations:

  • Must be a Integer

policy[scap_content_profile_id]
选填

策略 SCAP 内容配置文件 ID

Validations:

  • Must be a Integer

policy[period]
选填 , 允许空值

策略调度时段(周、月、自定义)

Validations:

  • Must be a String

policy[weekday]
选填 , 允许空值

策略调度工作日(只在时段 = “每周”时适用)

Validations:

  • Must be a String

policy[day_of_month]
选填 , 允许空值

每月的策略调度日(只在时段 = “每月”时适用)

Validations:

  • Must be a Integer

policy[cron_line]
选填 , 允许空值

策略调度 cron 行(只在时段 = “自定义”时适用)

Validations:

  • Must be a String

policy[hostgroup_ids]
选填 , 允许空值

应用策略到主机组

Validations:

  • Must be an array of any type

policy[host_ids]
选填 , 允许空值

对主机应用策略

Validations:

  • Must be an array of any type

policy[tailoring_file_id]
选填 , 允许空值

定制文件 ID

Validations:

  • Must be a Integer

policy[tailoring_file_profile_id]
选填 , 允许空值

定制文件配置文件 ID

Validations:

  • Must be a Integer

policy[deploy_by]
选填

How the policy should be deployed

Validations:

  • Must be one of: puppet, ansible, manual.

policy[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

policy[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


DELETE /api/compliance/policies/:id
删除一个策略

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


GET /api/compliance/policies/:id/content
显示策略的 SCAP 内容

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


GET /api/compliance/policies/:id/tailoring
显示策略定制文件

参数

参数名字 描述
location_id
选填

设置请求的当前位置上下文

Validations:

  • Must be a Integer

organization_id
选填

设置请求的当前组织上下文

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.