Examples

POST /api/media
{
  "medium": {
    "name": "new medium",
    "path": "http://www.newmedium.com/",
    "organization_ids": [
      114267492
    ],
    "os_family": "IjrUayydpN"
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "os_family": [
        "must be one of [ AIX, Altlinux, Archlinux, Coreos, Debian, Fcos, Freebsd, Gentoo, Junos, NXOS, Rancheros, Redhat, Rhcos, Solaris, Suse, VRP, Windows, Xenserver ]"
      ]
    },
    "full_messages": [
      "OS families must be one of [ AIX, Altlinux, Archlinux, Coreos, Debian, Fcos, Freebsd, Gentoo, Junos, NXOS, Rancheros, Redhat, Rhcos, Solaris, Suse, VRP, Windows, Xenserver ]"
    ]
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Integer

medium
required

Validations:

  • Hash

medium[name]
required

Name of media

Validations:

  • String

medium[path]
required

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

for example 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:

  • String

medium[os_family]
optional , nil allowed

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

Validations:

  • 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