Introduction
IBM Cloud App Configuration is a centralized feature management and configuration service for use with web and mobile applications, microservices, and distributed environments.
Instrument your applications with App Configuration SDKs, and use the App Configuration dashboard or App Configuration administrator API to define features flags, which are organized into collections and targeted to segments. Change feature flag states in the cloud to activate or deactivate features in your application or environment, often without restarting.
- App Owners - Roll out features by segment and independent from code deployments.
- Developers - Reduce source code branch complexity and troublesome merges by including untested or unfinished features behind a feature flag in your master branch.
- Testers - Increase confidence that new features will smoothly transition to production by testing there. Use flags to activate untested features only for testers and QA personnel until it's time to release.
Before you begin
Make sure that you have access to a paid IBM Cloud account.
Learn more about App Configuration.
SDKs
For more information about installation and technical concepts, see the 'README' document in the SDK.
Server SDKs | Client SDKs | Admin SDKs |
---|---|---|
Node SDK Documentation |
Android SDK Documentation |
Go Admin SDK |
Python SDK Documentation |
JavaScript SDK Documentation |
|
Go SDK Documentation |
React SDK Documentation |
|
Java SDK Documentation |
Installation
The code examples on this tab use the IBM Cloud App Configuration admin SDK for Go.
go get -u github.com/IBM/appconfiguration-go-admin-sdk
For more installation options, view this project in GitHub.
Endpoints URLs
The following URLs represents the base URLs for the App Configuration API endpoints. When you call the API, use the URL that corresponds to the region where your service instance is deployed. Add the path for each method to form the complete API endpoint for your requests.
- Dallas:
https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- Washington DC:
https://us-east.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- London:
https://eu-gb.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- Sydney:
https://au-syd.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
If you have enabled service endpoints in your account, you can send API requests over the IBM Cloud® private network at the following base endpoint URLs.
- Dallas:
https://private.us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- Washington DC:
https://private.us-east.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- London:
https://private.eu-gb.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
- Sydney:
https://private.au-syd.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
The following table details the location where the App Configuration actions run, data stored and replicated:
Location | Location where App Configuration actions run | Data is stored in | Data is replicated to |
---|---|---|---|
Dallas | All App Configuration actions run in the Dallas (us-south ) location. |
All metadata for the app's features are stored in the Dallas (us-south ) location. |
Data is replicated between three zones within us-south for high-availability. |
Washington DC | All App Configuration actions run in the Washington DC (us-east ) location. |
All metadata for the app's features are stored in the Washington DC (us-east ) location. |
Data is replicated between three zones within us-east for high-availability. |
London | All App Configuration actions run in the London (eu-gb ) location. |
All metadata for the app's features are stored in the London (eu-gb ) location. |
Data is replicated between three zones within eu-gb for high-availability. |
Sydney | All App Configuration actions run in the Sydney (au-syd ) location. |
All metadata for the app's features are stored in the Sydney (au-syd ) location. |
Data is replicated between three zones within au-syd for high-availability. |
Example request to a Dallas endpoint:
curl -H "Authorization:Bearer {token}" -X "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}"
Replace {token}
in this example with the values for your particular API call.
Endpoint URL
https://{region}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
Authentication
Authorization to the App Configuration API is enforced by using an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.
To work with the API, include a valid IAM token in each outgoing request to the service. You can generate an access token by first creating an API key and then exchanging your API key for an IBM Cloud IAM token. By default, the IAM access token have a lifetime of 60 minutes. See Managing access token expiration to decrease the IAM access token lifetime.
Don't have an API key? Try running ibmcloud iam oauth-tokens
in the IBM Cloud Shell to quickly generate a personal access token.
To generate an access token from your API key, use the following cURL command.
curl -X POST \
"https://iam.cloud.ibm.com/identity/token" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'grant_type=urn:ibm:params:oauth:grant-type:apikey' \
--data-urlencode 'apikey=<API_KEY>'
Replace <API_KEY>
with your IBM Cloud API key.
When you use the SDK, configure an IAM authenticator with an IBM Cloud IAM API key. The authenticator automatically obtains the IAM access token for the API key and includes it with each request. You can configure an authenticator in either of two ways:
- Programmatically by constructing an IAM authenticator instance and supplying your IAM API key.
- By defining the API key in external configuration properties and then using the SDK authenticator factory to construct an IAM authenticator that uses the configured IAM API key.
For more information, see the Authentication section of the IBM Cloud SDK Common documentation.
Example API request
curl -H "Authorization:Bearer {TOKEN}" -X "{BASE_URL}/{METHOD}"
Replace {TOKEN}
with your IAM access token.
Example that initializes the SDK programmatically.
import (
"encoding/json"
"fmt"
"github.com/IBM/go-sdk-core/v5/core"
ac "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
)
func main() {
appconfigurationApi, err := ac.NewAppConfigurationV1(&ac.AppConfigurationV1Options {
URL: "{BASE_URL}",
Authenticator: &core.IamAuthenticator {
ApiKey: "{API_KEY}",
},
})
if err != nil {
panic(err)
}
}
Replace {API_KEY}
with your IBM Cloud API key. Replace {BASE_URL}
with the endpoint URL for your instance.
Auditing
You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. Whenever an API method is called, an event is generated that you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method.
For more information about how to track App Configuration activity, see Auditing events for App Configuration.
Error handling
This API uses standard HTTP response codes to indicate whether a method completed successfully. A 2xx
response always indicates success. A 4xx
type response is some sort of failure, and a 5xx
type response usually indicates an internal system error.
HTTP status code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
201 |
Success | The resource was successfully created and added to your IBM Cloud account. |
400 |
Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
401 |
Unauthorized | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions. |
403 |
Forbidden | The supplied authentication is not authorized to access the apps. Check that you have the correct access credentials and permissions. |
404 |
Not Found | The requested resource could not be found. |
408 |
Request timeout | The connection to the server timed out. Wait a few minutes, then try again. |
409 |
Conflict | The entity is already in the requested state. |
429 |
Too Many Requests | Too many requests have been made within a time window. Wait before calling the API again. |
500 |
Internal Server Error | IBM Cloud App Configuration is not available. Your request could not be processed. Wait a few minutes and try again. If you still encounter this problem, note the incident ID and contact IBM Cloud support. |
503 |
Service Temporarily Unavailable | IBM Cloud App Configuration could not process the request, due to a temporary overloading or maintenance. Try to reduce your request rate, or retry after a few minutes. If the error persists, contact IBM Cloud support. |
Example error handling
import "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
// Instantiate a service
appconfigurationApi, err := appconfigurationv1.NewAppConfigurationV1(options)
// Check for errors
if err != nil {
panic(err)
}
// Call a method
result, response, err := appconfigurationApi.MethodName(&methodOptions)
// Check for errors
if err != nil {
panic(err)
}
Versioning
Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
API requests require a major version in the path (/v1/
).
Methods
Get list of Environments
List all the environments in the App Configuration service instance.
List all the environments in the App Configuration service instance.
GET /environments
(appConfiguration *AppConfigurationV1) ListEnvironments(listEnvironmentsOptions *ListEnvironmentsOptions) (result *EnvironmentList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListEnvironmentsWithContext(ctx context.Context, listEnvironmentsOptions *ListEnvironmentsOptions) (result *EnvironmentList, response *core.DetailedResponse, err error)
Request
Instantiate the ListEnvironmentsOptions
struct and set the fields to provide parameter values for the ListEnvironments
method.
Query Parameters
If set to
true
, returns expanded view of the resource details.Sort the environment details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Example:
version 1.1, pre-release
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Default:
10
The number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Default:
0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity
Example:
test tag
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ListEnvironments options.
If set to
true
, returns expanded view of the resource details.Sort the environment details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Examples:ViewInclude feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Examples:ViewThe number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity.
Examples:View
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments?expand=true' --header 'Authorization: Bearer {TOKEN}'
listEnvironmentsOptionsModel := appConfigurationServiceInstance.NewListEnvironmentsOptions() result, response, err := appConfigurationServiceInstance.ListEnvironments(listEnvironmentsOptionsModel)
Response
List of all environments.
Array of environments.
Number of records returned
Skipped number of records
Total number of records
URL to navigate to the first page of records
URL to navigate to the last page of records
URL to navigate to the previous list of records
URL to navigate to the next list of records
List of all environments.
Array of environments.
Examples:ViewEnvironment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:ViewCreation time of the environment.
Examples:ViewLast modified time of the environment data.
Examples:ViewEnvironment URL.
List of Features associated with the environment.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the environment.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the environment.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Environments
Number of records returned.
Skipped number of records.
Total number of records.
Response having URL of the page.
URL to the page.
First
Response having URL of the page.
URL to the page.
Previous
Response having URL of the page.
URL to the page.
Next
Response having URL of the page.
URL to the page.
Last
Status Code
Successfully listed the environments.
Unauthorized
{ "environments": [ { "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0" } }
{ "environments": [ { "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Create Environment
Create an environment.
Create an environment.
POST /environments
(appConfiguration *AppConfigurationV1) CreateEnvironment(createEnvironmentOptions *CreateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateEnvironmentWithContext(ctx context.Context, createEnvironmentOptions *CreateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
Request
Instantiate the CreateEnvironmentOptions
struct and set the fields to provide parameter values for the CreateEnvironment
method.
Request to create Environment
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Example:
#FDD13A
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateEnvironment options.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewEnvironment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewEnvironment description.
Possible values: length ≤ 255
Examples:ViewTags associated with the environment.
Examples:ViewColor code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:View
curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{ "name": <ENVIRONMENT_NAME>, "environment_id": <ENVIRONMENT_ID>, "description": "test", "tags" : "test" }'
createEnvironmentOptionsModel := appConfigurationServiceInstance.NewCreateEnvironmentOptions(name, environmentId) createEnvironmentOptionsModel.SetDescription(description) createEnvironmentOptionsModel.SetTags(tags) createEnvironmentOptionsModel.SetColorCode(colorCode) result, response, err := appConfigurationServiceInstance.CreateEnvironment(createEnvironmentOptionsModel)
Response
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Example:
#FDD13A
Creation time of the environment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the environment data.
Example:
2021-05-12T23:20:50.52Z
Environment URL
List of Features associated with the environment.
List of properties associated with the environment.
List of snapshots associated with the environment.
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:ViewCreation time of the environment.
Examples:ViewLast modified time of the environment data.
Examples:ViewEnvironment URL.
List of Features associated with the environment.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the environment.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the environment.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Status Code
Successfully created the environment.
Bad request. Verify that the information in the request body is complete and correct.
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "code": "FTEC1000E", "message": "Error while creating the environment." }
{ "code": "FTEC1000E", "message": "Error while creating the environment." }
Update Environment
Update an environment.
Update an environment.
PUT /environments/{environment_id}
(appConfiguration *AppConfigurationV1) UpdateEnvironment(updateEnvironmentOptions *UpdateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateEnvironmentWithContext(ctx context.Context, updateEnvironmentOptions *UpdateEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateEnvironmentOptions
struct and set the fields to provide parameter values for the UpdateEnvironment
method.
Path Parameters
Environment Id
Request body to update environment
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Example:
#FDD13A
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateEnvironment options.
Environment Id.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:View
curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{ "name": <ENVIRONMENT_NAME>, "description": "test", "tags" : "test" }'
updateEnvironmentOptionsModel := appConfigurationServiceInstance.NewUpdateEnvironmentOptions(environmentId) updateEnvironmentOptionsModel.SetName(name) updateEnvironmentOptionsModel.SetDescription(description) updateEnvironmentOptionsModel.SetTags(tags) updateEnvironmentOptionsModel.SetColorCode(colorCode) result, response, err := appConfigurationServiceInstance.UpdateEnvironment(updateEnvironmentOptionsModel)
Response
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Example:
#FDD13A
Creation time of the environment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the environment data.
Example:
2021-05-12T23:20:50.52Z
Environment URL
List of Features associated with the environment.
List of properties associated with the environment.
List of snapshots associated with the environment.
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:ViewCreation time of the environment.
Examples:ViewLast modified time of the environment data.
Examples:ViewEnvironment URL.
List of Features associated with the environment.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the environment.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the environment.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Status Code
Successfully updated the environment details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the environment id is correct.
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "code": "FTEC1007E", "message": "Error while updating the environment." }
{ "code": "FTEC1007E", "message": "Error while updating the environment." }
{ "code": "FTEC1000E", "message": "Error while updating the environment. The queried resource 'Environment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the environment. The queried resource 'Environment' is not available on the server." }
Get Environment
Retrieve the details of the environment.
Retrieve the details of the environment.
GET /environments/{environment_id}
(appConfiguration *AppConfigurationV1) GetEnvironment(getEnvironmentOptions *GetEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetEnvironmentWithContext(ctx context.Context, getEnvironmentOptions *GetEnvironmentOptions) (result *Environment, response *core.DetailedResponse, err error)
Request
Instantiate the GetEnvironmentOptions
struct and set the fields to provide parameter values for the GetEnvironment
method.
Path Parameters
Environment Id
Query Parameters
If set to
true
, returns expanded view of the resource details.Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetEnvironment options.
Environment Id.
If set to
true
, returns expanded view of the resource details.Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}?expand=true' --header 'Authorization: Bearer {TOKEN}'
getEnvironmentOptionsModel := appConfigurationServiceInstance.NewGetEnvironmentOptions(environmentId) result, response, err := appConfigurationServiceInstance.GetEnvironment(getEnvironmentOptionsModel)
Response
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Example:
#FDD13A
Creation time of the environment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the environment data.
Example:
2021-05-12T23:20:50.52Z
Environment URL
List of Features associated with the environment.
List of properties associated with the environment.
List of snapshots associated with the environment.
Details of the environment.
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Environment description.
Possible values: length ≤ 255
Tags associated with the environment.
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:ViewCreation time of the environment.
Examples:ViewLast modified time of the environment data.
Examples:ViewEnvironment URL.
List of Features associated with the environment.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the environment.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the environment.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Status Code
Successfully retrieved the environment details.
Not Found. Verify that the environment id is correct.
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev-environment" }
{ "code": "FTEC1000E", "message": "Error while retrieving the environment. The queried resource 'Environment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retrieving the environment. The queried resource 'Environment' is not available on the server." }
Delete Environment
Delete an Environment.
Delete an Environment.
DELETE /environments/{environment_id}
(appConfiguration *AppConfigurationV1) DeleteEnvironment(deleteEnvironmentOptions *DeleteEnvironmentOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteEnvironmentWithContext(ctx context.Context, deleteEnvironmentOptions *DeleteEnvironmentOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteEnvironmentOptions
struct and set the fields to provide parameter values for the DeleteEnvironment
method.
Path Parameters
Environment Id
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteEnvironment options.
Environment Id.
curl --request DELETE --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}' --header 'Authorization: Bearer {TOKEN}'
deleteEnvironmentOptionsModel := appConfigurationServiceInstance.NewDeleteEnvironmentOptions(environmentId) response, err := appConfigurationServiceInstance.DeleteEnvironment(deleteEnvironmentOptionsModel)
Response
Status Code
Successfully deleted the specified environment.
Bad request. Ensure that at least one environment should exist in the instance.
Not Found. Verify that the environment id is correct.
{ "code": "FTEC1008E", "message": "Error while deleting the environment." }
{ "code": "FTEC1008E", "message": "Error while deleting the environment." }
{ "code": "FTEC1000E", "message": "Error while deleting the environment. The queried resource 'Environment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the environment. The queried resource 'Environment' is not available on the server." }
Get list of Collections
List of all the collections in the App Configuration service instance.
List of all the collections in the App Configuration service instance.
GET /collections
(appConfiguration *AppConfigurationV1) ListCollections(listCollectionsOptions *ListCollectionsOptions) (result *CollectionList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListCollectionsWithContext(ctx context.Context, listCollectionsOptions *ListCollectionsOptions) (result *CollectionList, response *core.DetailedResponse, err error)
Request
Instantiate the ListCollectionsOptions
struct and set the fields to provide parameter values for the ListCollections
method.
Query Parameters
If set to
true
, returns expanded view of the resource details.Sort the collection details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Example:
version 1.1, pre-release
Filter collections by a list of comma separated features.
Filter collections by a list of comma separated properties.
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Default:
10
The number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Default:
0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity
Example:
test tag
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ListCollections options.
If set to
true
, returns expanded view of the resource details.Sort the collection details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Examples:ViewFilter collections by a list of comma separated features.
Filter collections by a list of comma separated properties.
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Examples:ViewThe number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity.
Examples:View
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections?expand=true&include=features,properties' --header 'Authorization: Bearer {TOKEN}'
listCollectionsOptionsModel := appConfigurationServiceInstance.NewListCollectionsOptions() listCollectionsOptionsModel.SetExpand(true) result, response, err := appConfigurationServiceInstance.ListCollections(listCollectionsOptionsModel)
Response
List of all Collections
Array of collections.
Number of records returned
Skipped number of records
Total number of records
URL to navigate to the first page of records
URL to navigate to the last page of records
URL to navigate to the previous list of records
URL to navigate to the next list of records
List of all Collections.
Array of collections.
Examples:ViewCollection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Collection description.
Possible values: length ≤ 255
Tags associated with the collection.
Creation time of the collection.
Examples:ViewLast updated time of the collection data.
Examples:ViewCollection URL.
List of Features associated with the collection.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the collection.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the collection.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Number of features associated with the collection.
Number of properties associated with the collection.
Number of snapshot associated with the collection.
Collections
Number of records returned.
Skipped number of records.
Total number of records.
Response having URL of the page.
URL to the page.
First
Response having URL of the page.
URL to the page.
Previous
Response having URL of the page.
URL to the page.
Next
Response having URL of the page.
URL to the page.
Last
Status Code
Successfully listed the collections.
Unauthorized
{ "collections": [ { "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd", "features": [ { "feature_id": "cycle-rentals", "name": "Cycle Rentals" }, { "feature_id": "discountRate", "name": "Discount Rate" }, { "feature_id": "longDistanceLimit", "name": "Long Distance Limit" } ], "properties": [ { "property_id": "bigbillionday", "name": "BigBillionDay" }, { "property_id": "newyear", "name": "NewYear" } ], "features_count": 3, "properties_count": 2 } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0" } }
{ "collections": [ { "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd", "features": [ { "feature_id": "cycle-rentals", "name": "Cycle Rentals" }, { "feature_id": "discountRate", "name": "Discount Rate" }, { "feature_id": "longDistanceLimit", "name": "Long Distance Limit" } ], "properties": [ { "property_id": "bigbillionday", "name": "BigBillionDay" }, { "property_id": "newyear", "name": "NewYear" } ], "features_count": 3, "properties_count": 2 } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Create Collection
Create a collection.
Create a collection.
POST /collections
(appConfiguration *AppConfigurationV1) CreateCollection(createCollectionOptions *CreateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateCollectionWithContext(ctx context.Context, createCollectionOptions *CreateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
Request
Instantiate the CreateCollectionOptions
struct and set the fields to provide parameter values for the CreateCollection
method.
Request to create Collection
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Collection description.
Possible values: length ≤ 255
Tags associated with the collection.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateCollection options.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewCollection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewCollection description.
Possible values: length ≤ 255
Examples:ViewTags associated with the collection.
Examples:View
curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name": <COLLECTION-NAME>,"collection_id": <COLLECTION-ID>,"description": <COLLECTION-DESCRIPTION>,"tags": <COLLECTION-TAGS>}'
createCollectionOptionsModel := appConfigurationServiceInstance.NewCreateCollectionOptions(name, collectionId) createCollectionOptionsModel.SetDescription(description) createCollectionOptionsModel.SetTags(tags) result, response, err := appConfigurationServiceInstance.CreateCollection(createCollectionOptionsModel)
Response
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Collection description.
Tags associated with the collection.
Creation time of the collection.
Example:
2021-05-12T23:20:50.52Z
Last updated time of the collection data.
Example:
2021-05-12T23:20:50.52Z
Collection URL
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Collection description.
Tags associated with the collection.
Creation time of the collection.
Examples:ViewLast updated time of the collection data.
Examples:ViewCollection URL.
Status Code
Successfully created the collection.
Bad request. Verify that the information in the request body is complete and correct.
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd" }
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd" }
{ "code": "FTEC1003E", "message": "Error while creating the collection." }
{ "code": "FTEC1003E", "message": "Error while creating the collection." }
Update Collection
Update the collection name, tags and description. Collection Id cannot be updated.
Update the collection name, tags and description. Collection Id cannot be updated.
PUT /collections/{collection_id}
(appConfiguration *AppConfigurationV1) UpdateCollection(updateCollectionOptions *UpdateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateCollectionWithContext(ctx context.Context, updateCollectionOptions *UpdateCollectionOptions) (result *CollectionLite, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateCollectionOptions
struct and set the fields to provide parameter values for the UpdateCollection
method.
Path Parameters
Collection Id of the collection
Request body of the update collection request
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Description of the collection.
Possible values: length ≤ 255
Tags associated with the collection.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateCollection options.
Collection Id of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Description of the collection.
Possible values: length ≤ 255
Tags associated with the collection.
curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name": <COLLECTION-NAME>,"description": <COLLECTION-DESCRIPTION>,"tags": <COLLECTION-TAGS>}'
updateCollectionOptionsModel := appConfigurationServiceInstance.NewUpdateCollectionOptions(collectionId) updateCollectionOptionsModel.SetName(name) updateCollectionOptionsModel.SetTags(tags) updateCollectionOptionsModel.SetDescription(description) result, response, err := appConfigurationServiceInstance.UpdateCollection(updateCollectionOptionsModel)
Response
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Collection description.
Tags associated with the collection.
Creation time of the collection.
Example:
2021-05-12T23:20:50.52Z
Last updated time of the collection data.
Example:
2021-05-12T23:20:50.52Z
Collection URL
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Collection description.
Tags associated with the collection.
Creation time of the collection.
Examples:ViewLast updated time of the collection data.
Examples:ViewCollection URL.
Status Code
Successfully updated the collection details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the collection id is correct.
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd" }
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd" }
{ "code": "FTEC1007E", "message": "Error while updating the collection." }
{ "code": "FTEC1007E", "message": "Error while updating the collection." }
{ "code": "FTEC1000E", "message": "Error while updating the collection. The queried resource 'Collection' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the collection. The queried resource 'Collection' is not available on the server." }
Get Collection
Retrieve the details of the collection.
Retrieve the details of the collection.
GET /collections/{collection_id}
(appConfiguration *AppConfigurationV1) GetCollection(getCollectionOptions *GetCollectionOptions) (result *Collection, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetCollectionWithContext(ctx context.Context, getCollectionOptions *GetCollectionOptions) (result *Collection, response *core.DetailedResponse, err error)
Request
Instantiate the GetCollectionOptions
struct and set the fields to provide parameter values for the GetCollection
method.
Path Parameters
Collection Id of the collection
Query Parameters
If set to
true
, returns expanded view of the resource details.Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetCollection options.
Collection Id of the collection.
If set to
true
, returns expanded view of the resource details.Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}?expand=true&include=features,properties' --header 'Authorization: Bearer {TOKEN}'
getCollectionOptionsModel := appConfigurationServiceInstance.NewGetCollectionOptions(collectionId) result, response, err := appConfigurationServiceInstance.GetCollection(getCollectionOptionsModel)
Response
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Collection description.
Possible values: length ≤ 255
Tags associated with the collection.
Creation time of the collection.
Example:
2021-05-12T23:20:50.52Z
Last updated time of the collection data.
Example:
2021-05-12T23:20:50.52Z
Collection URL
List of Features associated with the collection.
List of properties associated with the collection.
List of snapshots associated with the collection.
Number of features associated with the collection.
Number of properties associated with the collection.
Number of snapshot associated with the collection.
Details of the collection.
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Collection description.
Possible values: length ≤ 255
Tags associated with the collection.
Creation time of the collection.
Examples:ViewLast updated time of the collection data.
Examples:ViewCollection URL.
List of Features associated with the collection.
Examples:ViewFeature id.
Feature name.
Features
List of properties associated with the collection.
Examples:ViewProperty id.
Property name.
Properties
List of snapshots associated with the collection.
Examples:ViewGit Config id.
Git Config name.
Snapshots
Number of features associated with the collection.
Number of properties associated with the collection.
Number of snapshot associated with the collection.
Status Code
Successfully retrieved the collection details.
Not Found. Verify that the collection id is correct.
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd", "features": [ { "feature_id": "cycle-rentals", "name": "Cycle Rentals" }, { "feature_id": "discountRate", "name": "Discount Rate" }, { "feature_id": "longDistanceLimit", "name": "Long Distance Limit" } ], "properties": [ { "property_id": "bigbillionday", "name": "BigBillionDay" }, { "property_id": "newyearday", "name": "NewYearDay" } ], "features_count": 3, "properties_count": 2 }
{ "name": "GHz India Pvt Ltd", "collection_id": "ghzindiapvtltd", "description": "Collection for GHz Inc", "tags": "version: 1.1, pre-release", "created_time": "2020-01-09T00:16:07Z", "updated_time": "2020-03-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/collections/ghzindiapvtltd", "features": [ { "feature_id": "cycle-rentals", "name": "Cycle Rentals" }, { "feature_id": "discountRate", "name": "Discount Rate" }, { "feature_id": "longDistanceLimit", "name": "Long Distance Limit" } ], "properties": [ { "property_id": "bigbillionday", "name": "BigBillionDay" }, { "property_id": "newyearday", "name": "NewYearDay" } ], "features_count": 3, "properties_count": 2 }
{ "code": "FTEC1000E", "message": "Error while retrieving the collection. The queried resource 'Collection' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retrieving the collection. The queried resource 'Collection' is not available on the server." }
Delete Collection
Delete the collection.
Delete the collection.
DELETE /collections/{collection_id}
(appConfiguration *AppConfigurationV1) DeleteCollection(deleteCollectionOptions *DeleteCollectionOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteCollectionWithContext(ctx context.Context, deleteCollectionOptions *DeleteCollectionOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteCollectionOptions
struct and set the fields to provide parameter values for the DeleteCollection
method.
Path Parameters
Collection Id of the collection
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The DeleteCollection options.
Collection Id of the collection.
curl --request DELETE --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/collections/{COLLECTION_ID}' --header 'Authorization: Bearer {TOKEN}'
deleteCollectionOptionsModel := appConfigurationServiceInstance.NewDeleteCollectionOptions(collectionId) response, err := appConfigurationServiceInstance.DeleteCollection(deleteCollectionOptionsModel)
Response
Status Code
Successfully deleted the specified collection.
Not Found. Verify that the collection id is correct.
{ "code": "FTEC1000E", "message": "Error while deleting the collection. The queried resource 'Collection' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the collection. The queried resource 'Collection' is not available on the server." }
Get list of Features
List all the feature flags in the specified environment.
List all the feature flags in the specified environment.
GET /environments/{environment_id}/features
(appConfiguration *AppConfigurationV1) ListFeatures(listFeaturesOptions *ListFeaturesOptions) (result *FeaturesList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListFeaturesWithContext(ctx context.Context, listFeaturesOptions *ListFeaturesOptions) (result *FeaturesList, response *core.DetailedResponse, err error)
Request
Instantiate the ListFeaturesOptions
struct and set the fields to provide parameter values for the ListFeatures
method.
Path Parameters
Environment Id
Query Parameters
If set to
true
, returns expanded view of the resource details.Sort the feature details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Example:
version 1.1, pre-release
Filter features by a list of comma separated collections.
Filter features by a list of comma separated segments.
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Default:
10
The number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Default:
0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity
Example:
test tag
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The ListFeatures options.
Environment Id.
If set to
true
, returns expanded view of the resource details.Sort the feature details based on the specified attribute.
Allowable values: [
created_time
,updated_time
,id
,name (default)
]Filter the resources to be returned based on the associated tags. Specify the parameter as a list of comma separated tags. Returns resources associated with any of the specified tags.
Examples:ViewFilter features by a list of comma separated collections.
Filter features by a list of comma separated segments.
Include the associated collections or targeting rules details in the response.
Allowable values: [
collections
,rules
]The number of records to retrieve. By default, the list operation return the first 10 records. To retrieve different set of records, use
limit
withoffset
to page through the available records.Possible values: 1 ≤ value ≤ 100
Examples:ViewThe number of records to skip. By specifying
offset
, you retrieve a subset of items that starts with theoffset
value. Useoffset
withlimit
to page through the available records.Possible values: value ≥ 0
Searches for the provided keyword and returns the appropriate row with that value. Here the search happens on the '[Name OR Tag]' of the entity.
Examples:View
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features' --header 'Authorization: Bearer {TOKEN}'
listFeaturesOptionsModel := appConfigurationServiceInstance.NewListFeaturesOptions(environmentId) result, response, err := appConfigurationServiceInstance.ListFeatures(listFeaturesOptionsModel)
Response
List of all features
Array of Features.
Number of records returned
Skipped number of records
Total number of records
URL to navigate to the first page of records
URL to navigate to the last page of records
URL to navigate to the previous list of records
URL to navigate to the next list of records
List of all features.
Array of Features.
Examples:ViewFeature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Name of the collection.
Collections
Creation time of the feature flag.
Examples:ViewLast modified time of the feature flag data.
Examples:ViewThe last occurrence of the feature flag value evaluation.
Examples:ViewFeature flag URL.
Features
Number of records returned.
Skipped number of records.
Total number of records.
Response having URL of the page.
URL to the page.
First
Response having URL of the page.
URL to the page.
Previous
Response having URL of the page.
URL to the page.
Next
Response having URL of the page.
URL to the page.
Last
Status Code
Successfully listed all the features.
Unauthorized
{ "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flags to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "rollout_percentage": 90, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers" ] } ], "value": 25, "order": 1, "rollout_percentage": 10 } ], "segment_exists": true, "collections": [ { "collection_id": "web-app-collection" }, { "collection_id": "mobile-app-collection" } ], "created_time": "2020-06-09T00:16:07Z", "updated_time": "2020-06-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0" } }
{ "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flags to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "rollout_percentage": 90, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers" ] } ], "value": 25, "order": 1, "rollout_percentage": 10 } ], "segment_exists": true, "collections": [ { "collection_id": "web-app-collection" }, { "collection_id": "mobile-app-collection" } ], "created_time": "2020-06-09T00:16:07Z", "updated_time": "2020-06-09T12:16:07Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" } ], "limit": 10, "offset": 0, "total_count": 1, "first": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Create Feature
Create a feature flag
Create a feature flag.
POST /environments/{environment_id}/features
(appConfiguration *AppConfigurationV1) CreateFeature(createFeatureOptions *CreateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateFeatureWithContext(ctx context.Context, createFeatureOptions *CreateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
Request
Instantiate the CreateFeatureOptions
struct and set the fields to provide parameter values for the CreateFeature
method.
Path Parameters
Environment Id
Request to create feature flag
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Feature description
Possible values: length ≤ 255
Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Allowable values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Tags associated with the feature
Specify the targeting rules that is used to set different feature flag values for different segments.
List of collection id representing the collections that are associated with the specified feature flag.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The CreateFeature options.
Environment Id.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewFeature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewType of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
]Examples:ViewValue of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewValue of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewFeature description.
Possible values: length ≤ 255
Examples:ViewFormat of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Allowable values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Examples:ViewRollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Examples:ViewTags associated with the feature.
Examples:ViewSpecify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Collections
curl --request POST --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"feature_id":<FEATURE_ID>,"description":<FEATURE_DESCRIPTION>,"type":"BOOLEAN","enabled_value":true,"disabled_value":false,"rollout_percentage":90,"tags":"version: 1.1, pre-release","segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1,"rollout_percentage":45},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2,"rollout_percentage":30}],"collections":[{"collection_id":"ghzinc"},{"collection_id":"phzsystems"},{"collection_id":"ghzglobal"}],"enabled":true}'
ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) segmentRuleArray, _ := appConfigurationServiceInstance.NewFeatureSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order,segmentRolloutPercentage) collectionArray, _ := appConfigurationServiceInstance.NewCollectionRef(collectionId) createFeatureOptionsModel := appConfigurationServiceInstance.NewCreateFeatureOptions(environmentId, name, id, typeOfFeature, enabledValue, disabledValue) createFeatureOptionsModel.SetTags(tags) createFeatureOptionsModel.SetDescription(description) createFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*segmentRuleArray}) createFeatureOptionsModel.SetCollections([]appconfigurationv1.CollectionRef{*collectionArray}) if featureRolloutPercentage != nil { createFeatureOptionsModel.SetRolloutPercentage(*featureRolloutPercentage) } result, response, err := appConfigurationServiceInstance.CreateFeature(createFeatureOptionsModel)
Response
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Feature description
Possible values: length ≤ 255
Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature
Specify the targeting rules that is used to set different feature flag values for different segments.
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
Creation time of the feature flag.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the feature flag data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the feature flag value evaluation.
Example:
2021-05-12T23:20:50.52Z
Feature flag URL
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Name of the collection.
Collections
Creation time of the feature flag.
Examples:ViewLast modified time of the feature flag data.
Examples:ViewThe last occurrence of the feature flag value evaluation.
Examples:ViewFeature flag URL.
Status Code
Successfully created the feature flag.
Bad request. . Verify that the information in the request body is complete and correct.
Not Implemented.
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 40 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 5, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 40 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 5, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "not available", "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "available", "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "not available", "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "available", "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "code": "FTEC1003E", "message": "Error while creating the feature." }
{ "code": "FTEC1003E", "message": "Error while creating the feature." }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
Update Feature
Update a feature flag details
Update a feature flag details.
PUT /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) UpdateFeature(updateFeatureOptions *UpdateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateFeatureWithContext(ctx context.Context, updateFeatureOptions *UpdateFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateFeatureOptions
struct and set the fields to provide parameter values for the UpdateFeature
method.
Path Parameters
Environment Id
Feature Id
Request body to the update feature
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Tags associated with the feature
Specify the targeting rules that is used to set different property values for different segments.
List of collection id representing the collections that are associated with the specified property.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateFeature options.
Environment Id.
Feature Id.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewFeature description.
Possible values: length ≤ 255
Examples:ViewValue of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewValue of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewThe state of the feature flag.
Examples:ViewRollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Examples:ViewTags associated with the feature.
Examples:ViewSpecify the targeting rules that is used to set different property values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
List of collection id representing the collections that are associated with the specified property.
Examples:ViewCollection id.
Collections
curl --request PUT --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"description":<FEATURE_DESCRIPTION>,"type":"BOOLEAN","enabled_value":true,"disabled_value":false,"rollout_percentage":90,"tags":"version: 1.1, pre-release","segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1,"rollout_percentage":45},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2,"rollout_percentage":30}],"collections":[{"collection_id":"ghzinc"},{"collection_id":"phzsystems"},{"collection_id":"ghzglobal"}],"enabled":true}'
ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) segmentRuleArray, _ := appConfigurationServiceInstance.NewFeatureSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order,segmentRolloutPercentage) collectionArray, _ := appConfigurationServiceInstance.NewCollectionRef(collectionId) updateFeatureOptionsModel := appConfigurationServiceInstance.NewUpdateFeatureOptions(environmentId, id) updateFeatureOptionsModel.SetName(name) updateFeatureOptionsModel.SetDescription(description) updateFeatureOptionsModel.SetTags(tags) updateFeatureOptionsModel.SetDisabledValue(disabledValue) updateFeatureOptionsModel.SetEnabledValue(enabledValue) updateFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*segmentRuleArray}) updateFeatureOptionsModel.SetCollections([]appconfigurationv1.CollectionRef{*collectionArray}) if featureRolloutPercentage != nil { updateFeatureOptionsModel.SetRolloutPercentage(*featureRolloutPercentage) } result, response, err := appConfigurationServiceInstance.UpdateFeature(updateFeatureOptionsModel)
Response
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Feature description
Possible values: length ≤ 255
Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature
Specify the targeting rules that is used to set different feature flag values for different segments.
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
Creation time of the feature flag.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the feature flag data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the feature flag value evaluation.
Example:
2021-05-12T23:20:50.52Z
Feature flag URL
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Name of the collection.
Collections
Creation time of the feature flag.
Examples:ViewLast modified time of the feature flag data.
Examples:ViewThe last occurrence of the feature flag value evaluation.
Examples:ViewFeature flag URL.
Status Code
Successfully updated the feature flag details
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the feature id is correct.
Not Implemented.
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 90 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 90 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 90 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 90 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 40 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 40 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2, "rollout_percentage": 70 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "no", "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "yes", "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "no", "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "yes", "order": 2, "rollout_percentage": 15 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "code": "FTEC1007E", "message": "Error while updating the feature." }
{ "code": "FTEC1007E", "message": "Error while updating the feature." }
{ "code": "FTEC1000E", "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
Update Feature Values
Update the feature values. This method can be executed only by the writer
role. This method allows the update of feature name, feature enabled_value, feature disabled_value, tags, description and feature segment rules, however this method does not allow toggling the feature flag and assigning feature to a collection.
Update the feature values. This method can be executed only by the writer
role. This method allows the update of feature name, feature enabled_value, feature disabled_value, tags, description and feature segment rules, however this method does not allow toggling the feature flag and assigning feature to a collection.
PATCH /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) UpdateFeatureValues(updateFeatureValuesOptions *UpdateFeatureValuesOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateFeatureValuesWithContext(ctx context.Context, updateFeatureValuesOptions *UpdateFeatureValuesOptions) (result *Feature, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateFeatureValuesOptions
struct and set the fields to provide parameter values for the UpdateFeatureValues
method.
Path Parameters
Environment Id
Feature Id
Request body to update feature values
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Tags associated with the feature.
Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Specify the targeting rules that is used to set different property values for different segments.
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The UpdateFeatureValues options.
Environment Id.
Feature Id.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:ViewFeature description.
Possible values: length ≤ 255
Examples:ViewTags associated with the feature.
Examples:ViewValue of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewValue of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Examples:ViewRollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Examples:ViewSpecify the targeting rules that is used to set different property values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
curl --request PATCH --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}' --header 'Content-Type: application/json' --data '{"name":<FEATURE_NAME>,"enabled_value":true,"disabled_value":false,"rollout_percentage":90,"segment_rules":[{"rules":[{"segments":["betausers","premiumusers"]}],"value":true,"order":1,"rollout_percentage":45},{"rules":[{"segments":["freeusers"]}],"value":false,"order":2,"rollout_percentage":30}]}'
ruleArray, _ := appConfigurationServiceInstance.NewTargetSegments(segments) segmentRuleArray, _ := appConfigurationServiceInstance.NewSegmentRule([]appconfigurationv1.TargetSegments{*ruleArray}, value, order,segmentRolloutPercentage) patchFeatureOptionsModel := appConfigurationServiceInstance.NewUpdateFeatureValuesOptions(environmentId, id) patchFeatureOptionsModel.SetName(name) patchFeatureOptionsModel.SetDescription(description) patchFeatureOptionsModel.SetTags(tags) patchFeatureOptionsModel.SetDisabledValue(disabledValue) patchFeatureOptionsModel.SetEnabledValue(enabledValue) patchFeatureOptionsModel.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*segmentRuleArray}) if featureRolloutPercentage != nil { patchFeatureOptionsModel.SetRolloutPercentage(*featureRolloutPercentage) } result, response, err := appConfigurationServiceInstance.UpdateFeatureValues(patchFeatureOptionsModel)
Response
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Feature description
Possible values: length ≤ 255
Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature
Specify the targeting rules that is used to set different feature flag values for different segments.
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
Creation time of the feature flag.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the feature flag data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the feature flag value evaluation.
Example:
2021-05-12T23:20:50.52Z
Feature flag URL
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Name of the collection.
Collections
Creation time of the feature flag.
Examples:ViewLast modified time of the feature flag data.
Examples:ViewThe last occurrence of the feature flag value evaluation.
Examples:ViewFeature flag URL.
Status Code
Successfully updated the feature values.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the feature id is correct.
Not Implemented.
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "NUMERIC", "enabled_value": 1, "disabled_value": 0, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "no", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "yes", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "TEXT", "enabled_value": "yes", "disabled_value": "no", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "no", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "yes", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "JSON", "enabled_value": { "availability": "yes" }, "disabled_value": { "availability": "no" }, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "availability": "no" }, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "availability": "no" }, "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "STRING", "format": "YAML", "enabled_value": "---\navailability: 'yes'", "disabled_value": "---\navailability: 'no'", "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\navailability: 'yes'\npremium_user_ids:\n- custId1\n- custId2", "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\navailability: 'no'", "order": 2, "rollout_percentage": 100 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "code": "FTEC1007E", "message": "Error while updating the feature values." }
{ "code": "FTEC1007E", "message": "Error while updating the feature values." }
{ "code": "FTEC1000E", "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'rollout_percentage' feature is not available" }
Get Feature
Retrieve details of a feature.
Retrieve details of a feature.
GET /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) GetFeature(getFeatureOptions *GetFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetFeatureWithContext(ctx context.Context, getFeatureOptions *GetFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
Request
Instantiate the GetFeatureOptions
struct and set the fields to provide parameter values for the GetFeature
method.
Path Parameters
Environment Id
Feature Id
Query Parameters
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]
WithContext method only
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request.
The GetFeature options.
Environment Id.
Feature Id.
Include the associated collections in the response.
Allowable values: [
collections
]
curl --request GET --url 'https://{REGION}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{GUID}/environments/{ENVIRONMENT_ID}/features/{FEATURE_ID}' --header 'Authorization: Bearer {TOKEN}'
getFeatureOptionsModel := appConfigurationServiceInstance.NewGetFeatureOptions(environmentId, featureId) result, response, err := appConfigurationServiceInstance.GetFeature(getFeatureOptionsModel)
Response
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Feature description
Possible values: length ≤ 255
Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature
Specify the targeting rules that is used to set different feature flag values for different segments.
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_number.
If you have enabled the workflow configuration and have a pending CR then this provides the change_request_status.
Creation time of the feature flag.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the feature flag data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the feature flag value evaluation.
Example:
2021-05-12T23:20:50.52Z
Feature flag URL
Details of the feature.
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Feature description.
Possible values: length ≤ 255
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
]Format of the feature (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
andNUMERIC
types. This property is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
andNUMERIC
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the feature when it is enabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.Value of the feature when it is disabled. The value can be Boolean, Numeric, String - TEXT, String - JSON, String - YAML value as per the
type
andformat
attributes.The state of the feature flag.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:ViewThe list of targeted segments.
Examples:ViewList of segment ids that are used for targeting using the rule.
Rules
Value to be used for evaluation for this rule. The value can be Boolean, SecretRef, String - TEXT , String - JSON , String - YAML or a Numeric value as per the
type
andformat
attributes.Order of the rule, used during evaluation. The evaluation is performed in the order defined and the value associated with the first matching rule is used for evaluation.
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
SegmentRules
Denotes if the targeting rules are specified for the feature flag.
List of collection id representing the collections that are associated with the specified feature flag.
Examples:ViewCollection id.
Name of the collection.
Collections
Creation time of the feature flag.
Examples:ViewLast modified time of the feature flag data.
Examples:ViewThe last occurrence of the feature flag value evaluation.
Examples:ViewFeature flag URL.
Status Code
Successfully retrieved the feature details.
Not Found. Verify that the feature id is correct.
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 90, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "Feature flag to enable Cycle Rentals", "type": "BOOLEAN", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 90, "tags": "version: 1.1, pre-release", "change_request_status": "PENDING", "change_request_number": "CHG0030423", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "created_time": "2021-05-12T23:20:50.52Z", "updated_time": "2021-05-12T23:20:50.52Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/features/cycle-rentals" }
{ "code": "FTEC1000E", "message": "Error while retreiving the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retreiving the feature. The queried resource 'Feature' is not available on the server." }
Delete Feature
Delete a feature flag
Delete a feature flag.
DELETE /environments/{environment_id}/features/{feature_id}
(appConfiguration *AppConfigurationV1) DeleteFeature(deleteFeatureOptions *DeleteFeatureOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteFeatureWithContext(ctx context.Context, deleteFeatureOptions *DeleteFeatureOptions) (response *core.DetailedResponse, err error)