共用方式為


AutoPoolSpecification 類別

指定暫存「自動集區」的特性。 Batch 服務會在提交作業時建立此自動集區。

必須填入所有必要的參數,才能傳送至 Azure。

繼承
AutoPoolSpecification

建構函式

AutoPoolSpecification(*, pool_lifetime_option, auto_pool_id_prefix: str = None, keep_alive: bool = None, pool=None, **kwargs)

參數

auto_pool_id_prefix
str
必要

Batch 服務會在建立時為每個自動集區指派唯一識別碼。 若要區分為不同用途所建立的集區,您可以指定這個專案,將前置詞新增至指派的識別碼。 前置詞的長度最多 20 個字元。

pool_lifetime_option
strPoolLifetimeOption
必要

必要。 可能的值包括:'jobSchedule'、'job'

keep_alive
bool
必要

是否要在存留期到期後讓自動集區保持運作。 如果為 false,Batch 服務會在集區存留期 (刪除集區,如 poolLifetimeOption 設定所決定,) 到期;也就是說,當作業或作業排程完成時。 如果為 true,Batch 服務不會自動刪除集區。 使用者必須刪除使用此選項建立的自動集區。

pool
PoolSpecification
必要

自動集區的集區規格。

方法

as_dict

使用 json.dump 傳回可以是 JSONify 的聽寫。

進階用法可以選擇性地使用回呼作為參數:

索引鍵是 Python 中使用的屬性名稱。 Attr_desc是中繼資料的聽寫。 目前包含具有 msrest 類型的 'type',以及具有 RestAPI 編碼金鑰的 'key'。 Value 是這個 物件中的目前值。

傳回的字串將用來序列化索引鍵。 如果傳回類型是清單,則會將此視為階層式結果聽寫。

請參閱此檔案中的三個範例:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

deserialize

使用 RestAPI 語法剖析 str 並傳回模型。

enable_additional_properties_sending
from_dict

使用指定的索引鍵擷取器剖析聽寫會傳回模型。

根據預設,請考慮金鑰擷取器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

傳回會從此模型傳送至 Azure 的 JSON。

這是as_dict (full_restapi_key_transformer的別名 ,keep_readonly=False)

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

validate

以遞迴方式驗證此模型,並傳回 ValidationError 的清單。

as_dict

使用 json.dump 傳回可以是 JSONify 的聽寫。

進階用法可以選擇性地使用回呼作為參數:

索引鍵是 Python 中使用的屬性名稱。 Attr_desc是中繼資料的聽寫。 目前包含具有 msrest 類型的 'type',以及具有 RestAPI 編碼金鑰的 'key'。 Value 是這個 物件中的目前值。

傳回的字串將用來序列化索引鍵。 如果傳回類型是清單,則會將此視為階層式結果聽寫。

請參閱此檔案中的三個範例:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

參數

key_transformer
<xref:function>

按鍵轉換程式函式。

keep_readonly
預設值: True

傳回

聽寫 JSON 相容物件

傳回類型

deserialize

使用 RestAPI 語法剖析 str 並傳回模型。

deserialize(data, content_type=None)

參數

data
str
必要

使用 RestAPI 結構的 str。 根據預設,JSON。

content_type
str
預設值: None

根據預設,如果 XML,請設定 application/xml。

傳回

此模型的實例

例外狀況

DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending()

from_dict

使用指定的索引鍵擷取器剖析聽寫會傳回模型。

根據預設,請考慮金鑰擷取器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和last_rest_key_case_insensitive_extractor)

from_dict(data, key_extractors=None, content_type=None)

參數

data
dict
必要

使用 RestAPI 結構的聽寫

content_type
str
預設值: None

根據預設,如果 XML,請設定 application/xml。

key_extractors
預設值: None

傳回

此模型的實例

例外狀況

DeserializationError if something went wrong

is_xml_model

is_xml_model()

serialize

傳回會從此模型傳送至 Azure 的 JSON。

這是as_dict (full_restapi_key_transformer的別名 ,keep_readonly=False)

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

serialize(keep_readonly=False, **kwargs)

參數

keep_readonly
bool
預設值: False

如果您想要序列化唯讀屬性

傳回

聽寫 JSON 相容物件

傳回類型

validate

以遞迴方式驗證此模型,並傳回 ValidationError 的清單。

validate()

傳回

驗證錯誤清單

傳回類型