Help Center/ EventGrid/ API Reference/ APIs/ Event Subscription Management/ Updating an Event Subscription Source
Updated on 2023-05-24 GMT+08:00

Updating an Event Subscription Source

Function

This API is used to update an event subscription source.

URI

PUT /v1/{project_id}/subscriptions/{subscription_id}/sources/{source_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant project ID.

subscription_id

Yes

String

ID of the event subscription.

source_id

Yes

String

ID of the event subscription source.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 16384

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

id

No

String

ID of the subscription source, which must be globally unique. If the subscription source with the specified ID exists, the subscription source is updated. Otherwise, the subscription source is created. If no ID is specified, the system automatically generates an ID when creating the subscription source. Only lowercase letters, digits, and hyphens (-) are allowed. It must start with a letter or digit.

Minimum: 32

Maximum: 64

name

Yes

String

Name of the event subscription source.

Maximum: 128

provider_type

Yes

String

Provider type of the event subscription source.

Enumeration values:

  • CUSTOM

  • OFFICIAL

detail

No

Object

List of event subscription source parameters. The total length of this field after serialization cannot exceed 1024 bytes.

filter

Yes

Object

Filtering rule of the event subscription source. The total length of this field after serialization cannot exceed 2048 bytes.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-Request-Id

String

This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname.

Table 5 Response body parameters

Parameter

Type

Description

id

String

ID of the event subscription source.

name

String

Name of the event subscription source.

provider_type

String

Provider type of the event subscription source.

detail

Object

List of event subscription source parameters.

filter

Object

Filtering rule of the event subscription source.

created_time

String

Time when the event subscription is created.

updated_time

String

Time when the event subscription is updated.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Example Requests

Update an event subscription source.

/v1/{project_id}/subscriptions/{subscription_id}/sources/{source_id}

{
  "id" : "{{sub-source-id}}",
  "name" : "{{sub-source-name}}",
  "provider_type" : "CUSTOM",
  "detail" : {
    "test" : "001"
  },
  "filter" : {
    "source" : [ {
      "op" : "StringIn",
      "values" : [ "{{sub-source-name}}" ]
    } ]
  }
}

Example Responses

Status code: 400

{
  "error_code" : "EG.00014000",
  "error_msg" : "Bad request"
}

Status code: 401

{
  "error_code" : "EG.00014010",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

{
  "error_code" : "EG.00014030",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

{
  "error_code" : "EG.00014040",
  "error_msg" : "Not request resource found"
}

Status code: 500

{
  "error_code" : "EG.00015000",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Information

400

Invalid request.

401

Unauthorized.

403

Access denied.

404

Resource not found.

500

Internal service error.

Error Codes

See Error Codes.