All URIs are relative to https://api.opsgenie.com
Method | HTTP request | Description |
---|---|---|
create_team | POST /v2/teams | Create Team |
delete_team | DELETE /v2/teams/{identifier} | Delete Team |
get_team | GET /v2/teams/{identifier} | Get Team |
list_team_logs | GET /v2/teams/{identifier}/logs | List Team Logs |
list_teams | GET /v2/teams | List Teams |
update_team | PATCH /v2/teams/{identifier} | Update Team (Partial) |
SuccessResponse create_team(body)
Create Team
Creates a new team
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
body = swagger_client.CreateTeamPayload() # CreateTeamPayload | Request payload of created team
try:
# Create Team
api_response = api_instance.create_team(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->create_team: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | CreateTeamPayload | Request payload of created team |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse delete_team(identifier, identifier_type=identifier_type)
Delete Team
Delete team with given id or name
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
try:
# Delete Team
api_response = api_instance.delete_team(identifier, identifier_type=identifier_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->delete_team: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the team | |
identifier_type | str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' | [optional] [default to id] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetTeamResponse get_team(identifier, identifier_type=identifier_type)
Get Team
Returns team with given 'id' or 'name'
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
try:
# Get Team
api_response = api_instance.get_team(identifier, identifier_type=identifier_type)
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->get_team: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the team | |
identifier_type | str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' | [optional] [default to id] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListTeamLogsResponse list_team_logs(identifier, identifier_type=identifier_type, limit=limit, order=order, offset=offset)
List Team Logs
Return logs of a team given with identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
limit = 56 # int | Maximum number of items to provide in the result. Must be a positive integer value. (optional)
order = 'desc' # str | Sorting order of the result set (optional) (default to desc)
offset = 'offset_example' # str | Key which will be used in pagination (optional)
try:
# List Team Logs
api_response = api_instance.list_team_logs(identifier, identifier_type=identifier_type, limit=limit, order=order, offset=offset)
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->list_team_logs: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the team | |
identifier_type | str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' | [optional] [default to id] |
limit | int | Maximum number of items to provide in the result. Must be a positive integer value. | [optional] |
order | str | Sorting order of the result set | [optional] [default to desc] |
offset | str | Key which will be used in pagination | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListTeamsResponse list_teams()
List Teams
Return list of teams
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
try:
# List Teams
api_response = api_instance.list_teams()
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->list_teams: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse update_team(identifier, body=body)
Update Team (Partial)
Update team with given id
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.TeamApi(swagger_client.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
body = swagger_client.UpdateTeamPayload() # UpdateTeamPayload | Request payload of update team action (optional)
try:
# Update Team (Partial)
api_response = api_instance.update_team(identifier, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling TeamApi->update_team: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
identifier | str | Identifier of the team | |
body | UpdateTeamPayload | Request payload of update team action | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]