Microsoft Azure API Management Python客户端库
项目描述
Microsoft Azure SDK for Python
这是Microsoft Azure API Management客户端库。此包已在Python 3.8+上进行测试。要查看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.8+。
- Azure 订阅
安装包
pip install azure-mgmt-apimanagement
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.apimanagement import ApiManagementClient
import os
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = ApiManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
示例
此包的代码示例可在以下位置找到
故障排除
下一步
提供反馈
如果您遇到任何错误或有建议,请在项目的 问题 部分提交问题。
版本历史
4.0.1 (2024-03-19)
其他更改
- 重新生成示例
4.0.0 (2023-04-20)
新增功能
- 添加了操作 ApiManagementServiceOperations.begin_migrate_to_stv2
- 添加了操作组 ApiWikiOperations
- 添加了操作组 ApiWikisOperations
- 添加了操作组 AuthorizationAccessPolicyOperations
- 添加了操作组 AuthorizationLoginLinksOperations
- 添加了操作组 AuthorizationOperations
- 添加了操作组 AuthorizationProviderOperations
- 添加了操作组 DocumentationOperations
- 添加了操作组 GraphQLApiResolverOperations
- 添加了操作组 GraphQLApiResolverPolicyOperations
- 添加了操作组 PolicyFragmentOperations
- 添加了操作组 PortalConfigOperations
- 添加了操作组 ProductWikiOperations
- 添加了操作组 ProductWikisOperations
- 模型 AdditionalLocation 新增参数 nat_gateway_state
- 模型 AdditionalLocation 新增参数 outbound_public_ip_addresses
- 模型 ApiCreateOrUpdateParameter 新增参数 translate_required_query_parameters_conduct
- 模型 ApiCreateOrUpdateProperties 新增参数 translate_required_query_parameters_conduct
- 模型 ApiManagementServiceBaseProperties 新增参数 nat_gateway_state
- 模型 ApiManagementServiceBaseProperties 新增参数 outbound_public_ip_addresses
- 模型 ApiManagementServiceProperties 新增参数 nat_gateway_state
- 模型 ApiManagementServiceProperties 新增参数 outbound_public_ip_addresses
- 模型 ApiManagementServiceResource 新增参数 nat_gateway_state
- 模型 ApiManagementServiceResource 新增参数 outbound_public_ip_addresses
- 模型 ApiManagementServiceUpdateParameters 新增参数 nat_gateway_state
- 模型 ApiManagementServiceUpdateParameters 新增参数 outbound_public_ip_addresses
- 模型 ApiManagementServiceUpdateProperties 新增参数 nat_gateway_state
- 模型 ApiManagementServiceUpdateProperties 新增参数 outbound_public_ip_addresses
- 模型 AuthenticationSettingsContract 新增参数 o_auth2_authentication_settings
- 模型 AuthenticationSettingsContract 新增参数 openid_authentication_settings
- 模型 AuthorizationServerContract 新增参数 use_in_api_documentation
- 模型 AuthorizationServerContract 新增参数 use_in_test_console
- 模型 AuthorizationServerContractProperties 新增参数 use_in_api_documentation
- 模型 AuthorizationServerContractProperties 新增参数 use_in_test_console
- 模型 AuthorizationServerUpdateContract 新增参数 use_in_api_documentation
- 模型 AuthorizationServerUpdateContract 新增参数 use_in_test_console
- 模型 AuthorizationServerUpdateContractProperties 新增参数 use_in_api_documentation
- 模型 AuthorizationServerUpdateContractProperties 新增参数 use_in_test_console
- 模型 DiagnosticContract 新增参数 metrics
- 模型 IdentityProviderBaseParameters 新增参数 client_library
- 模型 IdentityProviderContract 新增参数 client_library
- 模型 IdentityProviderContractProperties 新增参数 client_library
- 模型 IdentityProviderCreateContract 新增参数 client_library
- 模型 IdentityProviderCreateContractProperties 新增参数 client_library
- 模型 IdentityProviderUpdateParameters 新增参数 client_library
- 模型 IdentityProviderUpdateProperties 新增参数 client_library
- 模型 OpenidConnectProviderContract 添加了新参数 use_in_api_documentation
- 模型 OpenidConnectProviderContract 添加了新参数 use_in_test_console
- 模型 OpenidConnectProviderUpdateContract 添加了新参数 use_in_api_documentation
- 模型 OpenidConnectProviderUpdateContract 添加了新参数 use_in_test_console
重大变更
- 操作 ContentItemOperations.create_or_update 添加了新的必需参数 parameters
- 操作 ContentTypeOperations.create_or_update 添加了新的必需参数 parameters
3.1.0b1 (2022-11-11)
新增功能
- 模型 DiagnosticContract 新增参数 metrics
3.0.0 (2022-01-13)
新功能
- 添加了操作组 ApiManagementClientOperationsMixin
- 添加了操作组 GlobalSchemaOperations
- 添加了操作组 OutboundNetworkDependenciesEndpointsOperations
- 添加了操作组 PrivateEndpointConnectionOperations
- 模型 AdditionalLocation 添加了新参数 platform_version
- 模型 AdditionalLocation 添加了新参数 public_ip_address_id
- 模型 ApiContract 添加了新参数 contact
- 模型 ApiContract 添加了新参数 license
- 模型 ApiContract 添加了新参数 terms_of_service_url
- 模型 ApiContractProperties 添加了新参数 contact
- 模型 ApiContractProperties 添加了新参数 license
- 模型 ApiContractProperties 添加了新参数 terms_of_service_url
- 模型 ApiContractUpdateProperties 添加了新参数 contact
- 模型 ApiContractUpdateProperties 添加了新参数 license
- 模型 ApiContractUpdateProperties 添加了新参数 terms_of_service_url
- 模型 ApiCreateOrUpdateParameter 添加了新参数 contact
- 模型 ApiCreateOrUpdateParameter 添加了新参数 license
- 模型 ApiCreateOrUpdateParameter 添加了新参数 terms_of_service_url
- 模型 ApiCreateOrUpdateProperties 添加了新参数 contact
- 模型 ApiCreateOrUpdateProperties 添加了新参数 license
- 模型 ApiCreateOrUpdateProperties 添加了新参数 terms_of_service_url
- 模型 ApiEntityBaseContract 添加了新参数 contact
- 模型 ApiEntityBaseContract 添加了新参数 license
- 模型 ApiEntityBaseContract 添加了新参数 terms_of_service_url
- 模型 ApiManagementServiceBackupRestoreParameters 添加了新参数 access_type
- 模型 ApiManagementServiceBackupRestoreParameters 添加了新参数 client_id
- 模型 ApiManagementServiceBaseProperties 添加了新参数 platform_version
- 模型 ApiManagementServiceBaseProperties 添加了新参数 private_endpoint_connections
- 模型 ApiManagementServiceBaseProperties 添加了新参数 public_ip_address_id
- 模型 ApiManagementServiceBaseProperties 添加了新参数 public_network_access
- 模型 ApiManagementServiceProperties 添加了新参数 platform_version
- 模型 ApiManagementServiceProperties 添加了新参数 private_endpoint_connections
- 模型 ApiManagementServiceProperties 添加了新参数 public_ip_address_id
- 模型 ApiManagementServiceProperties 添加了新参数 public_network_access
- 模型 ApiManagementServiceResource 添加了新参数 platform_version
- 模型 ApiManagementServiceResource 添加了新参数 private_endpoint_connections
- 模型 ApiManagementServiceResource 添加了新参数 public_ip_address_id
- 模型 ApiManagementServiceResource 添加了新参数 public_network_access
- 模型 ApiManagementServiceResource 添加了新参数 system_data
- 模型 ApiManagementServiceUpdateParameters 添加了新参数 platform_version
- 模型 ApiManagementServiceUpdateParameters 添加了新参数 private_endpoint_connections
- 模型 ApiManagementServiceUpdateParameters 添加了新参数 public_ip_address_id
- 模型 ApiManagementServiceUpdateParameters 添加了新参数 public_network_access
- 模型 ApiManagementServiceUpdateParameters 添加了新参数 zones
- 模型 ApiManagementServiceUpdateProperties 添加了新参数 platform_version
- 模型 ApiManagementServiceUpdateProperties 添加了新参数 private_endpoint_connections
- 模型 ApiManagementServiceUpdateProperties 添加了新参数 public_ip_address_id
- 模型 ApiManagementServiceUpdateProperties 添加了新参数 public_network_access
- 模型 ApiTagResourceContractProperties 添加了新参数 contact
- 模型 ApiTagResourceContractProperties 添加了新参数 license
- 模型 ApiTagResourceContractProperties 添加了新参数 terms_of_service_url
- 模型 ApiUpdateContract 添加了新参数 contact
- 模型 ApiUpdateContract 添加了新参数 license
- 模型 ApiUpdateContract 添加了新参数 terms_of_service_url
- 模型 HostnameConfiguration 添加了新参数 certificate_source
- 模型 HostnameConfiguration 添加了新参数 certificate_status
- 模型 ParameterContract 添加了新参数 examples
- 模型参数Contract新增参数schema_id
- 模型参数Contract新增参数type_name
- 模型表示Contract新增参数examples
- 模型SchemaContract新增参数components
- 模型租户配置同步状态Contract新增参数id
- 模型租户配置同步状态Contract新增参数name
- 模型租户配置同步状态Contract新增参数type
重大变更
- 模型表示Contract不再有参数sample
2.1.0 (2021-08-03)
新功能
- 模型操作结果Contract新增参数id_properties_id
- 模型操作结果Contract新增参数name
- 模型操作结果Contract新增参数type
- 模型租户配置同步状态Contract新增参数last_operation_id
2.0.0 (2021-03-25)
新功能
- 模型标签集合新增参数count
- 模型OpenIdConnectProvider集合新增参数count
- 模型标签资源集合新增参数count
- 模型证书集合新增参数count
- 模型策略集合新增参数count
- 模型问题附件集合新增参数count
- 模型后端服务Fabric集群属性新增参数client_certificate_id
- 模型后端集合新增参数count
- 模型订阅集合新增参数count
- 模型收件人电子邮件集合新增参数count
- 模型网关集合新增参数count
- 模型问题评论集合新增参数count
- 模型操作集合新增参数count
- 模型诊断集合新增参数count
- 模型API版本集合新增参数count
- 模型产品集合新增参数count
- 模型问题集合新增参数count
- 模型通知集合新增参数count
- 模型用户集合新增参数count
- 模型身份提供者列表新增参数count
- 模型API发布集合新增参数count
- 模型标签描述集合新增参数count
- 模型API修订集合新增参数count
- 模型缓存集合新增参数count
- 模型收件人用户集合新增参数count
- 模型命名值集合新增参数count
- 模型电子邮件模板集合新增参数count
- 模型后端凭据Contract新增参数certificate_ids
- 模型API集合新增参数count
- 模型组集合新增参数count
- 模型Schema集合新增参数count
- 添加操作:TenantAccessOperations.list_by_service
- 添加操作:TenantAccessOperations.create
- 添加操作:ApiManagementServiceOperations.get_domain_ownership_identifier
- 添加操作:NamedValueOperations.begin_refresh_secret
- 添加操作:CertificateOperations.refresh_secret
- 添加操作:DeletedServicesOperations.begin_purge
- 添加操作:UserSubscriptionOperations.get
- 添加操作组:PortalSettingsOperations
- 添加操作组:TenantSettingsOperations
- 添加操作组:GatewayCertificateAuthorityOperations
- 添加操作组:ApiManagementSkusOperations
重大变更
- 操作CertificateOperations.list_by_service具有新的签名
- 操作NamedValueOperations.list_by_service具有新的签名
- 移除操作DeletedServicesOperations.purge
- 移除操作TenantAccessGitOperations.list_secrets
- 移除操作TenantAccessGitOperations.get
- 模型AccessInformationContract具有新的签名
1.0.0 (2020-12-21)
新功能
- 添加操作组:ContentItemOperations
- 添加操作组:PortalRevisionOperations
重大变更
- 操作SignUpSettingsOperations.update具有新的签名
- 操作TenantAccessOperations.update具有新的签名
- 操作UserOperations.get_shared_access_token具有新的签名
- 操作SignInSettingsOperations.update具有新的签名
- 操作QuotaByPeriodKeysOperations.update具有新的签名
- 操作TenantConfigurationOperations.begin_save具有新的签名
- 操作 TenantConfigurationOperations.begin_validate 具有新的签名
- 操作 TenantConfigurationOperations.begin_deploy 具有新的签名
- 操作 BackendOperations.reconnect 具有新的签名
- 操作 QuotaByCounterKeysOperations.update 具有新的签名
- 操作 ApiReleaseOperations.update 具有新的签名
- 操作 TagOperations.update 具有新的签名
- 操作 ApiManagementServiceOperations.check_name_availability 具有新的签名
- 操作 ApiManagementServiceOperations.begin_apply_network_configuration_updates 具有新的签名
- 操作 GatewayOperations.update 具有新的签名
- 操作 GatewayOperations.generate_token 具有新的签名
- 操作 GatewayOperations.regenerate_key 具有新的签名
- 操作UserOperations.get_shared_access_token具有新的签名
- 操作 TenantConfigurationOperations.begin_validate 具有新的签名
- 操作TenantConfigurationOperations.begin_save具有新的签名
- 操作 TenantConfigurationOperations.begin_deploy 具有新的签名
- 操作 TagOperations.create_or_update 具有新的签名
- 操作SignUpSettingsOperations.update具有新的签名
- 操作QuotaByPeriodKeysOperations.update具有新的签名
- 操作 QuotaByCounterKeysOperations.update 具有新的签名
- 操作 GatewayOperations.update 具有新的签名
- 操作 GatewayOperations.generate_token 具有新的签名
- 操作 ApiReleaseOperations.update 具有新的签名
- 操作 GatewayApiOperations.create_or_update 具有新的签名
- 操作 TagOperations.create_or_update 具有新的签名
- 操作 SignUpSettingsOperations.create_or_update 具有新的签名
- 操作 SignInSettingsOperations.create_or_update 具有新的签名
- 操作 ApiOperationPolicyOperations.create_or_update 具有新的签名
- 操作 PolicyOperations.create_or_update 具有新的签名
- 操作 ApiPolicyOperations.create_or_update 具有新的签名
- 操作 ApiReleaseOperations.create_or_update 具有新的签名
- 操作 GatewayOperations.create_or_update 具有新的签名
- 操作 ProductPolicyOperations.create_or_update 具有新的签名
- 已删除操作组 ContentTypeContentItemOperations
1.0.0b1 (2020-10-31)
这是测试预览版本。有关详细变更日志,请参阅等效稳定版本 0.2.0(https://pypi.ac.cn/project/azure-mgmt-apimanagement/0.2.0/)
此版本使用新一代代码生成器,引入了重要破坏性变更,但也引入了重要新功能(如统一身份验证和异步编程)。
一般破坏性变更
-
凭证系统已完全重造
azure.common.credentials
或msrestazure.azure_active_directory
实例不再受支持,请使用azure-identity
类: https://pypi.ac.cn/project/azure-identity/credentials
参数已被重命名为credential
-
客户端上的
config
属性不再存在,配置应作为 kwarg 传递。例如:MyClient(credential, subscription_id, enable_logging=True)
。有关受支持的完整选项集,请参阅 azure-core 初始化文档中的参数接受 -
您不能再导入
version
模块,请使用__version__
代替 -
以前返回
msrest.polling.LROPoller
的操作现在返回azure.core.polling.LROPoller
,并带有begin_
前缀。 -
异常树已简化,大多数异常现在为
azure.core.exceptions.HttpResponseError
(已删除CloudError
)。 -
大多数操作 kwarg 已更改。一些最引人注目的是
raw
已删除。等效功能可通过使用cls
找到,这是一个将提供对内部 HTTP 响应的访问的回调,用于高级用户- 有关受支持的完整选项集,请参阅 azure-core 请求文档中的参数接受
一般新功能
- 支持使用
typing
进行类型注解。SDKs 已准备好 mypy。 - 此客户端现在提供稳定和官方的异步支持。检查您的包中的
aio
命名空间以找到异步客户端。 - 此客户端现在原生支持 OpenCensus 或 OpenTelemetry 等跟踪库。有关概述,请参阅此 跟踪快速入门。
0.2.0 (2020-03-25)
新功能
- 模型 IdentityProviderUpdateParameters 有一个新参数 signin_tenant
- 模型 ApiManagementServiceIdentity 有一个新参数 user_assigned_identities
- 模型 AdditionalLocation 有一个新参数 disable_gateway
- 模型 UserCreateParameters 有一个新参数 app_type
- 模型ApiManagementServiceResource新增参数disable_gateway
- 模型ApiManagementServiceResource新增参数developer_portal_url
- 模型ApiManagementServiceResource新增参数api_version_constraint
- 模型DiagnosticContract新增参数log_client_ip
- 模型DiagnosticContract新增参数verbosity
- 模型DiagnosticContract新增参数http_correlation_protocol
- 模型SchemaContract新增参数value
- 模型SchemaContract新增参数definitions
- 模型ApiManagementServiceUpdateParameters新增参数disable_gateway
- 模型ApiManagementServiceUpdateParameters新增参数developer_portal_url
- 模型ApiManagementServiceUpdateParameters新增参数api_version_constraint
- 模型TagDescriptionContract新增参数tag_id
- 模型ApiManagementServiceBaseProperties新增参数disable_gateway
- 模型ApiManagementServiceBaseProperties新增参数developer_portal_url
- 模型ApiManagementServiceBaseProperties新增参数api_version_constraint
- 模型IdentityProviderBaseParameters新增参数signin_tenant
- 模型IdentityProviderContract新增参数signin_tenant
- 添加操作TenantAccessGitOperations.list_secrets
- 添加操作DelegationSettingsOperations.list_secrets
- 添加操作AuthorizationServerOperations.list_secrets
- 添加操作TenantAccessOperations.list_secrets
- 添加操作SubscriptionOperations.list_secrets
- 添加操作IdentityProviderOperations.list_secrets
- 添加操作OpenIdConnectProviderOperations.list_secrets
- 添加操作组GatewayApiOperations
- 添加操作组PolicyDescriptionOperations
- 添加操作组GatewayHostnameConfigurationOperations
- 添加操作组NamedValueOperations
- 添加操作组GatewayOperations
一般破坏性变更
本版本使用下一代代码生成器,如果在某些导入中可能会引入破坏性更改。总的来说,一些模块被错误地可见/可导入,并已重命名。这解决了由于使用不应首先使用的类而引起的一些问题。
- 无法从
azure.mgmt.apimanagement.api_management_client
导入ApiManagementClient(从azure.mgmt.apimanagement
导入的方式与之前相同) - ApiManagementClientConfiguration的导入已从
azure.mgmt.apimanagement.api_management_client
移动到azure.mgmt.apimanagement
- 来自"models"子模块的模型
MyClass
无法再使用azure.mgmt.apimanagement.models.my_class
导入(从azure.mgmt.apimanagement.models
导入的方式与之前相同) - 来自
operations
子模块的操作类MyClassOperations
无法再使用azure.mgmt.apimanagement.operations.my_class_operations
导入(从azure.mgmt.apimanagement.operations
导入的方式与之前相同)
最后但同样重要的是,HTTP连接池现在默认启用。您应始终将客户端用作上下文管理器,或调用close(),或每个进程最多使用一个客户端。
0.1.0 (2019-05-01)
- 初始发布
项目详情
下载文件
下载适用于您平台的应用程序文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。
源分发
构建分发
azure-mgmt-apimanagement-4.0.1.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5cf509cc02ed8bb4174e682dbb054384203696e5b3ef37f291612c266a47cc0e |
|
MD5 | 15b9c7ab3814f43592679d7a2c90e64e |
|
BLAKE2b-256 | bb6b3c765010c029f1a5314366c35bd227303ea554ebbec26c1667fceecd8c82 |
azure_mgmt_apimanagement-4.0.1-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3ed71ab763dc34413f60bcd416871563127ca8fbf14738728719854f3194c1c2 |
|
MD5 | af6cd6048b4affdf7feb592c9ce1a2d5 |
|
BLAKE2b-256 | 3a0b94e2feac7343867dabfa3128648ed16497525465281d72b4e9d30d4a8ba3 |