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 |
Installing the Go SDK
Go modules (recommended): Add the following import in your code, and then run go build
or go mod tidy
import (
"github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
)
Go get
go get -u github.com/IBM/appconfiguration-go-admin-sdk
View on GitHub
Endpoint 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}
- Frankfurt:
https://eu-de.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}
- Frankfurt:
https://private.eu-de.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. |
Frankfurt | All App Configuration actions run in the Frankfurt (eu-de ) location. |
All metadata for the app's features are stored in the Frankfurt (eu-de ) location. |
Data is replicated between three zones within eu-de for high-availability. |
Base URL
https://{region}.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}
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}
and {guid}
in this example with the values for your particular API call.
Example request to a Dallas endpoint:
import (
"encoding/json"
"fmt"
"github.com/IBM/go-sdk-core/v5/core"
ac "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
)
func main() {
appConfigurationService, err := ac.NewAppConfigurationV1(&ac.AppConfigurationV1Options {
URL: "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/{guid}",
Authenticator: & core.IamAuthenticator {
ApiKey: "<API_KEY>",
},
})
if err != nil {
panic(err)
}
}
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.
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.
To call each method, you'll need to be assigned a role that includes the required IAM actions. Each method lists the associated action. For more information about IAM actions and how they map to roles, see Assigning access to account management services.
To retrieve your access token:
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 IAM API key.
Setting client options through external configuration
Example environment variables, where {SERVICE_URL}
is the endpoint URL and {API_KEY}
is your IAM API key
export APP_CONFIGURATION_URL={SERVICE_URL}
export APP_CONFIGURATION_AUTH_TYPE=iam
export APP_CONFIGURATION_APIKEY={API_KEY}
Example of constructing the service client
import {
ac "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
}
...
serviceClientOptions := &ac.AppConfigurationV1Options{}
serviceClient, err := ac.NewAppConfigurationV1UsingExternalConfig(serviceClientOptions)
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 ac "github.com/IBM/appconfiguration-go-admin-sdk/appconfigurationv1"
// Instantiate a service
appConfigurationService, err := ac.NewAppConfigurationV1(&ac.AppConfigurationV1Options)
// Check for errors
if err != nil {
panic(err)
}
// Call a method
result, response, err := appConfigurationService.MethodName(&methodOptions)
// Check for errors
if err != nil {
panic(err)
}
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.Example:
true
Sort the environment details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
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
]Examples:[ "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.Examples:true
Sort the environment details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
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:version 1.1,pre-release
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "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
Examples: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.
Examples:test tag
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments?expand=true&sort=created_time&tags=version 1.1,pre-release&include=features,properties,snapshots&search=test tag"
listEnvironmentsOptions := &appconfigurationv1.ListEnvironmentsOptions{ Expand: core.BoolPtr(true), Sort: core.StringPtr("created_time"), Tags: core.StringPtr("version 1.1,pre-release"), Include: []string{"features", "properties", "snapshots"}, Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("test tag"), } pager, err := appConfigurationService.NewEnvironmentsPager(listEnvironmentsOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.Environment for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all environments.
Array of environments.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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.
{
"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"
}
}
Array of environments.
Examples:{ "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" }
- Environments
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:#FDD13A
Creation time of the environment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the environment data.
Examples:2021-05-12T23:20:50.520Z
Environment URL.
List of Features associated with the environment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the environment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the environment.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
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.
The request body to create a new environment.
{
"name": "Dev environment",
"environment_id": "dev-environment",
"description": "Dev environment description",
"tags": "development",
"color_code": "#FDD13A"
}
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the environment, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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:Dev environment
Environment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:dev-environment
Environment description.
Possible values: length ≤ 255
Examples:Dev environment description
Tags associated with the environment.
Examples:development
Color code to distinguish the environment. The Hex code for the color. For example
#FF0000
forred
.Examples:#FDD13A
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Dev environment", "environment_id": "dev-environment", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A" }' "{base_url}/environments"
createEnvironmentOptions := appConfigurationService.NewCreateEnvironmentOptions( "Dev environment", "dev-environment", ) createEnvironmentOptions.SetDescription("Dev environment description") createEnvironmentOptions.SetTags("development") createEnvironmentOptions.SetColorCode("#FDD13A") environment, response, err := appConfigurationService.CreateEnvironment(createEnvironmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(environment, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the environment, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:#FDD13A
Creation time of the environment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the environment data.
Examples:2021-05-12T23:20:50.520Z
Environment URL.
List of Features associated with the environment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the environment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the environment.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
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
Example:
environment_id
The request body to update a environment.
{
"name": "Dev environment",
"description": "Dev environment description",
"tags": "development",
"color_code": "#FDD13A"
}
Environment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Environment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the environment, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
Examples: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:#FDD13A
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"name":"Dev environment","description":"Dev environment description","tags":"development","color_code":"#FDD13A"}' "{base_url}/environments/{environment_id}"
updateEnvironmentOptions := appConfigurationService.NewUpdateEnvironmentOptions( "environment_id", ) environment, response, err := appConfigurationService.UpdateEnvironment(updateEnvironmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(environment, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the environment, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:#FDD13A
Creation time of the environment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the environment data.
Examples:2021-05-12T23:20:50.520Z
Environment URL.
List of Features associated with the environment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the environment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the environment.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
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
Example:
environment_id
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "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.
Examples:environment_id
If set to
true
, returns expanded view of the resource details.Examples:true
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "features", "properties", "snapshots" ]
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}?expand=true&include=features,properties,snapshots"
getEnvironmentOptions := appConfigurationService.NewGetEnvironmentOptions( "environment_id", ) getEnvironmentOptions.SetExpand(true) getEnvironmentOptions.SetInclude([]string{"features", "properties", "snapshots"}) environment, response, err := appConfigurationService.GetEnvironment(getEnvironmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(environment, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the environment, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:#FDD13A
Creation time of the environment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the environment data.
Examples:2021-05-12T23:20:50.520Z
Environment URL.
List of Features associated with the environment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the environment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the environment.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
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
Example:
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.
Examples:environment_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/environments/{environment_id}"
deleteEnvironmentOptions := appConfigurationService.NewDeleteEnvironmentOptions( "environment_id", ) response, err := appConfigurationService.DeleteEnvironment(deleteEnvironmentOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteEnvironment(): %d\n", response.StatusCode) }
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.Example:
true
Sort the collection details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
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.
Examples:[ "my-feature-id", "cycle-rentals" ]
Filter collections by a list of comma separated properties.
Examples:[ "my-property-id", "email-property" ]
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "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.Examples:true
Sort the collection details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
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:version 1.1,pre-release
Filter collections by a list of comma separated features.
Examples:[ "my-feature-id", "cycle-rentals" ]
Filter collections by a list of comma separated properties.
Examples:[ "my-property-id", "email-property" ]
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "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
Examples: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.
Examples:test tag
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/collections?expand=true&sort=created_time&tags=version 1.1,pre-release&features=my-feature-id,cycle-rentals&properties=my-property-id,email-property&include=features,properties,snapshots&search=test tag"
listCollectionsOptions := &appconfigurationv1.ListCollectionsOptions{ Expand: core.BoolPtr(true), Sort: core.StringPtr("created_time"), Tags: core.StringPtr("version 1.1,pre-release"), Features: []string{"my-feature-id", "cycle-rentals"}, Properties: []string{"my-property-id", "email-property"}, Include: []string{"features", "properties", "snapshots"}, Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("test tag"), } pager, err := appConfigurationService.NewCollectionsPager(listCollectionsOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.Collection for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all Collections
Array of collections.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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.
{
"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"
}
}
Array of collections.
Examples:{ "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 }
- Collections
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:2021-05-12T23:20:50.520Z
Last updated time of the collection data.
Examples:2021-05-12T23:20:50.520Z
Collection URL.
List of Features associated with the collection.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the collection.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the collection.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
Number of features associated with the collection.
Number of properties associated with the collection.
Number of snapshot associated with the collection.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
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.
The request body to create a new collection.
{
"name": "Web App Collection",
"collection_id": "web-app-collection",
"description": "Collection for Web application",
"tags": "version: 1.1, pre-release"
}
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the collection, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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:Web App Collection
Collection Id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:web-app-collection
Collection description.
Possible values: length ≤ 255
Examples:Collection for Web application
Tags associated with the collection.
Examples:version: 1.1, pre-release
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Web App Collection", "collection_id": "web-app-collection", "description": "Collection for Web application", "tags": "version: 1.1, pre-release" }' "{base_url}/collections"
createCollectionOptions := appConfigurationService.NewCreateCollectionOptions( "Web App Collection", "web-app-collection", ) createCollectionOptions.SetDescription("Collection for Web application") createCollectionOptions.SetTags("version: 1.1, pre-release") collectionLite, response, err := appConfigurationService.CreateCollection(createCollectionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(collectionLite, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the collection, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:2021-05-12T23:20:50.520Z
Last updated time of the collection data.
Examples:2021-05-12T23:20:50.520Z
Collection 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
Example:
collection_id
The request body to update a collection.
{
"name": "Web Application",
"description": "Collection for Web Application.",
"tags": "version: 1.1, pre-release"
}
Collection name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Description of the collection, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the collection, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
Examples:collection_id
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 -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"name":"Web Application","description":"Collection for Web Application.","tags":"version: 1.1, pre-release"}' "{base_url}/collections/{collection_id}"
updateCollectionOptions := appConfigurationService.NewUpdateCollectionOptions( "collection_id", ) collectionLite, response, err := appConfigurationService.UpdateCollection(updateCollectionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(collectionLite, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the collection, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:2021-05-12T23:20:50.520Z
Last updated time of the collection data.
Examples:2021-05-12T23:20:50.520Z
Collection 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
Example:
collection_id
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "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.
Examples:collection_id
If set to
true
, returns expanded view of the resource details.Examples:true
Include feature, property, snapshots details in the response.
Allowable values: [
features
,properties
,snapshots
]Examples:[ "features", "properties", "snapshots" ]
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/collections/{collection_id}?expand=true&include=features,properties,snapshots"
getCollectionOptions := appConfigurationService.NewGetCollectionOptions( "collection_id", ) getCollectionOptions.SetExpand(true) getCollectionOptions.SetInclude([]string{"features", "properties", "snapshots"}) collection, response, err := appConfigurationService.GetCollection(getCollectionOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(collection, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the collection, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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
}
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:2021-05-12T23:20:50.520Z
Last updated time of the collection data.
Examples:2021-05-12T23:20:50.520Z
Collection URL.
List of Features associated with the collection.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the collection.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
List of snapshots associated with the collection.
Examples:{ "git_config_id": "bootstrap-config", "name": "Bootstrap Configuration" }
- Snapshots
Git Config id.
Git Config name.
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
Example:
collection_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 DeleteCollection options.
Collection Id of the collection.
Examples:collection_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/collections/{collection_id}"
deleteCollectionOptions := appConfigurationService.NewDeleteCollectionOptions( "collection_id", ) response, err := appConfigurationService.DeleteCollection(deleteCollectionOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteCollection(): %d\n", response.StatusCode) }
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
Example:
environment_id
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
Sort the feature details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
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.
Examples:[ "my-collection-id", "ghzindiapvtltd" ]
Filter features by a list of comma separated segments.
Examples:[ "my-segment-id", "beta-users" ]
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]Examples:[ "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.
Examples:environment_id
If set to
true
, returns expanded view of the resource details.Examples:true
Sort the feature details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
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:version 1.1,pre-release
Filter features by a list of comma separated collections.
Examples:[ "my-collection-id", "ghzindiapvtltd" ]
Filter features by a list of comma separated segments.
Examples:[ "my-segment-id", "beta-users" ]
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]Examples:[ "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
Examples: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.
Examples:test tag
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}/features?expand=true&sort=created_time&tags=version 1.1,pre-release&collections=my-collection-id,ghzindiapvtltd&segments=my-segment-id,beta-users&include=collections,rules,change_request&search=test tag"
listFeaturesOptions := &appconfigurationv1.ListFeaturesOptions{ EnvironmentID: core.StringPtr("environment_id"), Expand: core.BoolPtr(true), Sort: core.StringPtr("created_time"), Tags: core.StringPtr("version 1.1,pre-release"), Collections: []string{"my-collection-id", "ghzindiapvtltd"}, Segments: []string{"my-segment-id", "beta-users"}, Include: []string{"collections", "rules", "change_request"}, Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("test tag"), } pager, err := appConfigurationService.NewFeaturesPager(listFeaturesOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.Feature for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all features
Array of Features.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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.
{
"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"
}
}
Array of Features.
Examples:{ "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" }
- Features
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature flag URL.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
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
Example:
environment_id
The request body to create a new feature.
BOOLEAN
{
"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": 50
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2,
"rollout_percentage": 70
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
NUMERIC
{
"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": 40
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 5,
"order": 2,
"rollout_percentage": 70
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - TEXT
{
"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": "not available",
"order": 1,
"rollout_percentage": 50
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "available",
"order": 2,
"rollout_percentage": 15
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - JSON
{
"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": "yes",
"premium_user_ids": [
"custId1",
"custId2"
]
},
"order": 1,
"rollout_percentage": 50
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"availability": "no"
},
"order": 2,
"rollout_percentage": 15
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - YAML
{
"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
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
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.
Examples:environment_id
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Cycle Rentals
Feature id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:cycle-rentals
Type of the feature (BOOLEAN, STRING, NUMERIC). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
]Examples:BOOLEAN
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.Examples:true
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.Examples:false
Feature description.
Possible values: length ≤ 255
Examples:Feature flag to enable Cycle Rentals
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.
Examples:true
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Examples:100
Tags associated with the feature.
Examples:version: 1.1, pre-release
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 70 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
Default:
100
List of collection id representing the collections that are associated with the specified feature flag.
Examples:[ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ]
- Collections
Collection id.
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "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": 50 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 70 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ] }' "{base_url}/environments/{environment_id}/features"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } featureSegmentRuleModel := &appconfigurationv1.FeatureSegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), RolloutPercentage: core.Int64Ptr(int64(50)), } collectionRefModel := &appconfigurationv1.CollectionRef{ CollectionID: core.StringPtr("ghzinc"), } createFeatureOptions := appConfigurationService.NewCreateFeatureOptions( "environment_id", "Cycle Rentals", "cycle-rentals", "BOOLEAN", "true", "false", ) createFeatureOptions.SetDescription("Feature flag to enable Cycle Rentals") createFeatureOptions.SetEnabled(true) createFeatureOptions.SetRolloutPercentage(int64(100)) createFeatureOptions.SetTags("version: 1.1, pre-release") createFeatureOptions.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*featureSegmentRuleModel}) createFeatureOptions.SetCollections([]appconfigurationv1.CollectionRef{*collectionRefModel}) feature, response, err := appConfigurationService.CreateFeature(createFeatureOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(feature, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature 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
Example:
environment_id
Feature Id
Example:
feature_id
The request body to update a feature.
BOOLEAN
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": true,
"disabled_value": false,
"enabled": true,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1,
"rollout_percentage": 90
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2,
"rollout_percentage": 90
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
}
]
}
NUMERIC
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": 1,
"disabled_value": 0,
"enabled": true,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": 10,
"order": 1,
"rollout_percentage": 40
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 0,
"order": 2,
"rollout_percentage": 70
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
}
]
}
STRING - TEXT
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": "yes",
"disabled_value": "no",
"enabled": true,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "no",
"order": 1,
"rollout_percentage": 50
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "yes",
"order": 2,
"rollout_percentage": 15
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
}
]
}
STRING - JSON
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": {
"availability": "yes"
},
"disabled_value": {
"availability": "no"
},
"enabled": true,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-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
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
}
]
}
STRING - YAML
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": "---\navailability: 'yes'",
"disabled_value": "---\navailability: 'no'",
"enabled": true,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-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
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
}
]
}
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
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.
Examples:environment_id
Feature Id.
Examples:feature_id
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Cycle Rentals
Feature description.
Possible values: length ≤ 255
Examples:Feature flags to enable Cycle Rentals
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.Examples:true
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.Examples:false
The state of the feature flag.
Examples:true
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Examples:100
Tags associated with the feature.
Examples:version: 1.1, yet-to-release
Specify the targeting rules that is used to set different property values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 90 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 90 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
Default:
100
List of collection id representing the collections that are associated with the specified property.
Examples:[ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" } ]
- Collections
Collection id.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Cycle Rentals", "description": "Feature flags to enable Cycle Rentals", "enabled_value": true, "disabled_value": false, "enabled": true, "rollout_percentage": 100, "tags": "version: 1.1, yet-to-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 90 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 90 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" } ] }' "{base_url}/environments/{environment_id}/features/{feature_id}"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } featureSegmentRuleModel := &appconfigurationv1.FeatureSegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), RolloutPercentage: core.Int64Ptr(int64(90)), } collectionRefModel := &appconfigurationv1.CollectionRef{ CollectionID: core.StringPtr("ghzinc"), } updateFeatureOptions := appConfigurationService.NewUpdateFeatureOptions( "environment_id", "feature_id", ) updateFeatureOptions.SetName("Cycle Rentals") updateFeatureOptions.SetDescription("Feature flags to enable Cycle Rentals") updateFeatureOptions.SetEnabledValue("true") updateFeatureOptions.SetDisabledValue("false") updateFeatureOptions.SetEnabled(true) updateFeatureOptions.SetRolloutPercentage(int64(100)) updateFeatureOptions.SetTags("version: 1.1, yet-to-release") updateFeatureOptions.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*featureSegmentRuleModel}) updateFeatureOptions.SetCollections([]appconfigurationv1.CollectionRef{*collectionRefModel}) feature, response, err := appConfigurationService.UpdateFeature(updateFeatureOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(feature, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature 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
Example:
environment_id
Feature Id
Example:
feature_id
The request body to update the feature values.
BOOLEAN
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": true,
"disabled_value": false,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1,
"rollout_percentage": 100
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2,
"rollout_percentage": 100
}
]
}
NUMERIC
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": 1,
"disabled_value": 0,
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": 10,
"order": 1,
"rollout_percentage": 100
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 0,
"order": 2,
"rollout_percentage": 100
}
]
}
STRING - TEXT
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": "yes",
"disabled_value": "no",
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "no",
"order": 1,
"rollout_percentage": 100
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "yes",
"order": 2,
"rollout_percentage": 100
}
]
}
STRING - JSON
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": {
"availability": "yes"
},
"disabled_value": {
"availability": "no"
},
"rollout_percentage": 100,
"tags": "version: 1.1, yet-to-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
}
]
}
STRING - YAML
{
"name": "Cycle Rentals",
"description": "Feature flags to enable Cycle Rentals",
"enabled_value": "---\navailability: 'yes'",
"disabled_value": "---\navailability: 'no'",
"tags": "version: 1.1, yet-to-release",
"rollout_percentage": 100,
"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
}
]
}
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Feature description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the feature, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
Examples:environment_id
Feature Id.
Examples:feature_id
Feature name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Cycle Rentals
Feature description.
Possible values: length ≤ 255
Examples:Feature flags to enable Cycle Rentals
Tags associated with the feature.
Examples:version: 1.1, yet-to-release
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.Examples:true
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.Examples:false
Rollout percentage associated with feature flag. Supported only for Lite and Enterprise plans.
Possible values: 0 ≤ value ≤ 100
Default:
100
Examples:100
Specify the targeting rules that is used to set different property values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 100 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
Default:
100
curl -X PATCH --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Cycle Rentals", "description": "Feature flags to enable Cycle Rentals", "enabled_value": true, "disabled_value": false, "rollout_percentage": 100, "tags": "version: 1.1, yet-to-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 100 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 100 } ] }' "{base_url}/environments/{environment_id}/features/{feature_id}"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } featureSegmentRuleModel := &appconfigurationv1.FeatureSegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), RolloutPercentage: core.Int64Ptr(int64(100)), } updateFeatureValuesOptions := appConfigurationService.NewUpdateFeatureValuesOptions( "environment_id", "feature_id", ) updateFeatureValuesOptions.SetName("Cycle Rentals") updateFeatureValuesOptions.SetDescription("Feature flags to enable Cycle Rentals") updateFeatureValuesOptions.SetTags("version: 1.1, yet-to-release") updateFeatureValuesOptions.SetEnabledValue("true") updateFeatureValuesOptions.SetDisabledValue("false") updateFeatureValuesOptions.SetRolloutPercentage(int64(100)) updateFeatureValuesOptions.SetSegmentRules([]appconfigurationv1.FeatureSegmentRule{*featureSegmentRuleModel}) feature, response, err := appConfigurationService.UpdateFeatureValues(updateFeatureValuesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(feature, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature 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
Example:
environment_id
Feature Id
Example:
feature_id
Query Parameters
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]Examples:[ "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.
Examples:environment_id
Feature Id.
Examples:feature_id
Include the associated collections or targeting rules or change request details in the response.
Allowable values: [
collections
,rules
,change_request
]Examples:[ "collections", "rules", "change_request" ]
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}/features/{feature_id}?include=collections,rules,change_request"
getFeatureOptions := appConfigurationService.NewGetFeatureOptions( "environment_id", "feature_id", ) getFeatureOptions.SetInclude([]string{"collections", "rules", "change_request"}) feature, response, err := appConfigurationService.GetFeature(getFeatureOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(feature, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature 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)
Request
Instantiate the DeleteFeatureOptions
struct and set the fields to provide parameter values for the DeleteFeature
method.
Path Parameters
Environment Id
Example:
environment_id
Feature Id
Example:
feature_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 DeleteFeature options.
Environment Id.
Examples:environment_id
Feature Id.
Examples:feature_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/environments/{environment_id}/features/{feature_id}"
deleteFeatureOptions := appConfigurationService.NewDeleteFeatureOptions( "environment_id", "feature_id", ) response, err := appConfigurationService.DeleteFeature(deleteFeatureOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteFeature(): %d\n", response.StatusCode) }
Response
Status Code
Successfully deleted the specified feature.
Not Found. Verify that the feature id is correct.
{ "code": "FTEC1000E", "message": "Error while deleting the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the feature. The queried resource 'Feature' is not available on the server." }
Toggle Feature
Toggle a feature.
Toggle a feature.
PUT /environments/{environment_id}/features/{feature_id}/toggle
(appConfiguration *AppConfigurationV1) ToggleFeature(toggleFeatureOptions *ToggleFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ToggleFeatureWithContext(ctx context.Context, toggleFeatureOptions *ToggleFeatureOptions) (result *Feature, response *core.DetailedResponse, err error)
Request
Instantiate the ToggleFeatureOptions
struct and set the fields to provide parameter values for the ToggleFeature
method.
Path Parameters
Environment Id
Example:
environment_id
Feature Id
Example:
feature_id
The request body to toggle a feature.
{
"enabled": true
}
The state of the feature flag
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 ToggleFeature options.
Environment Id.
Examples:environment_id
Feature Id.
Examples:feature_id
The state of the feature flag.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"enabled":true}' "{base_url}/environments/{environment_id}/features/{feature_id}/toggle"
toggleFeatureOptions := appConfigurationService.NewToggleFeatureOptions( "environment_id", "feature_id", true, ) feature, response, err := appConfigurationService.ToggleFeature(toggleFeatureOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(feature, "", " ") fmt.Println(string(b))
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, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
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, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
{
"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"
}
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
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:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
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.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the feature flag data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the feature flag value evaluation.
Examples:2021-05-12T23:20:50.520Z
Feature flag URL.
Status Code
Successfully toggled the specified feature.
Bad request.
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 in toggle feature request." }
{ "code": "FTEC1000E", "message": "Error in toggle feature request." }
{ "code": "FTEC1000E", "message": "Error while toggling the feature. The queried resource 'Feature' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while toggling the feature. The queried resource 'Feature' is not available on the server." }
Get list of Properties
List all the properties in the specified environment.
List all the properties in the specified environment.
GET /environments/{environment_id}/properties
(appConfiguration *AppConfigurationV1) ListProperties(listPropertiesOptions *ListPropertiesOptions) (result *PropertiesList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListPropertiesWithContext(ctx context.Context, listPropertiesOptions *ListPropertiesOptions) (result *PropertiesList, response *core.DetailedResponse, err error)
Request
Instantiate the ListPropertiesOptions
struct and set the fields to provide parameter values for the ListProperties
method.
Path Parameters
Environment Id
Example:
environment_id
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
Sort the property details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
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 properties by a list of comma separated collections.
Examples:[ "my-collection-id", "ghzindiapvtltd" ]
Filter properties by a list of comma separated segments.
Examples:[ "my-segment-id", "beta-users" ]
Include the associated collections or targeting rules details in the response.
Allowable values: [
collections
,rules
]Examples:[ "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
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 ListProperties options.
Environment Id.
Examples:environment_id
If set to
true
, returns expanded view of the resource details.Examples:true
Sort the property details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
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:version 1.1,pre-release
Filter properties by a list of comma separated collections.
Examples:[ "my-collection-id", "ghzindiapvtltd" ]
Filter properties by a list of comma separated segments.
Examples:[ "my-segment-id", "beta-users" ]
Include the associated collections or targeting rules details in the response.
Allowable values: [
collections
,rules
]Examples:[ "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
Default:
10
Examples: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.
Examples:test tag
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}/properties?expand=true&sort=created_time&tags=version 1.1,pre-release&collections=my-collection-id,ghzindiapvtltd&segments=my-segment-id,beta-users&include=collections,rules&search=test tag"
listPropertiesOptions := &appconfigurationv1.ListPropertiesOptions{ EnvironmentID: core.StringPtr("environment_id"), Expand: core.BoolPtr(true), Sort: core.StringPtr("created_time"), Tags: core.StringPtr("version 1.1,pre-release"), Collections: []string{"my-collection-id", "ghzindiapvtltd"}, Segments: []string{"my-segment-id", "beta-users"}, Include: []string{"collections", "rules"}, Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("test tag"), } pager, err := appConfigurationService.NewPropertiesPager(listPropertiesOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.Property for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all properties.
Array of properties.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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 properties.
{
"properties": [
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"segment_exists": true,
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
],
"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/properties/email-property"
}
],
"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/properties?limit=10&offset=0"
},
"last": {
"href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0"
}
}
Array of properties.
Examples:{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "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/properties/email-property" }
- Properties
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
Creation time of the property.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the property data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the property value evaluation.
Examples:2021-05-12T23:20:50.520Z
Property URL.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
Status Code
Successfully listed all the properties.
Unauthorized
{ "properties": [ { "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "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/properties/email-property" } ], "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/properties?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0" } }
{ "properties": [ { "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "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/properties/email-property" } ], "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/properties?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/environments/dev/properties?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Create Property
Create a Property
Create a Property.
POST /environments/{environment_id}/properties
(appConfiguration *AppConfigurationV1) CreateProperty(createPropertyOptions *CreatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreatePropertyWithContext(ctx context.Context, createPropertyOptions *CreatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
Request
Instantiate the CreatePropertyOptions
struct and set the fields to provide parameter values for the CreateProperty
method.
Path Parameters
Environment Id
Example:
environment_id
The request body to create a new property.
BOOLEAN
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
NUMERIC
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "NUMERIC",
"value": 1,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": 10,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 0,
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
SECRETREF
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "SECRETREF",
"value": {
"secret_type": "kv",
"id": "1312414-12341243ff-324dsg-43ffg",
"sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::"
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - TEXT
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "STRING",
"format": "TEXT",
"value": "success",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "failed",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "success",
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - JSON
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "STRING",
"format": "JSON",
"value": {
"name": "email configuration",
"id": "email-config-1",
"description": "This email configuration for internal use",
"value": {
"Name": "ABC Inc",
"Location": "India"
},
"tags": "internal",
"employees_id": [
"empId1",
"empId2",
"empId3",
"empId4",
"empId5"
]
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"employees_id": [
"empId100"
]
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"employees_id": [
"empId11",
"empId22",
"empId33",
"empId44",
"empId55"
]
},
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - YAML
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "STRING",
"format": "YAML",
"value": "---\nname: email configuration\nid: email-config-1\ndescription: This email configuration for internal use\nvalue:\n Name: ABC Inc\n Location: India\ntags: internal\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "---\nemployees_id:\n- empId100",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "---\nemployees_id:\n- empId11\n- empId22\n- empId33\n- empId44\n- empId55",
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Allowable values: [
TEXT
,JSON
,YAML
]Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
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 CreateProperty options.
Environment Id.
Examples:environment_id
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Email property
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:email-property
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Examples:BOOLEAN
Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Examples:true
Property description.
Possible values: length ≤ 255
Examples:Property for email
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Allowable values: [
TEXT
,JSON
,YAML
]Tags associated with the property.
Examples:version: 1.1, pre-release
Specify the targeting rules that is used to set different property values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:[ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ]
- Collections
Collection id.
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ] }' "{base_url}/environments/{environment_id}/properties"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } segmentRuleModel := &appconfigurationv1.SegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), } collectionRefModel := &appconfigurationv1.CollectionRef{ CollectionID: core.StringPtr("ghzinc"), } createPropertyOptions := appConfigurationService.NewCreatePropertyOptions( "environment_id", "Email property", "email-property", "BOOLEAN", "true", ) createPropertyOptions.SetDescription("Property for email") createPropertyOptions.SetTags("version: 1.1, pre-release") createPropertyOptions.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleModel}) createPropertyOptions.SetCollections([]appconfigurationv1.CollectionRef{*collectionRefModel}) property, response, err := appConfigurationService.CreateProperty(createPropertyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(property, "", " ") fmt.Println(string(b))
Response
Details of the property.
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Specify the targeting rules that is used to set different property values for different segments.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Creation time of the property.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the property data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the property value evaluation.
Example:
2021-05-12T23:20:50.52Z
Property URL.
Details of the property.
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"segment_exists": true,
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
],
"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/properties/email-property"
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
Creation time of the property.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the property data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the property value evaluation.
Examples:2021-05-12T23:20:50.520Z
Property URL.
Status Code
Successfully created the property.
Bad request. Verify that the information in the request body is complete and correct.
Not Implemented.
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 1, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 1, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 10, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "failed", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "failed", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "name": "email configuration", "id": "email-config-1", "description": "This email configuration for internal use", "value": { "Name": "ABC Inc", "Location": "India" }, "tags": "internal", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId11", "empId22", "empId33", "empId44", "empId55" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "name": "email configuration", "id": "email-config-1", "description": "This email configuration for internal use", "value": { "Name": "ABC Inc", "Location": "India" }, "tags": "internal", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId11", "empId22", "empId33", "empId44", "empId55" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "---\nname: email configuration\nid: email-config-1\ndescription: This email configuration for internal use\nvalue:\n Name: ABC Inc\n Location: India\ntags: internal\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId11\n- empId22\n- empId33\n- empId44\n- empId55", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "---\nname: email configuration\nid: email-config-1\ndescription: This email configuration for internal use\nvalue:\n Name: ABC Inc\n Location: India\ntags: internal\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId11\n- empId22\n- empId33\n- empId44\n- empId55", "order": 2 } ], "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/properties/email-property" }
{ "code": "FTEC1003E", "message": "Error while creating the property." }
{ "code": "FTEC1003E", "message": "Error while creating the property." }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
Update Property
Update a Property.
Update a Property.
PUT /environments/{environment_id}/properties/{property_id}
(appConfiguration *AppConfigurationV1) UpdateProperty(updatePropertyOptions *UpdatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdatePropertyWithContext(ctx context.Context, updatePropertyOptions *UpdatePropertyOptions) (result *Property, response *core.DetailedResponse, err error)
Request
Instantiate the UpdatePropertyOptions
struct and set the fields to provide parameter values for the UpdateProperty
method.
Path Parameters
Environment Id
Example:
environment_id
Property Id
Example:
property_id
The request body to update a property.
BOOLEAN
{
"name": "Email property",
"description": "Property for email",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
NUMERIC
{
"name": "Email property",
"description": "Property for email",
"value": 10,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": 100,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 0,
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
SECRETREF
{
"name": "Email property",
"description": "Property for email",
"value": {
"secret_type": "kv",
"id": "1312414-12341243fdsf-324dfsg-43fffg",
"sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::"
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - TEXT
{
"name": "Email property",
"description": "Property for email",
"value": "success",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "fail",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "success",
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - JSON
{
"name": "Email property",
"description": "Property for email",
"value": {
"activate": "yes",
"employees_id": [
"empId1",
"empId2",
"empId3",
"empId4",
"empId5"
]
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"activate": "no"
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"employees_id": [
"empId100"
]
},
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
STRING - YAML
{
"name": "Email property",
"description": "Property for email",
"value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "---\nactivate: 'no'",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "---\nemployees_id:\n- empId100",
"order": 2
}
],
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
]
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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.
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 UpdateProperty options.
Environment Id.
Examples:environment_id
Property Id.
Examples:property_id
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Email property
Property description.
Possible values: length ≤ 255
Examples:Property for email
Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Examples:true
Tags associated with the property.
Examples:version: 1.1, pre-release
Specify the targeting rules that is used to set different property values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:[ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ]
- Collections
Collection id.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Email property", "description": "Property for email", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ] }' "{base_url}/environments/{environment_id}/properties/{property_id}"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } segmentRuleModel := &appconfigurationv1.SegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), } collectionRefModel := &appconfigurationv1.CollectionRef{ CollectionID: core.StringPtr("ghzinc"), } updatePropertyOptions := appConfigurationService.NewUpdatePropertyOptions( "environment_id", "property_id", ) updatePropertyOptions.SetName("Email property") updatePropertyOptions.SetDescription("Property for email") updatePropertyOptions.SetValue("true") updatePropertyOptions.SetTags("version: 1.1, pre-release") updatePropertyOptions.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleModel}) updatePropertyOptions.SetCollections([]appconfigurationv1.CollectionRef{*collectionRefModel}) property, response, err := appConfigurationService.UpdateProperty(updatePropertyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(property, "", " ") fmt.Println(string(b))
Response
Details of the property.
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Specify the targeting rules that is used to set different property values for different segments.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Creation time of the property.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the property data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the property value evaluation.
Example:
2021-05-12T23:20:50.52Z
Property URL.
Details of the property.
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"segment_exists": true,
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
],
"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/properties/email-property"
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
Creation time of the property.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the property data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the property value evaluation.
Examples:2021-05-12T23:20:50.520Z
Property URL.
Status Code
Successfully updated the property details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the property id is correct.
Not Implemented.
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 10, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 100, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 10, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 100, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "fail", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "fail", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "activate": "yes", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "activate": "no" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "activate": "yes", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "activate": "no" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nactivate: 'no'", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nactivate: 'no'", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 2 } ], "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/properties/email-property" }
{ "code": "FTEC1007E", "message": "Error while updating the property." }
{ "code": "FTEC1007E", "message": "Error while updating the property." }
{ "code": "FTEC1000E", "message": "Error while updating the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
Update Property values
Update the property values. This method can be executed by the writer
role. Property value and targeting rules can be updated, however this method does not allow assigning property to a collection.
Update the property values. This method can be executed by the writer
role. Property value and targeting rules can be updated, however this method does not allow assigning property to a collection.
PATCH /environments/{environment_id}/properties/{property_id}
(appConfiguration *AppConfigurationV1) UpdatePropertyValues(updatePropertyValuesOptions *UpdatePropertyValuesOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdatePropertyValuesWithContext(ctx context.Context, updatePropertyValuesOptions *UpdatePropertyValuesOptions) (result *Property, response *core.DetailedResponse, err error)
Request
Instantiate the UpdatePropertyValuesOptions
struct and set the fields to provide parameter values for the UpdatePropertyValues
method.
Path Parameters
Environment Id
Example:
environment_id
Property Id
Example:
property_id
The request body update the property values.
BOOLEAN
{
"name": "Email property",
"description": "Property for email",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
]
}
NUMERIC
{
"name": "Email property",
"description": "Property for email",
"value": 10,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": 100,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": 0,
"order": 2
}
]
}
SECRETREF
{
"name": "Email property",
"description": "Property for email",
"value": {
"secret_type": "kv",
"id": "1312414-12341243fdsf-324dfsg-43fffg",
"sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::"
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"id": "2234566-334g566ghjj-222-4000123fg"
},
"order": 2
}
]
}
STRING - TEXT
{
"name": "Email property",
"description": "Property for email",
"value": "success",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "fail",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "success",
"order": 2
}
]
}
STRING - JSON
{
"name": "Email property",
"description": "Property for email",
"value": {
"activate": "yes",
"employees_id": [
"empId1",
"empId2",
"empId3",
"empId4",
"empId5"
]
},
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": {
"activate": "no"
},
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": {
"employees_id": [
"empId100"
]
},
"order": 2
}
]
}
STRING - YAML
{
"name": "Email property",
"description": "Property for email",
"value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5",
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": "---\nactivate: 'no'",
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": "---\nemployees_id:\n- empId100",
"order": 2
}
]
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.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 UpdatePropertyValues options.
Environment Id.
Examples:environment_id
Property Id.
Examples:property_id
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Email property
Property description.
Possible values: length ≤ 255
Examples:Property for email
Tags associated with the property.
Examples:version: 1.1, pre-release
Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Examples:true
Specify the targeting rules that is used to set different property values for different segments.
Examples:[ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ]
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
curl -X PATCH --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Email property", "description": "Property for email", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ] }' "{base_url}/environments/{environment_id}/properties/{property_id}"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"betausers", "premiumusers"}, } segmentRuleModel := &appconfigurationv1.SegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("true"), Order: core.Int64Ptr(int64(1)), } updatePropertyValuesOptions := appConfigurationService.NewUpdatePropertyValuesOptions( "environment_id", "property_id", ) updatePropertyValuesOptions.SetName("Email property") updatePropertyValuesOptions.SetDescription("Property for email") updatePropertyValuesOptions.SetTags("version: 1.1, pre-release") updatePropertyValuesOptions.SetValue("true") updatePropertyValuesOptions.SetSegmentRules([]appconfigurationv1.SegmentRule{*segmentRuleModel}) property, response, err := appConfigurationService.UpdatePropertyValues(updatePropertyValuesOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(property, "", " ") fmt.Println(string(b))
Response
Details of the property.
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Specify the targeting rules that is used to set different property values for different segments.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Creation time of the property.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the property data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the property value evaluation.
Example:
2021-05-12T23:20:50.52Z
Property URL.
Details of the property.
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"segment_exists": true,
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
],
"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/properties/email-property"
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
Creation time of the property.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the property data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the property value evaluation.
Examples:2021-05-12T23:20:50.520Z
Property URL.
Status Code
Successfully updated the property values.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the property id is correct.
Not Implemented.
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 10, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 100, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "NUMERIC", "value": 10, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": 100, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": 0, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "SECRETREF", "value": { "secret_type": "kv", "id": "1312414-12341243fdsf-324dfsg-43fffg", "sm_instance_crn": "crn:v1:staging:public:apprapp_dev:us-south:a/7bf663503fc5e2e06b03d2ada843bf54:ssfffgr-f6ee-48a5-a11b-ade4aecfe378::" }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "id": "2234566-334g566ghjj-222-4000123fg" }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "fail", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "TEXT", "value": "success", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "fail", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "success", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "activate": "yes", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "activate": "no" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "JSON", "value": { "activate": "yes", "employees_id": [ "empId1", "empId2", "empId3", "empId4", "empId5" ] }, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": { "activate": "no" }, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": { "employees_id": [ "empId100" ] }, "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nactivate: 'no'", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 2 } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "STRING", "format": "YAML", "value": "activate: 'yes'\nemployees_id:\n- empId1\n- empId2\n- empId3\n- empId4\n- empId5", "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": "---\nactivate: 'no'", "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": "---\nemployees_id:\n- empId100", "order": 2 } ], "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/properties/email-property" }
{ "code": "FTEC1007E", "message": "Error while updating the property values." }
{ "code": "FTEC1007E", "message": "Error while updating the property values." }
{ "code": "FTEC1000E", "message": "Error while updating the property values. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the property values. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
Get Property
Retrieve details of a property.
Retrieve details of a property.
GET /environments/{environment_id}/properties/{property_id}
(appConfiguration *AppConfigurationV1) GetProperty(getPropertyOptions *GetPropertyOptions) (result *Property, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetPropertyWithContext(ctx context.Context, getPropertyOptions *GetPropertyOptions) (result *Property, response *core.DetailedResponse, err error)
Request
Instantiate the GetPropertyOptions
struct and set the fields to provide parameter values for the GetProperty
method.
Path Parameters
Environment Id
Example:
environment_id
Property Id
Example:
property_id
Query Parameters
Include the associated collections or targeting rules details in the response.
Allowable values: [
collections
,rules
]Examples:[ "collections", "rules" ]
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 GetProperty options.
Environment Id.
Examples:environment_id
Property Id.
Examples:property_id
Include the associated collections or targeting rules details in the response.
Allowable values: [
collections
,rules
]Examples:[ "collections", "rules" ]
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}/properties/{property_id}?include=collections,rules"
getPropertyOptions := appConfigurationService.NewGetPropertyOptions( "environment_id", "property_id", ) getPropertyOptions.SetInclude([]string{"collections", "rules"}) property, response, err := appConfigurationService.GetProperty(getPropertyOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(property, "", " ") fmt.Println(string(b))
Response
Details of the property.
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Property description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Tags associated with the property, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Specify the targeting rules that is used to set different property values for different segments.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Creation time of the property.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the property data.
Example:
2021-05-12T23:20:50.52Z
The last occurrence of the property value evaluation.
Example:
2021-05-12T23:20:50.52Z
Property URL.
Details of the property.
{
"name": "Email property",
"property_id": "email-property",
"description": "Property for email",
"type": "BOOLEAN",
"value": true,
"tags": "version: 1.1, pre-release",
"segment_rules": [
{
"rules": [
{
"segments": [
"betausers",
"premiumusers"
]
}
],
"value": true,
"order": 1
},
{
"rules": [
{
"segments": [
"freeusers"
]
}
],
"value": false,
"order": 2
}
],
"segment_exists": true,
"collections": [
{
"collection_id": "ghzinc"
},
{
"collection_id": "phzsystems"
},
{
"collection_id": "ghzglobal"
}
],
"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/properties/email-property"
}
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
Denotes if the targeting rules are specified for the property.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
Creation time of the property.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the property data.
Examples:2021-05-12T23:20:50.520Z
The last occurrence of the property value evaluation.
Examples:2021-05-12T23:20:50.520Z
Property URL.
Status Code
Successfully retrieved the property details.
Not Found. Verify that the property id is correct.
Not Implemented.
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "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/properties/email-property" }
{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "segment_exists": true, "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "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/properties/email-property" }
{ "code": "FTEC1000E", "message": "Error while retrieving the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retrieving the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
Delete Property
Delete a Property
Delete a Property.
DELETE /environments/{environment_id}/properties/{property_id}
(appConfiguration *AppConfigurationV1) DeleteProperty(deletePropertyOptions *DeletePropertyOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeletePropertyWithContext(ctx context.Context, deletePropertyOptions *DeletePropertyOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeletePropertyOptions
struct and set the fields to provide parameter values for the DeleteProperty
method.
Path Parameters
Environment Id
Example:
environment_id
Property Id
Example:
property_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 DeleteProperty options.
Environment Id.
Examples:environment_id
Property Id.
Examples:property_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/environments/{environment_id}/properties/{property_id}"
deletePropertyOptions := appConfigurationService.NewDeletePropertyOptions( "environment_id", "property_id", ) response, err := appConfigurationService.DeleteProperty(deletePropertyOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteProperty(): %d\n", response.StatusCode) }
Response
Status Code
Successfully deleted the specified property
Not Found. Verify that the property id is correct.
Not Implemented.
{ "code": "FTEC1000E", "message": "Error while deleting the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the property. The queried resource 'Property' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'secret manager integration' feature is not available" }
Get list of Segments
List all the segments
List all the segments.
GET /segments
(appConfiguration *AppConfigurationV1) ListSegments(listSegmentsOptions *ListSegmentsOptions) (result *SegmentsList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListSegmentsWithContext(ctx context.Context, listSegmentsOptions *ListSegmentsOptions) (result *SegmentsList, response *core.DetailedResponse, err error)
Request
Instantiate the ListSegmentsOptions
struct and set the fields to provide parameter values for the ListSegments
method.
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
Sort the segment details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
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
Segment details to include the associated rules in the response.
Allowable values: [
rules
]Example:
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
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 ListSegments options.
If set to
true
, returns expanded view of the resource details.Examples:true
Sort the segment details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
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:version 1.1,pre-release
Segment details to include the associated rules in the response.
Allowable values: [
rules
]Examples: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
Default:
10
Examples: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.
Examples:test tag
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/segments?expand=true&sort=created_time&tags=version 1.1,pre-release&include=rules&search=test tag"
listSegmentsOptions := &appconfigurationv1.ListSegmentsOptions{ Expand: core.BoolPtr(true), Sort: core.StringPtr("created_time"), Tags: core.StringPtr("version 1.1,pre-release"), Include: core.StringPtr("rules"), Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("test tag"), } pager, err := appConfigurationService.NewSegmentsPager(listSegmentsOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.Segment for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all segments.
Array of Segments.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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 segments.
{
"segments": [
{
"name": "Beta Users",
"segment_id": "beta-users",
"description": "Segment containing the beta users",
"tags": "preprod, users, ghz",
"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/segments/beta-users",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
]
}
],
"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/segments?limit=10&offset=0"
},
"last": {
"href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/segments?limit=10&offset=0"
}
}
Array of Segments.
Examples:{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
- Segments
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Creation time of the segment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the segment data.
Examples:2021-05-12T23:20:50.520Z
Segment URL.
List of Features associated with the segment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the segment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
Status Code
Successfully listed all the segments.
Unauthorized
{ "segments": [ { "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "preprod, users, ghz", "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/segments/beta-users", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] } ], "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/segments?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/segments?limit=10&offset=0" } }
{ "segments": [ { "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "preprod, users, ghz", "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/segments/beta-users", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] } ], "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/segments?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/segments?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Create Segment
Create a segment.
Create a segment.
POST /segments
(appConfiguration *AppConfigurationV1) CreateSegment(createSegmentOptions *CreateSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateSegmentWithContext(ctx context.Context, createSegmentOptions *CreateSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
Request
Instantiate the CreateSegmentOptions
struct and set the fields to provide parameter values for the CreateSegment
method.
The request body to create a new segment.
{
"name": "Beta Users",
"segment_id": "beta-users",
"description": "Segment containing the beta users",
"tags": "version: 1.1, stage",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
]
}
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Segment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the segments, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
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 CreateSegment options.
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:Beta Users
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Examples:beta-users
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:[ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ]
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Allowable values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Segment description.
Possible values: length ≤ 255
Examples:Segment containing the beta users
Tags associated with the segments.
Examples:version: 1.1, stage
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] }' "{base_url}/segments"
ruleModel := &appconfigurationv1.Rule{ AttributeName: core.StringPtr("email"), Operator: core.StringPtr("endsWith"), Values: []string{"@in.mnc.com", "@us.mnc.com"}, } createSegmentOptions := appConfigurationService.NewCreateSegmentOptions( "Beta Users", "beta-users", []appconfigurationv1.Rule{*ruleModel}, ) createSegmentOptions.SetDescription("Segment containing the beta users") createSegmentOptions.SetTags("version: 1.1, stage") segment, response, err := appConfigurationService.CreateSegment(createSegmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(segment, "", " ") fmt.Println(string(b))
Response
Details of the segment.
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Segment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the segments, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Creation time of the segment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the segment data.
Example:
2021-05-12T23:20:50.52Z
Segment URL.
List of Features associated with the segment.
List of properties associated with the segment.
Details of the segment.
{
"name": "Beta Users",
"segment_id": "beta-users",
"description": "Segment containing the beta users",
"tags": "version: 1.1, stage",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
],
"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/segments/beta-users"
}
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Creation time of the segment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the segment data.
Examples:2021-05-12T23:20:50.520Z
Segment URL.
List of Features associated with the segment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the segment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
Status Code
Successfully created the segment
Bad request. Verify that the information in the request body is complete and correct.
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "code": "FTEC1003E", "message": "Error while creating the segment." }
{ "code": "FTEC1003E", "message": "Error while creating the segment." }
Update Segment
Update the segment properties
Update the segment properties.
PUT /segments/{segment_id}
(appConfiguration *AppConfigurationV1) UpdateSegment(updateSegmentOptions *UpdateSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateSegmentWithContext(ctx context.Context, updateSegmentOptions *UpdateSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateSegmentOptions
struct and set the fields to provide parameter values for the UpdateSegment
method.
Path Parameters
Segment Id
Example:
segment_id
The request body to update a segment.
{
"name": "Beta Users",
"description": "Segment containing the beta users",
"tags": "version: 1.1, pre-release",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
]
}
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Segment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the segments, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to 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 UpdateSegment options.
Segment Id.
Examples:segment_id
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Allowable values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"name":"Beta Users","description":"Segment containing the beta users","tags":"version: 1.1, pre-release","rules":[{"attribute_name":"email","operator":"endsWith","values":["@in.mnc.com","@us.mnc.com"]},{"attribute_name":"country","operator":"is","values":["India","USA"]}]}' "{base_url}/segments/{segment_id}"
updateSegmentOptions := appConfigurationService.NewUpdateSegmentOptions( "segment_id", ) segment, response, err := appConfigurationService.UpdateSegment(updateSegmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(segment, "", " ") fmt.Println(string(b))
Response
Details of the segment.
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Segment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the segments, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Creation time of the segment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the segment data.
Example:
2021-05-12T23:20:50.52Z
Segment URL.
List of Features associated with the segment.
List of properties associated with the segment.
Details of the segment.
{
"name": "Beta Users",
"segment_id": "beta-users",
"description": "Segment containing the beta users",
"tags": "version: 1.1, stage",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
],
"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/segments/beta-users"
}
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Creation time of the segment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the segment data.
Examples:2021-05-12T23:20:50.520Z
Segment URL.
List of Features associated with the segment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the segment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
Status Code
Successfully updated the segment details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the segment id is correct.
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "code": "FTEC1007E", "message": "Error while updating the segment." }
{ "code": "FTEC1007E", "message": "Error while updating the segment." }
{ "code": "FTEC1000E", "message": "Error while updating the segment. The queried resource 'Segment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the segment. The queried resource 'Segment' is not available on the server." }
Get Segment
Retrieve details of a segment
Retrieve details of a segment.
GET /segments/{segment_id}
(appConfiguration *AppConfigurationV1) GetSegment(getSegmentOptions *GetSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetSegmentWithContext(ctx context.Context, getSegmentOptions *GetSegmentOptions) (result *Segment, response *core.DetailedResponse, err error)
Request
Instantiate the GetSegmentOptions
struct and set the fields to provide parameter values for the GetSegment
method.
Path Parameters
Segment Id
Example:
segment_id
Query Parameters
Include feature and property details in the response.
Allowable values: [
features
,properties
]Examples:[ "features", "properties" ]
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 GetSegment options.
Segment Id.
Examples:segment_id
Include feature and property details in the response.
Allowable values: [
features
,properties
]Examples:[ "features", "properties" ]
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/segments/{segment_id}?include=features,properties"
getSegmentOptions := appConfigurationService.NewGetSegmentOptions( "segment_id", ) getSegmentOptions.SetInclude([]string{"features", "properties"}) segment, response, err := appConfigurationService.GetSegment(getSegmentOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(segment, "", " ") fmt.Println(string(b))
Response
Details of the segment.
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 256
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Segment description, allowed special characters are [.,-_ :()$&%#!]
Possible values: length ≤ 255, Value must match regular expression
^[a-zA-Z0-9_\. ,:\-()$&%#!]+$
Tags associated with the segments, allowed special characters are [_. ,-:]
Possible values: Value must match regular expression
^[a-zA-Z0-9_\. ,\-]+(:[a-zA-Z0-9_\. ,\-]+)*$
Creation time of the segment.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the segment data.
Example:
2021-05-12T23:20:50.52Z
Segment URL.
List of Features associated with the segment.
List of properties associated with the segment.
Details of the segment.
{
"name": "Beta Users",
"segment_id": "beta-users",
"description": "Segment containing the beta users",
"tags": "version: 1.1, stage",
"rules": [
{
"attribute_name": "email",
"operator": "endsWith",
"values": [
"@in.mnc.com",
"@us.mnc.com"
]
},
{
"attribute_name": "country",
"operator": "is",
"values": [
"India",
"USA"
]
}
],
"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/segments/beta-users"
}
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Creation time of the segment.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the segment data.
Examples:2021-05-12T23:20:50.520Z
Segment URL.
List of Features associated with the segment.
Examples:{ "feature_id": "cycle-rentals", "name": "Cycle Rentals" }
- Features
Feature id.
Feature name.
List of properties associated with the segment.
Examples:{ "property_id": "newyearday", "name": "NewYearDay" }
- Properties
Property id.
Property name.
Status Code
Successfully retrieved the segment details.
Not Found. Verify that the segment id is correct.
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ], "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/segments/beta-users" }
{ "code": "FTEC1000E", "message": "Error while retrieving the segment. The queried resource 'Segment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retrieving the segment. The queried resource 'Segment' is not available on the server." }
Delete Segment
Delete a segment
Delete a segment.
DELETE /segments/{segment_id}
(appConfiguration *AppConfigurationV1) DeleteSegment(deleteSegmentOptions *DeleteSegmentOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteSegmentWithContext(ctx context.Context, deleteSegmentOptions *DeleteSegmentOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteSegmentOptions
struct and set the fields to provide parameter values for the DeleteSegment
method.
Path Parameters
Segment Id
Example:
segment_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 DeleteSegment options.
Segment Id.
Examples:segment_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/segments/{segment_id}"
deleteSegmentOptions := appConfigurationService.NewDeleteSegmentOptions( "segment_id", ) response, err := appConfigurationService.DeleteSegment(deleteSegmentOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteSegment(): %d\n", response.StatusCode) }
Response
Status Code
Successfully deleted the specified segment.
Not Found. Verify that the segment id is correct.
{ "code": "FTEC1000E", "message": "Error while deleting the segment. The queried resource 'Segment' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the segment. The queried resource 'Segment' is not available on the server." }
Get list of Git configs
List all the Git configs
List all the Git configs.
GET /gitconfigs
(appConfiguration *AppConfigurationV1) ListSnapshots(listSnapshotsOptions *ListSnapshotsOptions) (result *GitConfigList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListSnapshotsWithContext(ctx context.Context, listSnapshotsOptions *ListSnapshotsOptions) (result *GitConfigList, response *core.DetailedResponse, err error)
Request
Instantiate the ListSnapshotsOptions
struct and set the fields to provide parameter values for the ListSnapshots
method.
Query Parameters
Sort the git configurations details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Example:
created_time
Filters the response based on the specified collection_id.
Example:
collection_id
Filters the response based on the specified environment_id.
Example:
environment_id
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]' of the entity
Example:
search_string
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 ListSnapshots options.
Sort the git configurations details based on the specified attribute. By default, items are sorted by name.
Allowable values: [
created_time
,updated_time
,id
,name
]Examples:created_time
Filters the response based on the specified collection_id.
Examples:collection_id
Filters the response based on the specified environment_id.
Examples:environment_id
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
Examples: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]' of the entity.
Examples:search_string
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/gitconfigs?sort=created_time&collection_id=collection_id&environment_id=environment_id&search=search_string"
listSnapshotsOptions := &appconfigurationv1.ListSnapshotsOptions{ Sort: core.StringPtr("created_time"), CollectionID: core.StringPtr("collection_id"), EnvironmentID: core.StringPtr("environment_id"), Limit: core.Int64Ptr(int64(10)), Search: core.StringPtr("search_string"), } pager, err := appConfigurationService.NewSnapshotsPager(listSnapshotsOptions) if err != nil { panic(err) } var allResults []appconfigurationv1.GitConfig for pager.HasNext() { nextPage, err := pager.GetNext() if err != nil { panic(err) } allResults = append(allResults, nextPage...) } b, _ := json.MarshalIndent(allResults, "", " ") fmt.Println(string(b))
Response
List of all Git Configs.
Array of Git Configs.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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 Git Configs.
{
"git_config": [
{
"git_config_name": "boot-strap-configuration",
"git_config_id": "boot-strap-configuration",
"collection": {
"name": "Web Application",
"collection_id": "web-app-collection"
},
"environment": {
"name": "Dev",
"environment_id": "dev",
"color_code": "#FDD13A"
},
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "main",
"git_file_path": "code/development/README.json",
"last_sync_time": "2022-05-27T23:20:50.52Z",
"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/gitconfigs/boot-strap-configuration"
}
],
"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/gitconfigs?limit=10&offset=0"
},
"last": {
"href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/gitconfigs?limit=10&offset=0"
}
}
Array of Git Configs.
Examples:{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" }
- GitConfig
Git config name.
Git config id.
Details of the collection.
Examples:{ "name": "Web Application", "collection_id": "web-app-collection" }
- Collection
Collection name.
Collection Id.
Details of the environment.
Examples:{ "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }
- Environment
Environment name.
Environment Id.
Environment color code.
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Latest time when the snapshot was synced to git.
Examples:2022-05-27T23:20:50.520Z
Creation time of the git config.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the git config data.
Examples:2021-05-12T23:20:50.520Z
Git config URL.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
URL to navigate to the first page of records.
- First
URL to the page.
URL to navigate to the previous list of records.
- Previous
URL to the page.
URL to navigate to the next list of records.
- Next
URL to the page.
URL to navigate to the last page of records.
- Last
URL to the page.
Status Code
Successfully listed all the git configurations.
Unauthorized
Not Implemented.
{ "git_config": [ { "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" } ], "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/gitconfigs?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/gitconfigs?limit=10&offset=0" } }
{ "git_config": [ { "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" } ], "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/gitconfigs?limit=10&offset=0" }, "last": { "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/gitconfigs?limit=10&offset=0" } }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Create Git config
Create a Git config.
Create a Git config.
POST /gitconfigs
(appConfiguration *AppConfigurationV1) CreateGitconfig(createGitconfigOptions *CreateGitconfigOptions) (result *CreateGitConfigResponse, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateGitconfigWithContext(ctx context.Context, createGitconfigOptions *CreateGitconfigOptions) (result *CreateGitConfigResponse, response *core.DetailedResponse, err error)
Request
Instantiate the CreateGitconfigOptions
struct and set the fields to provide parameter values for the CreateGitconfig
method.
The request body to create a new Git config.
{
"git_config_name": "boot-strap-configuration",
"git_config_id": "boot-strap-configuration",
"collection_id": "web-app-collection",
"environment_id": "dev",
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "main",
"git_file_path": "code/development/README.json",
"git_token": "61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH"
}
Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 100
Git config id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 30
Collection Id.
Environment Id.
Git url which will be used to connect to the github account. The url must be formed in this format, https://api.github.com/repos/{owner}/{repo_name} for the personal git account. If you are using the organization account then url must be in this format https://github.{organization_name}.com/api/v3/repos/{owner}/{repo_name} . Note do not provide /(slash) in the beginning or at the end of the url.
Branch name to which you need to write or update the configuration. Just provide the branch name, do not provide any /(slashes) in the beginning or at the end of the branch name. Note make sure branch exists in your repository.
Git file path, this is a path where your configuration file will be written. The path must contain the file name with
json
extension. We only create or updatejson
extension file. Note do not provide any /(slashes) in the beginning or at the end of the file path.Git token, this needs to be provided with enough permission to write and update the file
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 CreateGitconfig options.
Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 100
Examples:boot-strap-configuration
Git config id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 30
Examples:boot-strap-configuration
Collection Id.
Examples:web-app-collection
Environment Id.
Examples:dev
Git url which will be used to connect to the github account. The url must be formed in this format, https://api.github.com/repos/{owner}/{repo_name} for the personal git account. If you are using the organization account then url must be in this format https://github.{organization_name}.com/api/v3/repos/{owner}/{repo_name} . Note do not provide /(slash) in the beginning or at the end of the url.
Examples:https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo
Branch name to which you need to write or update the configuration. Just provide the branch name, do not provide any /(slashes) in the beginning or at the end of the branch name. Note make sure branch exists in your repository.
Examples:main
Git file path, this is a path where your configuration file will be written. The path must contain the file name with
json
extension. We only create or updatejson
extension file. Note do not provide any /(slashes) in the beginning or at the end of the file path.Examples:code/development/README.json
Git token, this needs to be provided with enough permission to write and update the file.
Examples:61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection_id": "web-app-collection", "environment_id": "dev", "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "git_token": "61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH" }' "{base_url}/gitconfigs"
createGitconfigOptions := appConfigurationService.NewCreateGitconfigOptions( "boot-strap-configuration", "boot-strap-configuration", "web-app-collection", "dev", "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "main", "code/development/README.json", "61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH", ) createGitConfigResponse, response, err := appConfigurationService.CreateGitconfig(createGitconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(createGitConfigResponse, "", " ") fmt.Println(string(b))
Response
Details of the created Git config.
Git config name.
Git config Id.
Collection Id.
Environment Id.
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Creation time of the git config.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the git config data.
Example:
2021-05-12T23:20:50.52Z
Git config URL.
Details of the created Git config.
{
"git_config_name": "boot-strap-configuration",
"git_config_id": "boot-strap-configuration",
"collection_id": "web-app-collection",
"environment_id": "dev",
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "main",
"git_file_path": "code/development/README.json",
"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/gitconfigs/boot-strap-configuration"
}
Git config name.
Git config Id.
Collection Id.
Environment Id.
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Creation time of the git config.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the git config data.
Examples:2021-05-12T23:20:50.520Z
Git config URL.
Status Code
Successfully created the gitconfig
Bad request. Verify that the information in the request body is complete and correct.
Not Implemented.
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection_id": "web-app-collection", "environment_id": "dev", "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "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/gitconfigs/boot-strap-configuration" }
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection_id": "web-app-collection", "environment_id": "dev", "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "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/gitconfigs/boot-strap-configuration" }
{ "code": "FTEC1003E", "message": "Error while creating the gitconfig." }
{ "code": "FTEC1003E", "message": "Error while creating the gitconfig." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Update Git Config
Update the gitconfig properties
Update the gitconfig properties.
PUT /gitconfigs/{git_config_id}
(appConfiguration *AppConfigurationV1) UpdateGitconfig(updateGitconfigOptions *UpdateGitconfigOptions) (result *GitConfig, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateGitconfigWithContext(ctx context.Context, updateGitconfigOptions *UpdateGitconfigOptions) (result *GitConfig, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateGitconfigOptions
struct and set the fields to provide parameter values for the UpdateGitconfig
method.
Path Parameters
Git Config Id
Example:
git_config_id
The request body to update a Git config.
{
"git_config_name": "updated git config name",
"collection_id": "web-app-collection",
"environment_id": "dev",
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "newbranch",
"git_file_path": "code/development/README.json",
"git_token": "61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH"
}
Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Possible values: length ≤ 100
Collection Id.
Environment Id.
Git url which will be used to connect to the github account. The url must be formed in this format, https://api.github.com/repos/{owner}/{repo_name} for the personal git account. If you are using the organization account then url must be in this format https://github.{organization_name}.com/api/v3/repos/{owner}/{repo_name} . Note do not provide /(slash) in the beginning or at the end of the url.
Branch name to which you need to write or update the configuration. Just provide the branch name, do not provide any /(slashes) in the beginning or at the end of the branch name. Note make sure branch exists in your repository.
Git file path, this is a path where your configuration file will be written. The path must contain the file name with
json
extension. We only create or updatejson
extension file. Note do not provide any /(slashes) in the beginning or at the end of the file path.Git token, this needs to be provided with enough permission to write and update the file
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 UpdateGitconfig options.
Git Config Id.
Examples:git_config_id
Git config name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 100
Collection Id.
Environment Id.
Git url which will be used to connect to the github account. The url must be formed in this format, https://api.github.com/repos/{owner}/{repo_name} for the personal git account. If you are using the organization account then url must be in this format https://github.{organization_name}.com/api/v3/repos/{owner}/{repo_name} . Note do not provide /(slash) in the beginning or at the end of the url.
Branch name to which you need to write or update the configuration. Just provide the branch name, do not provide any /(slashes) in the beginning or at the end of the branch name. Note make sure branch exists in your repository.
Git file path, this is a path where your configuration file will be written. The path must contain the file name with
json
extension. We only create or updatejson
extension file. Note do not provide any /(slashes) in the beginning or at the end of the file path.Git token, this needs to be provided with enough permission to write and update the file.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"git_config_name":"updated git config name","collection_id":"web-app-collection","environment_id":"dev","git_url":"https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo","git_branch":"newbranch","git_file_path":"code/development/README.json","git_token":"61a792eahhGHji223jijb55a6cfdd4d5cde4c8a67esjjhjhHVH"}' "{base_url}/gitconfigs/{git_config_id}"
updateGitconfigOptions := appConfigurationService.NewUpdateGitconfigOptions( "git_config_id", ) gitConfig, response, err := appConfigurationService.UpdateGitconfig(updateGitconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(gitConfig, "", " ") fmt.Println(string(b))
Response
Details of the Git Config.
Git config name.
Git config id.
Details of the collection.
Examples:{ "name": "Web Application", "collection_id": "web-app-collection" }
Details of the environment.
Examples:{ "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Latest time when the snapshot was synced to git.
Example:
2022-05-27T23:20:50.52Z
Creation time of the git config.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the git config data.
Example:
2021-05-12T23:20:50.52Z
Git config URL.
Details of the Git Config.
{
"git_config_name": "boot-strap-configuration",
"git_config_id": "boot-strap-configuration",
"collection": {
"name": "Web Application",
"collection_id": "web-app-collection"
},
"environment": {
"name": "Dev",
"environment_id": "dev",
"color_code": "#FDD13A"
},
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "main",
"git_file_path": "code/development/README.json",
"last_sync_time": "2022-05-27T23:20:50.52Z",
"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/gitconfigs/boot-strap-configuration"
}
Git config name.
Git config id.
Details of the collection.
Examples:{ "name": "Web Application", "collection_id": "web-app-collection" }
- Collection
Collection name.
Collection Id.
Details of the environment.
Examples:{ "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }
- Environment
Environment name.
Environment Id.
Environment color code.
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Latest time when the snapshot was synced to git.
Examples:2022-05-27T23:20:50.520Z
Creation time of the git config.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the git config data.
Examples:2021-05-12T23:20:50.520Z
Git config URL.
Status Code
Successfully updated the gitconfig details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the git config id is correct.
Not Implemented.
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" }
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" }
{ "code": "FTEC1007E", "message": "Error while updating the gitconfig." }
{ "code": "FTEC1007E", "message": "Error while updating the gitconfig." }
{ "code": "FTEC1000E", "message": "Error while updating the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Get Git Config
Retrieve details of a gitconfig
Retrieve details of a gitconfig.
GET /gitconfigs/{git_config_id}
(appConfiguration *AppConfigurationV1) GetGitconfig(getGitconfigOptions *GetGitconfigOptions) (result *GitConfig, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) GetGitconfigWithContext(ctx context.Context, getGitconfigOptions *GetGitconfigOptions) (result *GitConfig, response *core.DetailedResponse, err error)
Request
Instantiate the GetGitconfigOptions
struct and set the fields to provide parameter values for the GetGitconfig
method.
Path Parameters
Git Config Id
Example:
git_config_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 GetGitconfig options.
Git Config Id.
Examples:git_config_id
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/gitconfigs/{git_config_id}"
getGitconfigOptions := appConfigurationService.NewGetGitconfigOptions( "git_config_id", ) gitConfig, response, err := appConfigurationService.GetGitconfig(getGitconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(gitConfig, "", " ") fmt.Println(string(b))
Response
Details of the Git Config.
Git config name.
Git config id.
Details of the collection.
Examples:{ "name": "Web Application", "collection_id": "web-app-collection" }
Details of the environment.
Examples:{ "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Latest time when the snapshot was synced to git.
Example:
2022-05-27T23:20:50.52Z
Creation time of the git config.
Example:
2021-05-12T23:20:50.52Z
Last modified time of the git config data.
Example:
2021-05-12T23:20:50.52Z
Git config URL.
Details of the Git Config.
{
"git_config_name": "boot-strap-configuration",
"git_config_id": "boot-strap-configuration",
"collection": {
"name": "Web Application",
"collection_id": "web-app-collection"
},
"environment": {
"name": "Dev",
"environment_id": "dev",
"color_code": "#FDD13A"
},
"git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo",
"git_branch": "main",
"git_file_path": "code/development/README.json",
"last_sync_time": "2022-05-27T23:20:50.52Z",
"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/gitconfigs/boot-strap-configuration"
}
Git config name.
Git config id.
Details of the collection.
Examples:{ "name": "Web Application", "collection_id": "web-app-collection" }
- Collection
Collection name.
Collection Id.
Details of the environment.
Examples:{ "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }
- Environment
Environment name.
Environment Id.
Environment color code.
Git url which will be used to connect to the github account.
Branch name to which you need to write or update the configuration.
Git file path, this is a path where your configuration file will be written.
Latest time when the snapshot was synced to git.
Examples:2022-05-27T23:20:50.520Z
Creation time of the git config.
Examples:2021-05-12T23:20:50.520Z
Last modified time of the git config data.
Examples:2021-05-12T23:20:50.520Z
Git config URL.
Status Code
Successfully retrieved the gitconfig details.
Not Found. Verify that the gitconfig id is correct.
Not Implemented.
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" }
{ "git_config_name": "boot-strap-configuration", "git_config_id": "boot-strap-configuration", "collection": { "name": "Web Application", "collection_id": "web-app-collection" }, "environment": { "name": "Dev", "environment_id": "dev", "color_code": "#FDD13A" }, "git_url": "https://github.ibm.com/api/v3/repos/jhondoe-owner/my-test-repo", "git_branch": "main", "git_file_path": "code/development/README.json", "last_sync_time": "2022-05-27T23:20:50.52Z", "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/gitconfigs/boot-strap-configuration" }
{ "code": "FTEC1000E", "message": "Error while retrieving the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while retrieving the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Delete Git Config
Delete a gitconfig
Delete a gitconfig.
DELETE /gitconfigs/{git_config_id}
(appConfiguration *AppConfigurationV1) DeleteGitconfig(deleteGitconfigOptions *DeleteGitconfigOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteGitconfigWithContext(ctx context.Context, deleteGitconfigOptions *DeleteGitconfigOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteGitconfigOptions
struct and set the fields to provide parameter values for the DeleteGitconfig
method.
Path Parameters
Git Config Id
Example:
git_config_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 DeleteGitconfig options.
Git Config Id.
Examples:git_config_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/gitconfigs/{git_config_id}"
deleteGitconfigOptions := appConfigurationService.NewDeleteGitconfigOptions( "git_config_id", ) response, err := appConfigurationService.DeleteGitconfig(deleteGitconfigOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteGitconfig(): %d\n", response.StatusCode) }
Response
Status Code
Successfully deleted the specified gitconfig.
Not Found. Verify that the gitconfig id is correct.
Not Implemented.
{ "code": "FTEC1000E", "message": "Error while deleting the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the gitconfig. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Promote configuration
Promote configuration, this api will write or update your chosen configuration to the GitHub based on the git url, file path and branch data. In simple words this api will create or updates the bootstrap json file
Promote configuration, this api will write or update your chosen configuration to the GitHub based on the git url, file path and branch data. In simple words this api will create or updates the bootstrap json file.
PUT /gitconfigs/{git_config_id}/promote
(appConfiguration *AppConfigurationV1) PromoteGitconfig(promoteGitconfigOptions *PromoteGitconfigOptions) (result *GitConfigPromote, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) PromoteGitconfigWithContext(ctx context.Context, promoteGitconfigOptions *PromoteGitconfigOptions) (result *GitConfigPromote, response *core.DetailedResponse, err error)
Request
Instantiate the PromoteGitconfigOptions
struct and set the fields to provide parameter values for the PromoteGitconfig
method.
Path Parameters
Git Config Id
Example:
git_config_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 PromoteGitconfig options.
Git Config Id.
Examples:git_config_id
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/gitconfigs/{git_config_id}/promote"
promoteGitconfigOptions := appConfigurationService.NewPromoteGitconfigOptions( "git_config_id", ) gitConfigPromote, response, err := appConfigurationService.PromoteGitconfig(promoteGitconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(gitConfigPromote, "", " ") fmt.Println(string(b))
Response
Details of the promote operation.
Git commit id will be given as part of the response upon successful git operation
Git commit message
Latest time when the snapshot was synced to git.
Example:
2022-05-27T23:20:50.52Z
Details of the promote operation.
{
"last_sync_time": "2022-05-30T05:33:41Z",
"git_commit_message": "custom config data written from App config instance",
"git_commit_id": "2fadfe4e71632f32c19ee97d795f1494be95caf8"
}
Git commit id will be given as part of the response upon successful git operation.
Git commit message.
Latest time when the snapshot was synced to git.
Examples:2022-05-27T23:20:50.520Z
Status Code
Successfully written the configuration details.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the git config id is correct.
Not Implemented.
{ "last_sync_time": "2022-05-30T05:33:41Z", "git_commit_message": "custom config data written from App config instance", "git_commit_id": "2fadfe4e71632f32c19ee97d795f1494be95caf8" }
{ "last_sync_time": "2022-05-30T05:33:41Z", "git_commit_message": "custom config data written from App config instance", "git_commit_id": "2fadfe4e71632f32c19ee97d795f1494be95caf8" }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the json file." }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the json file." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Restore configuration
Restore configuration, this api will write or update your chosen configuration from the GitHub to App configuration instance. The api will read the contents in the json file that was created using promote API and recreate or updates the App configuration instance with the file contents like properties, features and segments.
Restore configuration, this api will write or update your chosen configuration from the GitHub to App configuration instance. The api will read the contents in the json file that was created using promote API and recreate or updates the App configuration instance with the file contents like properties, features and segments.
PUT /gitconfigs/{git_config_id}/restore
(appConfiguration *AppConfigurationV1) RestoreGitconfig(restoreGitconfigOptions *RestoreGitconfigOptions) (result *GitConfigRestore, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) RestoreGitconfigWithContext(ctx context.Context, restoreGitconfigOptions *RestoreGitconfigOptions) (result *GitConfigRestore, response *core.DetailedResponse, err error)
Request
Instantiate the RestoreGitconfigOptions
struct and set the fields to provide parameter values for the RestoreGitconfig
method.
Path Parameters
Git Config Id
Example:
git_config_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 RestoreGitconfig options.
Git Config Id.
Examples:git_config_id
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/gitconfigs/{git_config_id}/restore"
restoreGitconfigOptions := appConfigurationService.NewRestoreGitconfigOptions( "git_config_id", ) gitConfigRestore, response, err := appConfigurationService.RestoreGitconfig(restoreGitconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(gitConfigRestore, "", " ") fmt.Println(string(b))
Response
Details of the restore operation.
The environments array will contain the environment data and it will also contains properties array and features array that belongs to that environment.
Segments that belongs to the features or properties
Details of the restore operation.
{
"environments": [
{
"name": "Dev",
"environment_id": "dev",
"description": "Environment created on instance creation",
"tags": "",
"color_code": "#FDD13A",
"features": [
{
"name": "Cycle Rentals",
"feature_id": "cycle-rentals",
"type": "NUMERIC",
"disabled_value": 2,
"enabled_value": 1,
"segment_rules": [],
"enabled": true,
"rollout_percentage": 100,
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
],
"properties": [
{
"name": "Daily Discount",
"property_id": "daily_discount",
"type": "NUMERIC",
"tags": "pre-release, v1.2",
"value": "100",
"segment_rules": [
{
"rules": [
{
"segments": [
"khpwj68h"
]
}
],
"value": 200,
"order": 1
},
{
"rules": [
{
"segments": [
"khpwjol7"
]
}
],
"value": 400,
"order": 2
}
],
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
]
}
],
"segments": [
{
"name": "Testers",
"segment_id": "khpwj68h",
"description": "Testers",
"tags": "test",
"rules": [
{
"values": [
"john@bluecharge.com",
"alice@bluecharge.com"
],
"operator": "is",
"attribute_name": "email"
}
]
},
{
"name": "IBMers",
"segment_id": "khpwjol7",
"description": "IBMers",
"tags": "company,ibm",
"rules": [
{
"values": [
"ibm.com"
],
"operator": "endsWith",
"attribute_name": "email"
}
]
}
]
}
The environments array will contain the environment data and it will also contains properties array and features array that belongs to that environment.
Examples:{ "name": "Dev environment", "environment_id": "dev", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "features": [], "properties": [] }
- Environments
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:#FDD13A
Array will contain features per environment.
Examples:{ "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", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "isOverridden": true }
- Features
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
List of collection id representing the collections that are associated with the specified feature flag.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the feature has to be imported or not.
Array will contain properties per environment.
Examples:{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "isOverridden": true }
- Properties
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the property has to be imported or not.
Segments that belongs to the features or properties.
Examples:{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] }
- Segments
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Status Code
Successfully updated the configuration details.
Bad request. Verify that the information in the request is complete and correct.
Not Found. Verify that the git config id is correct.
Not Implemented.
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "type": "NUMERIC", "tags": "pre-release, v1.2", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "type": "NUMERIC", "tags": "pre-release, v1.2", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the App configuration instance." }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the App configuration instance." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
Request
Query Parameters
If set to
true
, returns expanded view of the resource details.Example:
true
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
Response
List of all integrations.
Array of integrations.
The number of records that are retrieved in a list.
The number of records that are skipped in a list.
The total number of records.
Possible values: value ≥ 0
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.
Status Code
Successfully listed the integrations.
Unauthorized
{ "integrations": [ { "integration_id": "lckkhp34t", "integration_type": "EVENT_NOTIFICATIONS", "metadata": { "event_notifications_endpoint": "https://eu-gb.event-notifications.cloud.ibm.com", "event_notifications_source_id": "crn:v1:bluemix:public:apprapp:eu-gb:a/4f631ea3b3204b2b878a295604994acf:34e45c66-3648-4a51-be67-22eac4a7561c::", "event_notifications_instance_crn": "crn:v1:bluemix:public:event-notifications:eu-gb:a/4f631ea3b3204b2b878a295604994acf:0eb42def-21aa-4f0a-a975-0812ead6ceee::" }, "created_time": "2024-02-18T14:46:31Z", "updated_time": "2024-02-18T14:46:31Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/lckkhp34t" }, { "integration_id": "ldxktxso", "integration_type": "KMS", "metadata": { "key_status": "USABLE", "root_key_id": "094ab151-1e01-4d30-9e7a-f1311bc0fbc6", "kms_endpoint": "https://au-syd.kms.cloud.ibm.com", "kms_scheme_type": "BYOK", "kms_instance_crn": "crn:v1:bluemix:public:kms:au-syd:a/4f631ea3b3204b2b878a295604994acf:a3d454ea-38f4-4ae1-92e1-6a4aaac24e14::" }, "created_time": "2023-05-26T02:46:33Z", "updated_time": "2023-05-26T02:46:34Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/ldxktxso" } ], "offset": 0, "limit": 10, "total_count": 2, "first": { "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/6e7b594d-3132-484f-9ace-39e30c5c67cd/integrations?offset=0&size=10" }, "last": { "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/6e7b594d-3132-484f-9ace-39e30c5c67cd/integrations?offset=0&size=10" } }
{ "message": "Unauthorized" }
Request
The request body to create a new integration. Currently, integration with Key Protect / HPCS and Event Notifications service is supported.
{
"integration_id": "lckkhp34t",
"integration_type": "EVENT_NOTIFICATIONS",
"metadata": {
"event_notifications_instance_crn": "crn:v1:bluemix:public:event-notifications:eu-gb:a/4f631ea3b3204b2b878a295604994acf:0eb42def-21aa-4f0a-a975-0812ead6ceee::",
"event_notifications_endpoint": "https://eu-gb.event-notifications.cloud.ibm.com",
"event_notifications_source_name": "My App Config",
"event_notifications_source_description": "All the events from App Configuration instance"
}
}
{
"integration_id": "ldxktxso",
"integration_type": "KMS",
"metadata": {
"kms_instance_crn": "crn:v1:bluemix:public:kms:au-syd:a/4f631ea3b3204b2b878a295604994acf:a3d454ea-38f4-4ae1-92e1-6a4aaac24e14::",
"kms_endpoint": "https://au-syd.kms.cloud.ibm.com",
"root_key_id": "094ab151-1e01-4d30-9e7a-f1311bc0fbc6"
}
}
Integration id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only
Integration type.
Allowable values: [
KMS
,EVENT_NOTIFICATIONS
]Metadata required to create Event Notifications integration.
- metadata
The CRN of the Event Notifications service instance.
Example:
crn:v1:bluemix:public:event-notifications:eu-gb:a/4f631ea3b3204b2b878a295604994acf:0eb42def-21aa-4f0a-a975-0812ead6ceee::
The URL endpoint of the Event Notifications service instance.
Example:
https://eu-gb.event-notifications.cloud.ibm.com
Source name. This name will be shown in your Event Notification instance sources page.
Source description. This description will be shown in your Event Notification instance sources page under above source name.
Response
Details of the integration.
Integration id.
Integration type.
Metadata details of the retrieved EN integration.
- metadata
Event Notifications source id.
Event Notifications URL endpoint.
Event Notifications instance CRN.
Creation time of the integration.
Example:
2021-05-12T23:20:50.52Z
Last updated time of the integration.
Example:
2021-05-12T23:20:50.52Z
Integration URL
Status Code
Successfully created the integration
Bad request. Verify that the information in the request body is complete and correct.
Unauthorized
Forbidden
Example EN integration.
{ "integration_id": "lckkhp34t", "integration_type": "EVENT_NOTIFICATIONS", "metadata": { "event_notifications_endpoint": "https://eu-gb.event-notifications.cloud.ibm.com", "event_notifications_source_id": "crn:v1:bluemix:public:apprapp:eu-gb:a/4f631ea3b3204b2b878a295604994acf:34e45c66-3648-4a51-be67-22eac4a7561c::", "event_notifications_instance_crn": "crn:v1:bluemix:public:event-notifications:eu-gb:a/4f631ea3b3204b2b878a295604994acf:0eb42def-21aa-4f0a-a975-0812ead6ceee::" }, "created_time": "2024-02-18T14:46:31Z", "updated_time": "2024-02-18T14:46:31Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/lckkhp34t" }
Example KMS integration.
{ "integration_id": "ldxktxso", "integration_type": "KMS", "metadata": { "key_status": "USABLE", "root_key_id": "094ab151-1e01-4d30-9e7a-f1311bc0fbc6", "kms_endpoint": "https://au-syd.kms.cloud.ibm.com", "kms_scheme_type": "BYOK", "kms_instance_crn": "crn:v1:bluemix:public:kms:au-syd:a/4f631ea3b3204b2b878a295604994acf:a3d454ea-38f4-4ae1-92e1-6a4aaac24e14::" }, "created_time": "2023-05-26T02:46:33Z", "updated_time": "2023-05-26T02:46:34Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/ldxktxso" }
{ "code": "FTEC1003E", "message": "An incorrect or incomplete request is sent to the server. The server request does not contain proper values to complete the API request. Check the 'metadata' parameter value." }
{ "message": "Unauthorized" }
{ "code": "FTEC1021E", "message": "Forbidden - Insufficient permission to create the integration." }
Response
Details of the integration.
Integration id.
Integration type.
Metadata details of the retrieved EN integration.
- metadata
Event Notifications source id.
Event Notifications URL endpoint.
Event Notifications instance CRN.
Creation time of the integration.
Example:
2021-05-12T23:20:50.52Z
Last updated time of the integration.
Example:
2021-05-12T23:20:50.52Z
Integration URL
Status Code
Successfully retrived the integration details
Not Found. Verify that the integration id is correct.
Example EN integration.
{ "integration_id": "lckkhp34t", "integration_type": "EVENT_NOTIFICATIONS", "metadata": { "event_notifications_endpoint": "https://eu-gb.event-notifications.cloud.ibm.com", "event_notifications_source_id": "crn:v1:bluemix:public:apprapp:eu-gb:a/4f631ea3b3204b2b878a295604994acf:34e45c66-3648-4a51-be67-22eac4a7561c::", "event_notifications_instance_crn": "crn:v1:bluemix:public:event-notifications:eu-gb:a/4f631ea3b3204b2b878a295604994acf:0eb42def-21aa-4f0a-a975-0812ead6ceee::" }, "created_time": "2024-02-18T14:46:31Z", "updated_time": "2024-02-18T14:46:31Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/lckkhp34t" }
Example KMS integration.
{ "integration_id": "ldxktxso", "integration_type": "KMS", "metadata": { "key_status": "USABLE", "root_key_id": "094ab151-1e01-4d30-9e7a-f1311bc0fbc6", "kms_endpoint": "https://au-syd.kms.cloud.ibm.com", "kms_scheme_type": "BYOK", "kms_instance_crn": "crn:v1:bluemix:public:kms:au-syd:a/4f631ea3b3204b2b878a295604994acf:a3d454ea-38f4-4ae1-92e1-6a4aaac24e14::" }, "created_time": "2023-05-26T02:46:33Z", "updated_time": "2023-05-26T02:46:34Z", "href": "https://eu-gb.apprapp.cloud.ibm.com/feature/v1/instances/c6d52ad4-adaa-492b-941b-daa9e8d63d3a/integrations/ldxktxso" }
{ "code": "FTEC1000E", "message": "Not Found - The queried resource 'Integration' is not available on the server. Check the'lkqwest3ws' parameter." }
Response
Status Code
Successfully deleted the integration.
Not Found. Verify that the integration id is correct.
Method Not Allowed
{ "code": "FTEC1000E", "message": "Not Found - The queried resource 'Integration' is not available on the server. Check the'ekwgg78o' parameter." }
{ "code": "FTEC1019E", "message": "Method Not Allowed. Currently, integration of type KMS cannot be deleted." }
Get list of Origin Configs
List all the Origin Configs
List all the Origin Configs.
GET /originconfigs
(appConfiguration *AppConfigurationV1) ListOriginconfigs(listOriginconfigsOptions *ListOriginconfigsOptions) (result *OriginConfigList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListOriginconfigsWithContext(ctx context.Context, listOriginconfigsOptions *ListOriginconfigsOptions) (result *OriginConfigList, response *core.DetailedResponse, err error)
Request
No Request Parameters
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.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/originconfigs"
listOriginconfigsOptions := appConfigurationService.NewListOriginconfigsOptions() originConfigList, response, err := appConfigurationService.ListOriginconfigs(listOriginconfigsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(originConfigList, "", " ") fmt.Println(string(b))
Response
List of all origin configs.
List of allowed origins. Specify the parameter as a list of comma separated origins.
Creation time of the origin configs.
Example:
2022-11-15T23:20:50Z
Last modified time of the origin configs.
Example:
2022-11-16T21:20:50Z
Origin Config URL.
List of all origin configs.
{
"allowed_origins": [
"https://www.bluecharge.com",
"https://blog.hubspot.com",
"http://127.0.0.1:3000"
],
"created_time": "2022-11-15T23:20:50Z",
"updated_time": "2022-11-16T21:20:50Z",
"href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs"
}
List of allowed origins. Specify the parameter as a list of comma separated origins.
Creation time of the origin configs.
Examples:2022-11-15T23:20:50.000Z
Last modified time of the origin configs.
Examples:2022-11-16T21:20:50.000Z
Origin Config URL.
Status Code
Successfully listed all the origin configuration.
Unauthorized
{ "allowed_origins": [ "https://www.bluecharge.com", "https://blog.hubspot.com", "http://127.0.0.1:3000" ], "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs" }
{ "allowed_origins": [ "https://www.bluecharge.com", "https://blog.hubspot.com", "http://127.0.0.1:3000" ], "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs" }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Update Origin Configs
Update the Origin Configs
Update the Origin Configs.
PUT /originconfigs
(appConfiguration *AppConfigurationV1) UpdateOriginconfigs(updateOriginconfigsOptions *UpdateOriginconfigsOptions) (result *OriginConfigList, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateOriginconfigsWithContext(ctx context.Context, updateOriginconfigsOptions *UpdateOriginconfigsOptions) (result *OriginConfigList, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateOriginconfigsOptions
struct and set the fields to provide parameter values for the UpdateOriginconfigs
method.
The request body to update origin config.
{
"allowed_origins": [
"https://www.bluecharge.com",
"https://blog.hubspot.com",
"http://127.0.0.1:3000"
]
}
List of allowed origins. Specify the parameter as a list of comma separated origins.
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 UpdateOriginconfigs options.
List of allowed origins. Specify the parameter as a list of comma separated origins.
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{"allowed_origins":["https://www.bluecharge.com","https://blog.hubspot.com","http://127.0.0.1:3000"]}' "{base_url}/originconfigs"
updateOriginconfigsOptions := appConfigurationService.NewUpdateOriginconfigsOptions( []string{"testString"}, ) originConfigList, response, err := appConfigurationService.UpdateOriginconfigs(updateOriginconfigsOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(originConfigList, "", " ") fmt.Println(string(b))
Response
List of all origin configs.
List of allowed origins. Specify the parameter as a list of comma separated origins.
Creation time of the origin configs.
Example:
2022-11-15T23:20:50Z
Last modified time of the origin configs.
Example:
2022-11-16T21:20:50Z
Origin Config URL.
List of all origin configs.
{
"allowed_origins": [
"https://www.bluecharge.com",
"https://blog.hubspot.com",
"http://127.0.0.1:3000"
],
"created_time": "2022-11-15T23:20:50Z",
"updated_time": "2022-11-16T21:20:50Z",
"href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs"
}
List of allowed origins. Specify the parameter as a list of comma separated origins.
Creation time of the origin configs.
Examples:2022-11-15T23:20:50.000Z
Last modified time of the origin configs.
Examples:2022-11-16T21:20:50.000Z
Origin Config URL.
Status Code
Successfully updated the origin configs details.
Not Found. Verify that the instance id is correct.
{ "allowed_origins": [ "https://www.bluecharge.com", "https://blog.hubspot.com", "http://127.0.0.1:3000" ], "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs" }
{ "allowed_origins": [ "https://www.bluecharge.com", "https://blog.hubspot.com", "http://127.0.0.1:3000" ], "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.apprapp.cloud.ibm.com/apprapp/feature/v1/instances/9xxxxx-xxxxx-xxxxx-b3cd-xxxxx/originconfigs" }
{ "code": "FTEC1000E", "message": "The queried resource 'Instance' is not available on the server." }
{ "code": "FTEC1000E", "message": "The queried resource 'Instance' is not available on the server." }
Get Workflow Config
Get the environment specific workflow Configs
Get the environment specific workflow Configs.
GET /environments/{environment_id}/workflowconfigs
(appConfiguration *AppConfigurationV1) ListWorkflowconfig(listWorkflowconfigOptions *ListWorkflowconfigOptions) (result ListWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListWorkflowconfigWithContext(ctx context.Context, listWorkflowconfigOptions *ListWorkflowconfigOptions) (result ListWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
Request
Instantiate the ListWorkflowconfigOptions
struct and set the fields to provide parameter values for the ListWorkflowconfig
method.
Path Parameters
Environment Id
Example:
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 ListWorkflowconfig options.
Environment Id.
Examples:environment_id
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/environments/{environment_id}/workflowconfigs"
listWorkflowconfigOptions := appConfigurationService.NewListWorkflowconfigOptions( "environment_id", ) listWorkflowconfigResponse, response, err := appConfigurationService.ListWorkflowconfig(listWorkflowconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(listWorkflowconfigResponse, "", " ") fmt.Println(string(b))
Response
Details of the External Workflow configuration.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Creation time of the workflow configs.
Example:
2022-11-15T23:20:50Z
Last modified time of the workflow configs.
Example:
2022-11-16T21:20:50Z
Workflow Config URL.
Details of the External Workflow configuration.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
- WorkflowCredentials
Service Now instance login username.
Examples:admin
Service Now instance login password.
The auto-generated unique ID of the application in your Service Now instance.
Examples:f7b6379b55d08210f8ree233afc7256d
The secret string that both the Service Now instance and the client application use to authorize communications with one another.
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Creation time of the workflow configs.
Examples:2022-11-15T23:20:50.000Z
Last modified time of the workflow configs.
Examples:2022-11-16T21:20:50.000Z
Workflow Config URL.
Status Code
Successfully listed workflow configuration for the environment.
Unauthorized
Not Found. Verify that the environment_id is correct.
Not Implemented.
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
{ "code": "FTEC1000E", "message": "Error while fetching the configuration. The queried resource is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while fetching the configuration. The queried resource is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
Create Workflow config
Create a Workflow.
Create a Workflow.
POST /environments/{environment_id}/workflowconfigs
(appConfiguration *AppConfigurationV1) CreateWorkflowconfig(createWorkflowconfigOptions *CreateWorkflowconfigOptions) (result CreateWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) CreateWorkflowconfigWithContext(ctx context.Context, createWorkflowconfigOptions *CreateWorkflowconfigOptions) (result CreateWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
Request
Instantiate the CreateWorkflowconfigOptions
struct and set the fields to provide parameter values for the CreateWorkflowconfig
method.
Path Parameters
Environment Id
Example:
environment_id
The request body to create a new external workflow config.
{
"workflow_url": "https://xxxxx.service-now.com",
"approval_group_name": "WorkflowCRApprovers",
"approval_expiration": 10,
"workflow_credentials": {
"client_id": "client id value",
"client_secret": "clientsecret",
"password": "pwd",
"username": "user"
},
"enabled": true
}
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
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 CreateWorkflowconfig options.
Environment Id.
Examples:environment_id
Details of the External Workflow configuration.
- WorkflowConfig
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
- WorkflowCredentials
Service Now instance login username.
Examples:admin
Service Now instance login password.
The auto-generated unique ID of the application in your Service Now instance.
Examples:f7b6379b55d08210f8ree233afc7256d
The secret string that both the Service Now instance and the client application use to authorize communications with one another.
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true }' "{base_url}/environments/{environment_id}/workflowconfigs"
workflowCredentialsModel := &appconfigurationv1.WorkflowCredentials{ Username: core.StringPtr("user"), Password: core.StringPtr("pwd"), ClientID: core.StringPtr("client id value"), ClientSecret: core.StringPtr("clientsecret"), } createWorkflowconfigRequestModel := &appconfigurationv1.CreateWorkflowconfigRequestWorkflowConfig{ WorkflowURL: core.StringPtr("https://xxxxx.service-now.com"), ApprovalGroupName: core.StringPtr("WorkflowCRApprovers"), ApprovalExpiration: core.Int64Ptr(int64(10)), WorkflowCredentials: workflowCredentialsModel, Enabled: core.BoolPtr(true), } createWorkflowconfigOptions := appConfigurationService.NewCreateWorkflowconfigOptions( "environment_id", createWorkflowconfigRequestModel, ) createWorkflowconfigResponse, response, err := appConfigurationService.CreateWorkflowconfig(createWorkflowconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(createWorkflowconfigResponse, "", " ") fmt.Println(string(b))
Response
Details of the External Workflow configuration.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Creation time of the workflow configs.
Example:
2022-11-15T23:20:50Z
Last modified time of the workflow configs.
Example:
2022-11-16T21:20:50Z
Workflow Config URL.
Details of the External Workflow configuration.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
- WorkflowCredentials
Service Now instance login username.
Examples:admin
Service Now instance login password.
The auto-generated unique ID of the application in your Service Now instance.
Examples:f7b6379b55d08210f8ree233afc7256d
The secret string that both the Service Now instance and the client application use to authorize communications with one another.
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Creation time of the workflow configs.
Examples:2022-11-15T23:20:50.000Z
Last modified time of the workflow configs.
Examples:2022-11-16T21:20:50.000Z
Workflow Config URL.
Status Code
Successfully created the workflow configuration
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the environment_id is correct.
Not Implemented.
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
{ "code": "FTEC1003E", "message": "Error while creating the workflow configuration." }
{ "code": "FTEC1003E", "message": "Error while creating the workflow configuration." }
{ "code": "FTEC1000E", "message": "Error while creating the configuration. The queried evironment resource is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while creating the configuration. The queried evironment resource is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
Update Workflow config
Update a Workflow.
Update a Workflow.
PUT /environments/{environment_id}/workflowconfigs
(appConfiguration *AppConfigurationV1) UpdateWorkflowconfig(updateWorkflowconfigOptions *UpdateWorkflowconfigOptions) (result UpdateWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) UpdateWorkflowconfigWithContext(ctx context.Context, updateWorkflowconfigOptions *UpdateWorkflowconfigOptions) (result UpdateWorkflowconfigResponseIntf, response *core.DetailedResponse, err error)
Request
Instantiate the UpdateWorkflowconfigOptions
struct and set the fields to provide parameter values for the UpdateWorkflowconfig
method.
Path Parameters
Environment Id
Example:
environment_id
The request body to update a workflow config.
{
"workflow_url": "https://xxxxx.service-now.com",
"approval_group_name": "WorkflowCRApprovers",
"approval_expiration": 5,
"workflow_credentials": {
"client_id": "client id value",
"client_secret": "updated client secret",
"password": "updated password",
"username": "user"
},
"enabled": true
}
Service Now instance URL. Only url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Default:
false
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 UpdateWorkflowconfig options.
Environment Id.
Examples:environment_id
Workflow config attributes to be updated.
- UpdateWorkflowConfig
Service Now instance URL. Only url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
- WorkflowCredentials
Service Now instance login username.
Examples:admin
Service Now instance login password.
The auto-generated unique ID of the application in your Service Now instance.
Examples:f7b6379b55d08210f8ree233afc7256d
The secret string that both the Service Now instance and the client application use to authorize communications with one another.
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Default:
false
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 5, "workflow_credentials": { "client_id": "client id value", "client_secret": "updated client secret", "password": "updated password", "username": "user" }, "enabled": true }' "{base_url}/environments/{environment_id}/workflowconfigs"
workflowCredentialsModel := &appconfigurationv1.WorkflowCredentials{ Username: core.StringPtr("user"), Password: core.StringPtr("updated password"), ClientID: core.StringPtr("client id value"), ClientSecret: core.StringPtr("updated client secret"), } updateWorkflowconfigRequestModel := &appconfigurationv1.UpdateWorkflowconfigRequestUpdateWorkflowConfig{ WorkflowURL: core.StringPtr("https://xxxxx.service-now.com"), ApprovalGroupName: core.StringPtr("WorkflowCRApprovers"), ApprovalExpiration: core.Int64Ptr(int64(5)), WorkflowCredentials: workflowCredentialsModel, Enabled: core.BoolPtr(true), } updateWorkflowconfigOptions := appConfigurationService.NewUpdateWorkflowconfigOptions( "environment_id", updateWorkflowconfigRequestModel, ) updateWorkflowconfigResponse, response, err := appConfigurationService.UpdateWorkflowconfig(updateWorkflowconfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(updateWorkflowconfigResponse, "", " ") fmt.Println(string(b))
Response
Details of the External Workflow configuration.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Creation time of the workflow configs.
Example:
2022-11-15T23:20:50Z
Last modified time of the workflow configs.
Example:
2022-11-16T21:20:50Z
Workflow Config URL.
Details of the External Workflow configuration.
Environment name of workflow config in which it is created.
Environment ID of workflow config in which it is created.
Only service now url https://xxxxx.service-now.com allowed, xxxxx is the service now instance id.
Possible values: length ≤ 200
Group name of personals who can approve the Change Request on your Service Now. It must be first registered in your Service Now then it must be added here.
Possible values: length ≤ 100
Integer number identifies as hours which helps in adding approval start and end time to the created Change Request.
Possible values: 1 ≤ value ≤ 999
The credentials of the Service Now instance.
Examples:{ "username": "admin", "password": "Jy*1**Ef**q", "client_id": "f7b6378b57d08210f8bdd233afc7256d", "client_secret": "!xKxxxWTx" }
- WorkflowCredentials
Service Now instance login username.
Examples:admin
Service Now instance login password.
The auto-generated unique ID of the application in your Service Now instance.
Examples:f7b6379b55d08210f8ree233afc7256d
The secret string that both the Service Now instance and the client application use to authorize communications with one another.
This option enables the workflow configuration per environment. User must set it to true if they wish to create Change Request for flag state changes.
Creation time of the workflow configs.
Examples:2022-11-15T23:20:50.000Z
Last modified time of the workflow configs.
Examples:2022-11-16T21:20:50.000Z
Workflow Config URL.
Status Code
Successfully created the workflow configuration
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the environment_id is correct.
Not Implemented.
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "workflow_url": "https://xxxxx.service-now.com", "approval_group_name": "WorkflowCRApprovers", "approval_expiration": 10, "workflow_credentials": { "client_id": "client id value", "client_secret": "clientsecret", "password": "pwd", "username": "user" }, "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
Example IBM WorkflowConfig integration.
{ "environment_name": "Dev", "environment_id": "dev", "service_crn": "crn:v1:staging:staging:appservice:us-south::::", "sm_instance_crn": "crn:v1:staging:public:secrets-manager:eu-gb:a/3268cfe9e25d411122f9a731a:0a23274-92d0a-4d42-b1fa-d15b4293cd::", "approval_expiration": 4, "secret_id": "Secret ID", "workflow_type": "SERVICENOW_IBM", "enabled": true, "created_time": "2022-11-15T23:20:50Z", "updated_time": "2022-11-16T21:20:50Z", "href": "https://us-south.containers.appdomain.cloud/feature/v1/instances/31232860ac-c4c3-4a6a-9aa4-3dd82affbe1/environments/dev/workflowconfigs" }
{ "code": "FTEC1003E", "message": "Error while creating the workflow configuration." }
{ "code": "FTEC1003E", "message": "Error while creating the workflow configuration." }
{ "code": "FTEC1000E", "message": "Error while creating the configuration. The queried evironment resource is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while creating the configuration. The queried evironment resource is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
Delete Workflow config
Delete a Workflow config
Delete a Workflow config.
DELETE /environments/{environment_id}/workflowconfigs
(appConfiguration *AppConfigurationV1) DeleteWorkflowconfig(deleteWorkflowconfigOptions *DeleteWorkflowconfigOptions) (response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) DeleteWorkflowconfigWithContext(ctx context.Context, deleteWorkflowconfigOptions *DeleteWorkflowconfigOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteWorkflowconfigOptions
struct and set the fields to provide parameter values for the DeleteWorkflowconfig
method.
Path Parameters
Environment Id
Example:
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 DeleteWorkflowconfig options.
Environment Id.
Examples:environment_id
curl -X DELETE --location --header "Authorization: Bearer {iam_token}" "{base_url}/environments/{environment_id}/workflowconfigs"
deleteWorkflowconfigOptions := appConfigurationService.NewDeleteWorkflowconfigOptions( "environment_id", ) response, err := appConfigurationService.DeleteWorkflowconfig(deleteWorkflowconfigOptions) if err != nil { panic(err) } if response.StatusCode != 204 { fmt.Printf("\nUnexpected response status code received from DeleteWorkflowconfig(): %d\n", response.StatusCode) }
Response
Status Code
Successfully deleted environment specific workflow config.
Not Found. Verify that the environment id is correct.
Not Implemented.
{ "code": "FTEC1000E", "message": "Error while deleting the workflow config. The queried resource is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while deleting the workflow config. The queried resource is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'workflow integration' feature is not available" }
Import instance configuration
Import configuration to the instance.
Import configuration to the instance.
POST /config
(appConfiguration *AppConfigurationV1) ImportConfig(importConfigOptions *ImportConfigOptions) (result *ImportConfig, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ImportConfigWithContext(ctx context.Context, importConfigOptions *ImportConfigOptions) (result *ImportConfig, response *core.DetailedResponse, err error)
Request
Instantiate the ImportConfigOptions
struct and set the fields to provide parameter values for the ImportConfig
method.
Query Parameters
Full instance import requires query parameter
clean=true
to perform wiping of the existing data.Example:
true
The request body to import configurations.
{
"environments": [
{
"name": "Dev",
"environment_id": "dev",
"description": "Environment created on instance creation",
"tags": "",
"color_code": "#FDD13A",
"features": [
{
"name": "Cycle Rentals",
"feature_id": "cycle-rentals",
"description": "",
"tags": "",
"type": "NUMERIC",
"disabled_value": 2,
"enabled_value": 1,
"segment_rules": [],
"enabled": true,
"rollout_percentage": 100,
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
],
"properties": [
{
"name": "Daily Discount",
"property_id": "daily_discount",
"description": "",
"tags": "pre-release, v1.2",
"type": "NUMERIC",
"value": "100",
"segment_rules": [
{
"rules": [
{
"segments": [
"khpwj68h"
]
}
],
"value": 200,
"order": 1
},
{
"rules": [
{
"segments": [
"khpwjol7"
]
}
],
"value": 400,
"order": 2
}
],
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
]
}
],
"collections": [
{
"name": "web-app",
"collection_id": "web-app",
"description": "web app collection",
"tags": "v1"
}
],
"segments": [
{
"name": "Testers",
"segment_id": "khpwj68h",
"description": "Testers",
"tags": "test",
"rules": [
{
"values": [
"john@bluecharge.com",
"alice@bluecharge.com"
],
"operator": "is",
"attribute_name": "email"
}
]
},
{
"name": "IBMers",
"segment_id": "khpwjol7",
"description": "IBMers",
"tags": "company,ibm",
"rules": [
{
"values": [
"ibm.com"
],
"operator": "endsWith",
"attribute_name": "email"
}
]
}
]
}
Array will contain features and properties per environment
Array will contain collections details
Array will contain segments details
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 ImportConfig options.
Array will contain features and properties per environment.
Examples:[ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ]
- Environments
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:#FDD13A
Array will contain features per environment.
Examples:{ "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", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "isOverridden": true }
- Features
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.Allowable 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.Allowable 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
Default:
100
Tags associated with the feature.
Specify the targeting rules that is used to set different feature flag values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
Default:
100
List of collection id representing the collections that are associated with the specified feature flag.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
This attribute explains whether the feature has to be imported or not.
Array will contain properties per environment.
Examples:{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "isOverridden": true }
- Properties
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Allowable values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Allowable values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
This attribute explains whether the property has to be imported or not.
Array will contain collections details.
Examples:[ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ]
- Collections
Collection id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
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.
Array will contain segments details.
Examples:[ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ]
- Segments
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Allowable values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Full instance import requires query parameter
clean=true
to perform wiping of the existing data.Examples:true
curl -X POST --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" --header "Content-Type: application/json" --data '{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": ], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "collections": [ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }' "{base_url}/config?clean=true"
targetSegmentsModel := &appconfigurationv1.TargetSegments{ Segments: []string{"testString"}, } featureSegmentRuleModel := &appconfigurationv1.FeatureSegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: "testString", Order: core.Int64Ptr(int64(38)), } collectionRefModel := &appconfigurationv1.CollectionRef{ CollectionID: core.StringPtr("web-app"), } importFeatureRequestBodyModel := &appconfigurationv1.ImportFeatureRequestBody{ Name: core.StringPtr("Cycle Rentals"), FeatureID: core.StringPtr("cycle-rentals"), Type: core.StringPtr("NUMERIC"), EnabledValue: core.StringPtr("1"), DisabledValue: core.StringPtr("2"), Enabled: core.BoolPtr(true), RolloutPercentage: core.Int64Ptr(int64(100)), SegmentRules: []appconfigurationv1.FeatureSegmentRule{*featureSegmentRuleModel}, Collections: []appconfigurationv1.CollectionRef{*collectionRefModel}, IsOverridden: core.BoolPtr(true), } segmentRuleModel := &appconfigurationv1.SegmentRule{ Rules: []appconfigurationv1.TargetSegments{*targetSegmentsModel}, Value: core.StringPtr("200"), Order: core.Int64Ptr(int64(1)), } importPropertyRequestBodyModel := &appconfigurationv1.ImportPropertyRequestBody{ Name: core.StringPtr("Daily Discount"), PropertyID: core.StringPtr("daily_discount"), Type: core.StringPtr("NUMERIC"), Value: core.StringPtr("100"), Tags: core.StringPtr("pre-release, v1.2"), SegmentRules: []appconfigurationv1.SegmentRule{*segmentRuleModel}, Collections: []appconfigurationv1.CollectionRef{*collectionRefModel}, IsOverridden: core.BoolPtr(true), } importEnvironmentSchemaModel := &appconfigurationv1.ImportEnvironmentSchema{ Name: core.StringPtr("Dev"), EnvironmentID: core.StringPtr("dev"), Description: core.StringPtr("Environment created on instance creation"), ColorCode: core.StringPtr("#FDD13A"), Features: []appconfigurationv1.ImportFeatureRequestBody{*importFeatureRequestBodyModel}, Properties: []appconfigurationv1.ImportPropertyRequestBody{*importPropertyRequestBodyModel}, } importCollectionSchemaModel := &appconfigurationv1.ImportCollectionSchema{ CollectionID: core.StringPtr("web-app"), Name: core.StringPtr("web-app"), Description: core.StringPtr("web app collection"), Tags: core.StringPtr("v1"), } ruleModel := &appconfigurationv1.Rule{ AttributeName: core.StringPtr("email"), Operator: core.StringPtr("is"), Values: []string{"john@bluecharge.com", "alice@bluecharge.com"}, } importSegmentSchemaModel := &appconfigurationv1.ImportSegmentSchema{ Name: core.StringPtr("Testers"), SegmentID: core.StringPtr("khpwj68h"), Description: core.StringPtr("Testers"), Tags: core.StringPtr("test"), Rules: []appconfigurationv1.Rule{*ruleModel}, } importConfigOptions := appConfigurationService.NewImportConfigOptions() importConfigOptions.SetEnvironments([]appconfigurationv1.ImportEnvironmentSchema{*importEnvironmentSchemaModel}) importConfigOptions.SetCollections([]appconfigurationv1.ImportCollectionSchema{*importCollectionSchemaModel}) importConfigOptions.SetSegments([]appconfigurationv1.ImportSegmentSchema{*importSegmentSchemaModel}) importConfigOptions.SetClean("true") importConfig, response, err := appConfigurationService.ImportConfig(importConfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(importConfig, "", " ") fmt.Println(string(b))
Response
Full instance configuration.
Array will contain features and properties per environment
Array will contain collections details
Array will contain segments details
Full instance configuration.
{
"environments": [
{
"name": "Dev",
"environment_id": "dev",
"description": "Environment created on instance creation",
"tags": "",
"color_code": "#FDD13A",
"features": [
{
"name": "Cycle Rentals",
"feature_id": "cycle-rentals",
"description": "",
"tags": "",
"type": "NUMERIC",
"disabled_value": 2,
"enabled_value": 1,
"segment_rules": [],
"enabled": true,
"rollout_percentage": 100,
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
],
"properties": [
{
"name": "Daily Discount",
"property_id": "daily_discount",
"description": "",
"tags": "pre-release, v1.2",
"type": "NUMERIC",
"value": "100",
"segment_rules": [
{
"rules": [
{
"segments": [
"khpwj68h"
]
}
],
"value": 200,
"order": 1
},
{
"rules": [
{
"segments": [
"khpwjol7"
]
}
],
"value": 400,
"order": 2
}
],
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
]
}
],
"collections": [
{
"name": "web-app",
"collection_id": "web-app",
"description": "web app collection",
"tags": "v1"
}
],
"segments": [
{
"name": "Testers",
"segment_id": "khpwj68h",
"description": "Testers",
"tags": "test",
"rules": [
{
"values": [
"john@bluecharge.com",
"alice@bluecharge.com"
],
"operator": "is",
"attribute_name": "email"
}
]
},
{
"name": "IBMers",
"segment_id": "khpwjol7",
"description": "IBMers",
"tags": "company,ibm",
"rules": [
{
"values": [
"ibm.com"
],
"operator": "endsWith",
"attribute_name": "email"
}
]
}
]
}
Array will contain features and properties per environment.
Examples:{ "name": "Dev environment", "environment_id": "dev", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "features": [], "properties": [] }
- Environments
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:#FDD13A
Array will contain features per environment.
Examples:{ "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", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "isOverridden": true }
- Features
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
List of collection id representing the collections that are associated with the specified feature flag.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the feature has to be imported or not.
Array will contain properties per environment.
Examples:{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "isOverridden": true }
- Properties
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the property has to be imported or not.
Array will contain collections details.
Examples:{ "collection_id": "WebApplication", "name": "Web Application", "description": "Collection for Web Application.", "tags": "version: 1.1, pre-release" }
- Collections
Collection id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
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.
Array will contain segments details.
Examples:{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] }
- Segments
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Status Code
Successfully imported the configuration
Bad request. Verify that the information in the request body is complete and correct.
Forbidden Request - Instance is not empty. Send clean=true query param if you want to override the current instance configuration
Not Implemented.
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "collections": [ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "collections": [ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "code": "FTEC1003E", "message": "Error while import the configuration." }
{ "code": "FTEC1003E", "message": "Error while import the configuration." }
{ "code": "FTI1009E", "message": "Forbidden Request - Instance is not empty. Send clean=true query param if you want to override the current instance configuration." }
{ "code": "FTI1009E", "message": "Forbidden Request - Instance is not empty. Send clean=true query param if you want to override the current instance configuration." }
{ "code": "FTEC1011E", "message": "Currently 'Rollout percentage' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'Rollout percentage' feature is not available" }
Export instance configuration
Get the instance configuration.
Get the instance configuration.
GET /config
(appConfiguration *AppConfigurationV1) ListInstanceConfig(listInstanceConfigOptions *ListInstanceConfigOptions) (result *ImportConfig, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) ListInstanceConfigWithContext(ctx context.Context, listInstanceConfigOptions *ListInstanceConfigOptions) (result *ImportConfig, response *core.DetailedResponse, err error)
Request
No Request Parameters
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.
No Request Parameters
curl -X GET --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/config"
listInstanceConfigOptions := appConfigurationService.NewListInstanceConfigOptions() importConfig, response, err := appConfigurationService.ListInstanceConfig(listInstanceConfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(importConfig, "", " ") fmt.Println(string(b))
Response
Full instance configuration.
Array will contain features and properties per environment
Array will contain collections details
Array will contain segments details
Full instance configuration.
{
"environments": [
{
"name": "Dev",
"environment_id": "dev",
"description": "Environment created on instance creation",
"tags": "",
"color_code": "#FDD13A",
"features": [
{
"name": "Cycle Rentals",
"feature_id": "cycle-rentals",
"description": "",
"tags": "",
"type": "NUMERIC",
"disabled_value": 2,
"enabled_value": 1,
"segment_rules": [],
"enabled": true,
"rollout_percentage": 100,
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
],
"properties": [
{
"name": "Daily Discount",
"property_id": "daily_discount",
"description": "",
"tags": "pre-release, v1.2",
"type": "NUMERIC",
"value": "100",
"segment_rules": [
{
"rules": [
{
"segments": [
"khpwj68h"
]
}
],
"value": 200,
"order": 1
},
{
"rules": [
{
"segments": [
"khpwjol7"
]
}
],
"value": 400,
"order": 2
}
],
"collections": [
{
"collection_id": "web-app",
"name": "web-app"
}
],
"isOverridden": true
}
]
}
],
"collections": [
{
"name": "web-app",
"collection_id": "web-app",
"description": "web app collection",
"tags": "v1"
}
],
"segments": [
{
"name": "Testers",
"segment_id": "khpwj68h",
"description": "Testers",
"tags": "test",
"rules": [
{
"values": [
"john@bluecharge.com",
"alice@bluecharge.com"
],
"operator": "is",
"attribute_name": "email"
}
]
},
{
"name": "IBMers",
"segment_id": "khpwjol7",
"description": "IBMers",
"tags": "company,ibm",
"rules": [
{
"values": [
"ibm.com"
],
"operator": "endsWith",
"attribute_name": "email"
}
]
}
]
}
Array will contain features and properties per environment.
Examples:{ "name": "Dev environment", "environment_id": "dev", "description": "Dev environment description", "tags": "development", "color_code": "#FDD13A", "features": [], "properties": [] }
- Environments
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:#FDD13A
Array will contain features per environment.
Examples:{ "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", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 70 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2, "rollout_percentage": 20 } ], "collections": [ { "collection_id": "ghzinc", "name": "GHz Inc" }, { "collection_id": "phzsystems", "name": "PHz Systems" }, { "collection_id": "ghzglobal", "name": "GHz Global" } ], "isOverridden": true }
- Features
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:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1, "rollout_percentage": 50 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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
List of collection id representing the collections that are associated with the specified feature flag.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the feature has to be imported or not.
Array will contain properties per environment.
Examples:{ "name": "Email property", "property_id": "email-property", "description": "Property for email", "type": "BOOLEAN", "value": true, "tags": "version: 1.1, pre-release", "segment_rules": [ { "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }, { "rules": [ { "segments": [ "freeusers" ] } ], "value": false, "order": 2 } ], "collections": [ { "collection_id": "ghzinc" }, { "collection_id": "phzsystems" }, { "collection_id": "ghzglobal" } ], "isOverridden": true }
- Properties
Property name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Property description.
Possible values: length ≤ 255
Type of the property (BOOLEAN, STRING, NUMERIC, SECRETREF). If
type
isSTRING
, thenformat
attribute is required.Possible values: [
BOOLEAN
,STRING
,NUMERIC
,SECRETREF
]Format of the property (TEXT, JSON, YAML) and it is a required attribute when
type
isSTRING
. It is not required forBOOLEAN
,NUMERIC
orSECRETREF
types. This attribute is populated in the response body ofPOST, PUT and GET
calls if the typeSTRING
is used and not populated forBOOLEAN
,NUMERIC
andSECRETREF
types.Possible values: [
TEXT
,JSON
,YAML
]Value of the Property. The value can be Boolean, Numeric, SecretRef, String - TEXT, String - JSON, String - YAML as per the
type
andformat
attributes.Tags associated with the property.
Specify the targeting rules that is used to set different property values for different segments.
Examples:{ "rules": [ { "segments": [ "betausers", "premiumusers" ] } ], "value": true, "order": 1 }
- SegmentRules
The list of targeted segments.
Examples:{ "segments": [ "betausers", "premiumusers" ] }
- Rules
List of segment ids that are used for targeting using the rule.
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.
List of collection id representing the collections that are associated with the specified property.
Examples:{ "collection_id": "ghzinc" }
- Collections
Collection id.
Name of the collection.
This attribute explains whether the property has to be imported or not.
Array will contain collections details.
Examples:{ "collection_id": "WebApplication", "name": "Web Application", "description": "Collection for Web Application.", "tags": "version: 1.1, pre-release" }
- Collections
Collection id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
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.
Array will contain segments details.
Examples:{ "name": "Beta Users", "segment_id": "beta-users", "description": "Segment containing the beta users", "tags": "version: 1.1, stage", "rules": [ { "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }, { "attribute_name": "country", "operator": "is", "values": [ "India", "USA" ] } ] }
- Segments
Segment name. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment id. Allowed special characters are dot ( . ), hyphen( - ), underscore ( _ ) only.
Possible values: length ≤ 256
Segment description.
Possible values: length ≤ 255
Tags associated with the segments.
List of rules that determine if the entity belongs to the segment during feature / property evaluation. An entity is identified by an unique identifier and the attributes that it defines. Any feature flag and property value evaluation is performed in the context of an entity when it is targeted to segments.
Examples:{ "attribute_name": "email", "operator": "endsWith", "values": [ "@in.mnc.com", "@us.mnc.com" ] }
- Rules
Attribute name.
Operator to be used for the evaluation if the entity belongs to the segment.
Possible values: [
is
,contains
,startsWith
,endsWith
,greaterThan
,lesserThan
,greaterThanEquals
,lesserThanEquals
]List of values. Entities matching any of the given values will be considered to belong to the segment.
Status Code
Successfully listed configuration for the instance.
Unauthorized
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "collections": [ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "description": "", "tags": "", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "description": "", "tags": "pre-release, v1.2", "type": "NUMERIC", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "collections": [ { "name": "web-app", "collection_id": "web-app", "description": "web app collection", "tags": "v1" } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "message": "Unauthorized" }
{ "message": "Unauthorized" }
Promote or Restore snapshot configuration
This api will either promote or restore your chosen configuration from or to the GitHub based on the git url, file path and branch data.
This api will either promote or restore your chosen configuration from or to the GitHub based on the git url, file path and branch data.
PUT /config
(appConfiguration *AppConfigurationV1) PromoteRestoreConfig(promoteRestoreConfigOptions *PromoteRestoreConfigOptions) (result ConfigActionIntf, response *core.DetailedResponse, err error)
(appConfiguration *AppConfigurationV1) PromoteRestoreConfigWithContext(ctx context.Context, promoteRestoreConfigOptions *PromoteRestoreConfigOptions) (result ConfigActionIntf, response *core.DetailedResponse, err error)
Request
Instantiate the PromoteRestoreConfigOptions
struct and set the fields to provide parameter values for the PromoteRestoreConfig
method.
Query Parameters
Git Config Id.
Example:
git_config_id
Promote configuration to Git or Restore configuration from Git.
Allowable values: [
promote
,restore
]Example:
promote
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 PromoteRestoreConfig options.
Git Config Id.
Examples:git_config_id
Promote configuration to Git or Restore configuration from Git.
Allowable values: [
promote
,restore
]Examples:promote
curl -X PUT --location --header "Authorization: Bearer {iam_token}" --header "Accept: application/json" "{base_url}/config?git_config_id=git_config_id&action=promote"
promoteRestoreConfigOptions := appConfigurationService.NewPromoteRestoreConfigOptions( "git_config_id", "promote", ) configAction, response, err := appConfigurationService.PromoteRestoreConfig(promoteRestoreConfigOptions) if err != nil { panic(err) } b, _ := json.MarshalIndent(configAction, "", " ") fmt.Println(string(b))
Response
Details of the promote operation.
Git commit id will be given as part of the response upon successful git operation
Git commit message
Latest time when the snapshot was synced to git.
Example:
2022-05-27T23:20:50.52Z
Details of the promote operation.
Git commit id will be given as part of the response upon successful git operation.
Git commit message.
Latest time when the snapshot was synced to git.
Examples:2022-05-27T23:20:50.520Z
Status Code
Successfully completed the operation.
Bad request. Verify that the information in the request body is complete and correct.
Not Found. Verify that the git config id is correct.
Not Implemented.
Example promote snapshot configuration.
{ "last_sync_time": "2022-05-30T05:33:41Z", "git_commit_message": "custom config data written from App config instance", "git_commit_id": "2fadfe4e71632f32c19ee97d795f1494be95caf8" }
Example promote snapshot configuration.
{ "last_sync_time": "2022-05-30T05:33:41Z", "git_commit_message": "custom config data written from App config instance", "git_commit_id": "2fadfe4e71632f32c19ee97d795f1494be95caf8" }
Example restore snapshot configuration.
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "type": "NUMERIC", "tags": "pre-release, v1.2", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
Example restore snapshot configuration.
{ "environments": [ { "name": "Dev", "environment_id": "dev", "description": "Environment created on instance creation", "tags": "", "color_code": "#FDD13A", "features": [ { "name": "Cycle Rentals", "feature_id": "cycle-rentals", "type": "NUMERIC", "disabled_value": 2, "enabled_value": 1, "segment_rules": [], "enabled": true, "rollout_percentage": 100, "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ], "properties": [ { "name": "Daily Discount", "property_id": "daily_discount", "type": "NUMERIC", "tags": "pre-release, v1.2", "value": "100", "segment_rules": [ { "rules": [ { "segments": [ "khpwj68h" ] } ], "value": 200, "order": 1 }, { "rules": [ { "segments": [ "khpwjol7" ] } ], "value": 400, "order": 2 } ], "collections": [ { "collection_id": "web-app", "name": "web-app" } ], "isOverridden": true } ] } ], "segments": [ { "name": "Testers", "segment_id": "khpwj68h", "description": "Testers", "tags": "test", "rules": [ { "values": [ "john@bluecharge.com", "alice@bluecharge.com" ], "operator": "is", "attribute_name": "email" } ] }, { "name": "IBMers", "segment_id": "khpwjol7", "description": "IBMers", "tags": "company,ibm", "rules": [ { "values": [ "ibm.com" ], "operator": "endsWith", "attribute_name": "email" } ] } ] }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the json file." }
{ "code": "FTEC1007E", "message": "Error while writing or updating the configuration to the json file." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1000E", "message": "Error while updating the configuration. The queried resource 'git_config_id' is not available on the server." }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }
{ "code": "FTEC1011E", "message": "Currently 'snapshot' feature is not available" }