Skip to content

Latest commit

 

History

History
748 lines (556 loc) · 27.2 KB

File metadata and controls

748 lines (556 loc) · 27.2 KB

LaunchDarklyApi::ViewsBetaApi

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

Method HTTP request Description
create_view POST /api/v2/projects/{projectKey}/views Create view
delete_view DELETE /api/v2/projects/{projectKey}/views/{viewKey} Delete view
get_linked_resources GET /api/v2/projects/{projectKey}/views/{viewKey}/linked/{resourceType} Get linked resources
get_linked_views GET /api/v2/projects/{projectKey}/view-associations/{resourceType}/{resourceKey} Get linked views for a given resource
get_view GET /api/v2/projects/{projectKey}/views/{viewKey} Get view
get_views GET /api/v2/projects/{projectKey}/views List views
link_resource POST /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType} Link resource
unlink_resource DELETE /api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType} Unlink resource
update_view PATCH /api/v2/projects/{projectKey}/views/{viewKey} Update view

create_view

create_view(ld_api_version, project_key, view_post)

Create view

Create a new view in the given project.

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_post = LaunchDarklyApi::ViewPost.new({key: 'key_example', name: 'name_example'}) # ViewPost | View object to create

begin
  # Create view
  result = api_instance.create_view(ld_api_version, project_key, view_post)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->create_view: #{e}"
end

Using the create_view_with_http_info variant

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

<Array(, Integer, Hash)> create_view_with_http_info(ld_api_version, project_key, view_post)

begin
  # Create view
  data, status_code, headers = api_instance.create_view_with_http_info(ld_api_version, project_key, view_post)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <View>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->create_view_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_post ViewPost View object to create

Return type

View

Authorization

ApiKey

HTTP request headers

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

delete_view

delete_view(ld_api_version, project_key, view_key)

Delete view

Delete a specific view 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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 

begin
  # Delete view
  api_instance.delete_view(ld_api_version, project_key, view_key)
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->delete_view: #{e}"
end

Using the delete_view_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_view_with_http_info(ld_api_version, project_key, view_key)

begin
  # Delete view
  data, status_code, headers = api_instance.delete_view_with_http_info(ld_api_version, project_key, view_key)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->delete_view_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String

Return type

nil (empty response body)

Authorization

ApiKey

HTTP request headers

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

get_linked_resources

get_linked_resources(ld_api_version, project_key, view_key, resource_type, opts)

Get linked resources

Get a list of all linked resources for a given view.

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 
resource_type = 'flags' # String | 
opts = {
  limit: 56, # Integer | The number of views to return.
  offset: 56, # Integer | 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 items in the list, up to the query `limit`.
  sort: 'linkedAt', # String | Field to sort by. Default field is `linkedAt`, default order is ascending.
  query: 'query_example', # String | Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name.
  filter: 'filter_example', # String | Optional resource filter expression for linked resources. - Supported for `flags` and `segments` resource types. - Uses the same syntax as link/unlink and list endpoints. - For `segments`, `environmentId` is required when `filter` is provided. 
  expand: ['maintainer'] # Array<String> | A comma-separated list of fields to expand.
}

begin
  # Get linked resources
  result = api_instance.get_linked_resources(ld_api_version, project_key, view_key, resource_type, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_linked_resources: #{e}"
end

Using the get_linked_resources_with_http_info variant

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

<Array(, Integer, Hash)> get_linked_resources_with_http_info(ld_api_version, project_key, view_key, resource_type, opts)

begin
  # Get linked resources
  data, status_code, headers = api_instance.get_linked_resources_with_http_info(ld_api_version, project_key, view_key, resource_type, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ViewLinkedResources>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_linked_resources_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String
resource_type String
limit Integer The number of views to return. [optional]
offset Integer 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 items in the list, up to the query `limit`. [optional]
sort String Field to sort by. Default field is `linkedAt`, default order is ascending. [optional][default to 'linkedAt']
query String Case-insensitive search query for linked resources. Matches resource key and, when expanded, resource name. [optional]
filter String Optional resource filter expression for linked resources. - Supported for `flags` and `segments` resource types. - Uses the same syntax as link/unlink and list endpoints. - For `segments`, `environmentId` is required when `filter` is provided. [optional]
expand Array<String> A comma-separated list of fields to expand. [optional]

Return type

ViewLinkedResources

Authorization

ApiKey

HTTP request headers

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

get_linked_views

get_linked_views(ld_api_version, project_key, resource_type, resource_key, opts)

Get linked views for a given resource

Get a list of all linked views for a resource. Flags are identified by key. Segments are identified by segment ID.

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
resource_type = 'flags' # String | 
resource_key = 'my-flag' # String | 
opts = {
  environment_id: '6890ff25c3e3830ba1a352e4', # String | Environment ID. Required when resourceType is 'segments'
  limit: 56, # Integer | The number of views to return.
  offset: 56 # Integer | 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 items in the list, up to the query `limit`.
}

begin
  # Get linked views for a given resource
  result = api_instance.get_linked_views(ld_api_version, project_key, resource_type, resource_key, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_linked_views: #{e}"
end

Using the get_linked_views_with_http_info variant

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

<Array(, Integer, Hash)> get_linked_views_with_http_info(ld_api_version, project_key, resource_type, resource_key, opts)

begin
  # Get linked views for a given resource
  data, status_code, headers = api_instance.get_linked_views_with_http_info(ld_api_version, project_key, resource_type, resource_key, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Views>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_linked_views_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
resource_type String
resource_key String
environment_id String Environment ID. Required when resourceType is 'segments' [optional]
limit Integer The number of views to return. [optional]
offset Integer 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 items in the list, up to the query `limit`. [optional]

Return type

Views

Authorization

ApiKey

HTTP request headers

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

get_view

get_view(ld_api_version, project_key, view_key, opts)

Get view

Retrieve a specific view 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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 
opts = {
  sort: 'key', # String | A sort to apply to the list of views.
  limit: 56, # Integer | The number of views to return.
  offset: 56, # Integer | 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 items in the list, up to the query `limit`.
  filter: 'filter_example', # String | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals).
  expand: ['allFlags'] # Array<String> | A comma-separated list of fields to expand.
}

begin
  # Get view
  result = api_instance.get_view(ld_api_version, project_key, view_key, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_view: #{e}"
end

Using the get_view_with_http_info variant

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

<Array(, Integer, Hash)> get_view_with_http_info(ld_api_version, project_key, view_key, opts)

begin
  # Get view
  data, status_code, headers = api_instance.get_view_with_http_info(ld_api_version, project_key, view_key, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <View>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_view_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String
sort String A sort to apply to the list of views. [optional]
limit Integer The number of views to return. [optional]
offset Integer 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 items in the list, up to the query `limit`. [optional]
filter String A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). [optional]
expand Array<String> A comma-separated list of fields to expand. [optional]

Return type

View

Authorization

ApiKey

HTTP request headers

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

get_views

get_views(ld_api_version, project_key, opts)

List views

Get a list of all views in the given project.

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
opts = {
  sort: 'key', # String | A sort to apply to the list of views.
  limit: 56, # Integer | The number of views to return.
  offset: 56, # Integer | 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 items in the list, up to the query `limit`.
  filter: 'filter_example', # String | A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals).
  expand: ['flagsSummary'] # Array<String> | A comma-separated list of fields to expand.
}

begin
  # List views
  result = api_instance.get_views(ld_api_version, project_key, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_views: #{e}"
end

Using the get_views_with_http_info variant

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

<Array(, Integer, Hash)> get_views_with_http_info(ld_api_version, project_key, opts)

begin
  # List views
  data, status_code, headers = api_instance.get_views_with_http_info(ld_api_version, project_key, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Views>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->get_views_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
sort String A sort to apply to the list of views. [optional]
limit Integer The number of views to return. [optional]
offset Integer 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 items in the list, up to the query `limit`. [optional]
filter String A filter to apply to the list of views. Supports the following fields and operators: `name` (equals, notEquals, startsWith, contains, anyOf), `key` (equals, notEquals, startsWith, contains, anyOf), `tag` (equals, anyOf), `maintainerId` (equals, anyOf), `isPayloadView` (equals). [optional]
expand Array<String> A comma-separated list of fields to expand. [optional]

Return type

Views

Authorization

ApiKey

HTTP request headers

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

link_resource

link_resource(ld_api_version, project_key, view_key, resource_type, view_link_request)

Link resource

Link one or multiple resources to a view by keys, filters, or both: - Link flags using flag keys or filters (maintainerId, maintainerTeamKey, tags, state, query) - Link segments using segment IDs or filters (tags, query, unbounded) When both keys and filters are provided, resources matching either condition are linked (union).

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 
resource_type = 'flags' # String | 
view_link_request = LaunchDarklyApi::ViewLinkRequestFilter.new({filter: 'maintainerId:507f1f77bcf86cd799439011,tags:backend+beta'}) # ViewLinkRequest | Resources to link to the view. You can provide explicit keys/IDs, filters, or both. - Flags: identified by key or filtered by maintainerId, maintainerTeamKey, tags, state, query - Segments: identified by segment ID or filtered by tags, query, unbounded 

begin
  # Link resource
  result = api_instance.link_resource(ld_api_version, project_key, view_key, resource_type, view_link_request)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->link_resource: #{e}"
end

Using the link_resource_with_http_info variant

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

<Array(, Integer, Hash)> link_resource_with_http_info(ld_api_version, project_key, view_key, resource_type, view_link_request)

begin
  # Link resource
  data, status_code, headers = api_instance.link_resource_with_http_info(ld_api_version, project_key, view_key, resource_type, view_link_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <LinkResourceSuccessResponse>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->link_resource_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String
resource_type String
view_link_request ViewLinkRequest Resources to link to the view. You can provide explicit keys/IDs, filters, or both. - Flags: identified by key or filtered by maintainerId, maintainerTeamKey, tags, state, query - Segments: identified by segment ID or filtered by tags, query, unbounded

Return type

LinkResourceSuccessResponse

Authorization

ApiKey

HTTP request headers

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

unlink_resource

unlink_resource(ld_api_version, project_key, view_key, resource_type, view_link_request)

Unlink resource

Unlink one or multiple resources from a view: - Unlink flags using flag keys - Unlink segments using segment IDs

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 
resource_type = 'flags' # String | 
view_link_request = LaunchDarklyApi::ViewLinkRequestFilter.new({filter: 'maintainerId:507f1f77bcf86cd799439011,tags:backend+beta'}) # ViewLinkRequest | The resource to link to the view. Flags are identified by key. Segments are identified by segment ID.

begin
  # Unlink resource
  result = api_instance.unlink_resource(ld_api_version, project_key, view_key, resource_type, view_link_request)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->unlink_resource: #{e}"
end

Using the unlink_resource_with_http_info variant

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

<Array(, Integer, Hash)> unlink_resource_with_http_info(ld_api_version, project_key, view_key, resource_type, view_link_request)

begin
  # Unlink resource
  data, status_code, headers = api_instance.unlink_resource_with_http_info(ld_api_version, project_key, view_key, resource_type, view_link_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <UnlinkResourceSuccessResponse>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->unlink_resource_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String
resource_type String
view_link_request ViewLinkRequest The resource to link to the view. Flags are identified by key. Segments are identified by segment ID.

Return type

UnlinkResourceSuccessResponse

Authorization

ApiKey

HTTP request headers

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

update_view

update_view(ld_api_version, project_key, view_key, view_patch)

Update view

Edit an existing view. The request body must be a JSON object of the fields to update. The values you include replace the existing values for the fields. Here's an example: { \"description\": \"Example updated description\", \"tags\": [\"new-tag\"] }

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::ViewsBetaApi.new
ld_api_version = 'beta' # String | Version of the endpoint.
project_key = 'default' # String | 
view_key = 'my-view' # String | 
view_patch = LaunchDarklyApi::ViewPatch.new # ViewPatch | A JSON representation of the view including only the fields to update.

begin
  # Update view
  result = api_instance.update_view(ld_api_version, project_key, view_key, view_patch)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->update_view: #{e}"
end

Using the update_view_with_http_info variant

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

<Array(, Integer, Hash)> update_view_with_http_info(ld_api_version, project_key, view_key, view_patch)

begin
  # Update view
  data, status_code, headers = api_instance.update_view_with_http_info(ld_api_version, project_key, view_key, view_patch)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <View>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling ViewsBetaApi->update_view_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
ld_api_version String Version of the endpoint.
project_key String
view_key String
view_patch ViewPatch A JSON representation of the view including only the fields to update.

Return type

View

Authorization

ApiKey

HTTP request headers

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