flagr.VariantApi

December 12, 2017 ยท View on GitHub

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

MethodHTTP requestDescription
create_variantPOST /flags/{flagID}/variants
delete_variantDELETE /flags/{flagID}/variants/{variantID}
find_variantsGET /flags/{flagID}/variants
put_variantPUT /flags/{flagID}/variants/{variantID}

create_variant

Variant create_variant(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.VariantApi()
flag_id = 789 # int | numeric ID of the flag
body = flagr.CreateVariantRequest() # CreateVariantRequest | create a variant

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
bodyCreateVariantRequestcreate a variant

Return type

Variant

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_variant

delete_variant(flag_id, variant_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.VariantApi()
flag_id = 789 # int | numeric ID of the flag
variant_id = 789 # int | numeric ID of the variant

try:
    api_instance.delete_variant(flag_id, variant_id)
except ApiException as e:
    print("Exception when calling VariantApi->delete_variant: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
variant_idintnumeric ID of the variant

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_variants

list[Variant] find_variants(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.VariantApi()
flag_id = 789 # int | numeric ID of the flag

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag

Return type

list[Variant]

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_variant

Variant put_variant(flag_id, variant_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.VariantApi()
flag_id = 789 # int | numeric ID of the flag
variant_id = 789 # int | numeric ID of the variant
body = flagr.PutVariantRequest() # PutVariantRequest | update a variant

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag
variant_idintnumeric ID of the variant
bodyPutVariantRequestupdate a variant

Return type

Variant

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]