Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

AWS Lambda Component Update Error 400

Hi,
I am new to Statuspage and I am currently experiencing an error 400 when I try to update a Statuspage component via AWS Lambda.

This is the code for the lambda function I am using:

 

import requests
import json

def post_to_statuspage(payload):

headers = {'content-type': 'application/json', 'Authorization': 'Oauth a31d80fb-xxxxxx-xxxxx0849' }
url = 'https://api.statuspage.io/v1/pages/0b7rflm22xxx/components/q74nxxx8zt7'
return requests.patch(url=url, data=payload, headers=headers)

def package_data(payload):

data = {'event' : payload }
response = post_to_statuspage(json.dumps(data))
return response.status_code

def lambda_handler(event, context):

alerts = event["component"]
status = []
for alert in alerts:
status.append(package_data(alert))

return status



The test event/payload I am using only has the following:

{
"component": {
"status": "under_maintenance"
}
}

Where could the problem be?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center 8.1 is now available

G’day Bamboo customers, Bamboo DC 8.1 is now available with it the following features and programs: SAML 2.0, OpenID Connect, and Crowd SSO In order to help admins with a simplified user manage...

171 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you