def test_segment_pools():
    ### Test Segment ID Pool Operations

    # Get all configured Segment Pools
    get_segment_resp = client_session.read('vdnSegmentPools')
    client_session.view_response(get_segment_resp)

    # Add a Segment Pool
    segments_create_body = client_session.extract_resource_body_example('vdnSegmentPools', 'create')
    client_session.view_body_dict(segments_create_body)

    segments_create_body['segmentRange']['begin'] = '11002'
    segments_create_body['segmentRange']['end'] = '11003'
    segments_create_body['segmentRange']['name'] = 'legacy'

    create_response = client_session.create('vdnSegmentPools', request_body_dict=segments_create_body)
    client_session.view_response(create_response)

    time.sleep(5)

    # Update the new Segment Pool:
    update_segment_body = client_session.extract_resource_body_example('vdnSegmentPool', 'update')
    update_segment_body['segmentRange']['name'] = 'PythonTest'
    update_segment_body['segmentRange']['end'] = '11005'
    client_session.update('vdnSegmentPool', uri_parameters={'segmentPoolId': create_response['objectId']},
                          request_body_dict=update_segment_body)

    time.sleep(5)

    # Display a specific Segment pool (the new one)
    specific_segement_resp = client_session.read('vdnSegmentPool', uri_parameters={'segmentPoolId':
                                                                                    create_response['objectId']})
    client_session.view_response(specific_segement_resp)

    time.sleep(5)

    # Delete new Segment Pool
    client_session.delete('vdnSegmentPool', uri_parameters={'segmentPoolId': create_response['objectId']})