Class: RokkaClientCodegen::StacksApi

Inherits:
Object
  • Object
show all
Defined in:
lib/rokka_client_codegen/api/stacks_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StacksApi

Returns a new instance of StacksApi.



19
20
21
# File 'lib/rokka_client_codegen/api/stacks_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/rokka_client_codegen/api/stacks_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_stack(stack_definition, organization, name, opts = {}) ⇒ Stack

Create a new stack.

Parameters:

  • stack_definition

    Stack operations and options definition. See rokka.io/documentation/references/stacks.html for explanations how to define stacks.

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

    the optional parameters

Options Hash (opts):

  • :overwrite (BOOLEAN)

    Whether to overwrite the stack if it already exists (default to false)

Returns:



31
32
33
34
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 31

def create_stack(stack_definition, organization, name, opts = {})
  data, _status_code, _headers = create_stack_with_http_info(stack_definition, organization, name, opts)
  return data
end

#create_stack_with_http_info(stack_definition, organization, name, opts = {}) ⇒ Array<(Stack, Fixnum, Hash)>

Create a new stack.

Parameters:

  • stack_definition

    Stack operations and options definition. See rokka.io/documentation/references/stacks.html for explanations how to define stacks.

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

    the optional parameters

Options Hash (opts):

  • :overwrite (BOOLEAN)

    Whether to overwrite the stack if it already exists

Returns:

  • (Array<(Stack, Fixnum, Hash)>)

    Stack data, response status code and response headers



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
89
90
91
92
93
94
95
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 44

def create_stack_with_http_info(stack_definition, organization, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.create_stack ..."
  end
  # verify the required parameter 'stack_definition' is set
  if @api_client.config.client_side_validation && stack_definition.nil?
    fail ArgumentError, "Missing the required parameter 'stack_definition' when calling StacksApi.create_stack"
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling StacksApi.create_stack"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling StacksApi.create_stack, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StacksApi.create_stack"
  end
  if @api_client.config.client_side_validation && name !~ Regexp.new(/[a-z0-9\\-_]+/)
    fail ArgumentError, "invalid value for 'name' when calling StacksApi.create_stack, must conform to the pattern /[a-z0-9\\-_]+/."
  end

  # resource path
  local_var_path = "/stacks/{organization}/{name}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'name' + '}', name.to_s)

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

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(stack_definition)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Stack')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StacksApi#create_stack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_stack(organization, name, opts = {}) ⇒ nil

Delete a stack.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


103
104
105
106
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 103

def delete_stack(organization, name, opts = {})
  delete_stack_with_http_info(organization, name, opts)
  return nil
end

#delete_stack_with_http_info(organization, name, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a stack.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
155
156
157
158
159
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 114

def delete_stack_with_http_info(organization, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.delete_stack ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling StacksApi.delete_stack"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling StacksApi.delete_stack, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StacksApi.delete_stack"
  end
  if @api_client.config.client_side_validation && name !~ Regexp.new(/[a-z0-9\\-_]+/)
    fail ArgumentError, "invalid value for 'name' when calling StacksApi.delete_stack, must conform to the pattern /[a-z0-9\\-_]+/."
  end

  # resource path
  local_var_path = "/stacks/{organization}/{name}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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: StacksApi#delete_stack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_stack(organization, name, opts = {}) ⇒ Stack

Get a single stack.

Parameters:

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

    the optional parameters

Returns:



167
168
169
170
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 167

def get_stack(organization, name, opts = {})
  data, _status_code, _headers = get_stack_with_http_info(organization, name, opts)
  return data
end

#get_stack_with_http_info(organization, name, opts = {}) ⇒ Array<(Stack, Fixnum, Hash)>

Get a single stack.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Stack, Fixnum, Hash)>)

    Stack data, response status code and response headers



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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 178

def get_stack_with_http_info(organization, name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.get_stack ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling StacksApi.get_stack"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling StacksApi.get_stack, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StacksApi.get_stack"
  end
  if @api_client.config.client_side_validation && name !~ Regexp.new(/[a-z0-9\\-_]+/)
    fail ArgumentError, "invalid value for 'name' when calling StacksApi.get_stack, must conform to the pattern /[a-z0-9\\-_]+/."
  end

  # resource path
  local_var_path = "/stacks/{organization}/{name}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Stack')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StacksApi#get_stack\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_operations(opts = {}) ⇒ Hash<String, StackOperationDescription>

Listing all available operations that can be used in stacks.

Parameters:

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

    the optional parameters

Returns:



230
231
232
233
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 230

def list_operations(opts = {})
  data, _status_code, _headers = list_operations_with_http_info(opts)
  return data
end

#list_operations_with_http_info(opts = {}) ⇒ Array<(Hash<String, StackOperationDescription>, Fixnum, Hash)>

Listing all available operations that can be used in stacks.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Hash<String, StackOperationDescription>, Fixnum, Hash)>)

    Hash<String, StackOperationDescription> data, response status code and response headers



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
265
266
267
268
269
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 239

def list_operations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.list_operations ..."
  end
  # resource path
  local_var_path = "/operations"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Hash<String, StackOperationDescription>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StacksApi#list_operations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_stack_options(opts = {}) ⇒ StackOptions

List all available options that can be set on stacks.

Parameters:

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

    the optional parameters

Returns:



275
276
277
278
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 275

def list_stack_options(opts = {})
  data, _status_code, _headers = list_stack_options_with_http_info(opts)
  return data
end

#list_stack_options_with_http_info(opts = {}) ⇒ Array<(StackOptions, Fixnum, Hash)>

List all available options that can be set on stacks.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(StackOptions, Fixnum, Hash)>)

    StackOptions data, response status code and response headers



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
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 284

def list_stack_options_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.list_stack_options ..."
  end
  # resource path
  local_var_path = "/stackoptions"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'StackOptions')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StacksApi#list_stack_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_stacks(organization, opts = {}) ⇒ ListStacksResponse

Get all stacks of an organization.

Parameters:

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

    the optional parameters

Returns:



321
322
323
324
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 321

def list_stacks(organization, opts = {})
  data, _status_code, _headers = list_stacks_with_http_info(organization, opts)
  return data
end

#list_stacks_with_http_info(organization, opts = {}) ⇒ Array<(ListStacksResponse, Fixnum, Hash)>

Get all stacks of an organization.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ListStacksResponse, Fixnum, Hash)>)

    ListStacksResponse data, response status code and response headers



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/rokka_client_codegen/api/stacks_api.rb', line 331

def list_stacks_with_http_info(organization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StacksApi.list_stacks ..."
  end
  # verify the required parameter 'organization' is set
  if @api_client.config.client_side_validation && organization.nil?
    fail ArgumentError, "Missing the required parameter 'organization' when calling StacksApi.list_stacks"
  end
  if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
    fail ArgumentError, "invalid value for 'organization' when calling StacksApi.list_stacks, must conform to the pattern /[0-9a-z\\-]+/."
  end

  # resource path
  local_var_path = "/stacks/{organization}".sub('{' + 'organization' + '}', organization.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'ListStacksResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StacksApi#list_stacks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end