Skip to content

Latest commit

 

History

History
348 lines (249 loc) · 11.3 KB

TeamApi.md

File metadata and controls

348 lines (249 loc) · 11.3 KB

swagger_client.TeamApi

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)

create_team

SuccessResponse create_team(body)

Create Team

Creates a new team

Example

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)

Parameters

Name Type Description Notes
body CreateTeamPayload Request payload of created team

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_team

SuccessResponse delete_team(identifier, identifier_type=identifier_type)

Delete Team

Delete team with given id or name

Example

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)

Parameters

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]

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_team

GetTeamResponse get_team(identifier, identifier_type=identifier_type)

Get Team

Returns team with given 'id' or 'name'

Example

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)

Parameters

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]

Return type

GetTeamResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_team_logs

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

Example

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)

Parameters

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]

Return type

ListTeamLogsResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_teams

ListTeamsResponse list_teams()

List Teams

Return list of teams

Example

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)

Parameters

This endpoint does not need any parameter.

Return type

ListTeamsResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_team

SuccessResponse update_team(identifier, body=body)

Update Team (Partial)

Update team with given id

Example

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)

Parameters

Name Type Description Notes
identifier str Identifier of the team
body UpdateTeamPayload Request payload of update team action [optional]

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]