Skip to content

Latest commit

 

History

History
309 lines (225 loc) · 12.8 KB

TeamRoleApi.md

File metadata and controls

309 lines (225 loc) · 12.8 KB

opsgenie_swagger.TeamRoleApi

All URIs are relative to https://api.opsgenie.com

Method HTTP request Description
create_team_role POST /v2/teams/{identifier}/roles Create Team Role
delete_team_role DELETE /v2/teams/{identifier}/roles/{teamRoleIdentifier} Delete Team Role
get_team_role GET /v2/teams/{identifier}/roles/{teamRoleIdentifier} Get Team Role
list_team_roles GET /v2/teams/{identifier}/roles List Team Roles
update_team_role PATCH /v2/teams/{identifier}/roles/{teamRoleIdentifier} Update Team Role (Partial)

create_team_role

SuccessResponse create_team_role(identifier, body, team_identifier_type=team_identifier_type)

Create Team Role

Creates a new team role

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.TeamRoleApi(opsgenie_swagger.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
body = opsgenie_swagger.CreateTeamRolePayload() # CreateTeamRolePayload | Request payload of created team role
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)

try:
    # Create Team Role
    api_response = api_instance.create_team_role(identifier, body, team_identifier_type=team_identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamRoleApi->create_team_role: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
body CreateTeamRolePayload Request payload of created team role
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]

delete_team_role

SuccessResponse delete_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type)

Delete Team Role

Deletes a team role using team role 'id' or 'name'

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.TeamRoleApi(opsgenie_swagger.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
team_role_identifier = 'team_role_identifier_example' # str | Identifier of team role which could be team role 'id' or 'name'
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (optional) (default to id)

try:
    # Delete Team Role
    api_response = api_instance.delete_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamRoleApi->delete_team_role: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
team_role_identifier str Identifier of team role which could be team role 'id' or 'name'
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]
identifier_type str Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' [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_role

GetTeamRoleResponse get_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type)

Get Team Role

Returns team role with given 'id' or 'name'

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.TeamRoleApi(opsgenie_swagger.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
team_role_identifier = 'team_role_identifier_example' # str | Identifier of team role which could be team role 'id' or 'name'
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (optional) (default to id)

try:
    # Get Team Role
    api_response = api_instance.get_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamRoleApi->get_team_role: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
team_role_identifier str Identifier of team role which could be team role 'id' or 'name'
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]
identifier_type str Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' [optional] [default to id]

Return type

GetTeamRoleResponse

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_roles

ListTeamRoleResponse list_team_roles(identifier, team_identifier_type=team_identifier_type)

List Team Roles

Returns list of team roles

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.TeamRoleApi(opsgenie_swagger.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)

try:
    # List Team Roles
    api_response = api_instance.list_team_roles(identifier, team_identifier_type=team_identifier_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamRoleApi->list_team_roles: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]

Return type

ListTeamRoleResponse

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_role

SuccessResponse update_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type, body=body)

Update Team Role (Partial)

Updates the team role using team role 'id' or 'name'

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.TeamRoleApi(opsgenie_swagger.ApiClient(configuration))
identifier = 'identifier_example' # str | Identifier of the team
team_role_identifier = 'team_role_identifier_example' # str | Identifier of team role which could be team role 'id' or 'name'
team_identifier_type = 'id' # str | Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' (optional) (default to id)
identifier_type = 'id' # str | Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' (optional) (default to id)
body = opsgenie_swagger.UpdateTeamRolePayload() # UpdateTeamRolePayload | Request payload of update team role (optional)

try:
    # Update Team Role (Partial)
    api_response = api_instance.update_team_role(identifier, team_role_identifier, team_identifier_type=team_identifier_type, identifier_type=identifier_type, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TeamRoleApi->update_team_role: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Identifier of the team
team_role_identifier str Identifier of team role which could be team role 'id' or 'name'
team_identifier_type str Type of the identifier. Possible values are 'id' and 'name'. Default value is 'id' [optional] [default to id]
identifier_type str Type of the identifier that is provided as an in-line parameter. Possible values are 'id' or 'name' [optional] [default to id]
body UpdateTeamRolePayload Request payload of update team role [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]