AdminAPI’s property classes for endpoints

splitiorequests.api.workspaces module

Workspaces endpoint classes

Requests and Response classes for Workspaces endpoint

class splitiorequests.api.workspaces.WorkspacesRequests(headers: Dict[str, str], hostname: str, session: Session)

Workspaces endpoints

get_workspaces(offset: int = 0, limit: int = 50, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[WorkspacesResponse]]

Get Workspaces endpoint

Generator that yields all workspaces

Parameters
  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

WorkspacesResponse

class splitiorequests.api.workspaces.WorkspacesResponse(response: Response)

Workspace endpoint response

splitiorequests.api.environments module

Environments endpoint classes

Requests and Response classes for Environment endpoint

class splitiorequests.api.environments.EnvironmentsRequests(headers: Dict[str, str], hostname: str, session: Session)

Environments endpoints

create_environment(wsid: str, environment_name: str, is_production: bool, headers: Optional[Dict[str, str]] = None) EnvironmentsResponse

Create Environment endpoint

Parameters
  • wsid – Workspace ID

  • environment_name – Name of environment to create

  • is_production – Boolean value to indicate if new environment should be Prod env

  • headers – Headers to append to this request

Returns

EnvironmentsResponse object

delete_environment(wsid: str, environment_name_or_id: str, headers: Optional[Dict[str, str]] = None) EnvironmentsResponse

Delete Environment endpoint

Parameters
  • wsid – Workspace ID

  • environment_name_or_id – Environment name or ID

  • headers – Headers to append to this request

Returns

EnvironmentsResponse object

get_environments(wsid: str, headers: Optional[Dict[str, str]] = None) EnvironmentsResponse

Get environment endpoint

Parameters
  • wsid – workspace ID

  • headers – Headers to append to this request

Returns

EnvironmentsResponse object

update_environment(wsid: str, environment_name_or_id: str, old_data: Optional[dict] = None, new_data: Optional[dict] = None, patch_string: Optional[str] = None, headers: Optional[Dict[str, str]] = None) Union[NoReturn, EnvironmentsResponse]

Update Environment endpoint

To update environment, json patch data should be generated manually and passed in as patch_string argument OR current and new states of environment could be passed as old_data and new_data arguments and function will generate json patch object and make the request.

Parameters
  • wsid – Workspace ID

  • environment_name_or_id – Environment name or ID

  • old_data – Environment’s current payload as a dictionary

  • new_data – Environment’s new payload as a dictionary

  • patch_string – Json patch string

  • headers – Headers to append to this request

Returns

EnvironmentsResponse object

class splitiorequests.api.environments.EnvironmentsResponse(response: Response)

Environment endpoint response

splitiorequests.api.traffic_types module

Traffic Types endpoint classes

Requests and Response classes for Traffic Types endpoint

class splitiorequests.api.traffic_types.TrafficTypesRequests(headers: Dict[str, str], hostname: str, session: Session)

Traffic Types endpoints

get_traffic_types(wsid: str, headers: Optional[Dict[str, str]] = None) TrafficTypesResponse

Get Traffic Types endpoint

Parameters
  • wsid – workspace ID

  • headers – Headers to append to this request

Returns

TrafficTypesResponse object

class splitiorequests.api.traffic_types.TrafficTypesResponse(response: Response)

Traffic Type endpoint response

splitiorequests.api.segments module

Segments endpoint classes

Requests and Response classes for Segments endpoint

class splitiorequests.api.segments.SegmentsRequests(headers: Dict[str, str], hostname: str, session: Session)

Segments endpoints

create_segment(wsid: str, traffic_type_id_or_name: str, payload: dict, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Create Segment endpoint

Parameters
  • wsid – workspace ID

  • traffic_type_id_or_name – traffic type’s name or ID

  • payload – New segment’s payload

  • headers – Headers to append to this request

Returns

SegmentsResponse object

deactivate_segment_in_environment(environment_id: str, segment_name: str, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Deactivate Segment in Environment endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • headers – Headers to append to this request

Returns

SegmentsResponse object

delete_segment(wsid: str, segment_name: str, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Delete Segment endpoint

Parameters
  • wsid – workspace ID

  • segment_name – Name of the segment to delete

  • headers – Headers to append to this request

Returns

SegmentsResponse object

enable_segment_in_environment(environment_id: str, segment_name: str, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Enable Segment in Environment endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • headers – Headers to append to this request

Returns

SegmentsResponse object

get_segment_keys_in_environment(environment_id: str, segment_name: str, offset: int = 0, limit: int = 100, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[SegmentsResponse]]

Get Segment Keys in Environment endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

SegmentsResponse object

list_segments(wsid: str, offset: int = 0, limit: int = 50, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[SegmentsResponse]]

List Segments endpoint

Generator that yields all segments from specified workspace

Parameters
  • wsid – Workspace ID

  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

SegmentsResponse object

list_segments_in_environment(wsid: str, environment_id_or_name: str, offset: int = 0, limit: int = 50, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[SegmentsResponse]]

List Segments in Environment endpoint

Generator that yields all segments from specified environment

Parameters
  • wsid – Workspace ID

  • environment_id_or_name – Environment ID or name

  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

SegmentsResponse object

remove_segment_keys_from_environment(environment_id: str, segment_name: str, payload: dict, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Remove Segment Keys from Environment endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • payload – List of keys to remove

  • headers – Headers to append to this request

Returns

SegmentsResponse object

update_segment_keys_in_environment_via_csv(environment_id: str, segment_name: str, csv_file_path: str, csv_file_name: str, replace: bool = False, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Update Segment Keys in Environment via CSV endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • csv_file_path – Absolute path of segment keys CSV file in string format(Shouldn’t include file name)

  • csv_file_name – Name of CSV file

  • replace – Should existing keys be replaced

  • headers – Headers to append to this request

Returns

SegmentsResponse object

update_segment_keys_in_environment_via_json(environment_id: str, segment_name: str, payload: dict, replace: bool = False, headers: Optional[Dict[str, str]] = None) SegmentsResponse

Update Segment Keys in Environment via JSON endpoint

Parameters
  • environment_id – ID of Environment

  • segment_name – Name of the segment

  • payload – Keys payload to add to the segment

  • replace – Should existing keys be replaced

  • headers – Headers to append to this request

Returns

SegmentsResponse object

class splitiorequests.api.segments.SegmentsResponse(response: Response)

Segments endpoint response

splitiorequests.api.splits module

Splits endpoint classes

Requests and Response classes for Splits endpoint

class splitiorequests.api.splits.SplitsRequests(headers: Dict[str, str], hostname: str, session: Session)

Splits endpoints

create_split(wsid: str, traffic_type_id_or_name: str, payload: dict, headers: Optional[Dict[str, str]] = None) SplitsResponse

Create Split endpoint

Parameters
  • wsid – workspace ID

  • traffic_type_id_or_name – Traffic type to use for split

  • payload – Split payload to create

  • headers – Headers to append to this request

Returns

SplitsResponse object

create_split_definition_in_environment(split_name: str, wsid: str, environment_name: str, payload: dict, headers: Optional[Dict[str, str]] = None) SplitsResponse

Create Split Definition in Environment endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_name – Environment name or ID

  • payload – Split definition payload

  • headers – Headers to append to this request

Returns

SplitsResponse object

delete_split(split_name: str, wsid: str, headers: Optional[Dict[str, str]] = None) SplitsResponse

Delete Split endpoint

Parameters
  • split_name – Split name to delete

  • wsid – Workspace ID

  • headers – Headers to append to this request

Returns

SplitsResponse object

full_update_split_definition_in_environment(split_name: str, wsid: str, environment_id_or_name: str, payload: dict, headers: Optional[Dict[str, str]] = None) SplitsResponse

Full Update Split Definition in Environment endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_id_or_name – Environment name or ID

  • payload – Split definition payload

  • headers – Headers to append to this request

Returns

SplitsResponse object

get_split(split_name: str, wsid: str, headers: Optional[Dict[str, str]] = None) SplitsResponse

Get Split endpoint

Parameters
  • split_name – Split name to create

  • wsid – Workspace ID

  • headers – Headers to append to this request

Returns

SplitsResponse object

get_split_definition_in_environment(split_name: str, wsid: str, environment_name: str, headers: Optional[Dict[str, str]] = None) SplitsResponse

Get Split Definition in Environment endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_name – Environment name or ID

  • headers – Headers to append to this request

Returns

SplitsResponse object

kill_split_in_environment(split_name: str, wsid: str, environment_id_or_name: str, comment: Optional[str] = None, headers: Optional[Dict[str, str]] = None) SplitsResponse

Kill Split in Environment endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_id_or_name – Environment name or ID

  • comment – Optional comment for change

  • headers – Headers to append to this request

Returns

SplitsResponse object

list_split_definitions_in_environment(wsid: str, environment_name: str, offset: int = 0, limit: int = 50, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[SplitsResponse]]

List Split Definition in Environment Endpoint

Generator that yields all split definitions from specified environment

Parameters
  • wsid – Workspace ID

  • environment_name – Environment name or ID

  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

SplitsResponse object

list_splits(wsid: str, offset: int = 0, limit: int = 50, headers: Optional[Dict[str, str]] = None) Union[NoReturn, Iterator[SplitsResponse]]

List Splits endpoint

Generator that yields all splits from specified workspace

Parameters
  • wsid – Workspace ID

  • offset – Pagination offset parameter

  • limit – Pagination limit parameter

  • headers – Headers to append to this request

Returns

SplitsResponse object

partial_update_split_definition_in_environment(split_name: str, wsid: str, environment_name: str, old_data: Optional[dict] = None, new_data: Optional[dict] = None, patch_string: Optional[str] = None, headers: Optional[Dict[str, str]] = None) Union[NoReturn, SplitsResponse]

Partial Update Split Definition in Environment endpoint

To update split definition, json patch data should be generated manually and passed in as patch_string argument OR current and new states of environment could be passed as old_data and new_data arguments and function will generate json patch object and make the request.

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_name – Environment name or ID

  • old_data – Split definition’s current payload as a dictionary

  • new_data – Split definition’s new payload as a dictionary

  • patch_string – Json patch string

  • headers – Headers to append to this request

Returns

SplitsResponse object

remove_split_definition_from_environment(split_name: str, wsid: str, environment_name: str, headers: Optional[Dict[str, str]] = None) SplitsResponse

Remove Split Definition From Environment Endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_name – Environment name or ID

  • headers – Headers to append to this request

Returns

SplitsResponse object

restore_split_in_environment(split_name: str, wsid: str, environment_id_or_name: str, comment: Optional[str] = None, headers: Optional[Dict[str, str]] = None) SplitsResponse

Restore Split in Environment

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • environment_id_or_name – Environment name or ID

  • comment – Optional comment for change

  • headers – Headers to append to this request

Returns

SplitsResponse object

update_split_description(split_name: str, wsid: str, description: str, headers: Optional[Dict[str, str]] = None) SplitsResponse

Update Split Description endpoint

Parameters
  • split_name – Split name

  • wsid – Workspace ID

  • description – New description for split

  • headers – Headers to append to this request

Returns

SplitsResponse object

class splitiorequests.api.splits.SplitsResponse(response: Response)

Split endpoint response

splitiorequests.api.tags module

Tags endpoint classes

Requests and Response classes for Tags endpoint

class splitiorequests.api.tags.TagsRequests(headers: Dict[str, str], hostname: str, session: Session)

Tags endpoints

associate_tags(wsid: str, object_name: str, object_type: str, payload: List[str], headers: Optional[Dict[str, str]] = None) TagsResponse

Associate Tags endpoint

Parameters
  • wsid – workspace ID

  • object_name – Name of object(split) to associate tags with

  • object_type – Currently only ‘Split’ obejct is supported

  • payload – Tags list payload

  • headers – Headers to append to this request

Returns

TagsResponse object

class splitiorequests.api.tags.TagsResponse(response: Response)

Tag endpoint response