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 參數

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

string

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

subscriptionId
path True

string

目標訂用帳戶的標識碼。

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 版本。

要求本文

名稱 類型 Description
properties.plan

TablePlanEnum

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

properties.restoredLogs

RestoredLogs

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

properties.retentionInDays

integer

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

properties.schema

Schema

資料表結構描述。

properties.searchResults

SearchResults

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

properties.totalRetentionInDays

integer

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

回應

名稱 類型 Description
200 OK

Table

確定回應定義。

202 Accepted

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

Other Status Codes

ErrorResponse

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

安全性

azure_auth

Azure Active Directory OAuth2 Flow

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

Scopes

名稱 Description
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

定義

名稱 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

string

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

guid

string

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

ip

string

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

uri

string

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

ColumnTypeEnum

資料行資料類型。

名稱 類型 Description
boolean

string

dateTime

string

dynamic

string

guid

string

int

string

long

string

real

string

string

string

createdByType

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

名稱 類型 Description
Application

string

Key

string

ManagedIdentity

string

User

string

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

string

數據表狀態正在刪除。

InProgress

string

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

Succeeded

string

數據表狀態穩定且沒有變更,數據表會解除鎖定並開啟以供新更新使用。

Updating

string

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

RestoredLogs

還原參數。

名稱 類型 Description
azureAsyncOperationId

string

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

endRestoreTime

string

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

sourceTable

string

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

startRestoreTime

string

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

ResultStatistics

搜尋作業執行統計數據。

名稱 類型 Description
ingestedRecords

integer

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

progress

number

搜尋作業完成百分比。

scannedGb

number

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

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

依 UTC (UTC) 結束搜尋的時間戳

limit

integer

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

query

string

搜尋作業查詢。

sourceTable

string

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

startSearchTime

string

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

SourceEnum

數據表的建立者。

名稱 類型 Description
customer

string

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

microsoft

string

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

systemData

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

名稱 類型 Description
createdAt

string

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

createdBy

string

建立資源的身分識別。

createdByType

createdByType

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

lastModifiedAt

string

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

lastModifiedBy

string

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

lastModifiedByType

createdByType

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

Table

工作區數據表定義。

名稱 類型 Description
id

string

資源的完整資源識別碼。 Ex - /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

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

名稱 類型 Description
Analytics

string

允許監視和分析的記錄。

Basic

string

調整為支援大量低值詳細資訊記錄的記錄。

TableSubTypeEnum

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

名稱 類型 Description
Any

string

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

Classic

string

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

DataCollectionRuleBased

string

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

TableTypeEnum

數據表的建立者。

名稱 類型 Description
CustomLog

string

自訂記錄數據表。

Microsoft

string

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

RestoredLogs

string

還原的數據。

SearchResults

string

搜尋作業所收集的數據。