GetSubscription

Updated at:

Retrieves the details of a notification subscription.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

gemp:GetSubscription

get

*All Resource

*

None None

Request syntax

POST /notify/subscription/detail HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

subscriptionId

integer

No

The subscription ID.

10

notFilterScopeObjectDeleted

boolean

No

Specifies whether to filter out deleted objects.

Response elements

Element

Type

Description

Example

object

The response structure.

requestId

string

The request ID.

10REQUES-AC5C-4B59-BE11-378F117A6A88

data

object

The returned result.

subscriptionId

integer

The subscription ID.

68

subscriptionTitle

string

The name of the notification subscription.

newTitle

scope

string

The subscription scope type. Valid values:

  • ALL: All.

  • SERVICE: Service.

  • ROUTERULE: Routing rule.

SERVICE

notifyObjectType

string

The notification object type. Valid values:

  • SERVICEGROUP: Service group.

  • USER: User.

USER

expiredType

string

The validity period type. Valid values:

  • LONG_TERM: Long-term.

  • SHORT_TERM: Short-term.

LONG_TERM

period

string

The time period string.

1 month

startTime

string

The validity start time, in the YYYY-MM-DD HH:mm:ss format.

2020-05-09 10:10:10

endTime

string

The validity end time, in the YYYY-MM-DD HH:mm:ss format.

2021-08-09 10:10:10

status

string

The status. Valid values:

  • ENABLE: Enabled.

  • DISABLE: Disabled.

ENABLE

scopeObjectList

array<object>

The subscription scope list.

object

The subscription scope list.

id

integer

The primary key ID.

10

scope

string

The subscription scope type. Valid values:

  • ALL: All.

  • SERVICE: Service.

  • ROUTERULE: Routing rule.

SERVICE

scopeObjectId

integer

The primary key ID of the subscription scope object association table.

10

scopeObject

string

The name of the subscription scope object.

Alibaba Cloud

isValid

integer

Specifies whether the object is valid. Valid values:

  • 0: Invalid.

  • 1: Valid.

1

notifyObjectList

array<object>

The notification object list.

object

The notification object list.

id

integer

The primary key ID.

23

notifyObjectType

integer

The notification object type. Valid values:

  • 0: Service group.

  • 1: User.

1

notifyObjectId

integer

The associated primary key ID.

19

name

string

The name of the notification object.

TestName

notifyStrategyList

array<object>

The notification policy list.

array<object>

The notification subscription list.

instanceType

integer

The subscription instance type. Valid values:

  • 0: Event.

  • 1: Alert.

  • 2: Fault.

0

strategies

array<object>

The policies.

array<object>

The policies.

id

integer

The primary key of the policy.

12

channels

string

The notification channels.

SMS

conditions

array<object>

The conditions.

object

The subscription conditions.

effection

string

The impact scope.

HIGH

problemNotifyType

string

The fault notification type.

PROBLEM_NOTIFY

level

string

The level.

P1

action

string

The event action.

INCIDENT_TRIGGER

periodChannel

object

The channels by time period.

workday

string

The working hours.

DINGDING

nonWorkday

string

The non-working hours.

DINGDING

Examples

Success response

JSON format

{
  "requestId": "10REQUES-AC5C-4B59-BE11-378F117A6A88",
  "data": {
    "subscriptionId": 68,
    "subscriptionTitle": "newTitle",
    "scope": "SERVICE",
    "notifyObjectType": "USER",
    "expiredType": "LONG_TERM",
    "period": "1 month",
    "startTime": "2020-05-09 10:10:10",
    "endTime": "2021-08-09 10:10:10",
    "status": "ENABLE",
    "scopeObjectList": [
      {
        "id": 10,
        "scope": "SERVICE",
        "scopeObjectId": 10,
        "scopeObject": "Alibaba Cloud",
        "isValid": 1
      }
    ],
    "notifyObjectList": [
      {
        "id": 23,
        "notifyObjectType": 0,
        "notifyObjectId": 19,
        "name": "TestName"
      }
    ],
    "notifyStrategyList": [
      {
        "instanceType": 0,
        "strategies": [
          {
            "id": 12,
            "channels": "SMS",
            "conditions": [
              {
                "effection": "HIGH",
                "problemNotifyType": "PROBLEM_NOTIFY",
                "level": "P1",
                "action": "INCIDENT_TRIGGER"
              }
            ],
            "periodChannel": {
              "workday": "DINGDING",
              "nonWorkday": "DINGDING"
            }
          }
        ]
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

404 NotifySubsNotExists The specified subscription does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.