Skip to content

Latest commit

 

History

History
197 lines (125 loc) · 9.45 KB

EnvironmentsApi.md

File metadata and controls

197 lines (125 loc) · 9.45 KB

\EnvironmentsApi

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

Method HTTP request Description
DeleteEnvironment Delete /projects/{projectKey}/environments/{environmentKey} Delete an environment in a specific project.
GetEnvironment Get /projects/{projectKey}/environments/{environmentKey} Get an environment given a project and key.
PatchEnvironment Patch /projects/{projectKey}/environments/{environmentKey} Modify an environment by ID. If you try to patch the environment by setting both required and requiredApprovalTags, it will result in an error. Users can specify either required approvals for all flags in an environment or those with specific tags, but not both. Only customers on an Enterprise plan can require approval for flag updates with either mechanism.
PostEnvironment Post /projects/{projectKey}/environments Create a new environment in a specified project with a given name, key, and swatch color.
ResetEnvironmentMobileKey Post /projects/{projectKey}/environments/{environmentKey}/mobileKey Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.
ResetEnvironmentSDKKey Post /projects/{projectKey}/environments/{environmentKey}/apiKey Reset an environment's SDK key with an optional expiry time for the old key.

DeleteEnvironment

DeleteEnvironment(ctx, projectKey, environmentKey) Delete an environment in a specific project.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentKey string The environment key, used to tie together flag configuration and users under one environment so they can be managed together.

Return type

(empty response body)

Authorization

Token

HTTP request headers

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

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

GetEnvironment

Environment GetEnvironment(ctx, projectKey, environmentKey) Get an environment given a project and key.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentKey string The environment key, used to tie together flag configuration and users under one environment so they can be managed together.

Return type

Environment

Authorization

Token

HTTP request headers

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

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

PatchEnvironment

Environment PatchEnvironment(ctx, projectKey, environmentKey, patchDelta) Modify an environment by ID. If you try to patch the environment by setting both required and requiredApprovalTags, it will result in an error. Users can specify either required approvals for all flags in an environment or those with specific tags, but not both. Only customers on an Enterprise plan can require approval for flag updates with either mechanism.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentKey string The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
patchDelta []PatchOperation Requires a JSON Patch representation of the desired changes to the project. 'http://jsonpatch.com/'

Return type

Environment

Authorization

Token

HTTP request headers

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

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

PostEnvironment

Environment PostEnvironment(ctx, projectKey, environmentBody) Create a new environment in a specified project with a given name, key, and swatch color.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentBody EnvironmentPost New environment.

Return type

Environment

Authorization

Token

HTTP request headers

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

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

ResetEnvironmentMobileKey

Environment ResetEnvironmentMobileKey(ctx, projectKey, environmentKey, optional) Reset an environment's mobile key. The optional expiry for the old key is deprecated for this endpoint, so the old key will always expire immediately.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentKey string The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
optional *EnvironmentsApiResetEnvironmentMobileKeyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a EnvironmentsApiResetEnvironmentMobileKeyOpts struct

Name Type Description Notes

expiry | optional.Int64| The expiry parameter is deprecated for this endpoint, so the old mobile key will always expire immediately. This parameter will be removed in an upcoming major API client version. |

Return type

Environment

Authorization

Token

HTTP request headers

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

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

ResetEnvironmentSDKKey

Environment ResetEnvironmentSDKKey(ctx, projectKey, environmentKey, optional) Reset an environment's SDK key with an optional expiry time for the old key.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key, used to tie the flags together under one project so they can be managed together.
environmentKey string The environment key, used to tie together flag configuration and users under one environment so they can be managed together.
optional *EnvironmentsApiResetEnvironmentSDKKeyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a EnvironmentsApiResetEnvironmentSDKKeyOpts struct

Name Type Description Notes

expiry | optional.Int64| An expiration time for the old environment SDK key, expressed as a Unix epoch time in milliseconds. By default, the key will expire immediately. |

Return type

Environment

Authorization

Token

HTTP request headers

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

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