|
| 1 | +# launchdarkly_api.AccessTokensApi |
| 2 | + |
| 3 | +All URIs are relative to *https://app.launchdarkly.com/api/v2* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**delete_token**](AccessTokensApi.md#delete_token) | **DELETE** /tokens/{tokenId} | Delete an access token by ID. |
| 8 | +[**get_token**](AccessTokensApi.md#get_token) | **GET** /tokens/{tokenId} | Get a single access token by ID. |
| 9 | +[**get_tokens**](AccessTokensApi.md#get_tokens) | **GET** /tokens | Returns a list of tokens in the account. |
| 10 | +[**patch_token**](AccessTokensApi.md#patch_token) | **PATCH** /tokens/{tokenId} | Modify an access tokenby ID. |
| 11 | +[**post_token**](AccessTokensApi.md#post_token) | **POST** /tokens | Create a new token. |
| 12 | +[**reset_token**](AccessTokensApi.md#reset_token) | **POST** /tokens/{tokenId}/reset | Reset an access token's secret key with an optional expiry time for the old key. |
| 13 | + |
| 14 | + |
| 15 | +# **delete_token** |
| 16 | +> delete_token(token_id) |
| 17 | +
|
| 18 | +Delete an access token by ID. |
| 19 | + |
| 20 | +### Example |
| 21 | +```python |
| 22 | +from __future__ import print_function |
| 23 | +import time |
| 24 | +import launchdarkly_api |
| 25 | +from launchdarkly_api.rest import ApiException |
| 26 | +from pprint import pprint |
| 27 | + |
| 28 | +# Configure API key authorization: Token |
| 29 | +configuration = launchdarkly_api.Configuration() |
| 30 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 31 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 32 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 33 | + |
| 34 | +# create an instance of the API class |
| 35 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 36 | +token_id = 'token_id_example' # str | The access token ID. |
| 37 | + |
| 38 | +try: |
| 39 | + # Delete an access token by ID. |
| 40 | + api_instance.delete_token(token_id) |
| 41 | +except ApiException as e: |
| 42 | + print("Exception when calling AccessTokensApi->delete_token: %s\n" % e) |
| 43 | +``` |
| 44 | + |
| 45 | +### Parameters |
| 46 | + |
| 47 | +Name | Type | Description | Notes |
| 48 | +------------- | ------------- | ------------- | ------------- |
| 49 | + **token_id** | **str**| The access token ID. | |
| 50 | + |
| 51 | +### Return type |
| 52 | + |
| 53 | +void (empty response body) |
| 54 | + |
| 55 | +### Authorization |
| 56 | + |
| 57 | +[Token](../README.md#Token) |
| 58 | + |
| 59 | +### HTTP request headers |
| 60 | + |
| 61 | + - **Content-Type**: application/json |
| 62 | + - **Accept**: application/json |
| 63 | + |
| 64 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 65 | + |
| 66 | +# **get_token** |
| 67 | +> Token get_token(token_id) |
| 68 | +
|
| 69 | +Get a single access token by ID. |
| 70 | + |
| 71 | +### Example |
| 72 | +```python |
| 73 | +from __future__ import print_function |
| 74 | +import time |
| 75 | +import launchdarkly_api |
| 76 | +from launchdarkly_api.rest import ApiException |
| 77 | +from pprint import pprint |
| 78 | + |
| 79 | +# Configure API key authorization: Token |
| 80 | +configuration = launchdarkly_api.Configuration() |
| 81 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 82 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 83 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 84 | + |
| 85 | +# create an instance of the API class |
| 86 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 87 | +token_id = 'token_id_example' # str | The access token ID. |
| 88 | + |
| 89 | +try: |
| 90 | + # Get a single access token by ID. |
| 91 | + api_response = api_instance.get_token(token_id) |
| 92 | + pprint(api_response) |
| 93 | +except ApiException as e: |
| 94 | + print("Exception when calling AccessTokensApi->get_token: %s\n" % e) |
| 95 | +``` |
| 96 | + |
| 97 | +### Parameters |
| 98 | + |
| 99 | +Name | Type | Description | Notes |
| 100 | +------------- | ------------- | ------------- | ------------- |
| 101 | + **token_id** | **str**| The access token ID. | |
| 102 | + |
| 103 | +### Return type |
| 104 | + |
| 105 | +[**Token**](Token.md) |
| 106 | + |
| 107 | +### Authorization |
| 108 | + |
| 109 | +[Token](../README.md#Token) |
| 110 | + |
| 111 | +### HTTP request headers |
| 112 | + |
| 113 | + - **Content-Type**: application/json |
| 114 | + - **Accept**: application/json |
| 115 | + |
| 116 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 117 | + |
| 118 | +# **get_tokens** |
| 119 | +> Tokens get_tokens(show_all=show_all) |
| 120 | +
|
| 121 | +Returns a list of tokens in the account. |
| 122 | + |
| 123 | +### Example |
| 124 | +```python |
| 125 | +from __future__ import print_function |
| 126 | +import time |
| 127 | +import launchdarkly_api |
| 128 | +from launchdarkly_api.rest import ApiException |
| 129 | +from pprint import pprint |
| 130 | + |
| 131 | +# Configure API key authorization: Token |
| 132 | +configuration = launchdarkly_api.Configuration() |
| 133 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 134 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 135 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 136 | + |
| 137 | +# create an instance of the API class |
| 138 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 139 | +show_all = true # bool | If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved. (optional) |
| 140 | + |
| 141 | +try: |
| 142 | + # Returns a list of tokens in the account. |
| 143 | + api_response = api_instance.get_tokens(show_all=show_all) |
| 144 | + pprint(api_response) |
| 145 | +except ApiException as e: |
| 146 | + print("Exception when calling AccessTokensApi->get_tokens: %s\n" % e) |
| 147 | +``` |
| 148 | + |
| 149 | +### Parameters |
| 150 | + |
| 151 | +Name | Type | Description | Notes |
| 152 | +------------- | ------------- | ------------- | ------------- |
| 153 | + **show_all** | **bool**| If set to true, and the authentication access token has the \"Admin\" role, personal access tokens for all members will be retrieved. | [optional] |
| 154 | + |
| 155 | +### Return type |
| 156 | + |
| 157 | +[**Tokens**](Tokens.md) |
| 158 | + |
| 159 | +### Authorization |
| 160 | + |
| 161 | +[Token](../README.md#Token) |
| 162 | + |
| 163 | +### HTTP request headers |
| 164 | + |
| 165 | + - **Content-Type**: application/json |
| 166 | + - **Accept**: application/json |
| 167 | + |
| 168 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 169 | + |
| 170 | +# **patch_token** |
| 171 | +> Token patch_token(token_id, patch_delta) |
| 172 | +
|
| 173 | +Modify an access tokenby ID. |
| 174 | + |
| 175 | +### Example |
| 176 | +```python |
| 177 | +from __future__ import print_function |
| 178 | +import time |
| 179 | +import launchdarkly_api |
| 180 | +from launchdarkly_api.rest import ApiException |
| 181 | +from pprint import pprint |
| 182 | + |
| 183 | +# Configure API key authorization: Token |
| 184 | +configuration = launchdarkly_api.Configuration() |
| 185 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 186 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 187 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 188 | + |
| 189 | +# create an instance of the API class |
| 190 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 191 | +token_id = 'token_id_example' # str | The access token ID. |
| 192 | +patch_delta = [launchdarkly_api.PatchOperation()] # list[PatchOperation] | Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' |
| 193 | + |
| 194 | +try: |
| 195 | + # Modify an access tokenby ID. |
| 196 | + api_response = api_instance.patch_token(token_id, patch_delta) |
| 197 | + pprint(api_response) |
| 198 | +except ApiException as e: |
| 199 | + print("Exception when calling AccessTokensApi->patch_token: %s\n" % e) |
| 200 | +``` |
| 201 | + |
| 202 | +### Parameters |
| 203 | + |
| 204 | +Name | Type | Description | Notes |
| 205 | +------------- | ------------- | ------------- | ------------- |
| 206 | + **token_id** | **str**| The access token ID. | |
| 207 | + **patch_delta** | [**list[PatchOperation]**](PatchOperation.md)| Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/' | |
| 208 | + |
| 209 | +### Return type |
| 210 | + |
| 211 | +[**Token**](Token.md) |
| 212 | + |
| 213 | +### Authorization |
| 214 | + |
| 215 | +[Token](../README.md#Token) |
| 216 | + |
| 217 | +### HTTP request headers |
| 218 | + |
| 219 | + - **Content-Type**: application/json |
| 220 | + - **Accept**: application/json |
| 221 | + |
| 222 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 223 | + |
| 224 | +# **post_token** |
| 225 | +> Token post_token(token_body) |
| 226 | +
|
| 227 | +Create a new token. |
| 228 | + |
| 229 | +### Example |
| 230 | +```python |
| 231 | +from __future__ import print_function |
| 232 | +import time |
| 233 | +import launchdarkly_api |
| 234 | +from launchdarkly_api.rest import ApiException |
| 235 | +from pprint import pprint |
| 236 | + |
| 237 | +# Configure API key authorization: Token |
| 238 | +configuration = launchdarkly_api.Configuration() |
| 239 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 240 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 241 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 242 | + |
| 243 | +# create an instance of the API class |
| 244 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 245 | +token_body = launchdarkly_api.TokenBody() # TokenBody | Create a new access token. |
| 246 | + |
| 247 | +try: |
| 248 | + # Create a new token. |
| 249 | + api_response = api_instance.post_token(token_body) |
| 250 | + pprint(api_response) |
| 251 | +except ApiException as e: |
| 252 | + print("Exception when calling AccessTokensApi->post_token: %s\n" % e) |
| 253 | +``` |
| 254 | + |
| 255 | +### Parameters |
| 256 | + |
| 257 | +Name | Type | Description | Notes |
| 258 | +------------- | ------------- | ------------- | ------------- |
| 259 | + **token_body** | [**TokenBody**](TokenBody.md)| Create a new access token. | |
| 260 | + |
| 261 | +### Return type |
| 262 | + |
| 263 | +[**Token**](Token.md) |
| 264 | + |
| 265 | +### Authorization |
| 266 | + |
| 267 | +[Token](../README.md#Token) |
| 268 | + |
| 269 | +### HTTP request headers |
| 270 | + |
| 271 | + - **Content-Type**: application/json |
| 272 | + - **Accept**: application/json |
| 273 | + |
| 274 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 275 | + |
| 276 | +# **reset_token** |
| 277 | +> Token reset_token(token_id, expiry=expiry) |
| 278 | +
|
| 279 | +Reset an access token's secret key with an optional expiry time for the old key. |
| 280 | + |
| 281 | +### Example |
| 282 | +```python |
| 283 | +from __future__ import print_function |
| 284 | +import time |
| 285 | +import launchdarkly_api |
| 286 | +from launchdarkly_api.rest import ApiException |
| 287 | +from pprint import pprint |
| 288 | + |
| 289 | +# Configure API key authorization: Token |
| 290 | +configuration = launchdarkly_api.Configuration() |
| 291 | +configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
| 292 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 293 | +# configuration.api_key_prefix['Authorization'] = 'Bearer' |
| 294 | + |
| 295 | +# create an instance of the API class |
| 296 | +api_instance = launchdarkly_api.AccessTokensApi(launchdarkly_api.ApiClient(configuration)) |
| 297 | +token_id = 'token_id_example' # str | The access token ID. |
| 298 | +expiry = 789 # int | An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. (optional) |
| 299 | + |
| 300 | +try: |
| 301 | + # Reset an access token's secret key with an optional expiry time for the old key. |
| 302 | + api_response = api_instance.reset_token(token_id, expiry=expiry) |
| 303 | + pprint(api_response) |
| 304 | +except ApiException as e: |
| 305 | + print("Exception when calling AccessTokensApi->reset_token: %s\n" % e) |
| 306 | +``` |
| 307 | + |
| 308 | +### Parameters |
| 309 | + |
| 310 | +Name | Type | Description | Notes |
| 311 | +------------- | ------------- | ------------- | ------------- |
| 312 | + **token_id** | **str**| The access token ID. | |
| 313 | + **expiry** | **int**| An expiration time for the old token key, expressed as a Unix epoch time in milliseconds. By default, the token will expire immediately. | [optional] |
| 314 | + |
| 315 | +### Return type |
| 316 | + |
| 317 | +[**Token**](Token.md) |
| 318 | + |
| 319 | +### Authorization |
| 320 | + |
| 321 | +[Token](../README.md#Token) |
| 322 | + |
| 323 | +### HTTP request headers |
| 324 | + |
| 325 | + - **Content-Type**: application/json |
| 326 | + - **Accept**: application/json |
| 327 | + |
| 328 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 329 | + |
0 commit comments