Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@logged_api_call
def get_connected_nics(self):
"""
List the :term:`NICs ` connected to this Virtual Switch.
This method performs the "Get Connected VNICs of a Virtual Switch" HMC
operation.
Authorization requirements:
* Object-access permission to this CPC.
* Object-access permission to the backing Adapter of this Virtual
Switch.
Returns:
: A list of :term:`Nic` objects. These objects will be connected in
@logged_api_call
def delete(self, uri, logon_required=True):
"""
Perform the HTTP DELETE method against the resource identified by a
URI.
A set of standard HTTP headers is automatically part of the request.
If the HMC session token is expired, this method re-logs on and retries
the operation.
Parameters:
uri (:term:`string`):
Relative URI path of the resource, e.g.
"/api/session/{session-id}".
This URI is relative to the base URL of the session (see
@logged_api_call
def import_profiles(self, profile_area, wait_for_completion=True,
operation_timeout=None):
"""
Import activation profiles and/or system activity profiles for this CPC
from the SE hard drive into the CPC using the HMC operation
"Import Profiles".
This operation is not permitted when the CPC is in DPM mode.
Authorization requirements:
* Object-access permission to this CPC.
* Task permission for the "CIM Actions ExportSettingsData" task.
Parameters:
@logged_api_call
def find(self, **filter_args):
"""
Find exactly one resource in scope of this manager, by matching
resource properties against the specified filter arguments, and return
its Python resource object (e.g. for a CPC, a :class:`~zhmcclient.Cpc`
object is returned).
Any resource property may be specified in a filter argument. For
details about filter arguments, see :ref:`Filtering`.
The zhmcclient implementation handles the specified properties in an
optimized way: Properties that can be filtered on the HMC are actually
filtered there (this varies by resource type), and the remaining
properties are filtered on the client side.
If the "name" property is specified as the only filter argument, an
@logged_api_call
def reorder(self, user_patterns):
"""
Reorder the User Patterns of the HMC as specified.
The order of User Patterns determines the search order during logon
processing.
Authorization requirements:
* Task permission to the "Manage User Patterns" task.
Parameters:
user_patterns (list of :class:`~zhmcclient.UserPattern`):
The User Patterns in the desired order.
@logged_api_call
def delete(self):
"""
Delete this :term:`Metrics Context` resource.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
:exc:`~zhmcclient.AuthError`
:exc:`~zhmcclient.ConnectionError`
"""
self.manager.session.delete(self.uri)
self.manager._metrics_contexts.remove(self)
@logged_api_call
def dpm_enabled(self):
"""
bool: Indicates whether this CPC is currently in DPM mode
(Dynamic Partition Manager mode).
If the CPC is not currently in DPM mode, or if the CPC does not
support DPM mode (i.e. before z13), `False` is returned.
Authorization requirements:
* Object-access permission to this CPC.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
@logged_api_call
def list(self, full_properties=True, filter_args=None):
"""
List the :term:`User` resources representing the users defined in this
HMC.
Authorization requirements:
* User-related-access permission to the User object included in the
result, or, depending on the type of User object, task permission to
the "Manage Users" task or the "Manage User Templates" task.
Parameters:
full_properties (bool):
Controls whether the full set of resource properties should be
retrieved, vs. only the short set as returned by the list
@logged_api_call
def wait_for_available(self, operation_timeout=None):
"""
Wait for the Console (HMC) this client is connected to, to become
available. The Console is considered available if the
:meth:`~zhmcclient.Client.query_api_version` method succeeds.
If the Console does not become available within the operation timeout,
an :exc:`~zhmcclient.OperationTimeout` exception is raised.
Parameters:
operation_timeout (:term:`number`):
Timeout in seconds, when waiting for the Console to become
available. The special value 0 means that no timeout is set. `None`
means that the default async operation timeout of the session is
used.
@logged_api_call
def set_power_capping(self, power_capping_state, power_cap=None,
wait_for_completion=True, operation_timeout=None):
"""
Set the power capping settings of this CPC. The power capping settings
of a CPC define whether or not the power consumption of the CPC is
limited and if so, what the limit is. Use this method to limit the
peak power consumption of a CPC, or to remove a power consumption
limit for a CPC.
The current power capping settings in effect for a CPC are described in
the "cpc-power-capping-state" and "cpc-power-cap-current" properties of
the CPC.
This method performs the HMC operation "Set CPC Power Capping". It
requires that the feature "Automate/advanced management suite"
(FC 0020) is installed and enabled, and fails otherwise.