Amazon Simple Notification Service
API Reference (API Version 2010-03-31)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

SetSubscriptionAttributes

Description

The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the topic to a new value.

Request Parameters

For information about the common parameters that all actions use, see Common Parameters.

AttributeName

The name of the attribute you want to set. Only a subset of the subscriptions attributes are mutable.

Valid values: DeliveryPolicy

Type: String

Required: Yes

AttributeValue

The new value for the attribute in JSON format.

Type: String

Required: No

SubscriptionArn

The ARN of the subscription to modify.

Type: String

Required: Yes

Errors

For information about the errors that are common to all actions, see Common Errors.

AuthorizationError

Indicates that the user has been denied access to the requested resource.

HTTP Status Code: 403

InternalError

Indicates an internal service error.

HTTP Status Code: 500

InvalidParameter

Indicates that a request parameter does not comply with the associated constraints.

HTTP Status Code: 400

NotFound

Indicates that the requested resource does not exist.

HTTP Status Code: 404

Examples

Sample Request

    
The following example sets the delivery policy to 5 total retries
  
  http://sns.us-east-1.amazonaws.com/
  ?AttributeValue={"healthyRetryPolicy":{"numRetries":5}}
  &SubscriptionArn=arn%3Aaws%3Asns%3Aus-east-1%3A123456789012%3AMy-Topic%3A80289ba6-0fd4-4079-afb4-ce8c8260f0ca
  &AttributeName=DeliveryPolicy
  &Action=SetSubscriptionAttributes
  &SignatureVersion=2
  &SignatureMethod=HmacSHA256
  &Timestamp=2010-03-31T12%3A00%3A00.000Z
  &AWSAccessKeyId=(AWS Access Key Id)
  &Signature=mQA3nJI%2BcmAIY7r8HCArGElSqPX5JG4UGzF4yo0RygE%3D
  
The JSON format for the DeliveryPolicy AttributeValue (linebreaks added for readability):
{
    "healthyRetryPolicy": 
    {
        "minDelayTarget":  <int>,
        "maxDelayTarget": <int>,
        "numRetries": <int>,
        "numMaxDelayRetries": <int>,
        "backoffFunction": "<linear|arithmetic|geometric|exponential>"
    },
    "throttlePolicy":
    {
        "maxReceivesPerSecond": <int>
    }
}
  

Sample Response

  
<SetSubscriptionAttributesResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
  <ResponseMetadata>
    <RequestId>a8763b99-33a7-11df-a9b7-05d48da6f042</RequestId>
  </ResponseMetadata>
</SetSubscriptionAttributesResponse>