Class: VSphereAutomation::Content::LibrarySubscriptionsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LibrarySubscriptionsApi

Returns a new instance of LibrarySubscriptionsApi.



16
17
18
# File 'lib/vsphere-automation-content/api/library_subscriptions_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_subscriptions_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#create(library, request_body, opts = {}) ⇒ ContentLibrarySubscriptionsCreateResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Creates a subscription of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



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

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

#create_with_http_info(library, request_body, opts = {}) ⇒ Array<(ContentLibrarySubscriptionsCreateResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|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 subscription of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 35

def create_with_http_info(library, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibrarySubscriptionsApi.create ...'
  end
  # verify the required parameter 'library' is set
  if @api_client.config.client_side_validation && library.nil?
    fail ArgumentError, "Missing the required parameter 'library' when calling LibrarySubscriptionsApi.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 LibrarySubscriptionsApi.create"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/subscriptions/id:{library}'.sub('{' + 'library' + '}', library.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,
	:return_type => {
	  '200' => 'Content::ContentLibrarySubscriptionsCreateResult',
	  '400' => 'Content::VapiStdErrorsNotAllowedInCurrentStateError',
	  '401' => 'Content::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Content::VapiStdErrorsUnauthorizedError',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibrarySubscriptionsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete(library, request_body, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil

Deletes the specified subscription of the published library. The subscribed library associated with the subscription will not be deleted.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



89
90
91
92
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 89

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

#delete_with_http_info(library, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|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 the specified subscription of the published library. The subscribed library associated with the subscription will not be deleted.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



100
101
102
103
104
105
106
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
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 100

def delete_with_http_info(library, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibrarySubscriptionsApi.delete ...'
  end
  # verify the required parameter 'library' is set
  if @api_client.config.client_side_validation && library.nil?
    fail ArgumentError, "Missing the required parameter 'library' when calling LibrarySubscriptionsApi.delete"
  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 LibrarySubscriptionsApi.delete"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/subscriptions/id:{library}?~action=delete'.sub('{' + 'library' + '}', library.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: LibrarySubscriptionsApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get(library, request_body, opts = {}) ⇒ ContentLibrarySubscriptionsResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Returns information about the specified subscription of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



147
148
149
150
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 147

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

#get_with_http_info(library, request_body, opts = {}) ⇒ Array<(ContentLibrarySubscriptionsResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|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.

Returns information about the specified subscription of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 158

def get_with_http_info(library, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibrarySubscriptionsApi.get ...'
  end
  # verify the required parameter 'library' is set
  if @api_client.config.client_side_validation && library.nil?
    fail ArgumentError, "Missing the required parameter 'library' when calling LibrarySubscriptionsApi.get"
  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 LibrarySubscriptionsApi.get"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/subscriptions/id:{library}?~action=get'.sub('{' + 'library' + '}', library.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,
	:return_type => {
	  '200' => 'Content::ContentLibrarySubscriptionsResult',
	  '400' => 'Content::VapiStdErrorsNotAllowedInCurrentStateError',
	  '401' => 'Content::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Content::VapiStdErrorsUnauthorizedError',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibrarySubscriptionsApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list(library, opts = {}) ⇒ ContentLibrarySubscriptionsListResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|

Lists the subscriptions of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



211
212
213
214
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 211

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

#list_with_http_info(library, opts = {}) ⇒ Array<(ContentLibrarySubscriptionsListResult|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|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 subscriptions of the published library.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



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
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 221

def list_with_http_info(library, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibrarySubscriptionsApi.list ...'
  end
  # verify the required parameter 'library' is set
  if @api_client.config.client_side_validation && library.nil?
    fail ArgumentError, "Missing the required parameter 'library' when calling LibrarySubscriptionsApi.list"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/subscriptions'

  # query parameters
  query_params = {}
  query_params[:'library'] = library

  # 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::ContentLibrarySubscriptionsListResult',
	  '400' => 'Content::VapiStdErrorsNotAllowedInCurrentStateError',
	  '401' => 'Content::VapiStdErrorsUnauthenticatedError',
	  '403' => 'Content::VapiStdErrorsUnauthorizedError',
	  '404' => 'Content::VapiStdErrorsNotFoundError',
	})
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LibrarySubscriptionsApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update(library, request_body, opts = {}) ⇒ |VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil

Updates the specified subscription of the published library. <p> This is an incremental update to the subscription. Except for the UpdateSpecPlacement structure, fields that are unset in the update specification will be left unchanged. If spec#subscribedLibraryPlacement is specified, all fields of the current subscribed library placement will be replaced by this placement.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



270
271
272
273
# File 'lib/vsphere-automation-content/api/library_subscriptions_api.rb', line 270

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

#update_with_http_info(library, request_body, opts = {}) ⇒ Array<(|VapiStdErrorsNotAllowedInCurrentStateError|VapiStdErrorsUnauthenticatedError|VapiStdErrorsUnauthorizedError|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 specified subscription of the published library. &lt;p&gt; This is an incremental update to the subscription. Except for the UpdateSpecPlacement structure, fields that are unset in the update specification will be left unchanged. If spec#subscribedLibraryPlacement is specified, all fields of the current subscribed library placement will be replaced by this placement.

Parameters:

  • library

    Identifier of the published library.

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

    the optional parameters

Returns:



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

def update_with_http_info(library, request_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LibrarySubscriptionsApi.update ...'
  end
  # verify the required parameter 'library' is set
  if @api_client.config.client_side_validation && library.nil?
    fail ArgumentError, "Missing the required parameter 'library' when calling LibrarySubscriptionsApi.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 LibrarySubscriptionsApi.update"
  end
  # resource path
  local_var_path = '/com/vmware/content/library/subscriptions/id:{library}'.sub('{' + 'library' + '}', library.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: LibrarySubscriptionsApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end