class Fastly::VersionApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

activate_service_version(opts = {}) click to toggle source

Activate a service version Activate the current version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 25
def activate_service_version(opts = {})
  data, _status_code, _headers = activate_service_version_with_http_info(opts)
  data
end
activate_service_version_environment(opts = {}) click to toggle source

Activate a service version on the specified environment Activate a version on a given environment, i.e. "staging" @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [EnvironmentName] :environment_name (required) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 96
def activate_service_version_environment(opts = {})
  data, _status_code, _headers = activate_service_version_environment_with_http_info(opts)
  data
end
activate_service_version_environment_with_http_info(opts = {}) click to toggle source

Activate a service version on the specified environment Activate a version on a given environment, i.e. "staging&quot; @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [EnvironmentName] :environment_name (required) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 107
def activate_service_version_environment_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.activate_service_version_environment ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  environment_name = opts[:'environment_name']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.activate_service_version_environment"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.activate_service_version_environment"
  end
  # verify the required parameter 'environment_name' is set
  if @api_client.config.client_side_validation && environment_name.nil?
    fail ArgumentError, "Missing the required parameter 'environment_name' when calling VersionApi.activate_service_version_environment"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/activate/{environment_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'environment_name' + '}', CGI.escape(environment_name.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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.activate_service_version_environment",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#activate_service_version_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
activate_service_version_with_http_info(opts = {}) click to toggle source

Activate a service version Activate the current version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 35
def activate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.activate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.activate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.activate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/activate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.activate_service_version",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#activate_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
clone_service_version(opts = {}) click to toggle source

Clone a service version Clone the current configuration into a new version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Version]

# File lib/fastly/api/version_api.rb, line 172
def clone_service_version(opts = {})
  data, _status_code, _headers = clone_service_version_with_http_info(opts)
  data
end
clone_service_version_with_http_info(opts = {}) click to toggle source

Clone a service version Clone the current configuration into a new version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(Version, Integer, Hash)>] Version data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 182
def clone_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.clone_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.clone_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.clone_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/clone'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'Version'

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

  new_options = opts.merge(
    :operation => :"VersionApi.clone_service_version",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#clone_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_service_version(opts = {}) click to toggle source

Create a service version Create a version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @return [VersionCreateResponse]

# File lib/fastly/api/version_api.rb, line 241
def create_service_version(opts = {})
  data, _status_code, _headers = create_service_version_with_http_info(opts)
  data
end
create_service_version_with_http_info(opts = {}) click to toggle source

Create a service version Create a version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @return [Array<(VersionCreateResponse, Integer, Hash)>] VersionCreateResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 250
def create_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.create_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.create_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version'.sub('{' + 'service_id' + '}', CGI.escape(service_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] || 'VersionCreateResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.create_service_version",
    :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: VersionApi#create_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
deactivate_service_version(opts = {}) click to toggle source

Deactivate a service version Deactivate the current version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 305
def deactivate_service_version(opts = {})
  data, _status_code, _headers = deactivate_service_version_with_http_info(opts)
  data
end
deactivate_service_version_environment(opts = {}) click to toggle source

Deactivate a service version on an environment Deactivate the current version on a given environment, i.e. "staging" @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [EnvironmentName] :environment_name (required) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 376
def deactivate_service_version_environment(opts = {})
  data, _status_code, _headers = deactivate_service_version_environment_with_http_info(opts)
  data
end
deactivate_service_version_environment_with_http_info(opts = {}) click to toggle source

Deactivate a service version on an environment Deactivate the current version on a given environment, i.e. "staging&quot; @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [EnvironmentName] :environment_name (required) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 387
def deactivate_service_version_environment_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.deactivate_service_version_environment ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  environment_name = opts[:'environment_name']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.deactivate_service_version_environment"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.deactivate_service_version_environment"
  end
  # verify the required parameter 'environment_name' is set
  if @api_client.config.client_side_validation && environment_name.nil?
    fail ArgumentError, "Missing the required parameter 'environment_name' when calling VersionApi.deactivate_service_version_environment"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/deactivate/{environment_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'environment_name' + '}', CGI.escape(environment_name.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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.deactivate_service_version_environment",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#deactivate_service_version_environment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
deactivate_service_version_with_http_info(opts = {}) click to toggle source

Deactivate a service version Deactivate the current version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 315
def deactivate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.deactivate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.deactivate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.deactivate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/deactivate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.deactivate_service_version",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#deactivate_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_service_version(opts = {}) click to toggle source

Get a version of a service Get the version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 452
def get_service_version(opts = {})
  data, _status_code, _headers = get_service_version_with_http_info(opts)
  data
end
get_service_version_with_http_info(opts = {}) click to toggle source

Get a version of a service Get the version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 462
def get_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.get_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.get_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.get_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'VersionResponse'

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

  new_options = opts.merge(
    :operation => :"VersionApi.get_service_version",
    :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: VersionApi#get_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_service_versions(opts = {}) click to toggle source

List versions of a service List the versions for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @return [Array<VersionResponse>]

# File lib/fastly/api/version_api.rb, line 521
def list_service_versions(opts = {})
  data, _status_code, _headers = list_service_versions_with_http_info(opts)
  data
end
list_service_versions_with_http_info(opts = {}) click to toggle source

List versions of a service List the versions for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @return [Array<(Array<VersionResponse>, Integer, Hash)>] Array<VersionResponse> data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 530
def list_service_versions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.list_service_versions ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.list_service_versions"
  end
  # resource path
  local_var_path = '/service/{service_id}/version'.sub('{' + 'service_id' + '}', CGI.escape(service_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] || 'Array<VersionResponse>'

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

  new_options = opts.merge(
    :operation => :"VersionApi.list_service_versions",
    :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: VersionApi#list_service_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
lock_service_version(opts = {}) click to toggle source

Lock a service version Locks the specified version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Version]

# File lib/fastly/api/version_api.rb, line 585
def lock_service_version(opts = {})
  data, _status_code, _headers = lock_service_version_with_http_info(opts)
  data
end
lock_service_version_with_http_info(opts = {}) click to toggle source

Lock a service version Locks the specified version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(Version, Integer, Hash)>] Version data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 595
def lock_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.lock_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.lock_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.lock_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/lock'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'Version'

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

  new_options = opts.merge(
    :operation => :"VersionApi.lock_service_version",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#lock_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_service_version(opts = {}) click to toggle source

Update a service version Update a particular version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [Boolean] :active Whether this is the active version or not. (default to false) @option opts [String] :comment A freeform descriptive note. @option opts [Boolean] :deployed Unused at this time. @option opts [Boolean] :locked Whether this version is locked or not. Objects can not be added or edited on locked versions. (default to false) @option opts [Integer] :number The number of this version. @option opts [Boolean] :staging Unused at this time. (default to false) @option opts [Boolean] :testing Unused at this time. (default to false) @return [VersionResponse]

# File lib/fastly/api/version_api.rb, line 662
def update_service_version(opts = {})
  data, _status_code, _headers = update_service_version_with_http_info(opts)
  data
end
update_service_version_with_http_info(opts = {}) click to toggle source

Update a service version Update a particular version for a particular service. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @option opts [Boolean] :active Whether this is the active version or not. (default to false) @option opts [String] :comment A freeform descriptive note. @option opts [Boolean] :deployed Unused at this time. @option opts [Boolean] :locked Whether this version is locked or not. Objects can not be added or edited on locked versions. (default to false) @option opts [Integer] :number The number of this version. @option opts [Boolean] :staging Unused at this time. (default to false) @option opts [Boolean] :testing Unused at this time. (default to false) @return [Array<(VersionResponse, Integer, Hash)>] VersionResponse data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 679
def update_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.update_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.update_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.update_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['active'] = opts[:'active'] if !opts[:'active'].nil?
  form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  form_params['deployed'] = opts[:'deployed'] if !opts[:'deployed'].nil?
  form_params['locked'] = opts[:'locked'] if !opts[:'locked'].nil?
  form_params['number'] = opts[:'number'] if !opts[:'number'].nil?
  form_params['staging'] = opts[:'staging'] if !opts[:'staging'].nil?
  form_params['testing'] = opts[:'testing'] if !opts[:'testing'].nil?

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

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

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

  new_options = opts.merge(
    :operation => :"VersionApi.update_service_version",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VersionApi#update_service_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
validate_service_version(opts = {}) click to toggle source

Validate a service version Validate the version for a particular service and version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [InlineResponse200]

# File lib/fastly/api/version_api.rb, line 751
def validate_service_version(opts = {})
  data, _status_code, _headers = validate_service_version_with_http_info(opts)
  data
end
validate_service_version_with_http_info(opts = {}) click to toggle source

Validate a service version Validate the version for a particular service and version. @option opts [String] :service_id Alphanumeric string identifying the service. (required) @option opts [Integer] :version_id Integer identifying a service version. (required) @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers

# File lib/fastly/api/version_api.rb, line 761
def validate_service_version_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VersionApi.validate_service_version ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling VersionApi.validate_service_version"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling VersionApi.validate_service_version"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/validate'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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] || 'InlineResponse200'

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

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