All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
CreateExperiment | Post /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments | Create experiment |
CreateIteration | Post /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations | Create iteration |
GetExperiment | Get /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey} | Get experiment |
GetExperimentResults | Get /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/metrics/{metricKey}/results | Get experiment results |
GetExperiments | Get /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments | Get experiments |
GetLegacyExperimentResults | Get /api/v2/flags/{projectKey}/{featureFlagKey}/experiments/{environmentKey}/{metricKey} | Get legacy experiment results (deprecated) |
PatchExperiment | Patch /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey} | Patch experiment |
ResetExperiment | Delete /api/v2/flags/{projectKey}/{featureFlagKey}/experiments/{environmentKey}/{metricKey}/results | Reset experiment results |
Experiment CreateExperiment(ctx, projectKey, environmentKey).ExperimentPost(experimentPost).Execute()
Create experiment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
experimentPost := *openapiclient.NewExperimentPost("Name_example", "Description_example", "MaintainerId_example", "Key_example", *openapiclient.NewIterationInput("Hypothesis_example", []openapiclient.MetricInput{*openapiclient.NewMetricInput("Key_example", false)}, []openapiclient.TreatmentInput{*openapiclient.NewTreatmentInput("Name_example", false, "AllocationPercent_example", []openapiclient.TreatmentParameterInput{*openapiclient.NewTreatmentParameterInput("FlagKey_example", "VariationId_example")})}, map[string]FlagInput{"key": *openapiclient.NewFlagInput("RuleId_example", int32(123))})) // ExperimentPost |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.CreateExperiment(context.Background(), projectKey, environmentKey).ExperimentPost(experimentPost).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.CreateExperiment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateExperiment`: Experiment
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.CreateExperiment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key |
Other parameters are passed through a pointer to a apiCreateExperimentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
experimentPost | ExperimentPost | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
IterationRep CreateIteration(ctx, projectKey, environmentKey, experimentKey).IterationInput(iterationInput).Execute()
Create iteration
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
experimentKey := "experimentKey_example" // string | The experiment key
iterationInput := *openapiclient.NewIterationInput("Hypothesis_example", []openapiclient.MetricInput{*openapiclient.NewMetricInput("Key_example", false)}, []openapiclient.TreatmentInput{*openapiclient.NewTreatmentInput("Name_example", false, "AllocationPercent_example", []openapiclient.TreatmentParameterInput{*openapiclient.NewTreatmentParameterInput("FlagKey_example", "VariationId_example")})}, map[string]FlagInput{"key": *openapiclient.NewFlagInput("RuleId_example", int32(123))}) // IterationInput |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.CreateIteration(context.Background(), projectKey, environmentKey, experimentKey).IterationInput(iterationInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.CreateIteration``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateIteration`: IterationRep
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.CreateIteration`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key | |
experimentKey | string | The experiment key |
Other parameters are passed through a pointer to a apiCreateIterationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
iterationInput | IterationInput | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Experiment GetExperiment(ctx, projectKey, environmentKey, experimentKey).Execute()
Get experiment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
experimentKey := "experimentKey_example" // string | The experiment key
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.GetExperiment(context.Background(), projectKey, environmentKey, experimentKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.GetExperiment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetExperiment`: Experiment
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.GetExperiment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key | |
experimentKey | string | The experiment key |
Other parameters are passed through a pointer to a apiGetExperimentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExperimentResults GetExperimentResults(ctx, projectKey, environmentKey, experimentKey, metricKey).Execute()
Get experiment results
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
experimentKey := "experimentKey_example" // string | The experiment key
metricKey := "metricKey_example" // string | The metric key
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.GetExperimentResults(context.Background(), projectKey, environmentKey, experimentKey, metricKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.GetExperimentResults``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetExperimentResults`: ExperimentResults
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.GetExperimentResults`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key | |
experimentKey | string | The experiment key | |
metricKey | string | The metric key |
Other parameters are passed through a pointer to a apiGetExperimentResultsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExperimentCollectionRep GetExperiments(ctx, projectKey, environmentKey).Execute()
Get experiments
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.GetExperiments(context.Background(), projectKey, environmentKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.GetExperiments``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetExperiments`: ExperimentCollectionRep
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.GetExperiments`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key |
Other parameters are passed through a pointer to a apiGetExperimentsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ExperimentResults GetLegacyExperimentResults(ctx, projectKey, featureFlagKey, environmentKey, metricKey).From(from).To(to).Execute()
Get legacy experiment results (deprecated)
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
featureFlagKey := "featureFlagKey_example" // string | The feature flag key
environmentKey := "environmentKey_example" // string | The environment key
metricKey := "metricKey_example" // string | The metric key
from := int64(789) // int64 | A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds. (optional)
to := int64(789) // int64 | A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds. (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.GetLegacyExperimentResults(context.Background(), projectKey, featureFlagKey, environmentKey, metricKey).From(from).To(to).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.GetLegacyExperimentResults``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLegacyExperimentResults`: ExperimentResults
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.GetLegacyExperimentResults`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
featureFlagKey | string | The feature flag key | |
environmentKey | string | The environment key | |
metricKey | string | The metric key |
Other parameters are passed through a pointer to a apiGetLegacyExperimentResultsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
from | int64 | A timestamp denoting the start of the data collection period, expressed as a Unix epoch time in milliseconds. | to | int64 | A timestamp denoting the end of the data collection period, expressed as a Unix epoch time in milliseconds. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Experiment PatchExperiment(ctx, projectKey, environmentKey, experimentKey).ExperimentPatchInput(experimentPatchInput).Execute()
Patch experiment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
experimentKey := "experimentKey_example" // string | The experiment key
experimentPatchInput := *openapiclient.NewExperimentPatchInput() // ExperimentPatchInput |
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.PatchExperiment(context.Background(), projectKey, environmentKey, experimentKey).ExperimentPatchInput(experimentPatchInput).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.PatchExperiment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchExperiment`: Experiment
fmt.Fprintf(os.Stdout, "Response from `ExperimentsBetaApi.PatchExperiment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
environmentKey | string | The environment key | |
experimentKey | string | The experiment key |
Other parameters are passed through a pointer to a apiPatchExperimentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
experimentPatchInput | ExperimentPatchInput | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResetExperiment(ctx, projectKey, featureFlagKey, environmentKey, metricKey).Execute()
Reset experiment results
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
featureFlagKey := "featureFlagKey_example" // string | The feature flag key
environmentKey := "environmentKey_example" // string | The environment key
metricKey := "metricKey_example" // string | The metric's key
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.ExperimentsBetaApi.ResetExperiment(context.Background(), projectKey, featureFlagKey, environmentKey, metricKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ExperimentsBetaApi.ResetExperiment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key | |
featureFlagKey | string | The feature flag key | |
environmentKey | string | The environment key | |
metricKey | string | The metric's key |
Other parameters are passed through a pointer to a apiResetExperimentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]