flagr.FlagApi

July 17, 2020 ยท View on GitHub

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

MethodHTTP requestDescription
create_flagPOST /flags
delete_flagDELETE /flags/{flagID}
find_flagsGET /flags
get_flagGET /flags/{flagID}
get_flag_entity_typesGET /flags/entity_types
get_flag_snapshotsGET /flags/{flagID}/snapshots
put_flagPUT /flags/{flagID}
set_flag_enabledPUT /flags/{flagID}/enabled

create_flag

Flag create_flag(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.FlagApi()
body = flagr.CreateFlagRequest() # CreateFlagRequest | create a flag

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

Parameters

NameTypeDescriptionNotes
bodyCreateFlagRequestcreate a flag

Return type

Flag

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_flag

delete_flag(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.FlagApi()
flag_id = 789 # int | numeric ID of the flag

try:
    api_instance.delete_flag(flag_id)
except ApiException as e:
    print("Exception when calling FlagApi->delete_flag: %s\n" % e)

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag

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_flags

list[Flag] find_flags(limit=limit, enabled=enabled, description=description, tags=tags, description_like=description_like, key=key, offset=offset, preload=preload)

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.FlagApi()
limit = 789 # int | the numbers of flags to return (optional)
enabled = true # bool | return flags having given enabled status (optional)
description = 'description_example' # str | return flags exactly matching given description (optional)
tags = 'tags_example' # str | return flags with the given tags (comma separated) (optional)
description_like = 'description_like_example' # str | return flags partially matching given description (optional)
key = 'key_example' # str | return flags matching given key (optional)
offset = 789 # int | return flags given the offset, it should usually set together with limit (optional)
preload = true # bool | return flags with preloaded segments and variants (optional)

try:
    api_response = api_instance.find_flags(limit=limit, enabled=enabled, description=description, tags=tags, description_like=description_like, key=key, offset=offset, preload=preload)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling FlagApi->find_flags: %s\n" % e)

Parameters

NameTypeDescriptionNotes
limitintthe numbers of flags to return[optional]
enabledboolreturn flags having given enabled status[optional]
descriptionstrreturn flags exactly matching given description[optional]
tagsstrreturn flags with the given tags (comma separated)[optional]
description_likestrreturn flags partially matching given description[optional]
keystrreturn flags matching given key[optional]
offsetintreturn flags given the offset, it should usually set together with limit[optional]
preloadboolreturn flags with preloaded segments and variants[optional]

Return type

list[Flag]

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]

get_flag

Flag get_flag(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.FlagApi()
flag_id = 789 # int | numeric ID of the flag to get

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get

Return type

Flag

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]

get_flag_entity_types

list[str] get_flag_entity_types()

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.FlagApi()

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

Parameters

This endpoint does not need any parameter.

Return type

list[str]

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]

get_flag_snapshots

list[FlagSnapshot] get_flag_snapshots(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.FlagApi()
flag_id = 789 # int | numeric ID of the flag to get

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get

Return type

list[FlagSnapshot]

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_flag

Flag put_flag(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.FlagApi()
flag_id = 789 # int | numeric ID of the flag to get
body = flagr.PutFlagRequest() # PutFlagRequest | update a flag

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get
bodyPutFlagRequestupdate a flag

Return type

Flag

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]

set_flag_enabled

Flag set_flag_enabled(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.FlagApi()
flag_id = 789 # int | numeric ID of the flag to get
body = flagr.SetFlagEnabledRequest() # SetFlagEnabledRequest | set flag enabled state

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

Parameters

NameTypeDescriptionNotes
flag_idintnumeric ID of the flag to get
bodySetFlagEnabledRequestset flag enabled state

Return type

Flag

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]