flagr.SegmentApi

December 12, 2017 ยท View on GitHub

All URIs are relative to http://localhost/api/v1

MethodHTTP requestDescription
create_segmentPOST /flags/{flagID}/segments
delete_segmentDELETE /flags/{flagID}/segments/{segmentID}
find_segmentsGET /flags/{flagID}/segments
put_segmentPUT /flags/{flagID}/segments/{segmentID}
put_segments_reorderPUT /flags/{flagID}/segments/reorder

create_segment

Segment create_segment(flag_id, body)

Example

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

# create an instance of the API class
api_instance = flagr.SegmentApi()
flag_id = 789 # int | numeric ID of the flag to get
body = flagr.CreateSegmentRequest() # CreateSegmentRequest | create a segment under a flag

try:
    api_response = api_instance.create_segment(flag_id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->create_segment: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get
bodyCreateSegmentRequestcreate a segment under a flag

Return type

Segment

Authorization

No authorization required

HTTP request headers

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

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

delete_segment

delete_segment(flag_id, segment_id)

Example

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

# create an instance of the API class
api_instance = flagr.SegmentApi()
flag_id = 789 # int | numeric ID of the flag
segment_id = 789 # int | numeric ID of the segment

try:
    api_instance.delete_segment(flag_id, segment_id)
except ApiException as e:
    print("Exception when calling SegmentApi->delete_segment: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
segment_idintnumeric ID of the segment

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

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

find_segments

list[Segment] find_segments(flag_id)

Example

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

# create an instance of the API class
api_instance = flagr.SegmentApi()
flag_id = 789 # int | numeric ID of the flag to get

try:
    api_response = api_instance.find_segments(flag_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->find_segments: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get

Return type

list[Segment]

Authorization

No authorization required

HTTP request headers

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

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

put_segment

Segment put_segment(flag_id, segment_id, body)

Example

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

# create an instance of the API class
api_instance = flagr.SegmentApi()
flag_id = 789 # int | numeric ID of the flag
segment_id = 789 # int | numeric ID of the segment
body = flagr.PutSegmentRequest() # PutSegmentRequest | update a segment

try:
    api_response = api_instance.put_segment(flag_id, segment_id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling SegmentApi->put_segment: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
segment_idintnumeric ID of the segment
bodyPutSegmentRequestupdate a segment

Return type

Segment

Authorization

No authorization required

HTTP request headers

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

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

put_segments_reorder

put_segments_reorder(flag_id, body)

Example

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

# create an instance of the API class
api_instance = flagr.SegmentApi()
flag_id = 789 # int | numeric ID of the flag
body = flagr.PutSegmentReorderRequest() # PutSegmentReorderRequest | reorder segments

try:
    api_instance.put_segments_reorder(flag_id, body)
except ApiException as e:
    print("Exception when calling SegmentApi->put_segments_reorder: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
bodyPutSegmentReorderRequestreorder segments

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

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