Class: ForemanApi::Resources::Medium

Inherits:
Base
  • Object
show all
Defined in:
lib/foreman_api/resources/medium.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) doc



4
5
6
# File 'lib/foreman_api/resources/medium.rb', line 4

def self.doc
  @doc ||= ForemanApi.doc['resources']["media"]
end

Instance Method Details

- (Array) create(params = {}, headers = {})

First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • medium (Hash)

    allowed keys are:

    • name [String] Name of media
    • os_family [String] The family that the operating system belongs to. available families: archlinux debian redhat solaris suse windows
    • path [String] The path to the medium, can be a url or a valid nfs server (exclusive of the architecture). for example http://mirror.averse.net/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.

Returns:

  • (Array)

    First item: parsed data; second item: raw body



38
39
40
# File 'lib/foreman_api/resources/medium.rb', line 38

def create(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) destroy(params = {}, headers = {})

First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



61
62
63
# File 'lib/foreman_api/resources/medium.rb', line 61

def destroy(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) index(params = {}, headers = {})

First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • order (String)

    For example, name asc, or name desc

  • page (String)

    Paginate results

  • per_page (String)

    Number of entries per request

  • search (String)

    Filter results

Returns:

  • (Array)

    First item: parsed data; second item: raw body



16
17
18
# File 'lib/foreman_api/resources/medium.rb', line 16

def index(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) show(params = {}, headers = {})

First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



25
26
27
# File 'lib/foreman_api/resources/medium.rb', line 25

def show(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) update(params = {}, headers = {})

First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)
  • medium (Hash)

    allowed keys are:

    • name [String] Name of media
    • os_family [String, nil] The family that the operating system belongs to. available families: archlinux debian redhat solaris suse windows
    • path [String] The path to the medium, can be a url or a valid nfs server (exclusive of the architecture). for example http://mirror.averse.net/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.

Returns:

  • (Array)

    First item: parsed data; second item: raw body



52
53
54
# File 'lib/foreman_api/resources/medium.rb', line 52

def update(params = {}, headers = {})
  perform_call(__method__, params, headers)
end