Monitors - Create
创建监视器资源。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}?api-version=2025-06-11
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
monitor
|
path | True |
string minLength: 2maxLength: 32 pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]+$ |
监视资源名称 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| location | True |
string |
资源所在的地理位置 |
| identity | |||
| properties |
特定于监视资源的属性。 |
||
| sku | |||
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“DatadogMonitorResource”更新作成功 |
|
| 201 Created |
资源“DatadogMonitorResource”创建作成功 标头
|
|
| Other Status Codes |
意外错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Monitors_Create
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor?api-version=2025-06-11
{
"location": "West US",
"properties": {
"datadogOrganizationProperties": {
"name": "myOrg",
"cspm": false,
"enterpriseAppId": "00000000-0000-0000-0000-000000000000",
"id": "myOrg123",
"linkingAuthCode": "someAuthCode",
"linkingClientId": "00000000-0000-0000-0000-000000000000",
"resourceCollection": false
},
"monitoringStatus": "Enabled",
"userInfo": {
"name": "Alice",
"emailAddress": "alice@microsoft.com",
"phoneNumber": "123-456-7890"
}
},
"sku": {
"name": "free_Monthly"
},
"tags": {
"Environment": "Dev"
}
}
示例响应
{
"name": "myMonitor",
"type": "Microsoft.Datadog/monitors",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor",
"location": "West US",
"properties": {
"datadogOrganizationProperties": {
"name": "myOrg",
"enterpriseAppId": null,
"id": "myOrg123",
"linkingAuthCode": null,
"linkingClientId": null
},
"liftrResourceCategory": "MonitorLogs",
"liftrResourcePreference": 1,
"monitoringStatus": "Enabled",
"provisioningState": "Succeeded"
},
"sku": {
"name": "free_Monthly"
},
"tags": {
"Environment": "Dev"
}
}
{
"name": "myMonitor",
"type": "Microsoft.Datadog/monitors",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor",
"location": "West US",
"properties": {
"datadogOrganizationProperties": {
"name": "myOrg",
"id": "myOrg123"
},
"liftrResourceCategory": "MonitorLogs",
"liftrResourcePreference": 1,
"monitoringStatus": "Enabled",
"provisioningState": "Accepted"
},
"sku": {
"name": "free_Monthly"
},
"tags": {
"Environment": "Dev"
}
}
定义
| 名称 | 说明 |
|---|---|
|
created |
创建资源的标识的类型。 |
|
Datadog |
具体跟踪的资源类型可以通过使用特定属性类型将此类型别名创建。 |
|
Datadog |
指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Identity |
|
|
Liftr |
|
|
Managed |
指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。 |
|
Marketplace |
指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。 |
|
Monitoring |
指定是否启用或禁用资源监视的标志。 |
|
Monitor |
特定于监视资源的属性。 |
|
Provisioning |
|
|
Resource |
|
|
system |
与创建和上次修改资源相关的元数据。 |
|
User |
包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DatadogMonitorResource
具体跟踪的资源类型可以通过使用特定属性类型将此类型别名创建。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| identity | ||
| location |
string |
资源所在的地理位置 |
| name |
string |
资源的名称 |
| properties |
特定于监视资源的属性。 |
|
| sku | ||
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
DatadogOrganizationProperties
指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。
| 名称 | 类型 | 说明 |
|---|---|---|
| apiKey |
string (password) |
与 Datadog 组织关联的 Api 密钥。 |
| applicationKey |
string (password) |
与 Datadog 组织关联的应用程序密钥。 |
| cspm |
boolean |
描述云安全状况管理状态的配置。 这会收集订阅中所有资源的配置信息,并跟踪符合行业基准。 |
| enterpriseAppId |
string |
用于单一登录的企业应用的 ID。 |
| id |
string |
Datadog 组织的 ID。 |
| linkingAuthCode |
string (password) |
用于链接到现有 Datadog 组织的身份验证代码。 |
| linkingClientId |
string (password) |
用于交换身份验证令牌以链接组织的现有client_id。 |
| name |
string |
Datadog 组织的名称。 |
| redirectUri |
string |
用于链接的重定向 URI。 |
| resourceCollection |
boolean |
描述资源收集状态的配置。 这将收集订阅中所有资源的配置信息。 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
IdentityProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| principalId |
string |
标识 ID。 |
| tenantId |
string |
资源的租户 ID。 |
| type |
指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。 |
LiftrResourceCategories
| 值 | 说明 |
|---|---|
| Unknown | |
| MonitorLogs |
ManagedIdentityTypes
指定 Datadog Monitor 的标识类型。 目前,唯一允许的值是“SystemAssigned”。
| 值 | 说明 |
|---|---|
| SystemAssigned | |
| UserAssigned |
MarketplaceSubscriptionStatus
指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。
| 值 | 说明 |
|---|---|
| Provisioning | |
| Active | |
| Suspended | |
| Unsubscribed |
MonitoringStatus
指定是否启用或禁用资源监视的标志。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
MonitorProperties
特定于监视资源的属性。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| datadogOrganizationProperties |
指定 Datadog 组织名称。 在链接到现有组织、ID、ApiKey 和 Applicationkey 的情况下,也需要使用 Applicationkey。 |
||
| liftrResourceCategory | |||
| liftrResourcePreference |
integer (int32) |
资源的优先级。 |
|
| marketplaceSubscriptionStatus |
指定资源的市场订阅状态的标志。 如果未及时付款,资源将处于挂起状态。 |
||
| monitoringStatus | Enabled |
指定是否启用或禁用资源监视的标志。 |
|
| provisioningState | |||
| userInfo |
包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。 |
ProvisioningState
| 值 | 说明 |
|---|---|
| Accepted | |
| Creating | |
| Updating | |
| Deleting | |
| Succeeded | |
| Failed | |
| Canceled | |
| Deleted | |
| NotSpecified |
ResourceSku
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
采用 {PlanId} 格式的 SKU 的名称。 对于 Terraform,唯一允许的值是“Linked”。 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
UserInfo
包括姓名、电子邮件和(可选)电话号码。 用户信息不能为 null。
| 名称 | 类型 | 说明 |
|---|---|---|
| emailAddress |
string pattern: ^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$ |
Datadog 用于联系用户的电子邮件(如果需要) |
| name |
string maxLength: 50 |
用户名 |
| phoneNumber |
string maxLength: 40 |
Datadog 用于联系用户的电话号码(如果需要) |