All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
DeleteEnvironment | Delete /api/v2/projects/{projectKey}/environments/{environmentKey} | Delete environment |
GetEnvironment | Get /api/v2/projects/{projectKey}/environments/{environmentKey} | Get environment |
GetEnvironmentsByProject | Get /api/v2/projects/{projectKey}/environments | List environments |
PatchEnvironment | Patch /api/v2/projects/{projectKey}/environments/{environmentKey} | Update environment |
PostEnvironment | Post /api/v2/projects/{projectKey}/environments | Create environment |
ResetEnvironmentMobileKey | Post /api/v2/projects/{projectKey}/environments/{environmentKey}/mobileKey | Reset environment mobile SDK key |
ResetEnvironmentSDKKey | Post /api/v2/projects/{projectKey}/environments/{environmentKey}/apiKey | Reset environment SDK key |
DeleteEnvironment(ctx, projectKey, environmentKey).Execute()
Delete environment
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()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.DeleteEnvironment(context.Background(), projectKey, environmentKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.DeleteEnvironment``: %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 | |
environmentKey | string | The environment key |
Other parameters are passed through a pointer to a apiDeleteEnvironmentRequest 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]
Environment GetEnvironment(ctx, projectKey, environmentKey).Execute()
Get environment
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()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.GetEnvironment(context.Background(), projectKey, environmentKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.GetEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEnvironment`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.GetEnvironment`: %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 apiGetEnvironmentRequest 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]
Environments GetEnvironmentsByProject(ctx, projectKey).Limit(limit).Offset(offset).Filter(filter).Sort(sort).Execute()
List environments
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
limit := int64(789) // int64 | The number of environments to return in the response. Defaults to 20. (optional)
offset := int64(789) // int64 | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. (optional)
filter := "filter_example" // string | A comma-separated list of filters. Each filter is of the form `field:value`. (optional)
sort := "sort_example" // string | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.GetEnvironmentsByProject(context.Background(), projectKey).Limit(limit).Offset(offset).Filter(filter).Sort(sort).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.GetEnvironmentsByProject``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetEnvironmentsByProject`: Environments
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.GetEnvironmentsByProject`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key |
Other parameters are passed through a pointer to a apiGetEnvironmentsByProjectRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
limit | int64 | The number of environments to return in the response. Defaults to 20. | offset | int64 | Where to start in the list. This is for use with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | filter | string | A comma-separated list of filters. Each filter is of the form `field:value`. | sort | string | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Environment PatchEnvironment(ctx, projectKey, environmentKey).PatchOperation(patchOperation).Execute()
Update environment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField")} // []PatchOperation |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.PatchEnvironment(context.Background(), projectKey, environmentKey).PatchOperation(patchOperation).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.PatchEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PatchEnvironment`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.PatchEnvironment`: %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 apiPatchEnvironmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
patchOperation | []PatchOperation | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Environment PostEnvironment(ctx, projectKey).EnvironmentPost(environmentPost).Execute()
Create environment
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentPost := *openapiclient.NewEnvironmentPost("My Environment", "environment-key-123abc", "F5A623") // EnvironmentPost |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.PostEnvironment(context.Background(), projectKey).EnvironmentPost(environmentPost).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.PostEnvironment``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PostEnvironment`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.PostEnvironment`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
projectKey | string | The project key |
Other parameters are passed through a pointer to a apiPostEnvironmentRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
environmentPost | EnvironmentPost | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Environment ResetEnvironmentMobileKey(ctx, projectKey, environmentKey).Execute()
Reset environment mobile SDK key
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()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.ResetEnvironmentMobileKey(context.Background(), projectKey, environmentKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.ResetEnvironmentMobileKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ResetEnvironmentMobileKey`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.ResetEnvironmentMobileKey`: %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 apiResetEnvironmentMobileKeyRequest 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]
Environment ResetEnvironmentSDKKey(ctx, projectKey, environmentKey).Expiry(expiry).Execute()
Reset environment SDK key
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
projectKey := "projectKey_example" // string | The project key
environmentKey := "environmentKey_example" // string | The environment key
expiry := int64(789) // int64 | The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EnvironmentsApi.ResetEnvironmentSDKKey(context.Background(), projectKey, environmentKey).Expiry(expiry).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentsApi.ResetEnvironmentSDKKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ResetEnvironmentSDKKey`: Environment
fmt.Fprintf(os.Stdout, "Response from `EnvironmentsApi.ResetEnvironmentSDKKey`: %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 apiResetEnvironmentSDKKeyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
expiry | int64 | The time at which you want the old SDK key to expire, in UNIX milliseconds. By default, the key expires immediately. During the period between this call and the time when the old SDK key expires, both the old SDK key and the new SDK key will work. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]