Share via


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

NotificationProperties

Zamanlanmış eylem türüne göre bildirim özellikleri.

properties.schedule True

ScheduleProperties

Zamanlanmış eylemin zamanlaması.

properties.status True

ScheduledActionStatus

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

ScheduledActionKind

Zamanlanmış eylem türü.

properties.fileDestination

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.
Paylaşılan zamanlanmış eylem için (Kapsama Göre Oluştur veya Güncelleştir), Maliyet Yönetimi kapsamı abonelik kapsamı için 'subscriptions/{subscriptionId}' olabilir, ResourceGroup kapsamı için 'subscriptions/{subscriptionId}/resourceGroupName}', Faturalama Hesabı kapsamı için 'providers/Microsoft.Billing/billingAccountId}', 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' bölüm kapsamı için 'providers/Microsoft. EnrollmentAccount kapsamı için Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' BillingProfile kapsamı için 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}', InvoiceSection kapsamı için 'providers/Microsoft.Billing/billingAccountId}/invoiceSections/{invoiceSectionId}', için '/providers/Microsoft.CostManagement/externalBillingAccountName}' ExternalSubscription kapsamı için ExternalBillingAccount kapsamı ve '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' .

Yanıtlar

Name Tür Description
200 OK

ScheduledAction

Tamam ögesini seçin. İstek başarılı oldu.

201 Created

ScheduledAction

Oluşturulan.

Other Status Codes

ErrorResponseWithNestedDetails

İş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

CreateOrUpdateInsightAlertScheduledActionByScope
CreateOrUpdateScheduledActionByScope

CreateOrUpdateInsightAlertScheduledActionByScope

Sample Request

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"
  }
}

Sample Response

{
  "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

Sample Request

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"
  }
}

Sample Response

{
  "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
createdByType

Kaynağı oluşturan kimliğin türü.

DaysOfWeek

Haftanın Günleri.

ErrorDetailsWithNestedDetails

Hatanın ayrıntıları.

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.

FileDestination

Görünüm verilerinin hedefi. Bu isteğe bağlıdır. Şu anda yalnızca CSV biçimi desteklenmektedir.

FileFormat

Görünüm verilerinin hedefi. Şu anda yalnızca CSV biçimi desteklenmektedir.

NotificationProperties

Zamanlanmış eylem bildiriminin özellikleri.

ScheduledAction

Zamanlanmış eylem tanımı.

ScheduledActionKind

Zamanlanmış eylem türü.

ScheduledActionStatus

Zamanlanan eylemin durumu.

ScheduleFrequency

Zamanlamanın sıklığı.

ScheduleProperties

Zamanlamanın özellikleri.

systemData

Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.

WeeksOfMonth

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

ErrorDetailsWithNestedDetails[]

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

ErrorDetailsWithNestedDetails

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

FileFormat[]

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

ScheduledActionKind

Zamanlanmış eylem türü.

name

string

Kaynağın adı

properties.displayName

string

Zamanlanmış eylem adı.

properties.fileDestination

FileDestination

Görünüm verilerinin hedef biçimi. Bu isteğe bağlıdır.

properties.notification

NotificationProperties

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

ScheduleProperties

Zamanlanmış eylemin zamanlaması.

properties.scope

string

Özel zamanlanmış eylem (Oluştur veya Güncelleştir) için kapsam boş olur.
Paylaşılan zamanlanmış eylem için (Kapsama Göre Oluştur veya Güncelleştir), Maliyet Yönetimi kapsamı abonelik kapsamı için 'subscriptions/{subscriptionId}' olabilir, ResourceGroup kapsamı için 'subscriptions/{subscriptionId}/resourceGroupName}', Faturalama Hesabı kapsamı için 'providers/Microsoft.Billing/billingAccountId}', 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' bölüm kapsamı için 'providers/Microsoft. EnrollmentAccount kapsamı için Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' BillingProfile kapsamı için 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}', InvoiceSection kapsamı için 'providers/Microsoft.Billing/billingAccountId}/invoiceSections/{invoiceSectionId}', için '/providers/Microsoft.CostManagement/externalBillingAccountName}' ExternalSubscription kapsamı için ExternalBillingAccount kapsamı ve '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' .

properties.status

ScheduledActionStatus

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

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
Email

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

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

ScheduleFrequency

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

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

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

createdByType

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