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
107 108 109 |
# File 'lib/fog/openvz/models/compute/server.rb', line 107 def compact( = {}) data = service.compact_server(ctid, ) end |
#convert(options = {}) ⇒ Object
103 104 105 |
# File 'lib/fog/openvz/models/compute/server.rb', line 103 def convert( = {}) data = service.convert_server(ctid, ) end |
#destroy(options = {}) ⇒ Object
81 82 83 |
# File 'lib/fog/openvz/models/compute/server.rb', line 81 def destroy( = {}) data = service.destroy_server(ctid, ) end |
#exec(args) ⇒ Object
147 148 149 150 151 152 153 |
# File 'lib/fog/openvz/models/compute/server.rb', line 147 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
155 156 157 158 159 160 161 |
# File 'lib/fog/openvz/models/compute/server.rb', line 155 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
85 86 87 |
# File 'lib/fog/openvz/models/compute/server.rb', line 85 def mount( = {}) data = service.mount_server(ctid, ) end |
#persisted? ⇒ Boolean
61 62 63 |
# File 'lib/fog/openvz/models/compute/server.rb', line 61 def persisted? ctid.nil? end |
#public_ip_address ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/fog/openvz/models/compute/server.rb', line 69 def public_ip_address if ip.nil? return nil else return ip.first end end |
#public_ip_addresses ⇒ Object
65 66 67 |
# File 'lib/fog/openvz/models/compute/server.rb', line 65 def public_ip_addresses return ip end |
#quotainit(options = {}) ⇒ Object
143 144 145 |
# File 'lib/fog/openvz/models/compute/server.rb', line 143 def quotainit( = {}) data = service.quotainit_server(ctid, ) end |
#quotaoff(options = {}) ⇒ Object
139 140 141 |
# File 'lib/fog/openvz/models/compute/server.rb', line 139 def quotaoff( = {}) data = service.quotaoff_server(ctid, ) end |
#quotaon(options = {}) ⇒ Object
135 136 137 |
# File 'lib/fog/openvz/models/compute/server.rb', line 135 def quotaon( = {}) data = service.quotaon_server(ctid, ) end |
#ready? ⇒ Boolean
183 184 185 |
# File 'lib/fog/openvz/models/compute/server.rb', line 183 def ready? status == 'running' end |
#reboot(options = {}) ⇒ Object Also known as: restart
97 98 99 |
# File 'lib/fog/openvz/models/compute/server.rb', line 97 def reboot( = {}) data = service.restart_server(ctid, ) end |
#resume(options = {}) ⇒ Object
175 176 177 |
# File 'lib/fog/openvz/models/compute/server.rb', line 175 def resume( = {}) data = service.resume_server(ctid, ) end |
#runscript(args) ⇒ Object
163 164 165 166 167 168 169 |
# File 'lib/fog/openvz/models/compute/server.rb', line 163 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>]
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fog/openvz/models/compute/server.rb', line 40 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
179 180 181 |
# File 'lib/fog/openvz/models/compute/server.rb', line 179 def set() data = service.set_server(ctid,) end |
#snapshot(options = {}) ⇒ Object
111 112 113 |
# File 'lib/fog/openvz/models/compute/server.rb', line 111 def snapshot( = {}) data = service.snapshot_server(ctid, ) end |
#snapshot_delete(options = {}) ⇒ Object
119 120 121 |
# File 'lib/fog/openvz/models/compute/server.rb', line 119 def snapshot_delete( = {}) data = service.snapshot_delete_server(ctid, ) end |
#snapshot_list(options = {}) ⇒ Object
131 132 133 |
# File 'lib/fog/openvz/models/compute/server.rb', line 131 def snapshot_list( = {}) data = service.snapshot_list_server(ctid, ) end |
#snapshot_mount(options = {}) ⇒ Object
123 124 125 |
# File 'lib/fog/openvz/models/compute/server.rb', line 123 def snapshot_mount( = {}) data = service.snapshot_mount_server(ctid, ) end |
#snapshot_switch(options = {}) ⇒ Object
115 116 117 |
# File 'lib/fog/openvz/models/compute/server.rb', line 115 def snapshot_switch( = {}) data = service.snapshot_switch_server(ctid, ) end |
#snapshot_umount(options = {}) ⇒ Object
127 128 129 |
# File 'lib/fog/openvz/models/compute/server.rb', line 127 def snapshot_umount( = {}) data = service.snapshot_umount_server(ctid, ) end |
#start ⇒ Object
77 78 79 |
# File 'lib/fog/openvz/models/compute/server.rb', line 77 def start data = service.start_server(ctid) end |
#stop(options = {}) ⇒ Object
93 94 95 |
# File 'lib/fog/openvz/models/compute/server.rb', line 93 def stop( = {}) data = service.stop_server(ctid, ) end |
#suspend(options = {}) ⇒ Object
171 172 173 |
# File 'lib/fog/openvz/models/compute/server.rb', line 171 def suspend( = {}) data = service.suspend_server(ctid, ) end |
#umount(options = {}) ⇒ Object
89 90 91 |
# File 'lib/fog/openvz/models/compute/server.rb', line 89 def umount( = {}) data = service.umount_server(ctid, ) end |