flagr.FlagApi
July 17, 2020 ยท View on GitHub
All URIs are relative to http://localhost/api/v1
| Method | HTTP request | Description |
|---|---|---|
| create_flag | POST /flags | |
| delete_flag | DELETE /flags/{flagID} | |
| find_flags | GET /flags | |
| get_flag | GET /flags/{flagID} | |
| get_flag_entity_types | GET /flags/entity_types | |
| get_flag_snapshots | GET /flags/{flagID}/snapshots | |
| put_flag | PUT /flags/{flagID} | |
| set_flag_enabled | PUT /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
| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateFlagRequest | create a flag |
Return type
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
| Name | Type | Description | Notes |
|---|---|---|---|
| flag_id | int | numeric 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
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | the numbers of flags to return | [optional] |
| enabled | bool | return flags having given enabled status | [optional] |
| description | str | return flags exactly matching given description | [optional] |
| tags | str | return flags with the given tags (comma separated) | [optional] |
| description_like | str | return flags partially matching given description | [optional] |
| key | str | return flags matching given key | [optional] |
| offset | int | return flags given the offset, it should usually set together with limit | [optional] |
| preload | bool | return flags with preloaded segments and variants | [optional] |
Return type
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
| Name | Type | Description | Notes |
|---|---|---|---|
| flag_id | int | numeric ID of the flag to get |
Return type
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
| Name | Type | Description | Notes |
|---|---|---|---|
| flag_id | int | numeric ID of the flag to get |
Return type
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
| Name | Type | Description | Notes |
|---|---|---|---|
| flag_id | int | numeric ID of the flag to get | |
| body | PutFlagRequest | update a flag |
Return type
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
| Name | Type | Description | Notes |
|---|---|---|---|
| flag_id | int | numeric ID of the flag to get | |
| body | SetFlagEnabledRequest | set flag enabled state |
Return type
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]