共用方式為


Tables - Create Or Update

更新或建立Log Analytics工作區數據表。

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

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

subscriptionId
path True

string

minLength: 1

目標訂用帳戶的標識碼。

tableName
path True

string

minLength: 4
maxLength: 63
pattern: ^[A-Za-z0-9-_]+$

數據表的名稱。

workspaceName
path True

string

minLength: 4
maxLength: 63
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

工作區的名稱。

api-version
query True

string

minLength: 1

要用於這項作業的 API 版本。

要求本文

名稱 類型 Description
properties.plan

TablePlanEnum

指示系統如何處理並收取內嵌至此數據表的記錄費用。

properties.restoredLogs

RestoredLogs

起始此數據表之還原作業的參數。

properties.retentionInDays

integer (int32)

minimum: 4
maximum: 730

數據表保留天數,介於 4 到 730 之間。 將此屬性設定為 -1 預設為工作區保留期。

properties.schema

Schema

數據表架構。

properties.searchResults

SearchResults

起始此數據表之搜尋作業的參數。

properties.totalRetentionInDays

integer (int32)

minimum: 4
maximum: 4383

數據表總保留天數,介於 4 到 4383 之間。 將此屬性設定為 -1 預設為資料表保留。

回應

名稱 類型 Description
200 OK

Table

確定回應定義。

202 Accepted

接受的回應定義 (長時間執行的作業)。

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

TablesUpsert

範例要求

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

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

範例回覆

{
  "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=2025-02-01
Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperaitonalInsights/workspaces/oiautorest6685/tables/table1_CL/operationresults/62e4d893-d233-4005-988e-a428d9f77076?api-version=2025-02-01

定義

名稱 Description
Column

數據表數據行。

ColumnDataTypeHintEnum

數據行數據類型邏輯提示。

ColumnTypeEnum

數據行數據類型。

createdByType

建立資源的身分識別類型。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

ProvisioningStateEnum

數據表目前的布建狀態。 如果設定為 「更新」,表示因為進行中的作業而造成資源鎖定,則禁止對數據表進行任何更新,直到持續作業結束為止。

RestoredLogs

還原參數。

ResultStatistics

搜尋作業執行統計數據。

Schema

數據表的架構。

SearchResults

起始此數據表之搜尋作業的參數。

SourceEnum

數據表的建立者。

systemData

與建立和上次修改資源相關的元數據。

Table

工作區數據表定義。

TablePlanEnum

指示系統如何處理並收取內嵌至此數據表的記錄費用。

TableSubTypeEnum

子類型描述哪些 API 可用來與數據表互動,以及有哪些功能可供使用。

TableTypeEnum

數據表的建立者。

Column

數據表數據行。

名稱 類型 Description
dataTypeHint

ColumnDataTypeHintEnum

數據行數據類型邏輯提示。

description

string

數據列描述。

displayName

string

數據行顯示名稱。

isDefaultDisplay

boolean

預設會顯示 。

isHidden

boolean

為隱藏資料行。

name

string

數據行名稱。

type

ColumnTypeEnum

數據行數據類型。

ColumnDataTypeHintEnum

數據行數據類型邏輯提示。

Description
armPath

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

guid

標準 128 位 GUID,遵循標準圖形 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx

ip

標準 V4/V6 ip 位址,遵循標準圖形 x.x.x.x/y:y:y

uri

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

ColumnTypeEnum

數據行數據類型。

Description
boolean
dateTime
dynamic
guid
int
long
real
string

createdByType

建立資源的身分識別類型。

Description
Application
Key
ManagedIdentity
User

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細數據。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

ProvisioningStateEnum

數據表目前的布建狀態。 如果設定為 「更新」,表示因為進行中的作業而造成資源鎖定,則禁止對數據表進行任何更新,直到持續作業結束為止。

Description
Deleting

數據表狀態正在刪除。

InProgress

數據表架構穩定且沒有變更,數據表數據會進行更新。

Succeeded

數據表狀態穩定且沒有變更,數據表會解除鎖定並開啟以進行新的更新。

Updating

數據表架構仍在建置和更新中,數據表目前會鎖定任何變更,直到程式完成為止。

RestoredLogs

還原參數。

名稱 類型 Description
azureAsyncOperationId

string

搜尋結果數據表異步作標識碼。

endRestoreTime

string (date-time)

以 (UTC) 結束還原的時間戳。

sourceTable

string

要從中還原數據的數據表。

startRestoreTime

string (date-time)

從 (UTC) 開始還原的時間戳。

ResultStatistics

搜尋作業執行統計數據。

名稱 類型 Description
ingestedRecords

integer (int32)

搜尋作業所傳回的數據列數目。

progress

number

multipleOf: 0.01

搜尋作業完成百分比。

scannedGb

number

multipleOf: 0.01

搜尋作業:掃描的數據量。

Schema

數據表的架構。

名稱 類型 Description
categories

string[]

數據表類別目錄。

columns

Column[]

數據表自定義資料列的清單。

description

string

數據表描述。

displayName

string

數據表顯示名稱。

labels

string[]

數據表標籤。

name

string

數據表名稱。

solutions

string[]

數據表所附屬的解決方案清單

source

SourceEnum

數據表的建立者。

standardColumns

Column[]

數據表標準數據列的清單。

tableSubType

TableSubTypeEnum

子類型描述哪些 API 可用來與數據表互動,以及有哪些功能可供使用。

tableType

TableTypeEnum

數據表的建立者。

SearchResults

起始此數據表之搜尋作業的參數。

名稱 類型 Description
azureAsyncOperationId

string

搜尋結果數據表異步作標識碼。

description

string

搜尋作業描述。

endSearchTime

string (date-time)

結束搜尋的時間戳(UTC)

limit

integer (int32)

限制搜尋作業最多傳回指定的數據列數目。

query

string

搜尋作業查詢。

sourceTable

string

搜尋作業中使用的數據表。

startSearchTime

string (date-time)

從 (UTC) 開始搜尋的時間戳

SourceEnum

數據表的建立者。

Description
customer

工作區擁有者所建立的數據表,而且只能在此工作區中找到。

microsoft

由系統布建的數據表,如透過診斷設定、代理程式或任何其他標準數據收集方式所收集。

systemData

與建立和上次修改資源相關的元數據。

名稱 類型 Description
createdAt

string (date-time)

資源建立的時間戳(UTC)。

createdBy

string

建立資源的身分識別。

createdByType

createdByType

建立資源的身分識別類型。

lastModifiedAt

string (date-time)

上次修改的資源時間戳 (UTC)

lastModifiedBy

string

上次修改資源的身分識別。

lastModifiedByType

createdByType

上次修改資源的身分識別類型。

Table

工作區數據表定義。

名稱 類型 Description
id

string

資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.archiveRetentionInDays

integer (int32)

數據表數據封存保留天數。 計算為 (totalRetentionInDays-retentionInDays)

properties.lastPlanModifiedDate

string

上次修改數據表計劃的時間戳(UTC)。

properties.plan

TablePlanEnum

指示系統如何處理並收取內嵌至此數據表的記錄費用。

properties.provisioningState

ProvisioningStateEnum

數據表目前的布建狀態。 如果設定為 「更新」,表示因為進行中的作業而造成資源鎖定,則禁止對數據表進行任何更新,直到持續作業結束為止。

properties.restoredLogs

RestoredLogs

起始此數據表之還原作業的參數。

properties.resultStatistics

ResultStatistics

搜尋作業執行統計數據。

properties.retentionInDays

integer (int32)

minimum: 4
maximum: 730

數據表保留天數,介於 4 到 730 之間。 將此屬性設定為 -1 預設為工作區保留期。

properties.retentionInDaysAsDefault

boolean

True - 值源自工作區保留天數,False - 客戶專屬。

properties.schema

Schema

數據表架構。

properties.searchResults

SearchResults

起始此數據表之搜尋作業的參數。

properties.totalRetentionInDays

integer (int32)

minimum: 4
maximum: 4383

數據表總保留天數,介於 4 到 4383 之間。 將此屬性設定為 -1 預設為資料表保留。

properties.totalRetentionInDaysAsDefault

boolean

True - 值源自天數的保留期,False - 客戶專屬。

systemData

systemData

與建立和上次修改資源相關的元數據。

type

string

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

TablePlanEnum

指示系統如何處理並收取內嵌至此數據表的記錄費用。

Description
Analytics

允許監視和分析的記錄。

Basic

調整以支援大量低值詳細信息記錄檔的記錄。

TableSubTypeEnum

子類型描述哪些 API 可用來與數據表互動,以及有哪些功能可供使用。

Description
Any

建立內建數據表的預設子類型。

Classic

指出透過數據收集器 API 或 MMA 代理程式的自訂記錄功能所建立的數據表,或建立自定義欄位的任何資料表。

DataCollectionRuleBased

數據表,可透過資料收集規則所支援的任何方式傳送數據:數據收集端點 API、擷取時間轉換,或數據收集規則所提供的任何其他機制

TableTypeEnum

數據表的建立者。

Description
CustomLog

自訂記錄數據表。

Microsoft

Azure 監視器所收集的標準數據。

RestoredLogs

還原的數據。

SearchResults

搜尋作業收集的數據。