Examples

POST /api/media
{
  "medium": {
    "name": "new medium",
    "path": "http://www.newmedium.com/",
    "organization_ids": [
      114267492
    ],
    "location_ids": [
      255093256
    ]
  }
}
201
{
  "path": "http://www.newmedium.com/",
  "os_family": null,
  "created_at": "2018-11-15 19:01:57 UTC",
  "updated_at": "2018-11-15 19:01:57 UTC",
  "id": 1011586628,
  "name": "new medium",
  "operatingsystems": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 114267492,
      "name": "Empty Organization",
      "title": "Empty Organization",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

medium
required

Validations:

  • Must be a Hash

medium[name]
required

Name of media

Validations:

  • Must be a String

medium[path]
required

The path to the medium, can be a URL or a valid NFS server (exclusive of the architecture).

for example http://mirror.centos.org/centos/$version/os/$arch where $arch will be substituted for the host’s actual OS architecture and $version, $major and $minor will be substituted for the version of the operating system.

Solaris and Debian media may also use $release.

Validations:

  • Must be a String

medium[os_family]
optional , nil allowed

Operating system family, available values: AIX, Altlinux, Archlinux, Coreos, Debian, Freebsd, Gentoo, Junos, NXOS, Rancheros, Redhat, Solaris, Suse, Windows, Xenserver

Validations:

  • Must be a String

medium[operatingsystem_ids]
optional , nil allowed

Validations:

  • Must be an array of any type

medium[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

medium[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type