Class: LaunchDarklyApi::InsightsDeploymentsBetaApi

Inherits:
Object
  • Object
show all
Defined in:
lib/launchdarkly_api/api/insights_deployments_beta_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InsightsDeploymentsBetaApi

Returns a new instance of InsightsDeploymentsBetaApi.



19
20
21
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_deployment_event(post_deployment_event_input, opts = {}) ⇒ nil

Create deployment event Create deployment event

Parameters:

Returns:

  • (nil)


27
28
29
30
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 27

def create_deployment_event(post_deployment_event_input, opts = {})
  create_deployment_event_with_http_info(post_deployment_event_input, opts)
  nil
end

#create_deployment_event_with_http_info(post_deployment_event_input, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create deployment event Create deployment event

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 37

def create_deployment_event_with_http_info(post_deployment_event_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsDeploymentsBetaApi.create_deployment_event ...'
  end
  # verify the required parameter 'post_deployment_event_input' is set
  if @api_client.config.client_side_validation && post_deployment_event_input.nil?
    fail ArgumentError, "Missing the required parameter 'post_deployment_event_input' when calling InsightsDeploymentsBetaApi.create_deployment_event"
  end
  # resource path
  local_var_path = '/api/v2/engineering-insights/deployment-events'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_deployment_event_input)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"InsightsDeploymentsBetaApi.create_deployment_event",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsDeploymentsBetaApi#create_deployment_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployment(deployment_id, opts = {}) ⇒ DeploymentRep

Get deployment Get a deployment by ID. The deployment ID is returned as part of the [List deployments](launchdarkly.com/docs/api/insights-deployments-beta/get-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.

Parameters:

  • deployment_id (String)

    The deployment ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :expand (String)

    Expand properties in response. Options: &#x60;pullRequests&#x60;, &#x60;flagReferences&#x60;

Returns:



96
97
98
99
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 96

def get_deployment(deployment_id, opts = {})
  data, _status_code, _headers = get_deployment_with_http_info(deployment_id, opts)
  data
end

#get_deployment_with_http_info(deployment_id, opts = {}) ⇒ Array<(DeploymentRep, Integer, Hash)>

Get deployment Get a deployment by ID. The deployment ID is returned as part of the [List deployments](launchdarkly.com/docs/api/insights-deployments-beta/get-deployments) response. It is the &#x60;id&#x60; field of each element in the &#x60;items&#x60; array. ### Expanding the deployment response LaunchDarkly supports expanding the deployment response to include additional fields. To expand the response, append the &#x60;expand&#x60; query parameter and include the following: * &#x60;pullRequests&#x60; includes details on all of the pull requests associated with each deployment * &#x60;flagReferences&#x60; includes details on all of the references to flags in each deployment For example, use &#x60;?expand&#x3D;pullRequests&#x60; to include the &#x60;pullRequests&#x60; field in the response. By default, this field is not included in the response.

Parameters:

  • deployment_id (String)

    The deployment ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :expand (String)

    Expand properties in response. Options: &#x60;pullRequests&#x60;, &#x60;flagReferences&#x60;

Returns:

  • (Array<(DeploymentRep, Integer, Hash)>)

    DeploymentRep data, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 107

def get_deployment_with_http_info(deployment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsDeploymentsBetaApi.get_deployment ...'
  end
  # verify the required parameter 'deployment_id' is set
  if @api_client.config.client_side_validation && deployment_id.nil?
    fail ArgumentError, "Missing the required parameter 'deployment_id' when calling InsightsDeploymentsBetaApi.get_deployment"
  end
  # resource path
  local_var_path = '/api/v2/engineering-insights/deployments/{deploymentID}'.sub('{' + 'deploymentID' + '}', CGI.escape(deployment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"InsightsDeploymentsBetaApi.get_deployment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsDeploymentsBetaApi#get_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_deployments(project_key, environment_key, opts = {}) ⇒ DeploymentCollectionRep

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.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :application_key (String)

    Comma separated list of application keys

  • :limit (Integer)

    The number of deployments to return. Default is 20. Maximum allowed is 100.

  • :expand (String)

    Expand properties in response. Options: &#x60;pullRequests&#x60;, &#x60;flagReferences&#x60;

  • :from (Integer)

    Unix timestamp in milliseconds. Default value is 7 days ago.

  • :to (Integer)

    Unix timestamp in milliseconds. Default value is now.

  • :after (String)

    Identifier used for pagination

  • :before (String)

    Identifier used for pagination

  • :kind (String)

    The deployment kind

  • :status (String)

    The deployment status

Returns:



171
172
173
174
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 171

def get_deployments(project_key, environment_key, opts = {})
  data, _status_code, _headers = get_deployments_with_http_info(project_key, environment_key, opts)
  data
end

#get_deployments_with_http_info(project_key, environment_key, opts = {}) ⇒ Array<(DeploymentCollectionRep, Integer, Hash)>

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 &#x60;expand&#x60; query parameter and include the following: * &#x60;pullRequests&#x60; includes details on all of the pull requests associated with each deployment * &#x60;flagReferences&#x60; includes details on all of the references to flags in each deployment For example, use &#x60;?expand&#x3D;pullRequests&#x60; to include the &#x60;pullRequests&#x60; field in the response. By default, this field is not included in the response.

Parameters:

  • project_key (String)

    The project key

  • environment_key (String)

    The environment key

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :application_key (String)

    Comma separated list of application keys

  • :limit (Integer)

    The number of deployments to return. Default is 20. Maximum allowed is 100.

  • :expand (String)

    Expand properties in response. Options: &#x60;pullRequests&#x60;, &#x60;flagReferences&#x60;

  • :from (Integer)

    Unix timestamp in milliseconds. Default value is 7 days ago.

  • :to (Integer)

    Unix timestamp in milliseconds. Default value is now.

  • :after (String)

    Identifier used for pagination

  • :before (String)

    Identifier used for pagination

  • :kind (String)

    The deployment kind

  • :status (String)

    The deployment status

Returns:

  • (Array<(DeploymentCollectionRep, Integer, Hash)>)

    DeploymentCollectionRep data, response status code and response headers



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 191

def get_deployments_with_http_info(project_key, environment_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsDeploymentsBetaApi.get_deployments ...'
  end
  # verify the required parameter 'project_key' is set
  if @api_client.config.client_side_validation && project_key.nil?
    fail ArgumentError, "Missing the required parameter 'project_key' when calling InsightsDeploymentsBetaApi.get_deployments"
  end
  # verify the required parameter 'environment_key' is set
  if @api_client.config.client_side_validation && environment_key.nil?
    fail ArgumentError, "Missing the required parameter 'environment_key' when calling InsightsDeploymentsBetaApi.get_deployments"
  end
  # resource path
  local_var_path = '/api/v2/engineering-insights/deployments'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectKey'] = project_key
  query_params[:'environmentKey'] = environment_key
  query_params[:'applicationKey'] = opts[:'application_key'] if !opts[:'application_key'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentCollectionRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"InsightsDeploymentsBetaApi.get_deployments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsDeploymentsBetaApi#get_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_deployment(deployment_id, patch_operation, opts = {}) ⇒ DeploymentRep

Update deployment Update a deployment by ID. Updating a deployment uses a [JSON patch](datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](launchdarkly.com/docs/api#updates).<br/><br/>The deployment ID is returned as part of the [List deployments](launchdarkly.com/docs/api/insights-deployments-beta/get-deployments) response. It is the ‘id` field of each element in the `items` array.

Parameters:

  • deployment_id (String)

    The deployment ID

  • patch_operation (Array<PatchOperation>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



260
261
262
263
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 260

def update_deployment(deployment_id, patch_operation, opts = {})
  data, _status_code, _headers = update_deployment_with_http_info(deployment_id, patch_operation, opts)
  data
end

#update_deployment_with_http_info(deployment_id, patch_operation, opts = {}) ⇒ Array<(DeploymentRep, Integer, Hash)>

Update deployment Update a deployment by ID. Updating a deployment uses a [JSON patch](datatracker.ietf.org/doc/html/rfc6902) representation of the desired changes. To learn more, read [Updates](launchdarkly.com/docs/api#updates).&lt;br/&gt;&lt;br/&gt;The deployment ID is returned as part of the [List deployments](launchdarkly.com/docs/api/insights-deployments-beta/get-deployments) response. It is the &#x60;id&#x60; field of each element in the &#x60;items&#x60; array.

Parameters:

  • deployment_id (String)

    The deployment ID

  • patch_operation (Array<PatchOperation>)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeploymentRep, Integer, Hash)>)

    DeploymentRep data, response status code and response headers



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/launchdarkly_api/api/insights_deployments_beta_api.rb', line 271

def update_deployment_with_http_info(deployment_id, patch_operation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InsightsDeploymentsBetaApi.update_deployment ...'
  end
  # verify the required parameter 'deployment_id' is set
  if @api_client.config.client_side_validation && deployment_id.nil?
    fail ArgumentError, "Missing the required parameter 'deployment_id' when calling InsightsDeploymentsBetaApi.update_deployment"
  end
  # verify the required parameter 'patch_operation' is set
  if @api_client.config.client_side_validation && patch_operation.nil?
    fail ArgumentError, "Missing the required parameter 'patch_operation' when calling InsightsDeploymentsBetaApi.update_deployment"
  end
  # resource path
  local_var_path = '/api/v2/engineering-insights/deployments/{deploymentID}'.sub('{' + 'deploymentID' + '}', CGI.escape(deployment_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_operation)

  # return_type
  return_type = opts[:debug_return_type] || 'DeploymentRep'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"InsightsDeploymentsBetaApi.update_deployment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InsightsDeploymentsBetaApi#update_deployment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end