Logger - Create Or Update
Günlükçü oluşturur veya Güncelleştirmeler.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}?api-version=2022-08-01
URI Parametreleri
Name | İçinde | Gerekli | Tür | Description |
---|---|---|---|---|
logger
|
path | True |
string |
Günlükçü tanımlayıcısı. API Management hizmet örneğinde benzersiz olmalıdır. Regex pattern: |
resource
|
path | True |
string |
Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir. |
service
|
path | True |
string |
API Management hizmetinin adı. Regex pattern: |
subscription
|
path | True |
string |
Hedef aboneliğin kimliği. |
api-version
|
query | True |
string |
Bu işlem için kullanılacak API sürümü. |
İstek Başlığı
Name | Gerekli | Tür | Description |
---|---|---|---|
If-Match |
string |
Varlığın ETag'i. Varlık oluştururken gerekli değildir, ancak varlığı güncelleştirirken gereklidir. |
İstek Gövdesi
Name | Gerekli | Tür | Description |
---|---|---|---|
properties.loggerType | True |
Günlükçü türü. |
|
properties.credentials |
object |
azureEventHub günlükçüsü için olay hub'ının adı ve SendRule bağlantı dizesi. applicationInsights günlükçü için izleme anahtarı. |
|
properties.description |
string |
Günlükçü açıklaması. |
|
properties.isBuffered |
boolean |
Yayımlamadan önce kayıtların günlükçüde arabelleğe alınıp alınmayacağı. Varsayılan değerin true olduğu varsayılır. |
|
properties.resourceId |
string |
Günlük hedefinin Azure Kaynak Kimliği (Azure Event Hub kaynağı veya Azure Uygulaması Insights kaynağı). |
Yanıtlar
Name | Tür | Description |
---|---|---|
200 OK |
Mevcut günlükçü başarıyla güncelleştirildi. Headers ETag: string |
|
201 Created |
Günlükçü başarıyla oluşturuldu. Headers ETag: string |
|
Other Status Codes |
İşlemin neden başarısız olduğunu açıklayan hata yanıtı. |
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | kullanıcı hesabınızın kimliğine bürünme |
Örnekler
Api |
Api |
ApiManagementCreateAILogger
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId?api-version=2022-08-01
{
"properties": {
"loggerType": "applicationInsights",
"description": "adding a new logger",
"credentials": {
"instrumentationKey": "11................a1"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "loggerId",
"properties": {
"loggerType": "applicationInsights",
"description": null,
"credentials": {
"instrumentationKey": "{{5a.......2a}}"
},
"isBuffered": false,
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/microsoft.insights/components/airesource"
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/loggerId",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "loggerId",
"properties": {
"loggerType": "applicationInsights",
"description": null,
"credentials": {
"instrumentationKey": "{{5a.......2a}}"
},
"isBuffered": false
}
}
ApiManagementCreateEHLogger
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1?api-version=2022-08-01
{
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"name": "hydraeventhub",
"connectionString": "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "eh1",
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
},
"isBuffered": true
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/loggers/eh1",
"type": "Microsoft.ApiManagement/service/loggers",
"name": "eh1",
"properties": {
"loggerType": "azureEventHub",
"description": "adding a new logger",
"credentials": {
"connectionString": "{{Logger-Credentials-5f28745bbebeeb13cc3f7301}}"
},
"isBuffered": true
}
}
Tanımlar
Name | Description |
---|---|
Error |
Hata Alanı sözleşmesi. |
Error |
Hata Yanıtı. |
Logger |
Günlükçü ayrıntıları. |
Logger |
Günlükçü türü. |
ErrorFieldContract
Hata Alanı sözleşmesi.
Name | Tür | Description |
---|---|---|
code |
string |
Özellik düzeyi hata kodu. |
message |
string |
Özellik düzeyi hatanın insan tarafından okunabilir gösterimi. |
target |
string |
Özellik adı. |
ErrorResponse
Hata Yanıtı.
Name | Tür | Description |
---|---|---|
error.code |
string |
Hizmet tanımlı hata kodu. Bu kod, yanıtta belirtilen HTTP hata kodu için bir alt durum görevi görür. |
error.details |
Doğrulama hatası durumunda istekte gönderilen geçersiz alanların listesi. |
|
error.message |
string |
Hatanın insan tarafından okunabilen gösterimi. |
LoggerContract
Günlükçü ayrıntıları.
Name | Tür | Description |
---|---|---|
id |
string |
Kaynağın tam kaynak kimliği. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
Kaynağın adı |
properties.credentials |
object |
azureEventHub günlükçüsü için olay hub'ının adı ve SendRule bağlantı dizesi. applicationInsights günlükçü için izleme anahtarı. |
properties.description |
string |
Günlükçü açıklaması. |
properties.isBuffered |
boolean |
Yayımlamadan önce kayıtların günlükçüde arabelleğe alınıp alınmayacağı. Varsayılan değerin true olduğu varsayılır. |
properties.loggerType |
Günlükçü türü. |
|
properties.resourceId |
string |
Günlük hedefinin Azure Kaynak Kimliği (Azure Event Hub kaynağı veya Azure Uygulaması Insights kaynağı). |
type |
string |
Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts" |
LoggerType
Günlükçü türü.
Name | Tür | Description |
---|---|---|
applicationInsights |
string |
günlük hedefi olarak İçgörüler'i Azure Uygulaması. |
azureEventHub |
string |
Günlük hedefi olarak Azure Event Hub. |
azureMonitor |
string |
Azure İzleyici |