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 |
|---|---|---|---|---|---|---|---|
sbg/sevenbridges-python | sevenbridges/meta/transformer.py | Transform.to_division | def to_division(division):
"""Serializes division to id string
:param division: object to serialize
:return: string id
"""
from sevenbridges.models.division import Division
if not division:
raise SbgError('Division is required!')
elif isinstance(divisi... | python | def to_division(division):
"""Serializes division to id string
:param division: object to serialize
:return: string id
"""
from sevenbridges.models.division import Division
if not division:
raise SbgError('Division is required!')
elif isinstance(divisi... | Serializes division to id string
:param division: object to serialize
:return: string id | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/meta/transformer.py#L163-L176 |
sbg/sevenbridges-python | sevenbridges/meta/transformer.py | Transform.to_team | def to_team(team):
"""Serializes team to id string
:param team: object to serialize
:return: string id
"""
from sevenbridges.models.team import Team
if not team:
raise SbgError('Team is required!')
elif isinstance(team, Team):
return team.i... | python | def to_team(team):
"""Serializes team to id string
:param team: object to serialize
:return: string id
"""
from sevenbridges.models.team import Team
if not team:
raise SbgError('Team is required!')
elif isinstance(team, Team):
return team.i... | Serializes team to id string
:param team: object to serialize
:return: string id | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/meta/transformer.py#L179-L192 |
sbg/sevenbridges-python | sevenbridges/meta/transformer.py | Transform.to_import | def to_import(import_):
"""Serializes import to id string
:param import_: object to serialize
:return: string id
"""
from sevenbridges.models.storage_import import Import
if not import_:
raise SbgError('Import is required!')
elif isinstance(import_, Im... | python | def to_import(import_):
"""Serializes import to id string
:param import_: object to serialize
:return: string id
"""
from sevenbridges.models.storage_import import Import
if not import_:
raise SbgError('Import is required!')
elif isinstance(import_, Im... | Serializes import to id string
:param import_: object to serialize
:return: string id | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/meta/transformer.py#L195-L208 |
sbg/sevenbridges-python | sevenbridges/meta/transformer.py | Transform.to_export | def to_export(export):
"""Serializes export to id string
:param export: object to serialize
:return: string id
"""
from sevenbridges.models.storage_export import Export
if not export:
raise SbgError('Export is required!')
elif isinstance(export, Export... | python | def to_export(export):
"""Serializes export to id string
:param export: object to serialize
:return: string id
"""
from sevenbridges.models.storage_export import Export
if not export:
raise SbgError('Export is required!')
elif isinstance(export, Export... | Serializes export to id string
:param export: object to serialize
:return: string id | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/meta/transformer.py#L211-L224 |
sbg/sevenbridges-python | sevenbridges/meta/transformer.py | Transform.to_location | def to_location(location):
"""Serializes location to string
:param location: object to serialize
:return: string
"""
if not location:
raise SbgError('Location is required!')
if isinstance(location, six.string_types):
return location
else:
... | python | def to_location(location):
"""Serializes location to string
:param location: object to serialize
:return: string
"""
if not location:
raise SbgError('Location is required!')
if isinstance(location, six.string_types):
return location
else:
... | Serializes location to string
:param location: object to serialize
:return: string | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/meta/transformer.py#L227-L237 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.query | def query(cls, visibility=None, api=None):
"""Query ( List ) datasets
:param visibility: If provided as 'public', retrieves public datasets
:param api: Api instance
:return: Collection object
"""
api = api if api else cls._API
return super(Dataset, cls)._query(
... | python | def query(cls, visibility=None, api=None):
"""Query ( List ) datasets
:param visibility: If provided as 'public', retrieves public datasets
:param api: Api instance
:return: Collection object
"""
api = api if api else cls._API
return super(Dataset, cls)._query(
... | Query ( List ) datasets
:param visibility: If provided as 'public', retrieves public datasets
:param api: Api instance
:return: Collection object | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L48-L60 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.get_owned_by | def get_owned_by(cls, username, api=None):
"""Query ( List ) datasets by owner
:param api: Api instance
:param username: Owner username
:return: Collection object
"""
api = api if api else cls._API
return super(Dataset, cls)._query(
url=cls._URL['owne... | python | def get_owned_by(cls, username, api=None):
"""Query ( List ) datasets by owner
:param api: Api instance
:param username: Owner username
:return: Collection object
"""
api = api if api else cls._API
return super(Dataset, cls)._query(
url=cls._URL['owne... | Query ( List ) datasets by owner
:param api: Api instance
:param username: Owner username
:return: Collection object | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L63-L75 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.save | def save(self, inplace=True):
"""Save all modification to the dataset on the server.
:param inplace: Apply edits on the current instance or get a new one.
:return: Dataset instance.
"""
modified_data = self._modified_data()
if bool(modified_data):
dataset_requ... | python | def save(self, inplace=True):
"""Save all modification to the dataset on the server.
:param inplace: Apply edits on the current instance or get a new one.
:return: Dataset instance.
"""
modified_data = self._modified_data()
if bool(modified_data):
dataset_requ... | Save all modification to the dataset on the server.
:param inplace: Apply edits on the current instance or get a new one.
:return: Dataset instance. | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L78-L104 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.get_members | def get_members(self, api=None):
"""Retrieve dataset members
:param api: Api instance
:return: Collection object
"""
api = api or self._API
response = api.get(url=self._URL['members'].format(id=self.id))
data = response.json()
total = response.headers['x... | python | def get_members(self, api=None):
"""Retrieve dataset members
:param api: Api instance
:return: Collection object
"""
api = api or self._API
response = api.get(url=self._URL['members'].format(id=self.id))
data = response.json()
total = response.headers['x... | Retrieve dataset members
:param api: Api instance
:return: Collection object | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L106-L128 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.add_member | def add_member(self, username, permissions, api=None):
"""Add member to a dataset
:param username: Member username
:param permissions: Permissions dict
:param api: Api instance
:return: New member instance
"""
api = api or self._API
data = {
'u... | python | def add_member(self, username, permissions, api=None):
"""Add member to a dataset
:param username: Member username
:param permissions: Permissions dict
:param api: Api instance
:return: New member instance
"""
api = api or self._API
data = {
'u... | Add member to a dataset
:param username: Member username
:param permissions: Permissions dict
:param api: Api instance
:return: New member instance | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L144-L162 |
sbg/sevenbridges-python | sevenbridges/models/dataset.py | Dataset.remove_member | def remove_member(self, member, api=None):
"""Remove member from a dataset
:param member: Member username
:param api: Api instance
:return: None
"""
api = api or self._API
username = Transform.to_member(member)
api.delete(
url=self._URL['membe... | python | def remove_member(self, member, api=None):
"""Remove member from a dataset
:param member: Member username
:param api: Api instance
:return: None
"""
api = api or self._API
username = Transform.to_member(member)
api.delete(
url=self._URL['membe... | Remove member from a dataset
:param member: Member username
:param api: Api instance
:return: None | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/dataset.py#L164-L178 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.query | def query(cls, project=None, names=None, metadata=None, origin=None,
tags=None, offset=None, limit=None, dataset=None, api=None,
parent=None):
"""
Query ( List ) files, requires project or dataset
:param project: Project id
:param names: Name list
:par... | python | def query(cls, project=None, names=None, metadata=None, origin=None,
tags=None, offset=None, limit=None, dataset=None, api=None,
parent=None):
"""
Query ( List ) files, requires project or dataset
:param project: Project id
:param names: Name list
:par... | Query ( List ) files, requires project or dataset
:param project: Project id
:param names: Name list
:param metadata: Metadata query dict
:param origin: Origin query dict
:param tags: List of tags to filter on
:param offset: Pagination offset
:param limit: Paginat... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L90-L155 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.upload | def upload(cls, path, project=None, parent=None, file_name=None,
overwrite=False, retry=5, timeout=10,
part_size=PartSize.UPLOAD_MINIMUM_PART_SIZE, wait=True,
api=None):
"""
Uploads a file using multipart upload and returns an upload handle
if the wai... | python | def upload(cls, path, project=None, parent=None, file_name=None,
overwrite=False, retry=5, timeout=10,
part_size=PartSize.UPLOAD_MINIMUM_PART_SIZE, wait=True,
api=None):
"""
Uploads a file using multipart upload and returns an upload handle
if the wai... | Uploads a file using multipart upload and returns an upload handle
if the wait parameter is set to False. If wait is set to True it
will block until the upload is completed.
:param path: File path on local disc.
:param project: Project identifier
:param parent: Parent folder ide... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L158-L216 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.copy | def copy(self, project, name=None):
"""
Copies the current file.
:param project: Destination project.
:param name: Destination file name.
:return: Copied File object.
"""
project = Transform.to_project(project)
data = {
'project': project
... | python | def copy(self, project, name=None):
"""
Copies the current file.
:param project: Destination project.
:param name: Destination file name.
:return: Copied File object.
"""
project = Transform.to_project(project)
data = {
'project': project
... | Copies the current file.
:param project: Destination project.
:param name: Destination file name.
:return: Copied File object. | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L218-L238 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.download_info | def download_info(self):
"""
Fetches download information containing file url
that can be used to download file.
:return: Download info object.
"""
info = self._api.get(url=self._URL['download_info'].format(id=self.id))
return DownloadInfo(api=self._api, **info.js... | python | def download_info(self):
"""
Fetches download information containing file url
that can be used to download file.
:return: Download info object.
"""
info = self._api.get(url=self._URL['download_info'].format(id=self.id))
return DownloadInfo(api=self._api, **info.js... | Fetches download information containing file url
that can be used to download file.
:return: Download info object. | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L240-L247 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.download | def download(self, path, retry=5, timeout=10,
chunk_size=PartSize.DOWNLOAD_MINIMUM_PART_SIZE, wait=True,
overwrite=False):
"""
Downloads the file and returns a download handle.
Download will not start until .start() method is invoked.
:param path: Full p... | python | def download(self, path, retry=5, timeout=10,
chunk_size=PartSize.DOWNLOAD_MINIMUM_PART_SIZE, wait=True,
overwrite=False):
"""
Downloads the file and returns a download handle.
Download will not start until .start() method is invoked.
:param path: Full p... | Downloads the file and returns a download handle.
Download will not start until .start() method is invoked.
:param path: Full path to the new file.
:param retry: Number of retries if error occurs during download.
:param timeout: Timeout for http requests.
:param chunk_size: Ch... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L249-L286 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.save | def save(self, inplace=True, silent=False):
"""
Saves all modification to the file on the server. By default this
method raises an error if you are trying to save an instance that was
not changed. Set check_if_modified param to False to disable
this behaviour.
:param inpl... | python | def save(self, inplace=True, silent=False):
"""
Saves all modification to the file on the server. By default this
method raises an error if you are trying to save an instance that was
not changed. Set check_if_modified param to False to disable
this behaviour.
:param inpl... | Saves all modification to the file on the server. By default this
method raises an error if you are trying to save an instance that was
not changed. Set check_if_modified param to False to disable
this behaviour.
:param inplace: Apply edits to the current instance or get a new one.
... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L289-L329 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.stream | def stream(self, part_size=32 * PartSize.KB):
"""
Creates an iterator which can be used to stream the file content.
:param part_size: Size of the part in bytes. Default 32KB
:return Iterator
"""
download_info = self.download_info()
response = self._api.get(
... | python | def stream(self, part_size=32 * PartSize.KB):
"""
Creates an iterator which can be used to stream the file content.
:param part_size: Size of the part in bytes. Default 32KB
:return Iterator
"""
download_info = self.download_info()
response = self._api.get(
... | Creates an iterator which can be used to stream the file content.
:param part_size: Size of the part in bytes. Default 32KB
:return Iterator | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L331-L342 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.reload | def reload(self):
"""
Refreshes the file with the data from the server.
"""
try:
data = self._api.get(self.href, append_base=False).json()
resource = File(api=self._api, **data)
except Exception:
try:
data = self._api.get(
... | python | def reload(self):
"""
Refreshes the file with the data from the server.
"""
try:
data = self._api.get(self.href, append_base=False).json()
resource = File(api=self._api, **data)
except Exception:
try:
data = self._api.get(
... | Refreshes the file with the data from the server. | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L345-L372 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.content | def content(self, path=None, overwrite=True, encoding='utf-8'):
"""
Downloads file to the specified path or as temporary file
and reads the file content in memory.
Should not be used on very large files.
:param path: Path for file download If omitted tmp file will be used.
... | python | def content(self, path=None, overwrite=True, encoding='utf-8'):
"""
Downloads file to the specified path or as temporary file
and reads the file content in memory.
Should not be used on very large files.
:param path: Path for file download If omitted tmp file will be used.
... | Downloads file to the specified path or as temporary file
and reads the file content in memory.
Should not be used on very large files.
:param path: Path for file download If omitted tmp file will be used.
:param overwrite: Overwrite file if exists locally
:param encoding: File... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L374-L393 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.bulk_get | def bulk_get(cls, files, api=None):
"""
Retrieve files with specified ids in bulk
:param files: Files to be retrieved.
:param api: Api instance.
:return: List of FileBulkRecord objects.
"""
api = api or cls._API
file_ids = [Transform.to_file(file_) for fil... | python | def bulk_get(cls, files, api=None):
"""
Retrieve files with specified ids in bulk
:param files: Files to be retrieved.
:param api: Api instance.
:return: List of FileBulkRecord objects.
"""
api = api or cls._API
file_ids = [Transform.to_file(file_) for fil... | Retrieve files with specified ids in bulk
:param files: Files to be retrieved.
:param api: Api instance.
:return: List of FileBulkRecord objects. | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L396-L409 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.bulk_update | def bulk_update(cls, files, api=None):
"""
This call updates the details for multiple specified files.
Use this call to set new information for the files, thus replacing
all existing information and erasing omitted parameters. For each
of the specified files, the call sets a new ... | python | def bulk_update(cls, files, api=None):
"""
This call updates the details for multiple specified files.
Use this call to set new information for the files, thus replacing
all existing information and erasing omitted parameters. For each
of the specified files, the call sets a new ... | This call updates the details for multiple specified files.
Use this call to set new information for the files, thus replacing
all existing information and erasing omitted parameters. For each
of the specified files, the call sets a new name, new tags and
metadata.
:param files: ... | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L428-L457 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.list_files | def list_files(self, offset=None, limit=None, api=None):
"""List files in a folder
:param api: Api instance
:param offset: Pagination offset
:param limit: Pagination limit
:return: List of files
"""
api = api or self._API
if not self.is_folder():
... | python | def list_files(self, offset=None, limit=None, api=None):
"""List files in a folder
:param api: Api instance
:param offset: Pagination offset
:param limit: Pagination limit
:return: List of files
"""
api = api or self._API
if not self.is_folder():
... | List files in a folder
:param api: Api instance
:param offset: Pagination offset
:param limit: Pagination limit
:return: List of files | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L491-L507 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.create_folder | def create_folder(cls, name, parent=None, project=None,
api=None):
"""Create a new folder
:param name: Folder name
:param parent: Parent folder
:param project: Project to create folder in
:param api: Api instance
:return: New folder
"""
... | python | def create_folder(cls, name, parent=None, project=None,
api=None):
"""Create a new folder
:param name: Folder name
:param parent: Parent folder
:param project: Project to create folder in
:param api: Api instance
:return: New folder
"""
... | Create a new folder
:param name: Folder name
:param parent: Parent folder
:param project: Project to create folder in
:param api: Api instance
:return: New folder | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L510-L541 |
sbg/sevenbridges-python | sevenbridges/models/file.py | File.copy_to_folder | def copy_to_folder(self, parent, name=None, api=None):
"""Copy file to folder
:param parent: Folder to copy file to
:param name: New file name
:param api: Api instance
:return: New file instance
"""
api = api or self._API
if self.is_folder():
... | python | def copy_to_folder(self, parent, name=None, api=None):
"""Copy file to folder
:param parent: Folder to copy file to
:param name: New file name
:param api: Api instance
:return: New file instance
"""
api = api or self._API
if self.is_folder():
... | Copy file to folder
:param parent: Folder to copy file to
:param name: New file name
:param api: Api instance
:return: New file instance | https://github.com/sbg/sevenbridges-python/blob/f62640d1018d959f0b686f2dbe5e183085336607/sevenbridges/models/file.py#L543-L566 |
indico/indico-plugins | piwik/indico_piwik/queries/utils.py | get_json_from_remote_server | def get_json_from_remote_server(func, **kwargs):
"""
Safely manage calls to the remote server by encapsulating JSON creation
from Piwik data.
"""
rawjson = func(**kwargs)
if rawjson is None:
# If the request failed we already logged in in PiwikRequest;
# no need to get into the e... | python | def get_json_from_remote_server(func, **kwargs):
"""
Safely manage calls to the remote server by encapsulating JSON creation
from Piwik data.
"""
rawjson = func(**kwargs)
if rawjson is None:
# If the request failed we already logged in in PiwikRequest;
# no need to get into the e... | Safely manage calls to the remote server by encapsulating JSON creation
from Piwik data. | https://github.com/indico/indico-plugins/blob/fe50085cc63be9b8161b09539e662e7b04e4b38e/piwik/indico_piwik/queries/utils.py#L22-L40 |
indico/indico-plugins | piwik/indico_piwik/queries/utils.py | reduce_json | def reduce_json(data):
"""Reduce a JSON object"""
return reduce(lambda x, y: int(x) + int(y), data.values()) | python | def reduce_json(data):
"""Reduce a JSON object"""
return reduce(lambda x, y: int(x) + int(y), data.values()) | Reduce a JSON object | https://github.com/indico/indico-plugins/blob/fe50085cc63be9b8161b09539e662e7b04e4b38e/piwik/indico_piwik/queries/utils.py#L43-L45 |
indico/indico-plugins | piwik/indico_piwik/queries/utils.py | stringify_seconds | def stringify_seconds(seconds=0):
"""
Takes time as a value of seconds and deduces the delta in human-readable
HHh MMm SSs format.
"""
seconds = int(seconds)
minutes = seconds / 60
ti = {'h': 0, 'm': 0, 's': 0}
if seconds > 0:
ti['s'] = seconds % 60
ti['m'] = minutes % 6... | python | def stringify_seconds(seconds=0):
"""
Takes time as a value of seconds and deduces the delta in human-readable
HHh MMm SSs format.
"""
seconds = int(seconds)
minutes = seconds / 60
ti = {'h': 0, 'm': 0, 's': 0}
if seconds > 0:
ti['s'] = seconds % 60
ti['m'] = minutes % 6... | Takes time as a value of seconds and deduces the delta in human-readable
HHh MMm SSs format. | https://github.com/indico/indico-plugins/blob/fe50085cc63be9b8161b09539e662e7b04e4b38e/piwik/indico_piwik/queries/utils.py#L48-L62 |
Kane610/deconz | pydeconz/sensor.py | create_sensor | def create_sensor(sensor_id, sensor, async_set_state_callback):
"""Simplify creating sensor by not needing to know type."""
if sensor['type'] in CONSUMPTION:
return Consumption(sensor_id, sensor)
if sensor['type'] in CARBONMONOXIDE:
return CarbonMonoxide(sensor_id, sensor)
if sensor['typ... | python | def create_sensor(sensor_id, sensor, async_set_state_callback):
"""Simplify creating sensor by not needing to know type."""
if sensor['type'] in CONSUMPTION:
return Consumption(sensor_id, sensor)
if sensor['type'] in CARBONMONOXIDE:
return CarbonMonoxide(sensor_id, sensor)
if sensor['typ... | Simplify creating sensor by not needing to know type. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L1012-L1047 |
Kane610/deconz | pydeconz/sensor.py | supported_sensor | def supported_sensor(sensor):
"""Check if sensor is supported by pydeconz."""
if sensor['type'] in DECONZ_BINARY_SENSOR + DECONZ_SENSOR + OTHER_SENSOR:
return True
_LOGGER.info('Unsupported sensor type %s (%s)',
sensor['type'], sensor['name'])
return False | python | def supported_sensor(sensor):
"""Check if sensor is supported by pydeconz."""
if sensor['type'] in DECONZ_BINARY_SENSOR + DECONZ_SENSOR + OTHER_SENSOR:
return True
_LOGGER.info('Unsupported sensor type %s (%s)',
sensor['type'], sensor['name'])
return False | Check if sensor is supported by pydeconz. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L1050-L1056 |
Kane610/deconz | pydeconz/sensor.py | DeconzSensor.async_update | def async_update(self, event, reason={}):
"""New event for sensor.
Check if state or config is part of event.
Signal that sensor has updated attributes.
Inform what attributes got changed values.
"""
reason['attr'] = []
for data in ['state', 'config']:
... | python | def async_update(self, event, reason={}):
"""New event for sensor.
Check if state or config is part of event.
Signal that sensor has updated attributes.
Inform what attributes got changed values.
"""
reason['attr'] = []
for data in ['state', 'config']:
... | New event for sensor.
Check if state or config is part of event.
Signal that sensor has updated attributes.
Inform what attributes got changed values. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L57-L69 |
Kane610/deconz | pydeconz/sensor.py | Daylight.status | def status(self):
"""Return the daylight status string."""
if self._status == 100:
return "nadir"
elif self._status == 110:
return "night_end"
elif self._status == 120:
return "nautical_dawn"
elif self._status == 130:
return "dawn"
... | python | def status(self):
"""Return the daylight status string."""
if self._status == 100:
return "nadir"
elif self._status == 110:
return "night_end"
elif self._status == 120:
return "nautical_dawn"
elif self._status == 130:
return "dawn"
... | Return the daylight status string. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L316-L347 |
Kane610/deconz | pydeconz/sensor.py | Humidity.state | def state(self):
"""Main state of sensor."""
if self.humidity is None:
return None
humidity = round(float(self.humidity) / 100, 1)
return humidity | python | def state(self):
"""Main state of sensor."""
if self.humidity is None:
return None
humidity = round(float(self.humidity) / 100, 1)
return humidity | Main state of sensor. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L483-L488 |
Kane610/deconz | pydeconz/sensor.py | LightLevel.state | def state(self):
"""Main state of sensor."""
if self.lightlevel is None:
return None
lux = round(10 ** (float(self.lightlevel - 1) / 10000), 1)
return lux | python | def state(self):
"""Main state of sensor."""
if self.lightlevel is None:
return None
lux = round(10 ** (float(self.lightlevel - 1) / 10000), 1)
return lux | Main state of sensor. | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L540-L545 |
Kane610/deconz | pydeconz/sensor.py | Thermostat.async_set_config | async def async_set_config(self, data):
"""Set config of thermostat.
{
"mode": "auto",
"heatsetpoint": 180,
}
"""
field = self.deconz_id + '/config'
await self._async_set_state_callback(field, data) | python | async def async_set_config(self, data):
"""Set config of thermostat.
{
"mode": "auto",
"heatsetpoint": 180,
}
"""
field = self.deconz_id + '/config'
await self._async_set_state_callback(field, data) | Set config of thermostat.
{
"mode": "auto",
"heatsetpoint": 180,
} | https://github.com/Kane610/deconz/blob/8a9498dbbc8c168d4a081173ad6c3b1e17fffdf6/pydeconz/sensor.py#L842-L851 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | _metric_value | def _metric_value(value_str, metric_type):
"""
Return a Python-typed metric value from a metric value string.
"""
if metric_type in (int, float):
try:
return metric_type(value_str)
except ValueError:
raise ValueError("Invalid {} metric value: {!r}".
... | python | def _metric_value(value_str, metric_type):
"""
Return a Python-typed metric value from a metric value string.
"""
if metric_type in (int, float):
try:
return metric_type(value_str)
except ValueError:
raise ValueError("Invalid {} metric value: {!r}".
... | Return a Python-typed metric value from a metric value string. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L484-L507 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | _metric_unit_from_name | def _metric_unit_from_name(metric_name):
"""
Return a metric unit string for human consumption, that is inferred from
the metric name.
If a unit cannot be inferred, `None` is returned.
"""
for item in _PATTERN_UNIT_LIST:
pattern, unit = item
if pattern.match(metric_name):
... | python | def _metric_unit_from_name(metric_name):
"""
Return a metric unit string for human consumption, that is inferred from
the metric name.
If a unit cannot be inferred, `None` is returned.
"""
for item in _PATTERN_UNIT_LIST:
pattern, unit = item
if pattern.match(metric_name):
... | Return a metric unit string for human consumption, that is inferred from
the metric name.
If a unit cannot be inferred, `None` is returned. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L510-L521 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricsContextManager.create | def create(self, properties):
"""
Create a :term:`Metrics Context` resource in the HMC this client is
connected to.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined in section 'Request body contents'
in section '... | python | def create(self, properties):
"""
Create a :term:`Metrics Context` resource in the HMC this client is
connected to.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined in section 'Request body contents'
in section '... | Create a :term:`Metrics Context` resource in the HMC this client is
connected to.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined in section 'Request body contents'
in section 'Create Metrics Context' in the :term:`HMC API` boo... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L200-L232 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricsContext._setup_metric_group_definitions | def _setup_metric_group_definitions(self):
"""
Return the dict of MetricGroupDefinition objects for this metrics
context, by processing its 'metric-group-infos' property.
"""
# Dictionary of MetricGroupDefinition objects, by metric group name
metric_group_definitions = di... | python | def _setup_metric_group_definitions(self):
"""
Return the dict of MetricGroupDefinition objects for this metrics
context, by processing its 'metric-group-infos' property.
"""
# Dictionary of MetricGroupDefinition objects, by metric group name
metric_group_definitions = di... | Return the dict of MetricGroupDefinition objects for this metrics
context, by processing its 'metric-group-infos' property. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L272-L294 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricsContext.get_metrics | def get_metrics(self):
"""
Retrieve the current metric values for this :term:`Metrics Context`
resource from the HMC.
The metric values are returned by this method as a string in the
`MetricsResponse` format described with the 'Get Metrics' operation in
the :term:`HMC AP... | python | def get_metrics(self):
"""
Retrieve the current metric values for this :term:`Metrics Context`
resource from the HMC.
The metric values are returned by this method as a string in the
`MetricsResponse` format described with the 'Get Metrics' operation in
the :term:`HMC AP... | Retrieve the current metric values for this :term:`Metrics Context`
resource from the HMC.
The metric values are returned by this method as a string in the
`MetricsResponse` format described with the 'Get Metrics' operation in
the :term:`HMC API` book.
The :class:`~zhmcclient.M... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L307-L333 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricsContext.delete | def delete(self):
"""
Delete this :term:`Metrics Context` resource.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
:exc:`~zhmcclient.AuthError`
:exc:`~zhmcclient.ConnectionError`
"""
self.manager.session.delete(self.ur... | python | def delete(self):
"""
Delete this :term:`Metrics Context` resource.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
:exc:`~zhmcclient.AuthError`
:exc:`~zhmcclient.ConnectionError`
"""
self.manager.session.delete(self.ur... | Delete this :term:`Metrics Context` resource.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
:exc:`~zhmcclient.AuthError`
:exc:`~zhmcclient.ConnectionError` | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L336-L348 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricsResponse._setup_metric_group_values | def _setup_metric_group_values(self):
"""
Return the list of MetricGroupValues objects for this metrics response,
by processing its metrics response string.
The lines in the metrics response string are::
MetricsResponse: MetricsGroup{0,*}
<empty... | python | def _setup_metric_group_values(self):
"""
Return the list of MetricGroupValues objects for this metrics response,
by processing its metrics response string.
The lines in the metrics response string are::
MetricsResponse: MetricsGroup{0,*}
<empty... | Return the list of MetricGroupValues objects for this metrics response,
by processing its metrics response string.
The lines in the metrics response string are::
MetricsResponse: MetricsGroup{0,*}
<emptyline> a third empty line at the end
Metr... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L617-L706 |
zhmcclient/python-zhmcclient | zhmcclient/_metrics.py | MetricObjectValues.resource | def resource(self):
"""
:class:`~zhmcclient.BaseResource`: The Python resource object of the
resource these metric values apply to.
Raises:
:exc:`~zhmcclient.NotFound`: No resource found for this URI in the
management scope of the HMC.
"""
if sel... | python | def resource(self):
"""
:class:`~zhmcclient.BaseResource`: The Python resource object of the
resource these metric values apply to.
Raises:
:exc:`~zhmcclient.NotFound`: No resource found for this URI in the
management scope of the HMC.
"""
if sel... | :class:`~zhmcclient.BaseResource`: The Python resource object of the
resource these metric values apply to.
Raises:
:exc:`~zhmcclient.NotFound`: No resource found for this URI in the
management scope of the HMC. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_metrics.py#L846-L915 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_idpool.py | IdPool._expand | def _expand(self):
"""
Expand the free pool, if possible.
If out of capacity w.r.t. the defined ID value range, ValueError is
raised.
"""
assert not self._free # free pool is empty
expand_end = self._expand_start + self._expand_len
if expand_end > self._... | python | def _expand(self):
"""
Expand the free pool, if possible.
If out of capacity w.r.t. the defined ID value range, ValueError is
raised.
"""
assert not self._free # free pool is empty
expand_end = self._expand_start + self._expand_len
if expand_end > self._... | Expand the free pool, if possible.
If out of capacity w.r.t. the defined ID value range, ValueError is
raised. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_idpool.py#L67-L83 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_idpool.py | IdPool.alloc | def alloc(self):
"""
Allocate an ID value and return it.
Raises:
ValueError: Out of capacity in ID pool.
"""
if not self._free:
self._expand()
id = self._free.pop()
self._used.add(id)
return id | python | def alloc(self):
"""
Allocate an ID value and return it.
Raises:
ValueError: Out of capacity in ID pool.
"""
if not self._free:
self._expand()
id = self._free.pop()
self._used.add(id)
return id | Allocate an ID value and return it.
Raises:
ValueError: Out of capacity in ID pool. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_idpool.py#L85-L96 |
zhmcclient/python-zhmcclient | zhmcclient/_nic.py | NicManager.create | def create(self, properties):
"""
Create and configure a NIC in this Partition.
The NIC must be backed by an adapter port (on an OSA, ROCE, or
Hipersockets adapter).
The way the backing adapter port is specified in the "properties"
parameter of this method depends on th... | python | def create(self, properties):
"""
Create and configure a NIC in this Partition.
The NIC must be backed by an adapter port (on an OSA, ROCE, or
Hipersockets adapter).
The way the backing adapter port is specified in the "properties"
parameter of this method depends on th... | Create and configure a NIC in this Partition.
The NIC must be backed by an adapter port (on an OSA, ROCE, or
Hipersockets adapter).
The way the backing adapter port is specified in the "properties"
parameter of this method depends on the adapter type, as follows:
* For OSA and... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_nic.py#L134-L234 |
zhmcclient/python-zhmcclient | zhmcclient/_nic.py | Nic.delete | def delete(self):
"""
Delete this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this HBA.
* Task permission to the "Partition Details" task.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError... | python | def delete(self):
"""
Delete this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this HBA.
* Task permission to the "Partition Details" task.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError... | Delete this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this HBA.
* Task permission to the "Partition Details" task.
Raises:
:exc:`~zhmcclient.HTTPError`
:exc:`~zhmcclient.ParseError`
:exc:`~zhmcclient.AuthErro... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_nic.py#L270-L288 |
zhmcclient/python-zhmcclient | zhmcclient/_nic.py | Nic.update_properties | def update_properties(self, properties):
"""
Update writeable properties of this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this NIC.
* Object-access permission to the backing Adapter for this NIC.
* Task permission to the "P... | python | def update_properties(self, properties):
"""
Update writeable properties of this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this NIC.
* Object-access permission to the backing Adapter for this NIC.
* Task permission to the "P... | Update writeable properties of this NIC.
Authorization requirements:
* Object-access permission to the Partition containing this NIC.
* Object-access permission to the backing Adapter for this NIC.
* Task permission to the "Partition Details" task.
Parameters:
prope... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_nic.py#L291-L324 |
zhmcclient/python-zhmcclient | zhmcclient/_virtual_storage_resource.py | VirtualStorageResource.attached_partition | def attached_partition(self):
"""
:class:`~zhmcclient.Partition`: The partition to which this virtual
storage resource is attached.
The returned partition object has only a minimal set of properties set
('object-id', 'object-uri', 'class', 'parent').
Note that a virtual... | python | def attached_partition(self):
"""
:class:`~zhmcclient.Partition`: The partition to which this virtual
storage resource is attached.
The returned partition object has only a minimal set of properties set
('object-id', 'object-uri', 'class', 'parent').
Note that a virtual... | :class:`~zhmcclient.Partition`: The partition to which this virtual
storage resource is attached.
The returned partition object has only a minimal set of properties set
('object-id', 'object-uri', 'class', 'parent').
Note that a virtual storage resource is always attached to a partitio... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_virtual_storage_resource.py#L216-L243 |
zhmcclient/python-zhmcclient | zhmcclient/_virtual_storage_resource.py | VirtualStorageResource.adapter_port | def adapter_port(self):
"""
:class:`~zhmcclient.Port`: The storage adapter port associated with
this virtual storage resource, once discovery has determined which
port to use for this virtual storage resource.
This applies to both, FCP and FICON/ECKD typed storage groups.
... | python | def adapter_port(self):
"""
:class:`~zhmcclient.Port`: The storage adapter port associated with
this virtual storage resource, once discovery has determined which
port to use for this virtual storage resource.
This applies to both, FCP and FICON/ECKD typed storage groups.
... | :class:`~zhmcclient.Port`: The storage adapter port associated with
this virtual storage resource, once discovery has determined which
port to use for this virtual storage resource.
This applies to both, FCP and FICON/ECKD typed storage groups.
The returned adapter port object has only... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_virtual_storage_resource.py#L246-L282 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | _NameUriCache.get | def get(self, name):
"""
Get the resource URI for a specified resource name.
If an entry for the specified resource name does not exist in the
Name-URI cache, the cache is refreshed from the HMC with all resources
of the manager holding this cache.
If an entry for the s... | python | def get(self, name):
"""
Get the resource URI for a specified resource name.
If an entry for the specified resource name does not exist in the
Name-URI cache, the cache is refreshed from the HMC with all resources
of the manager holding this cache.
If an entry for the s... | Get the resource URI for a specified resource name.
If an entry for the specified resource name does not exist in the
Name-URI cache, the cache is refreshed from the HMC with all resources
of the manager holding this cache.
If an entry for the specified resource name still does not exi... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L75-L94 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | _NameUriCache.auto_invalidate | def auto_invalidate(self):
"""
Invalidate the cache if the current time is past the time to live.
"""
current = datetime.now()
if current > self._invalidated + timedelta(seconds=self._timetolive):
self.invalidate() | python | def auto_invalidate(self):
"""
Invalidate the cache if the current time is past the time to live.
"""
current = datetime.now()
if current > self._invalidated + timedelta(seconds=self._timetolive):
self.invalidate() | Invalidate the cache if the current time is past the time to live. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L96-L102 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | _NameUriCache.refresh | def refresh(self):
"""
Refresh the Name-URI cache from the HMC.
This is done by invalidating the cache, listing the resources of this
manager from the HMC, and populating the cache with that information.
"""
self.invalidate()
full = not self._manager._list_has_na... | python | def refresh(self):
"""
Refresh the Name-URI cache from the HMC.
This is done by invalidating the cache, listing the resources of this
manager from the HMC, and populating the cache with that information.
"""
self.invalidate()
full = not self._manager._list_has_na... | Refresh the Name-URI cache from the HMC.
This is done by invalidating the cache, listing the resources of this
manager from the HMC, and populating the cache with that information. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L114-L124 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | _NameUriCache.update_from | def update_from(self, res_list):
"""
Update the Name-URI cache from the provided resource list.
This is done by going through the resource list and updating any cache
entries for non-empty resource names in that list. Other cache entries
remain unchanged.
"""
for... | python | def update_from(self, res_list):
"""
Update the Name-URI cache from the provided resource list.
This is done by going through the resource list and updating any cache
entries for non-empty resource names in that list. Other cache entries
remain unchanged.
"""
for... | Update the Name-URI cache from the provided resource list.
This is done by going through the resource list and updating any cache
entries for non-empty resource names in that list. Other cache entries
remain unchanged. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L126-L139 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager._try_optimized_lookup | def _try_optimized_lookup(self, filter_args):
"""
Try to optimize the lookup by checking whether the filter arguments
specify the property that is used as the last segment in the resource
URI, with a plain string as match value (i.e. not using regular
expression matching).
... | python | def _try_optimized_lookup(self, filter_args):
"""
Try to optimize the lookup by checking whether the filter arguments
specify the property that is used as the last segment in the resource
URI, with a plain string as match value (i.e. not using regular
expression matching).
... | Try to optimize the lookup by checking whether the filter arguments
specify the property that is used as the last segment in the resource
URI, with a plain string as match value (i.e. not using regular
expression matching).
If so, the lookup is performed by constructing the resource URI... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L327-L378 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager._divide_filter_args | def _divide_filter_args(self, filter_args):
"""
Divide the filter arguments into filter query parameters for filtering
on the server side, and the remaining client-side filters.
Parameters:
filter_args (dict):
Filter arguments that narrow the list of returned reso... | python | def _divide_filter_args(self, filter_args):
"""
Divide the filter arguments into filter query parameters for filtering
on the server side, and the remaining client-side filters.
Parameters:
filter_args (dict):
Filter arguments that narrow the list of returned reso... | Divide the filter arguments into filter query parameters for filtering
on the server side, and the remaining client-side filters.
Parameters:
filter_args (dict):
Filter arguments that narrow the list of returned resources to
those that match the specified filter argum... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L380-L414 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager._matches_filters | def _matches_filters(self, obj, filter_args):
"""
Return a boolean indicating whether a resource object matches a set
of filter arguments.
This is used for client-side filtering.
Depending on the properties specified in the filter arguments, this
method retrieves the res... | python | def _matches_filters(self, obj, filter_args):
"""
Return a boolean indicating whether a resource object matches a set
of filter arguments.
This is used for client-side filtering.
Depending on the properties specified in the filter arguments, this
method retrieves the res... | Return a boolean indicating whether a resource object matches a set
of filter arguments.
This is used for client-side filtering.
Depending on the properties specified in the filter arguments, this
method retrieves the resource properties from the HMC.
Parameters:
obj... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L427-L455 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager._matches_prop | def _matches_prop(self, obj, prop_name, prop_match):
"""
Return a boolean indicating whether a resource object matches with
a single property against a property match value.
This is used for client-side filtering.
Depending on the specified property, this method retrieves the re... | python | def _matches_prop(self, obj, prop_name, prop_match):
"""
Return a boolean indicating whether a resource object matches with
a single property against a property match value.
This is used for client-side filtering.
Depending on the specified property, this method retrieves the re... | Return a boolean indicating whether a resource object matches with
a single property against a property match value.
This is used for client-side filtering.
Depending on the specified property, this method retrieves the resource
properties from the HMC.
Parameters:
o... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L457-L524 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager.resource_object | def resource_object(self, uri_or_oid, props=None):
"""
Return a minimalistic Python resource object for this resource class,
that is scoped to this manager.
This method is an internal helper function and is not normally called
by users.
The returned resource object will... | python | def resource_object(self, uri_or_oid, props=None):
"""
Return a minimalistic Python resource object for this resource class,
that is scoped to this manager.
This method is an internal helper function and is not normally called
by users.
The returned resource object will... | Return a minimalistic Python resource object for this resource class,
that is scoped to this manager.
This method is an internal helper function and is not normally called
by users.
The returned resource object will have the following minimal set of
properties set automatically... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L562-L613 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager.findall | def findall(self, **filter_args):
"""
Find zero or more resources in scope of this manager, by matching
resource properties against the specified filter arguments, and return
a list of their Python resource objects (e.g. for CPCs, a list of
:class:`~zhmcclient.Cpc` objects is ret... | python | def findall(self, **filter_args):
"""
Find zero or more resources in scope of this manager, by matching
resource properties against the specified filter arguments, and return
a list of their Python resource objects (e.g. for CPCs, a list of
:class:`~zhmcclient.Cpc` objects is ret... | Find zero or more resources in scope of this manager, by matching
resource properties against the specified filter arguments, and return
a list of their Python resource objects (e.g. for CPCs, a list of
:class:`~zhmcclient.Cpc` objects is returned).
Any resource property may be specifie... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L616-L692 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager.find | def find(self, **filter_args):
"""
Find exactly one resource in scope of this manager, by matching
resource properties against the specified filter arguments, and return
its Python resource object (e.g. for a CPC, a :class:`~zhmcclient.Cpc`
object is returned).
Any resou... | python | def find(self, **filter_args):
"""
Find exactly one resource in scope of this manager, by matching
resource properties against the specified filter arguments, and return
its Python resource object (e.g. for a CPC, a :class:`~zhmcclient.Cpc`
object is returned).
Any resou... | Find exactly one resource in scope of this manager, by matching
resource properties against the specified filter arguments, and return
its Python resource object (e.g. for a CPC, a :class:`~zhmcclient.Cpc`
object is returned).
Any resource property may be specified in a filter argument.... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L695-L772 |
zhmcclient/python-zhmcclient | zhmcclient/_manager.py | BaseManager.find_by_name | def find_by_name(self, name):
"""
Find a resource by name (i.e. value of its 'name' resource property)
and return its Python resource object (e.g. for a CPC, a
:class:`~zhmcclient.Cpc` object is returned).
This method performs an optimized lookup that uses a name-to-URI
... | python | def find_by_name(self, name):
"""
Find a resource by name (i.e. value of its 'name' resource property)
and return its Python resource object (e.g. for a CPC, a
:class:`~zhmcclient.Cpc` object is returned).
This method performs an optimized lookup that uses a name-to-URI
... | Find a resource by name (i.e. value of its 'name' resource property)
and return its Python resource object (e.g. for a CPC, a
:class:`~zhmcclient.Cpc` object is returned).
This method performs an optimized lookup that uses a name-to-URI
mapping cached in this manager object.
Th... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_manager.py#L837-L886 |
zhmcclient/python-zhmcclient | examples/get_inventory.py | pprint_for_ordereddict | def pprint_for_ordereddict():
"""
Context manager that causes pprint() to print OrderedDict objects as nicely
as standard Python dictionary objects.
"""
od_saved = OrderedDict.__repr__
try:
OrderedDict.__repr__ = dict.__repr__
yield
finally:
OrderedDict.__repr__ = od_... | python | def pprint_for_ordereddict():
"""
Context manager that causes pprint() to print OrderedDict objects as nicely
as standard Python dictionary objects.
"""
od_saved = OrderedDict.__repr__
try:
OrderedDict.__repr__ = dict.__repr__
yield
finally:
OrderedDict.__repr__ = od_... | Context manager that causes pprint() to print OrderedDict objects as nicely
as standard Python dictionary objects. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/examples/get_inventory.py#L33-L43 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedBaseResource.add_resources | def add_resources(self, resources):
"""
Add faked child resources to this resource, from the provided resource
definitions.
Duplicate resource names in the same scope are not permitted.
Although this method is typically used to initially load the faked
HMC with resource... | python | def add_resources(self, resources):
"""
Add faked child resources to this resource, from the provided resource
definitions.
Duplicate resource names in the same scope are not permitted.
Although this method is typically used to initially load the faked
HMC with resource... | Add faked child resources to this resource, from the provided resource
definitions.
Duplicate resource names in the same scope are not permitted.
Although this method is typically used to initially load the faked
HMC with resource state just once, it can be invoked multiple times
... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L192-L294 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedBaseManager.add | def add(self, properties):
"""
Add a faked resource to this manager.
For URI-based lookup, the resource is also added to the faked HMC.
Parameters:
properties (dict):
Resource properties. If the URI property (e.g. 'object-uri') or the
object ID proper... | python | def add(self, properties):
"""
Add a faked resource to this manager.
For URI-based lookup, the resource is also added to the faked HMC.
Parameters:
properties (dict):
Resource properties. If the URI property (e.g. 'object-uri') or the
object ID proper... | Add a faked resource to this manager.
For URI-based lookup, the resource is also added to the faked HMC.
Parameters:
properties (dict):
Resource properties. If the URI property (e.g. 'object-uri') or the
object ID property (e.g. 'object-id') are not specified, they
... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L521-L540 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedBaseManager.remove | def remove(self, oid):
"""
Remove a faked resource from this manager.
Parameters:
oid (string):
The object ID of the resource (e.g. value of the 'object-uri'
property).
"""
uri = self._resources[oid].uri
del self._resources[oid]
... | python | def remove(self, oid):
"""
Remove a faked resource from this manager.
Parameters:
oid (string):
The object ID of the resource (e.g. value of the 'object-uri'
property).
"""
uri = self._resources[oid].uri
del self._resources[oid]
... | Remove a faked resource from this manager.
Parameters:
oid (string):
The object ID of the resource (e.g. value of the 'object-uri'
property). | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L542-L554 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedBaseManager.list | def list(self, filter_args=None):
"""
List the faked resources of this manager.
Parameters:
filter_args (dict):
Filter arguments. `None` causes no filtering to happen. See
:meth:`~zhmcclient.BaseManager.list()` for details.
Returns:
list of ... | python | def list(self, filter_args=None):
"""
List the faked resources of this manager.
Parameters:
filter_args (dict):
Filter arguments. `None` causes no filtering to happen. See
:meth:`~zhmcclient.BaseManager.list()` for details.
Returns:
list of ... | List the faked resources of this manager.
Parameters:
filter_args (dict):
Filter arguments. `None` causes no filtering to happen. See
:meth:`~zhmcclient.BaseManager.list()` for details.
Returns:
list of FakedBaseResource: The faked resource objects of this
... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L556-L575 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedConsoleManager.console | def console(self):
"""
The faked Console representing the faked HMC (an object of
:class:`~zhmcclient_mock.FakedConsole`). The object is cached.
"""
if self._console is None:
self._console = self.list()[0]
return self._console | python | def console(self):
"""
The faked Console representing the faked HMC (an object of
:class:`~zhmcclient_mock.FakedConsole`). The object is cached.
"""
if self._console is None:
self._console = self.list()[0]
return self._console | The faked Console representing the faked HMC (an object of
:class:`~zhmcclient_mock.FakedConsole`). The object is cached. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L721-L728 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedHbaManager.add | def add(self, properties):
"""
Add a faked HBA resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | python | def add(self, properties):
"""
Add a faked HBA resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | Add a faked HBA resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
all instances of this resource type, if not spe... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L1760-L1812 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedHbaManager.remove | def remove(self, oid):
"""
Remove a faked HBA resource.
This method also updates the 'hba-uris' property in the parent
Partition resource, by removing the URI for the faked HBA resource.
Parameters:
oid (string):
The object ID of the faked HBA resource.
... | python | def remove(self, oid):
"""
Remove a faked HBA resource.
This method also updates the 'hba-uris' property in the parent
Partition resource, by removing the URI for the faked HBA resource.
Parameters:
oid (string):
The object ID of the faked HBA resource.
... | Remove a faked HBA resource.
This method also updates the 'hba-uris' property in the parent
Partition resource, by removing the URI for the faked HBA resource.
Parameters:
oid (string):
The object ID of the faked HBA resource. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L1814-L1837 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedNicManager.add | def add(self, properties):
"""
Add a faked NIC resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | python | def add(self, properties):
"""
Add a faked NIC resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | Add a faked NIC resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
all instances of this resource type, if not spe... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L1935-L2004 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedNicManager.remove | def remove(self, oid):
"""
Remove a faked NIC resource.
This method also updates the 'nic-uris' property in the parent
Partition resource, by removing the URI for the faked NIC resource.
Parameters:
oid (string):
The object ID of the faked NIC resource.
... | python | def remove(self, oid):
"""
Remove a faked NIC resource.
This method also updates the 'nic-uris' property in the parent
Partition resource, by removing the URI for the faked NIC resource.
Parameters:
oid (string):
The object ID of the faked NIC resource.
... | Remove a faked NIC resource.
This method also updates the 'nic-uris' property in the parent
Partition resource, by removing the URI for the faked NIC resource.
Parameters:
oid (string):
The object ID of the faked NIC resource. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2006-L2026 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.devno_alloc | def devno_alloc(self):
"""
Allocates a device number unique to this partition, in the range of
0x8000 to 0xFFFF.
Returns:
string: The device number as four hexadecimal digits in upper case.
Raises:
ValueError: No more device numbers available in that range.
... | python | def devno_alloc(self):
"""
Allocates a device number unique to this partition, in the range of
0x8000 to 0xFFFF.
Returns:
string: The device number as four hexadecimal digits in upper case.
Raises:
ValueError: No more device numbers available in that range.
... | Allocates a device number unique to this partition, in the range of
0x8000 to 0xFFFF.
Returns:
string: The device number as four hexadecimal digits in upper case.
Raises:
ValueError: No more device numbers available in that range. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2181-L2194 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.devno_free | def devno_free(self, devno):
"""
Free a device number allocated with :meth:`devno_alloc`.
The device number must be allocated.
Parameters:
devno (string): The device number as four hexadecimal digits.
Raises:
ValueError: Device number not in pool range or n... | python | def devno_free(self, devno):
"""
Free a device number allocated with :meth:`devno_alloc`.
The device number must be allocated.
Parameters:
devno (string): The device number as four hexadecimal digits.
Raises:
ValueError: Device number not in pool range or n... | Free a device number allocated with :meth:`devno_alloc`.
The device number must be allocated.
Parameters:
devno (string): The device number as four hexadecimal digits.
Raises:
ValueError: Device number not in pool range or not currently
allocated. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2196-L2210 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.devno_free_if_allocated | def devno_free_if_allocated(self, devno):
"""
Free a device number allocated with :meth:`devno_alloc`.
If the device number is not currently allocated or not in the pool
range, nothing happens.
Parameters:
devno (string): The device number as four hexadecimal digits.
... | python | def devno_free_if_allocated(self, devno):
"""
Free a device number allocated with :meth:`devno_alloc`.
If the device number is not currently allocated or not in the pool
range, nothing happens.
Parameters:
devno (string): The device number as four hexadecimal digits.
... | Free a device number allocated with :meth:`devno_alloc`.
If the device number is not currently allocated or not in the pool
range, nothing happens.
Parameters:
devno (string): The device number as four hexadecimal digits. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2212-L2223 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.wwpn_alloc | def wwpn_alloc(self):
"""
Allocates a WWPN unique to this partition, in the range of
0xAFFEAFFE00008000 to 0xAFFEAFFE0000FFFF.
Returns:
string: The WWPN as 16 hexadecimal digits in upper case.
Raises:
ValueError: No more WWPNs available in that range.
... | python | def wwpn_alloc(self):
"""
Allocates a WWPN unique to this partition, in the range of
0xAFFEAFFE00008000 to 0xAFFEAFFE0000FFFF.
Returns:
string: The WWPN as 16 hexadecimal digits in upper case.
Raises:
ValueError: No more WWPNs available in that range.
... | Allocates a WWPN unique to this partition, in the range of
0xAFFEAFFE00008000 to 0xAFFEAFFE0000FFFF.
Returns:
string: The WWPN as 16 hexadecimal digits in upper case.
Raises:
ValueError: No more WWPNs available in that range. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2225-L2238 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.wwpn_free | def wwpn_free(self, wwpn):
"""
Free a WWPN allocated with :meth:`wwpn_alloc`.
The WWPN must be allocated.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits.
Raises:
ValueError: WWPN not in pool range or not currently
allocated.
... | python | def wwpn_free(self, wwpn):
"""
Free a WWPN allocated with :meth:`wwpn_alloc`.
The WWPN must be allocated.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits.
Raises:
ValueError: WWPN not in pool range or not currently
allocated.
... | Free a WWPN allocated with :meth:`wwpn_alloc`.
The WWPN must be allocated.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits.
Raises:
ValueError: WWPN not in pool range or not currently
allocated. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2240-L2254 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPartition.wwpn_free_if_allocated | def wwpn_free_if_allocated(self, wwpn):
"""
Free a WWPN allocated with :meth:`wwpn_alloc`.
If the WWPN is not currently allocated or not in the pool
range, nothing happens.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits.
"""
wwpn_int = i... | python | def wwpn_free_if_allocated(self, wwpn):
"""
Free a WWPN allocated with :meth:`wwpn_alloc`.
If the WWPN is not currently allocated or not in the pool
range, nothing happens.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits.
"""
wwpn_int = i... | Free a WWPN allocated with :meth:`wwpn_alloc`.
If the WWPN is not currently allocated or not in the pool
range, nothing happens.
Parameters:
WWPN (string): The WWPN as 16 hexadecimal digits. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2256-L2268 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPortManager.add | def add(self, properties):
"""
Add a faked Port resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | python | def add(self, properties):
"""
Add a faked Port resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | Add a faked Port resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
all instances of this resource type, if not sp... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2300-L2331 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedPortManager.remove | def remove(self, oid):
"""
Remove a faked Port resource.
This method also updates the 'network-port-uris' or 'storage-port-uris'
property in the parent Adapter resource, by removing the URI for the
faked Port resource.
Parameters:
oid (string):
Th... | python | def remove(self, oid):
"""
Remove a faked Port resource.
This method also updates the 'network-port-uris' or 'storage-port-uris'
property in the parent Adapter resource, by removing the URI for the
faked Port resource.
Parameters:
oid (string):
Th... | Remove a faked Port resource.
This method also updates the 'network-port-uris' or 'storage-port-uris'
property in the parent Adapter resource, by removing the URI for the
faked Port resource.
Parameters:
oid (string):
The object ID of the faked Port resource. | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2333-L2354 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedVirtualFunctionManager.add | def add(self, properties):
"""
Add a faked Virtual Function resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | python | def add(self, properties):
"""
Add a faked Virtual Function resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
... | Add a faked Virtual Function resource.
Parameters:
properties (dict):
Resource properties.
Special handling and requirements for certain properties:
* 'element-id' will be auto-generated with a unique value across
all instances of this resource typ... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2391-L2427 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedVirtualFunctionManager.remove | def remove(self, oid):
"""
Remove a faked Virtual Function resource.
This method also updates the 'virtual-function-uris' property in the
parent Partition resource, by removing the URI for the faked Virtual
Function resource.
Parameters:
oid (string):
... | python | def remove(self, oid):
"""
Remove a faked Virtual Function resource.
This method also updates the 'virtual-function-uris' property in the
parent Partition resource, by removing the URI for the faked Virtual
Function resource.
Parameters:
oid (string):
... | Remove a faked Virtual Function resource.
This method also updates the 'virtual-function-uris' property in the
parent Partition resource, by removing the URI for the faked Virtual
Function resource.
Parameters:
oid (string):
The object ID of the faked Virtual Fun... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2429-L2450 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContextManager.add_metric_group_definition | def add_metric_group_definition(self, definition):
"""
Add a faked metric group definition.
The definition will be used:
* For later addition of faked metrics responses.
* For returning the metric-group-info objects in the response of the
Create Metrics Context operat... | python | def add_metric_group_definition(self, definition):
"""
Add a faked metric group definition.
The definition will be used:
* For later addition of faked metrics responses.
* For returning the metric-group-info objects in the response of the
Create Metrics Context operat... | Add a faked metric group definition.
The definition will be used:
* For later addition of faked metrics responses.
* For returning the metric-group-info objects in the response of the
Create Metrics Context operations.
For defined metric groups, see chapter "Metric groups" i... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2820-L2848 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContextManager.get_metric_group_definition | def get_metric_group_definition(self, group_name):
"""
Get a faked metric group definition by its group name.
Parameters:
group_name (:term:`string`): Name of the metric group.
Returns:
:class:~zhmcclient.FakedMetricGroupDefinition`: Definition of the
... | python | def get_metric_group_definition(self, group_name):
"""
Get a faked metric group definition by its group name.
Parameters:
group_name (:term:`string`): Name of the metric group.
Returns:
:class:~zhmcclient.FakedMetricGroupDefinition`: Definition of the
... | Get a faked metric group definition by its group name.
Parameters:
group_name (:term:`string`): Name of the metric group.
Returns:
:class:~zhmcclient.FakedMetricGroupDefinition`: Definition of the
metric group.
Raises:
ValueError: A metric group de... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2850-L2870 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContextManager.add_metric_values | def add_metric_values(self, values):
"""
Add one set of faked metric values for a particular resource to the
metrics response for a particular metric group, for later retrieval.
For defined metric groups, see chapter "Metric groups" in the
:term:`HMC API` book.
Paramete... | python | def add_metric_values(self, values):
"""
Add one set of faked metric values for a particular resource to the
metrics response for a particular metric group, for later retrieval.
For defined metric groups, see chapter "Metric groups" in the
:term:`HMC API` book.
Paramete... | Add one set of faked metric values for a particular resource to the
metrics response for a particular metric group, for later retrieval.
For defined metric groups, see chapter "Metric groups" in the
:term:`HMC API` book.
Parameters:
values (:class:`~zhmclient.FakedMetricObje... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2883-L2903 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContextManager.get_metric_values | def get_metric_values(self, group_name):
"""
Get the faked metric values for a metric group, by its metric group
name.
The result includes all metric object values added earlier for that
metric group name, using
:meth:`~zhmcclient.FakedMetricsContextManager.add_metric_ob... | python | def get_metric_values(self, group_name):
"""
Get the faked metric values for a metric group, by its metric group
name.
The result includes all metric object values added earlier for that
metric group name, using
:meth:`~zhmcclient.FakedMetricsContextManager.add_metric_ob... | Get the faked metric values for a metric group, by its metric group
name.
The result includes all metric object values added earlier for that
metric group name, using
:meth:`~zhmcclient.FakedMetricsContextManager.add_metric_object_values`
i.e. the metric values for all resources... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2905-L2932 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContext.get_metric_group_definitions | def get_metric_group_definitions(self):
"""
Get the faked metric group definitions for this context object
that are to be returned from its create operation.
If a 'metric-groups' property had been specified for this context,
only those faked metric group definitions of its manag... | python | def get_metric_group_definitions(self):
"""
Get the faked metric group definitions for this context object
that are to be returned from its create operation.
If a 'metric-groups' property had been specified for this context,
only those faked metric group definitions of its manag... | Get the faked metric group definitions for this context object
that are to be returned from its create operation.
If a 'metric-groups' property had been specified for this context,
only those faked metric group definitions of its manager object that
are in that list, are included in the... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L2995-L3020 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContext.get_metric_group_infos | def get_metric_group_infos(self):
"""
Get the faked metric group definitions for this context object
that are to be returned from its create operation, in the format
needed for the "Create Metrics Context" operation response.
Returns:
"metric-group-infos" JSON object ... | python | def get_metric_group_infos(self):
"""
Get the faked metric group definitions for this context object
that are to be returned from its create operation, in the format
needed for the "Create Metrics Context" operation response.
Returns:
"metric-group-infos" JSON object ... | Get the faked metric group definitions for this context object
that are to be returned from its create operation, in the format
needed for the "Create Metrics Context" operation response.
Returns:
"metric-group-infos" JSON object as described for the "Create Metrics
Conte... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L3022-L3047 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContext.get_metric_values | def get_metric_values(self):
"""
Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object.
Returns:
iterable of tuple (group_name, iterable of values): The faked
metrics, in the order they ... | python | def get_metric_values(self):
"""
Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object.
Returns:
iterable of tuple (group_name, iterable of values): The faked
metrics, in the order they ... | Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object.
Returns:
iterable of tuple (group_name, iterable of values): The faked
metrics, in the order they had been added, where:
group_name (s... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L3049-L3075 |
zhmcclient/python-zhmcclient | zhmcclient_mock/_hmc.py | FakedMetricsContext.get_metric_values_response | def get_metric_values_response(self):
"""
Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object, as a
string in the format needed for the "Get Metrics" operation response.
Returns:
"MetricsR... | python | def get_metric_values_response(self):
"""
Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object, as a
string in the format needed for the "Get Metrics" operation response.
Returns:
"MetricsR... | Get the faked metrics, for all metric groups and all resources that
have been prepared on the manager object of this context object, as a
string in the format needed for the "Get Metrics" operation response.
Returns:
"MetricsResponse" string as described for the "Get Metrics"
... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient_mock/_hmc.py#L3077-L3110 |
zhmcclient/python-zhmcclient | zhmcclient/_user_role.py | UserRoleManager.create | def create(self, properties):
"""
Create a new (user-defined) User Role in this HMC.
Authorization requirements:
* Task permission to the "Manage User Roles" task.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined i... | python | def create(self, properties):
"""
Create a new (user-defined) User Role in this HMC.
Authorization requirements:
* Task permission to the "Manage User Roles" task.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined i... | Create a new (user-defined) User Role in this HMC.
Authorization requirements:
* Task permission to the "Manage User Roles" task.
Parameters:
properties (dict): Initial property values.
Allowable properties are defined in section 'Request body contents'
in s... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_user_role.py#L148-L186 |
zhmcclient/python-zhmcclient | zhmcclient/_user_role.py | UserRole.add_permission | def add_permission(self, permitted_object, include_members=False,
view_only=True):
"""
Add permission for the specified permitted object(s) to this User Role,
thereby granting that permission to all users that have this User Role.
The granted permission depends on... | python | def add_permission(self, permitted_object, include_members=False,
view_only=True):
"""
Add permission for the specified permitted object(s) to this User Role,
thereby granting that permission to all users that have this User Role.
The granted permission depends on... | Add permission for the specified permitted object(s) to this User Role,
thereby granting that permission to all users that have this User Role.
The granted permission depends on the resource class of the permitted
object(s):
* For Task resources, the granted permission is task permissi... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_user_role.py#L276-L349 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolumeManager.create | def create(self, properties, email_to_addresses=None,
email_cc_addresses=None, email_insert=None):
"""
Create a :term:`storage volume` in this storage group on the HMC, and
optionally send emails to storage administrators requesting creation of
the storage volume on the st... | python | def create(self, properties, email_to_addresses=None,
email_cc_addresses=None, email_insert=None):
"""
Create a :term:`storage volume` in this storage group on the HMC, and
optionally send emails to storage administrators requesting creation of
the storage volume on the st... | Create a :term:`storage volume` in this storage group on the HMC, and
optionally send emails to storage administrators requesting creation of
the storage volume on the storage subsystem and setup of any resources
related to the storage volume (e.g. LUN mask definition on the storage
subs... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L174-L287 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolume.oid | def oid(self):
"""
:term `unicode string`: The object ID of this storage volume.
The object ID is unique within the parent storage group.
Note that for storage volumes, the 'name' property is not unique and
therefore cannot be used to identify a storage volume. Therefore,
... | python | def oid(self):
"""
:term `unicode string`: The object ID of this storage volume.
The object ID is unique within the parent storage group.
Note that for storage volumes, the 'name' property is not unique and
therefore cannot be used to identify a storage volume. Therefore,
... | :term `unicode string`: The object ID of this storage volume.
The object ID is unique within the parent storage group.
Note that for storage volumes, the 'name' property is not unique and
therefore cannot be used to identify a storage volume. Therefore,
storage volumes provide easy acce... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L319-L332 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolume.delete | def delete(self, email_to_addresses=None, email_cc_addresses=None,
email_insert=None):
"""
Delete this storage volume on the HMC, and optionally send emails to
storage administrators requesting deletion of the storage volume on the
storage subsystem and cleanup of any reso... | python | def delete(self, email_to_addresses=None, email_cc_addresses=None,
email_insert=None):
"""
Delete this storage volume on the HMC, and optionally send emails to
storage administrators requesting deletion of the storage volume on the
storage subsystem and cleanup of any reso... | Delete this storage volume on the HMC, and optionally send emails to
storage administrators requesting deletion of the storage volume on the
storage subsystem and cleanup of any resources related to the storage
volume (e.g. LUN mask definitions on a storage subsystem).
This method perfo... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L335-L408 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolume.update_properties | def update_properties(self, properties, email_to_addresses=None,
email_cc_addresses=None, email_insert=None):
"""
Update writeable properties of this storage volume on the HMC, and
optionally send emails to storage administrators requesting
modification of the s... | python | def update_properties(self, properties, email_to_addresses=None,
email_cc_addresses=None, email_insert=None):
"""
Update writeable properties of this storage volume on the HMC, and
optionally send emails to storage administrators requesting
modification of the s... | Update writeable properties of this storage volume on the HMC, and
optionally send emails to storage administrators requesting
modification of the storage volume on the storage subsystem and of any
resources related to the storage volume.
This method performs the "Modify Storage Group P... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L411-L493 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolume.indicate_fulfillment_ficon | def indicate_fulfillment_ficon(self, control_unit, unit_address):
"""
TODO: Add ControlUnit objects etc for FICON support.
Indicate completion of :term:`fulfillment` for this ECKD (=FICON)
storage volume and provide identifying information (control unit
and unit address) about t... | python | def indicate_fulfillment_ficon(self, control_unit, unit_address):
"""
TODO: Add ControlUnit objects etc for FICON support.
Indicate completion of :term:`fulfillment` for this ECKD (=FICON)
storage volume and provide identifying information (control unit
and unit address) about t... | TODO: Add ControlUnit objects etc for FICON support.
Indicate completion of :term:`fulfillment` for this ECKD (=FICON)
storage volume and provide identifying information (control unit
and unit address) about the actual storage volume on the storage
subsystem.
Manually indicatin... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L496-L554 |
zhmcclient/python-zhmcclient | zhmcclient/_storage_volume.py | StorageVolume.indicate_fulfillment_fcp | def indicate_fulfillment_fcp(self, wwpn, lun, host_port):
"""
Indicate completion of :term:`fulfillment` for this FCP storage volume
and provide identifying information (WWPN and LUN) about the actual
storage volume on the storage subsystem.
Manually indicating fulfillment is re... | python | def indicate_fulfillment_fcp(self, wwpn, lun, host_port):
"""
Indicate completion of :term:`fulfillment` for this FCP storage volume
and provide identifying information (WWPN and LUN) about the actual
storage volume on the storage subsystem.
Manually indicating fulfillment is re... | Indicate completion of :term:`fulfillment` for this FCP storage volume
and provide identifying information (WWPN and LUN) about the actual
storage volume on the storage subsystem.
Manually indicating fulfillment is required for storage volumes that
will be used as boot devices for a par... | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_storage_volume.py#L557-L626 |
zhmcclient/python-zhmcclient | zhmcclient/_exceptions.py | ReadTimeout.str_def | def str_def(self):
"""
:term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; read_timeout={}; read_retries={}; message={};
"""
return "classname={!r}; read_timeout={!r};... | python | def str_def(self):
"""
:term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; read_timeout={}; read_retries={}; message={};
"""
return "classname={!r}; read_timeout={!r};... | :term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; read_timeout={}; read_retries={}; message={}; | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_exceptions.py#L258-L270 |
zhmcclient/python-zhmcclient | zhmcclient/_exceptions.py | RetriesExceeded.str_def | def str_def(self):
"""
:term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; connect_retries={}; message={};
"""
return "classname={!r}; connect_retries={!r}; message={!... | python | def str_def(self):
"""
:term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; connect_retries={}; message={};
"""
return "classname={!r}; connect_retries={!r}; message={!... | :term:`string`: The exception as a string in a Python definition-style
format, e.g. for parsing by scripts:
.. code-block:: text
classname={}; connect_retries={}; message={}; | https://github.com/zhmcclient/python-zhmcclient/blob/9657563e5d9184c51d3c903442a58b9725fdf335/zhmcclient/_exceptions.py#L322-L332 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.