site¶
FABRIC site and resource information management.
This module provides classes for querying and managing information about FABRIC testbed sites and their available resources. The Site and Resources classes allow users to discover available compute, storage, and network resources across the FABRIC infrastructure.
- class fabrictestbed_extensions.fablib.site.Host(host, state, ptp, fablib_manager)[source]¶
Initialize a Host object.
- Parameters:
- Returns:
None
- get_component_allocated(component_model_name)[source]¶
Gets gets number of currently allocated components on a the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently allocated component of this model
- Return type:
- get_component_available(component_model_name)[source]¶
Gets gets number of currently available components on the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently available component of this model
- Return type:
- get_component_capacity(component_model_name)[source]¶
Gets the total site capacity of a component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
total component capacity
- Return type:
- get_components()[source]¶
Get the components associated with the host.
- Returns:
Dictionary-like view of the components associated with the host.
- Return type:
ViewOnlyDict
- get_core_allocated()[source]¶
Gets the number of currently allocated cores at the site
- Returns:
core count
- Return type:
- get_core_available()[source]¶
Gets the number of currently available cores at the site
- Returns:
core count
- Return type:
- get_core_capacity()[source]¶
Gets the total number of cores at the site
- Returns:
core count
- Return type:
- get_disk_allocated()[source]¶
Gets the amount of disk allocated the site in GB
- Returns:
disk in GB
- Return type:
- get_disk_capacity()[source]¶
Gets the total amount of disk available the site in GB
- Returns:
disk in GB
- Return type:
- get_fablib_manager()[source]¶
Get the Fabric library manager associated with the host.
- Returns:
The Fabric library manager.
- Return type:
Any
- get_location_postal()[source]¶
Gets the location of a site by postal address
- Parameters:
site (String or Node or NodeSliver) – site name or site object
- Returns:
postal address of the site
- Return type:
String
- get_ptp_capable()[source]¶
Gets the PTP flag of the site - if it has a native PTP capability :param site: site name or object :type site: String or Node or NodeSliver :return: boolean flag :rtype: bool
- get_ram_capacity()[source]¶
Gets the total amount of memory at the site in GB
- Returns:
ram in GB
- Return type:
- show(output=None, fields=None, quiet=False, pretty_names=True)[source]¶
Creates a tabulated string of all the available resources at a specific host.
Intended for printing available resources at a host.
- class fabrictestbed_extensions.fablib.site.ResourceConstants[source]¶
Constants and mappings for FABRIC resource attributes and display names.
- class fabrictestbed_extensions.fablib.site.Site(site, fablib_manager)[source]¶
Initialize a Site object.
- Parameters:
site (node.Node) – The node representing the site.
fablib_manager (Any) – The manager for the Fabric library.
- Returns:
None
- get_component_allocated(component_model_name)[source]¶
Gets gets number of currently allocated components on a the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently allocated component of this model
- Return type:
- get_component_available(component_model_name)[source]¶
Gets gets number of currently available components on the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently available component of this model
- Return type:
- get_component_capacity(component_model_name)[source]¶
Gets the total site capacity of a component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
total component capacity
- Return type:
- get_core_allocated()[source]¶
Gets the number of currently allocated cores at the site
- Returns:
core count
- Return type:
- get_core_available()[source]¶
Gets the number of currently available cores at the site
- Returns:
core count
- Return type:
- get_core_capacity()[source]¶
Gets the total number of cores at the site
- Returns:
core count
- Return type:
- get_disk_allocated()[source]¶
Gets the amount of disk allocated the site in GB
- Returns:
disk in GB
- Return type:
- get_disk_capacity()[source]¶
Gets the total amount of disk available the site in GB
- Returns:
disk in GB
- Return type:
- get_fablib_manager()[source]¶
Get the Fabric library manager associated with the site.
- Returns:
The Fabric library manager.
- Return type:
Any
- get_host_names()[source]¶
Gets a list of all currently available hosts
- Returns:
list of host names
- Return type:
List[String]
- get_location_postal()[source]¶
Gets the location of a site by postal address
- Parameters:
site (String or Node or NodeSliver) – site name or site object
- Returns:
postal address of the site
- Return type:
String
- get_ram_capacity()[source]¶
Gets the total amount of memory at the site in GB
- Returns:
ram in GB
- Return type:
- show(output=None, fields=None, quiet=False, pretty_names=True)[source]¶
Creates a tabulated string of all the available resources at a specific site.
Intended for printing available resources at a site.
- class fabrictestbed_extensions.fablib.site.Switch(switch, fablib_manager)[source]¶
Initialize a Switch object.
- Parameters:
switch (node.Node) – The node representing the switch.
fablib_manager (Any) – The manager for the Fabric library.
- get_allocated()[source]¶
Get the allocated capacity of the switch.
- Returns:
The allocated capacity of the switch.
- Return type:
- get_available()[source]¶
Get the available capacity of the switch.
- Returns:
The available capacity of the switch.
- Return type:
- class fabrictestbed_extensions.fablib.site.Site(site, fablib_manager)[source]¶
Initialize a Site object.
- Parameters:
site (node.Node) – The node representing the site.
fablib_manager (Any) – The manager for the Fabric library.
- Returns:
None
- __str__()[source]¶
Convert the Site object to a string representation in JSON format.
- Returns:
JSON string representation of the Site object.
- Return type:
- get_component_allocated(component_model_name)[source]¶
Gets gets number of currently allocated components on a the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently allocated component of this model
- Return type:
- get_component_available(component_model_name)[source]¶
Gets gets number of currently available components on the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently available component of this model
- Return type:
- get_component_capacity(component_model_name)[source]¶
Gets the total site capacity of a component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
total component capacity
- Return type:
- get_core_allocated()[source]¶
Gets the number of currently allocated cores at the site
- Returns:
core count
- Return type:
- get_core_available()[source]¶
Gets the number of currently available cores at the site
- Returns:
core count
- Return type:
- get_core_capacity()[source]¶
Gets the total number of cores at the site
- Returns:
core count
- Return type:
- get_disk_allocated()[source]¶
Gets the amount of disk allocated the site in GB
- Returns:
disk in GB
- Return type:
- get_disk_capacity()[source]¶
Gets the total amount of disk available the site in GB
- Returns:
disk in GB
- Return type:
- get_fablib_manager()[source]¶
Get the Fabric library manager associated with the site.
- Returns:
The Fabric library manager.
- Return type:
Any
- get_host_names()[source]¶
Gets a list of all currently available hosts
- Returns:
list of host names
- Return type:
List[String]
- get_location_postal()[source]¶
Gets the location of a site by postal address
- Parameters:
site (String or Node or NodeSliver) – site name or site object
- Returns:
postal address of the site
- Return type:
String
- get_ram_capacity()[source]¶
Gets the total amount of memory at the site in GB
- Returns:
ram in GB
- Return type:
- show(output=None, fields=None, quiet=False, pretty_names=True)[source]¶
Creates a tabulated string of all the available resources at a specific site.
Intended for printing available resources at a site.
- class fabrictestbed_extensions.fablib.site.Switch(switch, fablib_manager)[source]¶
Initialize a Switch object.
- Parameters:
switch (node.Node) – The node representing the switch.
fablib_manager (Any) – The manager for the Fabric library.
- get_allocated()[source]¶
Get the allocated capacity of the switch.
- Returns:
The allocated capacity of the switch.
- Return type:
- get_available()[source]¶
Get the available capacity of the switch.
- Returns:
The available capacity of the switch.
- Return type:
- class fabrictestbed_extensions.fablib.site.Host(host, state, ptp, fablib_manager)[source]¶
Initialize a Host object.
- Parameters:
- Returns:
None
- __str__()[source]¶
Convert the Host object to a string representation in JSON format.
- Returns:
JSON string representation of the Host object.
- Return type:
- get_component_allocated(component_model_name)[source]¶
Gets gets number of currently allocated components on a the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently allocated component of this model
- Return type:
- get_component_available(component_model_name)[source]¶
Gets gets number of currently available components on the site by the component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
currently available component of this model
- Return type:
- get_component_capacity(component_model_name)[source]¶
Gets the total site capacity of a component by model name.
- Parameters:
component_model_name (String) – component model name
- Returns:
total component capacity
- Return type:
- get_components()[source]¶
Get the components associated with the host.
- Returns:
Dictionary-like view of the components associated with the host.
- Return type:
ViewOnlyDict
- get_core_allocated()[source]¶
Gets the number of currently allocated cores at the site
- Returns:
core count
- Return type:
- get_core_available()[source]¶
Gets the number of currently available cores at the site
- Returns:
core count
- Return type:
- get_core_capacity()[source]¶
Gets the total number of cores at the site
- Returns:
core count
- Return type:
- get_disk_allocated()[source]¶
Gets the amount of disk allocated the site in GB
- Returns:
disk in GB
- Return type:
- get_disk_capacity()[source]¶
Gets the total amount of disk available the site in GB
- Returns:
disk in GB
- Return type:
- get_fablib_manager()[source]¶
Get the Fabric library manager associated with the host.
- Returns:
The Fabric library manager.
- Return type:
Any
- get_location_postal()[source]¶
Gets the location of a site by postal address
- Parameters:
site (String or Node or NodeSliver) – site name or site object
- Returns:
postal address of the site
- Return type:
String
- get_ptp_capable()[source]¶
Gets the PTP flag of the site - if it has a native PTP capability :param site: site name or object :type site: String or Node or NodeSliver :return: boolean flag :rtype: bool
- get_ram_capacity()[source]¶
Gets the total amount of memory at the site in GB
- Returns:
ram in GB
- Return type:
- show(output=None, fields=None, quiet=False, pretty_names=True)[source]¶
Creates a tabulated string of all the available resources at a specific host.
Intended for printing available resources at a host.