Model¶
The setup editors describe ZOS-API members once and reuse that description for reading and writing.
Attribute is one member copied into a result field.
Rows is a 1-based row list.
Section and Listing are System Explorer groups.
Shared descriptions of ZOS-API members and row lists.
- class Attribute(name: str, source: str | tuple[str, ...], convert: Callable[[object], object], call: bool = False, writable: bool = True, enumeration: str | None = None)¶
One ZOS-API member copied into a result field.
- Parameters:
name (str) – Key in the result.
source (str | tuple[str, ...]) – Property name, or a path of property names. The last member is called when
callis true.convert (collections.abc.Callable[[object], object]) – Converts the raw value.
call (bool) – When true, call the last member before converting it.
writable (bool) – When true, a write tool may change this member.
enumeration (str | None) – ZOS-API enumeration type in
ZOSAPI.SystemData.Nonewhen the member is not an enumeration.
- assign(data, value: object) None¶
Assign a tool value to this member.
- Parameters:
data – Object that exposes
source.value (object) – Value supplied for this member.
- Raises:
ValueError –
valuedoes not match this member.
- enumeration: str | None = None¶
ZOS-API enumeration type in
ZOSAPI.SystemData.Nonewhen the member is not an enumeration.
- read(data) object¶
Read this member from a ZOS-API object.
- Parameters:
data – Object that exposes
source.- Returns:
The converted value.
- Return type:
- classmethod record(data, attributes: tuple[Attribute, ...]) dict[str, object]¶
Copy attributes of one object into a dictionary.
- value_for_write(value: object) object¶
Convert a tool value into the value stored by ZOS-API.
- Parameters:
value (object) – Value supplied for this member.
- Returns:
The value to assign.
- Return type:
- Raises:
ValueError –
valuedoes not match this member.
- class Listing(source: str, rows: Rows)¶
One SystemData child copied into a list of dictionaries.
- Parameters:
- class Rows(count: str, item: str, attributes: tuple[Attribute, ...], add: str | None = None, add_arguments: tuple[str, ...] = (), remove: str | None = None, primary: str | None = None)¶
A 1-based ZOS-API list copied into a list of dictionaries.
- Parameters:
count (str) – Property that holds the number of rows.
item (str) – Method that returns one row. The argument is a 1-based index.
attributes (tuple[Attribute, ...]) – Attributes copied from each row.
add (str | None) – Method that appends a row.
Nonewhen rows cannot be added.add_arguments (tuple[str, ...]) – Attribute names passed to
add, in order.remove (str | None) – Method that removes a 1-based row.
Nonewhen rows cannot be removed.primary (str | None) – Method on one row that makes it primary.
Nonewhen the list has no primary row.
- edit(data, action: str, number: int | None, values: dict[str, object] | None) None¶
Change, add, or remove one row.
addappends a row.make_primarycallsprimaryon the selected row.- Parameters:
- Raises:
ValueError – The action, number, or values cannot be applied.
- primary: str | None = None¶
Method on one row that makes it primary.
Nonewhen the list has no primary row.
- class Section(source: str, attributes: tuple[Attribute, ...] = (), rows: tuple[tuple[str, Rows], ...] = ())¶
One SystemData child copied into a dictionary.
- Parameters: