若要查看表属性,请调用表 - 获取 API:
GET https://management.chinacloudapi.cn/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}?api-version=2021-12-01-preview
响应正文
名称 |
Type |
说明 |
properties.plan |
字符串 |
表计划。 Analytics , Basic 或 Auxiliary 。 |
properties.retentionInDays |
integer |
表的交互式数据保留期(以天为单位)。 对于 Basic 和 Auxiliiary ,此值为 30 天。 对于 Analytics ,此值介于 4 到 730 天之间。 |
properties.totalRetentionInDays |
integer |
表的总数据保留期,包括交互式和长期保留期。 |
properties.archiveRetentionInDays |
integer |
表的长期保留期(只读、计算)。 |
properties.lastPlanModifiedDate |
String |
上次为此表设置计划的时间。 如果从未对默认设置进行任何更改,则为 NULL(只读)。 |
示例请求
GET https://management.chinacloudapi.cn/subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/Microsoft.OperationalInsights/workspaces/ContosoWorkspace/tables/ContainerLogV2?api-version=2021-12-01-preview
示例响应
状态代码:200
{
"properties": {
"retentionInDays": 8,
"totalRetentionInDays": 8,
"archiveRetentionInDays": 0,
"plan": "Basic",
"lastPlanModifiedDate": "2022-01-01T14:34:04.37",
"schema": {...},
"provisioningState": "Succeeded"
},
"id": "subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/Microsoft.OperationalInsights/workspaces/ContosoWorkspace",
"name": "ContainerLogV2"
}
若要设置表属性,请调用表 - 创建或更新 API。
若要使用 PowerShell 查看表属性,请运行:
Invoke-AzRestMethod -Path "/subscriptions/ContosoSID/resourcegroups/ContosoRG/providers/microsoft.operationalinsights/workspaces/ContosoWorkspace/tables/Heartbeat?api-version=2021-12-01-preview" -Method GET
示例响应
{
"properties": {
"totalRetentionInDays": 30,
"archiveRetentionInDays": 0,
"plan": "Analytics",
"retentionInDaysAsDefault": true,
"totalRetentionInDaysAsDefault": true,
"schema": {
"tableSubType": "Any",
"name": "Heartbeat",
"tableType": "Microsoft",
"standardColumns": [
{
"name": "TenantId",
"type": "guid",
"description": "ID of the workspace that stores this record.",
"isDefaultDisplay": true,
"isHidden": true
},
{
"name": "SourceSystem",
"type": "string",
"description": "Type of agent the data was collected from. Possible values are OpsManager (Windows agent) or Linux.",
"isDefaultDisplay": true,
"isHidden": false
},
{
"name": "TimeGenerated",
"type": "datetime",
"description": "Date and time the record was created.",
"isDefaultDisplay": true,
"isHidden": false
},
<OMITTED>
{
"name": "ComputerPrivateIPs",
"type": "dynamic",
"description": "The list of private IP addresses of the computer.",
"isDefaultDisplay": true,
"isHidden": false
}
],
"solutions": [
"LogManagement"
],
"isTroubleshootingAllowed": false
},
"provisioningState": "Succeeded",
"retentionInDays": 30
},
"id": "/subscriptions/{guid}/resourceGroups/{rg name}/providers/Microsoft.OperationalInsights/workspaces/{ws id}/tables/Heartbeat",
"name": "Heartbeat"
}
使用 Update-AzOperationalInsightsTable cmdlet 设置表属性。