Skip to content

Latest commit

 

History

History
853 lines (551 loc) · 27 KB

FeatureFlagsApi.md

File metadata and controls

853 lines (551 loc) · 27 KB

\FeatureFlagsApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
CopyFeatureFlag Post /api/v2/flags/{projKey}/{featureFlagKey}/copy Copy feature flag
DeleteFeatureFlag Delete /api/v2/flags/{projKey}/{key} Delete feature flag
GetExpiringUserTargets Get /api/v2/flags/{projKey}/{flagKey}/expiring-user-targets/{envKey} Get expiring user targets for feature flag
GetFeatureFlag Get /api/v2/flags/{projKey}/{key} Get feature flag
GetFeatureFlagStatus Get /api/v2/flag-statuses/{projKey}/{envKey}/{key} Get feature flag status
GetFeatureFlagStatusAcrossEnvironments Get /api/v2/flag-status/{projKey}/{key} Get flag status across environments
GetFeatureFlagStatuses Get /api/v2/flag-statuses/{projKey}/{envKey} List feature flag statuses
GetFeatureFlags Get /api/v2/flags/{projKey} List feature flags
PatchExpiringUserTargets Patch /api/v2/flags/{projKey}/{flagKey}/expiring-user-targets/{envKey} Update expiring user targets on feature flag
PatchFeatureFlag Patch /api/v2/flags/{projKey}/{key} Update feature flag
PostFeatureFlag Post /api/v2/flags/{projKey} Create a feature flag

CopyFeatureFlag

FeatureFlag CopyFeatureFlag(ctx, projKey, featureFlagKey).FlagCopyConfigPost(flagCopyConfigPost).Execute()

Copy feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    featureFlagKey := "featureFlagKey_example" // string | The feature flag's key. The key identifies the flag in your code.
    flagCopyConfigPost := *openapiclient.NewFlagCopyConfigPost(*openapiclient.NewFlagCopyConfigEnvironment("Key_example"), *openapiclient.NewFlagCopyConfigEnvironment("Key_example")) // FlagCopyConfigPost | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.CopyFeatureFlag(context.Background(), projKey, featureFlagKey).FlagCopyConfigPost(flagCopyConfigPost).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.CopyFeatureFlag``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CopyFeatureFlag`: FeatureFlag
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.CopyFeatureFlag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.
featureFlagKey string The feature flag's key. The key identifies the flag in your code.

Other Parameters

Other parameters are passed through a pointer to a apiCopyFeatureFlagRequest struct via the builder pattern

Name Type Description Notes

flagCopyConfigPost | FlagCopyConfigPost | |

Return type

FeatureFlag

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFeatureFlag

DeleteFeatureFlag(ctx, projKey, key).Execute()

Delete feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    key := "key_example" // string | The feature flag's key. The key identifies the flag in your code.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.DeleteFeatureFlag(context.Background(), projKey, key).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.DeleteFeatureFlag``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.
key string The feature flag's key. The key identifies the flag in your code.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteFeatureFlagRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetExpiringUserTargets

ExpiringUserTargetGetResponse GetExpiringUserTargets(ctx, projKey, envKey, flagKey).Execute()

Get expiring user targets for feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    envKey := "envKey_example" // string | The environment key.
    flagKey := "flagKey_example" // string | The feature flag key.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetExpiringUserTargets(context.Background(), projKey, envKey, flagKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetExpiringUserTargets``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetExpiringUserTargets`: ExpiringUserTargetGetResponse
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetExpiringUserTargets`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.
envKey string The environment key.
flagKey string The feature flag key.

Other Parameters

Other parameters are passed through a pointer to a apiGetExpiringUserTargetsRequest struct via the builder pattern

Name Type Description Notes

Return type

ExpiringUserTargetGetResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFeatureFlag

FeatureFlag GetFeatureFlag(ctx, projKey, key).Env(env).Execute()

Get feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key
    key := "key_example" // string | The feature flag key
    env := "env_example" // string | Filter configurations by environment (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetFeatureFlag(context.Background(), projKey, key).Env(env).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetFeatureFlag``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFeatureFlag`: FeatureFlag
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetFeatureFlag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key
key string The feature flag key

Other Parameters

Other parameters are passed through a pointer to a apiGetFeatureFlagRequest struct via the builder pattern

Name Type Description Notes

env | string | Filter configurations by environment |

Return type

FeatureFlag

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFeatureFlagStatus

FlagStatusRep GetFeatureFlagStatus(ctx, projKey, envKey, key).Execute()

Get feature flag status

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key
    envKey := "envKey_example" // string | The environment key
    key := "key_example" // string | The feature flag key

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetFeatureFlagStatus(context.Background(), projKey, envKey, key).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetFeatureFlagStatus``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFeatureFlagStatus`: FlagStatusRep
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetFeatureFlagStatus`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key
envKey string The environment key
key string The feature flag key

Other Parameters

Other parameters are passed through a pointer to a apiGetFeatureFlagStatusRequest struct via the builder pattern

Name Type Description Notes

Return type

FlagStatusRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFeatureFlagStatusAcrossEnvironments

FeatureFlagStatusAcrossEnvironments GetFeatureFlagStatusAcrossEnvironments(ctx, projKey, key).Env(env).Execute()

Get flag status across environments

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key
    key := "key_example" // string | The feature flag key
    env := "env_example" // string | Optional environment filter (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetFeatureFlagStatusAcrossEnvironments(context.Background(), projKey, key).Env(env).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetFeatureFlagStatusAcrossEnvironments``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFeatureFlagStatusAcrossEnvironments`: FeatureFlagStatusAcrossEnvironments
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetFeatureFlagStatusAcrossEnvironments`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key
key string The feature flag key

Other Parameters

Other parameters are passed through a pointer to a apiGetFeatureFlagStatusAcrossEnvironmentsRequest struct via the builder pattern

Name Type Description Notes

env | string | Optional environment filter |

Return type

FeatureFlagStatusAcrossEnvironments

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFeatureFlagStatuses

FeatureFlagStatuses GetFeatureFlagStatuses(ctx, projKey, envKey).Execute()

List feature flag statuses

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key
    envKey := "envKey_example" // string | Filter configurations by environment

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetFeatureFlagStatuses(context.Background(), projKey, envKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetFeatureFlagStatuses``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFeatureFlagStatuses`: FeatureFlagStatuses
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetFeatureFlagStatuses`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key
envKey string Filter configurations by environment

Other Parameters

Other parameters are passed through a pointer to a apiGetFeatureFlagStatusesRequest struct via the builder pattern

Name Type Description Notes

Return type

FeatureFlagStatuses

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFeatureFlags

FeatureFlags GetFeatureFlags(ctx, projKey).Env(env).Tag(tag).Limit(limit).Offset(offset).Archived(archived).Summary(summary).Filter(filter).Sort(sort).Execute()

List feature flags

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key
    env := "env_example" // string | Filter configurations by environment (optional)
    tag := "tag_example" // string | Filter feature flags by tag (optional)
    limit := int64(789) // int64 | The number of feature flags to return. Defaults to -1, which returns all flags (optional)
    offset := int64(789) // int64 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items (optional)
    archived := true // bool | A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned (optional)
    summary := true // bool | By default in API version >= 1, flags will _not_ include their list of prerequisites, targets or rules.  Set summary=0 to include these fields for each flag returned (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()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.GetFeatureFlags(context.Background(), projKey).Env(env).Tag(tag).Limit(limit).Offset(offset).Archived(archived).Summary(summary).Filter(filter).Sort(sort).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.GetFeatureFlags``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFeatureFlags`: FeatureFlags
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.GetFeatureFlags`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiGetFeatureFlagsRequest struct via the builder pattern

Name Type Description Notes

env | string | Filter configurations by environment | tag | string | Filter feature flags by tag | limit | int64 | The number of feature flags to return. Defaults to -1, which returns all flags | offset | int64 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next limit items | archived | bool | A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned | summary | bool | By default in API version >= 1, flags will not include their list of prerequisites, targets or rules. Set summary=0 to include these fields for each flag returned | 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 |

Return type

FeatureFlags

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchExpiringUserTargets

ExpiringUserTargetPatchResponse PatchExpiringUserTargets(ctx, projKey, envKey, flagKey).PatchWithComment(patchWithComment).Execute()

Update expiring user targets on feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    envKey := "envKey_example" // string | The environment key.
    flagKey := "flagKey_example" // string | The feature flag key.
    patchWithComment := *openapiclient.NewPatchWithComment([]openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/biscuits", interface{}(Chocolate Digestive))}) // PatchWithComment | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.PatchExpiringUserTargets(context.Background(), projKey, envKey, flagKey).PatchWithComment(patchWithComment).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.PatchExpiringUserTargets``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchExpiringUserTargets`: ExpiringUserTargetPatchResponse
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.PatchExpiringUserTargets`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.
envKey string The environment key.
flagKey string The feature flag key.

Other Parameters

Other parameters are passed through a pointer to a apiPatchExpiringUserTargetsRequest struct via the builder pattern

Name Type Description Notes

patchWithComment | PatchWithComment | |

Return type

ExpiringUserTargetPatchResponse

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchFeatureFlag

FeatureFlag PatchFeatureFlag(ctx, projKey, key).PatchWithComment(patchWithComment).Execute()

Update feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    key := "key_example" // string | The feature flag's key. The key identifies the flag in your code.
    patchWithComment := *openapiclient.NewPatchWithComment([]openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/biscuits", interface{}(Chocolate Digestive))}) // PatchWithComment | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.PatchFeatureFlag(context.Background(), projKey, key).PatchWithComment(patchWithComment).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.PatchFeatureFlag``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchFeatureFlag`: FeatureFlag
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.PatchFeatureFlag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.
key string The feature flag's key. The key identifies the flag in your code.

Other Parameters

Other parameters are passed through a pointer to a apiPatchFeatureFlagRequest struct via the builder pattern

Name Type Description Notes

patchWithComment | PatchWithComment | |

Return type

FeatureFlag

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostFeatureFlag

FeatureFlag PostFeatureFlag(ctx, projKey).FeatureFlagBody(featureFlagBody).Clone(clone).Execute()

Create a feature flag

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projKey := "projKey_example" // string | The project key.
    featureFlagBody := *openapiclient.NewFeatureFlagBody("Name_example", "Key_example") // FeatureFlagBody | 
    clone := "clone_example" // string | The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.FeatureFlagsApi.PostFeatureFlag(context.Background(), projKey).FeatureFlagBody(featureFlagBody).Clone(clone).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FeatureFlagsApi.PostFeatureFlag``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PostFeatureFlag`: FeatureFlag
    fmt.Fprintf(os.Stdout, "Response from `FeatureFlagsApi.PostFeatureFlag`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projKey string The project key.

Other Parameters

Other parameters are passed through a pointer to a apiPostFeatureFlagRequest struct via the builder pattern

Name Type Description Notes

featureFlagBody | FeatureFlagBody | | clone | string | The key of the feature flag to be cloned. The key identifies the flag in your code. For example, setting `clone=flagKey` copies the full targeting configuration for all environments, including `on/off` state, from the original flag to the new flag. |

Return type

FeatureFlag

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]