Class: Fog::Compute::Openvz::Server
- Inherits:
-
Server
- Object
- Server
- Fog::Compute::Openvz::Server
- Defined in:
- lib/fog/openvz/models/compute/server.rb
Instance Method Summary collapse
- #compact(options = {}) ⇒ Object
- #convert(options = {}) ⇒ Object
- #destroy(options = {}) ⇒ Object
- #exec(args) ⇒ Object
- #exec2(args) ⇒ Object
- #mount(options = {}) ⇒ Object
- #persisted? ⇒ Boolean
- #public_ip_address ⇒ Object
- #public_ip_addresses ⇒ Object
- #quotainit(options = {}) ⇒ Object
- #quotaoff(options = {}) ⇒ Object
- #quotaon(options = {}) ⇒ Object
- #ready? ⇒ Boolean
- #reboot(options = {}) ⇒ Object (also: #restart)
- #resume(options = {}) ⇒ Object
- #runscript(args) ⇒ Object
-
#save ⇒ Object
vzctl create <ctid> [–ostemplate <name>] [–config <name>] [–layout ploop|simfs] [–hostname <name>] [–name <name>] [–ipadd <addr>] [–diskspace <kbytes>] [–private <path>] [–root <path>] [–local_uid <UID>] [–local_gid <GID>].
- #set(options) ⇒ Object
- #snapshot(options = {}) ⇒ Object
- #snapshot_delete(options = {}) ⇒ Object
- #snapshot_list(options = {}) ⇒ Object
- #snapshot_mount(options = {}) ⇒ Object
- #snapshot_switch(options = {}) ⇒ Object
- #snapshot_umount(options = {}) ⇒ Object
- #start ⇒ Object
- #stop(options = {}) ⇒ Object
- #suspend(options = {}) ⇒ Object
- #umount(options = {}) ⇒ Object
Instance Method Details
#compact(options = {}) ⇒ Object
109 110 111 |
# File 'lib/fog/openvz/models/compute/server.rb', line 109 def compact( = {}) data = service.compact_server(ctid, ) end |
#convert(options = {}) ⇒ Object
105 106 107 |
# File 'lib/fog/openvz/models/compute/server.rb', line 105 def convert( = {}) data = service.convert_server(ctid, ) end |
#destroy(options = {}) ⇒ Object
83 84 85 |
# File 'lib/fog/openvz/models/compute/server.rb', line 83 def destroy( = {}) data = service.destroy_server(ctid, ) end |
#exec(args) ⇒ Object
149 150 151 152 153 154 155 |
# File 'lib/fog/openvz/models/compute/server.rb', line 149 def exec(args) if args.is_a?(String) data = service.exec_server(ctid,[ args ]) else data = service.exec_server(ctid,args) end end |
#exec2(args) ⇒ Object
157 158 159 160 161 162 163 |
# File 'lib/fog/openvz/models/compute/server.rb', line 157 def exec2(args) if args.is_a?(String) data = service.exec2_server(ctid,[ args ]) else data = service.exec2_server(ctid,args) end end |
#mount(options = {}) ⇒ Object
87 88 89 |
# File 'lib/fog/openvz/models/compute/server.rb', line 87 def mount( = {}) data = service.mount_server(ctid, ) end |
#persisted? ⇒ Boolean
63 64 65 |
# File 'lib/fog/openvz/models/compute/server.rb', line 63 def persisted? ctid.nil? end |
#public_ip_address ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/fog/openvz/models/compute/server.rb', line 71 def public_ip_address if ip.nil? return nil else return ip.first end end |
#public_ip_addresses ⇒ Object
67 68 69 |
# File 'lib/fog/openvz/models/compute/server.rb', line 67 def public_ip_addresses return ip end |
#quotainit(options = {}) ⇒ Object
145 146 147 |
# File 'lib/fog/openvz/models/compute/server.rb', line 145 def quotainit( = {}) data = service.quotainit_server(ctid, ) end |
#quotaoff(options = {}) ⇒ Object
141 142 143 |
# File 'lib/fog/openvz/models/compute/server.rb', line 141 def quotaoff( = {}) data = service.quotaoff_server(ctid, ) end |
#quotaon(options = {}) ⇒ Object
137 138 139 |
# File 'lib/fog/openvz/models/compute/server.rb', line 137 def quotaon( = {}) data = service.quotaon_server(ctid, ) end |
#ready? ⇒ Boolean
186 187 188 |
# File 'lib/fog/openvz/models/compute/server.rb', line 186 def ready? status == 'running' end |
#reboot(options = {}) ⇒ Object Also known as: restart
99 100 101 |
# File 'lib/fog/openvz/models/compute/server.rb', line 99 def reboot( = {}) data = service.restart_server(ctid, ) end |
#resume(options = {}) ⇒ Object
177 178 179 |
# File 'lib/fog/openvz/models/compute/server.rb', line 177 def resume( = {}) data = service.resume_server(ctid, ) end |
#runscript(args) ⇒ Object
165 166 167 168 169 170 171 |
# File 'lib/fog/openvz/models/compute/server.rb', line 165 def runscript(args) if args.is_a?(String) data = service.runscript_server(ctid,[ args ]) else data = service.runscript_server(ctid,args) end end |
#save ⇒ Object
vzctl create <ctid> [–ostemplate <name>] [–config <name>]
[--layout ploop|simfs] [--hostname <name>] [--name <name>] [--ipadd <addr>]
[--diskspace <kbytes>] [--private <path>] [--root <path>]
[--local_uid <UID>] [--local_gid <GID>]
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fog/openvz/models/compute/server.rb', line 42 def save requires :ctid raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? = {} = { 'ctid' => ctid, 'ostemplate' => ostemplate, 'layout' => layout , 'hostname' => hostname, 'name' => name, 'ipadd' => ipadd, 'diskspace' => diskspace, 'private' => private, 'root' => root, 'local_uid' => local_uid, 'local_gid' => local_gid } data = service.create_server() reload end |
#set(options) ⇒ Object
182 183 184 |
# File 'lib/fog/openvz/models/compute/server.rb', line 182 def set() data = service.set_server(ctid,) end |
#snapshot(options = {}) ⇒ Object
113 114 115 |
# File 'lib/fog/openvz/models/compute/server.rb', line 113 def snapshot( = {}) data = service.snapshot_server(ctid, ) end |
#snapshot_delete(options = {}) ⇒ Object
121 122 123 |
# File 'lib/fog/openvz/models/compute/server.rb', line 121 def snapshot_delete( = {}) data = service.snapshot_delete_server(ctid, ) end |
#snapshot_list(options = {}) ⇒ Object
133 134 135 |
# File 'lib/fog/openvz/models/compute/server.rb', line 133 def snapshot_list( = {}) data = service.snapshot_list_server(ctid, ) end |
#snapshot_mount(options = {}) ⇒ Object
125 126 127 |
# File 'lib/fog/openvz/models/compute/server.rb', line 125 def snapshot_mount( = {}) data = service.snapshot_mount_server(ctid, ) end |
#snapshot_switch(options = {}) ⇒ Object
117 118 119 |
# File 'lib/fog/openvz/models/compute/server.rb', line 117 def snapshot_switch( = {}) data = service.snapshot_switch_server(ctid, ) end |
#snapshot_umount(options = {}) ⇒ Object
129 130 131 |
# File 'lib/fog/openvz/models/compute/server.rb', line 129 def snapshot_umount( = {}) data = service.snapshot_umount_server(ctid, ) end |
#start ⇒ Object
79 80 81 |
# File 'lib/fog/openvz/models/compute/server.rb', line 79 def start data = service.start_server(ctid) end |
#stop(options = {}) ⇒ Object
95 96 97 |
# File 'lib/fog/openvz/models/compute/server.rb', line 95 def stop( = {}) data = service.stop_server(ctid, ) end |
#suspend(options = {}) ⇒ Object
173 174 175 |
# File 'lib/fog/openvz/models/compute/server.rb', line 173 def suspend( = {}) data = service.suspend_server(ctid, ) end |
#umount(options = {}) ⇒ Object
91 92 93 |
# File 'lib/fog/openvz/models/compute/server.rb', line 91 def umount( = {}) data = service.umount_server(ctid, ) end |