class ServerTemplateInternal

API 0.1

Public Class Methods

resource_plural_name() click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 43
def self.resource_plural_name
  "server_templates"
end
resource_singular_name() click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 47
def self.resource_singular_name
  "server_template"
end

Public Instance Methods

add_executable(executable, apply="operational") click to toggle source

<~Executable> executable, an Executable object to add <~String> Apply, a string designating the type of executable: “boot”, “operational”, “decommission”. Default is operational

# File lib/rest_connection/rightscale/server_template_internal.rb, line 79
def add_executable(executable, apply="operational")
  t = URI.parse(self.href)
  params = {}
  if executable.recipe?
    params[:recipe] = executable.href
  else
    params[:right_script_href] = executable.href
  end
  params[:apply] = apply
  connection.post(t.path + "/add_executable", params)
end
add_multi_cloud_image(mci_href) click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 51
def add_multi_cloud_image(mci_href)
  t = URI.parse(self.href)
  connection.put(t.path + "/add_multi_cloud_image", :multi_cloud_image_href => mci_href)
end
commit(message) click to toggle source

message <~String>: commit message string (required)

# File lib/rest_connection/rightscale/server_template_internal.rb, line 72
def commit(message)
  t = URI.parse(self.href)
  ServerTemplate.new(:href => connection.post(t.path + "/commit", :commit_message => message))
end
delete_executable(executable, apply="operational") click to toggle source

<~Executable> executable, an Executable object to delete <~String> Apply, a string designating the type of executable: “boot”, “operational”, “decommission”. Default is operational

# File lib/rest_connection/rightscale/server_template_internal.rb, line 93
def delete_executable(executable, apply="operational")
  t = URI.parse(self.href)
  params = {}
  if executable.recipe?
    params[:recipe] = executable.href
  else
    params[:right_script_href] = executable.href
  end
  params[:apply] = apply
  connection.delete(t.path + "/delete_executable", params)
end
delete_multi_cloud_image(mci_href) click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 56
def delete_multi_cloud_image(mci_href)
  t = URI.parse(self.href)
  connection.put(t.path + "/delete_multi_cloud_image", :multi_cloud_image_href => mci_href)
end
multi_cloud_images() click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 66
def multi_cloud_images
  t = URI.parse(self.href)
  connection.get(t.path + "/multi_cloud_images")
end
resource_plural_name() click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 35
def resource_plural_name
  "server_templates"
end
resource_singular_name() click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 39
def resource_singular_name
  "server_template"
end
set_default_multi_cloud_image(mci_href) click to toggle source
# File lib/rest_connection/rightscale/server_template_internal.rb, line 61
def set_default_multi_cloud_image(mci_href)
  t = URI.parse(self.href)
  connection.put(t.path + "/set_default_multi_cloud_image", :multi_cloud_image_href => mci_href)
end