Foreman considers a domain and a DNS zone as the same thing. That is, if you are planning to manage a site where all the machines are of the form hostname.somewhere.com then the domain is somewhere.com. This allows Foreman to associate a puppet variable with a domain/site and automatically append this variable to all external node requests made by machines at that site.


GET /api/domains
域列表

GET /api/subnets/:subnet_id/domains
每个子网的域列表

GET /api/locations/:location_id/domains
每个位置的域列表

GET /api/organizations/:organization_id/domains
每个机构的域列表

参数

参数名字 描述
subnet_id
选填

子网 ID

Validations:

  • Must be a String

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.

搜索字段

字段名 类型 可能的值
fullname
location
location_id
name
organization
organization_id
params

GET /api/domains/:id
显示域

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

数字 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.

show_hidden_parameters
选填

显示隐藏的参数值

Validations:

  • Must be one of: true, false, 1, 0.


POST /api/domains
创建域

The fullname field is used for human readability in reports and other pages that refer to domains, and also available as an external node parameter

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

domain
必填

Validations:

  • Must be a Hash

domain[name]
必填

完整 DNS 域名

Validations:

  • Must be a String

domain[fullname]
选填 , 允许空值

域描述

Validations:

  • Must be a String

domain[dns_id]
选填 , 允许空值

要在此域中使用的 DNS 代理 ID

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
选填 , 允许空值

参数阵列(name,value)

Validations:

  • Must be an array of any type

domain[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

domain[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


PUT /api/domains/:id
更新域

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

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.

domain
必填

Validations:

  • Must be a Hash

domain[name]
选填

完整 DNS 域名

Validations:

  • Must be a String

domain[fullname]
选填 , 允许空值

域描述

Validations:

  • Must be a String

domain[dns_id]
选填 , 允许空值

要在此域中使用的 DNS 代理 ID

Validations:

  • Must be a number.

domain[domain_parameters_attributes]
选填 , 允许空值

参数阵列(name,value)

Validations:

  • Must be an array of any type

domain[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

domain[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


DELETE /api/domains/:id
删除域

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

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.