GET /api/operatingsystems
列出所有操作系统

GET /api/architectures/:architecture_id/operatingsystems
列出嵌套架构的所有操作系统

GET /api/media/:medium_id/operatingsystems
列出嵌套媒体的所有操作系统

GET /api/ptables/:ptable_id/operatingsystems
列出嵌套分区表的所有操作系统

GET /api/config_templates/:config_template_id/operatingsystems
列出嵌套预配模板的所有操作系统

GET /api/provisioning_templates/:provisioning_template_id/operatingsystems
列出嵌套预配模板的所有操作系统

示例

GET /api/operatingsystems
200
{
  "total": 8,
  "subtotal": 8,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "description": null,
      "major": "5",
      "minor": "3",
      "family": "Redhat",
      "release_name": null,
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 309172073,
      "name": "centos",
      "title": "centos 5.3"
    },
    {
      "description": null,
      "major": "5",
      "minor": "17",
      "family": "VRP",
      "release_name": null,
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 32055736,
      "name": "Huawei_VRP",
      "title": "Huawei VRP 5"
    },
    {
      "description": null,
      "major": "1",
      "minor": "1",
      "family": "Redhat",
      "release_name": null,
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 775246587,
      "name": "NoHosts",
      "title": "NoHosts 1.1"
    },
    {
      "description": null,
      "major": "12",
      "minor": "3",
      "family": "Suse",
      "release_name": null,
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 750842046,
      "name": "OpenSuse",
      "title": "OpenSuSE 12.3"
    },
    {
      "description": "RHEL 6.1",
      "major": "6",
      "minor": "1",
      "family": "Redhat",
      "release_name": null,
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 1073012828,
      "name": "Redhat",
      "title": "RHEL 6.1"
    },
    {
      "description": null,
      "major": "5",
      "minor": "10",
      "family": "Solaris",
      "release_name": "hw0910",
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 442321401,
      "name": "Solaris",
      "title": "Solaris 5.10"
    },
    {
      "description": null,
      "major": "10",
      "minor": "10",
      "family": "Debian",
      "release_name": "rn10",
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 331303656,
      "name": "Ubuntu",
      "title": "Ubuntu 10.10"
    },
    {
      "description": null,
      "major": "12",
      "minor": "10",
      "family": "Debian",
      "release_name": "rn10",
      "password_hash": "SHA256",
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 272342666,
      "name": "Ubuntu",
      "title": "Ubuntu 12.10"
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

architecture_id
选填

架构 ID

Validations:

  • Must be a String

medium_id
选填

媒体 ID

Validations:

  • Must be a String

ptable_id
选填

分区表 ID

Validations:

  • Must be a String

config_template_id
选填

模板 ID

Validations:

  • Must be a String

provisioning_template_id
选填

模板 ID

Validations:

  • Must be a String

os_parameters_attributes
选填

参数阵列

Validations:

  • Must be an Array of nested elements

os_parameters_attributes[name]
必填

参数名称

Validations:

  • Must be a String

os_parameters_attributes[value]
必填

参数值

Validations:

  • Must be a String

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.

搜索字段

字段名 类型 可能的值
architecture string
description string
family string
major string
medium string
minor string
name string
params text
template string
title string

GET /api/operatingsystems/:id
显示操作系统

示例

GET /api/operatingsystems/1073012829
200
{
  "description": null,
  "major": "550",
  "minor": "",
  "family": null,
  "release_name": null,
  "password_hash": "SHA256",
  "created_at": "2019-09-11 14:47:36 UTC",
  "updated_at": "2019-09-11 14:47:36 UTC",
  "id": 1073012829,
  "name": "operatingsystem538",
  "title": "operatingsystem538 550",
  "media": [],
  "architectures": [],
  "ptables": [],
  "config_templates": [],
  "provisioning_templates": [],
  "os_default_templates": [],
  "images": [],
  "parameters": [
    {
      "priority": 50,
      "created_at": "2019-09-11 14:47:36 UTC",
      "updated_at": "2019-09-11 14:47:36 UTC",
      "id": 767575239,
      "name": "foo",
      "parameter_type": null,
      "value": "*****"
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String

show_hidden_parameters
选填

显示隐藏的参数值

Validations:

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


POST /api/operatingsystems
创建操作系统

示例

POST /api/operatingsystems
{
  "operatingsystem": {
    "name": "nIchybcxxO",
    "major": "1"
  }
}
201
{
  "description": null,
  "major": "1",
  "minor": "",
  "family": null,
  "release_name": null,
  "password_hash": "SHA256",
  "created_at": "2019-09-11 14:55:41 UTC",
  "updated_at": "2019-09-11 14:55:41 UTC",
  "id": 1073012837,
  "name": "nIchybcxxO",
  "title": "nIchybcxxO 1",
  "media": [],
  "architectures": [],
  "ptables": [],
  "config_templates": [],
  "provisioning_templates": [],
  "os_default_templates": [],
  "images": [],
  "parameters": []
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

operatingsystem
必填

Validations:

  • Must be a Hash

operatingsystem[name]
必填

Validations:

  • Must match regular expression /\A(\S+)\Z/.

operatingsystem[major]
必填

Validations:

  • Must be a String

operatingsystem[minor]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[description]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[family]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[release_name]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[os_parameters_attributes]
选填 , 允许空值

参数阵列

Validations:

  • Must be an Array of nested elements

operatingsystem[os_parameters_attributes][name]
必填

参数名称

Validations:

  • Must be a String

operatingsystem[os_parameters_attributes][value]
必填

参数值

Validations:

  • Must be a String

operatingsystem[password_hash]
选填 , 允许空值

要使用的 root 密码哈希功能,应为 MD5、SHA256、SHA512 和 Base64 之一。

Validations:

  • Must be a String

operatingsystem[architecture_ids]
选填 , 允许空值

关联架构的 ID

Validations:

  • Must be an array of any type

operatingsystem[config_template_ids]
选填 , 允许空值

关联预配模板的 ID

Validations:

  • Must be an array of any type

operatingsystem[provisioning_template_ids]
选填 , 允许空值

关联预配模板的 ID

Validations:

  • Must be an array of any type

operatingsystem[medium_ids]
选填 , 允许空值

关联介质的 ID

Validations:

  • Must be an array of any type

operatingsystem[ptable_ids]
选填 , 允许空值

关联分区表的 ID

Validations:

  • Must be an array of any type


PUT /api/operatingsystems/:id
更新操作系统

示例

PUT /api/operatingsystems/1073012828-RHEL%206-1
{
  "operatingsystem": {},
  "architectures": [
    {
      "name": "x86_64"
    },
    {
      "name": "sparc"
    }
  ]
}
200
{
  "description": "RHEL 6.1",
  "major": "6",
  "minor": "1",
  "family": "Redhat",
  "release_name": null,
  "password_hash": "SHA256",
  "created_at": "2019-09-11 14:55:21 UTC",
  "updated_at": "2019-09-11 14:55:21 UTC",
  "id": 1073012828,
  "name": "Redhat",
  "title": "RHEL 6.1",
  "media": [
    {
      "id": 980190962,
      "name": "CentOS 5.4"
    }
  ],
  "architectures": [
    {
      "name": "x86_64",
      "id": 501905019
    },
    {
      "name": "sparc",
      "id": 331892513
    }
  ],
  "ptables": [],
  "config_templates": [
    {
      "id": 1007981701,
      "name": "centos5_3_pxelinux",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    },
    {
      "id": 104314179,
      "name": "MyFinish",
      "template_kind_id": 550103832,
      "template_kind_name": "finish"
    },
    {
      "id": 981457253,
      "name": "MyScript",
      "template_kind_id": 478250810,
      "template_kind_name": "script"
    },
    {
      "id": 943779058,
      "name": "MyString",
      "template_kind_id": 698706415,
      "template_kind_name": "iPXE"
    },
    {
      "id": 269958254,
      "name": "MyString2",
      "template_kind_id": 983253650,
      "template_kind_name": "provision"
    },
    {
      "id": 554905648,
      "name": "PXEGrub2 global default",
      "template_kind_id": 701398793,
      "template_kind_name": "PXEGrub2"
    },
    {
      "id": 131565194,
      "name": "PXEGrub Dummy Menu",
      "template_kind_id": 131565194,
      "template_kind_name": "PXEGrub"
    },
    {
      "id": 824224502,
      "name": "PXEGrub global default",
      "template_kind_id": 131565194,
      "template_kind_name": "PXEGrub"
    },
    {
      "id": 821548108,
      "name": "PXELinux default local boot",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    },
    {
      "id": 352050261,
      "name": "PXELinux global default",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    }
  ],
  "provisioning_templates": [
    {
      "id": 1007981701,
      "name": "centos5_3_pxelinux",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    },
    {
      "id": 104314179,
      "name": "MyFinish",
      "template_kind_id": 550103832,
      "template_kind_name": "finish"
    },
    {
      "id": 981457253,
      "name": "MyScript",
      "template_kind_id": 478250810,
      "template_kind_name": "script"
    },
    {
      "id": 943779058,
      "name": "MyString",
      "template_kind_id": 698706415,
      "template_kind_name": "iPXE"
    },
    {
      "id": 269958254,
      "name": "MyString2",
      "template_kind_id": 983253650,
      "template_kind_name": "provision"
    },
    {
      "id": 554905648,
      "name": "PXEGrub2 global default",
      "template_kind_id": 701398793,
      "template_kind_name": "PXEGrub2"
    },
    {
      "id": 131565194,
      "name": "PXEGrub Dummy Menu",
      "template_kind_id": 131565194,
      "template_kind_name": "PXEGrub"
    },
    {
      "id": 824224502,
      "name": "PXEGrub global default",
      "template_kind_id": 131565194,
      "template_kind_name": "PXEGrub"
    },
    {
      "id": 821548108,
      "name": "PXELinux default local boot",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    },
    {
      "id": 352050261,
      "name": "PXELinux global default",
      "template_kind_id": 452984334,
      "template_kind_name": "PXELinux"
    }
  ],
  "os_default_templates": [
    {
      "id": 980190962,
      "provisioning_template_id": 943779058,
      "provisioning_template_name": "MyString",
      "template_kind_id": 698706415,
      "template_kind_name": "iPXE",
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 943779058,
      "config_template_name": "MyString"
    },
    {
      "id": 298486374,
      "provisioning_template_id": 269958254,
      "provisioning_template_name": "MyString2",
      "template_kind_id": 983253650,
      "template_kind_name": "provision",
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 269958254,
      "config_template_name": "MyString2"
    },
    {
      "id": 113629430,
      "provisioning_template_id": 981457253,
      "provisioning_template_name": "MyScript",
      "template_kind_id": 478250810,
      "template_kind_name": "script",
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 981457253,
      "config_template_name": "MyScript"
    },
    {
      "id": 281110143,
      "provisioning_template_id": 1007981701,
      "provisioning_template_name": "centos5_3_pxelinux",
      "template_kind_id": 710512633,
      "template_kind_name": null,
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 1007981701,
      "config_template_name": "centos5_3_pxelinux"
    },
    {
      "id": 1018350795,
      "provisioning_template_id": 131565194,
      "provisioning_template_name": "PXEGrub Dummy Menu",
      "template_kind_id": 131565194,
      "template_kind_name": "PXEGrub",
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 131565194,
      "config_template_name": "PXEGrub Dummy Menu"
    },
    {
      "id": 51848956,
      "provisioning_template_id": 698706415,
      "provisioning_template_name": "iPXE Dummy Menu",
      "template_kind_id": 698706415,
      "template_kind_name": "iPXE",
      "operatingsystem_id": 1073012828,
      "operatingsystem_name": "RHEL 6.1",
      "config_template_id": 698706415,
      "config_template_name": "iPXE Dummy Menu"
    }
  ],
  "images": [],
  "parameters": [
    {
      "priority": null,
      "created_at": "2019-09-11 14:55:21 UTC",
      "updated_at": "2019-09-11 14:55:21 UTC",
      "id": 716195090,
      "name": "os1",
      "parameter_type": null,
      "value": "os1"
    }
  ]
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String

operatingsystem
必填

Validations:

  • Must be a Hash

operatingsystem[name]
选填

Validations:

  • Must match regular expression /\A(\S+)\Z/.

operatingsystem[major]
选填

Validations:

  • Must be a String

operatingsystem[minor]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[description]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[family]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[release_name]
选填 , 允许空值

Validations:

  • Must be a String

operatingsystem[os_parameters_attributes]
选填 , 允许空值

参数阵列

Validations:

  • Must be an Array of nested elements

operatingsystem[os_parameters_attributes][name]
选填

参数名称

Validations:

  • Must be a String

operatingsystem[os_parameters_attributes][value]
选填

参数值

Validations:

  • Must be a String

operatingsystem[password_hash]
选填 , 允许空值

要使用的 root 密码哈希功能,应为 MD5、SHA256、SHA512 和 Base64 之一。

Validations:

  • Must be a String

operatingsystem[architecture_ids]
选填 , 允许空值

关联架构的 ID

Validations:

  • Must be an array of any type

operatingsystem[config_template_ids]
选填 , 允许空值

关联预配模板的 ID

Validations:

  • Must be an array of any type

operatingsystem[provisioning_template_ids]
选填 , 允许空值

关联预配模板的 ID

Validations:

  • Must be an array of any type

operatingsystem[medium_ids]
选填 , 允许空值

关联介质的 ID

Validations:

  • Must be an array of any type

operatingsystem[ptable_ids]
选填 , 允许空值

关联分区表的 ID

Validations:

  • Must be an array of any type


DELETE /api/operatingsystems/:id
删除操作系统

示例

DELETE /api/operatingsystems/775246587-NoHosts%201-1
{
  "operatingsystem": {}
}
200
{
  "id": 775246587,
  "major": "1",
  "name": "NoHosts",
  "minor": "1",
  "nameindicator": null,
  "created_at": "2019-09-11T14:55:21.544Z",
  "updated_at": "2019-09-11T14:55:21.544Z",
  "release_name": null,
  "description": null,
  "password_hash": "SHA256",
  "title": "NoHosts 1.1"
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String


GET /api/operatingsystems/:id/bootfiles
列出操作系统的引导文件

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be a String

medium
选填

Validations:

  • Must be a String

architecture
选填

Validations:

  • Must be a String