Class: VSphereAutomation::Content::LibraryItemUpdateSessionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vsphere-automation-content/api/library_item_update_session_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LibraryItemUpdateSessionApi

Returns a new instance of LibraryItemUpdateSessionApi.



16
17
18
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 16

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#cancel(update_session_id, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil

Cancels the update session and sets its state to UpdateSessionModel.State#CANCELED. This operation will free up any temporary resources currently associated with the session. <p> This operation is not allowed if the session has been already completed. <p> Cancelling an update session will cancel any in progress transfers (either uploaded by the client or pulled by the server). Any content that has been already received will be scheduled for deletion.

Parameters:

  • update_session_id

    Identifier of the update session that should be canceled.

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

    the optional parameters

Returns:



23
24
25
26
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 23

def cancel(update_session_id, opts = {})
  cancel_with_http_info(update_session_id, opts)
  nil
end

#cancel_with_http_info(update_session_id, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Cancels the update session and sets its state to UpdateSessionModel.State#CANCELED. This operation will free up any temporary resources currently associated with the session. &lt;p&gt; This operation is not allowed if the session has been already completed. &lt;p&gt; Cancelling an update session will cancel any in progress transfers (either uploaded by the client or pulled by the server). Any content that has been already received will be scheduled for deletion.

Parameters:

  • update_session_id

    Identifier of the update session that should be canceled.

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

    the optional parameters

Returns:



33
34
35
36
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
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 33

def cancel_with_http_info(update_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.cancel ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.cancel"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}?~action=cancel'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#complete(update_session_id, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil

Completes the update session. This indicates that the client has finished making all the changes required to the underlying library item. If the client is pushing the content to the server, the library item will be updated once this call returns. If the server is pulling the content, the call may return before the changes become visible. In that case, the client can track the session to know when the server is done. <p> This operation requires the session to be in the UpdateSessionModel.State#ACTIVE state. <p> Depending on the type of the library item associated with this session, a type adapter may be invoked to verify the validity of the files uploaded. The user can explicitly validate the session before completing the session by using the content.library.item.updatesession.File#validate operation. <p> Modifications are not visible to other clients unless the session is completed and all necessary files have been received.

Parameters:

  • update_session_id

    Identifier of the update session that should be completed.

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

    the optional parameters

Returns:



73
74
75
76
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 73

def complete(update_session_id, opts = {})
  complete_with_http_info(update_session_id, opts)
  nil
end

#complete_with_http_info(update_session_id, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Completes the update session. This indicates that the client has finished making all the changes required to the underlying library item. If the client is pushing the content to the server, the library item will be updated once this call returns. If the server is pulling the content, the call may return before the changes become visible. In that case, the client can track the session to know when the server is done. &lt;p&gt; This operation requires the session to be in the UpdateSessionModel.State#ACTIVE state. &lt;p&gt; Depending on the type of the library item associated with this session, a type adapter may be invoked to verify the validity of the files uploaded. The user can explicitly validate the session before completing the session by using the content.library.item.updatesession.File#validate operation. &lt;p&gt; Modifications are not visible to other clients unless the session is completed and all necessary files have been received.

Parameters:

  • update_session_id

    Identifier of the update session that should be completed.

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

    the optional parameters

Returns:



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 83

def complete_with_http_info(update_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.complete ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.complete"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}?~action=complete'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create(request_body, opts = {}) ⇒ ContentLibraryItemUpdateSessionCreateResult|VapiStdErrorsResourceBusyError|VapiStdErrorsNotFoundError|

Creates a new update session. An update session is used to make modifications to a library item. Modifications are not visible to other clients unless the session is completed and all necessary files have been received. <p> Content Library Service allows only one single update session to be active for a specific library item.

Parameters:

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

    the optional parameters

Returns:



123
124
125
126
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 123

def create(request_body, opts = {})
  data, _status_code, _headers = create_with_http_info(request_body, opts)
  data
end

#create_with_http_info(request_body, opts = {}) ⇒ Array<(ContentLibraryItemUpdateSessionCreateResult|VapiStdErrorsResourceBusyError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a new update session. An update session is used to make modifications to a library item. Modifications are not visible to other clients unless the session is completed and all necessary files have been received. &lt;p&gt; Content Library Service allows only one single update session to be active for a specific library item.

Parameters:

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

    the optional parameters

Returns:



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 133

def create_with_http_info(request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.create ...'
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling LibraryItemUpdateSessionApi.create"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Content::ContentLibraryItemUpdateSessionCreateResult',
	  '400' => 'Content::VapiStdErrorsResourceBusyError',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(update_session_id, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil

Deletes an update session. This removes the session and all information associated with it. <p> Removing an update session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the server will terminate the transfers, or that the transfers can be completed). However there will no longer be a means of inspecting the status of those uploads except by seeing the effect on the library item. <p> Update sessions for which there is no upload activity or which are complete will automatically be deleted after a period of time.

Parameters:

  • update_session_id

    Identifer of the update session to delete.

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

    the optional parameters

Returns:



180
181
182
183
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 180

def delete(update_session_id, opts = {})
  delete_with_http_info(update_session_id, opts)
  nil
end

#delete_with_http_info(update_session_id, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deletes an update session. This removes the session and all information associated with it. &lt;p&gt; Removing an update session leaves any current transfers for that session in an indeterminate state (there is no guarantee that the server will terminate the transfers, or that the transfers can be completed). However there will no longer be a means of inspecting the status of those uploads except by seeing the effect on the library item. &lt;p&gt; Update sessions for which there is no upload activity or which are complete will automatically be deleted after a period of time.

Parameters:

  • update_session_id

    Identifer of the update session to delete.

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

    the optional parameters

Returns:



190
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
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 190

def delete_with_http_info(update_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.delete ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.delete"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fail(update_session_id, request_body, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil

Terminates the update session with a client specified error message. <p> This is useful in transmitting client side failures (for example, not being able to access a file) to the server side.

Parameters:

  • update_session_id

    Identifier of the update session to fail.

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

    the optional parameters

Returns:



231
232
233
234
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 231

def fail(update_session_id, request_body, opts = {})
  fail_with_http_info(update_session_id, request_body, opts)
  nil
end

#fail_with_http_info(update_session_id, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Terminates the update session with a client specified error message. &lt;p&gt; This is useful in transmitting client side failures (for example, not being able to access a file) to the server side.

Parameters:

  • update_session_id

    Identifier of the update session to fail.

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

    the optional parameters

Returns:



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 242

def fail_with_http_info(update_session_id, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.fail ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.fail"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling LibraryItemUpdateSessionApi.fail"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}?~action=fail'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#fail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(update_session_id, opts = {}) ⇒ ContentLibraryItemUpdateSessionResult|VapiStdErrorsNotFoundError|

Gets the update session with the specified identifier, including the most up-to-date status information for the session.

Parameters:

  • update_session_id

    Identifier of the update session to retrieve.

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

    the optional parameters

Returns:



288
289
290
291
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 288

def get(update_session_id, opts = {})
  data, _status_code, _headers = get_with_http_info(update_session_id, opts)
  data
end

#get_with_http_info(update_session_id, opts = {}) ⇒ Array<(ContentLibraryItemUpdateSessionResult|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Gets the update session with the specified identifier, including the most up-to-date status information for the session.

Parameters:

  • update_session_id

    Identifier of the update session to retrieve.

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

    the optional parameters

Returns:



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
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 298

def get_with_http_info(update_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.get ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.get"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Content::ContentLibraryItemUpdateSessionResult',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#keep_alive(update_session_id, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil

Keeps an update session alive. <p> If there is no activity for an update session after a period of time, the update session will expire, then be deleted. The update session expiration timeout is configurable in the Content Library Service system configuration. The default is five minutes. Invoking this operation enables a client to specifically extend the lifetime of the update session.

Parameters:

  • update_session_id

    Identifier of the update session whose lifetime should be extended.

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

    the optional parameters

Options Hash (opts):

Returns:



343
344
345
346
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 343

def keep_alive(update_session_id, opts = {})
  keep_alive_with_http_info(update_session_id, opts)
  nil
end

#keep_alive_with_http_info(update_session_id, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Keeps an update session alive. &lt;p&gt; If there is no activity for an update session after a period of time, the update session will expire, then be deleted. The update session expiration timeout is configurable in the Content Library Service system configuration. The default is five minutes. Invoking this operation enables a client to specifically extend the lifetime of the update session.

Parameters:

  • update_session_id

    Identifier of the update session whose lifetime should be extended.

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

    the optional parameters

Options Hash (opts):

Returns:



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 354

def keep_alive_with_http_info(update_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.keep_alive ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.keep_alive"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}?~action=keep-alive'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'request_body'])
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#keep_alive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(opts = {}) ⇒ ContentLibraryItemUpdateSessionListResult|VapiStdErrorsNotFoundError|

Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :library_item_id (String)

    Optional library item identifier on which to filter results.

Returns:



396
397
398
399
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 396

def list(opts = {})
  data, _status_code, _headers = list_with_http_info(opts)
  data
end

#list_with_http_info(opts = {}) ⇒ Array<(ContentLibraryItemUpdateSessionListResult|VapiStdErrorsNotFoundError|, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Lists the identifiers of the update session created by the calling user. Optionally may filter by library item.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :library_item_id (String)

    Optional library item identifier on which to filter results.

Returns:



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 406

def list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.list ...'
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session'

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

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
	:return_type => {
	  '200' => 'Content::ContentLibraryItemUpdateSessionListResult',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(update_session_id, request_body, opts = {}) ⇒ |VapiStdErrorsInvalidArgumentError|VapiStdErrorsNotFoundError|nil

Updates the properties of an update session. <p> This is an incremental update to the update session. Any field in the UpdateSessionModel structure that is unset will not be modified. <p> This operation will only update the property UpdateSessionModel#warningBehavior of the update session. This will not, for example, update the UpdateSessionModel#libraryItemId or UpdateSessionModel#state of an update session. <p> This operation requires the session to be in the UpdateSessionModel.State#ACTIVE state.

Parameters:

  • update_session_id

    Identifer of the update session that should be updated.

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

    the optional parameters

Returns:



448
449
450
451
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 448

def update(update_session_id, request_body, opts = {})
  update_with_http_info(update_session_id, request_body, opts)
  nil
end

#update_with_http_info(update_session_id, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsInvalidArgumentError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Updates the properties of an update session. &lt;p&gt; This is an incremental update to the update session. Any field in the UpdateSessionModel structure that is unset will not be modified. &lt;p&gt; This operation will only update the property UpdateSessionModel#warningBehavior of the update session. This will not, for example, update the UpdateSessionModel#libraryItemId or UpdateSessionModel#state of an update session. &lt;p&gt; This operation requires the session to be in the UpdateSessionModel.State#ACTIVE state.

Parameters:

  • update_session_id

    Identifer of the update session that should be updated.

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

    the optional parameters

Returns:



459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
# File 'lib/vsphere-automation-content/api/library_item_update_session_api.rb', line 459

def update_with_http_info(update_session_id, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibraryItemUpdateSessionApi.update ...'
  end
  # verify the required parameter 'update_session_id' is set
  if @api_client.config.client_side_validation && update_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'update_session_id' when calling LibraryItemUpdateSessionApi.update"
  end
  # verify the required parameter 'request_body' is set
  if @api_client.config.client_side_validation && request_body.nil?
    fail ArgumentError, "Missing the required parameter 'request_body' when calling LibraryItemUpdateSessionApi.update"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/item/update-session/id:{update_session_id}'.sub('{' + 'update_session_id' + '}', update_session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request_body)
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibraryItemUpdateSessionApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end