GET /api/compliance/policies
List 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 string
location string
location_id integer
name string
organization string
organization_id integer
profile string
tailoring_file string
tailoring_file_profile string

GET /api/compliance/policies/:id
Show a Policy

参数

参数名字 描述
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
Create a Policy

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

policy
必填

Validations:

  • Must be a Hash

policy[name]
必填

Policy name

Validations:

  • Must be a String

policy[description]
选填 , 允许空值

Policy description

Validations:

  • Must be a String

policy[scap_content_id]
必填

Policy SCAP content ID

Validations:

  • Must be a Integer

policy[scap_content_profile_id]
必填

Policy SCAP content profile ID

Validations:

  • Must be a Integer

policy[period]
选填 , 允许空值

Policy schedule period (weekly, monthly, custom)

Validations:

  • Must be a String

policy[weekday]
选填 , 允许空值

Policy schedule weekday (only if period == “weekly”)

Validations:

  • Must be a String

policy[day_of_month]
选填 , 允许空值

Policy schedule day of month (only if period == “monthly”)

Validations:

  • Must be a Integer

policy[cron_line]
选填 , 允许空值

Policy schedule cron line (only if period == “custom”)

Validations:

  • Must be a String

policy[hostgroup_ids]
选填 , 允许空值

Apply policy to host groups

Validations:

  • Must be an array of any type

policy[host_ids]
选填 , 允许空值

Apply policy to hosts

Validations:

  • Must be an array of any type

policy[tailoring_file_id]
选填 , 允许空值

Tailoring file ID

Validations:

  • Must be a Integer

policy[tailoring_file_profile_id]
选填 , 允许空值

Tailoring file profile 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
Update a Policy

参数

参数名字 描述
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]
选填

Policy name

Validations:

  • Must be a String

policy[description]
选填 , 允许空值

Policy description

Validations:

  • Must be a String

policy[scap_content_id]
选填

Policy SCAP content ID

Validations:

  • Must be a Integer

policy[scap_content_profile_id]
选填

Policy SCAP content profile ID

Validations:

  • Must be a Integer

policy[period]
选填 , 允许空值

Policy schedule period (weekly, monthly, custom)

Validations:

  • Must be a String

policy[weekday]
选填 , 允许空值

Policy schedule weekday (only if period == “weekly”)

Validations:

  • Must be a String

policy[day_of_month]
选填 , 允许空值

Policy schedule day of month (only if period == “monthly”)

Validations:

  • Must be a Integer

policy[cron_line]
选填 , 允许空值

Policy schedule cron line (only if period == “custom”)

Validations:

  • Must be a String

policy[hostgroup_ids]
选填 , 允许空值

Apply policy to host groups

Validations:

  • Must be an array of any type

policy[host_ids]
选填 , 允许空值

Apply policy to hosts

Validations:

  • Must be an array of any type

policy[tailoring_file_id]
选填 , 允许空值

Tailoring file ID

Validations:

  • Must be a Integer

policy[tailoring_file_profile_id]
选填 , 允许空值

Tailoring file profile 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
Delete a Policy

参数

参数名字 描述
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
Show a policy's SCAP content

参数

参数名字 描述
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
Show a policy's Tailoring file

参数

参数名字 描述
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.