Class: Fastly::SecretStoreApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/secret_store_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SecretStoreApi

Returns a new instance of SecretStoreApi.



17
18
19
# File 'lib/fastly/api/secret_store_api.rb', line 17

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/secret_store_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#client_key(opts = {}) ⇒ ClientKey

Create new client key Create a new client key for encrypting secrets locally before uploading.

Returns:



23
24
25
26
# File 'lib/fastly/api/secret_store_api.rb', line 23

def client_key(opts = {})
  data, _status_code, _headers = client_key_with_http_info(opts)
  data
end

#client_key_with_http_info(opts = {}) ⇒ Array<(ClientKey, Integer, Hash)>

Create new client key Create a new client key for encrypting secrets locally before uploading.

Returns:

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

    ClientKey data, response status code and response headers



31
32
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
69
70
71
72
73
74
# File 'lib/fastly/api/secret_store_api.rb', line 31

def client_key_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.client_key ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/resources/stores/secret/client-key'

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.client_key",
    :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: SecretStoreApi#client_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_secret_store(opts = {}) ⇒ SecretStoreResponse

Create new secret store Create a new secret store.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:



80
81
82
83
# File 'lib/fastly/api/secret_store_api.rb', line 80

def create_secret_store(opts = {})
  data, _status_code, _headers = create_secret_store_with_http_info(opts)
  data
end

#create_secret_store_with_http_info(opts = {}) ⇒ Array<(SecretStoreResponse, Integer, Hash)>

Create new secret store Create a new secret store.

Parameters:

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

    a customizable set of options

Options Hash (opts):

Returns:

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

    SecretStoreResponse data, response status code and response headers



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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/fastly/api/secret_store_api.rb', line 89

def create_secret_store_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.create_secret_store ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/resources/stores/secret'

  # 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(opts[:'secret_store'])

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

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.create_secret_store",
    :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: SecretStoreApi#create_secret_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_secret_store(opts = {}) ⇒ nil

Delete secret store Delete a secret store and all of its contents.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :store_id (String) — default: required

Returns:

  • (nil)


143
144
145
146
# File 'lib/fastly/api/secret_store_api.rb', line 143

def delete_secret_store(opts = {})
  delete_secret_store_with_http_info(opts)
  nil
end

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

Delete secret store Delete a secret store and all of its contents.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :store_id (String) — default: required

Returns:

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

    nil, response status code and response headers



152
153
154
155
156
157
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
# File 'lib/fastly/api/secret_store_api.rb', line 152

def delete_secret_store_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.delete_secret_store ...'
  end
  # unbox the parameters from the hash
  store_id = opts[:'store_id']
  # verify the required parameter 'store_id' is set
  if @api_client.config.client_side_validation && store_id.nil?
    fail ArgumentError, "Missing the required parameter 'store_id' when calling SecretStoreApi.delete_secret_store"
  end
  # resource path
  local_var_path = '/resources/stores/secret/{store_id}'.sub('{' + 'store_id' + '}', CGI.escape(store_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.delete_secret_store",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecretStoreApi#delete_secret_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_secret_store(opts = {}) ⇒ SecretStoreResponse

Get secret store by ID Get a secret store by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :store_id (String) — default: required

Returns:



204
205
206
207
# File 'lib/fastly/api/secret_store_api.rb', line 204

def get_secret_store(opts = {})
  data, _status_code, _headers = get_secret_store_with_http_info(opts)
  data
end

#get_secret_store_with_http_info(opts = {}) ⇒ Array<(SecretStoreResponse, Integer, Hash)>

Get secret store by ID Get a secret store by ID.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :store_id (String) — default: required

Returns:

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

    SecretStoreResponse data, response status code and response headers



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
253
254
255
256
257
258
259
260
261
# File 'lib/fastly/api/secret_store_api.rb', line 213

def get_secret_store_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.get_secret_store ...'
  end
  # unbox the parameters from the hash
  store_id = opts[:'store_id']
  # verify the required parameter 'store_id' is set
  if @api_client.config.client_side_validation && store_id.nil?
    fail ArgumentError, "Missing the required parameter 'store_id' when calling SecretStoreApi.get_secret_store"
  end
  # resource path
  local_var_path = '/resources/stores/secret/{store_id}'.sub('{' + 'store_id' + '}', CGI.escape(store_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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.get_secret_store",
    :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: SecretStoreApi#get_secret_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_secret_stores(opts = {}) ⇒ InlineResponse2005

Get all secret stores Get all secret stores.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :cursor (String)

    Cursor value from the &#x60;next_cursor&#x60; field of a previous response, used to retrieve the next page. To request the first page, this should be empty.

  • :limit (String)

    Number of results per page. The maximum is 200. (default to ‘100’)

  • :name (String)

    Returns a one-element array containing the details for the named secret store.

Returns:



269
270
271
272
# File 'lib/fastly/api/secret_store_api.rb', line 269

def get_secret_stores(opts = {})
  data, _status_code, _headers = get_secret_stores_with_http_info(opts)
  data
end

#get_secret_stores_with_http_info(opts = {}) ⇒ Array<(InlineResponse2005, Integer, Hash)>

Get all secret stores Get all secret stores.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :cursor (String)

    Cursor value from the &#x60;next_cursor&#x60; field of a previous response, used to retrieve the next page. To request the first page, this should be empty.

  • :limit (String)

    Number of results per page. The maximum is 200. (default to ‘100’)

  • :name (String)

    Returns a one-element array containing the details for the named secret store.

Returns:

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

    InlineResponse2005 data, response status code and response headers



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/fastly/api/secret_store_api.rb', line 280

def get_secret_stores_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.get_secret_stores ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/resources/stores/secret'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].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] || 'InlineResponse2005'

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.get_secret_stores",
    :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: SecretStoreApi#get_secret_stores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#signing_key(opts = {}) ⇒ SigningKey

Get public key Get the public key used for signing client keys.

Returns:



331
332
333
334
# File 'lib/fastly/api/secret_store_api.rb', line 331

def signing_key(opts = {})
  data, _status_code, _headers = signing_key_with_http_info(opts)
  data
end

#signing_key_with_http_info(opts = {}) ⇒ Array<(SigningKey, Integer, Hash)>

Get public key Get the public key used for signing client keys.

Returns:

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

    SigningKey data, response status code and response headers



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
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/fastly/api/secret_store_api.rb', line 339

def signing_key_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SecretStoreApi.signing_key ...'
  end
  # unbox the parameters from the hash
  # resource path
  local_var_path = '/resources/stores/secret/signing-key'

  # 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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"SecretStoreApi.signing_key",
    :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: SecretStoreApi#signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end