你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Broker Listener - Create Or Update

创建 BrokerListenerResource

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}?api-version=2025-04-01

URI 参数

名称 必需 类型 说明
brokerName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

中转站的名称。

instanceName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

实例的名称。

listenerName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

实例代理侦听器资源的名称

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

名称 必需 类型 说明
extendedLocation True

ExtendedLocation

资源的边缘位置。

properties

BrokerListenerProperties

此资源的资源特定属性。

响应

名称 类型 说明
200 OK

BrokerListenerResource

资源“BrokerListenerResource”更新作成功

201 Created

BrokerListenerResource

资源“BrokerListenerResource”创建作成功

标头

  • Azure-AsyncOperation: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

BrokerListener_CreateOrUpdate
BrokerListener_CreateOrUpdate_Complex
BrokerListener_CreateOrUpdate_Simple

BrokerListener_CreateOrUpdate

示例请求

PUT https://management.azure.com/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123?api-version=2025-04-01

{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "ports": [
      {
        "authenticationRef": "tjvdroaqqy",
        "authorizationRef": "inxhvxnwswyrvt",
        "nodePort": 7281,
        "port": 1268,
        "protocol": "Mqtt",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "duration": "qmpeffoksron",
            "secretName": "oagi",
            "renewBefore": "hutno",
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "kind": "Issuer",
              "name": "ocwoqpgucvjrsuudtjhb"
            },
            "privateKey": {
              "algorithm": "Ec256",
              "rotationPolicy": "Always"
            },
            "san": {
              "dns": [
                "xhvmhrrhgfsapocjeebqtnzarlj"
              ],
              "ip": [
                "zbgugfzcgsmegevzktsnibyuyp"
              ]
            }
          },
          "manual": {
            "secretRef": "secret-name"
          }
        }
      }
    ],
    "serviceType": "ClusterIp"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  }
}

示例响应

{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "ports": [
      {
        "authenticationRef": "tjvdroaqqy",
        "authorizationRef": "inxhvxnwswyrvt",
        "nodePort": 7281,
        "port": 1268,
        "protocol": "Mqtt",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "duration": "qmpeffoksron",
            "secretName": "oagi",
            "renewBefore": "hutno",
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "kind": "Issuer",
              "name": "ocwoqpgucvjrsuudtjhb"
            },
            "privateKey": {
              "algorithm": "Ec256",
              "rotationPolicy": "Always"
            },
            "san": {
              "dns": [
                "xhvmhrrhgfsapocjeebqtnzarlj"
              ],
              "ip": [
                "zbgugfzcgsmegevzktsnibyuyp"
              ]
            }
          },
          "manual": {
            "secretRef": "secret-name"
          }
        }
      }
    ],
    "serviceType": "ClusterIp",
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "ports": [
      {
        "authenticationRef": "tjvdroaqqy",
        "authorizationRef": "inxhvxnwswyrvt",
        "nodePort": 7281,
        "port": 1268,
        "protocol": "Mqtt",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "duration": "qmpeffoksron",
            "secretName": "oagi",
            "renewBefore": "hutno",
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "kind": "Issuer",
              "name": "ocwoqpgucvjrsuudtjhb"
            },
            "privateKey": {
              "algorithm": "Ec256",
              "rotationPolicy": "Always"
            },
            "san": {
              "dns": [
                "xhvmhrrhgfsapocjeebqtnzarlj"
              ],
              "ip": [
                "zbgugfzcgsmegevzktsnibyuyp"
              ]
            }
          },
          "manual": {
            "secretRef": "secret-name"
          }
        }
      }
    ],
    "serviceType": "ClusterIp",
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}

BrokerListener_CreateOrUpdate_Complex

示例请求

PUT https://management.azure.com/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123?api-version=2025-04-01

{
  "properties": {
    "serviceType": "LoadBalancer",
    "ports": [
      {
        "port": 8080,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets"
      },
      {
        "port": 8443,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "name": "example-issuer",
              "kind": "Issuer"
            }
          }
        }
      },
      {
        "port": 1883,
        "authenticationRef": "example-authentication"
      },
      {
        "port": 8883,
        "authenticationRef": "example-authentication",
        "tls": {
          "mode": "Manual",
          "manual": {
            "secretRef": "example-secret"
          }
        }
      }
    ]
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  }
}

示例响应

{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "serviceType": "LoadBalancer",
    "ports": [
      {
        "port": 8080,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets"
      },
      {
        "port": 8443,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "name": "example-issuer",
              "kind": "Issuer"
            }
          }
        }
      },
      {
        "port": 1883,
        "authenticationRef": "example-authentication"
      },
      {
        "port": 8883,
        "authenticationRef": "example-authentication",
        "tls": {
          "mode": "Manual",
          "manual": {
            "secretRef": "example-secret"
          }
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "serviceType": "LoadBalancer",
    "ports": [
      {
        "port": 8080,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets"
      },
      {
        "port": 8443,
        "authenticationRef": "example-authentication",
        "protocol": "WebSockets",
        "tls": {
          "mode": "Automatic",
          "certManagerCertificateSpec": {
            "issuerRef": {
              "group": "jtmuladdkpasfpoyvewekmiy",
              "name": "example-issuer",
              "kind": "Issuer"
            }
          }
        }
      },
      {
        "port": 1883,
        "authenticationRef": "example-authentication"
      },
      {
        "port": 8883,
        "authenticationRef": "example-authentication",
        "tls": {
          "mode": "Manual",
          "manual": {
            "secretRef": "example-secret"
          }
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}

BrokerListener_CreateOrUpdate_Simple

示例请求

PUT https://management.azure.com/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123?api-version=2025-04-01

{
  "properties": {
    "ports": [
      {
        "port": 1883
      }
    ]
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  }
}

示例响应

{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "serviceType": "LoadBalancer",
    "ports": [
      {
        "port": 1883
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "serviceName": "tpfiszlapdpxktx",
    "serviceType": "LoadBalancer",
    "ports": [
      {
        "port": 1883
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "qmbrfwcpwwhggszhrdjv",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/listeners/resource-name123",
  "name": "hoqjaachratt",
  "type": "hizbknwegcdaeh",
  "systemData": {
    "createdBy": "ssvaslsmudloholronopqyxjcu",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "gnicpuszwd",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}

定义

名称 说明
BrokerListenerProperties

定义 Broker 侦听器。 侦听器是代理从客户端接受连接的端口集合。

BrokerListenerResource

实例代理资源

BrokerProtocolType

代理协议类型

CertManagerCertificateSpec

使用证书管理器进行自动 TLS 服务器证书管理

CertManagerIssuerKind

CertManagerIssuerKind 属性

CertManagerIssuerRef

Cert-Manager issuerRef 属性

CertManagerPrivateKey

证书管理器私钥属性

createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ExtendedLocation

扩展位置是 Azure 位置的扩展。 他们提供了一种使用已启用 Azure ARC 的 Kubernetes 群集作为部署 Azure 服务实例的目标位置的方法。

ExtendedLocationType

已接受 ExtendedLocation 的枚举类型。

ListenerPort

定义 BrokerListener 侦听的 TCP 端口。

PrivateKeyAlgorithm

私钥算法类型。

PrivateKeyRotationPolicy

私钥轮换策略。

ProvisioningState

定义资源状态的枚举。

SanForCert

证书的使用者可选名称(SAN)。

ServiceType

侦听器支持的 Kubernetes 服务类型

systemData

与创建和上次修改资源相关的元数据。

TlsCertMethod

不同 TLS 类型的集合,一次只需要支持其中一个枚举

TlsCertMethodMode

代理身份验证模式

X509ManualCertificate

X509 证书身份验证属性。

BrokerListenerProperties

定义 Broker 侦听器。 侦听器是代理从客户端接受连接的端口集合。

名称 类型 默认值 说明
ports

ListenerPort[]

此侦听器接受客户端连接的端口。

provisioningState

ProvisioningState

上次作的状态。

serviceName

string

此侦听器的 Kubernetes 服务名称。

serviceType

ServiceType

ClusterIp

此侦听器的 Kubernetes 服务类型。

BrokerListenerResource

实例代理资源

名称 类型 说明
extendedLocation

ExtendedLocation

资源的边缘位置。

id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties

BrokerListenerProperties

此资源的资源特定属性。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

type

string

资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

BrokerProtocolType

代理协议类型

说明
Mqtt

协议代理

WebSockets

protocol websocket

CertManagerCertificateSpec

使用证书管理器进行自动 TLS 服务器证书管理

名称 类型 说明
duration

string

证书的生存期。 必须使用 Go 时间指定。持续时间格式(h|m|s)。 例如 240 小时 240 小时 45 米,45 分钟。

issuerRef

CertManagerIssuerRef

cert-manager issuerRef。

privateKey

CertManagerPrivateKey

证书私钥的类型。

renewBefore

string

何时开始续订证书。 必须使用 Go 时间指定。持续时间格式(h|m|s)。 例如 240 小时 240 小时 45 米,45 分钟。

san

SanForCert

要包含在证书中的其他使用者可选名称(SAN)。

secretName

string

用于存储服务器证书的机密。 将覆盖任何现有数据。 这是通过标识名称而不是机密本身对机密的引用。

CertManagerIssuerKind

CertManagerIssuerKind 属性

说明
ClusterIssuer

ClusterIssuer 类型。

Issuer

颁发者类型。

CertManagerIssuerRef

Cert-Manager issuerRef 属性

名称 类型 默认值 说明
group

string

cert-manager.io

颁发者组。

kind

CertManagerIssuerKind

颁发者类型(颁发者或 ClusterIssuer)。

name

string

颁发者的名称。

CertManagerPrivateKey

证书管理器私钥属性

名称 类型 说明
algorithm

PrivateKeyAlgorithm

私钥的算法。

rotationPolicy

PrivateKeyRotationPolicy

cert-manager 私钥 rotationPolicy。

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ExtendedLocation

扩展位置是 Azure 位置的扩展。 他们提供了一种使用已启用 Azure ARC 的 Kubernetes 群集作为部署 Azure 服务实例的目标位置的方法。

名称 类型 说明
name

string

扩展位置的名称。

type

ExtendedLocationType

ExtendedLocation 的类型。

ExtendedLocationType

已接受 ExtendedLocation 的枚举类型。

说明
CustomLocation

CustomLocation 类型

ListenerPort

定义 BrokerListener 侦听的 TCP 端口。

名称 类型 默认值 说明
authenticationRef

string

对客户端身份验证设置的引用。 省略以禁用身份验证。

authorizationRef

string

对客户端授权设置的引用。 省略以禁用授权。

nodePort

integer (int32)

minimum: 0
maximum: 65535

Kubernetes 节点端口。 仅当此端口与 NodePort 侦听器关联时才相关。

port

integer (int32)

minimum: 0
maximum: 65535

用于接受客户端连接的 TCP 端口。

protocol

BrokerProtocolType

Mqtt

用于客户端连接的协议。

tls

TlsCertMethod

此端口的 TLS 服务器证书设置。 省略以禁用 TLS。

PrivateKeyAlgorithm

私钥算法类型。

说明
Ec256

算法 - ec256。

Ec384

算法 - ec384。

Ec521

算法 - ec521。

Ed25519

算法 - ed25519。

Rsa2048

算法 - rsa2048。

Rsa4096

算法 - rsa4096。

Rsa8192

算法 - rsa8192。

PrivateKeyRotationPolicy

私钥轮换策略。

说明
Always

轮换策略 - 始终。

Never

轮换策略 - 从不。

ProvisioningState

定义资源状态的枚举。

说明
Accepted

资源已被接受。

Canceled

资源创建已取消。

Deleting

资源正在删除。

Failed

资源创建失败。

Provisioning

正在预配资源。

Succeeded

已创建资源。

Updating

资源正在更新。

SanForCert

证书的使用者可选名称(SAN)。

名称 类型 说明
dns

string[]

DNS SAN。

ip

string[]

IP 地址 SAN。

ServiceType

侦听器支持的 Kubernetes 服务类型

说明
ClusterIp

群集 IP 服务。

LoadBalancer

负载均衡器服务。

NodePort

节点端口服务。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

TlsCertMethod

不同 TLS 类型的集合,一次只需要支持其中一个枚举

名称 类型 说明
certManagerCertificateSpec

CertManagerCertificateSpec

选项 1 - 使用证书管理器进行自动 TLS 服务器证书管理。

manual

X509ManualCertificate

选项 2 - 通过定义的机密手动管理 TLS 服务器证书。

mode

TlsCertMethodMode

TLS 服务器证书管理模式。

TlsCertMethodMode

代理身份验证模式

说明
Automatic

自动 TLS 服务器证书配置。

Manual

手动 TLS 服务器证书配置。

X509ManualCertificate

X509 证书身份验证属性。

名称 类型 说明
secretRef

string

包含 X.509 客户端证书的 Kubernetes 机密。 这是通过标识名称而不是机密本身对机密的引用。