Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

OpsGenie - Python - Api - Timezone

Raphael Benedeti June 21, 2023

Hello! I'm working on a code that uses the opsgenie_sdk library to interact with Opsgenie. However, I'm having difficulties setting the correct time zone for the Brazil location (America/Sao_Paulo). Currently, the data is being returned in UTC format only. I would like to know how I can adjust the code below to use the Brazil time zone:

import opsgenie_sdk

opsgenie_api_key = '__opsgenie_api_key__'
conf = opsgenie_sdk.configuration.Configuration()
conf.api_key['Authorization'] = opsgenie_api_key
api_client = opsgenie_sdk.api_client.ApiClient(configuration=conf)
alert_api = opsgenie_sdk.AlertApi(api_client=api_client)

start_at = 0
max_results = 100

while True:
list_alerts = alert_api.list_alerts(
query='createdAt = "27-09-2022"',
offset=start_at,
limit=max_results
)
print(list_alerts)

I would appreciate any help you can provide! Currently, the data is only being returned in UTC, and I would like to adjust it to use the Brazil time zone.

1 answer

0 votes
Allen Barnard
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2023

Hi @Raphael Benedeti

 

Unfortunately none of our API's currently have that functionality,  I have raised a feature request you can track it here here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events