Skip to content

Latest commit

 

History

History
322 lines (235 loc) · 11.9 KB

InsightsDeploymentsBetaApi.md

File metadata and controls

322 lines (235 loc) · 11.9 KB

LaunchDarklyApi::InsightsDeploymentsBetaApi

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

Method HTTP request Description
create_deployment_event POST /api/v2/engineering-insights/deployment-events Create deployment event
get_deployment GET /api/v2/engineering-insights/deployments/{deploymentID} Get deployment
get_deployments GET /api/v2/engineering-insights/deployments List deployments
update_deployment PATCH /api/v2/engineering-insights/deployments/{deploymentID} Update deployment

create_deployment_event

create_deployment_event(post_deployment_event_input)

Create deployment event

Create deployment event

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::InsightsDeploymentsBetaApi.new
post_deployment_event_input = LaunchDarklyApi::PostDeploymentEventInput.new({project_key: 'default', environment_key: 'production', application_key: 'billing-service', version: 'a90a8a2', event_type: 'started'}) # PostDeploymentEventInput | 

begin
  # Create deployment event
  api_instance.create_deployment_event(post_deployment_event_input)
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->create_deployment_event: #{e}"
end

Using the create_deployment_event_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)> create_deployment_event_with_http_info(post_deployment_event_input)

begin
  # Create deployment event
  data, status_code, headers = api_instance.create_deployment_event_with_http_info(post_deployment_event_input)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->create_deployment_event_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
post_deployment_event_input PostDeploymentEventInput

Return type

nil (empty response body)

Authorization

ApiKey

HTTP request headers

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

get_deployment

get_deployment(deployment_id, opts)

Get deployment

Get a deployment by ID. The deployment ID is returned as part of the List deployments response. It is the id field of each element in the items array. ### Expanding the deployment response LaunchDarkly supports expanding the deployment response to include additional fields. To expand the response, append the expand query parameter and include the following: * pullRequests includes details on all of the pull requests associated with each deployment * flagReferences includes details on all of the references to flags in each deployment For example, use ?expand=pullRequests to include the pullRequests field in the response. By default, this field is not included in the response.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::InsightsDeploymentsBetaApi.new
deployment_id = 'deployment_id_example' # String | The deployment ID
opts = {
  expand: 'expand_example' # String | Expand properties in response. Options: `pullRequests`, `flagReferences`
}

begin
  # Get deployment
  result = api_instance.get_deployment(deployment_id, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->get_deployment: #{e}"
end

Using the get_deployment_with_http_info variant

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

<Array(, Integer, Hash)> get_deployment_with_http_info(deployment_id, opts)

begin
  # Get deployment
  data, status_code, headers = api_instance.get_deployment_with_http_info(deployment_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeploymentRep>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->get_deployment_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
deployment_id String The deployment ID
expand String Expand properties in response. Options: `pullRequests`, `flagReferences` [optional]

Return type

DeploymentRep

Authorization

ApiKey

HTTP request headers

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

get_deployments

get_deployments(project_key, environment_key, opts)

List deployments

Get a list of deployments ### Expanding the deployment collection response LaunchDarkly supports expanding the deployment collection response to include additional fields. To expand the response, append the expand query parameter and include the following: * pullRequests includes details on all of the pull requests associated with each deployment * flagReferences includes details on all of the references to flags in each deployment For example, use ?expand=pullRequests to include the pullRequests field in the response. By default, this field is not included in the response.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::InsightsDeploymentsBetaApi.new
project_key = 'project_key_example' # String | The project key
environment_key = 'environment_key_example' # String | The environment key
opts = {
  application_key: 'application_key_example', # String | Comma separated list of application keys
  limit: 789, # Integer | The number of deployments to return. Default is 20. Maximum allowed is 100.
  expand: 'expand_example', # String | Expand properties in response. Options: `pullRequests`, `flagReferences`
  from: 789, # Integer | Unix timestamp in milliseconds. Default value is 7 days ago.
  to: 789, # Integer | Unix timestamp in milliseconds. Default value is now.
  after: 'after_example', # String | Identifier used for pagination
  before: 'before_example', # String | Identifier used for pagination
  kind: 'kind_example', # String | The deployment kind
  status: 'status_example' # String | The deployment status
}

begin
  # List deployments
  result = api_instance.get_deployments(project_key, environment_key, opts)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->get_deployments: #{e}"
end

Using the get_deployments_with_http_info variant

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

<Array(, Integer, Hash)> get_deployments_with_http_info(project_key, environment_key, opts)

begin
  # List deployments
  data, status_code, headers = api_instance.get_deployments_with_http_info(project_key, environment_key, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeploymentCollectionRep>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->get_deployments_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
project_key String The project key
environment_key String The environment key
application_key String Comma separated list of application keys [optional]
limit Integer The number of deployments to return. Default is 20. Maximum allowed is 100. [optional]
expand String Expand properties in response. Options: `pullRequests`, `flagReferences` [optional]
from Integer Unix timestamp in milliseconds. Default value is 7 days ago. [optional]
to Integer Unix timestamp in milliseconds. Default value is now. [optional]
after String Identifier used for pagination [optional]
before String Identifier used for pagination [optional]
kind String The deployment kind [optional]
status String The deployment status [optional]

Return type

DeploymentCollectionRep

Authorization

ApiKey

HTTP request headers

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

update_deployment

update_deployment(deployment_id, patch_operation)

Update deployment

Update a deployment by ID. Updating a deployment uses a JSON patch representation of the desired changes. To learn more, read Updates.

The deployment ID is returned as part of the List deployments response. It is the id field of each element in the items array.

Examples

require 'time'
require 'launchdarkly_api'
# setup authorization
LaunchDarklyApi.configure do |config|
  # Configure API key authorization: ApiKey
  config.api_key['ApiKey'] = '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['ApiKey'] = 'Bearer'
end

api_instance = LaunchDarklyApi::InsightsDeploymentsBetaApi.new
deployment_id = 'deployment_id_example' # String | The deployment ID
patch_operation = [LaunchDarklyApi::PatchOperation.new({op: 'replace', path: '/exampleField'})] # Array<PatchOperation> | 

begin
  # Update deployment
  result = api_instance.update_deployment(deployment_id, patch_operation)
  p result
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->update_deployment: #{e}"
end

Using the update_deployment_with_http_info variant

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

<Array(, Integer, Hash)> update_deployment_with_http_info(deployment_id, patch_operation)

begin
  # Update deployment
  data, status_code, headers = api_instance.update_deployment_with_http_info(deployment_id, patch_operation)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeploymentRep>
rescue LaunchDarklyApi::ApiError => e
  puts "Error when calling InsightsDeploymentsBetaApi->update_deployment_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
deployment_id String The deployment ID
patch_operation Array<PatchOperation>

Return type

DeploymentRep

Authorization

ApiKey

HTTP request headers

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