repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_documentation_string
stringlengths
1
47.2k
func_code_url
stringlengths
85
339
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupsHandler.get
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Storage Groups (always global but with filters).""" query_str = uri_parms[0] filter_args = parse_query_parms(method, uri, query_str) result_storage_groups = [] for sg in hmc.consoles.console.storage_groups.l...
python
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Storage Groups (always global but with filters).""" query_str = uri_parms[0] filter_args = parse_query_parms(method, uri, query_str) result_storage_groups = [] for sg in hmc.consoles.console.storage_groups.l...
Operation: List Storage Groups (always global but with filters).
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2060-L2072
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupsHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Create Storage Group.""" assert wait_for_completion is True # async not supported yet check_required_fields(method, uri, body, ['name', 'cpc-uri', 'type']) cpc_uri = body['cpc-ur...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Create Storage Group.""" assert wait_for_completion is True # async not supported yet check_required_fields(method, uri, body, ['name', 'cpc-uri', 'type']) cpc_uri = body['cpc-ur...
Operation: Create Storage Group.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2075-L2119
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupModifyHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Modify Storage Group Properties.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group_o...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Modify Storage Group Properties.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group_o...
Operation: Modify Storage Group Properties.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2129-L2180
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupDeleteHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Delete Storage Group.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group_oid = uri_pa...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Delete Storage Group.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group_oid = uri_pa...
Operation: Delete Storage Group.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2186-L2201
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupRequestFulfillmentHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Request Storage Group Fulfillment.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Request Storage Group Fulfillment.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI storage_group...
Operation: Request Storage Group Fulfillment.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2207-L2220
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
StorageGroupAddCandidatePortsHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Add Candidate Adapter Ports to an FCP Storage Group.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI ...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Add Candidate Adapter Ports to an FCP Storage Group.""" assert wait_for_completion is True # async not supported yet # The URI is a POST operation, so we need to construct the SG URI ...
Operation: Add Candidate Adapter Ports to an FCP Storage Group.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2226-L2252
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
LparsHandler.get
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Logical Partitions of CPC (empty result in DPM mode.""" cpc_oid = uri_parms[0] query_str = uri_parms[1] try: cpc = hmc.cpcs.lookup_by_oid(cpc_oid) except KeyError: raise Inval...
python
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Logical Partitions of CPC (empty result in DPM mode.""" cpc_oid = uri_parms[0] query_str = uri_parms[1] try: cpc = hmc.cpcs.lookup_by_oid(cpc_oid) except KeyError: raise Inval...
Operation: List Logical Partitions of CPC (empty result in DPM mode.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2291-L2309
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
LparActivateHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Activate Logical Partition (requires classic mode).""" assert wait_for_completion is True # async not supported yet lpar_oid = uri_parms[0] lpar_uri = '/api/logical-partitions/' ...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Activate Logical Partition (requires classic mode).""" assert wait_for_completion is True # async not supported yet lpar_oid = uri_parms[0] lpar_uri = '/api/logical-partitions/' ...
Operation: Activate Logical Partition (requires classic mode).
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2335-L2374
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
LparLoadHandler.post
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Load Logical Partition (requires classic mode).""" assert wait_for_completion is True # async not supported yet lpar_oid = uri_parms[0] lpar_uri = '/api/logical-partitions/' + lp...
python
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Load Logical Partition (requires classic mode).""" assert wait_for_completion is True # async not supported yet lpar_oid = uri_parms[0] lpar_uri = '/api/logical-partitions/' + lp...
Operation: Load Logical Partition (requires classic mode).
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2447-L2509
zhmcclient/python-zhmcclient
zhmcclient_mock/_urihandler.py
LoadActProfilesHandler.get
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Load Activation Profiles (requires classic mode).""" cpc_oid = uri_parms[0] query_str = uri_parms[1] try: cpc = hmc.cpcs.lookup_by_oid(cpc_oid) except KeyError: raise InvalidResourceE...
python
def get(method, hmc, uri, uri_parms, logon_required): """Operation: List Load Activation Profiles (requires classic mode).""" cpc_oid = uri_parms[0] query_str = uri_parms[1] try: cpc = hmc.cpcs.lookup_by_oid(cpc_oid) except KeyError: raise InvalidResourceE...
Operation: List Load Activation Profiles (requires classic mode).
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_urihandler.py#L2573-L2590
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
PartitionManager.create
def create(self, properties): """ Create and configure a Partition in this CPC. Authorization requirements: * Object-access permission to this CPC. * Task permission to the "New Partition" task. Parameters: properties (dict): Initial property values. ...
python
def create(self, properties): """ Create and configure a Partition in this CPC. Authorization requirements: * Object-access permission to this CPC. * Task permission to the "New Partition" task. Parameters: properties (dict): Initial property values. ...
Create and configure a Partition in this CPC. Authorization requirements: * Object-access permission to this CPC. * Task permission to the "New Partition" task. Parameters: properties (dict): Initial property values. Allowable properties are defined in section '...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L168-L207
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.nics
def nics(self): """ :class:`~zhmcclient.NicManager`: Access to the :term:`NICs <NIC>` in this Partition. """ # We do here some lazy loading. if not self._nics: self._nics = NicManager(self) return self._nics
python
def nics(self): """ :class:`~zhmcclient.NicManager`: Access to the :term:`NICs <NIC>` in this Partition. """ # We do here some lazy loading. if not self._nics: self._nics = NicManager(self) return self._nics
:class:`~zhmcclient.NicManager`: Access to the :term:`NICs <NIC>` in this Partition.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L243-L251
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.hbas
def hbas(self): """ :class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`. """ # We do here some lazy loading. if not self._hbas: try: ...
python
def hbas(self): """ :class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`. """ # We do here some lazy loading. if not self._hbas: try: ...
:class:`~zhmcclient.HbaManager`: Access to the :term:`HBAs <HBA>` in this Partition. If the "dpm-storage-management" feature is enabled, this property is `None`.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L254-L270
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.virtual_functions
def virtual_functions(self): """ :class:`~zhmcclient.VirtualFunctionManager`: Access to the :term:`Virtual Functions <Virtual Function>` in this Partition. """ # We do here some lazy loading. if not self._virtual_functions: self._virtual_functions = VirtualFun...
python
def virtual_functions(self): """ :class:`~zhmcclient.VirtualFunctionManager`: Access to the :term:`Virtual Functions <Virtual Function>` in this Partition. """ # We do here some lazy loading. if not self._virtual_functions: self._virtual_functions = VirtualFun...
:class:`~zhmcclient.VirtualFunctionManager`: Access to the :term:`Virtual Functions <Virtual Function>` in this Partition.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L273-L281
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.feature_enabled
def feature_enabled(self, feature_name): """ Indicates whether the specified feature is enabled for the CPC of this partition. The HMC must generally support features, and the specified feature must be available for the CPC. For a list of available features, see section...
python
def feature_enabled(self, feature_name): """ Indicates whether the specified feature is enabled for the CPC of this partition. The HMC must generally support features, and the specified feature must be available for the CPC. For a list of available features, see section...
Indicates whether the specified feature is enabled for the CPC of this partition. The HMC must generally support features, and the specified feature must be available for the CPC. For a list of available features, see section "Features" in the :term:`HMC API`, or use the :meth:...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L284-L328
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.feature_info
def feature_info(self): """ Returns information about the features available for the CPC of this partition. Authorization requirements: * Object-access permission to this partition. Returns: :term:`iterable`: An iterable where each item represent...
python
def feature_info(self): """ Returns information about the features available for the CPC of this partition. Authorization requirements: * Object-access permission to this partition. Returns: :term:`iterable`: An iterable where each item represent...
Returns information about the features available for the CPC of this partition. Authorization requirements: * Object-access permission to this partition. Returns: :term:`iterable`: An iterable where each item represents one feature that is available ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L331-L366
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.start
def start(self, wait_for_completion=True, operation_timeout=None, status_timeout=None): """ Start (activate) this Partition, using the HMC operation "Start Partition". This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, ...
python
def start(self, wait_for_completion=True, operation_timeout=None, status_timeout=None): """ Start (activate) this Partition, using the HMC operation "Start Partition". This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, ...
Start (activate) this Partition, using the HMC operation "Start Partition". This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, it takes a few seconds until the partition status has reached the desired value (it still may show status ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L369-L450
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.dump_partition
def dump_partition(self, parameters, wait_for_completion=True, operation_timeout=None): """ Dump this Partition, by loading a standalone dump program from a SCSI device and starting its execution, using the HMC operation 'Dump Partition'. Authorization req...
python
def dump_partition(self, parameters, wait_for_completion=True, operation_timeout=None): """ Dump this Partition, by loading a standalone dump program from a SCSI device and starting its execution, using the HMC operation 'Dump Partition'. Authorization req...
Dump this Partition, by loading a standalone dump program from a SCSI device and starting its execution, using the HMC operation 'Dump Partition'. Authorization requirements: * Object-access permission to this Partition. * Task permission to the "Dump Partition" task. ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L566-L628
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.mount_iso_image
def mount_iso_image(self, image, image_name, ins_file_name): """ Upload an ISO image and associate it to this Partition using the HMC operation 'Mount ISO Image'. When the partition already has an ISO image associated, the newly uploaded image replaces the current one. ...
python
def mount_iso_image(self, image, image_name, ins_file_name): """ Upload an ISO image and associate it to this Partition using the HMC operation 'Mount ISO Image'. When the partition already has an ISO image associated, the newly uploaded image replaces the current one. ...
Upload an ISO image and associate it to this Partition using the HMC operation 'Mount ISO Image'. When the partition already has an ISO image associated, the newly uploaded image replaces the current one. Authorization requirements: * Object-access permission to this Partition...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L688-L736
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.open_os_message_channel
def open_os_message_channel(self, include_refresh_messages=True): """ Open a JMS message channel to this partition's operating system, returning the string "topic" representing the message channel. Parameters: include_refresh_messages (bool): Boolean controlling w...
python
def open_os_message_channel(self, include_refresh_messages=True): """ Open a JMS message channel to this partition's operating system, returning the string "topic" representing the message channel. Parameters: include_refresh_messages (bool): Boolean controlling w...
Open a JMS message channel to this partition's operating system, returning the string "topic" representing the message channel. Parameters: include_refresh_messages (bool): Boolean controlling whether refresh operating systems messages should be sent, as follows: ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L761-L796
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.send_os_command
def send_os_command(self, os_command_text, is_priority=False): """ Send a command to the operating system running in this partition. Parameters: os_command_text (string): The text of the operating system command. is_priority (bool): Boolean controlling whether ...
python
def send_os_command(self, os_command_text, is_priority=False): """ Send a command to the operating system running in this partition. Parameters: os_command_text (string): The text of the operating system command. is_priority (bool): Boolean controlling whether ...
Send a command to the operating system running in this partition. Parameters: os_command_text (string): The text of the operating system command. is_priority (bool): Boolean controlling whether this is a priority operating system command, as follows: *...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L799-L831
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.wait_for_status
def wait_for_status(self, status, status_timeout=None): """ Wait until the status of this partition has a desired value. Parameters: status (:term:`string` or iterable of :term:`string`): Desired partition status or set of status values to reach; one or more o...
python
def wait_for_status(self, status, status_timeout=None): """ Wait until the status of this partition has a desired value. Parameters: status (:term:`string` or iterable of :term:`string`): Desired partition status or set of status values to reach; one or more o...
Wait until the status of this partition has a desired value. Parameters: status (:term:`string` or iterable of :term:`string`): Desired partition status or set of status values to reach; one or more of the values defined for the 'status' property in the data model...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L834-L890
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.increase_crypto_config
def increase_crypto_config(self, crypto_adapters, crypto_domain_configurations): """ Add crypto adapters and/or crypto domains to the crypto configuration of this partition. The general principle for maintaining crypto configurations of partitions ...
python
def increase_crypto_config(self, crypto_adapters, crypto_domain_configurations): """ Add crypto adapters and/or crypto domains to the crypto configuration of this partition. The general principle for maintaining crypto configurations of partitions ...
Add crypto adapters and/or crypto domains to the crypto configuration of this partition. The general principle for maintaining crypto configurations of partitions is as follows: Each adapter included in the crypto configuration of a partition has all crypto domains included in the ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L893-L964
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.decrease_crypto_config
def decrease_crypto_config(self, crypto_adapters, crypto_domain_indexes): """ Remove crypto adapters and/or crypto domains from the crypto configuration of this partition. For the general principle for maintaining crypto configurations of partition...
python
def decrease_crypto_config(self, crypto_adapters, crypto_domain_indexes): """ Remove crypto adapters and/or crypto domains from the crypto configuration of this partition. For the general principle for maintaining crypto configurations of partition...
Remove crypto adapters and/or crypto domains from the crypto configuration of this partition. For the general principle for maintaining crypto configurations of partitions, see :meth:`~zhmcclient.Partition.increase_crypto_config`. Example: Assume that the current crypto configuration o...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L967-L1009
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.change_crypto_domain_config
def change_crypto_domain_config(self, crypto_domain_index, access_mode): """ Change the access mode for a crypto domain that is currently included in the crypto configuration of this partition. The access mode will be changed for the specified crypto domain on all crypto adapter...
python
def change_crypto_domain_config(self, crypto_domain_index, access_mode): """ Change the access mode for a crypto domain that is currently included in the crypto configuration of this partition. The access mode will be changed for the specified crypto domain on all crypto adapter...
Change the access mode for a crypto domain that is currently included in the crypto configuration of this partition. The access mode will be changed for the specified crypto domain on all crypto adapters currently included in the crypto configuration of this partition. For the ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L1012-L1049
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.zeroize_crypto_domain
def zeroize_crypto_domain(self, crypto_adapter, crypto_domain_index): """ Zeroize a single crypto domain on a crypto adapter. Zeroizing a crypto domain clears the cryptographic keys and non-compliance mode settings in the crypto domain. The crypto domain must be attached to thi...
python
def zeroize_crypto_domain(self, crypto_adapter, crypto_domain_index): """ Zeroize a single crypto domain on a crypto adapter. Zeroizing a crypto domain clears the cryptographic keys and non-compliance mode settings in the crypto domain. The crypto domain must be attached to thi...
Zeroize a single crypto domain on a crypto adapter. Zeroizing a crypto domain clears the cryptographic keys and non-compliance mode settings in the crypto domain. The crypto domain must be attached to this partition in "control-usage" access mode. Supported CPC versions: z14 G...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L1052-L1090
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.attach_storage_group
def attach_storage_group(self, storage_group): """ Attach a :term:`storage group` to this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be attached to the partition, instantiating any necessary :term:`virtual storage resource` ob...
python
def attach_storage_group(self, storage_group): """ Attach a :term:`storage group` to this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be attached to the partition, instantiating any necessary :term:`virtual storage resource` ob...
Attach a :term:`storage group` to this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be attached to the partition, instantiating any necessary :term:`virtual storage resource` objects. A storage group can be attached to a partition rega...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L1093-L1129
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.detach_storage_group
def detach_storage_group(self, storage_group): """ Detach a :term:`storage group` from this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be detached from the partition, removing any :term:`virtual storage resource` objects that ...
python
def detach_storage_group(self, storage_group): """ Detach a :term:`storage group` from this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be detached from the partition, removing any :term:`virtual storage resource` objects that ...
Detach a :term:`storage group` from this partition. This will cause the :term:`storage volumes <storage volume>` of the storage group to be detached from the partition, removing any :term:`virtual storage resource` objects that had been created upon attachment. A storage group ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L1132-L1167
zhmcclient/python-zhmcclient
zhmcclient/_partition.py
Partition.list_attached_storage_groups
def list_attached_storage_groups(self, full_properties=False): """ Return the storage groups that are attached to this partition. The CPC must have the "dpm-storage-management" feature enabled. Authorization requirements: * Object-access permission to this partition. *...
python
def list_attached_storage_groups(self, full_properties=False): """ Return the storage groups that are attached to this partition. The CPC must have the "dpm-storage-management" feature enabled. Authorization requirements: * Object-access permission to this partition. *...
Return the storage groups that are attached to this partition. The CPC must have the "dpm-storage-management" feature enabled. Authorization requirements: * Object-access permission to this partition. * Task permission to the "Partition Details" task. Parameters: f...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_partition.py#L1170-L1211
zhmcclient/python-zhmcclient
zhmcclient/_password_rule.py
PasswordRule.update_properties
def update_properties(self, properties): """ Update writeable properties of this PasswordRule. The Password Rule must be user-defined. System-defined Password Rules cannot be updated. Authorization requirements: * Task permission to the "Manage Password Rules" task. ...
python
def update_properties(self, properties): """ Update writeable properties of this PasswordRule. The Password Rule must be user-defined. System-defined Password Rules cannot be updated. Authorization requirements: * Task permission to the "Manage Password Rules" task. ...
Update writeable properties of this PasswordRule. The Password Rule must be user-defined. System-defined Password Rules cannot be updated. Authorization requirements: * Task permission to the "Manage Password Rules" task. Parameters: properties (dict): New values f...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_password_rule.py#L237-L269
zhmcclient/python-zhmcclient
zhmcclient/_client.py
Client.version_info
def version_info(self): """ Returns API version information for the HMC. This operation does not require authentication. Returns: :term:`HMC API version`: The HMC API version supported by the HMC. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmc...
python
def version_info(self): """ Returns API version information for the HMC. This operation does not require authentication. Returns: :term:`HMC API version`: The HMC API version supported by the HMC. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmc...
Returns API version information for the HMC. This operation does not require authentication. Returns: :term:`HMC API version`: The HMC API version supported by the HMC. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcclie...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_client.py#L88-L107
zhmcclient/python-zhmcclient
zhmcclient/_client.py
Client.query_api_version
def query_api_version(self): """ The Query API Version operation returns information about the level of Web Services API supported by the HMC. This operation does not require authentication. Returns: :term:`json object`: A JSON object with members ``api-m...
python
def query_api_version(self): """ The Query API Version operation returns information about the level of Web Services API supported by the HMC. This operation does not require authentication. Returns: :term:`json object`: A JSON object with members ``api-m...
The Query API Version operation returns information about the level of Web Services API supported by the HMC. This operation does not require authentication. Returns: :term:`json object`: A JSON object with members ``api-major-version``, ``api-minor-version``...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_client.py#L110-L135
zhmcclient/python-zhmcclient
zhmcclient/_client.py
Client.get_inventory
def get_inventory(self, resources): """ Returns a JSON object with the requested resources and their properties, that are managed by the HMC. This method performs the 'Get Inventory' HMC operation. Parameters: resources (:term:`iterable` of :term:`string`): ...
python
def get_inventory(self, resources): """ Returns a JSON object with the requested resources and their properties, that are managed by the HMC. This method performs the 'Get Inventory' HMC operation. Parameters: resources (:term:`iterable` of :term:`string`): ...
Returns a JSON object with the requested resources and their properties, that are managed by the HMC. This method performs the 'Get Inventory' HMC operation. Parameters: resources (:term:`iterable` of :term:`string`): Resource classes and/or resource classifiers specifyi...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_client.py#L138-L179
zhmcclient/python-zhmcclient
zhmcclient/_client.py
Client.wait_for_available
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 availabl...
python
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 availabl...
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.OperationTime...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_client.py#L182-L229
zhmcclient/python-zhmcclient
zhmcclient/_resource.py
BaseResource.pull_full_properties
def pull_full_properties(self): """ Retrieve the full set of resource properties and cache them in this object. Authorization requirements: * Object-access permission to this resource. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmcclient.ParseErr...
python
def pull_full_properties(self): """ Retrieve the full set of resource properties and cache them in this object. Authorization requirements: * Object-access permission to this resource. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmcclient.ParseErr...
Retrieve the full set of resource properties and cache them in this object. Authorization requirements: * Object-access permission to this resource. Raises: :exc:`~zhmcclient.HTTPError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcclient.AuthError` ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_resource.py#L188-L207
zhmcclient/python-zhmcclient
zhmcclient/_resource.py
BaseResource.get_property
def get_property(self, name): """ Return the value of a resource property. If the resource property is not cached in this object yet, the full set of resource properties is retrieved and cached in this object, and the resource property is again attempted to be returned. ...
python
def get_property(self, name): """ Return the value of a resource property. If the resource property is not cached in this object yet, the full set of resource properties is retrieved and cached in this object, and the resource property is again attempted to be returned. ...
Return the value of a resource property. If the resource property is not cached in this object yet, the full set of resource properties is retrieved and cached in this object, and the resource property is again attempted to be returned. Authorization requirements: * Object-acc...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_resource.py#L210-L247
zhmcclient/python-zhmcclient
docs/notebooks/tututils.py
make_client
def make_client(zhmc, userid=None, password=None): """ Create a `Session` object for the specified HMC and log that on. Create a `Client` object using that `Session` object, and return it. If no userid and password are specified, and if no previous call to this method was made, userid and password ...
python
def make_client(zhmc, userid=None, password=None): """ Create a `Session` object for the specified HMC and log that on. Create a `Client` object using that `Session` object, and return it. If no userid and password are specified, and if no previous call to this method was made, userid and password ...
Create a `Session` object for the specified HMC and log that on. Create a `Client` object using that `Session` object, and return it. If no userid and password are specified, and if no previous call to this method was made, userid and password are interactively inquired. Userid and password are saved i...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/docs/notebooks/tututils.py#L31-L54
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
repr_text
def repr_text(text, indent): """Return a debug representation of a multi-line text (e.g. the result of another repr...() function).""" if text is None: return 'None' ret = _indent(text, amount=indent) return ret.lstrip(' ')
python
def repr_text(text, indent): """Return a debug representation of a multi-line text (e.g. the result of another repr...() function).""" if text is None: return 'None' ret = _indent(text, amount=indent) return ret.lstrip(' ')
Return a debug representation of a multi-line text (e.g. the result of another repr...() function).
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L39-L45
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
repr_list
def repr_list(_list, indent): """Return a debug representation of a list or tuple.""" # pprint represents lists and tuples in one row if possible. We want one # per row, so we iterate ourselves. if _list is None: return 'None' if isinstance(_list, MutableSequence): bm = '[' e...
python
def repr_list(_list, indent): """Return a debug representation of a list or tuple.""" # pprint represents lists and tuples in one row if possible. We want one # per row, so we iterate ourselves. if _list is None: return 'None' if isinstance(_list, MutableSequence): bm = '[' e...
Return a debug representation of a list or tuple.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L48-L68
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
repr_dict
def repr_dict(_dict, indent): """Return a debug representation of a dict or OrderedDict.""" # pprint represents OrderedDict objects using the tuple init syntax, # which is not very readable. Therefore, dictionaries are iterated over. if _dict is None: return 'None' if not isinstance(_dict, M...
python
def repr_dict(_dict, indent): """Return a debug representation of a dict or OrderedDict.""" # pprint represents OrderedDict objects using the tuple init syntax, # which is not very readable. Therefore, dictionaries are iterated over. if _dict is None: return 'None' if not isinstance(_dict, M...
Return a debug representation of a dict or OrderedDict.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L71-L94
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
repr_timestamp
def repr_timestamp(timestamp): """Return a debug representation of an HMC timestamp number.""" if timestamp is None: return 'None' dt = datetime_from_timestamp(timestamp) ret = "%d (%s)" % (timestamp, dt.strftime('%Y-%m-%d %H:%M:%S.%f %Z')) return ret
python
def repr_timestamp(timestamp): """Return a debug representation of an HMC timestamp number.""" if timestamp is None: return 'None' dt = datetime_from_timestamp(timestamp) ret = "%d (%s)" % (timestamp, dt.strftime('%Y-%m-%d %H:%M:%S.%f %Z')) return ret
Return a debug representation of an HMC timestamp number.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L97-L104
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
datetime_from_timestamp
def datetime_from_timestamp(ts): """ Convert an :term:`HMC timestamp number <timestamp>` into a :class:`~py:datetime.datetime` object. The HMC timestamp number must be non-negative. This means the special timestamp value -1 cannot be represented as datetime and will cause ``ValueError`` to be r...
python
def datetime_from_timestamp(ts): """ Convert an :term:`HMC timestamp number <timestamp>` into a :class:`~py:datetime.datetime` object. The HMC timestamp number must be non-negative. This means the special timestamp value -1 cannot be represented as datetime and will cause ``ValueError`` to be r...
Convert an :term:`HMC timestamp number <timestamp>` into a :class:`~py:datetime.datetime` object. The HMC timestamp number must be non-negative. This means the special timestamp value -1 cannot be represented as datetime and will cause ``ValueError`` to be raised. The date and time range supported...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L112-L169
zhmcclient/python-zhmcclient
zhmcclient/_utils.py
timestamp_from_datetime
def timestamp_from_datetime(dt): """ Convert a :class:`~py:datetime.datetime` object into an :term:`HMC timestamp number <timestamp>`. The date and time range supported by this function has the following bounds: * The upper bounds is :attr:`py:datetime.datetime.max`, as follows: * 9999-...
python
def timestamp_from_datetime(dt): """ Convert a :class:`~py:datetime.datetime` object into an :term:`HMC timestamp number <timestamp>`. The date and time range supported by this function has the following bounds: * The upper bounds is :attr:`py:datetime.datetime.max`, as follows: * 9999-...
Convert a :class:`~py:datetime.datetime` object into an :term:`HMC timestamp number <timestamp>`. The date and time range supported by this function has the following bounds: * The upper bounds is :attr:`py:datetime.datetime.max`, as follows: * 9999-12-31 23:59:59 UTC, for 32-bit and 64-bit CPy...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_utils.py#L172-L214
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroupManager.create
def create(self, properties): """ Create and configure a storage group. The new storage group will be associated with the CPC identified by the `cpc-uri` input property. Authorization requirements: * Object-access permission to the CPC that will be associated with ...
python
def create(self, properties): """ Create and configure a storage group. The new storage group will be associated with the CPC identified by the `cpc-uri` input property. Authorization requirements: * Object-access permission to the CPC that will be associated with ...
Create and configure a storage group. The new storage group will be associated with the CPC identified by the `cpc-uri` input property. Authorization requirements: * Object-access permission to the CPC that will be associated with the new storage group. * Task permis...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L219-L268
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.storage_volumes
def storage_volumes(self): """ :class:`~zhmcclient.StorageVolumeManager`: Access to the :term:`storage volumes <storage volume>` in this storage group. """ # We do here some lazy loading. if not self._storage_volumes: self._storage_volumes = StorageVolumeManag...
python
def storage_volumes(self): """ :class:`~zhmcclient.StorageVolumeManager`: Access to the :term:`storage volumes <storage volume>` in this storage group. """ # We do here some lazy loading. if not self._storage_volumes: self._storage_volumes = StorageVolumeManag...
:class:`~zhmcclient.StorageVolumeManager`: Access to the :term:`storage volumes <storage volume>` in this storage group.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L304-L312
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.virtual_storage_resources
def virtual_storage_resources(self): """ :class:`~zhmcclient.VirtualStorageResourceManager`: Access to the :term:`virtual storage resources <Virtual Storage Resource>` in this storage group. """ # We do here some lazy loading. if not self._virtual_storage_resource...
python
def virtual_storage_resources(self): """ :class:`~zhmcclient.VirtualStorageResourceManager`: Access to the :term:`virtual storage resources <Virtual Storage Resource>` in this storage group. """ # We do here some lazy loading. if not self._virtual_storage_resource...
:class:`~zhmcclient.VirtualStorageResourceManager`: Access to the :term:`virtual storage resources <Virtual Storage Resource>` in this storage group.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L315-L325
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.cpc
def cpc(self): """ :class:`~zhmcclient.Cpc`: The :term:`CPC` to which this storage group is associated. The returned :class:`~zhmcclient.Cpc` has only a minimal set of properties populated. """ # We do here some lazy loading. if not self._cpc: ...
python
def cpc(self): """ :class:`~zhmcclient.Cpc`: The :term:`CPC` to which this storage group is associated. The returned :class:`~zhmcclient.Cpc` has only a minimal set of properties populated. """ # We do here some lazy loading. if not self._cpc: ...
:class:`~zhmcclient.Cpc`: The :term:`CPC` to which this storage group is associated. The returned :class:`~zhmcclient.Cpc` has only a minimal set of properties populated.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L328-L341
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.list_attached_partitions
def list_attached_partitions(self, name=None, status=None): """ Return the partitions to which this storage group is currently attached, optionally filtered by partition name and status. Authorization requirements: * Object-access permission to this storage group. * Tas...
python
def list_attached_partitions(self, name=None, status=None): """ Return the partitions to which this storage group is currently attached, optionally filtered by partition name and status. Authorization requirements: * Object-access permission to this storage group. * Tas...
Return the partitions to which this storage group is currently attached, optionally filtered by partition name and status. Authorization requirements: * Object-access permission to this storage group. * Task permission to the "Configure Storage - System Programmer" task. Param...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L344-L400
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.add_candidate_adapter_ports
def add_candidate_adapter_ports(self, ports): """ Add a list of storage adapter ports to this storage group's candidate adapter ports list. This operation only applies to storage groups of type "fcp". These adapter ports become candidates for use as backing adapters when ...
python
def add_candidate_adapter_ports(self, ports): """ Add a list of storage adapter ports to this storage group's candidate adapter ports list. This operation only applies to storage groups of type "fcp". These adapter ports become candidates for use as backing adapters when ...
Add a list of storage adapter ports to this storage group's candidate adapter ports list. This operation only applies to storage groups of type "fcp". These adapter ports become candidates for use as backing adapters when creating virtual storage resources when the storage group is att...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L514-L562
zhmcclient/python-zhmcclient
zhmcclient/_storage_group.py
StorageGroup.list_candidate_adapter_ports
def list_candidate_adapter_ports(self, full_properties=False): """ Return the current candidate storage adapter port list of this storage group. The result reflects the actual list of ports used by the CPC, including any changes that have been made during discovery. The source f...
python
def list_candidate_adapter_ports(self, full_properties=False): """ Return the current candidate storage adapter port list of this storage group. The result reflects the actual list of ports used by the CPC, including any changes that have been made during discovery. The source f...
Return the current candidate storage adapter port list of this storage group. The result reflects the actual list of ports used by the CPC, including any changes that have been made during discovery. The source for this information is the 'candidate-adapter-port-uris' property of the ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_group.py#L606-L655
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
AdapterManager.create_hipersocket
def create_hipersocket(self, properties): """ Create and configure a HiperSockets Adapter in this CPC. Authorization requirements: * Object-access permission to the scoping CPC. * Task permission to the "Create HiperSockets Adapter" task. Parameters: propert...
python
def create_hipersocket(self, properties): """ Create and configure a HiperSockets Adapter in this CPC. Authorization requirements: * Object-access permission to the scoping CPC. * Task permission to the "Create HiperSockets Adapter" task. Parameters: propert...
Create and configure a HiperSockets Adapter in this CPC. Authorization requirements: * Object-access permission to the scoping CPC. * Task permission to the "Create HiperSockets Adapter" task. Parameters: properties (dict): Initial property values. Allowable pro...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L204-L242
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.ports
def ports(self): """ :class:`~zhmcclient.PortManager`: Access to the :term:`Ports <Port>` of this Adapter. """ # We do here some lazy loading. if not self._ports: family = self.get_property('adapter-family') try: port_type = self.po...
python
def ports(self): """ :class:`~zhmcclient.PortManager`: Access to the :term:`Ports <Port>` of this Adapter. """ # We do here some lazy loading. if not self._ports: family = self.get_property('adapter-family') try: port_type = self.po...
:class:`~zhmcclient.PortManager`: Access to the :term:`Ports <Port>` of this Adapter.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L305-L318
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.port_uris_prop
def port_uris_prop(self): """ :term:`string`: Name of adapter property that specifies the adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-port-uris' for a network adapter. """ if self._port_uris_prop is None: fami...
python
def port_uris_prop(self): """ :term:`string`: Name of adapter property that specifies the adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-port-uris' for a network adapter. """ if self._port_uris_prop is None: fami...
:term:`string`: Name of adapter property that specifies the adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-port-uris' for a network adapter.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L321-L334
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.port_uri_segment
def port_uri_segment(self): """ :term:`string`: Adapter type specific URI segment for adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-ports' for a network adapter. """ if self._port_uri_segment is None: family = s...
python
def port_uri_segment(self): """ :term:`string`: Adapter type specific URI segment for adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-ports' for a network adapter. """ if self._port_uri_segment is None: family = s...
:term:`string`: Adapter type specific URI segment for adapter port URIs, or the empty string ('') for adapters without ports. For example, 'network-ports' for a network adapter.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L337-L351
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.maximum_crypto_domains
def maximum_crypto_domains(self): """ Integer: The maximum number of crypto domains on this crypto adapter. The following table shows the maximum number of crypto domains for crypto adapters supported on IBM Z machine generations in DPM mode. The corresponding LinuxONE machine g...
python
def maximum_crypto_domains(self): """ Integer: The maximum number of crypto domains on this crypto adapter. The following table shows the maximum number of crypto domains for crypto adapters supported on IBM Z machine generations in DPM mode. The corresponding LinuxONE machine g...
Integer: The maximum number of crypto domains on this crypto adapter. The following table shows the maximum number of crypto domains for crypto adapters supported on IBM Z machine generations in DPM mode. The corresponding LinuxONE machine generations are listed in the notes below the t...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L355-L401
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.change_crypto_type
def change_crypto_type(self, crypto_type, zeroize=None): """ Reconfigures a cryptographic adapter to a different crypto type. This operation is only supported for cryptographic adapters. The cryptographic adapter must be varied offline before its crypto type can be reconfigured....
python
def change_crypto_type(self, crypto_type, zeroize=None): """ Reconfigures a cryptographic adapter to a different crypto type. This operation is only supported for cryptographic adapters. The cryptographic adapter must be varied offline before its crypto type can be reconfigured....
Reconfigures a cryptographic adapter to a different crypto type. This operation is only supported for cryptographic adapters. The cryptographic adapter must be varied offline before its crypto type can be reconfigured. Authorization requirements: * Object-access permission to ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L488-L525
zhmcclient/python-zhmcclient
zhmcclient/_adapter.py
Adapter.change_adapter_type
def change_adapter_type(self, adapter_type): """ Reconfigures an adapter from one type to another, or to ungonfigured. Currently, only storage adapters can be reconfigured, and their adapter type is the supported storage protocol (FCP vs. FICON). Storage adapter instances (i.e. ...
python
def change_adapter_type(self, adapter_type): """ Reconfigures an adapter from one type to another, or to ungonfigured. Currently, only storage adapters can be reconfigured, and their adapter type is the supported storage protocol (FCP vs. FICON). Storage adapter instances (i.e. ...
Reconfigures an adapter from one type to another, or to ungonfigured. Currently, only storage adapters can be reconfigured, and their adapter type is the supported storage protocol (FCP vs. FICON). Storage adapter instances (i.e. :class:`~zhmcclient.Adapter` objects) represent daughter ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_adapter.py#L528-L570
zhmcclient/python-zhmcclient
zhmcclient/_lpar.py
Lpar.scsi_load
def scsi_load(self, load_address, wwpn, lun, load_parameter=None, disk_partition_id=None, operating_system_specific_load_parameters=None, boot_record_logical_block_address=None, force=False, wait_for_completion=True, operation_timeout=None, ...
python
def scsi_load(self, load_address, wwpn, lun, load_parameter=None, disk_partition_id=None, operating_system_specific_load_parameters=None, boot_record_logical_block_address=None, force=False, wait_for_completion=True, operation_timeout=None, ...
Load (boot) this LPAR from a designated SCSI device, using the HMC operation "SCSI Load". This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, it takes a few seconds until the LPAR status has reached the desired value. If `wait_for_completion=...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_lpar.py#L429-L567
zhmcclient/python-zhmcclient
zhmcclient/_lpar.py
Lpar.load
def load(self, load_address=None, load_parameter=None, clear_indicator=True, store_status_indicator=False, wait_for_completion=True, operation_timeout=None, status_timeout=None, allow_status_exceptions=False, force=False): """ Load (boot) this LPAR fro...
python
def load(self, load_address=None, load_parameter=None, clear_indicator=True, store_status_indicator=False, wait_for_completion=True, operation_timeout=None, status_timeout=None, allow_status_exceptions=False, force=False): """ Load (boot) this LPAR fro...
Load (boot) this LPAR from a load address (boot device), using the HMC operation "Load Logical Partition". This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, it takes a few seconds until the LPAR status has reached the desired value. If `wai...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_lpar.py#L570-L695
zhmcclient/python-zhmcclient
zhmcclient/_lpar.py
Lpar.stop
def stop(self, wait_for_completion=True, operation_timeout=None, status_timeout=None, allow_status_exceptions=False): """ Stop this LPAR, using the HMC operation "Stop Logical Partition". The stop operation stops the processors from processing instructions. This HMC...
python
def stop(self, wait_for_completion=True, operation_timeout=None, status_timeout=None, allow_status_exceptions=False): """ Stop this LPAR, using the HMC operation "Stop Logical Partition". The stop operation stops the processors from processing instructions. This HMC...
Stop this LPAR, using the HMC operation "Stop Logical Partition". The stop operation stops the processors from processing instructions. This HMC operation has deferred status behavior: If the asynchronous job on the HMC is complete, it takes a few seconds until the LPAR status h...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_lpar.py#L698-L786
zhmcclient/python-zhmcclient
zhmcclient/_session.py
_handle_request_exc
def _handle_request_exc(exc, retry_timeout_config): """ Handle a :exc:`request.exceptions.RequestException` exception that was raised. """ if isinstance(exc, requests.exceptions.ConnectTimeout): raise ConnectTimeout(_request_exc_message(exc), exc, retry_timeout_c...
python
def _handle_request_exc(exc, retry_timeout_config): """ Handle a :exc:`request.exceptions.RequestException` exception that was raised. """ if isinstance(exc, requests.exceptions.ConnectTimeout): raise ConnectTimeout(_request_exc_message(exc), exc, retry_timeout_c...
Handle a :exc:`request.exceptions.RequestException` exception that was raised.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L58-L75
zhmcclient/python-zhmcclient
zhmcclient/_session.py
_request_exc_message
def _request_exc_message(exc): """ Return a reasonable exception message from a :exc:`request.exceptions.RequestException` exception. The approach is to dig deep to the original reason, if the original exception is present, skipping irrelevant exceptions such as `urllib3.exceptions.MaxRetryErro...
python
def _request_exc_message(exc): """ Return a reasonable exception message from a :exc:`request.exceptions.RequestException` exception. The approach is to dig deep to the original reason, if the original exception is present, skipping irrelevant exceptions such as `urllib3.exceptions.MaxRetryErro...
Return a reasonable exception message from a :exc:`request.exceptions.RequestException` exception. The approach is to dig deep to the original reason, if the original exception is present, skipping irrelevant exceptions such as `urllib3.exceptions.MaxRetryError`, and eliminating useless object repr...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L78-L112
zhmcclient/python-zhmcclient
zhmcclient/_session.py
_text_repr
def _text_repr(text, max_len=1000): """ Return the input text as a Python string representation (i.e. using repr()) that is limited to a maximum length. """ if text is None: text_repr = 'None' elif len(text) > max_len: text_repr = repr(text[0:max_len]) + '...' else: t...
python
def _text_repr(text, max_len=1000): """ Return the input text as a Python string representation (i.e. using repr()) that is limited to a maximum length. """ if text is None: text_repr = 'None' elif len(text) > max_len: text_repr = repr(text[0:max_len]) + '...' else: t...
Return the input text as a Python string representation (i.e. using repr()) that is limited to a maximum length.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L1299-L1310
zhmcclient/python-zhmcclient
zhmcclient/_session.py
_result_object
def _result_object(result): """ Return the JSON payload in the HTTP response as a Python dict. Parameters: result (requests.Response): HTTP response object. Raises: zhmcclient.ParseError: Error parsing the returned JSON. """ content_type = result.headers.get('content-type', Non...
python
def _result_object(result): """ Return the JSON payload in the HTTP response as a Python dict. Parameters: result (requests.Response): HTTP response object. Raises: zhmcclient.ParseError: Error parsing the returned JSON. """ content_type = result.headers.get('content-type', Non...
Return the JSON payload in the HTTP response as a Python dict. Parameters: result (requests.Response): HTTP response object. Raises: zhmcclient.ParseError: Error parsing the returned JSON.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L1313-L1405
zhmcclient/python-zhmcclient
zhmcclient/_session.py
RetryTimeoutConfig.override_with
def override_with(self, override_config): """ Return a new configuration object that represents the configuration from this configuration object acting as a default, and the specified configuration object overriding that default. Parameters: override_config (:class:`~...
python
def override_with(self, override_config): """ Return a new configuration object that represents the configuration from this configuration object acting as a default, and the specified configuration object overriding that default. Parameters: override_config (:class:`~...
Return a new configuration object that represents the configuration from this configuration object acting as a default, and the specified configuration object overriding that default. Parameters: override_config (:class:`~zhmcclient.RetryTimeoutConfig`): The configuration...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L192-L216
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session.is_logon
def is_logon(self, verify=False): """ Return a boolean indicating whether the session is currently logged on to the HMC. By default, this method checks whether there is a session-id set and considers that sufficient for determining that the session is logged on. The `ver...
python
def is_logon(self, verify=False): """ Return a boolean indicating whether the session is currently logged on to the HMC. By default, this method checks whether there is a session-id set and considers that sufficient for determining that the session is logged on. The `ver...
Return a boolean indicating whether the session is currently logged on to the HMC. By default, this method checks whether there is a session-id set and considers that sufficient for determining that the session is logged on. The `verify` parameter can be used to verify the validity ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L542-L564
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session._do_logon
def _do_logon(self): """ Log on, unconditionally. This can be used to re-logon. This requires credentials to be provided. Raises: :exc:`~zhmcclient.ClientAuthError` :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmc...
python
def _do_logon(self): """ Log on, unconditionally. This can be used to re-logon. This requires credentials to be provided. Raises: :exc:`~zhmcclient.ClientAuthError` :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmc...
Log on, unconditionally. This can be used to re-logon. This requires credentials to be provided. Raises: :exc:`~zhmcclient.ClientAuthError` :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcc...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L566-L595
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session._new_session
def _new_session(retry_timeout_config): """ Return a new `requests.Session` object. """ retry = requests.packages.urllib3.Retry( total=None, connect=retry_timeout_config.connect_retries, read=retry_timeout_config.read_retries, method_whitel...
python
def _new_session(retry_timeout_config): """ Return a new `requests.Session` object. """ retry = requests.packages.urllib3.Retry( total=None, connect=retry_timeout_config.connect_retries, read=retry_timeout_config.read_retries, method_whitel...
Return a new `requests.Session` object.
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L598-L613
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session._do_logoff
def _do_logoff(self): """ Log off, unconditionally. Raises: :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcclient.HTTPError` """ session_uri = '/api/sessions/this-session' ...
python
def _do_logoff(self): """ Log off, unconditionally. Raises: :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcclient.HTTPError` """ session_uri = '/api/sessions/this-session' ...
Log off, unconditionally. Raises: :exc:`~zhmcclient.ServerAuthError` :exc:`~zhmcclient.ConnectionError` :exc:`~zhmcclient.ParseError` :exc:`~zhmcclient.HTTPError`
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L615-L630
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session._log_http_request
def _log_http_request(method, url, headers=None, content=None): """ Log the HTTP request of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and operation URI)...
python
def _log_http_request(method, url, headers=None, content=None): """ Log the HTTP request of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and operation URI)...
Log the HTTP request of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and operation URI) headers (iterable): HTTP headers used for the request content...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L633-L663
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session._log_http_response
def _log_http_response(method, url, status, headers=None, content=None): """ Log the HTTP response of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and oper...
python
def _log_http_response(method, url, status, headers=None, content=None): """ Log the HTTP response of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and oper...
Log the HTTP response of an HMC REST API call, at the debug level. Parameters: method (:term:`string`): HTTP method name in upper case, e.g. 'GET' url (:term:`string`): HTTP URL (base URL and operation URI) status (integer): HTTP status code headers (iterable): HTTP ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L666-L702
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session.post
def post(self, uri, body=None, logon_required=True, wait_for_completion=False, operation_timeout=None): """ Perform the HTTP POST method against the resource identified by a URI, using a provided request body. A set of standard HTTP headers is automatically part of the requ...
python
def post(self, uri, body=None, logon_required=True, wait_for_completion=False, operation_timeout=None): """ Perform the HTTP POST method against the resource identified by a URI, using a provided request body. A set of standard HTTP headers is automatically part of the requ...
Perform the HTTP POST method against the resource identified by a URI, using a provided request body. A set of standard HTTP headers is automatically part of the request. HMC operations using HTTP POST are either synchronous or asynchronous. Asynchronous operations return the URI of an...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L778-L979
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Session.delete
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 oper...
python
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 oper...
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`): ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L982-L1051
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Job.check_for_completion
def check_for_completion(self): """ Check once for completion of the job and return completion status and result if it has completed. If the job completed in error, an :exc:`~zhmcclient.HTTPError` exception is raised. Returns: : A tuple (status, result) with:...
python
def check_for_completion(self): """ Check once for completion of the job and return completion status and result if it has completed. If the job completed in error, an :exc:`~zhmcclient.HTTPError` exception is raised. Returns: : A tuple (status, result) with:...
Check once for completion of the job and return completion status and result if it has completed. If the job completed in error, an :exc:`~zhmcclient.HTTPError` exception is raised. Returns: : A tuple (status, result) with: * status (:term:`string`): Completion st...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L1159-L1225
zhmcclient/python-zhmcclient
zhmcclient/_session.py
Job.wait_for_completion
def wait_for_completion(self, operation_timeout=None): """ Wait for completion of the job, then delete the job on the HMC and return the result of the original asynchronous HMC operation, if it completed successfully. If the job completed in error, an :exc:`~zhmcclient.HTTPError...
python
def wait_for_completion(self, operation_timeout=None): """ Wait for completion of the job, then delete the job on the HMC and return the result of the original asynchronous HMC operation, if it completed successfully. If the job completed in error, an :exc:`~zhmcclient.HTTPError...
Wait for completion of the job, then delete the job on the HMC and return the result of the original asynchronous HMC operation, if it completed successfully. If the job completed in error, an :exc:`~zhmcclient.HTTPError` exception is raised. Parameters: operation_ti...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_session.py#L1228-L1296
zhmcclient/python-zhmcclient
zhmcclient/_logging.py
logged_api_call
def logged_api_call(func): """ Function decorator that causes the decorated API function or method to log calls to itself to a logger. The logger's name is the dotted module name of the module defining the decorated function (e.g. 'zhmcclient._cpc'). Parameters: func (function object): ...
python
def logged_api_call(func): """ Function decorator that causes the decorated API function or method to log calls to itself to a logger. The logger's name is the dotted module name of the module defining the decorated function (e.g. 'zhmcclient._cpc'). Parameters: func (function object): ...
Function decorator that causes the decorated API function or method to log calls to itself to a logger. The logger's name is the dotted module name of the module defining the decorated function (e.g. 'zhmcclient._cpc'). Parameters: func (function object): The original function being decorated. ...
https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_logging.py#L102-L234
honeybadger-io/honeybadger-python
honeybadger/contrib/django.py
DjangoPlugin.supports
def supports(self, config, context): """ Check whether this is a django request or not. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ request = current_reques...
python
def supports(self, config, context): """ Check whether this is a django request or not. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ request = current_reques...
Check whether this is a django request or not. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/django.py#L61-L69
honeybadger-io/honeybadger-python
honeybadger/contrib/django.py
DjangoPlugin.generate_payload
def generate_payload(self, config, context): """ Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ request = current_request() pay...
python
def generate_payload(self, config, context): """ Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ request = current_request() pay...
Generate payload by checking Django request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/django.py#L71-L95
honeybadger-io/honeybadger-python
examples/flask/app.py
generic_div
def generic_div(a, b): """Simple function to divide two numbers""" logger.debug('Called generic_div({}, {})'.format(a, b)) return a / b
python
def generic_div(a, b): """Simple function to divide two numbers""" logger.debug('Called generic_div({}, {})'.format(a, b)) return a / b
Simple function to divide two numbers
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/examples/flask/app.py#L9-L12
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskPlugin.supports
def supports(self, config, context): """ Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ try: from ...
python
def supports(self, config, context): """ Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ try: from ...
Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L21-L33
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskPlugin.generate_payload
def generate_payload(self, config, context): """ Generate payload by checking Flask request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ from flask import current_app, session, r...
python
def generate_payload(self, config, context): """ Generate payload by checking Flask request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ from flask import current_app, session, r...
Generate payload by checking Flask request object. :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L35-L72
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskHoneybadger.init_app
def init_app(self, app, report_exceptions=False, reset_context_after_request=False): """ Initialize honeybadger and listen for errors. :param Flask app: the Flask application object. :param bool report_exceptions: whether to automatically report exceptions raised by Flask on requests ...
python
def init_app(self, app, report_exceptions=False, reset_context_after_request=False): """ Initialize honeybadger and listen for errors. :param Flask app: the Flask application object. :param bool report_exceptions: whether to automatically report exceptions raised by Flask on requests ...
Initialize honeybadger and listen for errors. :param Flask app: the Flask application object. :param bool report_exceptions: whether to automatically report exceptions raised by Flask on requests (i.e. by calling abort) or not. :param bool reset_context_after_request: whether to reset ...
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L98-L127
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskHoneybadger._register_signal_handler
def _register_signal_handler(self, description, signal, handler): """ Registers a handler for the given signal. :param description: a short description of the signal to handle. :param signal: the signal to handle. :param handler: the function to use for handling the signal. ...
python
def _register_signal_handler(self, description, signal, handler): """ Registers a handler for the given signal. :param description: a short description of the signal to handle. :param signal: the signal to handle. :param handler: the function to use for handling the signal. ...
Registers a handler for the given signal. :param description: a short description of the signal to handle. :param signal: the signal to handle. :param handler: the function to use for handling the signal.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L129-L142
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskHoneybadger._initialize_honeybadger
def _initialize_honeybadger(self, config): """ Initializes honeybadger using the given config object. :param dict config: a dict or dict-like object that contains honeybadger configuration properties. """ if config.get('DEBUG', False): honeybadger.configure(environmen...
python
def _initialize_honeybadger(self, config): """ Initializes honeybadger using the given config object. :param dict config: a dict or dict-like object that contains honeybadger configuration properties. """ if config.get('DEBUG', False): honeybadger.configure(environmen...
Initializes honeybadger using the given config object. :param dict config: a dict or dict-like object that contains honeybadger configuration properties.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L144-L158
honeybadger-io/honeybadger-python
honeybadger/contrib/flask.py
FlaskHoneybadger._handle_exception
def _handle_exception(self, sender, exception=None): """ Actual code handling the exception and sending it to honeybadger if it's enabled. :param T sender: the object sending the exception event. :param Exception exception: the exception to handle. """ honeybadger.notify(...
python
def _handle_exception(self, sender, exception=None): """ Actual code handling the exception and sending it to honeybadger if it's enabled. :param T sender: the object sending the exception event. :param Exception exception: the exception to handle. """ honeybadger.notify(...
Actual code handling the exception and sending it to honeybadger if it's enabled. :param T sender: the object sending the exception event. :param Exception exception: the exception to handle.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/contrib/flask.py#L166-L174
honeybadger-io/honeybadger-python
honeybadger/plugins.py
PluginManager.register
def register(self, plugin): """ Register the given plugin. Registration order is kept. :param plugin: the plugin to register. """ if plugin.name not in self._registered: logger.info('Registering plugin %s' % plugin.name) self._registered[plugin.name] = plu...
python
def register(self, plugin): """ Register the given plugin. Registration order is kept. :param plugin: the plugin to register. """ if plugin.name not in self._registered: logger.info('Registering plugin %s' % plugin.name) self._registered[plugin.name] = plu...
Register the given plugin. Registration order is kept. :param plugin: the plugin to register.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/plugins.py#L51-L60
honeybadger-io/honeybadger-python
honeybadger/plugins.py
PluginManager.generate_payload
def generate_payload(self, config=None, context=None): """ Generate payload by iterating over registered plugins. Merges . :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ for name, plugin i...
python
def generate_payload(self, config=None, context=None): """ Generate payload by iterating over registered plugins. Merges . :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload. """ for name, plugin i...
Generate payload by iterating over registered plugins. Merges . :param context: current context. :param config: honeybadger configuration. :return: a dict with the generated payload.
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/honeybadger/plugins.py#L62-L77
honeybadger-io/honeybadger-python
examples/django_app/app/views.py
buggy_div
def buggy_div(request): """ A buggy endpoint to perform division between query parameters a and b. It will fail if b is equal to 0 or either a or b are not float. :param request: request object :return: """ a = float(request.GET.get('a', '0')) b = float(request.GET.get('b', '0')) re...
python
def buggy_div(request): """ A buggy endpoint to perform division between query parameters a and b. It will fail if b is equal to 0 or either a or b are not float. :param request: request object :return: """ a = float(request.GET.get('a', '0')) b = float(request.GET.get('b', '0')) re...
A buggy endpoint to perform division between query parameters a and b. It will fail if b is equal to 0 or either a or b are not float. :param request: request object :return:
https://github.com/honeybadger-io/honeybadger-python/blob/81519b40d3e446b62035f64e34900e08ff91938c/examples/django_app/app/views.py#L14-L24
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
ascii
def ascii(graph): """Format graph as an ASCII art.""" from .._ascii import DAG from .._echo import echo_via_pager echo_via_pager(str(DAG(graph)))
python
def ascii(graph): """Format graph as an ASCII art.""" from .._ascii import DAG from .._echo import echo_via_pager echo_via_pager(str(DAG(graph)))
Format graph as an ASCII art.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L25-L30
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
_jsonld
def _jsonld(graph, format, *args, **kwargs): """Return formatted graph in JSON-LD ``format`` function.""" import json from pyld import jsonld from renku.models._jsonld import asjsonld output = getattr(jsonld, format)([ asjsonld(action) for action in graph.activities.values() ]) ret...
python
def _jsonld(graph, format, *args, **kwargs): """Return formatted graph in JSON-LD ``format`` function.""" import json from pyld import jsonld from renku.models._jsonld import asjsonld output = getattr(jsonld, format)([ asjsonld(action) for action in graph.activities.values() ]) ret...
Return formatted graph in JSON-LD ``format`` function.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L33-L43
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
dot
def dot(graph, simple=True, debug=False, landscape=False): """Format graph as a dot file.""" import sys from rdflib import ConjunctiveGraph from rdflib.plugin import register, Parser from rdflib.tools.rdf2dot import rdf2dot register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') ...
python
def dot(graph, simple=True, debug=False, landscape=False): """Format graph as a dot file.""" import sys from rdflib import ConjunctiveGraph from rdflib.plugin import register, Parser from rdflib.tools.rdf2dot import rdf2dot register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') ...
Format graph as a dot file.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L46-L76
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
_rdf2dot_simple
def _rdf2dot_simple(g, stream): """Create a simple graph of processes and artifacts.""" from itertools import chain import re path_re = re.compile( r'file:///(?P<type>[a-zA-Z]+)/' r'(?P<commit>\w+)' r'(?P<path>.+)?' ) inputs = g.query( """ SELECT ?input...
python
def _rdf2dot_simple(g, stream): """Create a simple graph of processes and artifacts.""" from itertools import chain import re path_re = re.compile( r'file:///(?P<type>[a-zA-Z]+)/' r'(?P<commit>\w+)' r'(?P<path>.+)?' ) inputs = g.query( """ SELECT ?input...
Create a simple graph of processes and artifacts.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L86-L175
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
_rdf2dot_reduced
def _rdf2dot_reduced(g, stream): """ A reduced dot graph. Adapted from original source: https://rdflib.readthedocs.io/en/stable/_modules/rdflib/tools/rdf2dot.html """ import cgi import collections import rdflib from rdflib.tools.rdf2dot import LABEL_PROPERTIES, NODECOLOR type...
python
def _rdf2dot_reduced(g, stream): """ A reduced dot graph. Adapted from original source: https://rdflib.readthedocs.io/en/stable/_modules/rdflib/tools/rdf2dot.html """ import cgi import collections import rdflib from rdflib.tools.rdf2dot import LABEL_PROPERTIES, NODECOLOR type...
A reduced dot graph. Adapted from original source: https://rdflib.readthedocs.io/en/stable/_modules/rdflib/tools/rdf2dot.html
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L178-L278
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
makefile
def makefile(graph): """Format graph as Makefile.""" from renku.models.provenance.activities import ProcessRun, WorkflowRun for activity in graph.activities.values(): if not isinstance(activity, ProcessRun): continue elif isinstance(activity, WorkflowRun): steps = ac...
python
def makefile(graph): """Format graph as Makefile.""" from renku.models.provenance.activities import ProcessRun, WorkflowRun for activity in graph.activities.values(): if not isinstance(activity, ProcessRun): continue elif isinstance(activity, WorkflowRun): steps = ac...
Format graph as Makefile.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L281-L301
SwissDataScienceCenter/renku-python
renku/cli/_format/graph.py
nt
def nt(graph): """Format graph as n-tuples.""" from rdflib import ConjunctiveGraph from rdflib.plugin import register, Parser register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') click.echo( ConjunctiveGraph().parse( data=_jsonld(graph, 'expand'), for...
python
def nt(graph): """Format graph as n-tuples.""" from rdflib import ConjunctiveGraph from rdflib.plugin import register, Parser register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') click.echo( ConjunctiveGraph().parse( data=_jsonld(graph, 'expand'), for...
Format graph as n-tuples.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/_format/graph.py#L314-L326
SwissDataScienceCenter/renku-python
renku/cli/githooks.py
install
def install(client, force): """Install Git hooks.""" import pkg_resources from git.index.fun import hook_path as get_hook_path for hook in HOOKS: hook_path = Path(get_hook_path(hook, client.repo.git_dir)) if hook_path.exists(): if not force: click.echo( ...
python
def install(client, force): """Install Git hooks.""" import pkg_resources from git.index.fun import hook_path as get_hook_path for hook in HOOKS: hook_path = Path(get_hook_path(hook, client.repo.git_dir)) if hook_path.exists(): if not force: click.echo( ...
Install Git hooks.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/githooks.py#L60-L85
SwissDataScienceCenter/renku-python
renku/cli/githooks.py
uninstall
def uninstall(client): """Uninstall Git hooks.""" from git.index.fun import hook_path as get_hook_path for hook in HOOKS: hook_path = Path(get_hook_path(hook, client.repo.git_dir)) if hook_path.exists(): hook_path.unlink()
python
def uninstall(client): """Uninstall Git hooks.""" from git.index.fun import hook_path as get_hook_path for hook in HOOKS: hook_path = Path(get_hook_path(hook, client.repo.git_dir)) if hook_path.exists(): hook_path.unlink()
Uninstall Git hooks.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/cli/githooks.py#L90-L97
SwissDataScienceCenter/renku-python
renku/models/_tabulate.py
format_cell
def format_cell(cell, datetime_fmt=None): """Format a cell.""" if datetime_fmt and isinstance(cell, datetime): return cell.strftime(datetime_fmt) return cell
python
def format_cell(cell, datetime_fmt=None): """Format a cell.""" if datetime_fmt and isinstance(cell, datetime): return cell.strftime(datetime_fmt) return cell
Format a cell.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/models/_tabulate.py#L26-L30
SwissDataScienceCenter/renku-python
renku/models/_tabulate.py
tabulate
def tabulate(collection, headers, datetime_fmt='%Y-%m-%d %H:%M:%S', **kwargs): """Pretty-print a collection.""" if isinstance(headers, dict): attrs = headers.keys() # if mapping is not specified keep original names = [ key if value is None else value for key, value in headers...
python
def tabulate(collection, headers, datetime_fmt='%Y-%m-%d %H:%M:%S', **kwargs): """Pretty-print a collection.""" if isinstance(headers, dict): attrs = headers.keys() # if mapping is not specified keep original names = [ key if value is None else value for key, value in headers...
Pretty-print a collection.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/models/_tabulate.py#L33-L47
SwissDataScienceCenter/renku-python
renku/models/datasets.py
_convert_dataset_files
def _convert_dataset_files(value): """Convert dataset files.""" output = {} for k, v in value.items(): inst = DatasetFile.from_jsonld(v) output[inst.path] = inst return output
python
def _convert_dataset_files(value): """Convert dataset files.""" output = {} for k, v in value.items(): inst = DatasetFile.from_jsonld(v) output[inst.path] = inst return output
Convert dataset files.
https://github.com/SwissDataScienceCenter/renku-python/blob/691644d695b055a01e0ca22b2620e55bbd928c0d/renku/models/datasets.py#L151-L157