Class: Jamf::ComputerPrestage

Inherits:
OAPISchemas::GetComputerPrestageV2 show all
Includes:
CollectionResource, Prestage
Defined in:
lib/jamf/api/jamf_pro/api_objects/computer_prestage.rb

Overview

A building in the Jamf Pro API

The parent class is the OAPI object representing a single member of the collection, i.e. the ‘GET_OBJECT’ similar to the POST_OBJECT defined in the class below.

Constant Summary collapse

SEARCH_RESULT_OBJECT =

The OAPI object class we get back from a ‘list’ query to get the whole collection, or a subset of it. It contains a :results key which is an array of data for objects of the parent class.

Jamf::OAPISchemas::ComputerPrestageSearchResultsV3
POST_OBJECT =

The OAPI object class we send with a POST request to make a new member of the collection in Jamf. This is usually the same as the parent class.

Jamf::OAPISchemas::PostComputerPrestageV3
PUT_OBJECT =

The OAPI object class we send with a PUT request to change an object in Jamf by specifying all its values. Most updates happen this way, and this is usually the same as the parent class

Jamf::OAPISchemas::PutComputerPrestageV3
LIST_PATH =

The path for GETting the list of all objects in the collection, possibly filtered, sorted, and/or paged

REQUIRED for all collection resources

GET_, PUT_, PATCH_, POST_, and DELETE_ paths for instances don’t need to be defined if they are the same as LIST_PATH (followed by an id if needed)

See the methods get_path, put_path, etc, in Jamf::CollectionResource::ClassMethods

'v3/computer-prestages'
SCOPE_PATH_PREFIX =

As of Jamf Pro 10.50, the scope-related endpoints for computer prestages are still in v2

'v2/computer-prestages'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cnxJamf::Connection (readonly) Originally defined in module JPAPIResource

Returns the API connection thru which we deal with this resource.

Returns:

  • (Jamf::Connection)

    the API connection thru which we deal with this resource.

#delete_pathString (readonly) Originally defined in module CollectionResource

Returns The path for deleting a this item from the collection in the JPAPI.

Returns:

  • (String)

    The path for deleting a this item from the collection in the JPAPI

#get_pathString (readonly) Originally defined in module JPAPIResource

Returns The path for fetching this thing from the JPAPI

this gets set in the constructor in the CollectionResource or SingletonResource mixins.

Returns:

  • (String)

    The path for fetching this thing from the JPAPI

    this gets set in the constructor in the CollectionResource or SingletonResource mixins

#post_pathString (readonly) Originally defined in module CollectionResource

Returns The path for creating a new item in the collection in the JPAPI.

Returns:

  • (String)

    The path for creating a new item in the collection in the JPAPI

#update_pathString (readonly) Originally defined in module JPAPIResource

Returns The path for updating this thing from the JPAPI

this gets set in the constructor in the CollectionResource or SingletonResource mixins

We use ‘update_path’ because some items are updated via a PUT_PATH and others via a PATCH_PATH. When this gets set, it will contain the appropriate one.

Returns:

  • (String)

    The path for updating this thing from the JPAPI

    this gets set in the constructor in the CollectionResource or SingletonResource mixins

    We use ‘update_path’ because some items are updated via a PUT_PATH and others via a PATCH_PATH. When this gets set, it will contain the appropriate one.

Instance Method Details

#assign(*sns_to_assign) ⇒ Object Also known as: add Originally defined in module Prestage

Assign

#assigned?(sn) ⇒ Boolean Also known as: include?, scoped? Originally defined in module Prestage

Is this SN assigned to this prestage?

This method uses the instance’s scope object, from a different API path than the class-level .assigned? method.

Parameters:

  • sn (String)

    the sn to look for

Returns:

  • (Boolean)

#assigned_snsArray<String> Originally defined in module Prestage

Returns the serialnumbers assigned to this prestage.

Returns:

  • (Array<String>)

    the serialnumbers assigned to this prestage

#deleteObject Originally defined in module CollectionResource

#exist?Boolean Originally defined in module CollectionResource

Returns:

  • (Boolean)

#initialize(**data) ⇒ Object Originally defined in module CollectionResource

Constructor

#pretty_print_instance_variablesArray Originally defined in module JPAPIResource

Remove large cached items from the instance_variables used to create pretty-print (pp) output.

Returns:

  • (Array)

    the desired instance_variables

#saveObject Originally defined in module JPAPIResource

TODO: error handling

#scope(refresh = false) ⇒ PrestageScope Originally defined in module Prestage

The scope data for this prestage -

Parameters:

  • refresh (Boolean) (defaults to: false)

    reload from the API? DEPRECATED: the data is always read from the API. If making many calls at once, consisider capturing the data in your own variable

Returns:

  • (PrestageScope)

#scope_pathObject Originally defined in module Prestage

The scope endpoint for this instance

#to_sString Originally defined in module CollectionResource

A meaningful string representation of this object

Returns:

#unassign(*sns_to_unassign) ⇒ Object Also known as: remove Originally defined in module Prestage