Python的Microsoft Azure Batch管理客户端库
项目描述
Microsoft Azure SDK for Python
这是Microsoft Azure Batch管理客户端库。此软件包已在Python 3.7+上进行了测试。要获取Azure库的完整视图,请参阅azure sdk python发布。
免责声明
Azure SDK Python 包对 Python 2.7 的支持已于 2022 年 1 月 1 日结束。有关更多信息和建议,请参阅 https://github.com/Azure/azure-sdk-for-python/issues/20691
入门指南
先决条件
- 使用此包需要 Python 3.7 或更高版本。
- Azure 订阅
安装包
pip install azure-mgmt-batch
pip install azure-identity
身份验证
默认情况下,Azure Active Directory 令牌身份验证依赖于以下环境变量的正确配置。
AZURE_CLIENT_ID
用于 Azure 客户端 ID。AZURE_TENANT_ID
用于 Azure 租户 ID。AZURE_CLIENT_SECRET
用于 Azure 客户端密钥。
此外,Azure 订阅 ID 可以通过环境变量 AZURE_SUBSCRIPTION_ID
进行配置。
以上配置完成后,客户端可以通过以下代码进行身份验证
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
import os
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = BatchManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
示例
此包的代码示例可以在以下位置找到
故障排除
下一步
提供反馈
如果您遇到任何错误或有建议,请在项目的 问题 部分提交问题。
版本历史记录
18.0.0 (2024-09-25)
新增功能
- 客户端
BatchManagementClient
添加了操作组network_security_perimeter
- 模型
Application
在方法__init__
中添加了参数tags
- 模型
ApplicationPackage
在方法__init__
中添加了参数tags
- 模型
Certificate
在方法__init__
中添加了参数tags
- 模型
CertificateCreateOrUpdateParameters
在方法__init__
中添加了参数tags
- 模型
DetectorResponse
在方法__init__
中添加了参数tags
- 模型
ImageReference
添加了属性shared_gallery_image_id
- 模型
ImageReference
添加了属性community_gallery_image_id
- 模型
ManagedDisk
添加了属性security_profile
- 模型
Pool
在方法__init__
中添加了参数tags
- 模型
PrivateEndpointConnection
在方法__init__
中添加了参数tags
- 模型
PrivateLinkResource
在方法__init__
中添加了参数tags
- 模型
ProxyResource
添加了属性system_data
- 模型
ProxyResource
添加了属性additional_properties
- 枚举
PublicNetworkAccessType
添加了成员SECURED_BY_PERIMETER
- 模型
Resource
添加了属性system_data
- 模型
TaskContainerSettings
添加了属性container_host_batch_bind_mounts
- 添加了模型
AccessRule
- 添加了枚举
AccessRuleDirection
- 添加了模型
AccessRuleProperties
- 添加了模型
AccessRulePropertiesSubscriptionsItem
- 添加了模型
AzureProxyResource
- 添加了模型
AzureResource
- 添加了模型
ContainerHostBatchBindMountEntry
- 添加了枚举
ContainerHostDataPath
- 添加了枚举
CreatedByType
- 添加了模型
ErrorAdditionalInfo
- 添加了模型
ErrorDetail
- 添加了模型
ErrorResponse
- 添加了枚举
IssueType
- 添加了模型
NetworkSecurityPerimeter
- 添加了模型
NetworkSecurityPerimeterConfiguration
- 添加了模型
NetworkSecurityPerimeterConfigurationListResult
- 添加了模型
NetworkSecurityPerimeterConfigurationProperties
- 添加了枚举
NetworkSecurityPerimeterConfigurationProvisioningState
- 添加了模型
NetworkSecurityProfile
- 添加了模型
ProvisioningIssue
- 添加了模型
ProvisioningIssueProperties
- 添加了模型
ResourceAssociation
- 添加了枚举
ResourceAssociationAccessMode
- 添加了枚举
SecurityEncryptionTypes
- 添加了枚举
SecurityTypes
- 添加了枚举
Severity
- 添加了模型
SystemData
- 添加了模型
VMDiskSecurityProfile
- 添加了模型
NetworkSecurityPerimeterOperations
重大更改
- 模型
DeploymentConfiguration
删除或重命名了其实例变量cloud_service_configuration
- 模型
ProxyResource
删除或重命名了其实例变量etag
- 模型
Resource
删除或重命名了其实例变量location
- 模型
Resource
删除或重命名了其实例变量tags
- 删除或重命名了模型
CloudServiceConfiguration
- 删除或重命名了方法
LocationOperations.list_supported_cloud_service_skus
17.3.0 (2024-03-19)
新增功能
- 模型 Pool 添加了新的参数 upgrade_policy
- 模型 SupportedSku 添加了新的参数 batch_support_end_of_life
17.2.0 (2023-12-18)
新增功能
- 模型 OSDisk 添加了新的参数 caching
- 模型 OSDisk 添加了新的参数 disk_size_gb
- 模型 OSDisk 添加了新的参数 managed_disk
- 模型 OSDisk 添加了新的参数 write_accelerator_enabled
- 模型 Pool 添加了新的参数 resource_tags
- 模型 VirtualMachineConfiguration 添加了新的参数 security_profile
- 模型 VirtualMachineConfiguration 添加了新的参数 service_artifact_reference
17.1.0 (2023-07-21)
新增功能
- 模型 NetworkConfiguration 添加了新的参数 enable_accelerated_networking
- 模型 VMExtension 添加了新的参数 enable_automatic_upgrade
- 模型 ContainerConfiguration 允许两个可能的值:
dockerCompatible
和criCompatible
,而不是固定的值dockerCompatible
17.0.0 (2022-11-23)
新增功能
- 模型 NetworkConfiguration 添加了新的参数 dynamic_vnet_assignment_scope
- 模型 Pool 添加了新的参数 current_node_communication_mode
- 模型 Pool 添加了新的参数 target_node_communication_mode
- 模型 PrivateLinkServiceConnectionState 添加了新的参数 actions_required
重大更改
- 模型 CIFSMountConfiguration 添加了一个新的必填参数 user_name
- 模型 CIFSMountConfiguration 不再具有参数 username
- 模型 NetworkConfiguration 不再具有参数 dynamic_v_net_assignment_scope
- 模型 PrivateLinkServiceConnectionState 不再具有参数 action_required
16.2.0 (2022-06-06)
功能
- 添加了操作 PrivateEndpointConnectionOperations.begin_delete
- 模型 BatchAccount 添加了新的参数 network_profile
- 模型 BatchAccount 添加了新的参数 node_management_endpoint
- 模型 BatchAccountCreateParameters 添加了新的参数 network_profile
- 模型 BatchAccountUpdateParameters 添加了新的参数 network_profile
- 模型 BatchAccountUpdateParameters 添加了新的参数 public_network_access
- 模型 PrivateEndpointConnection 添加了新的参数 group_ids
16.1.0 (2022-02-24)
功能
- 添加了操作 BatchAccountOperations.get_detector
- 添加了操作 BatchAccountOperations.list_detectors
- 模型 NetworkConfiguration 添加了新的参数 dynamic_v_net_assignment_scope
16.0.0 (2021-07-30)
功能
- 模型 BatchAccount 添加了新的参数 allowed_authentication_modes
- 模型 AutoStorageBaseProperties 添加了新的参数 node_identity_reference
- 模型 AutoStorageBaseProperties 添加了新的参数 authentication_mode
- 模型 AzureBlobFileSystemConfiguration 添加了新的参数 identity_reference
- 模型 BatchAccountUpdateParameters 添加了新的参数 allowed_authentication_modes
- 模型 ContainerRegistry 添加了新的参数 identity_reference
- 模型 Operation 添加了新的参数 is_data_action
- 模型 BatchAccountCreateParameters 添加了新的参数 allowed_authentication_modes
- 模型 AutoStorageProperties 添加了新的参数 node_identity_reference
- 模型 AutoStorageProperties 添加了新的参数 authentication_mode
- 模型 ResourceFile 添加了新的参数 identity_reference
- 模型 VirtualMachineConfiguration 添加了新的参数 os_disk
- 添加了操作 BatchAccountOperations.list_outbound_network_dependencies_endpoints
- 添加了操作 LocationOperations.list_supported_cloud_service_skus
- 添加了操作 LocationOperations.list_supported_virtual_machine_skus
破坏性变更
- 将
BatchManagement
重命名为BatchManagementClient
15.0.0 (2021-02-01)
- 修复更改日志
15.0.0b1 (2021-01-28)
功能
- 在池上为 VirtualMachineConfiguration 添加了新的扩展属性,用于指定节点的虚拟机扩展
- 在 VirtualMachineConfiguration 上添加了新的属性 node_placement_configuration,以指定可用区
- 在 Pool 上添加了新的身份属性,用于指定托管身份
- 在 BatchAccountIdentity 上添加了新的 user_assigned_identities,用于指定用户管理的身份
- 添加了证书操作方法 PoolOperations.create
- 添加了证书操作方法 CertificateOperations.create
破坏性变更
- 移除了证书操作方法 PoolOperations.begin_create。证书操作不是长时间运行的操作,因此这是不正确的。
- 移除了证书操作方法 CertificateOperations.begin_create。证书操作不是长时间运行的操作,因此这是不正确的。
14.0.0 (2020-12-22)
- GA 版本
14.0.0b1 (2020-10-23)
这是测试预览版本。
本版本使用新一代代码生成器,引入了重要的破坏性变更,但也引入了重要的新功能(如统一身份验证和异步编程)。
一般破坏性变更
-
凭证系统已完全重造
azure.common.credentials
或msrestazure.azure_active_directory
实例不再受支持,请使用azure-identity
类:[https://pypi.ac.cn/project/azure-identity/](https://pypi.ac.cn/project/azure-identity/)credentials
参数已重命名为credential
-
客户端上的
config
属性不再存在,配置应作为 kwarg 传递。例如:MyClient(credential, subscription_id, enable_logging=True)
。有关支持选项的完整集合,请参阅 [azure-core 初始化文档中的参数接受](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies) -
不能再导入
version
模块,请使用__version__
代替 -
以前返回
msrest.polling.LROPoller
的操作现在返回azure.core.polling.LROPoller
,并带有begin_
前缀。 -
异常树已简化,大多数异常现在是
azure.core.exceptions.HttpResponseError
(已删除CloudError
)。 -
大多数操作 kwarg 都已更改。其中一些最显著的
raw
已删除。等效功能可以通过使用cls
找到,这是一个回调,将提供对内部 HTTP 响应的访问,供高级用户使用- 有关支持选项的完整集合,请参阅 [azure-core 请求文档中的参数接受](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
一般新功能
- 支持使用
typing
进行类型注解。SDKs 已准备好使用 mypy。 - 此客户端现在具有稳定且官方的异步支持。检查您的包中的
aio
命名空间以查找异步客户端。 - 此客户端现在原生支持 OpenCensus 或 OpenTelemetry 等跟踪库。有关概述,请参阅此 [跟踪快速入门](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core-tracing-opentelemetry)。
9.0.0 (2020-05-29)
REST API 版本
- 本版本针对 REST API 版本 2020-05-01。
功能
- 通过在
BatchAccount
上的新public_network_access
属性中添加了能够访问 Batch DataPlane API 而无需为帐户创建公共 DNS 条目的功能。 - 添加了新的
PrivateLinkResource
和PrivateEndpointConnection
资源类型。这两个类型都仅在将BatchAccount
上的public_network_access
属性设置为Disabled
时使用。- 当
public_network_access
设置为Disabled
时,在该帐户中可见一个新PrivateLinkResource
,可用于通过您的 VNET 中的 ARM Private Endpoint 连接到帐户。
- 当
- 通过使用
VirtualMachineConfiguration
的新disk_encryption_configuration
属性,现在可以加密ComputeNode
磁盘驱动器。 - [破坏性]
ImageReference
的id
属性现在只能引用共享映像库图像。 - [破坏性] 现在可以通过
NetworkConfiguration
的新public_ip_configuration
属性来部署池而无需公共 IP。NetworkConfiguration
的public_ips
属性已移动到PublicIPAddressConfiguration
。此属性只能在IPAddressProvisioningType
为UserManaged
时指定。
- 向
BatchAccount
添加了新的identity
属性,类型为BatchAccountIdentity
。这可以用来配置如何在 Batch 帐户内部加密客户数据。- 这个新属性可以在创建和更新时在账户级别进行配置,通过在
BatchAccountCreateParameters
和BatchAccountUpdateParameters
上新增的identity
属性来实现。
- 这个新属性可以在创建和更新时在账户级别进行配置,通过在
修复内容
- [破坏性更改] 将标签从创建和更新池参数的参数移动到
BatchAccountCreateParameters
和BatchAccountUpdateParameters
中,以正确反映REST API。
8.0.1(2020-05-26)[已弃用]
注意事项
- 此版本针对了一个无效的REST API。此版本不遵守相关REST API合约。
错误修复
- 由于Swagger规范中的错误导致验证失败,修复了私有端点连接的获取和更新方法中存在的问题。建议使用9.0版本或更高版本以利用此版本中添加的功能。
8.0.0(2020-04-10)[已弃用]
注意事项
- 此版本针对了一个无效的REST API。目前,私有端点的get()和update()函数无法正常工作。建议使用9.0版本或更高版本以利用此版本中添加的功能。
REST API 版本
- 此版本针对REST API版本2020-03-01。
功能
- 通过在
BatchAccount
上的新public_network_access
属性中添加了能够访问 Batch DataPlane API 而无需为帐户创建公共 DNS 条目的功能。 - 添加了新的
PrivateLinkResource
和PrivateEndpointConnection
资源类型。这两个类型都仅在将BatchAccount
上的public_network_access
属性设置为Disabled
时使用。- 当
public_network_access
设置为Disabled
时,在该帐户中可见一个新PrivateLinkResource
,可用于通过您的 VNET 中的 ARM Private Endpoint 连接到帐户。
- 当
- 通过使用
VirtualMachineConfiguration
的新disk_encryption_configuration
属性,现在可以加密ComputeNode
磁盘驱动器。 - [破坏性]
ImageReference
的id
属性现在只能引用共享映像库图像。 - [破坏性] 现在可以通过
NetworkConfiguration
的新public_ip_configuration
属性来部署池而无需公共 IP。NetworkConfiguration
的public_ips
属性已移动到PublicIPAddressConfiguration
。此属性只能在IPAddressProvisioningType
为UserManaged
时指定。
7.0.0 (2019-08-05)
- 通过新的
public_ips
属性,现在可以在NetworkConfiguration
上指定一组公共IP地址。这保证了池中的节点将具有用户提供的IP列表中的一个IP地址。 - 现在可以通过
Pool
上的mount_configuration
属性在每个池节点上挂载远程文件系统。 - 现在可以通过引用ARM ID来通过
ImageReference
的id
属性指定共享镜像库中的镜像。 - [破坏性更改] 如果未指定,现在
StartTask
上的wait_for_success
的默认值是True
(之前是False
)。 - [破坏性更改] 如果未指定,现在
AutoUserSpecification
上的scope
的默认值始终是Pool
(在Windows节点上是Task
,在Linux节点上是Pool
)。 - 破坏性更改 模型签名现在只使用关键字参数语法。每个位置参数都必须重写为关键字参数。
- 枚举类型现在使用“str”混合(class AzureEnum(str, Enum))来改进遇到未识别枚举值时的行为。
6.0.0 (2019-01-14)
-
-
[破坏性更改] 资源文件改进
-
在
ResourceFile
中添加了指定整个Azure存储容器的能力。 -
新的属性
HttpUrl
替换了BlobSource
。这可以是指向任何HTTP URL。之前,这必须是Azure Blob Storage URL。 -
-
在构建
ResourceFile
时,您现在可以从以下选项中选择一个:HttpUrl
:指定一个指向要下载的特定文件的HTTP URL。StorageContainerUrl
:指定Azure存储容器的URL。所有与存储容器中的BlobPrefix
匹配的blob都将被下载。AutoStorageContainerName
:指定在已注册的批处理自动存储账户中的容器名称。所有与存储容器中的BlobPrefix
匹配的blob都将被下载。
-
-
-
-
[破坏性更改] 从
VirtualMachineConfiguration
中删除了OSDisk
属性。此属性不再受支持。 -
[破坏性更改]
Application
不再具有Packages
属性,而是可以通过新的ApplicationPackage.List
API检索包。 -
[破坏性更改]
TargetOsVersion
现在是OsVersion
,并且CurrentOsVersion
不再在CloudServiceConfiguration
上受支持。 -
通过
WindowsUserConfiguration.LoginMode
添加了对Windows池创建具有特定登录模式(即Batch
或Interactive
)的用户的支持。 -
在创建池时添加了对
ContainerConfiguration
的支持。
5.0.1 (2018-05-25)
错误修复
- sdist与wheel 0.31.0的兼容性
- msrestazure依赖版本范围
5.0.0 (2017-11-13)
- 批处理池现在是可以使用新的客户端.PoolOperations创建、更新和管理ARM资源。
- 批处理证书现在已成为ARM资源,可以使用新的客户端.CertificateOperations进行创建、更新和管理。
4.1.0 (2017-07-24)
- 新增了检查批处理账户名称可用性和有效性的操作。
4.0.0 (2017-05-10)
- 新增了列出Microsoft.Batch提供者可用的操作的命令,包括新的
Operation
和OperationDisplay
模型。 - 将
AddApplicationParameters
重命名为ApplicationCreateParameters
。 - 将
UpdateApplicationParameters
重命名为ApplicationUpdateParameters
。 - 从
BatchAccount
对象中移除了core_quota
属性,现在由单独的dedicated_core_quota
和low_priority_core_quota
替代。 BatchAccountKeys
对象现在具有额外的account_name
属性。
3.0.1 (2017-04-19)
- 此轮包现在使用azure wheel扩展构建。
3.0.0 (2017-03-07)
- 更新了
BatchAccount
模型 - 支持在用户的订阅中进行池分配。 - 更新了
BatchAccount
模型 - 支持引用Azure密钥保管库以用于以UserSubscription池分配模式创建的账户。 - 更新了
BatchAccount
模型 - 属性现在是只读的。 - 更新了
ApplicationPackage
模型 - 属性现在是只读的。 - 更新了
BatchAccountKeys
模型 - 属性现在是只读的。 - 更新了
BatchLocationQuota
模型 - 属性现在是只读的。
2.0.0 (2016-10-04)
- 将
AccountResource
重命名为BatchAccount
。 - 将
AccountOperations
重命名为BatchAccountOperations
。同时,IBatchManagementClient.Account
属性也重命名为IBatchManagementClient.BatchAccount
。 - 将
Application
和ApplicationPackage
操作拆分为两个单独的操作组。 - 更新了
Application
和ApplicationPackage
方法,以使用标准的Create
、Delete
、Update
语法。例如,创建Application
是通过ApplicationOperations.Create
完成的。 - 将
SubscriptionOperations
重命名为LocationOperations
,并将SubscriptionOperations.GetSubscriptionQuotas
更改为LocationOperations.GetQuotas
。 - 此版本针对REST API版本2015-12-01。
1.0.0 (2016-08-09)
- 初始发布
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源分发
构建分发版
azure_mgmt_batch-18.0.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 305eb51fb3f73b20927ef47b3b6f93e9e32dc939876c045f970bd386c07ba79c |
|
MD5 | 878203c54a2bde328978414a1c28e9a5 |
|
BLAKE2b-256 | 9dde134bcd314ec6d5b1b5b286cbc32c5c1a390e41cdf1b3f1f68627a55ab7aa |
azure_mgmt_batch-18.0.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e78588f68a45b66f2b27f14c6753c35dff42a8a66fd7e1688b0cb3dbe1fb4ffb |
|
MD5 | b05525b6456bec486077351b120a2266 |
|
BLAKE2b-256 | f89f7da4532346ab2a3b3c1866e9838c08b02551de4c9fb0047b9adcd9344d2a |