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

Tables - Create Or Update

更新或创建 Log Analytics 工作区表。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}?api-version=2022-10-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

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

subscriptionId
path True

string

目标订阅的 ID。

tableName
path True

string

表的名称。

workspaceName
path True

string

工作区的名称。

Regex pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

api-version
query True

string

要用于此操作的 API 版本。

请求正文

名称 类型 说明
properties.plan

TablePlanEnum

指示系统如何处理引入到此表的日志并收取费用。

properties.restoredLogs

RestoredLogs

启动此表的还原操作的参数。

properties.retentionInDays

integer

表保留天数,介于 4 到 730 之间。 将此属性设置为 -1 将默认为工作区保留期。

properties.schema

Schema

表架构。

properties.searchResults

SearchResults

启动此表的搜索作业的参数。

properties.totalRetentionInDays

integer

表的总保留期(天),介于 4 到 4383 之间。 将此属性设置为 -1 将默认为表保留期。

响应

名称 类型 说明
200 OK

Table

正常响应定义。

202 Accepted

接受的响应定义 (长时间运行的操作) 。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

TablesUpsert

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow?api-version=2022-10-01

{
  "properties": {
    "schema": {
      "name": "AzureNetworkFlow",
      "columns": [
        {
          "name": "MyNewColumn",
          "type": "guid"
        }
      ]
    },
    "retentionInDays": 45,
    "totalRetentionInDays": 70
  }
}

Sample Response

{
  "properties": {
    "schema": {
      "name": "AzureNetworkFlow",
      "tableSubType": "DataCollectionRuleBased",
      "tableType": "Microsoft",
      "columns": [
        {
          "isHidden": false,
          "name": "MyNewColumn",
          "type": "guid",
          "isDefaultDisplay": false
        }
      ],
      "standardColumns": [
        {
          "isHidden": true,
          "name": "TenantId",
          "type": "guid",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "SourceSystem",
          "type": "string",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "TimeGenerated",
          "type": "dateTime",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "AgentID",
          "type": "string",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "SourceIP",
          "type": "string",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "Protocol",
          "type": "string",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "SourcePort",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "DestinationPort",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "TcpFlags",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "Packets",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "Bytes",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "BytesOut",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "DurationInMs",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "RstCount",
          "type": "int",
          "isDefaultDisplay": false
        },
        {
          "isHidden": false,
          "name": "MaxSampleRtt",
          "type": "int",
          "isDefaultDisplay": false
        }
      ],
      "solutions": [
        "LogManagement"
      ]
    },
    "provisioningState": "Succeeded",
    "retentionInDays": 45,
    "totalRetentionInDays": 70,
    "archiveRetentionInDays": 25,
    "retentionInDaysAsDefault": false,
    "totalRetentionInDaysAsDefault": false,
    "plan": "Analytics"
  },
  "id": "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow",
  "name": "AzureNetworkFlow"
}
azure-asyncoperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/providers/Microsoft.OperaitonalInsights/locations/eastus/operationstatuses/62e4d893-d233-4005-988e-a428d9f77076?api-version=2022-10-01

定义

名称 说明
Column

表列。

ColumnDataTypeHintEnum

列数据类型逻辑提示。

ColumnTypeEnum

列数据类型。

createdByType

创建资源的标识类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ProvisioningStateEnum

表的当前预配状态。 如果设置为“正在更新”,则指示由于正在进行的操作而导致的资源锁,禁止对表进行任何更新,直到正在进行的操作结束。

RestoredLogs

还原参数。

ResultStatistics

搜索作业执行统计信息。

Schema

表的架构。

SearchResults

启动此表的搜索作业的参数。

SourceEnum

表的创建者。

systemData

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

Table

工作区数据表定义。

TablePlanEnum

指示系统如何处理引入到此表的日志并收取费用。

TableSubTypeEnum

子类型描述哪些 API 可用于与表交互,以及可用于表的功能。

TableTypeEnum

表的创建者。

Column

表列。

名称 类型 说明
dataTypeHint

ColumnDataTypeHintEnum

列数据类型逻辑提示。

description

string

列说明。

displayName

string

列显示名称。

isDefaultDisplay

boolean

默认显示 。

isHidden

boolean

列隐藏。

name

string

列名称。

type

ColumnTypeEnum

列数据类型。

ColumnDataTypeHintEnum

列数据类型逻辑提示。

名称 类型 说明
armPath

string

Azure 资源模型 (ARM) 路径:/subscriptions/{...}/resourceGroups/{...}/providers/Microsoft。{...}/{...}/{...}/{...}...

guid

string

标准形状 xxxxx-xxxx-xxxx-xxx 后的标准 128 位 GUID

ip

string

标准形状 x.x.x.x/y:y:y:y:y:y:y:y:y 后的标准 V4/V6 IP 地址

uri

string

与 URI 模式匹配的字符串,例如,scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment

ColumnTypeEnum

列数据类型。

名称 类型 说明
boolean

string

dateTime

string

dynamic

string

guid

string

int

string

long

string

real

string

string

string

createdByType

创建资源的标识类型。

名称 类型 说明
Application

string

Key

string

ManagedIdentity

string

User

string

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ProvisioningStateEnum

表的当前预配状态。 如果设置为“正在更新”,则指示由于正在进行的操作而导致的资源锁,禁止对表进行任何更新,直到正在进行的操作结束。

名称 类型 说明
Deleting

string

正在删除表状态。

InProgress

string

表架构稳定,无需更改,表数据将更新。

Succeeded

string

表状态稳定,无需更改,表将解锁并打开,以便进行新的更新。

Updating

string

表架构仍在生成和更新中,在过程完成之前,表当前已锁定以进行任何更改。

RestoredLogs

还原参数。

名称 类型 说明
azureAsyncOperationId

string

搜索结果表异步操作 ID。

endRestoreTime

string

在 UTC) (结束还原的时间戳。

sourceTable

string

要从中还原数据的表。

startRestoreTime

string

从 (UTC) 开始还原的时间戳。

ResultStatistics

搜索作业执行统计信息。

名称 类型 说明
ingestedRecords

integer

搜索作业返回的行数。

progress

number

搜索作业完成百分比。

scannedGb

number

搜索作业:扫描的数据量。

Schema

表的架构。

名称 类型 说明
categories

string[]

表类别。

columns

Column[]

表自定义列的列表。

description

string

表说明。

displayName

string

表显示名称。

labels

string[]

表标签。

name

string

表名。

solutions

string[]

表所属的解决方案列表

source

SourceEnum

表的创建者。

standardColumns

Column[]

表标准列的列表。

tableSubType

TableSubTypeEnum

子类型描述哪些 API 可用于与表交互,以及可用于表的功能。

tableType

TableTypeEnum

表的创建者。

SearchResults

启动此表的搜索作业的参数。

名称 类型 说明
azureAsyncOperationId

string

搜索结果表异步操作 ID。

description

string

搜索作业说明。

endSearchTime

string

按 utc) 结束搜索的时间戳 (

limit

integer

将搜索作业限制为最多返回指定的行数。

query

string

搜索作业查询。

sourceTable

string

搜索作业中使用的表。

startSearchTime

string

从 (UTC) 开始搜索的时间戳

SourceEnum

表的创建者。

名称 类型 说明
customer

string

由工作区所有者创建的表,并且仅在此工作区中找到。

microsoft

string

系统预配的表(通过诊断设置、代理或任何其他标准数据收集方式收集)。

systemData

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

名称 类型 说明
createdAt

string

资源创建时间戳 (UTC) 。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识类型。

lastModifiedAt

string

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

Table

工作区数据表定义。

名称 类型 说明
id

string

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

name

string

资源的名称

properties.archiveRetentionInDays

integer

表数据存档保留期(以天为单位)。 计算结果为 (totalRetentionInDays-retentionInDays)

properties.lastPlanModifiedDate

string

表计划的上次修改时间戳 (UTC) 。

properties.plan

TablePlanEnum

指示系统如何处理引入到此表的日志并收取费用。

properties.provisioningState

ProvisioningStateEnum

表的当前预配状态。 如果设置为“正在更新”,则指示由于正在进行的操作而导致的资源锁,禁止对表进行任何更新,直到正在进行的操作结束。

properties.restoredLogs

RestoredLogs

启动此表的还原操作的参数。

properties.resultStatistics

ResultStatistics

搜索作业执行统计信息。

properties.retentionInDays

integer

表保留期(以天为单位),介于 4 到 730 之间。 将此属性设置为 -1 将默认为工作区保留期。

properties.retentionInDaysAsDefault

boolean

True - 值源自工作区保留期(以天为单位),False - 特定于客户。

properties.schema

Schema

表架构。

properties.searchResults

SearchResults

启动此表的搜索作业的参数。

properties.totalRetentionInDays

integer

表总保留期(以天为单位),介于 4 到 4383 之间。 将此属性设置为 -1 将默认为表保留期。

properties.totalRetentionInDaysAsDefault

boolean

True - 值源自以天为单位的保留期,False - 特定于客户。

systemData

systemData

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

type

string

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

TablePlanEnum

指示系统如何处理引入到此表的日志并收取费用。

名称 类型 说明
Analytics

string

允许监视和分析的日志。

Basic

string

调整为支持高容量低值详细日志的日志。

TableSubTypeEnum

子类型描述哪些 API 可用于与表交互,以及可用于表的功能。

名称 类型 说明
Any

string

用于创建内置表的默认子类型。

Classic

string

指示通过数据收集器 API 或使用 MMA 代理的自定义日志功能创建的表,或创建自定义字段所针对的任何表。

DataCollectionRuleBased

string

表有资格通过数据收集规则支持的任何方式将数据发送到其中:数据收集终结点 API、引入时转换或数据收集规则提供的任何其他机制

TableTypeEnum

表的创建者。

名称 类型 说明
CustomLog

string

自定义日志表。

Microsoft

string

Azure Monitor 收集的标准数据。

RestoredLogs

string

还原的数据。

SearchResults

string

搜索作业收集的数据。