Class: Latitude::API::Resources::Server
- Inherits:
-
APIResource
- Object
- APIResource
- Latitude::API::Resources::Server
- Extended by:
- Operations::Action, Operations::Create, Operations::Delete, Operations::List, Operations::Retrieve, Operations::Update
- Defined in:
- lib/latitude/api/resources/server.rb
Defined Under Namespace
Classes: Distro, Feature, Interface, OperatingSystem, Plan, Region, Site, Spec
Constant Summary
Constants inherited from APIResource
APIResource::READ_ONLY_ATTRIBUTES
Instance Attribute Summary collapse
- #created_at ⇒ Time readonly
- #hostname ⇒ String
- #interfaces ⇒ Array<Interface>
- #ipmi_status ⇒ String
- #label ⇒ String
- #locked ⇒ Boolean
- #operating_system ⇒ OperatingSystem
- #plan ⇒ Plan
- #price ⇒ Integer
- #primary_ipv4 ⇒ String
- #primary_ipv6 ⇒ String
- #project ⇒ Latitude::API::Objects::Project
- #region ⇒ Region
- #rescue_allowed ⇒ Boolean
- #role ⇒ String
- #scheduled_deletion_at ⇒ Time
- #specs ⇒ Spec
- #status ⇒ String
- #tags ⇒ Array<Latitude::API::Objects::Tag>
- #team ⇒ Latitude::API::Objects::Team
Attributes inherited from APIResource
#id, #meta, #path_params, #raw_data, #type
Class Method Summary collapse
- .deploy_config(id, opts = {}, path_params: {}) ⇒ Object
- .update_deploy_config(id, attributes = {}, opts = {}) ⇒ Object
Instance Method Summary collapse
Methods included from Operations::List
Methods included from Operations::Create
Methods included from Operations::Retrieve
Methods included from Operations::Update
Methods included from Operations::Delete
Methods included from Operations::Action
Methods inherited from APIResource
#==, #[], #[]=, #as_json, #attributes, #changed?, class_url, config_source, construct_from, #delete, execute_request, extract_path_params, #hash, id_prefix, #initialize, #inspect, instance_url, #method_missing, path_param_keys, #refresh, resource_path, resource_type, #resource_url, #respond_to_missing?, #save, #to_h, #unsaved_attributes, with_config, #write_attribute
Methods included from Attributes::ClassMethods
Methods included from Attributes::InstanceMethods
#attribute_spec, #read_attribute, #wrap_attribute
Constructor Details
This class inherits a constructor from Latitude::API::APIResource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Latitude::API::APIResource
Instance Attribute Details
#created_at ⇒ Time (readonly)
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#hostname ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#interfaces ⇒ Array<Interface>
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#ipmi_status ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#label ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#locked ⇒ Boolean
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#operating_system ⇒ OperatingSystem
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#plan ⇒ Plan
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#price ⇒ Integer
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#primary_ipv4 ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#primary_ipv6 ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#project ⇒ Latitude::API::Objects::Project
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#region ⇒ Region
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#rescue_allowed ⇒ Boolean
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#role ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#scheduled_deletion_at ⇒ Time
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#specs ⇒ Spec
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#status ⇒ String
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#tags ⇒ Array<Latitude::API::Objects::Tag>
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
#team ⇒ Latitude::API::Objects::Team
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 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 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 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 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/latitude/api/resources/server.rb', line 46 class Server < APIResource # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] facility # @return [String] # @!attribute [r] rack_id # @return [String] class Site < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :facility, :string, read_only: true attribute :rack_id, :string, read_only: true end # @!attribute [r] city # @return [String] # @!attribute [r] country # @return [String] # @!attribute [r] site # @return [Site] class Region < APIObject attribute :city, :string, read_only: true attribute :country, :string, read_only: true attribute :site, Site, read_only: true end # @!attribute [r] id # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] billing # @return [String] class Plan < APIObject attribute :id, :string, read_only: true attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :billing, :string, read_only: true end # @!attribute [r] role # @return [String] # @!attribute [r] name # @return [String] # @!attribute [r] mac_address # @return [String] # @!attribute [r] description # @return [String] class Interface < APIObject attribute :role, :string, read_only: true attribute :name, :string, read_only: true attribute :mac_address, :string, read_only: true attribute :description, :string, read_only: true end # @!attribute [r] raid # @return [Boolean] # @!attribute [r] ssh_keys # @return [Boolean] class Feature < APIObject attribute :raid, :boolean, read_only: true attribute :ssh_keys, :boolean, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] series # @return [String] class Distro < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :series, :string, read_only: true end # @!attribute [r] name # @return [String] # @!attribute [r] slug # @return [String] # @!attribute [r] version # @return [String] # @!attribute [r] features # @return [Feature] # @!attribute [r] distro # @return [Distro] class < APIObject attribute :name, :string, read_only: true attribute :slug, :string, read_only: true attribute :version, :string, read_only: true attribute :features, Feature, read_only: true attribute :distro, Distro, read_only: true end # @!attribute [r] cpu # @return [String] # @!attribute [r] disk # @return [String] # @!attribute [r] ram # @return [String] # @!attribute [r] nic # @return [String] # @!attribute [r] gpu # @return [String] class Spec < APIObject attribute :cpu, :string, read_only: true attribute :disk, :string, read_only: true attribute :ram, :string, read_only: true attribute :nic, :string, read_only: true attribute :gpu, :string, read_only: true end attribute :hostname, :string attribute :label, :string attribute :price, :integer attribute :ipmi_status, :string attribute :scheduled_deletion_at, :time attribute :status, :string attribute :role, :string attribute :primary_ipv4, :string attribute :created_at, :time, read_only: true attribute :locked, :boolean attribute :team, Objects::Team attribute :project, Objects::Project attribute :region, Region attribute :tags, [Objects::Tag] attribute :primary_ipv6, :string attribute :rescue_allowed, :boolean attribute :plan, Plan attribute :interfaces, [Interface] attribute :operating_system, attribute :specs, Spec resource_type "servers" resource_path "/servers" id_prefix "sv_" extend Operations::List extend Operations::Create extend Operations::Retrieve extend Operations::Update extend Operations::Delete extend Operations::Action action :power_action, path: "actions", type: "actions", accepts: i[action] action :reboot, path: "actions", type: "actions", attributes: { action: "reboot" } action :power_on, path: "actions", type: "actions", attributes: { action: "power_on" } action :power_off, path: "actions", type: "actions", attributes: { action: "power_off" } action :reset, path: "actions", type: "actions", attributes: { action: "reset" } action :lock, path: "lock" action :unlock, path: "unlock" action :rescue_mode, path: "rescue_mode" action :exit_rescue_mode, path: "exit_rescue_mode" action :remote_access, path: "remote_access" action :schedule_deletion, path: "schedule_deletion", accepts: i[at reason] action :unschedule_deletion, path: "schedule_deletion", method: :delete action :reinstall, path: "reinstall", type: "reinstalls", accepts: i[ ipxe hostname ssh_keys user_data raid partitions] action :create_out_of_band_connection, path: "out_of_band_connection", type: "out_of_band_connections", accepts: i[port ssh_key_id] action :list_out_of_band_connections, path: "out_of_band_connection", method: :get class << self def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end end def deploy_config(opts = {}) self.class.deploy_config(id, opts) end def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end end |
Class Method Details
.deploy_config(id, opts = {}, path_params: {}) ⇒ Object
218 219 220 221 222 223 224 225 226 227 |
# File 'lib/latitude/api/resources/server.rb', line 218 def deploy_config(id, opts = {}, path_params: {}) params = opts.is_a?(Hash) ? opts : {} path_params = extract_path_params(params, path_param_keys) if path_params.empty? parsed = execute_request( method: :get, path: "#{instance_url(id, path_params: path_params)}/deploy_config", opts: params, ) parsed end |
.update_deploy_config(id, attributes = {}, opts = {}) ⇒ Object
229 230 231 232 233 234 235 236 237 238 |
# File 'lib/latitude/api/resources/server.rb', line 229 def update_deploy_config(id, attributes = {}, opts = {}) body = JSONAPI.encode(type: "deploy_config", id: id, attributes: attributes) parsed = execute_request( method: :patch, path: "#{instance_url(id)}/deploy_config", body: body, opts: opts, ) parsed end |
Instance Method Details
#deploy_config(opts = {}) ⇒ Object
241 242 243 |
# File 'lib/latitude/api/resources/server.rb', line 241 def deploy_config(opts = {}) self.class.deploy_config(id, opts) end |
#update_deploy_config(attributes, opts = {}) ⇒ Object
245 246 247 |
# File 'lib/latitude/api/resources/server.rb', line 245 def update_deploy_config(attributes, opts = {}) self.class.update_deploy_config(id, attributes, opts) end |