python - 微软 Azure : obtaining public IP on Linux with azure API for Python

标签 python linux azure networking

有人可以给我建议或展示如何通过 Linux 上的 Azure API 获取公共(public) IP 的示例吗?我知道我可以通过 wgetcurl 等方式获取公共(public) IP,但是那些使用外部域的方式我想避免使用。 有一些适用于 Python 的 SDK,但我无法运行任何功能。

我想也许其中之一是我返回我需要的东西:
NetworkInterfaceIPConfigurationsOperations class
NetworkInterfacesOperations class

最佳答案

您应该从 Python 教程开始 https://learn.microsoft.com/en-us/python/azure/python-sdk-azure-get-started?view=azure-python

然后是一些网络示例: https://learn.microsoft.com/en-us/python/api/overview/azure/network?view=azure-python

一旦您熟悉了 NetworkManagementClient 客户端,您就可以:

    result_get = network_client.public_ip_addresses.get(
        resource_group_name,
        public_ip_name,
    )

network_client.public_ip_addresses 是 https://learn.microsoft.com/en-us/python/api/azure.mgmt.network.v2018_02_01.operations.publicipaddressesoperations?view=azure-python 的一个实例

关于python - 微软 Azure : obtaining public IP on Linux with azure API for Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50719739/

相关文章:

c++ - 将 C++ 中的原始字符串数据传递给 Python 程序

Python 子进程 Grep

python - 断管错误 selenium webdriver,当命令之间存在间隙时?

linux - 使用 bash 将日期时间(12 小时)转换为 CSV 文件中的 mysql 日期时间格式

Windows 上带有 Docker 的 Linux 内核与 WSL Linux 内核不匹配

python - 优化列表理解以找到互质数对

c - 进程和线程如何选择

linux - 删除旧的 Vim 配置文件

azure - 如何将 dns 设置为 azure kubernetes(acs) 服务?

asp.net - 如何为每个 Azure 部署槽使用不同的 web.config 文件?