class Fastly::SecretStoreApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/fastly/api/secret_store_api.rb, line 17
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

client_key(opts = {}) click to toggle source

Create new client key Create a new client key for encrypting secrets locally before uploading. @return [ClientKey]

# 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 = {}) click to toggle source

Create new client key Create a new client key for encrypting secrets locally before uploading. @return [Array<(ClientKey, Integer, Hash)>] ClientKey data, response status code and response headers

# 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 = {}) click to toggle source

Create new secret store Create a new secret store. @option opts [SecretStore] :secret_store @return [SecretStoreResponse]

# 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 = {}) click to toggle source

Create new secret store Create a new secret store. @option opts [SecretStore] :secret_store @return [Array<(SecretStoreResponse, Integer, Hash)>] SecretStoreResponse data, response status code and response headers

# 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 = {}) click to toggle source

Delete secret store Delete a secret store and all of its contents. @option opts [String] :store_id (required) @return [nil]

# 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 = {}) click to toggle source

Delete secret store Delete a secret store and all of its contents. @option opts [String] :store_id (required) @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Get secret store by ID Get a secret store by ID. @option opts [String] :store_id (required) @return [SecretStoreResponse]

# 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 = {}) click to toggle source

Get secret store by ID Get a secret store by ID. @option opts [String] :store_id (required) @return [Array<(SecretStoreResponse, Integer, Hash)>] SecretStoreResponse data, response status code and response headers

# 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 = {}) click to toggle source

Get all secret stores Get all secret stores. @option opts [String] :cursor 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. @option opts [String] :limit Number of results per page. The maximum is 200. (default to ‘100’) @option opts [String] :name Returns a one-element array containing the details for the named secret store. @return [InlineResponse2005]

# 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 = {}) click to toggle source

Get all secret stores Get all secret stores. @option opts [String] :cursor 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. @option opts [String] :limit Number of results per page. The maximum is 200. (default to ‘100’) @option opts [String] :name Returns a one-element array containing the details for the named secret store. @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers

# 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 = {}) click to toggle source

Get public key Get the public key used for signing client keys. @return [SigningKey]

# 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 = {}) click to toggle source

Get public key Get the public key used for signing client keys. @return [Array<(SigningKey, Integer, Hash)>] SigningKey data, response status code and response headers

# 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