Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit 5f32fc7

Browse files
author
LaunchDarklyCI
committed
Version 2.0.19 automatically generated from ld-openapi@71bd90f.
1 parent e160cbc commit 5f32fc7

File tree

9 files changed

+153
-23
lines changed

9 files changed

+153
-23
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Class | Method | HTTP request | Description
110110
*EnvironmentsApi* | [**getEnvironment**](docs/EnvironmentsApi.md#getenvironment) | **GET** /projects/{projectKey}/environments/{environmentKey} | Get an environment given a project and key.
111111
*EnvironmentsApi* | [**patchEnvironment**](docs/EnvironmentsApi.md#patchenvironment) | **PATCH** /projects/{projectKey}/environments/{environmentKey} | Modify an environment by ID.
112112
*EnvironmentsApi* | [**postEnvironment**](docs/EnvironmentsApi.md#postenvironment) | **POST** /projects/{projectKey}/environments | Create a new environment in a specified project with a given name, key, and swatch color.
113-
*FeatureFlagsApi* | [**copyFeatureFlag**](docs/FeatureFlagsApi.md#copyfeatureflag) | **POST** /flags/{projectKey}/{environmentKey}/{featureFlagKey}/copy | Copies the feature flag configuration from one environment to the same feature flag in another environment.
113+
*FeatureFlagsApi* | [**copyFeatureFlag**](docs/FeatureFlagsApi.md#copyfeatureflag) | **POST** /flags/{projectKey}/{featureFlagKey}/copy | Copies the feature flag configuration from one environment to the same feature flag in another environment.
114114
*FeatureFlagsApi* | [**deleteFeatureFlag**](docs/FeatureFlagsApi.md#deletefeatureflag) | **DELETE** /flags/{projectKey}/{featureFlagKey} | Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application.
115115
*FeatureFlagsApi* | [**getFeatureFlag**](docs/FeatureFlagsApi.md#getfeatureflag) | **GET** /flags/{projectKey}/{featureFlagKey} | Get a single feature flag by key.
116116
*FeatureFlagsApi* | [**getFeatureFlagStatus**](docs/FeatureFlagsApi.md#getfeatureflagstatus) | **GET** /flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey} | Get the status for a particular feature flag.
@@ -154,6 +154,7 @@ Class | Method | HTTP request | Description
154154
- [AuditLogEntry](docs/AuditLogEntry.md)
155155
- [AuditLogEntry_target](docs/AuditLogEntry_target.md)
156156
- [Clause](docs/Clause.md)
157+
- [CopyActions](docs/CopyActions.md)
157158
- [CustomProperty](docs/CustomProperty.md)
158159
- [CustomRole](docs/CustomRole.md)
159160
- [CustomRoleBody](docs/CustomRoleBody.md)
@@ -164,6 +165,8 @@ Class | Method | HTTP request | Description
164165
- [FeatureFlag](docs/FeatureFlag.md)
165166
- [FeatureFlagBody](docs/FeatureFlagBody.md)
166167
- [FeatureFlagConfig](docs/FeatureFlagConfig.md)
168+
- [FeatureFlagCopyBody](docs/FeatureFlagCopyBody.md)
169+
- [FeatureFlagCopyObject](docs/FeatureFlagCopyObject.md)
167170
- [FeatureFlagStatus](docs/FeatureFlagStatus.md)
168171
- [FeatureFlagStatuses](docs/FeatureFlagStatuses.md)
169172
- [FeatureFlags](docs/FeatureFlags.md)

_client.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ case $state in
425425
local -a _op_arguments
426426
_op_arguments=(
427427
"projectKey=:[PATH] The project key, used to tie the flags together under one project so they can be managed together."
428-
"environmentKey=:[PATH] The environment key, used to tie together flag configuration and users under one environment so they can be managed together."
429428
"featureFlagKey=:[PATH] The feature flag's key. The key identifies the flag in your code."
430429
)
431430
_describe -t actions 'operations' _op_arguments -S '' && ret=0

client.sh

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ operation_parameters_minimum_occurrences["patchEnvironment:::patchDelta"]=1
116116
operation_parameters_minimum_occurrences["postEnvironment:::projectKey"]=1
117117
operation_parameters_minimum_occurrences["postEnvironment:::environmentBody"]=1
118118
operation_parameters_minimum_occurrences["copyFeatureFlag:::projectKey"]=1
119-
operation_parameters_minimum_occurrences["copyFeatureFlag:::environmentKey"]=1
120119
operation_parameters_minimum_occurrences["copyFeatureFlag:::featureFlagKey"]=1
120+
operation_parameters_minimum_occurrences["copyFeatureFlag:::featureFlagCopyBody"]=1
121121
operation_parameters_minimum_occurrences["deleteFeatureFlag:::projectKey"]=1
122122
operation_parameters_minimum_occurrences["deleteFeatureFlag:::featureFlagKey"]=1
123123
operation_parameters_minimum_occurrences["getFeatureFlag:::projectKey"]=1
@@ -226,8 +226,8 @@ operation_parameters_maximum_occurrences["patchEnvironment:::patchDelta"]=0
226226
operation_parameters_maximum_occurrences["postEnvironment:::projectKey"]=0
227227
operation_parameters_maximum_occurrences["postEnvironment:::environmentBody"]=0
228228
operation_parameters_maximum_occurrences["copyFeatureFlag:::projectKey"]=0
229-
operation_parameters_maximum_occurrences["copyFeatureFlag:::environmentKey"]=0
230229
operation_parameters_maximum_occurrences["copyFeatureFlag:::featureFlagKey"]=0
230+
operation_parameters_maximum_occurrences["copyFeatureFlag:::featureFlagCopyBody"]=0
231231
operation_parameters_maximum_occurrences["deleteFeatureFlag:::projectKey"]=0
232232
operation_parameters_maximum_occurrences["deleteFeatureFlag:::featureFlagKey"]=0
233233
operation_parameters_maximum_occurrences["getFeatureFlag:::projectKey"]=0
@@ -333,8 +333,8 @@ operation_parameters_collection_type["patchEnvironment:::patchDelta"]=
333333
operation_parameters_collection_type["postEnvironment:::projectKey"]=""
334334
operation_parameters_collection_type["postEnvironment:::environmentBody"]=""
335335
operation_parameters_collection_type["copyFeatureFlag:::projectKey"]=""
336-
operation_parameters_collection_type["copyFeatureFlag:::environmentKey"]=""
337336
operation_parameters_collection_type["copyFeatureFlag:::featureFlagKey"]=""
337+
operation_parameters_collection_type["copyFeatureFlag:::featureFlagCopyBody"]=""
338338
operation_parameters_collection_type["deleteFeatureFlag:::projectKey"]=""
339339
operation_parameters_collection_type["deleteFeatureFlag:::featureFlagKey"]=""
340340
operation_parameters_collection_type["getFeatureFlag:::projectKey"]=""
@@ -759,7 +759,7 @@ build_request_path() {
759759
print_help() {
760760
cat <<EOF
761761
762-
${BOLD}${WHITE}LaunchDarkly REST API command line client (API version 2.0.18)${OFF}
762+
${BOLD}${WHITE}LaunchDarkly REST API command line client (API version 2.0.19)${OFF}
763763
764764
${BOLD}${WHITE}Usage${OFF}
765765
@@ -921,7 +921,7 @@ echo -e " \\t\\t\\t\\t(e.g. 'https://app.launchdarkly.com')"
921921
##############################################################################
922922
print_about() {
923923
echo ""
924-
echo -e "${BOLD}${WHITE}LaunchDarkly REST API command line client (API version 2.0.18)${OFF}"
924+
echo -e "${BOLD}${WHITE}LaunchDarkly REST API command line client (API version 2.0.19)${OFF}"
925925
echo ""
926926
echo -e "License: Apache 2.0"
927927
echo -e "Contact: [email protected]"
@@ -941,7 +941,7 @@ echo "$appdescription" | paste -sd' ' | fold -sw 80
941941
##############################################################################
942942
print_version() {
943943
echo ""
944-
echo -e "${BOLD}LaunchDarkly REST API command line client (API version 2.0.18)${OFF}"
944+
echo -e "${BOLD}LaunchDarkly REST API command line client (API version 2.0.19)${OFF}"
945945
echo ""
946946
}
947947

@@ -1203,12 +1203,13 @@ print_copyFeatureFlag_help() {
12031203
echo -e ""
12041204
echo -e "${BOLD}${WHITE}Parameters${OFF}"
12051205
echo -e " * ${GREEN}projectKey${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The project key, used to tie the flags together under one project so they can be managed together. ${YELLOW}Specify as: projectKey=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
1206-
echo -e " * ${GREEN}environmentKey${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The environment key, used to tie together flag configuration and users under one environment so they can be managed together. ${YELLOW}Specify as: environmentKey=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
12071206
echo -e " * ${GREEN}featureFlagKey${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The feature flag's key. The key identifies the flag in your code. ${YELLOW}Specify as: featureFlagKey=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
1207+
echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Copy feature flag configurations between environments." | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /'
1208+
echo -e ""
12081209
echo ""
12091210
echo -e "${BOLD}${WHITE}Responses${OFF}"
12101211
code=201
1211-
echo -e "${result_color_table[${code:0:1}]} 201;Flag confguration copy response.${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
1212+
echo -e "${result_color_table[${code:0:1}]} 201;Flag configuration copy response.${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
12121213
code=400
12131214
echo -e "${result_color_table[${code:0:1}]} 400;Invalid request body.${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /'
12141215
code=401
@@ -2565,13 +2566,13 @@ call_postEnvironment() {
25652566
call_copyFeatureFlag() {
25662567
# ignore error about 'path_parameter_names' being unused; passed by reference
25672568
# shellcheck disable=SC2034
2568-
local path_parameter_names=(projectKey environmentKey featureFlagKey)
2569+
local path_parameter_names=(projectKey featureFlagKey)
25692570
# ignore error about 'query_parameter_names' being unused; passed by reference
25702571
# shellcheck disable=SC2034
25712572
local query_parameter_names=( )
25722573
local path
25732574

2574-
if ! path=$(build_request_path "/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/copy" path_parameter_names query_parameter_names); then
2575+
if ! path=$(build_request_path "/api/v2/flags/{projectKey}/{featureFlagKey}/copy" path_parameter_names query_parameter_names); then
25752576
ERROR_MSG=$path
25762577
exit 1
25772578
fi
@@ -2586,10 +2587,52 @@ call_copyFeatureFlag() {
25862587
if [[ -n $basic_auth_credential ]]; then
25872588
basic_auth_option="-u ${basic_auth_credential}"
25882589
fi
2589-
if [[ "$print_curl" = true ]]; then
2590-
echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
2590+
local body_json_curl=""
2591+
2592+
#
2593+
# Check if the user provided 'Content-type' headers in the
2594+
# command line. If not try to set them based on the Swagger specification
2595+
# if values produces and consumes are defined unambigously
2596+
#
2597+
if [[ -z $header_content_type ]]; then
2598+
header_content_type="application/json"
2599+
fi
2600+
2601+
2602+
if [[ -z $header_content_type && "$force" = false ]]; then
2603+
:
2604+
echo "ERROR: Request's content-type not specified!!!"
2605+
echo "This operation expects content-type in one of the following formats:"
2606+
echo -e "\\t- application/json"
2607+
echo ""
2608+
echo "Use '--content-type' to set proper content type"
2609+
exit 1
25912610
else
2592-
eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\""
2611+
headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'"
2612+
fi
2613+
2614+
2615+
#
2616+
# If we have received some body content over pipe, pass it from the
2617+
# temporary file to cURL
2618+
#
2619+
if [[ -n $body_content_temp_file ]]; then
2620+
if [[ "$print_curl" = true ]]; then
2621+
echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-"
2622+
else
2623+
eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-"
2624+
fi
2625+
rm "${body_content_temp_file}"
2626+
#
2627+
# If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE
2628+
#
2629+
else
2630+
body_json_curl=$(body_parameters_to_json)
2631+
if [[ "$print_curl" = true ]]; then
2632+
echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\""
2633+
else
2634+
eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\""
2635+
fi
25932636
fi
25942637
}
25952638

client.sh.bash-completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ _()
130130
operation_parameters["getEnvironment"]="projectKey= environmentKey= "
131131
operation_parameters["patchEnvironment"]="projectKey= environmentKey= "
132132
operation_parameters["postEnvironment"]="projectKey= "
133-
operation_parameters["copyFeatureFlag"]="projectKey= environmentKey= featureFlagKey= "
133+
operation_parameters["copyFeatureFlag"]="projectKey= featureFlagKey= "
134134
operation_parameters["deleteFeatureFlag"]="projectKey= featureFlagKey= "
135135
operation_parameters["getFeatureFlag"]="projectKey= featureFlagKey= env= "
136136
operation_parameters["getFeatureFlagStatus"]="projectKey= environmentKey= featureFlagKey= "

docs/CopyActions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# CopyActions
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
7+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
8+
9+

docs/FeatureFlagCopyBody.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# featureFlagCopyBody
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**source** | [**FeatureFlagCopyObject**](FeatureFlagCopyObject.md) | | [optional] [default to null]
7+
**target** | [**FeatureFlagCopyObject**](FeatureFlagCopyObject.md) | | [optional] [default to null]
8+
**comment** | **string** | | [optional] [default to null]
9+
**includedActions** | [**array[CopyActions]**](CopyActions.md) | | [optional] [default to null]
10+
**excludedActions** | [**array[CopyActions]**](CopyActions.md) | | [optional] [default to null]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/FeatureFlagCopyObject.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# FeatureFlagCopyObject
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**key** | **string** | | [default to null]
7+
**currentVersion** | **integer** | | [optional] [default to null]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/FeatureFlagsApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All URIs are relative to */api/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7-
[**copyFeatureFlag**](FeatureFlagsApi.md#copyFeatureFlag) | **POST** /flags/{projectKey}/{environmentKey}/{featureFlagKey}/copy | Copies the feature flag configuration from one environment to the same feature flag in another environment.
7+
[**copyFeatureFlag**](FeatureFlagsApi.md#copyFeatureFlag) | **POST** /flags/{projectKey}/{featureFlagKey}/copy | Copies the feature flag configuration from one environment to the same feature flag in another environment.
88
[**deleteFeatureFlag**](FeatureFlagsApi.md#deleteFeatureFlag) | **DELETE** /flags/{projectKey}/{featureFlagKey} | Delete a feature flag in all environments. Be careful-- only delete feature flags that are no longer being used by your application.
99
[**getFeatureFlag**](FeatureFlagsApi.md#getFeatureFlag) | **GET** /flags/{projectKey}/{featureFlagKey} | Get a single feature flag by key.
1010
[**getFeatureFlagStatus**](FeatureFlagsApi.md#getFeatureFlagStatus) | **GET** /flag-statuses/{projectKey}/{environmentKey}/{featureFlagKey} | Get the status for a particular feature flag.
@@ -20,16 +20,16 @@ Copies the feature flag configuration from one environment to the same feature f
2020

2121
### Example
2222
```bash
23-
copyFeatureFlag projectKey=value environmentKey=value featureFlagKey=value
23+
copyFeatureFlag projectKey=value featureFlagKey=value
2424
```
2525

2626
### Parameters
2727

2828
Name | Type | Description | Notes
2929
------------- | ------------- | ------------- | -------------
3030
**projectKey** | **string** | The project key, used to tie the flags together under one project so they can be managed together. |
31-
**environmentKey** | **string** | The environment key, used to tie together flag configuration and users under one environment so they can be managed together. |
3231
**featureFlagKey** | **string** | The feature flag's key. The key identifies the flag in your code. |
32+
**featureFlagCopyBody** | [**FeatureFlagCopyBody**](FeatureFlagCopyBody.md) | Copy feature flag configurations between environments. |
3333

3434
### Return type
3535

openapi.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ info:
1010
license:
1111
name: Apache 2.0
1212
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
13-
version: 2.0.18
13+
version: 2.0.19
1414
host: app.launchdarkly.com
1515
basePath: /api/v2
1616
schemes:
@@ -274,19 +274,19 @@ paths:
274274
$ref: '#/responses/Standard404'
275275
tags:
276276
- Feature flags
277-
'/flags/{projectKey}/{environmentKey}/{featureFlagKey}/copy':
277+
'/flags/{projectKey}/{featureFlagKey}/copy':
278278
post:
279279
summary: >-
280280
Copies the feature flag configuration from one environment to the same
281281
feature flag in another environment.
282282
operationId: copyFeatureFlag
283283
parameters:
284284
- $ref: '#/parameters/ProjectKey'
285-
- $ref: '#/parameters/EnvironmentKey'
286285
- $ref: '#/parameters/FeatureFlagKey'
286+
- $ref: '#/parameters/FeatureFlagCopyBody'
287287
responses:
288288
'201':
289-
description: Flag confguration copy response.
289+
description: Flag configuration copy response.
290290
schema:
291291
$ref: '#/definitions/FeatureFlag'
292292
'400':
@@ -1684,6 +1684,31 @@ definitions:
16841684
- Value 2
16851685
required:
16861686
- name
1687+
FeatureFlagCopyObject:
1688+
type: object
1689+
properties:
1690+
key:
1691+
type: string
1692+
description: The environment key to be used.
1693+
example: staging
1694+
currentVersion:
1695+
type: integer
1696+
description: >-
1697+
If the latest version of the flag matches provided version it will
1698+
copy, otherwise it will return a conflict.
1699+
example: 65
1700+
required:
1701+
- key
1702+
CopyActions:
1703+
type: string
1704+
example: []
1705+
enum:
1706+
- updateOn
1707+
- updatePrerequisites
1708+
- updateTargets
1709+
- updateRules
1710+
- updateFallthrough
1711+
- updateOffVariation
16871712
responses:
16881713
Standard201:
16891714
description: Resource created.
@@ -1767,6 +1792,32 @@ parameters:
17671792
- url
17681793
- sign
17691794
- 'on'
1795+
FeatureFlagCopyBody:
1796+
name: featureFlagCopyBody
1797+
in: body
1798+
required: true
1799+
description: Copy feature flag configurations between environments.
1800+
schema:
1801+
type: object
1802+
properties:
1803+
source:
1804+
$ref: '#/definitions/FeatureFlagCopyObject'
1805+
target:
1806+
$ref: '#/definitions/FeatureFlagCopyObject'
1807+
comment:
1808+
type: string
1809+
description: comment will be included in audit log item for change.
1810+
example: This is a comment string
1811+
includedActions:
1812+
type: array
1813+
items:
1814+
$ref: '#/definitions/CopyActions'
1815+
description: Define the parts of the flag configuration that will be copied.
1816+
excludedActions:
1817+
type: array
1818+
items:
1819+
$ref: '#/definitions/CopyActions'
1820+
description: Define the parts of the flag configuration that will not be copied.
17701821
FeatureFlagPostRequest:
17711822
name: featureFlagBody
17721823
in: body

0 commit comments

Comments
 (0)