Skip to content

Latest commit

 

History

History
324 lines (237 loc) · 11.1 KB

File metadata and controls

324 lines (237 loc) · 11.1 KB

LaunchDarklyApi::SDKKeysBetaApi

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

Method HTTP request Description
delete_sdk_key_by_key DELETE /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Delete SDK key
get_sdk_key_by_key GET /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Get SDK key
patch_sdk_key_by_key PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys/{sdkKeyKey} Update SDK key
post_sdk_key POST /api/v2/projects/{projectKey}/environments/{environmentKey}/sdk-keys Create SDK key

delete_sdk_key_by_key

delete_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key)

Delete SDK key

Delete a specific SDK key by its key.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::SDKKeysBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
environment_key = 'production' # String | 
sdk_key_key = 'my-sdk-key' # String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

begin
  # Delete SDK key
  api_instance.delete_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key)
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->delete_sdk_key_by_key: #{e}"
end

Using the delete_sdk_key_by_key_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

<Array(nil, Integer, Hash)> delete_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key)

begin
  # Delete SDK key
  data, status_code, headers = api_instance.delete_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->delete_sdk_key_by_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
environment_key String
sdk_key_key String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

Return type

nil (empty response body)

Authorization

ApiKey

HTTP request headers

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

get_sdk_key_by_key

get_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key)

Get SDK key

Get a specific SDK key by its key.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::SDKKeysBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
environment_key = 'production' # String | 
sdk_key_key = 'my-sdk-key' # String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

begin
  # Get SDK key
  result = api_instance.get_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->get_sdk_key_by_key: #{e}"
end

Using the get_sdk_key_by_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key)

begin
  # Get SDK key
  data, status_code, headers = api_instance.get_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SdkKey>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->get_sdk_key_by_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
environment_key String
sdk_key_key String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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

patch_sdk_key_by_key

patch_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts)

Update SDK key

Update a an existing SDK key by its identifying key.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::SDKKeysBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
environment_key = 'production' # String | 
sdk_key_key = 'my-sdk-key' # String | The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
sdk_key_patch = LaunchDarklyApi::SdkKeyPatch.new # SdkKeyPatch | An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.
opts = {
  version: 56 # Integer | The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches.
}

begin
  # Update SDK key
  result = api_instance.patch_sdk_key_by_key(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->patch_sdk_key_by_key: #{e}"
end

Using the patch_sdk_key_by_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> patch_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts)

begin
  # Update SDK key
  data, status_code, headers = api_instance.patch_sdk_key_by_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_key, sdk_key_patch, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SdkKey>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->patch_sdk_key_by_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
environment_key String
sdk_key_key String The user-defined identifying key of the SDK key. This is used solely to identify an SDK key and is distinct from the value field, which is the actual SDK key value.
sdk_key_patch SdkKeyPatch An array of patches for updating an existing SDK key. The following fields are supported: `name`, `description`, `expiry`.
version Integer The version of the SDK key for optimistic locking. If provided, the update will only succeed if the current version matches. [optional]

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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

post_sdk_key

post_sdk_key(ld_api_version, project_key, environment_key, sdk_key_post)

Create SDK key

Create a new server-side or mobile SDK key.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = LaunchDarklyApi::SDKKeysBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
environment_key = 'production' # String | 
sdk_key_post = LaunchDarklyApi::SdkKeyPost.new({key: 'key_example', name: 'name_example'}) # SdkKeyPost | Parameters for creating a new SDK key

begin
  # Create SDK key
  result = api_instance.post_sdk_key(ld_api_version, project_key, environment_key, sdk_key_post)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->post_sdk_key: #{e}"
end

Using the post_sdk_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> post_sdk_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_post)

begin
  # Create SDK key
  data, status_code, headers = api_instance.post_sdk_key_with_http_info(ld_api_version, project_key, environment_key, sdk_key_post)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SdkKey>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling SDKKeysBetaApi->post_sdk_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
environment_key String
sdk_key_post SdkKeyPost Parameters for creating a new SDK key

Return type

SdkKey

Authorization

ApiKey

HTTP request headers

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