All Products
Search
Document Center

:SetSubscriptionAttributes

Last Updated:Jun 18, 2024

Modifies the parameters of a subscription.

Authorization

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after these RAM users are granted related permissions. The following table describes the authorization information of this operation. For more information, see Permission policies and examples.

Item

Value

API operation

SetSubscriptionAttributes

Action

mns:SetSubscriptionAttributes

Resource

acs:mns:$region:$accountid:/topics/$topicName/subscriptions/$subscriptionName

Request

A request consists of the following parts:

  • Request line

    PUT /topics/$TopicName/subscriptions/$SubscriptionName?metaoverride=true HTTP/1.1

  • Operation-specific URI parameters

    To modify the parameters of a subscription, you can specify metaoverride=true in the URI.

  • Operation-specific request headers

    None.

  • Request body

    The request body is in the XML format. The request body includes the parameters that are used to modify a subscription.

    Parameter

    Type

    Required

    Example

    Description

    NotifyStrategy

    Boolean

    No

    BACKOFF_RETRY

    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.

    Valid values:

    • BACKOFF_RETRY: retries with a fixed backoff interval.

    • EXPONENTIAL_DECAY_RETRY: retries with exponential backoff.

    For more information, see NotifyStrategy.

    Default value: BACKOFF_RETRY.

Response

A response consists of the following parts:

  • HTTP status code

    HTTP/1.1 204 No Content

  • Operation-specific response headers

    None.

  • Response body

    None.

Examples

Sample requests

PUT /topics/$TopicName/subscriptions/$SubscriptionName?metaoverride=true HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:09:22 GMT
Authorization: MNS 15B4D3461F177624206A:rNT4xclLS297/n0UFYIezzHJ****
x-mns-version: 2015-06-06
<?xml version="1.0" encoding="utf-8"?>
<Subscription xmlns="http://mns.aliyuncs.com/doc/v1/">
    <NotifyStrategy>BACKOFF_RETRY</NotifyStrategy>
</Subscription>

Sample success responses

HTTP/1.1 204 No Content
x-mns-request-id:56667412B2B71C9C1600****
x-mns-version: 2015-06-06

Error codes

Error code

Error message

HTTP status code

Description

SubscriptionNotExist

The subscription you provided does not exits.

404

The error message returned because the specified subscription does not exist. Create a subscription.