repository_name stringlengths 7 55 | func_path_in_repository stringlengths 4 223 | func_name stringlengths 1 134 | whole_func_string stringlengths 75 104k | language stringclasses 1
value | func_code_string stringlengths 75 104k | func_code_tokens listlengths 19 28.4k | func_documentation_string stringlengths 1 46.9k | func_documentation_tokens listlengths 1 1.97k | split_name stringclasses 1
value | func_code_url stringlengths 87 315 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.list_shares | def list_shares(self, prefix=None, marker=None, num_results=None,
include_metadata=False, timeout=None):
'''
Returns a generator to list the shares under the specified account.
The generator will lazily follow the continuation tokens returned by
the service and stop ... | python | def list_shares(self, prefix=None, marker=None, num_results=None,
include_metadata=False, timeout=None):
'''
Returns a generator to list the shares under the specified account.
The generator will lazily follow the continuation tokens returned by
the service and stop ... | [
"def",
"list_shares",
"(",
"self",
",",
"prefix",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"num_results",
"=",
"None",
",",
"include_metadata",
"=",
"False",
",",
"timeout",
"=",
"None",
")",
":",
"include",
"=",
"'metadata'",
"if",
"include_metadata"... | Returns a generator to list the shares under the specified account.
The generator will lazily follow the continuation tokens returned by
the service and stop when all shares have been returned or num_results
is reached.
If num_results is specified and the account has more than that num... | [
"Returns",
"a",
"generator",
"to",
"list",
"the",
"shares",
"under",
"the",
"specified",
"account",
".",
"The",
"generator",
"will",
"lazily",
"follow",
"the",
"continuation",
"tokens",
"returned",
"by",
"the",
"service",
"and",
"stop",
"when",
"all",
"shares"... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L503-L537 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_share_properties | def get_share_properties(self, share_name, timeout=None):
'''
Returns all user-defined metadata and system properties for the
specified share. The data returned does not include the shares's
list of files or directories.
:param str share_name:
Name of existing share.... | python | def get_share_properties(self, share_name, timeout=None):
'''
Returns all user-defined metadata and system properties for the
specified share. The data returned does not include the shares's
list of files or directories.
:param str share_name:
Name of existing share.... | [
"def",
"get_share_properties",
"(",
"self",
",",
"share_name",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"request",
"=",
"HTTPRequest",
"(",
")",
"request",
".",
"method",
"=",
"'GET'",
"request",... | Returns all user-defined metadata and system properties for the
specified share. The data returned does not include the shares's
list of files or directories.
:param str share_name:
Name of existing share.
:param int timeout:
The timeout parameter is expressed in... | [
"Returns",
"all",
"user",
"-",
"defined",
"metadata",
"and",
"system",
"properties",
"for",
"the",
"specified",
"share",
".",
"The",
"data",
"returned",
"does",
"not",
"include",
"the",
"shares",
"s",
"list",
"of",
"files",
"or",
"directories",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L630-L654 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.set_share_properties | def set_share_properties(self, share_name, quota, timeout=None):
'''
Sets service-defined properties for the specified share.
:param str share_name:
Name of existing share.
:param int quota:
Specifies the maximum size of the share, in gigabytes. Must be
... | python | def set_share_properties(self, share_name, quota, timeout=None):
'''
Sets service-defined properties for the specified share.
:param str share_name:
Name of existing share.
:param int quota:
Specifies the maximum size of the share, in gigabytes. Must be
... | [
"def",
"set_share_properties",
"(",
"self",
",",
"share_name",
",",
"quota",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"_validate_not_none",
"(",
"'quota'",
",",
"quota",
")",
"request",
"=",
"HTT... | Sets service-defined properties for the specified share.
:param str share_name:
Name of existing share.
:param int quota:
Specifies the maximum size of the share, in gigabytes. Must be
greater than 0, and less than or equal to 5 TB (5120 GB).
:param int time... | [
"Sets",
"service",
"-",
"defined",
"properties",
"for",
"the",
"specified",
"share",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L656-L681 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_share_metadata | def get_share_metadata(self, share_name, timeout=None):
'''
Returns all user-defined metadata for the specified share.
:param str share_name:
Name of existing share.
:param int timeout:
The timeout parameter is expressed in seconds.
:return:
A... | python | def get_share_metadata(self, share_name, timeout=None):
'''
Returns all user-defined metadata for the specified share.
:param str share_name:
Name of existing share.
:param int timeout:
The timeout parameter is expressed in seconds.
:return:
A... | [
"def",
"get_share_metadata",
"(",
"self",
",",
"share_name",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"request",
"=",
"HTTPRequest",
"(",
")",
"request",
".",
"method",
"=",
"'GET'",
"request",
... | Returns all user-defined metadata for the specified share.
:param str share_name:
Name of existing share.
:param int timeout:
The timeout parameter is expressed in seconds.
:return:
A dictionary representing the share metadata name, value pairs.
:rtyp... | [
"Returns",
"all",
"user",
"-",
"defined",
"metadata",
"for",
"the",
"specified",
"share",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L683-L707 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_share_stats | def get_share_stats(self, share_name, timeout=None):
'''
Gets the approximate size of the data stored on the share,
rounded up to the nearest gigabyte.
Note that this value may not include all recently created
or recently resized files.
:param str share_name:
... | python | def get_share_stats(self, share_name, timeout=None):
'''
Gets the approximate size of the data stored on the share,
rounded up to the nearest gigabyte.
Note that this value may not include all recently created
or recently resized files.
:param str share_name:
... | [
"def",
"get_share_stats",
"(",
"self",
",",
"share_name",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"request",
"=",
"HTTPRequest",
"(",
")",
"request",
".",
"method",
"=",
"'GET'",
"request",
".... | Gets the approximate size of the data stored on the share,
rounded up to the nearest gigabyte.
Note that this value may not include all recently created
or recently resized files.
:param str share_name:
Name of existing share.
:param int timeout:
... | [
"Gets",
"the",
"approximate",
"size",
"of",
"the",
"data",
"stored",
"on",
"the",
"share",
"rounded",
"up",
"to",
"the",
"nearest",
"gigabyte",
".",
"Note",
"that",
"this",
"value",
"may",
"not",
"include",
"all",
"recently",
"created",
"or",
"recently",
"... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L794-L821 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.list_directories_and_files | def list_directories_and_files(self, share_name, directory_name=None,
num_results=None, marker=None, timeout=None):
'''
Returns a generator to list the directories and files under the specified share.
The generator will lazily follow the continuation tokens re... | python | def list_directories_and_files(self, share_name, directory_name=None,
num_results=None, marker=None, timeout=None):
'''
Returns a generator to list the directories and files under the specified share.
The generator will lazily follow the continuation tokens re... | [
"def",
"list_directories_and_files",
"(",
"self",
",",
"share_name",
",",
"directory_name",
"=",
"None",
",",
"num_results",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"args",
"=",
"(",
"share_name",
",",
"directory_name"... | Returns a generator to list the directories and files under the specified share.
The generator will lazily follow the continuation tokens returned by
the service and stop when all directories and files have been returned or
num_results is reached.
If num_results is specified and the sha... | [
"Returns",
"a",
"generator",
"to",
"list",
"the",
"directories",
"and",
"files",
"under",
"the",
"specified",
"share",
".",
"The",
"generator",
"will",
"lazily",
"follow",
"the",
"continuation",
"tokens",
"returned",
"by",
"the",
"service",
"and",
"stop",
"whe... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1046-L1082 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService._list_directories_and_files | def _list_directories_and_files(self, share_name, directory_name=None,
marker=None, max_results=None, timeout=None):
'''
Returns a list of the directories and files under the specified share.
:param str share_name:
Name of existing share.
... | python | def _list_directories_and_files(self, share_name, directory_name=None,
marker=None, max_results=None, timeout=None):
'''
Returns a list of the directories and files under the specified share.
:param str share_name:
Name of existing share.
... | [
"def",
"_list_directories_and_files",
"(",
"self",
",",
"share_name",
",",
"directory_name",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"max_results",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share... | Returns a list of the directories and files under the specified share.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str marker:
A string value that identifies the portion of the list
t... | [
"Returns",
"a",
"list",
"of",
"the",
"directories",
"and",
"files",
"under",
"the",
"specified",
"share",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1084-L1123 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.set_file_properties | def set_file_properties(self, share_name, directory_name, file_name,
content_settings, timeout=None):
'''
Sets system properties on the file. If one property is set for the
content_settings, all properties will be overriden.
:param str share_name:
... | python | def set_file_properties(self, share_name, directory_name, file_name,
content_settings, timeout=None):
'''
Sets system properties on the file. If one property is set for the
content_settings, all properties will be overriden.
:param str share_name:
... | [
"def",
"set_file_properties",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"content_settings",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"_validate_not_none",
"(",
"'f... | Sets system properties on the file. If one property is set for the
content_settings, all properties will be overriden.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
Name of e... | [
"Sets",
"system",
"properties",
"on",
"the",
"file",
".",
"If",
"one",
"property",
"is",
"set",
"for",
"the",
"content_settings",
"all",
"properties",
"will",
"be",
"overriden",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1218-L1249 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.copy_file | def copy_file(self, share_name, directory_name, file_name, copy_source,
metadata=None, timeout=None):
'''
Copies a blob or file to a destination file within the storage account.
:param str share_name:
Name of existing share.
:param str directory_name:
... | python | def copy_file(self, share_name, directory_name, file_name, copy_source,
metadata=None, timeout=None):
'''
Copies a blob or file to a destination file within the storage account.
:param str share_name:
Name of existing share.
:param str directory_name:
... | [
"def",
"copy_file",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"copy_source",
",",
"metadata",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"_validate_... | Copies a blob or file to a destination file within the storage account.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
Name of existing file.
:param str copy_source:
... | [
"Copies",
"a",
"blob",
"or",
"file",
"to",
"a",
"destination",
"file",
"within",
"the",
"storage",
"account",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1315-L1356 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.create_file | def create_file(self, share_name, directory_name, file_name,
content_length, content_settings=None, metadata=None,
timeout=None):
'''
Creates a new file.
See create_file_from_* for high level functions that handle the
creation and upload of large... | python | def create_file(self, share_name, directory_name, file_name,
content_length, content_settings=None, metadata=None,
timeout=None):
'''
Creates a new file.
See create_file_from_* for high level functions that handle the
creation and upload of large... | [
"def",
"create_file",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"content_length",
",",
"content_settings",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_... | Creates a new file.
See create_file_from_* for high level functions that handle the
creation and upload of large files with automatic chunking and
progress notifications.
:param str share_name:
Name of existing share.
:param str directory_name:
The path ... | [
"Creates",
"a",
"new",
"file",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1417-L1459 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.create_file_from_text | def create_file_from_text(self, share_name, directory_name, file_name,
text, encoding='utf-8', content_settings=None,
metadata=None, timeout=None):
'''
Creates a new file from str/unicode, or updates the content of an
existing file, with aut... | python | def create_file_from_text(self, share_name, directory_name, file_name,
text, encoding='utf-8', content_settings=None,
metadata=None, timeout=None):
'''
Creates a new file from str/unicode, or updates the content of an
existing file, with aut... | [
"def",
"create_file_from_text",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"text",
",",
"encoding",
"=",
"'utf-8'",
",",
"content_settings",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
... | Creates a new file from str/unicode, or updates the content of an
existing file, with automatic chunking and progress notifications.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
... | [
"Creates",
"a",
"new",
"file",
"from",
"str",
"/",
"unicode",
"or",
"updates",
"the",
"content",
"of",
"an",
"existing",
"file",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1513-L1550 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.create_file_from_bytes | def create_file_from_bytes(
self, share_name, directory_name, file_name, file,
index=0, count=None, content_settings=None, metadata=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Creates a new file from an array of bytes... | python | def create_file_from_bytes(
self, share_name, directory_name, file_name, file,
index=0, count=None, content_settings=None, metadata=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Creates a new file from an array of bytes... | [
"def",
"create_file_from_bytes",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"file",
",",
"index",
"=",
"0",
",",
"count",
"=",
"None",
",",
"content_settings",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"progress_callb... | Creates a new file from an array of bytes, or updates the content
of an existing file, with automatic chunking and progress
notifications.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file... | [
"Creates",
"a",
"new",
"file",
"from",
"an",
"array",
"of",
"bytes",
"or",
"updates",
"the",
"content",
"of",
"an",
"existing",
"file",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1552-L1617 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.create_file_from_stream | def create_file_from_stream(
self, share_name, directory_name, file_name, stream, count,
content_settings=None, metadata=None, progress_callback=None,
max_connections=1, max_retries=5, retry_wait=1.0, timeout=None):
'''
Creates a new file from a file/stream, or updates the conten... | python | def create_file_from_stream(
self, share_name, directory_name, file_name, stream, count,
content_settings=None, metadata=None, progress_callback=None,
max_connections=1, max_retries=5, retry_wait=1.0, timeout=None):
'''
Creates a new file from a file/stream, or updates the conten... | [
"def",
"create_file_from_stream",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"stream",
",",
"count",
",",
"content_settings",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"progress_callback",
"=",
"None",
",",
"max_connectio... | Creates a new file from a file/stream, or updates the content of an
existing file, with automatic chunking and progress notifications.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
... | [
"Creates",
"a",
"new",
"file",
"from",
"a",
"file",
"/",
"stream",
"or",
"updates",
"the",
"content",
"of",
"an",
"existing",
"file",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1619-L1695 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService._get_file | def _get_file(self, share_name, directory_name, file_name,
start_range=None, end_range=None,
range_get_content_md5=None, timeout=None):
'''
Downloads a file's content, metadata, and properties. You can specify a
range if you don't need to download the file in it... | python | def _get_file(self, share_name, directory_name, file_name,
start_range=None, end_range=None,
range_get_content_md5=None, timeout=None):
'''
Downloads a file's content, metadata, and properties. You can specify a
range if you don't need to download the file in it... | [
"def",
"_get_file",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"range_get_content_md5",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",... | Downloads a file's content, metadata, and properties. You can specify a
range if you don't need to download the file in its entirety. If no range
is specified, the full file will be downloaded.
See get_file_to_* for high level functions that handle the download
of large files with autom... | [
"Downloads",
"a",
"file",
"s",
"content",
"metadata",
"and",
"properties",
".",
"You",
"can",
"specify",
"a",
"range",
"if",
"you",
"don",
"t",
"need",
"to",
"download",
"the",
"file",
"in",
"its",
"entirety",
".",
"If",
"no",
"range",
"is",
"specified",... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1697-L1749 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_file_to_path | def get_file_to_path(self, share_name, directory_name, file_name, file_path,
open_mode='wb', start_range=None, end_range=None,
range_get_content_md5=None, progress_callback=None,
max_connections=1, max_retries=5, retry_wait=1.0, timeout=None):
... | python | def get_file_to_path(self, share_name, directory_name, file_name, file_path,
open_mode='wb', start_range=None, end_range=None,
range_get_content_md5=None, progress_callback=None,
max_connections=1, max_retries=5, retry_wait=1.0, timeout=None):
... | [
"def",
"get_file_to_path",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"file_path",
",",
"open_mode",
"=",
"'wb'",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"range_get_content_md5",
"=",
"None",
",",... | Downloads a file to a file path, with automatic chunking and progress
notifications. Returns an instance of File with properties and metadata.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_nam... | [
"Downloads",
"a",
"file",
"to",
"a",
"file",
"path",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
".",
"Returns",
"an",
"instance",
"of",
"File",
"with",
"properties",
"and",
"metadata",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1751-L1815 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_file_to_stream | def get_file_to_stream(
self, share_name, directory_name, file_name, stream,
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Downloads a file to a stream, with autom... | python | def get_file_to_stream(
self, share_name, directory_name, file_name, stream,
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Downloads a file to a stream, with autom... | [
"def",
"get_file_to_stream",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"stream",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"range_get_content_md5",
"=",
"None",
",",
"progress_callback",
"=",
"None",... | Downloads a file to a stream, with automatic chunking and progress
notifications. Returns an instance of :class:`File` with properties
and metadata.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:para... | [
"Downloads",
"a",
"file",
"to",
"a",
"stream",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
".",
"Returns",
"an",
"instance",
"of",
":",
"class",
":",
"File",
"with",
"properties",
"and",
"metadata",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1817-L1925 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_file_to_bytes | def get_file_to_bytes(self, share_name, directory_name, file_name,
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Dow... | python | def get_file_to_bytes(self, share_name, directory_name, file_name,
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Dow... | [
"def",
"get_file_to_bytes",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"range_get_content_md5",
"=",
"None",
",",
"progress_callback",
"=",
"None",
",",
"max_conne... | Downloads a file as an array of bytes, with automatic chunking and
progress notifications. Returns an instance of :class:`File` with
properties, metadata, and content.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the direc... | [
"Downloads",
"a",
"file",
"as",
"an",
"array",
"of",
"bytes",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
".",
"Returns",
"an",
"instance",
"of",
":",
"class",
":",
"File",
"with",
"properties",
"metadata",
"and",
"content",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1927-L1995 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.get_file_to_text | def get_file_to_text(
self, share_name, directory_name, file_name, encoding='utf-8',
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Downloads a file as unicode text... | python | def get_file_to_text(
self, share_name, directory_name, file_name, encoding='utf-8',
start_range=None, end_range=None, range_get_content_md5=None,
progress_callback=None, max_connections=1, max_retries=5,
retry_wait=1.0, timeout=None):
'''
Downloads a file as unicode text... | [
"def",
"get_file_to_text",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"encoding",
"=",
"'utf-8'",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"range_get_content_md5",
"=",
"None",
",",
"progress_callbac... | Downloads a file as unicode text, with automatic chunking and progress
notifications. Returns an instance of :class:`File` with properties,
metadata, and content.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.... | [
"Downloads",
"a",
"file",
"as",
"unicode",
"text",
"with",
"automatic",
"chunking",
"and",
"progress",
"notifications",
".",
"Returns",
"an",
"instance",
"of",
":",
"class",
":",
"File",
"with",
"properties",
"metadata",
"and",
"content",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L1997-L2067 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.update_range | def update_range(self, share_name, directory_name, file_name, data,
start_range, end_range, content_md5=None, timeout=None):
'''
Writes the bytes specified by the request body into the specified range.
:param str share_name:
Name of existing share.
... | python | def update_range(self, share_name, directory_name, file_name, data,
start_range, end_range, content_md5=None, timeout=None):
'''
Writes the bytes specified by the request body into the specified range.
:param str share_name:
Name of existing share.
... | [
"def",
"update_range",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"data",
",",
"start_range",
",",
"end_range",
",",
"content_md5",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'"... | Writes the bytes specified by the request body into the specified range.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
Name of existing file.
:param bytes data:
... | [
"Writes",
"the",
"bytes",
"specified",
"by",
"the",
"request",
"body",
"into",
"the",
"specified",
"range",
".",
":",
"param",
"str",
"share_name",
":",
"Name",
"of",
"existing",
"share",
".",
":",
"param",
"str",
"directory_name",
":",
"The",
"path",
"to"... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L2069-L2121 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.clear_range | def clear_range(self, share_name, directory_name, file_name, start_range,
end_range, timeout=None):
'''
Clears the specified range and releases the space used in storage for
that range.
:param str share_name:
Name of existing share.
:par... | python | def clear_range(self, share_name, directory_name, file_name, start_range,
end_range, timeout=None):
'''
Clears the specified range and releases the space used in storage for
that range.
:param str share_name:
Name of existing share.
:par... | [
"def",
"clear_range",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"start_range",
",",
"end_range",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
")",
"_validate_not_none",
"... | Clears the specified range and releases the space used in storage for
that range.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
Name of existing file.
:para... | [
"Clears",
"the",
"specified",
"range",
"and",
"releases",
"the",
"space",
"used",
"in",
"storage",
"for",
"that",
"range",
".",
":",
"param",
"str",
"share_name",
":",
"Name",
"of",
"existing",
"share",
".",
":",
"param",
"str",
"directory_name",
":",
"The... | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L2123-L2165 |
Azure/azure-multiapi-storage-python | azure/multiapi/storage/v2015_04_05/file/fileservice.py | FileService.list_ranges | def list_ranges(self, share_name, directory_name, file_name,
start_range=None, end_range=None, timeout=None):
'''
Retrieves the valid ranges for a file.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the ... | python | def list_ranges(self, share_name, directory_name, file_name,
start_range=None, end_range=None, timeout=None):
'''
Retrieves the valid ranges for a file.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the ... | [
"def",
"list_ranges",
"(",
"self",
",",
"share_name",
",",
"directory_name",
",",
"file_name",
",",
"start_range",
"=",
"None",
",",
"end_range",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"_validate_not_none",
"(",
"'share_name'",
",",
"share_name",
... | Retrieves the valid ranges for a file.
:param str share_name:
Name of existing share.
:param str directory_name:
The path to the directory.
:param str file_name:
Name of existing file.
:param int start_range:
Specifies the start offset of ... | [
"Retrieves",
"the",
"valid",
"ranges",
"for",
"a",
"file",
"."
] | train | https://github.com/Azure/azure-multiapi-storage-python/blob/bd5482547f993c6eb56fd09070e15c2e9616e440/azure/multiapi/storage/v2015_04_05/file/fileservice.py#L2167-L2210 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations._get_sushy_system | def _get_sushy_system(self, system_id):
"""Get the sushy system for system_id
:param system_id: The identity of the System resource
:returns: the Sushy system instance
:raises: IloError
"""
system_url = parse.urljoin(self._sushy.get_system_collection_path(),
... | python | def _get_sushy_system(self, system_id):
"""Get the sushy system for system_id
:param system_id: The identity of the System resource
:returns: the Sushy system instance
:raises: IloError
"""
system_url = parse.urljoin(self._sushy.get_system_collection_path(),
... | [
"def",
"_get_sushy_system",
"(",
"self",
",",
"system_id",
")",
":",
"system_url",
"=",
"parse",
".",
"urljoin",
"(",
"self",
".",
"_sushy",
".",
"get_system_collection_path",
"(",
")",
",",
"system_id",
")",
"try",
":",
"return",
"self",
".",
"_sushy",
".... | Get the sushy system for system_id
:param system_id: The identity of the System resource
:returns: the Sushy system instance
:raises: IloError | [
"Get",
"the",
"sushy",
"system",
"for",
"system_id"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L167-L183 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations._get_sushy_manager | def _get_sushy_manager(self, manager_id):
"""Get the sushy Manager for manager_id
:param manager_id: The identity of the Manager resource
:returns: the Sushy Manager instance
:raises: IloError
"""
manager_url = parse.urljoin(self._sushy.get_manager_collection_path(),
... | python | def _get_sushy_manager(self, manager_id):
"""Get the sushy Manager for manager_id
:param manager_id: The identity of the Manager resource
:returns: the Sushy Manager instance
:raises: IloError
"""
manager_url = parse.urljoin(self._sushy.get_manager_collection_path(),
... | [
"def",
"_get_sushy_manager",
"(",
"self",
",",
"manager_id",
")",
":",
"manager_url",
"=",
"parse",
".",
"urljoin",
"(",
"self",
".",
"_sushy",
".",
"get_manager_collection_path",
"(",
")",
",",
"manager_id",
")",
"try",
":",
"return",
"self",
".",
"_sushy",... | Get the sushy Manager for manager_id
:param manager_id: The identity of the Manager resource
:returns: the Sushy Manager instance
:raises: IloError | [
"Get",
"the",
"sushy",
"Manager",
"for",
"manager_id"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L185-L201 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_host_power_status | def get_host_power_status(self):
"""Request the power state of the server.
:returns: Power State of the server, 'ON' or 'OFF'
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
return GET_POWER_STATE_MAP.get(sushy_syste... | python | def get_host_power_status(self):
"""Request the power state of the server.
:returns: Power State of the server, 'ON' or 'OFF'
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
return GET_POWER_STATE_MAP.get(sushy_syste... | [
"def",
"get_host_power_status",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"return",
"GET_POWER_STATE_MAP",
".",
"get",
"(",
"sushy_system",
".",
"power_state",
")"
] | Request the power state of the server.
:returns: Power State of the server, 'ON' or 'OFF'
:raises: IloError, on an error from iLO. | [
"Request",
"the",
"power",
"state",
"of",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L212-L219 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.reset_server | def reset_server(self):
"""Resets the server.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.reset_system(sushy.RESET_FORCE_RESTART)
except sushy.exceptions.SushyError as e:
... | python | def reset_server(self):
"""Resets the server.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.reset_system(sushy.RESET_FORCE_RESTART)
except sushy.exceptions.SushyError as e:
... | [
"def",
"reset_server",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"sushy_system",
".",
"reset_system",
"(",
"sushy",
".",
"RESET_FORCE_RESTART",
")",
"except",
"sushy",
".",
"exceptio... | Resets the server.
:raises: IloError, on an error from iLO. | [
"Resets",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L221-L234 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_host_power | def set_host_power(self, target_value):
"""Sets the power state of the system.
:param target_value: The target value to be set. Value can be:
'ON' or 'OFF'.
:raises: IloError, on an error from iLO.
:raises: InvalidInputError, if the target value is not
allowed.
... | python | def set_host_power(self, target_value):
"""Sets the power state of the system.
:param target_value: The target value to be set. Value can be:
'ON' or 'OFF'.
:raises: IloError, on an error from iLO.
:raises: InvalidInputError, if the target value is not
allowed.
... | [
"def",
"set_host_power",
"(",
"self",
",",
"target_value",
")",
":",
"if",
"target_value",
"not",
"in",
"POWER_RESET_MAP",
":",
"msg",
"=",
"(",
"'The parameter \"%(parameter)s\" value \"%(target_value)s\" is '",
"'invalid. Valid values are: %(valid_power_values)s'",
"%",
"{"... | Sets the power state of the system.
:param target_value: The target value to be set. Value can be:
'ON' or 'OFF'.
:raises: IloError, on an error from iLO.
:raises: InvalidInputError, if the target value is not
allowed. | [
"Sets",
"the",
"power",
"state",
"of",
"the",
"system",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L236-L267 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.press_pwr_btn | def press_pwr_btn(self):
"""Simulates a physical press of the server power button.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.push_power_button(sys_cons.PUSH_POWER_BUTTON_PRESS)
exc... | python | def press_pwr_btn(self):
"""Simulates a physical press of the server power button.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.push_power_button(sys_cons.PUSH_POWER_BUTTON_PRESS)
exc... | [
"def",
"press_pwr_btn",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"sushy_system",
".",
"push_power_button",
"(",
"sys_cons",
".",
"PUSH_POWER_BUTTON_PRESS",
")",
"except",
"sushy",
"."... | Simulates a physical press of the server power button.
:raises: IloError, on an error from iLO. | [
"Simulates",
"a",
"physical",
"press",
"of",
"the",
"server",
"power",
"button",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L269-L282 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.activate_license | def activate_license(self, key):
"""Activates iLO license.
:param key: iLO license key.
:raises: IloError, on an error from iLO.
"""
sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
try:
sushy_manager.set_license(key)
except sushy.exceptio... | python | def activate_license(self, key):
"""Activates iLO license.
:param key: iLO license key.
:raises: IloError, on an error from iLO.
"""
sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
try:
sushy_manager.set_license(key)
except sushy.exceptio... | [
"def",
"activate_license",
"(",
"self",
",",
"key",
")",
":",
"sushy_manager",
"=",
"self",
".",
"_get_sushy_manager",
"(",
"PROLIANT_MANAGER_ID",
")",
"try",
":",
"sushy_manager",
".",
"set_license",
"(",
"key",
")",
"except",
"sushy",
".",
"exceptions",
".",... | Activates iLO license.
:param key: iLO license key.
:raises: IloError, on an error from iLO. | [
"Activates",
"iLO",
"license",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L300-L314 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_one_time_boot | def get_one_time_boot(self):
"""Retrieves the current setting for the one time boot.
:returns: Returns boot device that would be used in next
boot. Returns 'Normal' if no device is set.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
if (sushy_sys... | python | def get_one_time_boot(self):
"""Retrieves the current setting for the one time boot.
:returns: Returns boot device that would be used in next
boot. Returns 'Normal' if no device is set.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
if (sushy_sys... | [
"def",
"get_one_time_boot",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"if",
"(",
"sushy_system",
".",
"boot",
".",
"enabled",
"==",
"sushy",
".",
"BOOT_SOURCE_ENABLED_ONCE",
")",
":",
"return",
... | Retrieves the current setting for the one time boot.
:returns: Returns boot device that would be used in next
boot. Returns 'Normal' if no device is set. | [
"Retrieves",
"the",
"current",
"setting",
"for",
"the",
"one",
"time",
"boot",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L316-L327 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_pending_boot_mode | def get_pending_boot_mode(self):
"""Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
... | python | def get_pending_boot_mode(self):
"""Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
... | [
"def",
"get_pending_boot_mode",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"return",
"BOOT_MODE_MAP",
".",
"get",
"(",
"sushy_system",
".",
"bios_settings",
".",
"pending_settings",
"."... | Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO. | [
"Retrieves",
"the",
"pending",
"boot",
"mode",
"of",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L329-L345 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations._validate_virtual_media | def _validate_virtual_media(self, device):
"""Check if the device is valid device.
:param device: virtual media device
:raises: IloInvalidInputError, if the device is not valid.
"""
if device not in VIRTUAL_MEDIA_MAP:
msg = (self._("Invalid device '%s'. Valid devices... | python | def _validate_virtual_media(self, device):
"""Check if the device is valid device.
:param device: virtual media device
:raises: IloInvalidInputError, if the device is not valid.
"""
if device not in VIRTUAL_MEDIA_MAP:
msg = (self._("Invalid device '%s'. Valid devices... | [
"def",
"_validate_virtual_media",
"(",
"self",
",",
"device",
")",
":",
"if",
"device",
"not",
"in",
"VIRTUAL_MEDIA_MAP",
":",
"msg",
"=",
"(",
"self",
".",
"_",
"(",
"\"Invalid device '%s'. Valid devices: FLOPPY or \"",
"\"CDROM.\"",
")",
"%",
"device",
")",
"L... | Check if the device is valid device.
:param device: virtual media device
:raises: IloInvalidInputError, if the device is not valid. | [
"Check",
"if",
"the",
"device",
"is",
"valid",
"device",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L363-L374 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.eject_virtual_media | def eject_virtual_media(self, device):
"""Ejects the Virtual Media image if one is inserted.
:param device: virual media device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the device is not valid.
"""
self._validate_virtual_media(device)
... | python | def eject_virtual_media(self, device):
"""Ejects the Virtual Media image if one is inserted.
:param device: virual media device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the device is not valid.
"""
self._validate_virtual_media(device)
... | [
"def",
"eject_virtual_media",
"(",
"self",
",",
"device",
")",
":",
"self",
".",
"_validate_virtual_media",
"(",
"device",
")",
"manager",
"=",
"self",
".",
"_get_sushy_manager",
"(",
"PROLIANT_MANAGER_ID",
")",
"try",
":",
"vmedia_device",
"=",
"(",
"manager",
... | Ejects the Virtual Media image if one is inserted.
:param device: virual media device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the device is not valid. | [
"Ejects",
"the",
"Virtual",
"Media",
"image",
"if",
"one",
"is",
"inserted",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L376-L403 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_vm_status | def set_vm_status(self, device='FLOPPY',
boot_option='BOOT_ONCE', write_protect='YES'):
"""Sets the Virtual Media drive status
It sets the boot option for virtual media device.
Note: boot option can be set only for CD device.
:param device: virual media device
... | python | def set_vm_status(self, device='FLOPPY',
boot_option='BOOT_ONCE', write_protect='YES'):
"""Sets the Virtual Media drive status
It sets the boot option for virtual media device.
Note: boot option can be set only for CD device.
:param device: virual media device
... | [
"def",
"set_vm_status",
"(",
"self",
",",
"device",
"=",
"'FLOPPY'",
",",
"boot_option",
"=",
"'BOOT_ONCE'",
",",
"write_protect",
"=",
"'YES'",
")",
":",
"# CONNECT is a RIBCL call. There is no such property to set in Redfish.",
"if",
"boot_option",
"==",
"'CONNECT'",
... | Sets the Virtual Media drive status
It sets the boot option for virtual media device.
Note: boot option can be set only for CD device.
:param device: virual media device
:param boot_option: boot option to set on the virtual media device
:param write_protect: set the write prote... | [
"Sets",
"the",
"Virtual",
"Media",
"drive",
"status"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L434-L471 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.update_firmware | def update_firmware(self, file_url, component_type):
"""Updates the given firmware on the server for the given component.
:param file_url: location of the raw firmware file. Extraction of the
firmware file (if in compact format) is expected to
happen pr... | python | def update_firmware(self, file_url, component_type):
"""Updates the given firmware on the server for the given component.
:param file_url: location of the raw firmware file. Extraction of the
firmware file (if in compact format) is expected to
happen pr... | [
"def",
"update_firmware",
"(",
"self",
",",
"file_url",
",",
"component_type",
")",
":",
"try",
":",
"update_service_inst",
"=",
"self",
".",
"_sushy",
".",
"get_update_service",
"(",
")",
"update_service_inst",
".",
"flash_firmware",
"(",
"self",
",",
"file_url... | Updates the given firmware on the server for the given component.
:param file_url: location of the raw firmware file. Extraction of the
firmware file (if in compact format) is expected to
happen prior to this invocation.
:param component_type: Type of c... | [
"Updates",
"the",
"given",
"firmware",
"on",
"the",
"server",
"for",
"the",
"given",
"component",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L474-L491 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations._is_boot_mode_uefi | def _is_boot_mode_uefi(self):
"""Checks if the system is in uefi boot mode.
:return: 'True' if the boot mode is uefi else 'False'
"""
boot_mode = self.get_current_boot_mode()
return (boot_mode == BOOT_MODE_MAP.get(sys_cons.BIOS_BOOT_MODE_UEFI)) | python | def _is_boot_mode_uefi(self):
"""Checks if the system is in uefi boot mode.
:return: 'True' if the boot mode is uefi else 'False'
"""
boot_mode = self.get_current_boot_mode()
return (boot_mode == BOOT_MODE_MAP.get(sys_cons.BIOS_BOOT_MODE_UEFI)) | [
"def",
"_is_boot_mode_uefi",
"(",
"self",
")",
":",
"boot_mode",
"=",
"self",
".",
"get_current_boot_mode",
"(",
")",
"return",
"(",
"boot_mode",
"==",
"BOOT_MODE_MAP",
".",
"get",
"(",
"sys_cons",
".",
"BIOS_BOOT_MODE_UEFI",
")",
")"
] | Checks if the system is in uefi boot mode.
:return: 'True' if the boot mode is uefi else 'False' | [
"Checks",
"if",
"the",
"system",
"is",
"in",
"uefi",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L493-L499 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_persistent_boot_device | def get_persistent_boot_device(self):
"""Get current persistent boot device set for the host
:returns: persistent boot device for the system
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
# Return boot device if it ... | python | def get_persistent_boot_device(self):
"""Get current persistent boot device set for the host
:returns: persistent boot device for the system
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
# Return boot device if it ... | [
"def",
"get_persistent_boot_device",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"# Return boot device if it is persistent.",
"if",
"(",
"(",
"sushy_system",
".",
"boot",
".",
"enabled",
")",
"==",
"s... | Get current persistent boot device set for the host
:returns: persistent boot device for the system
:raises: IloError, on an error from iLO. | [
"Get",
"current",
"persistent",
"boot",
"device",
"set",
"for",
"the",
"host"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L501-L526 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_pending_boot_mode | def set_pending_boot_mode(self, boot_mode):
"""Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_sys... | python | def set_pending_boot_mode(self, boot_mode):
"""Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_sys... | [
"def",
"set_pending_boot_mode",
"(",
"self",
",",
"boot_mode",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"if",
"boot_mode",
".",
"upper",
"(",
")",
"not",
"in",
"BOOT_MODE_MAP_REV",
".",
"keys",
"(",
")",
... | Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO. | [
"Sets",
"the",
"boot",
"mode",
"of",
"the",
"system",
"for",
"next",
"boot",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L528-L552 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.update_persistent_boot | def update_persistent_boot(self, devices=[]):
"""Changes the persistent boot device order for the host
:param devices: ordered list of boot devices
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid.
"""
sushy_system =... | python | def update_persistent_boot(self, devices=[]):
"""Changes the persistent boot device order for the host
:param devices: ordered list of boot devices
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid.
"""
sushy_system =... | [
"def",
"update_persistent_boot",
"(",
"self",
",",
"devices",
"=",
"[",
"]",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"# Check if the input is valid",
"for",
"item",
"in",
"devices",
":",
"if",
"item",
".",... | Changes the persistent boot device order for the host
:param devices: ordered list of boot devices
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid. | [
"Changes",
"the",
"persistent",
"boot",
"device",
"order",
"for",
"the",
"host"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L554-L579 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_one_time_boot | def set_one_time_boot(self, device):
"""Configures a single boot from a specific device.
:param device: Device to be set as a one time boot device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid.
"""
sushy_system = ... | python | def set_one_time_boot(self, device):
"""Configures a single boot from a specific device.
:param device: Device to be set as a one time boot device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid.
"""
sushy_system = ... | [
"def",
"set_one_time_boot",
"(",
"self",
",",
"device",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"# Check if the input is valid",
"if",
"device",
".",
"upper",
"(",
")",
"not",
"in",
"DEVICE_COMMON_TO_REDFISH",... | Configures a single boot from a specific device.
:param device: Device to be set as a one time boot device
:raises: IloError, on an error from iLO.
:raises: IloInvalidInputError, if the given input is not valid. | [
"Configures",
"a",
"single",
"boot",
"from",
"a",
"specific",
"device",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L581-L605 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.reset_ilo_credential | def reset_ilo_credential(self, password):
"""Resets the iLO password.
:param password: The password to be set.
:raises: IloError, if account not found or on an error from iLO.
"""
try:
acc_service = self._sushy.get_account_service()
member = acc_service.a... | python | def reset_ilo_credential(self, password):
"""Resets the iLO password.
:param password: The password to be set.
:raises: IloError, if account not found or on an error from iLO.
"""
try:
acc_service = self._sushy.get_account_service()
member = acc_service.a... | [
"def",
"reset_ilo_credential",
"(",
"self",
",",
"password",
")",
":",
"try",
":",
"acc_service",
"=",
"self",
".",
"_sushy",
".",
"get_account_service",
"(",
")",
"member",
"=",
"acc_service",
".",
"accounts",
".",
"get_member_details",
"(",
"self",
".",
"_... | Resets the iLO password.
:param password: The password to be set.
:raises: IloError, if account not found or on an error from iLO. | [
"Resets",
"the",
"iLO",
"password",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L607-L627 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_supported_boot_mode | def get_supported_boot_mode(self):
"""Get the system supported boot modes.
:return: any one of the following proliantutils.ilo.constants:
SUPPORTED_BOOT_MODE_LEGACY_BIOS_ONLY,
SUPPORTED_BOOT_MODE_UEFI_ONLY,
SUPPORTED_BOOT_MODE_LEGACY_BIOS_AND_UEFI
:raises: I... | python | def get_supported_boot_mode(self):
"""Get the system supported boot modes.
:return: any one of the following proliantutils.ilo.constants:
SUPPORTED_BOOT_MODE_LEGACY_BIOS_ONLY,
SUPPORTED_BOOT_MODE_UEFI_ONLY,
SUPPORTED_BOOT_MODE_LEGACY_BIOS_AND_UEFI
:raises: I... | [
"def",
"get_supported_boot_mode",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"return",
"SUPPORTED_BOOT_MODE_MAP",
".",
"get",
"(",
"sushy_system",
".",
"supported_boot_mode",
")",
"except... | Get the system supported boot modes.
:return: any one of the following proliantutils.ilo.constants:
SUPPORTED_BOOT_MODE_LEGACY_BIOS_ONLY,
SUPPORTED_BOOT_MODE_UEFI_ONLY,
SUPPORTED_BOOT_MODE_LEGACY_BIOS_AND_UEFI
:raises: IloError, if account not found or on an error f... | [
"Get",
"the",
"system",
"supported",
"boot",
"modes",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L629-L647 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_server_capabilities | def get_server_capabilities(self):
"""Returns the server capabilities
raises: IloError on an error from iLO.
"""
capabilities = {}
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
try:
... | python | def get_server_capabilities(self):
"""Returns the server capabilities
raises: IloError on an error from iLO.
"""
capabilities = {}
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
sushy_manager = self._get_sushy_manager(PROLIANT_MANAGER_ID)
try:
... | [
"def",
"get_server_capabilities",
"(",
"self",
")",
":",
"capabilities",
"=",
"{",
"}",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"sushy_manager",
"=",
"self",
".",
"_get_sushy_manager",
"(",
"PROLIANT_MANAGER_ID",
")",
... | Returns the server capabilities
raises: IloError on an error from iLO. | [
"Returns",
"the",
"server",
"capabilities"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L649-L727 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.reset_bios_to_default | def reset_bios_to_default(self):
"""Resets the BIOS settings to default values.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.bios_settings.update_bios_to_default()
except sushy.except... | python | def reset_bios_to_default(self):
"""Resets the BIOS settings to default values.
:raises: IloError, on an error from iLO.
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
try:
sushy_system.bios_settings.update_bios_to_default()
except sushy.except... | [
"def",
"reset_bios_to_default",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"sushy_system",
".",
"bios_settings",
".",
"update_bios_to_default",
"(",
")",
"except",
"sushy",
".",
"except... | Resets the BIOS settings to default values.
:raises: IloError, on an error from iLO. | [
"Resets",
"the",
"BIOS",
"settings",
"to",
"default",
"values",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L729-L742 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_secure_boot_mode | def get_secure_boot_mode(self):
"""Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
sushy_system = self... | python | def get_secure_boot_mode(self):
"""Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
sushy_system = self... | [
"def",
"get_secure_boot_mode",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"secure_boot_enabled",
"=",
"GET_SECUREBOOT_CURRENT_BOOT_MAP",
".",
"get",
"(",
"sushy_system",
".",
"secure_boot",... | Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Get",
"the",
"status",
"of",
"secure",
"boot",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L744-L768 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_secure_boot_mode | def set_secure_boot_mode(self, secure_boot_enable):
"""Enable/Disable secure boot on the server.
Resetting the server post updating this settings is needed
from the caller side to make this into effect.
:param secure_boot_enable: True, if secure boot needs to be
enabled f... | python | def set_secure_boot_mode(self, secure_boot_enable):
"""Enable/Disable secure boot on the server.
Resetting the server post updating this settings is needed
from the caller side to make this into effect.
:param secure_boot_enable: True, if secure boot needs to be
enabled f... | [
"def",
"set_secure_boot_mode",
"(",
"self",
",",
"secure_boot_enable",
")",
":",
"if",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"sushy_system",
".",
"secu... | Enable/Disable secure boot on the server.
Resetting the server post updating this settings is needed
from the caller side to make this into effect.
:param secure_boot_enable: True, if secure boot needs to be
enabled for next boot, else False.
:raises: IloError, on an erro... | [
"Enable",
"/",
"Disable",
"secure",
"boot",
"on",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L777-L806 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.reset_secure_boot_keys | def reset_secure_boot_keys(self):
"""Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
sus... | python | def reset_secure_boot_keys(self):
"""Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
sus... | [
"def",
"reset_secure_boot_keys",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"sushy_system",
".",
"secure_boot",
".",
"reset_key... | Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Reset",
"secure",
"boot",
"keys",
"to",
"manufacturing",
"defaults",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L808-L829 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_essential_properties | def get_essential_properties(self):
"""Constructs the dictionary of essential properties
Constructs the dictionary of essential properties, named
cpu, cpu_arch, local_gb, memory_mb. The MACs are also returned
as part of this method.
"""
sushy_system = self._get_sushy_sys... | python | def get_essential_properties(self):
"""Constructs the dictionary of essential properties
Constructs the dictionary of essential properties, named
cpu, cpu_arch, local_gb, memory_mb. The MACs are also returned
as part of this method.
"""
sushy_system = self._get_sushy_sys... | [
"def",
"get_essential_properties",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"# TODO(nisha): Add local_gb here and return after",
"# local_gb changes are merged.",
"# local_gb = sushy_system.storage_s... | Constructs the dictionary of essential properties
Constructs the dictionary of essential properties, named
cpu, cpu_arch, local_gb, memory_mb. The MACs are also returned
as part of this method. | [
"Constructs",
"the",
"dictionary",
"of",
"essential",
"properties"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L854-L878 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations._change_iscsi_target_settings | def _change_iscsi_target_settings(self, iscsi_info):
"""Change iSCSI target settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO.
"""
su... | python | def _change_iscsi_target_settings(self, iscsi_info):
"""Change iSCSI target settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO.
"""
su... | [
"def",
"_change_iscsi_target_settings",
"(",
"self",
",",
"iscsi_info",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"pci_settings_map",
"=",
"(",
"sushy_system",
".",
"bios_settings",
".",
"bios_mappin... | Change iSCSI target settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO. | [
"Change",
"iSCSI",
"target",
"settings",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L880-L926 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_iscsi_info | def set_iscsi_info(self, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iSCSI details of the system in UEFI boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port et... | python | def set_iscsi_info(self, target_name, lun, ip_address,
port='3260', auth_method=None, username=None,
password=None):
"""Set iSCSI details of the system in UEFI boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port et... | [
"def",
"set_iscsi_info",
"(",
"self",
",",
"target_name",
",",
"lun",
",",
"ip_address",
",",
"port",
"=",
"'3260'",
",",
"auth_method",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"if",
"(",
"self",
".",
"_is_boo... | Set iSCSI details of the system in UEFI boot mode.
The initiator system is set with the target details like
IQN, LUN, IP, Port etc.
:param target_name: Target Name for iSCSI.
:param lun: logical unit number.
:param ip_address: IP address of the target.
:param port: port ... | [
"Set",
"iSCSI",
"details",
"of",
"the",
"system",
"in",
"UEFI",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L928-L960 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.unset_iscsi_info | def unset_iscsi_info(self):
"""Disable iSCSI boot option in UEFI boot mode.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
if(self._is_boot_mode_uefi()):
iscsi_info = {'iSCSIConnection': 'Disabled'}
self._... | python | def unset_iscsi_info(self):
"""Disable iSCSI boot option in UEFI boot mode.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
if(self._is_boot_mode_uefi()):
iscsi_info = {'iSCSIConnection': 'Disabled'}
self._... | [
"def",
"unset_iscsi_info",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
")",
":",
"iscsi_info",
"=",
"{",
"'iSCSIConnection'",
":",
"'Disabled'",
"}",
"self",
".",
"_change_iscsi_target_settings",
"(",
"iscsi_info",
")",
"else... | Disable iSCSI boot option in UEFI boot mode.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode. | [
"Disable",
"iSCSI",
"boot",
"option",
"in",
"UEFI",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L962-L973 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_iscsi_initiator_info | def set_iscsi_initiator_info(self, initiator_iqn):
"""Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
... | python | def set_iscsi_initiator_info(self, initiator_iqn):
"""Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
... | [
"def",
"set_iscsi_initiator_info",
"(",
"self",
",",
"initiator_iqn",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
")",
":",
"iscsi_data",
"=",
"{",
"'i... | Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode. | [
"Set",
"iSCSI",
"initiator",
"information",
"in",
"iLO",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L975-L997 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_iscsi_initiator_info | def get_iscsi_initiator_info(self):
"""Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
sushy_... | python | def get_iscsi_initiator_info(self):
"""Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
sushy_... | [
"def",
"get_iscsi_initiator_info",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
")",
":",
"try",
":",
"iscsi_initiator",
"=",
"(",
"sushy_s... | Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode. | [
"Give",
"iSCSI",
"initiator",
"information",
"of",
"iLO",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L999-L1021 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.inject_nmi | def inject_nmi(self):
"""Inject NMI, Non Maskable Interrupt.
Inject NMI (Non Maskable Interrupt) for a node immediately.
:raises: IloError, on an error from iLO
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
if sushy_system.power_state != sushy.SYSTEM_POW... | python | def inject_nmi(self):
"""Inject NMI, Non Maskable Interrupt.
Inject NMI (Non Maskable Interrupt) for a node immediately.
:raises: IloError, on an error from iLO
"""
sushy_system = self._get_sushy_system(PROLIANT_SYSTEM_ID)
if sushy_system.power_state != sushy.SYSTEM_POW... | [
"def",
"inject_nmi",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"if",
"sushy_system",
".",
"power_state",
"!=",
"sushy",
".",
"SYSTEM_POWER_STATE_ON",
":",
"raise",
"exception",
".",
"IloError",
... | Inject NMI, Non Maskable Interrupt.
Inject NMI (Non Maskable Interrupt) for a node immediately.
:raises: IloError, on an error from iLO | [
"Inject",
"NMI",
"Non",
"Maskable",
"Interrupt",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1023-L1040 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_host_post_state | def get_host_post_state(self):
"""Get the current state of system POST.
Retrieves current state of system POST.
:returns: POST state of the server. The valida states are:-
null, Unknown, Reset, PowerOff, InPost,
InPostDiscoveryComplete and FinishedPost.
... | python | def get_host_post_state(self):
"""Get the current state of system POST.
Retrieves current state of system POST.
:returns: POST state of the server. The valida states are:-
null, Unknown, Reset, PowerOff, InPost,
InPostDiscoveryComplete and FinishedPost.
... | [
"def",
"get_host_post_state",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"return",
"GET_POST_STATE_MAP",
".",
"get",
"(",
"sushy_system",
".",
"post_state",
")"
] | Get the current state of system POST.
Retrieves current state of system POST.
:returns: POST state of the server. The valida states are:-
null, Unknown, Reset, PowerOff, InPost,
InPostDiscoveryComplete and FinishedPost.
:raises: IloError, on an error from iL... | [
"Get",
"the",
"current",
"state",
"of",
"system",
"POST",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1042-L1053 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.read_raid_configuration | def read_raid_configuration(self, raid_config=None):
"""Read the logical drives from the system
:param raid_config: None in case of post-delete read or in case of
post-create a dictionary containing target raid
configuration data. This data stuctu... | python | def read_raid_configuration(self, raid_config=None):
"""Read the logical drives from the system
:param raid_config: None in case of post-delete read or in case of
post-create a dictionary containing target raid
configuration data. This data stuctu... | [
"def",
"read_raid_configuration",
"(",
"self",
",",
"raid_config",
"=",
"None",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"return",
"sushy_system",
".",
"read_raid",
"(",
"raid_config",
"=",
"raid_config",
")"... | Read the logical drives from the system
:param raid_config: None in case of post-delete read or in case of
post-create a dictionary containing target raid
configuration data. This data stucture should be as
follows:
... | [
"Read",
"the",
"logical",
"drives",
"from",
"the",
"system"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1055-L1070 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_current_bios_settings | def get_current_bios_settings(self, only_allowed_settings=True):
"""Get current BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictio... | python | def get_current_bios_settings(self, only_allowed_settings=True):
"""Get current BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictio... | [
"def",
"get_current_bios_settings",
"(",
"self",
",",
"only_allowed_settings",
"=",
"True",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"current_settings",
"=",
"sushy_system",
".",
"bios_settings",
".... | Get current BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictionary of current BIOS settings is returned. Depending
on the... | [
"Get",
"current",
"BIOS",
"settings",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1077-L1103 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.set_bios_settings | def set_bios_settings(self, data=None, only_allowed_settings=True):
"""Sets current BIOS settings to the provided data.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be set. If False, all the BIOS settings supported by
iLO and present in the ... | python | def set_bios_settings(self, data=None, only_allowed_settings=True):
"""Sets current BIOS settings to the provided data.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be set. If False, all the BIOS settings supported by
iLO and present in the ... | [
"def",
"set_bios_settings",
"(",
"self",
",",
"data",
"=",
"None",
",",
"only_allowed_settings",
"=",
"True",
")",
":",
"if",
"not",
"data",
":",
"raise",
"exception",
".",
"IloError",
"(",
"\"Could not apply settings with\"",
"\" empty data\"",
")",
"sushy_system... | Sets current BIOS settings to the provided data.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be set. If False, all the BIOS settings supported by
iLO and present in the 'data' are set.
:param: data: a dictionary of BIOS settings to be appli... | [
"Sets",
"current",
"BIOS",
"settings",
"to",
"the",
"provided",
"data",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1133-L1170 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_default_bios_settings | def get_default_bios_settings(self, only_allowed_settings=True):
"""Get default BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictio... | python | def get_default_bios_settings(self, only_allowed_settings=True):
"""Get default BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictio... | [
"def",
"get_default_bios_settings",
"(",
"self",
",",
"only_allowed_settings",
"=",
"True",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"settings",
"=",
"sushy_system",
".",
"bios_settings",
".",
"de... | Get default BIOS settings.
:param: only_allowed_settings: True when only allowed BIOS settings
are to be returned. If False, All the BIOS settings supported
by iLO are returned.
:return: a dictionary of default BIOS settings(factory settings).
Depending ... | [
"Get",
"default",
"BIOS",
"settings",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1172-L1196 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.create_raid_configuration | def create_raid_configuration(self, raid_config):
"""Create the raid configuration on the hardware.
Based on user raid_config input, it will create raid
:param raid_config: A dictionary containing target raid configuration
data. This data stucture should be as follo... | python | def create_raid_configuration(self, raid_config):
"""Create the raid configuration on the hardware.
Based on user raid_config input, it will create raid
:param raid_config: A dictionary containing target raid configuration
data. This data stucture should be as follo... | [
"def",
"create_raid_configuration",
"(",
"self",
",",
"raid_config",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"sushy_system",
".",
"create_raid",
"(",
"raid_config",
")"
] | Create the raid configuration on the hardware.
Based on user raid_config input, it will create raid
:param raid_config: A dictionary containing target raid configuration
data. This data stucture should be as follows:
raid_config = {'logical_disks... | [
"Create",
"the",
"raid",
"configuration",
"on",
"the",
"hardware",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1198-L1212 |
openstack/proliantutils | proliantutils/redfish/redfish.py | RedfishOperations.get_bios_settings_result | def get_bios_settings_result(self):
"""Gets the result of the bios settings applied
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is
not supported on the server.
"""
sushy_system = self._get_sushy_system(PROLIANT_S... | python | def get_bios_settings_result(self):
"""Gets the result of the bios settings applied
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is
not supported on the server.
"""
sushy_system = self._get_sushy_system(PROLIANT_S... | [
"def",
"get_bios_settings_result",
"(",
"self",
")",
":",
"sushy_system",
"=",
"self",
".",
"_get_sushy_system",
"(",
"PROLIANT_SYSTEM_ID",
")",
"try",
":",
"settings_result",
"=",
"sushy_system",
".",
"bios_settings",
".",
"messages",
"except",
"sushy",
".",
"exc... | Gets the result of the bios settings applied
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is
not supported on the server. | [
"Gets",
"the",
"result",
"of",
"the",
"bios",
"settings",
"applied"
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/redfish/redfish.py#L1214-L1231 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_collection | def _get_collection(self, collection_uri, request_headers=None):
"""Generator function that returns collection members."""
# get the collection
status, headers, thecollection = self._rest_get(collection_uri)
if status != 200:
msg = self._get_extended_error(thecollection)
... | python | def _get_collection(self, collection_uri, request_headers=None):
"""Generator function that returns collection members."""
# get the collection
status, headers, thecollection = self._rest_get(collection_uri)
if status != 200:
msg = self._get_extended_error(thecollection)
... | [
"def",
"_get_collection",
"(",
"self",
",",
"collection_uri",
",",
"request_headers",
"=",
"None",
")",
":",
"# get the collection",
"status",
",",
"headers",
",",
"thecollection",
"=",
"self",
".",
"_rest_get",
"(",
"collection_uri",
")",
"if",
"status",
"!=",
... | Generator function that returns collection members. | [
"Generator",
"function",
"that",
"returns",
"collection",
"members",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L77-L134 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_type | def _get_type(self, obj):
"""Return the type of an object."""
typever = obj['Type']
typesplit = typever.split('.')
return typesplit[0] + '.' + typesplit[1] | python | def _get_type(self, obj):
"""Return the type of an object."""
typever = obj['Type']
typesplit = typever.split('.')
return typesplit[0] + '.' + typesplit[1] | [
"def",
"_get_type",
"(",
"self",
",",
"obj",
")",
":",
"typever",
"=",
"obj",
"[",
"'Type'",
"]",
"typesplit",
"=",
"typever",
".",
"split",
"(",
"'.'",
")",
"return",
"typesplit",
"[",
"0",
"]",
"+",
"'.'",
"+",
"typesplit",
"[",
"1",
"]"
] | Return the type of an object. | [
"Return",
"the",
"type",
"of",
"an",
"object",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L136-L140 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._render_extended_error_message_list | def _render_extended_error_message_list(self, extended_error):
"""Parse the ExtendedError object and retruns the message.
Build a list of decoded messages from the extended_error using the
message registries. An ExtendedError JSON object is a response from
the with its own schema. This... | python | def _render_extended_error_message_list(self, extended_error):
"""Parse the ExtendedError object and retruns the message.
Build a list of decoded messages from the extended_error using the
message registries. An ExtendedError JSON object is a response from
the with its own schema. This... | [
"def",
"_render_extended_error_message_list",
"(",
"self",
",",
"extended_error",
")",
":",
"messages",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"extended_error",
",",
"dict",
")",
":",
"if",
"(",
"'Type'",
"in",
"extended_error",
"and",
"extended_error",
"[",
... | Parse the ExtendedError object and retruns the message.
Build a list of decoded messages from the extended_error using the
message registries. An ExtendedError JSON object is a response from
the with its own schema. This function knows how to parse the
ExtendedError object and, using a... | [
"Parse",
"the",
"ExtendedError",
"object",
"and",
"retruns",
"the",
"message",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L150-L193 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_host_details | def _get_host_details(self):
"""Get the system details."""
# Assuming only one system present as part of collection,
# as we are dealing with iLO's here.
status, headers, system = self._rest_get('/rest/v1/Systems/1')
if status < 300:
stype = self._get_type(system)
... | python | def _get_host_details(self):
"""Get the system details."""
# Assuming only one system present as part of collection,
# as we are dealing with iLO's here.
status, headers, system = self._rest_get('/rest/v1/Systems/1')
if status < 300:
stype = self._get_type(system)
... | [
"def",
"_get_host_details",
"(",
"self",
")",
":",
"# Assuming only one system present as part of collection,",
"# as we are dealing with iLO's here.",
"status",
",",
"headers",
",",
"system",
"=",
"self",
".",
"_rest_get",
"(",
"'/rest/v1/Systems/1'",
")",
"if",
"status",
... | Get the system details. | [
"Get",
"the",
"system",
"details",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L199-L213 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._check_bios_resource | def _check_bios_resource(self, properties=[]):
"""Check if the bios resource exists."""
system = self._get_host_details()
if ('links' in system['Oem']['Hp'] and
'BIOS' in system['Oem']['Hp']['links']):
# Get the BIOS URI and Settings
bios_uri = system['Oe... | python | def _check_bios_resource(self, properties=[]):
"""Check if the bios resource exists."""
system = self._get_host_details()
if ('links' in system['Oem']['Hp'] and
'BIOS' in system['Oem']['Hp']['links']):
# Get the BIOS URI and Settings
bios_uri = system['Oe... | [
"def",
"_check_bios_resource",
"(",
"self",
",",
"properties",
"=",
"[",
"]",
")",
":",
"system",
"=",
"self",
".",
"_get_host_details",
"(",
")",
"if",
"(",
"'links'",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'",
"]",
"and",
"'BIOS'",
"in",
"system... | Check if the bios resource exists. | [
"Check",
"if",
"the",
"bios",
"resource",
"exists",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L215-L242 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_pci_devices | def _get_pci_devices(self):
"""Gets the PCI devices.
:returns: PCI devices list if the pci resource exist.
:raises: IloCommandNotSupportedError if the PCI resource
doesn't exist.
:raises: IloError, on an error from iLO.
"""
system = self._get_host_details()
... | python | def _get_pci_devices(self):
"""Gets the PCI devices.
:returns: PCI devices list if the pci resource exist.
:raises: IloCommandNotSupportedError if the PCI resource
doesn't exist.
:raises: IloError, on an error from iLO.
"""
system = self._get_host_details()
... | [
"def",
"_get_pci_devices",
"(",
"self",
")",
":",
"system",
"=",
"self",
".",
"_get_host_details",
"(",
")",
"if",
"(",
"'links'",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'",
"]",
"and",
"'PCIDevices'",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'... | Gets the PCI devices.
:returns: PCI devices list if the pci resource exist.
:raises: IloCommandNotSupportedError if the PCI resource
doesn't exist.
:raises: IloError, on an error from iLO. | [
"Gets",
"the",
"PCI",
"devices",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L244-L269 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_gpu_pci_devices | def _get_gpu_pci_devices(self):
"""Returns the list of gpu devices."""
pci_device_list = self._get_pci_devices()
gpu_list = []
items = pci_device_list['Items']
for item in items:
if item['ClassCode'] in CLASSCODE_FOR_GPU_DEVICES:
if item['SubclassCode... | python | def _get_gpu_pci_devices(self):
"""Returns the list of gpu devices."""
pci_device_list = self._get_pci_devices()
gpu_list = []
items = pci_device_list['Items']
for item in items:
if item['ClassCode'] in CLASSCODE_FOR_GPU_DEVICES:
if item['SubclassCode... | [
"def",
"_get_gpu_pci_devices",
"(",
"self",
")",
":",
"pci_device_list",
"=",
"self",
".",
"_get_pci_devices",
"(",
")",
"gpu_list",
"=",
"[",
"]",
"items",
"=",
"pci_device_list",
"[",
"'Items'",
"]",
"for",
"item",
"in",
"items",
":",
"if",
"item",
"[",
... | Returns the list of gpu devices. | [
"Returns",
"the",
"list",
"of",
"gpu",
"devices",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L271-L281 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_storage_resource | def _get_storage_resource(self):
"""Gets the SmartStorage resource if exists.
:raises: IloCommandNotSupportedError if the resource SmartStorage
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings.
"""
system = self._get_host_details()
... | python | def _get_storage_resource(self):
"""Gets the SmartStorage resource if exists.
:raises: IloCommandNotSupportedError if the resource SmartStorage
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings.
"""
system = self._get_host_details()
... | [
"def",
"_get_storage_resource",
"(",
"self",
")",
":",
"system",
"=",
"self",
".",
"_get_host_details",
"(",
")",
"if",
"(",
"'links'",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'",
"]",
"and",
"'SmartStorage'",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
... | Gets the SmartStorage resource if exists.
:raises: IloCommandNotSupportedError if the resource SmartStorage
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings. | [
"Gets",
"the",
"SmartStorage",
"resource",
"if",
"exists",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L283-L305 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_array_controller_resource | def _get_array_controller_resource(self):
"""Gets the ArrayController resource if exists.
:raises: IloCommandNotSupportedError if the resource ArrayController
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings.
"""
headers, storage_uri, stora... | python | def _get_array_controller_resource(self):
"""Gets the ArrayController resource if exists.
:raises: IloCommandNotSupportedError if the resource ArrayController
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings.
"""
headers, storage_uri, stora... | [
"def",
"_get_array_controller_resource",
"(",
"self",
")",
":",
"headers",
",",
"storage_uri",
",",
"storage_settings",
"=",
"self",
".",
"_get_storage_resource",
"(",
")",
"if",
"(",
"'links'",
"in",
"storage_settings",
"and",
"'ArrayControllers'",
"in",
"storage_s... | Gets the ArrayController resource if exists.
:raises: IloCommandNotSupportedError if the resource ArrayController
doesn't exist.
:returns the tuple of SmartStorage URI, Headers and settings. | [
"Gets",
"the",
"ArrayController",
"resource",
"if",
"exists",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L307-L329 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._create_list_of_array_controllers | def _create_list_of_array_controllers(self):
"""Creates the list of Array Controller URIs.
:raises: IloCommandNotSupportedError if the ArrayControllers
doesnt have member "Member".
:returns list of ArrayControllers.
"""
headers, array_uri, array_settings = (
... | python | def _create_list_of_array_controllers(self):
"""Creates the list of Array Controller URIs.
:raises: IloCommandNotSupportedError if the ArrayControllers
doesnt have member "Member".
:returns list of ArrayControllers.
"""
headers, array_uri, array_settings = (
... | [
"def",
"_create_list_of_array_controllers",
"(",
"self",
")",
":",
"headers",
",",
"array_uri",
",",
"array_settings",
"=",
"(",
"self",
".",
"_get_array_controller_resource",
"(",
")",
")",
"array_uri_links",
"=",
"[",
"]",
"if",
"(",
"'links'",
"in",
"array_se... | Creates the list of Array Controller URIs.
:raises: IloCommandNotSupportedError if the ArrayControllers
doesnt have member "Member".
:returns list of ArrayControllers. | [
"Creates",
"the",
"list",
"of",
"Array",
"Controller",
"URIs",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L331-L348 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_drive_type_and_speed | def _get_drive_type_and_speed(self):
"""Gets the disk drive type.
:returns: A dictionary with the following keys:
- has_rotational: True/False. It is True if atleast one
rotational disk is attached.
- has_ssd: True/False. It is True if at least one SSD disk is
... | python | def _get_drive_type_and_speed(self):
"""Gets the disk drive type.
:returns: A dictionary with the following keys:
- has_rotational: True/False. It is True if atleast one
rotational disk is attached.
- has_ssd: True/False. It is True if at least one SSD disk is
... | [
"def",
"_get_drive_type_and_speed",
"(",
"self",
")",
":",
"disk_details",
"=",
"self",
".",
"_get_physical_drive_resource",
"(",
")",
"drive_hdd",
"=",
"False",
"drive_ssd",
"=",
"False",
"drive_details",
"=",
"{",
"}",
"speed_const_list",
"=",
"[",
"4800",
","... | Gets the disk drive type.
:returns: A dictionary with the following keys:
- has_rotational: True/False. It is True if atleast one
rotational disk is attached.
- has_ssd: True/False. It is True if at least one SSD disk is
attached.
- drive_rotational_<... | [
"Gets",
"the",
"disk",
"drive",
"type",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L350-L385 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_drive_resource | def _get_drive_resource(self, drive_name):
"""Gets the DiskDrive resource if exists.
:param drive_name: can be either "PhysicalDrives" or
"LogicalDrives".
:returns the list of drives.
:raises: IloCommandNotSupportedError if the given drive resource
doesn't exist... | python | def _get_drive_resource(self, drive_name):
"""Gets the DiskDrive resource if exists.
:param drive_name: can be either "PhysicalDrives" or
"LogicalDrives".
:returns the list of drives.
:raises: IloCommandNotSupportedError if the given drive resource
doesn't exist... | [
"def",
"_get_drive_resource",
"(",
"self",
",",
"drive_name",
")",
":",
"disk_details_list",
"=",
"[",
"]",
"array_uri_links",
"=",
"self",
".",
"_create_list_of_array_controllers",
"(",
")",
"for",
"array_link",
"in",
"array_uri_links",
":",
"_",
",",
"_",
",",... | Gets the DiskDrive resource if exists.
:param drive_name: can be either "PhysicalDrives" or
"LogicalDrives".
:returns the list of drives.
:raises: IloCommandNotSupportedError if the given drive resource
doesn't exist.
:raises: IloError, on an error from iLO. | [
"Gets",
"the",
"DiskDrive",
"resource",
"if",
"exists",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L387-L425 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_logical_raid_levels | def _get_logical_raid_levels(self):
"""Gets the different raid levels configured on a server.
:returns a dictionary of logical_raid_levels set to true.
Example if raid level 1+0 and 6 are configured, it returns
{'logical_raid_level_10': 'true',
'logical_raid_level_6... | python | def _get_logical_raid_levels(self):
"""Gets the different raid levels configured on a server.
:returns a dictionary of logical_raid_levels set to true.
Example if raid level 1+0 and 6 are configured, it returns
{'logical_raid_level_10': 'true',
'logical_raid_level_6... | [
"def",
"_get_logical_raid_levels",
"(",
"self",
")",
":",
"logical_drive_details",
"=",
"self",
".",
"_get_logical_drive_resource",
"(",
")",
"raid_level",
"=",
"{",
"}",
"if",
"logical_drive_details",
":",
"for",
"item",
"in",
"logical_drive_details",
":",
"if",
... | Gets the different raid levels configured on a server.
:returns a dictionary of logical_raid_levels set to true.
Example if raid level 1+0 and 6 are configured, it returns
{'logical_raid_level_10': 'true',
'logical_raid_level_6': 'true'} | [
"Gets",
"the",
"different",
"raid",
"levels",
"configured",
"on",
"a",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L435-L450 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._is_raid_supported | def _is_raid_supported(self):
"""Get the RAID support on the server.
This method returns the raid support on the physical server. It
checks for the list of array controllers configured to the Smart
Storage. If one or more array controllers available then raid
is supported by the... | python | def _is_raid_supported(self):
"""Get the RAID support on the server.
This method returns the raid support on the physical server. It
checks for the list of array controllers configured to the Smart
Storage. If one or more array controllers available then raid
is supported by the... | [
"def",
"_is_raid_supported",
"(",
"self",
")",
":",
"header",
",",
"uri",
",",
"array_resource",
"=",
"self",
".",
"_get_array_controller_resource",
"(",
")",
"return",
"True",
"if",
"array_resource",
"[",
"'Total'",
"]",
">",
"0",
"else",
"False"
] | Get the RAID support on the server.
This method returns the raid support on the physical server. It
checks for the list of array controllers configured to the Smart
Storage. If one or more array controllers available then raid
is supported by the server. If none, raid is not supported.
... | [
"Get",
"the",
"RAID",
"support",
"on",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L452-L464 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_bios_settings_resource | def _get_bios_settings_resource(self, data):
"""Get the BIOS settings resource."""
try:
bios_settings_uri = data['links']['Settings']['href']
except KeyError:
msg = ('BIOS Settings resource not found.')
raise exception.IloError(msg)
status, headers, b... | python | def _get_bios_settings_resource(self, data):
"""Get the BIOS settings resource."""
try:
bios_settings_uri = data['links']['Settings']['href']
except KeyError:
msg = ('BIOS Settings resource not found.')
raise exception.IloError(msg)
status, headers, b... | [
"def",
"_get_bios_settings_resource",
"(",
"self",
",",
"data",
")",
":",
"try",
":",
"bios_settings_uri",
"=",
"data",
"[",
"'links'",
"]",
"[",
"'Settings'",
"]",
"[",
"'href'",
"]",
"except",
"KeyError",
":",
"msg",
"=",
"(",
"'BIOS Settings resource not fo... | Get the BIOS settings resource. | [
"Get",
"the",
"BIOS",
"settings",
"resource",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L466-L479 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._validate_if_patch_supported | def _validate_if_patch_supported(self, headers, uri):
"""Check if the PATCH Operation is allowed on the resource."""
if not self._operation_allowed(headers, 'PATCH'):
msg = ('PATCH Operation not supported on the resource '
'"%s"' % uri)
raise except... | python | def _validate_if_patch_supported(self, headers, uri):
"""Check if the PATCH Operation is allowed on the resource."""
if not self._operation_allowed(headers, 'PATCH'):
msg = ('PATCH Operation not supported on the resource '
'"%s"' % uri)
raise except... | [
"def",
"_validate_if_patch_supported",
"(",
"self",
",",
"headers",
",",
"uri",
")",
":",
"if",
"not",
"self",
".",
"_operation_allowed",
"(",
"headers",
",",
"'PATCH'",
")",
":",
"msg",
"=",
"(",
"'PATCH Operation not supported on the resource '",
"'\"%s\"'",
"%"... | Check if the PATCH Operation is allowed on the resource. | [
"Check",
"if",
"the",
"PATCH",
"Operation",
"is",
"allowed",
"on",
"the",
"resource",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L481-L486 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_bios_setting | def _get_bios_setting(self, bios_property):
"""Retrieves bios settings of the server."""
headers, bios_uri, bios_settings = self._check_bios_resource([
bios_property])
return bios_settings[bios_property] | python | def _get_bios_setting(self, bios_property):
"""Retrieves bios settings of the server."""
headers, bios_uri, bios_settings = self._check_bios_resource([
bios_property])
return bios_settings[bios_property] | [
"def",
"_get_bios_setting",
"(",
"self",
",",
"bios_property",
")",
":",
"headers",
",",
"bios_uri",
",",
"bios_settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
"[",
"bios_property",
"]",
")",
"return",
"bios_settings",
"[",
"bios_property",
"]"
] | Retrieves bios settings of the server. | [
"Retrieves",
"bios",
"settings",
"of",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L488-L492 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_bios_hash_password | def _get_bios_hash_password(self, bios_password):
"""Get the hashed BIOS password."""
request_headers = {}
if bios_password:
bios_password_hash = hashlib.sha256((bios_password.encode()).
hexdigest().upper())
request_headers[... | python | def _get_bios_hash_password(self, bios_password):
"""Get the hashed BIOS password."""
request_headers = {}
if bios_password:
bios_password_hash = hashlib.sha256((bios_password.encode()).
hexdigest().upper())
request_headers[... | [
"def",
"_get_bios_hash_password",
"(",
"self",
",",
"bios_password",
")",
":",
"request_headers",
"=",
"{",
"}",
"if",
"bios_password",
":",
"bios_password_hash",
"=",
"hashlib",
".",
"sha256",
"(",
"(",
"bios_password",
".",
"encode",
"(",
")",
")",
".",
"h... | Get the hashed BIOS password. | [
"Get",
"the",
"hashed",
"BIOS",
"password",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L494-L501 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._change_bios_setting | def _change_bios_setting(self, properties):
"""Change the bios settings to specified values."""
keys = properties.keys()
# Check if the BIOS resource/property exists.
headers, bios_uri, settings = self._check_bios_resource(keys)
if not self._operation_allowed(headers, 'PATCH'):
... | python | def _change_bios_setting(self, properties):
"""Change the bios settings to specified values."""
keys = properties.keys()
# Check if the BIOS resource/property exists.
headers, bios_uri, settings = self._check_bios_resource(keys)
if not self._operation_allowed(headers, 'PATCH'):
... | [
"def",
"_change_bios_setting",
"(",
"self",
",",
"properties",
")",
":",
"keys",
"=",
"properties",
".",
"keys",
"(",
")",
"# Check if the BIOS resource/property exists.",
"headers",
",",
"bios_uri",
",",
"settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
... | Change the bios settings to specified values. | [
"Change",
"the",
"bios",
"settings",
"to",
"specified",
"values",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L503-L517 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_iscsi_settings_resource | def _get_iscsi_settings_resource(self, data):
"""Get the iscsi settings resoure.
:param data: Existing iscsi settings of the server.
:returns: headers, iscsi_settings url and
iscsi settings as a dictionary.
:raises: IloCommandNotSupportedError, if resource is not found.... | python | def _get_iscsi_settings_resource(self, data):
"""Get the iscsi settings resoure.
:param data: Existing iscsi settings of the server.
:returns: headers, iscsi_settings url and
iscsi settings as a dictionary.
:raises: IloCommandNotSupportedError, if resource is not found.... | [
"def",
"_get_iscsi_settings_resource",
"(",
"self",
",",
"data",
")",
":",
"try",
":",
"iscsi_settings_uri",
"=",
"data",
"[",
"'links'",
"]",
"[",
"'Settings'",
"]",
"[",
"'href'",
"]",
"except",
"KeyError",
":",
"msg",
"=",
"(",
"'iscsi settings resource not... | Get the iscsi settings resoure.
:param data: Existing iscsi settings of the server.
:returns: headers, iscsi_settings url and
iscsi settings as a dictionary.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO. | [
"Get",
"the",
"iscsi",
"settings",
"resoure",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L519-L540 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_bios_boot_resource | def _get_bios_boot_resource(self, data):
"""Get the Boot resource like BootSources.
:param data: Existing Bios settings of the server.
:returns: boot settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO.
"""
... | python | def _get_bios_boot_resource(self, data):
"""Get the Boot resource like BootSources.
:param data: Existing Bios settings of the server.
:returns: boot settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO.
"""
... | [
"def",
"_get_bios_boot_resource",
"(",
"self",
",",
"data",
")",
":",
"try",
":",
"boot_uri",
"=",
"data",
"[",
"'links'",
"]",
"[",
"'Boot'",
"]",
"[",
"'href'",
"]",
"except",
"KeyError",
":",
"msg",
"=",
"(",
"'Boot resource not found.'",
")",
"raise",
... | Get the Boot resource like BootSources.
:param data: Existing Bios settings of the server.
:returns: boot settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO. | [
"Get",
"the",
"Boot",
"resource",
"like",
"BootSources",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L542-L562 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._get_bios_mappings_resource | def _get_bios_mappings_resource(self, data):
"""Get the Mappings resource.
:param data: Existing Bios settings of the server.
:returns: mappings settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO.
"""
... | python | def _get_bios_mappings_resource(self, data):
"""Get the Mappings resource.
:param data: Existing Bios settings of the server.
:returns: mappings settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO.
"""
... | [
"def",
"_get_bios_mappings_resource",
"(",
"self",
",",
"data",
")",
":",
"try",
":",
"map_uri",
"=",
"data",
"[",
"'links'",
"]",
"[",
"'Mappings'",
"]",
"[",
"'href'",
"]",
"except",
"KeyError",
":",
"msg",
"=",
"(",
"'Mappings resource not found.'",
")",
... | Get the Mappings resource.
:param data: Existing Bios settings of the server.
:returns: mappings settings.
:raises: IloCommandNotSupportedError, if resource is not found.
:raises: IloError, on an error from iLO. | [
"Get",
"the",
"Mappings",
"resource",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L564-L583 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._check_iscsi_rest_patch_allowed | def _check_iscsi_rest_patch_allowed(self):
"""Checks if patch is supported on iscsi.
:returns: iscsi url.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
headers, bios_uri... | python | def _check_iscsi_rest_patch_allowed(self):
"""Checks if patch is supported on iscsi.
:returns: iscsi url.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
headers, bios_uri... | [
"def",
"_check_iscsi_rest_patch_allowed",
"(",
"self",
")",
":",
"headers",
",",
"bios_uri",
",",
"bios_settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
")",
"# Check if the bios resource exists.",
"if",
"(",
"'links'",
"in",
"bios_settings",
"and",
"'iScsi'"... | Checks if patch is supported on iscsi.
:returns: iscsi url.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Checks",
"if",
"patch",
"is",
"supported",
"on",
"iscsi",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L585-L615 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._change_iscsi_settings | def _change_iscsi_settings(self, iscsi_info):
"""Change iSCSI settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO.
"""
headers, bios_ur... | python | def _change_iscsi_settings(self, iscsi_info):
"""Change iSCSI settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO.
"""
headers, bios_ur... | [
"def",
"_change_iscsi_settings",
"(",
"self",
",",
"iscsi_info",
")",
":",
"headers",
",",
"bios_uri",
",",
"bios_settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
")",
"# Get the Mappings resource.",
"map_settings",
"=",
"self",
".",
"_get_bios_mappings_resou... | Change iSCSI settings.
:param iscsi_info: A dictionary that contains information of iSCSI
target like target_name, lun, ip_address, port etc.
:raises: IloError, on an error from iLO. | [
"Change",
"iSCSI",
"settings",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L617-L653 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._change_secure_boot_settings | def _change_secure_boot_settings(self, property, value):
"""Change secure boot settings on the server."""
system = self._get_host_details()
# find the BIOS URI
if ('links' not in system['Oem']['Hp'] or
'SecureBoot' not in system['Oem']['Hp']['links']):
msg = (' "Se... | python | def _change_secure_boot_settings(self, property, value):
"""Change secure boot settings on the server."""
system = self._get_host_details()
# find the BIOS URI
if ('links' not in system['Oem']['Hp'] or
'SecureBoot' not in system['Oem']['Hp']['links']):
msg = (' "Se... | [
"def",
"_change_secure_boot_settings",
"(",
"self",
",",
"property",
",",
"value",
")",
":",
"system",
"=",
"self",
".",
"_get_host_details",
"(",
")",
"# find the BIOS URI",
"if",
"(",
"'links'",
"not",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'",
"]",
... | Change secure boot settings on the server. | [
"Change",
"secure",
"boot",
"settings",
"on",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L655-L683 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.get_secure_boot_mode | def get_secure_boot_mode(self):
"""Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
system = self._get_... | python | def get_secure_boot_mode(self):
"""Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
system = self._get_... | [
"def",
"get_secure_boot_mode",
"(",
"self",
")",
":",
"system",
"=",
"self",
".",
"_get_host_details",
"(",
")",
"if",
"(",
"'links'",
"not",
"in",
"system",
"[",
"'Oem'",
"]",
"[",
"'Hp'",
"]",
"or",
"'SecureBoot'",
"not",
"in",
"system",
"[",
"'Oem'",
... | Get the status of secure boot.
:returns: True, if enabled, else False
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Get",
"the",
"status",
"of",
"secure",
"boot",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L708-L733 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.set_secure_boot_mode | def set_secure_boot_mode(self, secure_boot_enable):
"""Enable/Disable secure boot on the server.
:param secure_boot_enable: True, if secure boot needs to be
enabled for next boot, else False.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, i... | python | def set_secure_boot_mode(self, secure_boot_enable):
"""Enable/Disable secure boot on the server.
:param secure_boot_enable: True, if secure boot needs to be
enabled for next boot, else False.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, i... | [
"def",
"set_secure_boot_mode",
"(",
"self",
",",
"secure_boot_enable",
")",
":",
"if",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
":",
"self",
".",
"_change_secure_boot_settings",
"(",
"'SecureBootEnable'",
",",
"secure_boot_enable",
")",
"else",
":",
"msg",
"="... | Enable/Disable secure boot on the server.
:param secure_boot_enable: True, if secure boot needs to be
enabled for next boot, else False.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Enable",
"/",
"Disable",
"secure",
"boot",
"on",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L735-L750 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.reset_secure_boot_keys | def reset_secure_boot_keys(self):
"""Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
sel... | python | def reset_secure_boot_keys(self):
"""Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
sel... | [
"def",
"reset_secure_boot_keys",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
":",
"self",
".",
"_change_secure_boot_settings",
"(",
"'ResetToDefaultKeys'",
",",
"True",
")",
"else",
":",
"msg",
"=",
"(",
"'System is not in UEFI boot m... | Reset secure boot keys to manufacturing defaults.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Reset",
"secure",
"boot",
"keys",
"to",
"manufacturing",
"defaults",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L752-L764 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.clear_secure_boot_keys | def clear_secure_boot_keys(self):
"""Reset all keys.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
self._change_secure_boot_settings('Re... | python | def clear_secure_boot_keys(self):
"""Reset all keys.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server.
"""
if self._is_boot_mode_uefi():
self._change_secure_boot_settings('Re... | [
"def",
"clear_secure_boot_keys",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
":",
"self",
".",
"_change_secure_boot_settings",
"(",
"'ResetAllKeys'",
",",
"True",
")",
"else",
":",
"msg",
"=",
"(",
"'System is not in UEFI boot mode. \... | Reset all keys.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Reset",
"all",
"keys",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L766-L778 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._perform_power_op | def _perform_power_op(self, oper):
"""Perform requested power operation.
:param oper: Type of power button press to simulate.
Supported values: 'ON', 'ForceOff', 'ForceRestart' and
'Nmi'
:raises: IloError, on an error from iLO.
"""
powe... | python | def _perform_power_op(self, oper):
"""Perform requested power operation.
:param oper: Type of power button press to simulate.
Supported values: 'ON', 'ForceOff', 'ForceRestart' and
'Nmi'
:raises: IloError, on an error from iLO.
"""
powe... | [
"def",
"_perform_power_op",
"(",
"self",
",",
"oper",
")",
":",
"power_settings",
"=",
"{",
"\"Action\"",
":",
"\"Reset\"",
",",
"\"ResetType\"",
":",
"oper",
"}",
"systems_uri",
"=",
"\"/rest/v1/Systems/1\"",
"status",
",",
"headers",
",",
"response",
"=",
"s... | Perform requested power operation.
:param oper: Type of power button press to simulate.
Supported values: 'ON', 'ForceOff', 'ForceRestart' and
'Nmi'
:raises: IloError, on an error from iLO. | [
"Perform",
"requested",
"power",
"operation",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L790-L807 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._press_pwr_btn | def _press_pwr_btn(self, pushType="Press"):
"""Simulates a physical press of the server power button.
:param pushType: Type of power button press to simulate
Supported values are: 'Press' and 'PressAndHold'
:raises: IloError, on an error from iLO.
"""
po... | python | def _press_pwr_btn(self, pushType="Press"):
"""Simulates a physical press of the server power button.
:param pushType: Type of power button press to simulate
Supported values are: 'Press' and 'PressAndHold'
:raises: IloError, on an error from iLO.
"""
po... | [
"def",
"_press_pwr_btn",
"(",
"self",
",",
"pushType",
"=",
"\"Press\"",
")",
":",
"power_settings",
"=",
"{",
"\"Action\"",
":",
"\"PowerButton\"",
",",
"\"Target\"",
":",
"\"/Oem/Hp\"",
",",
"\"PushType\"",
":",
"pushType",
"}",
"systems_uri",
"=",
"\"/rest/v1... | Simulates a physical press of the server power button.
:param pushType: Type of power button press to simulate
Supported values are: 'Press' and 'PressAndHold'
:raises: IloError, on an error from iLO. | [
"Simulates",
"a",
"physical",
"press",
"of",
"the",
"server",
"power",
"button",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L817-L834 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations._retry_until_powered_on | def _retry_until_powered_on(self, power):
"""This method retries power on operation.
:param: power : target power state
"""
# If the system is in the same power state as
# requested by the user, it gives the error
# InvalidOperationForSystemState. To avoid this error
... | python | def _retry_until_powered_on(self, power):
"""This method retries power on operation.
:param: power : target power state
"""
# If the system is in the same power state as
# requested by the user, it gives the error
# InvalidOperationForSystemState. To avoid this error
... | [
"def",
"_retry_until_powered_on",
"(",
"self",
",",
"power",
")",
":",
"# If the system is in the same power state as",
"# requested by the user, it gives the error",
"# InvalidOperationForSystemState. To avoid this error",
"# the power state is checked before power on",
"# operation is perf... | This method retries power on operation.
:param: power : target power state | [
"This",
"method",
"retries",
"power",
"on",
"operation",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L855-L870 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.set_host_power | def set_host_power(self, power):
"""Toggle the power button of server.
:param power: 'ON' or 'OFF'
:raises: IloError, on an error from iLO.
"""
power = power.upper()
if (power is not None) and (power not in POWER_STATE):
msg = ("Invalid input '%(pow)s'. "
... | python | def set_host_power(self, power):
"""Toggle the power button of server.
:param power: 'ON' or 'OFF'
:raises: IloError, on an error from iLO.
"""
power = power.upper()
if (power is not None) and (power not in POWER_STATE):
msg = ("Invalid input '%(pow)s'. "
... | [
"def",
"set_host_power",
"(",
"self",
",",
"power",
")",
":",
"power",
"=",
"power",
".",
"upper",
"(",
")",
"if",
"(",
"power",
"is",
"not",
"None",
")",
"and",
"(",
"power",
"not",
"in",
"POWER_STATE",
")",
":",
"msg",
"=",
"(",
"\"Invalid input '%... | Toggle the power button of server.
:param power: 'ON' or 'OFF'
:raises: IloError, on an error from iLO. | [
"Toggle",
"the",
"power",
"button",
"of",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L872-L895 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.get_http_boot_url | def get_http_boot_url(self):
"""Request the http boot url from system in uefi boot mode.
:returns: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode.
"""
if(self.... | python | def get_http_boot_url(self):
"""Request the http boot url from system in uefi boot mode.
:returns: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode.
"""
if(self.... | [
"def",
"get_http_boot_url",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
"is",
"True",
")",
":",
"return",
"self",
".",
"_get_bios_setting",
"(",
"'UefiShellStartupUrl'",
")",
"else",
":",
"msg",
"=",
"'get_http_boot_url is no... | Request the http boot url from system in uefi boot mode.
:returns: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode. | [
"Request",
"the",
"http",
"boot",
"url",
"from",
"system",
"in",
"uefi",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L897-L909 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.set_http_boot_url | def set_http_boot_url(self, url):
"""Set url to the UefiShellStartupUrl to the system in uefi boot mode.
:param url: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode.
""... | python | def set_http_boot_url(self, url):
"""Set url to the UefiShellStartupUrl to the system in uefi boot mode.
:param url: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode.
""... | [
"def",
"set_http_boot_url",
"(",
"self",
",",
"url",
")",
":",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
"is",
"True",
")",
":",
"self",
".",
"_change_bios_setting",
"(",
"{",
"'UefiShellStartupUrl'",
":",
"url",
"}",
")",
"else",
":",
"msg... | Set url to the UefiShellStartupUrl to the system in uefi boot mode.
:param url: URL for http boot
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the bios boot mode. | [
"Set",
"url",
"to",
"the",
"UefiShellStartupUrl",
"to",
"the",
"system",
"in",
"uefi",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L911-L923 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.unset_iscsi_info | def unset_iscsi_info(self):
"""Disable iSCSI boot option in UEFI boot mode.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
if(self._is_boot_mode_uefi() is True):
iscsi_... | python | def unset_iscsi_info(self):
"""Disable iSCSI boot option in UEFI boot mode.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode.
"""
if(self._is_boot_mode_uefi() is True):
iscsi_... | [
"def",
"unset_iscsi_info",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
"is",
"True",
")",
":",
"iscsi_info",
"=",
"{",
"'iSCSIBootEnable'",
":",
"'Disabled'",
"}",
"self",
".",
"_change_iscsi_settings",
"(",
"iscsi_info",
"... | Disable iSCSI boot option in UEFI boot mode.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedInBiosError, if the system is
in the BIOS boot mode. | [
"Disable",
"iSCSI",
"boot",
"option",
"in",
"UEFI",
"boot",
"mode",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L960-L972 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.get_iscsi_initiator_info | def get_iscsi_initiator_info(self):
"""Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode.
"""
headers, bio... | python | def get_iscsi_initiator_info(self):
"""Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode.
"""
headers, bio... | [
"def",
"get_iscsi_initiator_info",
"(",
"self",
")",
":",
"headers",
",",
"bios_uri",
",",
"bios_settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
")",
"if",
"(",
"'links'",
"in",
"bios_settings",
"and",
"'iScsi'",
"in",
"bios_settings",
"[",
"'links'",
... | Give iSCSI initiator information of iLO.
:returns: iSCSI initiator information.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode. | [
"Give",
"iSCSI",
"initiator",
"information",
"of",
"iLO",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L974-L994 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.set_iscsi_initiator_info | def set_iscsi_initiator_info(self, initiator_iqn):
"""Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode.
"""
... | python | def set_iscsi_initiator_info(self, initiator_iqn):
"""Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode.
"""
... | [
"def",
"set_iscsi_initiator_info",
"(",
"self",
",",
"initiator_iqn",
")",
":",
"if",
"(",
"self",
".",
"_is_boot_mode_uefi",
"(",
")",
"is",
"True",
")",
":",
"iscsi_uri",
"=",
"self",
".",
"_check_iscsi_rest_patch_allowed",
"(",
")",
"initiator_info",
"=",
"... | Set iSCSI initiator information in iLO.
:param initiator_iqn: Initiator iqn for iLO.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the system is
in the bios boot mode. | [
"Set",
"iSCSI",
"initiator",
"information",
"in",
"iLO",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L996-L1014 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.get_pending_boot_mode | def get_pending_boot_mode(self):
"""Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO.
"""
headers, uri, bios_settings = self._check_bios_resource(['BootMode... | python | def get_pending_boot_mode(self):
"""Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO.
"""
headers, uri, bios_settings = self._check_bios_resource(['BootMode... | [
"def",
"get_pending_boot_mode",
"(",
"self",
")",
":",
"headers",
",",
"uri",
",",
"bios_settings",
"=",
"self",
".",
"_check_bios_resource",
"(",
"[",
"'BootMode'",
"]",
")",
"_",
",",
"_",
",",
"settings",
"=",
"self",
".",
"_get_bios_settings_resource",
"... | Retrieves the pending boot mode of the server.
Gets the boot mode to be set on next reset.
:returns: either LEGACY or UEFI.
:raises: IloError, on an error from iLO. | [
"Retrieves",
"the",
"pending",
"boot",
"mode",
"of",
"the",
"server",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L1028-L1040 |
openstack/proliantutils | proliantutils/ilo/ris.py | RISOperations.set_pending_boot_mode | def set_pending_boot_mode(self, boot_mode):
"""Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the c... | python | def set_pending_boot_mode(self, boot_mode):
"""Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the c... | [
"def",
"set_pending_boot_mode",
"(",
"self",
",",
"boot_mode",
")",
":",
"boot_mode",
"=",
"boot_mode",
".",
"lower",
"(",
")",
"if",
"boot_mode",
"not",
"in",
"[",
"'uefi'",
",",
"'legacy'",
"]",
":",
"msg",
"=",
"'Invalid Boot mode specified'",
"raise",
"e... | Sets the boot mode of the system for next boot.
:param boot_mode: either 'uefi' or 'legacy'.
:raises: IloInvalidInputError, on an invalid input.
:raises: IloError, on an error from iLO.
:raises: IloCommandNotSupportedError, if the command is not supported
on the server. | [
"Sets",
"the",
"boot",
"mode",
"of",
"the",
"system",
"for",
"next",
"boot",
"."
] | train | https://github.com/openstack/proliantutils/blob/86ef3b47b4eca97c221577e3570b0240d6a25f22/proliantutils/ilo/ris.py#L1042-L1065 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.