Scheduled Actions - Create Or Update By Scope
Belirtilen kapsam içinde paylaşılan bir zamanlanmış eylem oluşturun veya güncelleştirin.
PUT https://management.azure.com/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}?api-version=2023-11-01
URI Parametreleri
Name | İçinde | Gerekli | Tür | Description |
---|---|---|---|---|
name
|
path | True |
string |
Zamanlanmış eylem adı. |
scope
|
path | True |
string |
Zamanlanmış eylem işlemleriyle ilişkili kapsam. Buna abonelik kapsamı için 'subscriptions/{subscriptionId}' dahildir, ResourceGroup kapsamı için 'subscriptions/{subscriptionId}/resourceGroupname}', Faturalama Hesabı kapsamı için 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}', Departman kapsamı için 'providers/Microsoft.Billing/billingAccountId}/departments/{departmentId}' Departman kapsamı için 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{ EnrollmentAccount kapsamı için enrollmentAccountId}', BillingProfile kapsamı için 'providers/Microsoft.Billing/billingAccountId}/billingProfiles/{billingProfileId}' InvoiceSection kapsamı için 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}', Dış Faturalama Hesabı kapsamı için 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' ve 'providers/Microsoft. Dış Abonelik kapsamı için CostManagement/externalSubscriptions/{externalSubscriptionName}' . Not: İçgörü Uyarıları yalnızca abonelik kapsamında kullanılabilir. |
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. Bir varlığı güncelleştirirken isteğe bağlıdır ve iyimser eşzamanlılık elde etmek için belirtilebilir. |
İstek Gövdesi
Name | Gerekli | Tür | Description |
---|---|---|---|
properties.displayName | True |
string |
Zamanlanmış eylem adı. |
properties.notification | True |
Zamanlanmış eylem türüne göre bildirim özellikleri. |
|
properties.schedule | True |
Zamanlanmış eylemin zamanlaması. |
|
properties.status | True |
Zamanlanan eylemin durumu. |
|
properties.viewId | True |
string |
Zamanlanmış eylem için kullanılan maliyet analizi viewId değeri. Örneğin, '/providers/Microsoft.CostManagement/views/swaggerExample' |
kind |
Zamanlanmış eylem türü. |
||
properties.fileDestination |
Görünüm verilerinin hedef biçimi. Bu isteğe bağlıdır. |
||
properties.notificationEmail |
string |
Abonelikten çıkma isteklerini ve bildirim e-postalarını alması gereken iletişim noktasının adresini Email. |
|
properties.scope |
string |
Özel zamanlanmış eylem (Oluştur veya Güncelleştir) için kapsam boş olur. |
Yanıtlar
Name | Tür | Description |
---|---|---|
200 OK |
Tamam ögesini seçin. İstek başarılı oldu. |
|
201 Created |
Oluşturulan. |
|
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.
Tür:
oauth2
Akış:
implicit
Yetkilendirme URL’si:
https://login.microsoftonline.com/common/oauth2/authorize
Kapsamlar
Name | Description |
---|---|
user_impersonation | kullanıcı hesabınızın kimliğine bürünme |
Örnekler
Create |
Create |
CreateOrUpdateInsightAlertScheduledActionByScope
Örnek isteği
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource?api-version=2023-11-01
{
"kind": "InsightAlert",
"properties": {
"displayName": "Daily anomaly by resource",
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost anomaly detected in the resource"
},
"schedule": {
"frequency": "Daily",
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
Örnek yanıt
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource",
"name": "dailyAnomalyByResource",
"type": "Microsoft.CostManagement/ScheduledActions",
"kind": "InsightAlert",
"eTag": "\"1d4ff9fe66f1d10\"",
"systemData": {
"createdBy": "testuser",
"createdByType": "User",
"createdAt": "2020-06-18T22:21:51.1287144Z",
"lastModifiedBy": "testuser",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-18T22:21:51.1287144Z"
},
"properties": {
"displayName": "Daily anomaly by resource",
"fileDestination": {
"fileFormats": []
},
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost anomaly detected in the resource"
},
"schedule": {
"frequency": "Daily",
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource",
"name": "dailyAnomalyByResource",
"type": "Microsoft.CostManagement/ScheduledActions",
"kind": "InsightAlert",
"eTag": "\"1d4ff9fe66f1d10\"",
"systemData": {
"createdBy": "testuser",
"createdByType": "User",
"createdAt": "2020-06-18T22:21:51.1287144Z",
"lastModifiedBy": "testuser",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-19T22:21:51.1287144Z"
},
"properties": {
"displayName": "Daily anomaly by resource",
"fileDestination": {
"fileFormats": []
},
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost anomaly detected in the resource"
},
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"schedule": {
"frequency": "Daily",
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
CreateOrUpdateScheduledActionByScope
Örnek isteği
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource?api-version=2023-11-01
{
"kind": "Email",
"properties": {
"displayName": "Monthly Cost By Resource",
"fileDestination": {
"fileFormats": [
"Csv"
]
},
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost by resource this month"
},
"schedule": {
"frequency": "Monthly",
"weeksOfMonth": [
"First",
"Third"
],
"daysOfWeek": [
"Monday"
],
"hourOfDay": 10,
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
Örnek yanıt
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource",
"name": "monthlyCostByResource",
"type": "Microsoft.CostManagement/ScheduledActions",
"kind": "Email",
"eTag": "\"1d4ff9fe66f1d10\"",
"systemData": {
"createdBy": "testuser",
"createdByType": "User",
"createdAt": "2020-06-18T22:21:51.1287144Z",
"lastModifiedBy": "testuser",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-18T22:21:51.1287144Z"
},
"properties": {
"displayName": "Monthly Cost By Resource",
"fileDestination": {
"fileFormats": [
"Csv"
]
},
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost by resource this month"
},
"schedule": {
"frequency": "Monthly",
"weeksOfMonth": [
"First",
"Third"
],
"daysOfWeek": [
"Monday"
],
"hourOfDay": 10,
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
{
"id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource",
"name": "monthlyCostByResource",
"type": "Microsoft.CostManagement/ScheduledActions",
"kind": "Email",
"eTag": "\"1d4ff9fe66f1d10\"",
"systemData": {
"createdBy": "testuser",
"createdByType": "User",
"createdAt": "2020-06-18T22:21:51.1287144Z",
"lastModifiedBy": "testuser",
"lastModifiedByType": "User",
"lastModifiedAt": "2020-06-19T22:21:51.1287144Z"
},
"properties": {
"displayName": "Monthly Cost By Resource",
"notification": {
"to": [
"user@gmail.com",
"team@gmail.com"
],
"subject": "Cost by resource this month"
},
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"schedule": {
"frequency": "Monthly",
"weeksOfMonth": [
"First",
"Third"
],
"daysOfWeek": [
"Monday"
],
"hourOfDay": 10,
"startDate": "2020-06-19T22:21:51.1287144Z",
"endDate": "2021-06-19T22:21:51.1287144Z"
},
"status": "Enabled",
"viewId": "/providers/Microsoft.CostManagement/views/swaggerExample"
}
}
Tanımlar
Name | Description |
---|---|
created |
Kaynağı oluşturan kimliğin türü. |
Days |
Haftanın Günleri. |
Error |
Hatanın ayrıntıları. |
Error |
Hata yanıtı, hizmetin gelen isteği işleyemediğini gösterir. Nedeni hata iletisinde verilmiştir. Bazı Hata yanıtları:
|
File |
Görünüm verilerinin hedefi. Bu isteğe bağlıdır. Şu anda yalnızca CSV biçimi desteklenmektedir. |
File |
Görünüm verilerinin hedefi. Şu anda yalnızca CSV biçimi desteklenmektedir. |
Notification |
Zamanlanmış eylem bildiriminin özellikleri. |
Scheduled |
Zamanlanmış eylem tanımı. |
Scheduled |
Zamanlanmış eylem türü. |
Scheduled |
Zamanlanan eylemin durumu. |
Schedule |
Zamanlamanın sıklığı. |
Schedule |
Zamanlamanın özellikleri. |
system |
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler. |
Weeks |
Ayın haftası. |
createdByType
Kaynağı oluşturan kimliğin türü.
Name | Tür | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
DaysOfWeek
Haftanın Günleri.
Name | Tür | Description |
---|---|---|
Friday |
string |
|
Monday |
string |
|
Saturday |
string |
|
Sunday |
string |
|
Thursday |
string |
|
Tuesday |
string |
|
Wednesday |
string |
ErrorDetailsWithNestedDetails
Hatanın ayrıntıları.
Name | Tür | Description |
---|---|---|
code |
string |
Hata kodu. |
details |
Hatanın ek ayrıntıları. |
|
message |
string |
İşlemin neden başarısız olduğunu belirten hata iletisi. |
ErrorResponseWithNestedDetails
Hata yanıtı, hizmetin gelen isteği işleyemediğini gösterir. Nedeni hata iletisinde verilmiştir.
Bazı Hata yanıtları:
429 TooManyRequests - İstek kısıtlandı. "x-ms-ratelimit-microsoft.consumption-retry-after" üst bilgisinde belirtilen süreyi bekledikten sonra yeniden deneyin.
503 ServiceUnavailable - Hizmet geçici olarak kullanılamıyor. "Retry-After" üst bilgisinde belirtilen süre bekledikten sonra yeniden deneyin.
Name | Tür | Description |
---|---|---|
error |
Hatanın ayrıntıları. |
FileDestination
Görünüm verilerinin hedefi. Bu isteğe bağlıdır. Şu anda yalnızca CSV biçimi desteklenmektedir.
Name | Tür | Description |
---|---|---|
fileFormats |
Görünüm verilerinin hedefi. Şu anda yalnızca CSV biçimi desteklenmektedir. |
FileFormat
Görünüm verilerinin hedefi. Şu anda yalnızca CSV biçimi desteklenmektedir.
Name | Tür | Description |
---|---|---|
Csv |
string |
NotificationProperties
Zamanlanmış eylem bildiriminin özellikleri.
Name | Tür | Description |
---|---|---|
language |
string |
E-postanın yerel ayarı. |
message |
string |
E-postaya eklenecek isteğe bağlı ileti. Uzunluk 250 karakterle sınırlıdır. |
regionalFormat |
string |
E-postadaki tarih/saat ve para birimi değerlerini biçimlendirmek için kullanılan bölgesel biçim. |
subject |
string |
E-postanın konusu. Uzunluk 70 karakterle sınırlıdır. |
to |
string[] |
E-posta adresleri dizisi. |
ScheduledAction
Zamanlanmış eylem tanımı.
Name | Tür | Description |
---|---|---|
eTag |
string |
Kaynak Etag'i. Güncelleştirme çağrıları için eTag isteğe bağlıdır ve iyimser eşzamanlılık elde etmek için belirtilebilir. Önce bir 'GET' çağrısı yaparak ve ardından güncelleştirmeyi gerçekleştirirken istek gövdesinin veya 'If-Match' üst bilgisinin bir parçası olarak en son eTag'i ekleyerek kaynağın eTag'ini getirin. Oluşturma çağrıları için eTag gerekli değildir. |
id |
string |
Kaynağın tam kaynak kimliği. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
kind |
Zamanlanmış eylem türü. |
|
name |
string |
Kaynağın adı |
properties.displayName |
string |
Zamanlanmış eylem adı. |
properties.fileDestination |
Görünüm verilerinin hedef biçimi. Bu isteğe bağlıdır. |
|
properties.notification |
Zamanlanmış eylem türüne göre bildirim özellikleri. |
|
properties.notificationEmail |
string |
Abonelikten çıkma isteklerini ve bildirim e-postalarını alması gereken iletişim noktasının adresini Email. |
properties.schedule |
Zamanlanmış eylemin zamanlaması. |
|
properties.scope |
string |
Özel zamanlanmış eylem (Oluştur veya Güncelleştir) için kapsam boş olur. |
properties.status |
Zamanlanan eylemin durumu. |
|
properties.viewId |
string |
Zamanlanmış eylem için kullanılan maliyet analizi viewId değeri. Örneğin, '/providers/Microsoft.CostManagement/views/swaggerExample' |
systemData |
Zamanlanmış eylem türü. |
|
type |
string |
Kaynağın türü. Örneğin, "Microsoft.Compute/virtualMachines" veya "Microsoft.Storage/storageAccounts" |
ScheduledActionKind
Zamanlanmış eylem türü.
Name | Tür | Description |
---|---|---|
string |
Maliyet analizi verileri e-postayla gönderilir. |
|
InsightAlert |
string |
Maliyet anomalisi bilgileri e-postayla gönderilir. Yalnızca günlük sıklıkta abonelik kapsamında kullanılabilir. Kaynakta anomali algılanmazsa e-posta gönderilmez. |
ScheduledActionStatus
Zamanlanan eylemin durumu.
Name | Tür | Description |
---|---|---|
Disabled |
string |
Zamanlanmış eylem kaydedilir ancak çalıştırılmaz. |
Enabled |
string |
Zamanlanmış eylem kaydedilir ve çalıştırılır. |
Expired |
string |
Zamanlanan eylemin süresi doldu. |
ScheduleFrequency
Zamanlamanın sıklığı.
Name | Tür | Description |
---|---|---|
Daily |
string |
Maliyet analizi verileri her gün e-postayla gönderilir. |
Monthly |
string |
Maliyet analizi verileri her ay e-postayla gönderilir. |
Weekly |
string |
Maliyet analizi verileri her hafta e-postayla gönderilir. |
ScheduleProperties
Zamanlamanın özellikleri.
Name | Tür | Description |
---|---|---|
dayOfMonth |
integer |
Maliyet analizi verilerinin e-postayla gönderileceği UTC günü. 1 ile 31 arasında olmalıdır. Sıklık Aylık olduğunda ve weeksOfMonth veya daysOfWeek'i geçersiz kıldığında bu özellik geçerlidir. |
daysOfWeek |
Maliyet analizi verilerinin e-postayla gönderileceği İngilizce gün adları. Bu özellik sıklık Haftalık veya Aylık olduğunda geçerlidir. |
|
endDate |
string |
Zamanlanan eylemin bitiş tarihi ve saati (UTC). |
frequency |
Zamanlamanın sıklığı. |
|
hourOfDay |
integer |
Maliyet analizi verilerinin e-postayla gönderileceği UTC saati. |
startDate |
string |
Zamanlanan eylemin başlangıç tarihi ve saati (UTC). |
weeksOfMonth |
Maliyet analizi verilerinin e-postayla gönderileceği haftalar. Sıklık Aylık olduğunda ve daysOfWeek ile birlikte kullanıldığında bu özellik geçerlidir. |
systemData
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.
Name | Tür | Description |
---|---|---|
createdAt |
string |
Kaynak oluşturma (UTC) zaman damgası. |
createdBy |
string |
Kaynağı oluşturan kimlik. |
createdByType |
Kaynağı oluşturan kimliğin türü. |
|
lastModifiedAt |
string |
Kaynağın son değişikliğinin zaman damgası (UTC) |
lastModifiedBy |
string |
Kaynağı en son değiştiren kimlik. |
lastModifiedByType |
Kaynağı en son değiştiren kimliğin türü. |
WeeksOfMonth
Ayın haftası.
Name | Tür | Description |
---|---|---|
First |
string |
|
Fourth |
string |
|
Last |
string |
|
Second |
string |
|
Third |
string |