OnApp Cloud API 4.1 Cloud OnApp Cloud 4.1 API Guide 1. OnApp 4.1 API Guide ............................................................................................................................................................................... 13 1.1 Change Log ..................................................................................................................................................................................... 14 1.2 Alerts................................................................................................................................................................................................ 15 1.3 Application Servers .......................................................................................................................................................................... 15 1.3.1 Create Application Server ....................................................................................................................................................... 16 1.4 Applications...................................................................................................................................................................................... 20 1.4.1 Get List of All Installed Applications ........................................................................................................................................ 20 1.4.2 Get List of All Available for Installation Applications ................................................................................................................ 21 1.4.3 Get Application Attributes ....................................................................................................................................................... 22 1.4.4 Install Application.................................................................................................................................................................... 23 1.4.5 Back Up Application................................................................................................................................................................ 23 1.4.6 Delete Application................................................................................................................................................................... 24 1.4.7 Get List of All Application Backups.......................................................................................................................................... 25 1.4.8 Restore Application Backup .................................................................................................................................................... 26 1.4.9 Remove Application Backup ................................................................................................................................................... 27 1.5 Assets .............................................................................................................................................................................................. 27 1.5.1 Get List of Assets.................................................................................................................................................................... 27 1.5.2 Get Asset Details .................................................................................................................................................................... 28 1.5.3 Get Lst of Unassigned Assets ................................................................................................................................................. 29 1.6 Auto-Backups................................................................................................................................................................................... 33 1.6.1 Auto-backup Presets .............................................................................................................................................................. 33 1.6.1.1 Get List of Auto-backup Presets .................................................................................................................................... 33 1.6.1.2 Get Auto-backup Preset Details .................................................................................................................................... 34 1.6.1.3 Edit Auto-backup Preset................................................................................................................................................ 35 1.6.2 Manage Auto-Backups ........................................................................................................................................................... 35 1.6.2.1 Enable auto-backups for VS .......................................................................................................................................... 35 1.6.2.2 Disable auto-backups for VS ......................................................................................................................................... 36 1.6.2.3 Enable Auto-backups for Disk ....................................................................................................................................... 36 1.6.2.4 Disable Auto-backups for Disk ...................................................................................................................................... 36 1.6.3 Schedules............................................................................................................................................................................... 37 1.6.3.1 Get List of All Schedules ............................................................................................................................................... 37 1.6.3.2 Get Schedule Details..................................................................................................................................................... 39 1.6.3.3 Get List of Schedules for a Disk .................................................................................................................................... 40 1.6.3.4 Get List of Virtual Server Schedules .............................................................................................................................. 41 1.6.3.5 Add Schedule to Disk .................................................................................................................................................... 44 1.6.3.6 Add Schedule to Virtual Server...................................................................................................................................... 45 1.6.3.7 Edit Disk Schedule ........................................................................................................................................................ 45 1.6.3.8 Edit Virtual Server Schedule.......................................................................................................................................... 46 1.6.3.9 Delete Disk Schedule .................................................................................................................................................... 47 1.6.3.10 Delete Virtual Server Schedule.................................................................................................................................... 47 1.7 Background Task Daemon ............................................................................................................................................................... 48 1.7.1 Get Background Task Daemon Status .................................................................................................................................... 48 1.7.2 Start Background Task Daemon ............................................................................................................................................. 48 1.7.3 Stop Background Task Daemon ............................................................................................................................................. 48 1.7.4 Reload Background Task Daemon ......................................................................................................................................... 49 1.8 Backups/ Snapshots......................................................................................................................................................................... 49 1.8.1 Get List of All VS Backups ...................................................................................................................................................... 49 1.8.2 Get List of Normal Backups .................................................................................................................................................... 52 1.8.3 Get List of Incremental Backups ............................................................................................................................................. 54 1.8.4 Get List of Disk Backups ......................................................................................................................................................... 56 1.8.5 Create Incremental Backup .................................................................................................................................................... 58 1.8.6 Create Disk Backup ................................................................................................................................................................ 58 1.8.7 Create Backups for All Disks................................................................................................................................................... 59 1.8.8 Convert Backup to Template................................................................................................................................................... 59 1.8.9 Delete Backup ........................................................................................................................................................................ 60 1.8.10 Restore Backup .................................................................................................................................................................... 60 1.8.11 Add/Edit Backup Note ........................................................................................................................................................... 61 1.9 Backup Servers ................................................................................................................................................................................ 61 1.9.1 Get List of Backup Servers ..................................................................................................................................................... 61 1.9.2 Get Backup Server Details ...................................................................................................................................................... 63 1.9.3 Add Backup Server ................................................................................................................................................................. 65 1.9.4 Edit Backup Server ................................................................................................................................................................. 65 1.9.5 Delete Backup Server ............................................................................................................................................................. 66 1.9.6 Search Backups ..................................................................................................................................................................... 66 1.9.7 Create Cloud Boot Backup Server .......................................................................................................................................... 69 1.10 Backup Server Zones ..................................................................................................................................................................... 70 1.10.1 Get List of Backup Server Zones .......................................................................................................................................... 70 1.10.2 Get Backup Server Zone Details ........................................................................................................................................... 70 1.10.3 Add Backup Server Zone ...................................................................................................................................................... 71 1.10.4 Edit Backup Server Zone ...................................................................................................................................................... 71 OnApp Cloud 4.1 API Guide 1.10.5 Delete Backup Server Zone .................................................................................................................................................. 72 1.10.6 Get List of Servers Assigned to Backup Server Zone ............................................................................................................ 73 OnApp Cloud 4.1 API Guide 1.10.7 Assign Backup Server to Backup Server Zone ...................................................................................................................... 73 1.10.8 Unassign Backup Server from Backup Server Zone.............................................................................................................. 74 1.11 Baremetal Servers.......................................................................................................................................................................... 74 1.11.1 Get List of Baremetal Servers ............................................................................................................................................... 74 1.11.2 Get Baremetal Server Details ............................................................................................................................................... 76 1.11.3 Create Baremetal Server ...................................................................................................................................................... 78 1.11.4 Delete Baremetal Server....................................................................................................................................................... 79 1.11.5 Add/Edit Admin/User Note for Baremetal Server ................................................................................................................... 80 1.11.6 Enable Recovery Mode for Baremetal Server ....................................................................................................................... 80 1.11.7 Disable Recovery Mode for Baremetal Server....................................................................................................................... 81 1.12 Billing Plans ................................................................................................................................................................................... 81 1.12.1 Get the List of Billing Plans ................................................................................................................................................... 83 1.12.2 Get Billing Plan Details ......................................................................................................................................................... 87 1.12.3 Add Billing Plan..................................................................................................................................................................... 91 1.12.4 Edit Billing Plan..................................................................................................................................................................... 94 1.12.5 Get Base Resources ............................................................................................................................................................. 94 1.12.5.1 Get List of Base Resources ......................................................................................................................................... 94 1.12.5.2 Get Backup Resource Details...................................................................................................................................... 98 1.12.5.3 Get Customer Networks Resource Details................................................................................................................... 100 1.12.5.4 Get Template, ISOs & Backup Storage Resource Details............................................................................................ 101 1.12.5.5 Get Template Resource Details................................................................................................................................... 102 1.12.5.6 Get Virtual Server Resource Details ............................................................................................................................ 103 1.12.5.7 Get VS Autoscaling Resource Details.......................................................................................................................... 105 1.12.5.8 Get Template Store Resource Details ......................................................................................................................... 106 1.12.5.9 Get Recipe Group Resource Details............................................................................................................................ 107 1.12.5.10 Get Compute Zone Resource Details ........................................................................................................................ 109 1.12.5.11 Get Data Store Zone Resource Details...................................................................................................................... 112 1.12.5.12 Get Network Zone Resource Details.......................................................................................................................... 113 1.12.5.13 Get Edge Group Resource Details ............................................................................................................................ 115 1.12.5.14 Get Backup Server Zone Resource Details ............................................................................................................... 116 1.12.5.15 Get MinIOPS Resource Details ................................................................................................................................. 118 1.12.5.16 Get Instance Types Resource Details........................................................................................................................ 119 1.12.6 Add Base Resources to Billing Plan ...................................................................................................................................... 121 1.12.6.1 Add Limits for User VSs .............................................................................................................................................. 121 1.12.6.2 Add Limits for Template Store ..................................................................................................................................... 122 1.12.6.3 Add Limits for Recipe Groups ...................................................................................................................................... 122 1.12.6.4 Add Limits for Compute Zones .................................................................................................................................... 123 1.12.6.4.1 Add Compute Zone Base Resource to Master Bucket Zone............................................................................... 124 1.12.6.5 Add Limits for Data Store Zones.................................................................................................................................. 125 1.12.6.5.1 Add Data Store Zone Base Resource to Master Template Zone ........................................................................ 126 1.12.6.6 Add Limits for Network Zones...................................................................................................................................... 127 1.12.6.6.1 Add Network Zone Base Resource to Master Template Zone ............................................................................ 128 1.12.6.7 Add Limits for Edge Groups......................................................................................................................................... 129 1.12.6.8 Add Limits for Backup Server Zones ........................................................................................................................... 130 1.12.6.9 Add Limits for minIOPS ............................................................................................................................................... 131 1.12.6.10 Add Limits for Instance Types ................................................................................................................................... 132 1.12.7 Edit Base Resources ............................................................................................................................................................ 133 1.12.7.1 Edit Virtual Server Base Resource Limits .................................................................................................................... 133 1.12.7.2 Edit Autoscaling Base Resource Limits ....................................................................................................................... 134 1.12.7.3 Edit Backups Base Resource Limits ............................................................................................................................ 134 1.12.7.4 Edit Customer Network Base Resource Limits ............................................................................................................ 135 1.12.7.5 Edit Template Base Resource Limits ........................................................................................................................... 136 1.12.7.6 Edit Templates, ISOs & Backups Storage Base Resource Limits ................................................................................ 136 1.12.7.7 Edit ISO Base Resource Limits ................................................................................................................................... 137 1.12.7.8 Edit Limits for Template Store ..................................................................................................................................... 138 1.12.7.9 Edit Limits for Recipe Groups ...................................................................................................................................... 138 1.12.7.10 Edit Limits & Pricing for Compute Zones ................................................................................................................... 139 1.12.7.11 Edit Limits & Pricing for Data Store Zones ................................................................................................................. 142 1.12.7.12 Edit Limits & Pricing for Network Zones ..................................................................................................................... 144 1.12.7.13 Edit Limits for Edge Groups ....................................................................................................................................... 146 1.12.7.14 Edit Limits & Pricing for Backup Server Zones ........................................................................................................... 147 1.12.7.15 Edit Limits for Instance Types.................................................................................................................................... 149 1.12.8 Delete Base Resource From Billing Plan............................................................................................................................... 150 1.12.9 Add Base Resource to Master Bucket Zone.......................................................................................................................... 151 1.12.10 Remove Base Resource from Master Bucket Zone ............................................................................................................. 151 1.12.11 Add Base Resource to Master Template Zone .................................................................................................................... 152 1.12.12 Remove Base Resource From Master Template Zone ........................................................................................................ 152 1.12.13 Delete Billing Plan............................................................................................................................................................... 153 1.13 Blueprints ....................................................................................................................................................................................... 153 1.13.1 Get List of Blueprints ............................................................................................................................................................ 153 OnApp Cloud 4.1 API Guide 1.13.2 Get Blueprint Details ............................................................................................................................................................. 154 1.13.3 Add Blueprint ........................................................................................................................................................................ 155 OnApp Cloud 4.1 API Guide 1.13.4 Delete Blueprint .................................................................................................................................................................... 156 1.14 Blueprint Template Groups............................................................................................................................................................. 157 1.14.1 Get List of Blueprint Template Groups .................................................................................................................................. 157 1.14.2 Get Blueprint Template Group Details................................................................................................................................... 159 1.14.3 Add Blueprint Template Group.............................................................................................................................................. 159 1.14.4 Edit Blueprint Template Group .............................................................................................................................................. 160 1.14.5 Delete Blueprint Template Group .......................................................................................................................................... 161 1.14.6 Add Child Blueprint Template Group ..................................................................................................................................... 162 1.14.7 Get List of Blueprint Templates Attached to Blueprint Template Group ................................................................................. 163 1.14.8 Attach Blueprint Template to Group ...................................................................................................................................... 164 1.14.9 Remove Blueprint Template from Blueprint Temlate Group .................................................................................................. 165 1.15 Blueprint Templates ....................................................................................................................................................................... 165 1.15.1 Get List of Blueprint Templates ............................................................................................................................................. 165 1.15.2 Get Blueprint Template Details ............................................................................................................................................. 166 1.15.3 Add Blueprint Template ........................................................................................................................................................ 167 1.15.4 Edit Blueprint Template......................................................................................................................................................... 168 1.15.5 Delete Blueprint Template .................................................................................................................................................... 169 1.16 CDN Edge Groups ......................................................................................................................................................................... 170 1.16.1 Get List of CDN Edge Groups ............................................................................................................................................... 170 1.16.2 Get List of Available CDN Edge Groups ................................................................................................................................ 171 1.16.3 Get CDN Edge Group Details ............................................................................................................................................... 172 1.16.4 Add CDN Edge Group .......................................................................................................................................................... 174 1.16.5 Edit CDN Edge Group........................................................................................................................................................... 174 1.16.6 Delete CDN Edge Group ...................................................................................................................................................... 174 1.16.7 Assign Location to CDN Edge Group .................................................................................................................................... 175 1.16.8 Unassign Location From CDN Edge Group........................................................................................................................... 176 1.16.9 Modify CDN Edge Group ...................................................................................................................................................... 176 1.16.10 Search CDN Edge Groups .................................................................................................................................................. 177 1.17 CDN Edge Servers ......................................................................................................................................................................... 178 1.17.1 Get List of CDN Edge Servers .............................................................................................................................................. 178 1.17.2 Get CDN Edge Server Details ............................................................................................................................................... 182 1.17.3 Add CDN Edge Server .......................................................................................................................................................... 186 1.17.4 Edit CDN Edge Server .......................................................................................................................................................... 188 1.17.5 Reboot CDN Edge Server ..................................................................................................................................................... 188 1.17.6 Reboot CDN Edge Server in Recovery ................................................................................................................................. 189 1.17.7 Start up CDN Edge Server .................................................................................................................................................... 189 1.17.8 Shut down CDN Edge Server ............................................................................................................................................... 189 1.17.9 Stop CDN Edge Server ......................................................................................................................................................... 190 1.17.10 Rebuild CDN Edge Server .................................................................................................................................................. 190 1.17.11 Suspend CDN Edge Server ................................................................................................................................................ 190 1.17.12 Rerun CDN Edge Server Creation Scripts........................................................................................................................... 191 1.17.13 Unlock CDN Edge Server ................................................................................................................................................... 191 1.17.14 Delete CDN Edge Server .................................................................................................................................................... 192 1.17.15 Migrate CDN Edge Server .................................................................................................................................................. 192 1.17.16 Segregate CDN Edge Server .............................................................................................................................................. 192 1.17.17 Open CDN Edge Server Console ........................................................................................................................................ 193 1.17.18 Change CDN Edge Server Owner....................................................................................................................................... 193 1.17.19 Set VIP Status for CDN Edge Server .................................................................................................................................. 193 1.17.20 Add/Edit Admin/User Note for CDN Edge Server ................................................................................................................ 194 1.17.21 CDN Edge Server Disks ..................................................................................................................................................... 195 1.17.22 CDN Edge Server Network Interfaces ................................................................................................................................. 195 1.17.23 CDN Edge Server IP Address Joins .................................................................................................................................... 196 1.17.24 Rebuild Network for CDN Edge Server ............................................................................................................................... 199 1.17.25 Get CDN Edge Server Billing Statistics ............................................................................................................................... 200 1.17.26 Get CDN Edge Server CPU Usage Statistics ...................................................................................................................... 204 1.17.27 Search CDN Edge Server by Label ..................................................................................................................................... 204 1.18 CDN Resources ............................................................................................................................................................................. 204 1.18.1 Get List of CDN Resources ................................................................................................................................................... 205 1.18.2 Get CDN Resource Basic Details.......................................................................................................................................... 206 1.18.3 Get CDN Resource Advanced Details................................................................................................................................... 208 1.18.4 Add HTTP CDN Resource .................................................................................................................................................... 209 1.18.5 Add Video on Demand CDN Resource ................................................................................................................................. 210 1.18.6 Add Live Streaming CDN Resource ...................................................................................................................................... 211 1.18.7 Add HTTP Pull CDN Resource with Advanced Settings ........................................................................................................ 213 1.18.8 Add HTTP Push CDN Resource with Advanced Settings ...................................................................................................... 216 1.18.9 Add VoD Push CDN Resource With Advanced Settings ....................................................................................................... 219 1.18.10 Add VoD Pull CDN Resource With Advanced Settings........................................................................................................ 220 1.18.11 Add Live Streaming CDN Resource with Advanced Settings............................................................................................... 222 1.18.12 Edit CDN Resource ............................................................................................................................................................ 224 1.18.13 Edit HTTP Pull CDN Resource with Advanced Settings ...................................................................................................... 225 OnApp Cloud 4.1 API Guide 1.18.14 Edit HTTP Push CDN Resource with Advanced Settings .................................................................................................... 227 1.18.15 Edit VoD Push CDN Resource with Advanced Settings ...................................................................................................... 230 OnApp Cloud 4.1 API Guide 1.18.16 Edit VoD Pull CDN Resource with Advanced Settings......................................................................................................... 231 1.18.17 Edit Live Streaming CDN Resource with Advanced Settings ............................................................................................... 232 1.18.18 Delete CDN Resource ........................................................................................................................................................ 234 1.18.19 Change CDN Resource FTP Password .............................................................................................................................. 234 1.18.20 Prefetch CDN Resource Content ........................................................................................................................................ 235 1.18.21 Purge CDN Resource Content ............................................................................................................................................ 236 1.18.22 View CDN Resource Bandwidth Statistics........................................................................................................................... 238 1.18.23 View CDN Resource Streaming Statistics ........................................................................................................................... 241 1.18.24 View CDN Resource Billing Statistics .................................................................................................................................. 242 1.18.25 View CDN Resource Raw Log Configuration ...................................................................................................................... 243 1.18.26 Edit CDN Resource Raw Log Configuration ........................................................................................................................ 244 1.18.27 Get Instruction for Live Streaming CDN Internal Resource .................................................................................................. 246 1.18.28 Search CDN Resource ....................................................................................................................................................... 248 1.18.29 Suspend CDN Resource ..................................................................................................................................................... 249 1.18.30 Resume CDN Resource ..................................................................................................................................................... 250 1.18.31 View CDN Advanced Reporting .......................................................................................................................................... 250 1.18.32 Get List of Available Storage Locations ............................................................................................................................... 252 1.19 CDN SSL Certificates ..................................................................................................................................................................... 253 1.19.1 Get List of Custom SNI SSL Certificates ............................................................................................................................... 254 1.19.2 Get Custom SNI SSL Certificate Details ............................................................................................................................... 254 1.19.3 Add Custom SNI SSL Certificate........................................................................................................................................... 256 1.19.4 Edit Custom SNI SSL Certificate ........................................................................................................................................... 259 1.19.5 Delete Custom SNI SSL Certificate ....................................................................................................................................... 262 1.19.6 Add Custom SNI SSL Certificate to CDN Resource .............................................................................................................. 262 1.20 CDN Storage Servers..................................................................................................................................................................... 262 1.20.1 Get List of CDN Storage Servers .......................................................................................................................................... 263 1.20.2 Get List of HTTP Storage Servers ......................................................................................................................................... 266 1.20.3 Get List of Streaming Storage Servers .................................................................................................................................. 266 1.20.4 Get CDN Storage Server Details........................................................................................................................................... 266 1.20.5 Add CDN Storage Server ...................................................................................................................................................... 269 1.20.6 Edit CDN Storage Server ...................................................................................................................................................... 270 1.20.7 Reboot CDN Storage Server................................................................................................................................................. 270 1.20.8 Start up CDN Storage Server ................................................................................................................................................ 271 1.20.9 Shut down CDN Storage Server ........................................................................................................................................... 271 1.20.10 Stop CDN Storage Server ................................................................................................................................................... 271 1.20.11 Rebuild CDN Storage Server .............................................................................................................................................. 272 1.20.12 Suspend CDN Storage Server ............................................................................................................................................ 272 1.20.13 Unlock CDN Storage Server ............................................................................................................................................... 273 1.20.14 Set VIP Status for CDN Storage Server .............................................................................................................................. 273 1.20.15 Delete CDN Storage Server ................................................................................................................................................ 273 1.20.16 Migrate CDN Storage Server .............................................................................................................................................. 274 1.20.17 Segregate CDN Storage Server .......................................................................................................................................... 274 1.20.18 Resize CDN Storage Server ............................................................................................................................................... 275 1.20.19 Change CDN Storage Server Owner .................................................................................................................................. 275 1.20.20 Rebuild Network for CDN Storage Server ........................................................................................................................... 276 1.20.21 CDN Storage Server Disks ................................................................................................................................................. 276 1.20.22 CDN Storage Server Network Interfaces ............................................................................................................................. 276 1.20.23 CDN Storage Server IP Address Joins ................................................................................................................................ 277 1.20.24 Get CDN Storage Server CPU Usage Statistics .................................................................................................................. 279 1.20.25 Get CDN Storage Server Hourly Statistics .......................................................................................................................... 280 1.20.26 Get CDN Storage Server Billing Statistics ........................................................................................................................... 281 1.20.27 Search CDN Storage Server by Label ................................................................................................................................. 285 1.20.28 Get List of CDN Storage Server Backups............................................................................................................................ 286 1.20.29 Add/Edit Admin/User Note for CDN Storage Server ............................................................................................................ 287 1.21 CDN Usage Statistics ..................................................................................................................................................................... 288 1.22 Check Password Strength .............................................................................................................................................................. 289 1.23 CloudBoot IP Addresses ................................................................................................................................................................ 289 1.23.1 Get List of CloudBoot IP Addresses ...................................................................................................................................... 289 1.23.2 Add CloudBoot IP Address ................................................................................................................................................... 290 1.23.3 Edit CloudBoot IP Address.................................................................................................................................................... 291 1.23.4 Delete Cloud Boot IP Address .............................................................................................................................................. 292 1.24 Currencies...................................................................................................................................................................................... 292 1.24.1 Get List of Currencies ........................................................................................................................................................... 292 1.24.2 Get Currency Details ............................................................................................................................................................ 293 1.24.3 Add Currency........................................................................................................................................................................ 294 1.24.4 Edit Currency ........................................................................................................................................................................ 294 1.24.5 Delete Currency.................................................................................................................................................................... 295 1.25 Customer Networks ........................................................................................................................................................................ 295 1.25.1 Get List of Customer Networks ............................................................................................................................................. 296 1.25.2 Get List of User Customer Networks ..................................................................................................................................... 297 OnApp Cloud 4.1 API Guide 1.25.3 Add Customer Network ......................................................................................................................................................... 297 1.25.4 Delete Customer Network ..................................................................................................................................................... 298 OnApp Cloud 4.1 API Guide 1.26 Customer VLANs ........................................................................................................................................................................... 298 1.26.1 Get List of Customer VLANs ................................................................................................................................................. 298 1.26.2 Get Customer VLAN Details ................................................................................................................................................. 299 1.26.3 Add Customer VLAN ............................................................................................................................................................ 300 1.26.4 Edit Customer VLAN............................................................................................................................................................. 300 1.26.5 Delete Customer VLAN......................................................................................................................................................... 301 1.27 Custom Recipe Variables ............................................................................................................................................................... 301 1.27.1 Get List of Custom Variables ................................................................................................................................................ 301 1.27.2 Get Custom Variable Details ................................................................................................................................................. 302 1.27.3 Edit Custom Variable ............................................................................................................................................................ 303 1.27.4 Add Custom Variable ............................................................................................................................................................ 304 1.27.5 Delete Custom Variable ........................................................................................................................................................ 305 1.27.6 Get List of Virtual Server Custom Variables .......................................................................................................................... 305 1.27.7 Get List of Smart Server Custom Variables ........................................................................................................................... 306 1.27.8 Get List of Baremetal Server Variables ................................................................................................................................. 307 1.27.9 Get Virtual Server Custom Variable Details........................................................................................................................... 308 1.27.10 Get Smart Server Custom Variable Details ......................................................................................................................... 309 1.27.11 Get Baremetal Server Custom Variable Details................................................................................................................... 310 1.27.12 Add Virtual Server Custom Variable .................................................................................................................................... 311 1.27.13 Add Smart Server Custom Variable .................................................................................................................................... 312 1.27.14 Add Baremetal Server Custom Variable .............................................................................................................................. 313 1.27.15 Edit Virtual Server Custom Variable .................................................................................................................................... 314 1.27.16 Edit Smart Server Custom Variable..................................................................................................................................... 314 1.27.17 Edit Baremetal Server Custom Variable .............................................................................................................................. 315 1.27.18 Delete Virtual Server Custom Variable ................................................................................................................................ 316 1.27.19 Delete Smart Server Custom Variable ................................................................................................................................ 316 1.27.20 Delete Baremetal Server Custom Variable .......................................................................................................................... 316 1.28 Data Stores .................................................................................................................................................................................... 317 1.28.1 Get List of Data Stores.......................................................................................................................................................... 317 1.28.2 Get Data Store Details .......................................................................................................................................................... 318 1.28.3 Add LVM Data Store ............................................................................................................................................................. 319 1.28.4 Add VMware Data Store ....................................................................................................................................................... 319 1.28.5 Add SolidFire Data Store ...................................................................................................................................................... 320 1.28.6 Edit LVM Data Store ............................................................................................................................................................. 321 1.28.7 Edit SolidFire Data Store ...................................................................................................................................................... 322 1.28.8 Delete Data Store ................................................................................................................................................................. 323 1.29 Data Store Zones ........................................................................................................................................................................... 323 1.29.1 Get List of Data Store Zones ................................................................................................................................................. 323 1.29.2 Get Data Store Zone Details ................................................................................................................................................. 324 1.29.3 Add Data Store Zone ............................................................................................................................................................ 325 1.29.4 Edit Data Store Zone ............................................................................................................................................................ 325 1.29.5 Delete Data Store Zone ........................................................................................................................................................ 326 1.29.6 Get the List of Data Stores Attached to Data Store Zone ...................................................................................................... 326 1.29.7 Attach Data Store to Data Store Zone ................................................................................................................................... 327 1.29.8 Detach Data Store from Data Store Zone.............................................................................................................................. 327 1.30 Disks .............................................................................................................................................................................................. 328 1.30.1 Get List of Disks.................................................................................................................................................................... 328 1.30.2 Get List of VS Disks .............................................................................................................................................................. 329 1.30.3 Add New Disk ....................................................................................................................................................................... 331 1.30.4 Edit Disk ............................................................................................................................................................................... 331 1.30.5 Migrate Disk.......................................................................................................................................................................... 332 1.30.6 Delete Disk ........................................................................................................................................................................... 333 1.30.7 View Disk IOPS .................................................................................................................................................................... 333 1.30.8 Build Disk ............................................................................................................................................................................. 334 1.30.9 Unlock Disk .......................................................................................................................................................................... 335 1.30.10 Get List of Backups Available for a Disk .............................................................................................................................. 335 1.31 DNS Setup ..................................................................................................................................................................................... 336 1.31.1 Get DNS Domain Details ...................................................................................................................................................... 337 1.31.2 Set Up DNS Domain ............................................................................................................................................................. 337 1.31.3 Edit DNS Domain.................................................................................................................................................................. 337 1.31.4 Get List of Glue Records ....................................................................................................................................................... 338 1.32 DNS Zones .................................................................................................................................................................................... 338 1.32.1 Get List of Own DNS Zones .................................................................................................................................................. 338 1.32.2 Get Domain Zone Details ...................................................................................................................................................... 339 1.32.3 Get List of Users DNS Zones ................................................................................................................................................ 339 1.32.4 Add DNS Zone ..................................................................................................................................................................... 340 1.32.5 Delete DNS Zone.................................................................................................................................................................. 340 1.32.6 Get List of Name Servers ...................................................................................................................................................... 341 1.32.7 Get List of DNS Zone Records .............................................................................................................................................. 341 1.32.8 Get DNS Record Details ....................................................................................................................................................... 344 OnApp Cloud 4.1 API Guide 1.32.9 Add DNS Record .................................................................................................................................................................. 345 1.32.10 Edit DNS Records............................................................................................................................................................... 345 OnApp Cloud 4.1 API Guide 1.32.11 Delete DNS Record ............................................................................................................................................................ 347 1.33 Embed Statistics Charts ................................................................................................................................................................. 347 1.34 Firewall Rules for VSs .................................................................................................................................................................... 350 1.34.1 Get List of Firewall Rules ...................................................................................................................................................... 350 1.34.2 Apply Firewall Rule ............................................................................................................................................................... 350 1.34.3 Add Firewall Rule.................................................................................................................................................................. 351 1.34.4 Edit Firewall Rule .................................................................................................................................................................. 351 1.34.5 Delete Firewall Rule.............................................................................................................................................................. 352 1.34.6 Change Firewall Rule Position .............................................................................................................................................. 353 1.34.7 Set Default Firewall Rules ..................................................................................................................................................... 353 1.35 Firewalls ......................................................................................................................................................................................... 354 1.35.1 Get List of Firewalls .............................................................................................................................................................. 354 1.35.2 Get Firewall Details............................................................................................................................................................... 355 1.35.3 Add Firewall .......................................................................................................................................................................... 356 1.35.4 Edit Firewall .......................................................................................................................................................................... 356 1.35.5 Delete Firewall ...................................................................................................................................................................... 357 1.36 High Availability Control Panel........................................................................................................................................................ 357 1.36.1 Get List of Clusters ............................................................................................................................................................... 358 1.36.2 Get Status of OnApp Subsystems ......................................................................................................................................... 359 1.36.3 Update High Availability Clusters .......................................................................................................................................... 360 1.37 Compute Resources....................................................................................................................................................................... 361 1.37.1 Get List of Compute Resources ............................................................................................................................................ 361 1.37.2 Get Compute Resource Details............................................................................................................................................. 365 1.37.3 Add Xen/KVM Compute Resource ........................................................................................................................................ 369 1.37.4 Add CloudBoot Compute Resource ...................................................................................................................................... 370 1.37.5 Add Smart CloudBoot Compute Resource ............................................................................................................................ 374 1.37.6 Add Baremetal CloudBoot Compute Resource ..................................................................................................................... 378 1.37.7 Add VMware Compute Resource .......................................................................................................................................... 379 1.37.8 Edit Xen/KVM Compute Resource ........................................................................................................................................ 380 1.37.9 Edit CloudBoot Compute Resource ...................................................................................................................................... 380 1.37.10 Edit Smart CloudBoot Compute Resource .......................................................................................................................... 382 1.37.11 Edit Baremetal CloudBoot Compute Resource.................................................................................................................... 383 1.37.12 Reboot Compute Resource................................................................................................................................................. 384 1.37.13 Delete Compute Resource .................................................................................................................................................. 384 1.37.14 Edit VMware Compute Resource ........................................................................................................................................ 385 1.37.15 Get List of VSs Running on Compute Resource .................................................................................................................. 385 1.37.16 Get List of Data Store Joins Attached to Compute Resource .............................................................................................. 386 1.37.17 Get List of Data Stores Attached to Compute Resource ...................................................................................................... 386 1.37.18 Add Data Store Join to Compute Resource ......................................................................................................................... 387 1.37.19 Remove Data Store Join from Compute Resource .............................................................................................................. 388 1.37.20 Get List of Compute Resource Network Joins ..................................................................................................................... 388 1.37.21 Add Network Join to Compute Resource............................................................................................................................. 389 1.37.22 Remove Network Join from Compute Resource.................................................................................................................. 389 1.37.23 Power Cycle CloudBoot Compute Resource ....................................................................................................................... 389 1.38 Compute Zones.............................................................................................................................................................................. 390 1.38.1 Get List of Compute Zones ................................................................................................................................................... 390 1.38.2 Get Compute Zone Details.................................................................................................................................................... 392 1.38.3 Add Compute Zone............................................................................................................................................................... 395 1.38.4 Edit Compute Zone ............................................................................................................................................................... 396 1.38.5 Delete Compute Zone ........................................................................................................................................................... 398 1.38.6 Get List of Compute Resources Attached to Compute Zone ................................................................................................. 398 1.38.7 Attach Compute Resource to Compute Zone ........................................................................................................................ 398 1.38.8 Remove Compute Resource from Compute Zone................................................................................................................. 399 1.38.9 Get the List of Data Store Joins Attached to Compute Zone.................................................................................................. 399 1.38.10 Add Data Store Join to Compute Zone ................................................................................................................................ 400 1.38.11 Remove Data Store Join from Compute Zone ..................................................................................................................... 400 1.38.12 Get List of Network Joins Attached to Compute Zone ......................................................................................................... 401 1.38.13 Add Network Join to Compute Zone.................................................................................................................................... 402 1.38.14 Remove Network Join from Compute Zone......................................................................................................................... 402 1.39 Instance Types ............................................................................................................................................................................... 402 1.39.1 Get List of Instance Types .................................................................................................................................................... 402 1.39.2 Get Instance Type Details ..................................................................................................................................................... 403 1.39.3 Edit Instance Type ................................................................................................................................................................ 404 1.39.4 Add Instance Type ................................................................................................................................................................ 405 1.39.5 Delete Instance Type ............................................................................................................................................................ 406 1.40 Integrated Storage ......................................................................................................................................................................... 406 1.40.1 Get List of Integrated Storage Data Stores............................................................................................................................ 406 1.40.2 Get Integrated Data Store Details ......................................................................................................................................... 407 1.40.3 Add Integrated Storage Data Store ....................................................................................................................................... 408 1.40.4 Edit Integrated Data Store .................................................................................................................................................... 409 OnApp Cloud 4.1 API Guide 1.40.5 Delete Integrated Storage Data Store ................................................................................................................................... 410 1.40.6 Add Disk Drive to Integrated Storage Data Store .................................................................................................................. 410 OnApp Cloud 4.1 API Guide 1.40.7 Remove Disk Drive from Integrated Storage Data Store ....................................................................................................... 411 1.40.8 Get Storage Node IO Statistics ............................................................................................................................................. 412 1.40.9 Get Integrated Storage Datastore Disk IO Statistics .............................................................................................................. 413 1.40.10 Forget Storage Node .......................................................................................................................................................... 414 1.40.11 Get List of Backend Nodes on Integrated Storage Data Store ............................................................................................. 414 1.40.12 Get List of Integrated Storage Data Stores Disk Drives ....................................................................................................... 415 1.41 IP Addresses .................................................................................................................................................................................. 416 1.41.1 Get List of Network IP Addresses ......................................................................................................................................... 416 1.41.2 Add IP Address Record ........................................................................................................................................................ 416 1.41.3 Edit IP Address ..................................................................................................................................................................... 417 1.41.4 Delete IP address ................................................................................................................................................................. 418 1.41.5 Assign IP Address to User .................................................................................................................................................... 418 1.41.6 Unassign IP Address from User ............................................................................................................................................ 419 1.42 IP Address Joins ............................................................................................................................................................................ 419 1.42.1 Get List of IP Address Joins .................................................................................................................................................. 419 1.42.2 Assign IP Address Join to VS ............................................................................................................................................... 420 1.42.3 Delete IP Address Join ......................................................................................................................................................... 421 1.43 IP Address Pools............................................................................................................................................................................ 421 1.43.1 Get List of IP Address Pools ................................................................................................................................................. 422 1.43.2 Get IP Address Pool Details.................................................................................................................................................. 423 1.43.3 Add New IP Address Pool ..................................................................................................................................................... 424 1.43.4 Delete IP Address Pool ......................................................................................................................................................... 425 1.44 ISOs ............................................................................................................................................................................................... 425 1.44.1 Get List of ISOs .................................................................................................................................................................... 425 1.44.2 Get ISO Details ..................................................................................................................................................................... 427 1.44.3 Get List of Public ISOs .......................................................................................................................................................... 429 1.44.4 Get List of ISOs of Particular User ........................................................................................................................................ 431 1.44.5 Get List of User ISOs ............................................................................................................................................................ 433 1.44.6 Get List of Own ISOs ............................................................................................................................................................ 435 1.44.7 Update ISO........................................................................................................................................................................... 437 1.44.8 Add New ISO ........................................................................................................................................................................ 438 1.44.9 Make ISO Public ................................................................................................................................................................... 438 1.44.10 Delete ISO .......................................................................................................................................................................... 439 1.45 License .......................................................................................................................................................................................... 439 1.45.1 Get License Details............................................................................................................................................................... 439 1.45.2 Edit License Details .............................................................................................................................................................. 440 1.46 Load Balancers .............................................................................................................................................................................. 440 1.46.1 Get List of Load Balancers .................................................................................................................................................... 440 1.46.2 Get Load Balancer Details .................................................................................................................................................... 444 1.46.3 Get the List of Load Balancing Clusters ................................................................................................................................ 450 1.46.4 Get Load Balancing Cluster Details....................................................................................................................................... 455 1.46.5 Get Load Balancer Billing Statistics....................................................................................................................................... 460 1.46.6 Get List of Load Balancer Autoscaling Monitors .................................................................................................................... 463 1.46.7 Get Load Balancer Autoscaling Monitor Details .................................................................................................................... 467 1.46.8 Add Load Balancing Cluster.................................................................................................................................................. 471 1.46.9 Add Autoscaling Cluster........................................................................................................................................................ 472 1.46.10 Add Nodes to Cluster Type ................................................................................................................................................. 473 1.46.11 Remove Nodes from Cluster Type ...................................................................................................................................... 473 1.46.12 Edit Load Balancing Cluster ................................................................................................................................................ 474 1.46.13 Edit Autoscaling Cluster ...................................................................................................................................................... 475 1.46.14 Edit Load Balancing Cluster Ports ....................................................................................................................................... 475 1.46.15 Delete Load Balancing Cluster ............................................................................................................................................ 476 1.46.16 Rebuild Load Balancer........................................................................................................................................................ 476 1.46.17 Search Load Balancer by Label .......................................................................................................................................... 477 1.46.18 Start up Load Balancer ....................................................................................................................................................... 477 1.46.19 Shut down Load Balancer ................................................................................................................................................... 477 1.46.20 Suspend Load Balancer...................................................................................................................................................... 478 1.46.21 Stop Load Balancer ............................................................................................................................................................ 478 1.46.22 Unlock Load Balancer ......................................................................................................................................................... 478 1.47 Locales .......................................................................................................................................................................................... 479 1.48 Location Groups ............................................................................................................................................................................. 479 1.48.1 Get List of Location Groups .................................................................................................................................................. 479 1.48.2 Get Location Group Details ................................................................................................................................................... 481 1.48.3 Refresh Location Groups ...................................................................................................................................................... 481 1.48.4 Attach Compute Zone to Location Group .............................................................................................................................. 482 1.48.5 Detach Compute Zone from Location Group ......................................................................................................................... 482 1.48.6 Attach Data Store Zone to Location Group............................................................................................................................ 482 1.48.7 Detach Data Store Zone from Location Group ...................................................................................................................... 483 1.48.8 Attach Network Zone to Location Group ............................................................................................................................... 483 1.48.9 Detach Network Zone from Location Group .......................................................................................................................... 483 OnApp Cloud 4.1 API Guide 1.48.10 Attach Backup Server Zone to Location Group ................................................................................................................... 484 1.48.11 Detach Backup Server Zone from Location Group .............................................................................................................. 484 OnApp Cloud 4.1 API Guide 1.48.12 Get List of Compute Zones Attached to Location Group...................................................................................................... 485 1.48.13 Get List of Data Store Zones Attached to Location Group ................................................................................................... 486 1.48.14 Get List of Network Zones Attached to Location Group ....................................................................................................... 487 1.48.15 Get List of Backup Server Zones Attached to Location Group ............................................................................................. 488 1.48.16 Attach CDN Location to Location Group.............................................................................................................................. 489 1.48.17 Detach CDN Location from Location Group ........................................................................................................................ 489 1.48.18 Get List of CDN Locations................................................................................................................................................... 489 1.48.19 Get List of CDN Locations for Location Group..................................................................................................................... 490 1.49 Logs ............................................................................................................................................................................................... 491 1.49.1 Get List of Log Items ............................................................................................................................................................. 491 1.49.2 Get Log Item Details ............................................................................................................................................................. 492 1.49.3 Get List of VS Log Items ....................................................................................................................................................... 492 1.49.4 Get VS Log Item Details ....................................................................................................................................................... 493 1.50 My Template Groups ...................................................................................................................................................................... 494 1.50.1 Get My Template Groups List ............................................................................................................................................... 494 1.50.2 Get My Template Group Details ............................................................................................................................................ 497 1.50.3 Add My Template Group ....................................................................................................................................................... 499 1.50.4 Add Child Group. .................................................................................................................................................................. 500 1.50.5 Edit My Template Group ....................................................................................................................................................... 501 1.50.6 Delete My Template Group ................................................................................................................................................... 502 1.50.7 Get List of Templates Attached to Group. ............................................................................................................................. 502 1.50.8 Attach Template to Group. .................................................................................................................................................... 504 1.50.9 Detach Template from Group. ............................................................................................................................................... 505 1.51 Network Interfaces ......................................................................................................................................................................... 505 1.51.1 Get List of VS Network Interfaces ......................................................................................................................................... 505 1.51.2 Get Network Interface Details ............................................................................................................................................... 506 1.51.3 Add Network Interface to VS ................................................................................................................................................. 506 1.51.4 Edit Network Interface........................................................................................................................................................... 507 1.51.5 Delete Network Interface ...................................................................................................................................................... 507 1.52 Networks ........................................................................................................................................................................................ 508 1.52.1 Get List of Networks ............................................................................................................................................................. 508 1.52.2 Get Network Details .............................................................................................................................................................. 508 1.52.3 Add Network ......................................................................................................................................................................... 509 1.52.4 Edit Network ......................................................................................................................................................................... 509 1.52.5 Rebuild VS Network .............................................................................................................................................................. 510 1.52.6 Delete Network ..................................................................................................................................................................... 511 1.53 Network Zones ............................................................................................................................................................................... 511 1.53.1 Get List of Network Zones..................................................................................................................................................... 511 1.53.2 Get Network Zone Details ..................................................................................................................................................... 511 1.53.3 Add Network Zone ................................................................................................................................................................ 512 1.53.4 Edit Network Zone ................................................................................................................................................................ 513 1.53.5 Delete Network Zone ............................................................................................................................................................ 513 1.53.6 Attach Network to Network Zone........................................................................................................................................... 514 1.53.7 Remove Network from Network Zone ................................................................................................................................... 514 1.54 Pagination ...................................................................................................................................................................................... 514 1.55 Publishing Rules ............................................................................................................................................................................ 517 1.55.1 Get List of Publishing Rules .................................................................................................................................................. 517 1.55.2 Add Publishing Rule ............................................................................................................................................................. 518 1.55.3 Delete Publishing Rule.......................................................................................................................................................... 519 1.56 Recipe Groups ............................................................................................................................................................................... 520 1.56.1 Get List of Recipe Groups ..................................................................................................................................................... 520 1.56.2 Get Recipe Group Details ..................................................................................................................................................... 522 1.56.3 Add Recipe Group ................................................................................................................................................................ 523 1.56.4 Add Child Recipe Group ....................................................................................................................................................... 523 1.56.5 Edit Recipe Group ................................................................................................................................................................ 524 1.56.6 Delete Recipe Group ............................................................................................................................................................ 524 1.56.7 Get List of Recipes Attached to Recipe Group ...................................................................................................................... 524 1.56.8 Attach Recipe to Recipe Group ............................................................................................................................................. 525 1.56.9 Remove Recipe from Recipe Group...................................................................................................................................... 525 1.57 Recipes .......................................................................................................................................................................................... 526 1.57.1 Get List of Recipes ............................................................................................................................................................... 526 1.57.2 Get List of Servers Using Recipe .......................................................................................................................................... 527 1.57.3 Get Recipe Details ................................................................................................................................................................ 528 1.57.4 Add Recipe ........................................................................................................................................................................... 530 1.57.5 Edit Recipe ........................................................................................................................................................................... 531 1.57.6 Delete Recipe ....................................................................................................................................................................... 531 1.57.7 Manage Recipe Steps........................................................................................................................................................... 532 1.57.7.1 Get the List of Recipe Steps ........................................................................................................................................ 532 1.57.7.2 Create Recipe Step ..................................................................................................................................................... 535 1.57.7.3 Edit Recipe Step ......................................................................................................................................................... 537 OnApp Cloud 4.1 API Guide 1.57.7.4 Remove Recipe Step .................................................................................................................................................. 537 1.57.7.5 Swap Recipe Steps Locations ..................................................................................................................................... 538 OnApp Cloud 4.1 API Guide 1.57.8 Manage Virtual Server Recipes............................................................................................................................................. 538 1.57.8.1 Get the List of Virtual Server Recipes .......................................................................................................................... 538 1.57.8.2 Assign Recipe to Virtual Server ................................................................................................................................... 538 1.57.8.3 Remove Recipe from Virtual Server ............................................................................................................................ 539 1.57.8.4 Run Recipe on Multiple Virtual Servers ....................................................................................................................... 539 1.57.9 Manage Smart Server Recipes ............................................................................................................................................. 540 1.57.9.1 Get the List of Smart Server Recipes .......................................................................................................................... 540 1.57.9.2 Assign Recipe to Smart Server.................................................................................................................................... 540 1.57.9.3 Remove Recipe from Smart Server ............................................................................................................................. 541 1.57.9.4 Run Recipe on Multiple Smart Servers ........................................................................................................................ 541 1.57.10 Manage Baremetal Server Recipes..................................................................................................................................... 542 1.57.10.1 Get the List of Baremetal Server Recipes .................................................................................................................. 542 1.57.10.2 Assign Recipe to Baremetal Server ........................................................................................................................... 542 1.57.10.3 Remove Recipe from Baremetal Server .................................................................................................................... 542 1.57.11 Manage Template Recipes ................................................................................................................................................. 543 1.57.11.1 Get the List of Template Recipes............................................................................................................................... 543 1.57.11.2 Assign Recipe to Template........................................................................................................................................ 543 1.57.11.3 Remove Recipe from Template ................................................................................................................................. 544 1.57.12 Manage Compute Zone Recipes......................................................................................................................................... 544 1.57.12.1 Get the List of Compute Zone Recipes ...................................................................................................................... 544 1.57.12.2 Assign Recipe to Compute Zone ............................................................................................................................... 544 1.57.12.3 Remove Recipe from Compute Zone ........................................................................................................................ 545 1.57.13 Manage Control Panel Recipes........................................................................................................................................... 545 1.57.13.1 Get the List of Control Panel Recipes ........................................................................................................................ 546 1.57.13.2 Assign Recipe to Control Panel ................................................................................................................................. 546 1.57.13.3 Remove Recipe from Control Panel .......................................................................................................................... 547 1.58 Resolvers ....................................................................................................................................................................................... 547 1.58.1 Get List of Resolvers............................................................................................................................................................. 547 1.58.2 Get Resolver Details ............................................................................................................................................................. 547 1.58.3 Add Resolver ........................................................................................................................................................................ 548 1.58.4 Edit Resolver ........................................................................................................................................................................ 548 1.58.5 Delete Resolver .................................................................................................................................................................... 549 1.59 Restrictions Sets ............................................................................................................................................................................ 549 1.59.1 Get List of Restrictions Sets .................................................................................................................................................. 549 1.59.2 Get Restrictions Set Details .................................................................................................................................................. 551 1.59.3 Get List of All Restrictions Resources ................................................................................................................................... 552 1.59.4 Create Restrictions Set ......................................................................................................................................................... 553 1.59.5 Edit Restrictions Set ............................................................................................................................................................. 554 1.60 Roles.............................................................................................................................................................................................. 554 1.60.1 Get List of Roles ................................................................................................................................................................... 555 1.60.2 Get Role Details ................................................................................................................................................................... 555 1.60.3 Add Role............................................................................................................................................................................... 556 1.60.4 Edit Role ............................................................................................................................................................................... 556 1.60.5 Delete Role........................................................................................................................................................................... 557 1.60.6 Edit User Role Assignment ................................................................................................................................................... 557 1.60.7 Get List of All Permissions .................................................................................................................................................... 558 1.60.8 Clone Role............................................................................................................................................................................ 558 1.61 Smart Servers ................................................................................................................................................................................ 559 1.61.1 Get List of Smart Servers ...................................................................................................................................................... 560 1.61.2 Get Smart Server Details ...................................................................................................................................................... 563 1.61.3 Add Smart Server ................................................................................................................................................................. 563 1.61.4 View Encrypted Smart Server Password ............................................................................................................................... 565 1.61.5 Build Smart Server................................................................................................................................................................ 565 1.61.6 Edit Smart Server ................................................................................................................................................................. 566 1.61.7 Change Smart Server Owner ................................................................................................................................................ 567 1.61.8 Migrate Smart Server ............................................................................................................................................................ 567 1.61.9 Delete Smart Server ............................................................................................................................................................. 568 1.61.10 Start up Smart Server ......................................................................................................................................................... 568 1.61.11 Reboot Smart Server .......................................................................................................................................................... 568 1.61.12 Reboot Smart Server in Recovery ....................................................................................................................................... 569 1.61.13 Suspend Smart Server........................................................................................................................................................ 569 1.61.14 Unsuspend Smart Server .................................................................................................................................................... 569 1.61.15 Unlock Smart Server ........................................................................................................................................................... 570 1.61.16 Shut down Smart Server ..................................................................................................................................................... 570 1.61.17 Stop Smart Server .............................................................................................................................................................. 570 1.61.18 Open Smart Server Console ............................................................................................................................................... 571 1.61.19 Smart Server Autoscaling ................................................................................................................................................... 571 1.61.19.1 Get the List of Autoscaling Rules for Smart Server .................................................................................................... 571 1.61.19.2 Create Autoscaling Rule for SS ................................................................................................................................. 572 1.61.19.3 Edit Autoscaling Rule for SS...................................................................................................................................... 572 OnApp Cloud 4.1 API Guide 1.61.19.4 Delete Autoscaling Rule. ........................................................................................................................................... 572 1.61.20 Smart Server Billing Statistics ............................................................................................................................................. 573 OnApp Cloud 4.1 API Guide 1.61.21 Search Smart Servers by Label .......................................................................................................................................... 576 1.61.22 Get Smart Server CPU Usage Statistics ............................................................................................................................. 577 1.61.23 Resize Smart Server ........................................................................................................................................................... 577 1.61.24 Add/Edit Admin/User Note for Smart Servers ...................................................................................................................... 578 1.62 Software Licenses .......................................................................................................................................................................... 579 1.62.1 Get List of Software Licenses ............................................................................................................................................... 579 1.62.2 Get Software License Details ................................................................................................................................................ 580 1.62.3 Add Software License ........................................................................................................................................................... 580 1.62.4 Edit Software License ........................................................................................................................................................... 581 1.62.5 Delete Software License ....................................................................................................................................................... 581 1.63 SSH keys ....................................................................................................................................................................................... 582 1.63.1 Get List of SSH Keys ............................................................................................................................................................ 582 1.63.2 Add SSH Key........................................................................................................................................................................ 582 1.63.3 Edit SSH Key ........................................................................................................................................................................ 583 1.63.4 Delete SSH Key .................................................................................................................................................................... 583 1.64 Statistics ........................................................................................................................................................................................ 584 1.65 Storage Server Backups................................................................................................................................................................. 585 1.65.1 Get All Storage Server Backups Details ................................................................................................................................ 585 1.65.2 Get Normal Storage Server Backups Details ........................................................................................................................ 587 1.65.3 Get Incremental Server Backups Details ............................................................................................................................... 589 1.65.4 Add Backup for Storage Server............................................................................................................................................. 591 1.65.5 Add/Edit Storage Server Backup Note .................................................................................................................................. 593 1.65.6 Restore Storage Server Backup............................................................................................................................................ 593 1.66 System Configuration ..................................................................................................................................................................... 594 1.66.1 View System Configuration ................................................................................................................................................... 594 1.66.2 Edit System Configuration .................................................................................................................................................... 601 1.67 Templates ...................................................................................................................................................................................... 608 1.67.1 Get List of All Templates ....................................................................................................................................................... 608 1.67.2 Get List of System Templates ............................................................................................................................................... 610 1.67.3 Get List of Own Templates.................................................................................................................................................... 613 1.67.4 Get List of User Templates ................................................................................................................................................... 615 1.67.5 Get List of Templates of Particular User ................................................................................................................................ 618 1.67.6 Get List of Inactive Templates ............................................................................................................................................... 620 1.67.7 Get Template Details ............................................................................................................................................................ 623 1.67.8 Make Template Public .......................................................................................................................................................... 625 1.67.9 Delete Template ................................................................................................................................................................... 626 1.67.10 Edit Template ..................................................................................................................................................................... 626 1.67.11 Get List of Available for Installation Templates .................................................................................................................... 627 1.67.12 Get List of Available for Update Templates ......................................................................................................................... 629 1.67.13 Install Template .................................................................................................................................................................. 631 1.67.14 Update Template ................................................................................................................................................................ 631 1.67.15 Search for Particular Available for Installation Template...................................................................................................... 632 1.67.16 Search for Particular Available for Upgrade Template ......................................................................................................... 633 1.68 Template Store............................................................................................................................................................................... 634 1.68.1 Get Template Store Details ................................................................................................................................................... 634 1.68.2 Get Template Group Details ................................................................................................................................................. 636 1.68.3 Add Template Group ............................................................................................................................................................ 637 1.68.4 Add Child Group ................................................................................................................................................................... 638 1.68.5 Edit Template Group............................................................................................................................................................. 640 1.68.6 Delete Template Group......................................................................................................................................................... 641 1.68.7 Get List of Templates Attached to Group .............................................................................................................................. 641 1.68.8 Attach Template to Group ..................................................................................................................................................... 643 1.68.9 Detach Template from Group................................................................................................................................................ 644 1.68.10 Change Price for Template in the Group ............................................................................................................................. 644 1.69 Top IOPS Disks.............................................................................................................................................................................. 645 1.69.1 Get TOP IOPS Disks ............................................................................................................................................................ 645 1.70 Transactions .................................................................................................................................................................................. 646 1.70.1 Get List of Transactions ........................................................................................................................................................ 646 1.70.2 Get List of VS Transactions without Log Output .................................................................................................................... 648 1.70.3 Get List of Transactions with Log Output............................................................................................................................... 649 1.70.4 Get Transaction Details ........................................................................................................................................................ 651 1.70.5 Get Transaction Details without Log Output .......................................................................................................................... 652 1.71 User Additional Fields .................................................................................................................................................................... 653 1.71.1 Get List of Additional Fields .................................................................................................................................................. 653 1.71.2 Get Additional Field Details ................................................................................................................................................... 654 1.71.3 Add Additional Field .............................................................................................................................................................. 654 1.71.4 Edit Additional Field .............................................................................................................................................................. 655 1.71.5 Delete Additional Field .......................................................................................................................................................... 655 1.71.6 Search User by Additional Field Parameter........................................................................................................................... 655 1.72 User Groups................................................................................................................................................................................... 656 OnApp Cloud 4.1 API Guide 1.72.1 Get List of User Groups ........................................................................................................................................................ 656 1.72.2 Get User Group Details......................................................................................................................................................... 658 OnApp Cloud 4.1 API Guide 1.72.3 Add User Group .................................................................................................................................................................... 660 1.72.4 Edit User Group .................................................................................................................................................................... 660 1.72.5 Delete User Group ................................................................................................................................................................ 661 1.73 Users ............................................................................................................................................................................................. 661 1.73.1 Get List of Users ................................................................................................................................................................... 661 1.73.2 Get User Details ................................................................................................................................................................... 667 1.73.3 Check Login/E-mail Availability ............................................................................................................................................. 671 1.73.4 Add User .............................................................................................................................................................................. 673 1.73.5 Edit User............................................................................................................................................................................... 674 1.73.6 Suspend User ....................................................................................................................................................................... 674 1.73.7 Activate User ........................................................................................................................................................................ 675 1.73.8 Unlock User .......................................................................................................................................................................... 675 1.73.9 Delete User .......................................................................................................................................................................... 676 1.73.10 Drop Sessions .................................................................................................................................................................... 676 1.73.11 Get User Last Access Log .................................................................................................................................................. 677 1.73.12 Get User Statistics .............................................................................................................................................................. 678 1.73.13 Get User's Statistics for Particular Period ............................................................................................................................ 680 1.73.14 Get User Billing Statistics .................................................................................................................................................... 683 1.73.15 Get List of User Monthly Bills .............................................................................................................................................. 685 1.73.16 Get List of User Payments .................................................................................................................................................. 685 1.73.17 Add Payment ...................................................................................................................................................................... 686 1.73.18 Edit Payment ...................................................................................................................................................................... 686 1.73.19 Delete Payment .................................................................................................................................................................. 686 1.73.20 Get List of User VSs ........................................................................................................................................................... 687 1.73.21 Get List of Compute resources Used by Users' VSs............................................................................................................ 687 1.73.22 Get List of User Backups .................................................................................................................................................... 687 1.73.23 Get List of User Data Store Zones ...................................................................................................................................... 687 1.73.24 Get List of User Limits......................................................................................................................................................... 687 1.73.25 Get List of User Network Zones .......................................................................................................................................... 689 1.73.26 Search User Backups ......................................................................................................................................................... 689 1.73.27 Generate API Key ............................................................................................................................................................... 691 1.73.28 Search Users by Name ....................................................................................................................................................... 692 1.74 Users with Config Problems ........................................................................................................................................................... 692 1.75 Version........................................................................................................................................................................................... 694 1.76 Virtual Servers................................................................................................................................................................................ 694 1.76.1 Get List of VSs ...................................................................................................................................................................... 694 1.76.2 Get VS Details ...................................................................................................................................................................... 701 1.76.3 Get Statuses for all Virtual Servers ....................................................................................................................................... 705 1.76.4 Get Virtual Server Status ...................................................................................................................................................... 706 1.76.5 Add VS ................................................................................................................................................................................. 707 1.76.6 Add VMware VS ................................................................................................................................................................... 712 1.76.7 View Encrypted VS Password ............................................................................................................................................... 714 1.76.8 Build VS................................................................................................................................................................................ 715 1.76.9 Edit VS ................................................................................................................................................................................. 715 1.76.10 Change VS Owner .............................................................................................................................................................. 717 1.76.11 Reset VS Root Password.................................................................................................................................................... 717 1.76.12 Set SSH Keys ..................................................................................................................................................................... 718 1.76.13 Migrate VS .......................................................................................................................................................................... 719 1.76.14 Set VIP Status for VS.......................................................................................................................................................... 719 1.76.15 Delete VS ........................................................................................................................................................................... 720 1.76.16 Start up VS ......................................................................................................................................................................... 720 1.76.17 Segregate VS ..................................................................................................................................................................... 721 1.76.18 Reboot VS .......................................................................................................................................................................... 721 1.76.19 Reboot VS in Recovery....................................................................................................................................................... 721 1.76.20 Reboot VS from ISO ........................................................................................................................................................... 722 1.76.21 Boot VS from ISO ............................................................................................................................................................... 722 1.76.22 Suspend VS........................................................................................................................................................................ 723 1.76.23 Unlock VS ........................................................................................................................................................................... 723 1.76.24 Unsuspend VS .................................................................................................................................................................... 723 1.76.25 Shut down VS ..................................................................................................................................................................... 723 1.76.26 Stop VS .............................................................................................................................................................................. 724 1.76.27 Open VS Console ............................................................................................................................................................... 724 1.76.28 VS Autoscaling ................................................................................................................................................................... 724 1.76.28.1 Get the List of Autoscaling Rules for VS .................................................................................................................... 724 1.76.28.2 Create Autoscaling Rule for VS ................................................................................................................................. 725 1.76.28.3 Edit Autoscaling Rule for VS...................................................................................................................................... 726 1.76.28.4 Delete Autoscaling Rule ............................................................................................................................................ 726 1.76.29 VS Billing Statistics ............................................................................................................................................................. 727 1.76.30 Search VS by Label ............................................................................................................................................................ 729 1.76.31 Get VS CPU Usage Statistics ............................................................................................................................................. 730 OnApp Cloud 4.1 API Guide 1.76.32 Add/Edit Admin/User Note for Virtual Server ....................................................................................................................... 731 1.77 Whitelist IPs ................................................................................................................................................................................... 733 OnApp Cloud 4.1 API Guide 1.77.1 Get List of Whitelist IPs ......................................................................................................................................................... 733 1.77.2 Get Whitelist IP Details ......................................................................................................................................................... 733 1.77.3 Add Whitelisted IP ................................................................................................................................................................ 734 1.77.4 Edit Whitelisted IP................................................................................................................................................................. 734 1.77.5 Delete Whitelisted IP ............................................................................................................................................................ 735 OnApp Cloud 4.1 API Guide OnApp 4.1 API Guide The API enables cloud integration with third party applications. You can manage every aspect of your cloud through the API. This guide is a complete reference for all API calls and includes detailed API information, code and output examples. The version of the guide corresponds to the latest OnApp API version. For comprehensive instructions on previous versions, refer to corresponding guides at docs.onapp.com. The OnApp API is RESTful All function calls respond to XML and JSON exchange formats All function calls need authorization and authentication (Basic HTTP or API key) The OnApp API is backward compatible starting with version 3.0 API Authentication To authenticate using HTTP Basic, just use your username/password combination. Curl example: curl -u user:userpass To authenticate using API key, put your account email as a login and the key to the server as a password. HTTP Methods The API uses the following HTTP methods: GET - used for retrieving information from a particular URI POST - used for creating new object and adding new transactions into the queue PUT - used for altering object properties NOTE: updated_at value is changed in PUT requests even if the request fails. DELETE - used for object deletion HTTP response codes The API returns appropriate HTTP status codes for every request: 200 OK The request completed successfully 204 No content The request completed successfully. The 204 status is returned on DELETE and PUT requests 201 Scheduled The request has been accepted and scheduled for processing 403 Forbidden The request is correct, but could not be processed. 404 Not Found The requested URL is incorrect or the resource does not exist. For example, if you request to delete a user with ID {5}, but there is no such a user in the cloud, you will get a 404 error. 422 Unprocessable Entity The sent parameters are erroneous. 500 Internal Server Error An error occurred. Please contact support. Formatting and naming conventions OnApp Cloud 4.1 API Guide The table below represents all the existing formatting and naming conventions used in this guide: OnApp Cloud 4.1 API Guide Convention Explanation Example user:userpass stands for username:password combination Admin:123456 onapp.test stands for address, where your Control Panel is located Example.com :id stands for the resource ID. Sometimes also: :resource_id 23 italics all the parameters are italicised currency_code * (asterisk) marks the required parameters label * preformatted indicates request examples in XML or JSON GET /roles.xml Code block indicates console requests and response examples. info An info message emphasizes or explains the information within the chapter. note A note message contains information essential for the task completion. warning A warning message informs you of something you should not do or be cautious. You won't be able to restore a VS after deleting it. The element showing new parameters added in the latest release of API. limit_type – hourly or monthly limit type set for the resource Clicking the OFF button performs graceful shutdown and then powers off the VS. The maximum length of a Mount Point is 256 characters. FAQ Q: Is it possible to enable API access via https? A: We can enable https for your cloud, which can be used for both WebUI access and API access. Or you can do so yourself: the Apache config file is located at: /etc/httpd/conf.d/onapp.conf Q: Can you create a VS on behalf of another user? A: No. It is possible to switch VS owners, however . Refer to Change a VS owner section for details. Q: How are passwords stored – in plain text? A: No, passwords are not stored in plain text. Except for a login and password combination, you can use email + API key combination to authorize a user via the API. API keys can be generated and changed easily on a user's profile page (as well as through the API). For security reasons we recommend users authenticate through the API key, not the login and password. Q: Which parameters are required, and which are optional? A: Required parameters are marked in this guide with an asterisk *. Change Log OnApp 4.1 OnApp Cloud 4.1 API Guide Added OnApp Cloud 4.1 API Guide Added Applications chapter Added Application Servers chapter Added Get Status of OnApp Subsystems section Added View CDN Resource Raw Log Configuration section Added Edit CDN Resource Raw Log Configuration section Added Instance Types chapter Added Get Instance Types Resource Details section Added Add Limits for Instance Types section Added Edit Limits for Instance Types section Updated Set VIP Status for CDN Storage Server section Updated Updated Delete VS section with the note Updated Get List of Users section with new API request Updated Get List of VSs section with new API request Updated GET VS Details section Updated Edit System Configuration section Updated View System Configuration section Updated Add VS section Updated Edit VS section Updated Get Compute Zone Details section Updated Set VIP Status for VS section Updated Set VIP Status for CDN Edge Server section Updated Get List of Smart Servers section Updated Add Smart Server section Updated Edit Smart Server section Alerts To get the list of alerts on Zombie disks, Zombie data stores, Zombie virtual servers and Zombie transactions, use the following request: GET /alerts.xml GET /alerts.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <alerts> <zombie_data_stores type="array"/> <zombie_transactions type="array"/> <zombie_disks type="array"> <zombie_disk>/dev/[DATASTORE_IDENTIFIER]/[DISK_IDENTIFIER]</zombie_disk> </zombie_disks> <zombie_domains type="array"> <zombie_domain>[VM_IDENTIFIER]</zombie_domain> </zombie_domains> </alerts> Explanation of the data returned: zombie_data_stores - data stores, which are not mounted to a compute resource zombie_transactions - transactions, which have "running" status, but their PIDs do not exist in the system zombie_disks - disks, whick exist on data stores, but are not in the database zombie_domains - an array of zombie VSs, which are running on a compute resource, but are not in the DB Application Servers Application Server is a regular VS based on default CentOS template with pre-installed additional software. This software allows you to install and OnApp Cloud 4.1 API Guide have up & running various PHP/Perl/Python frameworks (like Drupal, Joomla, Wordpress etc.) on a server using web interface. OnApp Cloud 4.1 API Guide API requests for application servers are the same as for virtual servers, just make the following replacement: virtual machines->application servers Below you can find the list of operations applicable for application servers: Get List of servers Get server details Get statuses for all servers Get server status Add server View encrypted server password Build server Edit server Change server owner Migrate server Set VIP status for server Delete server Start up server Segregate server Reboot server Reboot server in recovery Suspend server Unlock server Unsuspend server Shut down server Stop server Server autoscaling Server billing statistics Search server by label Get server CPU usage statistics Add/edit admin/user note for server Create Application Server To create an application server, use the following request: POST /application_servers.xml POST /application_servers.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<application_server><location_id>1</location_id><label>zaza xml</label><hostname>zaza</hostname><hypervisor_group_id>6</hypervisor_group_id><hype r visor_id>2</hypervisor_id><memory>384</memory><cpus>1</cpus><cpu_shares>1</cpu_shares > <data_store_group_primary_id>1</data_store_group_primary_id><primary_disk_size>5</pri m ary_disk_size><data_store_group_swap_id>1</data_store_group_swap_id><swap_disk_size>1 < /swap_disk_size><primary_network_group_id>16</primary_network_group_id><required_ip_a d dress_assignment>1</required_ip_address_assignment><rate_limit>0</rate_limit><require JSON d Request example _virtual_machine_build>1</required_virtual_machine_build></application_server>' -url http://onapp.test/application_servers.xml OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"application_server":{"location_id":"1", "label":"zaza JSON", "hostname":"zaza", "hypervisor_group_id":"6", "hypervisor_id":"2", "memory":"384", "cpus":"1", "cpu_shares":"1", "data_store_group_primary_id":"1", "primary_disk_size":"5", "data_store_group_swap_id":"1", "swap_disk_size":"1", "primary_network_group_id":"16", "required_ip_address_assignment":"1", "rate_limit":"0", "required_virtual_machine_build":"1"}}' --url http://onapp.test/application_servers.json XML Output example <application_server> <add_to_marketplace nil="true"/> <admin_note nil="true"/> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">false</booted> <built type="boolean">false</built> <cores_per_socket type="integer">0</cores_per_socket> <cpu_shares type="integer">1</cpu_shares> <cpu_sockets nil="true"/> <cpu_threads nil="true"/> <cpu_units type="integer">10</cpu_units> <cpus type="integer">1</cpus> <created_at type="datetime">2015-06-23T15:33:36+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis nil="true"/> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>zaza</hostname> <hot_add_cpu nil="true"/> <hot_add_memory nil="true"/> <hypervisor_id type="integer">2</hypervisor_id> <id type="integer">411</id> <identifier>tb6s00o85zqig2</identifier> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <instance_type_id nil="true"/> <iso_id nil="true"/> <label>zaza xml</label> <local_remote_access_ip_address>10.0.24.32</local_remote_access_ip_address> <local_remote_access_port nil="true"/> <locked type="boolean">true</locked> <memory type="integer">384</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>rhel</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode nil="true"/> <remote_access_password>ReO44gmSyF92</remote_access_password> <service_password nil="true"/> <state>building</state> OnApp Cloud 4.1 API Guide <storage_server_type nil="true"/> OnApp Cloud 4.1 API Guide <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">155</template_id> <template_label>CentOS 6.6 x64 ApplicationServer</template_label> <time_zone nil="true"/> <updated_at type="datetime">2015-06-23T15:33:41+03:00</updated_at> <user_id type="integer">1</user_id> <vip nil="true"/> <xen_id nil="true"/> <ip_addresses type="array"> <ip_address> <address>69.168.237.56</address> <broadcast>69.168.237.255</broadcast> <created_at type="datetime">2015-05-14T12:19:08+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>69.168.237.1</gateway> <hypervisor_id nil="true"/> <id type="integer">340</id> <ip_address_pool_id nil="true"/> <network_address>69.168.237.0</network_address> <network_id type="integer">3</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2015-06-23T15:33:37+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.0</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used>0</monthly_bandwidth_used> <total_disk_size type="integer">6</total_disk_size> <price_per_hour type="float">769.0</price_per_hour> <price_per_hour_powered_off type="float">384.01</price_per_hour_powered_off> OnApp Cloud 4.1 API Guide <support_incremental_backups type="boolean">true</support_incremental_backups> <cpu_priority type="integer">1</cpu_priority> </application_server> Where: add_to_marketplace – true, if the edge server is added to marketplace. The default value is "false". This parameter is for CDN servers only. admin_note - administrator comment for the VS allowed_hot_migrate – true if hot migration is allowed, otherwise false allowed_swap – true if swap is allowed, otherwise false booted - true, if the VS is boothed, otherwise false built - true, if the VS is built, otherwise false cpu_shares - the percentage of allocated CPU priority resource cpu_sockets - the amount of CPU sockets per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_threads - the amount of CPU threads per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan. cpus - number of CPUs assigned to the VS created_at – the date when the VS was created in the [YYYY][MM][DD]T[hh][mm][ss] format updated_at – the date when the VS was updated in the [YYYY][MM][DD]T[hh][mm][ss] format customer_network_id - ID of the customer network edge_server_type - type of the CDN edge server. This parameter is for CDN servers only. enable_autoscale — true if autoscaling is allowed for this VS enable_monitis - deprecated attribute firewall notrack - parameter for adding firewall rules. It is true for edge servers only. hostname - VS hostname hypervisor_id – the ID of the compute resource, on which the server is deployed id – the VS ID in OnApp CP database identifier – the VS identifier initial_root_password — the VS root password initial_root_password_encrypted - true, if the root password is encrypted, otherwise false instance_type_id - ID of the instance type iso_id - ID of the ISO you want to use label - user-friendly VS description local_remote_access_ip_address - IP address for remote connection local_remote_access_port - port for remote connection locked - true if the VS is locked; otherwise false memory - the RAM size allocated to this VS min_disk_size — the minimum disk size required to build a VS from a specified template note - optional note OnApp Cloud 4.1 API Guide operating_system — operating system used by the VS operating_system_distro — the distribution of the OS from which this VS is built OnApp Cloud 4.1 API Guide preferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settings recovery_mode - true if recovery mode allowed, otherwise false remote_access_password — the password for the remote access service_password - password of a service user state – application server state storage_server_type - set http or streaming server type. strict_virtual_machine_id - the ID of a virtual machine that will never reside on the same compute resource with this VS suspended - true if VS is suspended, otherwise false template_id - the ID of the template the VS is based on template_label - the name of the template from which this VS is built time_zone – the time zone of the user user_id — the ID of a user assigned to this VS vip — true if the VS has VIP status (gives migration priority) xen_id — the VS ID set by the virtualization engine ip_addresses - an array of IP addresses with the following parameters: address - IP address broadcast - broadcast address created_at - the date when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - ID of the customer network which will be used for this blueprint disallowed_primary - true if not allowed to be used as primary (for VS build), otherwise false gateway - gateway address hypervisor id - the ID of the compute resource id - the ID of the IP address ip_address_pool_id - ID of the IP address pool to the IP address belongs to network_address - the address of the network network_id - the ID of the network pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated_at - the date when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of a user associated with this IP address free - true if free, otherwise false netmask - netmask for the IP address monthly_bandwidth_used - VS monthly bandwidth in KB total_disk_size - total VS disk size price_per_hour - server's price per hour price_per_hour_powered_off - price per hour when server is powered off support_incremental_backups - 1, if virtual server supports incremental backups, and 0 if it does not cpu_priority - this is a new parameter reserved for further use; currently will have the same value as cpu_shares Applications An application is a piece of software that brings additional features into the basic functionality. OnApp allows you to deploy a wide range of applications by means of additional software. To install different applications on your cloud, you shoud create an Application Server. An application server is a regular VS based on CentOS but with pre-installed software. Application Servers allow you to install various applications (like Drupal, Joomla, Wordpress etc.) on a server using web interface. Get List of All Installed Applications To get the list of all installed applications, use the following request: GET /application_servers/:application_server_id/applications.xml GET /application_servers/:application_server_id/applications.json OnApp Cloud 4.1 API Guide XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/application_servers/:application_server_id/applications.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/application_servers/:application_server_id/applications.json' XML Output example <applications type="array"> <application> <admin_url>http://109.1.125.2/wp/wp-admin/</admin_url> <application_type>WordPress</application_type> <errors type="array"/> <id>26_74947</id> <software_url>http://109.1.125.2/wp</software_url> <software_version>4.2.2</software_version> </application> </applications> Where: admin_url - this URL is a link for administrator, where they can enter credentials to log into application application_type - the name of application id - the ID of an application software_url - this URL is a link to the application itself software_version - the version of the application software installed Get List of All Available for Installation Applications To get the list of all applications, available for installation, use the following request: GET /application_servers/:application_server_id/applications/available.xml GET /application_servers/:application_server_id/applications/available.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url http://onapp.test/application_servers/:application_server_id/applications/available.x m l' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url http://onapp.test/application_servers/:application_server_id/applications/available.j s on' XML Output example <applications type="array"> <application> <category>cms</category> <description> Zikula is a Web Application Toolkit, which allows you to run impressive websites and build powerful online applications. </description> <name>Zikula</name> <script_id>1</script_id> <software_version>1.3.9</software_version> </application> <application> <category>forums</category> <description>The most widely used Open Source forum solution</description> <name>phpBB</name> <script_id>2</script_id> <software_version>3.1.4</software_version> </application> <application>...</application> </applications> Where: category - the category, to which an application refers (for example - cms,forums, blogs, frameworks etc.) description - the short description of main application features name - the standard name of an application script_id - the ID of an application in the list of all applications, available for installation software_version - the version of application software Get Application Attributes To get attributes required for installation of an application and their default values, use the following request: GET /application_servers/:application_server_id/script/script_id.xml GET /application_servers/:application_server_id/script/script_id.json XML Request example curl -i -X GET -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml' --url http://onapp.test/application_servers/:application_server_id/script/script_id.xm l JSON Request example OnApp Cloud 4.1 API Guide curl -i -X GET -u user:password -H 'Accept: application/json' -H 'Content-type: application/json' --url http://onapp.test/application_servers/:application_server_id/script/script_id.jso n Where: script_id - the ID of an application in the list of all applications, available for installation. List of all available scripts can be extracted using request from the Get List of All Available for Installation Applications section. In this request you will get the following parameters: category - the category, to which an application refers (for example - cms,forums, blogs, frameworks etc.) description - the short description of main application features name - the standard name of an application script_id - the ID of an application in the list of all applications, available for installation software_version - the version of application software Install Application To install application: POST /application_servers/:application_server_id/applications.xml POST /application_servers/:application_server_id/applications.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/applications.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<application><script_id>1</script_id><softdirectory>XML_Zikula</softdirectory><admin _ username>admin</admin_username><admin_pass>pass</admin_pass><admin_email>user@onapp.c o m</admin_email></application>' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/applications.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"application": {"script_id": "1", "softdirectory": "Zikula1000", "admin_username": "admin", "admin_pass": "pass", "admin_email": "user@onapp.com"}}' Where: script_id - the ID of an application in the list of all applications, available for installation. softdirectory - the directory where an application will be stored The following parameters depend on the type of an application: admin_username - the username of an administrator, who wants to install an application admin_pass - the password of an administrator, who wants to install an application admin_email - the email of an administrator, who wants to install an application Parameters are different for every application. All the parameters that are required for successful installation of the application can be retrieved via the Get Application Attributes API call. Put extracted parameters inside <application> </application> parameter. OnApp Cloud 4.1 API Guide Back Up Application To back up an application: POST /application_servers/:application_server_id/applications/:id/backup.xml POST /application_servers/:application_server_id/applications/:id/backup.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/application_servers/:application_server_id/applications/:applicatio n _id/backup.xml -d '<backup><application_id>1_31528</application_id><backup_directory>1</backup_director y ><backup_database>1</backup_database><note>xml backup</note></backup>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/application_servers/:application_server_id/applications/:applicatio n _id/backup.json -d '{"backup": {"application_id": "1_23728", "backup_directory": "1", "backup_database": "1", "note": "json backup"} }' Where: application_id - the ID of an application backup_directory - set 1 to back up directory, otherwise set 0 backup_data_directory - set 1 to back up data directory, otherwise set 0 backup_database - set 1 to back up database, otherwise set 0 note - a back up note (optional parameter) Parameters backup_directory, backup_database can be used with any value (for example, "1" or "true") to back up a corresponding thing. Do not include a parameter in order not to back up particular part of an application. Delete Application To delete an application: DELETE /application_servers/:application_server_id/applications/:id.xml DELETE /application_servers/:application_server_id/applications/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/application_servers/:application_server_id/applications/:id.xml -d '<application><application_id>1_31528</application_id><remove_directory>1</remove_dir e ctory><remove_database>1</remove_database><remove_database_user>1</remove_database_us e r></application>' OnApp Cloud 4.1 API Guide JSON Request example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:password --url http://onapp.test/application_servers/:application_server_id/applications/:id.json -d '{"application": {"application_id": "1_23728", "remove_directory": "1", "remove_database": "1", "remove_database_user": "1"} }' Where: application_id - the ID of an application remove_database_user - set 1 to remove database user, otherwise set 0 remove_database - set 1 to remove database, otherwise set 0 remove_directory - set 1 to remove directory, otherwise set 0 remove_data_directory - set 1 to remove data directory, otherwise set 0 Get List of All Application Backups To get the list of all backups taken for this particular application server, use the following request:: GET /application_servers/:application_server_id/applications/backups.xml GET /application_servers/:application_server_id/applications/backups.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url http://onapp.test/application_servers/:application_server_id/applications/backups.xml ' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url http://onapp.test/application_servers/:application_server_id/applications/backups.jso n ' XML Output example OnApp Cloud 4.1 API Guide <backups type="array"> <backup> <application_id>123_70977</application_id> <application_type>CodeIgniter</application_type> <backup_note>Code Igniter Backup #1</backup_note> <identifier>475d8fd0e008941b19c9819d8dc8a410</identifier> <software_url>http://109.123.125.26/igniter</software_url> <software_version>3.0.0</software_version> <size>1.369 MB</size> </backup> <backup> <application_id>123_70977</application_id> <application_type>CodeIgniter</application_type> <backup_note>Code Igniter Backup #1</backup_note> <identifier>7d0c93305dc816282e17e432903e33eb</identifier> <software_url>http://109.123.125.26/igniter</software_url> <software_version>3.0.0</software_version> <size>1.369 MB</size> </backup> <backup>...</backup> </backups> Where: application_id - the ID of the application, which was backed up application_type - the name of the application, which was backed up backup_note - the note, that was written during backup creation identifier - identifier of the application backup software_url - this URL is a link to application itself software_version - the version of application software size - backup size Restore Application Backup To restore application backup: POST /application_servers/:application_server_id/applications/backups/:identifier/restore.xml POST /application_servers/:application_server_id/applications/backups/:identifier/restore.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/applications/:applicatio n _id/backups/:identifier/restore.xml -d '<backup><restore_directory>1</restore_directory><restore_database>1</restore_databas e ></backup>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/applications/:applicatio n _id/backups/:identifier/restore.json -d '{"backup": {"restore_directory": "1", "restore_database": "1"} }' Where: restore_directory - set 1 to restore directory, otherwise set 0 restore_database - set 1 to restore database, otherwise set 0 identifier - identifier of the application backup. It can be found using the Get List of All Application Backups request. Remove Application Backup To remove application backup: DELETE /application_servers/:application_server_id/applications/backups/:identifier/destroy.xml DELETE /application_servers/:application_server_id/applications/backups/:identifier/destroy.json XML Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/application_servers/:application_server_id/applications/backups/:id e ntifier/destroy.xml -H'Content-type: application/xml' -H'Accept: application/xml' JSON Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/application_servers/:application_server_id/applications/backups/:id e ntifier/destroy.json -H'Content-type: application/json' -H'Accept: application/json' Where: identifier - identifier of the application backup. It can be found using the Get List of All Application Backups request. Assets Assets are the compute resources that are connected to the control panel server but are either not configured or not assigned to the compute zone. You can retrieve the list of assets using the Get Lst of Unassigned Assets request. Get List of Assets Use the following API call to view the list of assets: GET hypervisors/settings/assets.xml GET hypervisors/settings/assets.json To view the list of assets that are already created but not assigned to the compute zone, use the Get Lst of Unassigned Assets API call XML Request example curl -i -u user:userpass http://onapp.test/settings/assets.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -u user:userpass http://onapp.test/settings/assets.json -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <assets type="array"> <asset> <mac>00:15:17:63:ea:3e</mac> </asset> <asset> <mac>00:15:17:5a:51:4a</mac> </asset> </assets> Where: mac - asset MAC address Get Asset Details Use the following API call to view the list of assets: GET /settings/assets/:asset_mac_address.xml GET /settings/assets/:asset_mac_address.json XML Request example curl -i -u user:userpass http://onapp.test/settings/assets/:asset_mac_address.xml H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/settings/assets/:asset_mac_address.json H 'Accept: application/json' -H 'Content-type: application/json' XML Response example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <asset> <mac nil="true"/> <disks type="array"> <disk> <name>disk1name1</name> <scsi>disk1scsi</scsi> </disk> <disk> <name>disk3name</name> <scsi>disk3scsi</scsi> </disk> </disks> <nics type="array"> <nic> <name>nic1name</name> <mac>nic1mac</mac> </nic> <nic> <name>eth1 </name> <mac>00:1a:64:62:41:e1</mac> </nic> </nics> <pcis type="array"> <pci> <name>Broadcom Corporation NetXtreme BCM5704 Gigabit Ethernet [14e4:1648] (rev 10)</name> <pci>02:01.0</pci> </pci> </pcis> </asset> Where: mac - asset MAC address disk - an array of asset's disks along with the following details: name - disk label scsi - SCSI inquiry product revision number nics - an array of asset's network interfaces along with their details: name - NIC name mac - NIC MAC address pcis - an array of NIC PCIs along with the following details: name - PCI label pci - NIC PCI Get Lst of Unassigned Assets Use the following API call to view the list of assets: GET hypervisors/not_grouped.xml GET hypervisors/not_grouped.json OnApp Cloud 4.1 API Guide XML Request example curl -i -u user:userpass http://onapp.test/hypervisors/not_grouped.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/hypervisors/not_grouped.json -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example OnApp Cloud 4.1 API Guide OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <hypervisors type="array"> <hypervisor> <backup type="boolean">false</backup> <backup_ip_address/> <blocked type="boolean">true</blocked> <built type="boolean">false</built> <called_in_at nil="true"/> <connection_options nil="true"/> <cpu_idle type="integer">0</cpu_idle> <cpu_mhz nil="true"/><cpus nil="true"/> <created_at type="datetime">2013-06-10T12:09:48+00:00</created_at> <custom_config nil="true"/> <disable_failover type="boolean">false</disable_failover> <disk_pcis nil="true"/> <distro nil="true"/> <enabled type="boolean">true</enabled> <failure_count type="integer">0</failure_count> <format_disks type="boolean">false</format_disks> <free_mem type="integer">0</free_mem> <host nil="true"/><host_id nil="true"/> <hypervisor_group_id nil="true"/> <hypervisor_type>kvm</hypervisor_type> <id type="integer">7</id> <ip_address>109.123.105.132</ip_address> <label>KVM C5 HV1</label> <list_of_logical_volumes/> <list_of_volume_groups/> <list_of_zombie_domains nil="true"/> <locked type="boolean">false</locked> <mac nil="true"/> <machine nil="true"/> <mem_info type="integer">0</mem_info> <mtu type="integer">1500</mtu> <online type="boolean">false</online> <ovs nil="true"/> <passthrough_disks type="boolean">false</passthrough_disks> <release nil="true"/> <server_type>virtual</server_type> <spare type="boolean">false</spare> <storage_channel>224.3.28.1</storage_channel> <threads_per_core nil="true"/> <total_mem nil="true"/> <total_zombie_mem nil="true"/> <updated_at type="datetime">2013-06-10T12:09:48+00:00</updated_at> <uptime nil="true"/> <vmware_total_cpu_cores type="integer">0</vmware_total_cpu_cores> <total_cpus type="integer">0</total_cpus> <free_memory type="integer">0</free_memory> <used_cpu_resources type="integer">0</used_cpu_resources> <total_memory type="integer">0</total_memory> <cpu_cores type="integer">0</cpu_cores> <free_disk_space><onapp-fv4zl7t2h5wbeq type="integer">184</onappfv4zl7t2h5wbeq></free_disk_space> <memory_allocated_by_running_vms type="integer">0</memory_allocated_by_running_vms> <total_memory_allocated_by_vms type="integer">0</total_memory_allocated_by_vms> OnApp Cloud 4.1 API Guide </hypervisors> </hypervisors> OnApp Cloud 4.1 API Guide Where: backup - true, if the CloudBoot compute resource is used as a backup server. This parameter is for CloudBoot compute resources only. For other compute resource types the backup value is 0. backup_ip_address - provisioning network IP address blocked - true if the compute resource is blocked, otherwise false built - true if the compute resource is built, otherwise false called_in_at – the date when the compute resource was called in the [YYYY][MM][DD]T[hh][mm][ss]Z format connection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name distributed_virtual_switch_name - distributed virtual switch label cpu_idle - time of CPU delay cpu_mhz - CPU operating frequency created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format custom_config - custom commands that run when the compute resource is booted disable_failover – true if compute resource failover is disabled, otherwise false. disk_pcis - comma-separated list of hypervisor disk pcis distro - distributive label enabled - true, if the compute resource is enabled, otherwise false failure_count – the number of failures format_disks - true, if the compute resource's disks are formatted during creation, otherwise false free_mem - free compute resource memory host - host label hypervisor_group_id - the ID of a compute zone to which this compute resource is attached hypervisor_type - the compute resource type id - the compute resource ID ip_address – the compute resource IP address label - the compute resource label list_of_logical_volumes - an array of compute resource logical volumes list_of_volume_groups - an array of compute resource volume groups list_of_zombie_domains - an array of zombie virtual servers locked - true if the compute resource is locked, otherwise false mac - compute resource MAC address machine - architecture type mem_info - Xen compute resource Dom0 size. This parameter is for Xen compute resources only. For other compute resource types the mem_inf o value is 0. mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. OnApp Cloud 4.1 API Guide online - true if online, otherwise false ovs - whether the OpenvSwitch is enabled or not. Redundant parameter. passthrough_disks - true, if the disks are passed through to the storage nodes, otherwise 0 release - compute resource kernel version server_type - server type: virtual smart baremetal spare – true if no VSs are assigned, otherwise false storage_channel - storage channel for the communication threads_per_core - compute resource core and CPU ratio. For example, if threads_per_core = 2, compute resource with 2 cores will have 4 CPUs. total_mem - total compute resource memory total_zombie_mem - memory space occupied by zombie disks updated_at – the date when the record was made in the DB in the [YYYY][MM][DD]T[hh][mm][ss]Z format uptime - compute resource uptime value; shows how long the compute resource is online vmware_total_cpu_cores - the total number of VMware compute resource CPU cores total_cpus – the number of virtual cores free_memory – free RAM (MB) of compute resource used_cpu_resources – the percentage of used CPU resources total_memory – total RAM (MB) of compute resource cpu_cores – the number physical of cores per compute resource free_disk_space - free compute resource disk space in GB memory_allocated_by_running_vms - the compute resource RAM in MB allocated to the virtual servers, which are currently running on this compute resource total_memory_allocated_by_vms - the compute resource RAM in MB allocated to all virtual servers of this compute resource Auto-Backups OnApp Cloud provides a range of auto-backup possibilities for Virtual Servers: See Auto-Backup Presets to learn how to change the auto-backup schedule, which applies during the VS creation, or when the auto-backup is enabled for the first time. See Manage Auto-Backups chapter to learn how to enable or disable auto-backups for already existing Virtual Servers. See Schedules to learn how to view, create, delete or change any schedule for a particular Virtual Server. Auto-backup Presets Auto-backup presets are simple way to set up an automatic backup schedule when virtual servers are created or when the auto-backup is enabled for the first time. Once configured, they can be applied to a virtual server automatically when the Automatic backups required paramete r is enabled during VS creation. Get List of Auto-backup Presets To get the list of available auto-backup presets, use the following request: GET /settings/autobackup_presets.xml GET /settings/autobackup_presets.json OnApp Cloud 4.1 API Guide An array of auto-backup presets is returned. If there are no presets, an empty array is returned. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <autobackup_templates type="array"> <autobackup_template> <duration type="integer">1</duration> <created_at type="datetime">2011-07-14T15:01:38Z</created_at> <updated_at type="datetime">2011-07-28T11:49:52Z</updated_at> <period>days</period> <id type="integer">1</id> <enabled type="boolean">true</enabled> </autobackup_template> <autobackup_template> <duration type="integer">1</duration> <created_at type="datetime">2011-07-14T15:01:38Z</created_at> <updated_at type="datetime">2011-07-28T11:50:21Z</updated_at> <period>weeks</period> <id type="integer">2</id> <enabled type="boolean">true</enabled> </autobackup_template> ... <autobackup_template></autobackup_template> ... </autobackup_templates> Explanation of the data returned: duration - the number specifying how often a backup should be taken created at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format period - the time period (days, weeks, months, or years) updated at - the date when the auto-backup preset was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true if the auto-backup preset is enabled, otherwise false. id - the ID of the auto-backup preset Get Auto-backup Preset Details This method will output the details for a particular auto-backup preset. GET /settings/autobackup_presets/:id.xml GET /settings/autobackup_presets/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?><autobackup_template> <duration type="integer">1</duration> <created_at type="datetime">2011-01-06T10:49:43Z</created_at> <period>days</period> <updated_at type="datetime">2011-01-06T10:49:43Z</updated_at> <enabled type="boolean">true</enabled> <id type="integer">1</id></autobackup_template> Where: duration - edit the number specifying how often a backup should be taken created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format period - specifies the time period (days, weeks, months, or years) updated_at - the date when the auto-backup preset was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide enabled - set True if auto-backup preset is enabled, otherwise False OnApp Cloud 4.1 API Guide id - edit an auto-backup preset ID Edit Auto-backup Preset To edit an auto-backup preset, use the following method: PUT /settings/autobackup_presets/:id.xml PUT /settings/autobackup_presets/:id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d'<?xml version="1.0" encoding="UTF8"?><autobackup_template><duration>5</duration><period>days</period><ena bled>false</enabled></autobackup_template>' --url http://onapp.test/settings/autobackup_presets/:id.xml' JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass d'{"autobackup_template":{"duration":"5","period":"weeks","enabled": "false"}}' -url http://onapp.test/settings/autobackup_presets/:id.json' You can edit the following parameters: duration - edit the number specifying how often a backup should be taken enabled - set true if auto-backup preset is enabled, otherwise set false Every autobackup_preset_id has its defined period (either days, or weeks, or months, or years), which cannot be altered. Returns HTTP 204 response on success, or HTTP 404 when an auto-backup preset with the ID specified is not found, or the URL requested is incorrect. Manage Auto-Backups Auto-backup has a specific target from which the backup is taken according to the schedule assigned to such target. When you use a normal backup scheme in your cloud - the target for auto-backups will be a disk of the Virtual Server; for incremental backups - it will be the whole Virtual Server. Windows-based Virtual Servers support only normal backups. Thus, even if incremental backups are selected for your cloud, the auto-backup target for Windows VS will be its disk. The auto-backup may be enabled either during the creation of Virtual Server using the required_automatic_backup parameter, or at any time afterwards. If you enable the auto-backup for a Virtual Server or its disk for the first time (i.e. there is no auto-backup schedule for such target) the system will automatically apply the schedule configured in auto-backup presets. If you enable the auto-backups for a target with assigned schedule - this schedule will remain unchanged. Enable auto-backups for VS OnApp Cloud 4.1 API Guide To enable incremental auto-backups for a Virtual Server: OnApp Cloud 4.1 API Guide POST /virtual_machines/:id/autobackup_enable.xml POST /virtual_machines/:id/autobackup_enable.json XML Request example curl -i -X POST http://onapp.test/virtual_machines/:id/autobackup_enable.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/virtual_machines/:id/autobackup_enable.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json Disable auto-backups for VS To disable incremental auto-backups for a Virtual Server: POST /virtual_machines/:id/autobackup_disable.xml POST /virtual_machines/:id/autobackup_disable.json XML Request example curl -i -X POST http://onapp.test/virtual_machines/:id/autobackup_disable.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/virtual_machines/:id/autobackup_disable.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json Enable Auto-backups for Disk You can enable auto-backups for a disk using the following methods: POST /settings/disks/:disk_id/autobackup_enable.xml POST /settings/disks/:disk_id/autobackup_enable.json XML Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/autobackup_enable.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/autobackup_enable.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: disk_id* - is the ID of the disk, for wich you want to enable auto-backup Disable Auto-backups for Disk OnApp Cloud 4.1 API Guide To disable auto-backups for a disk, use the following method: OnApp Cloud 4.1 API Guide POST /settings/disks/:id/autobackup_disable.xml POST /settings/disks/:id/autobackup_disable.json XML Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/autobackup_disable.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/autobackup_disable.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: disk_id* - the ID of the disk for which you want to disable auto-backup Schedules Schedules are concerned with backups scheduled for virtual servers or virtual server disks in the cloud: If you are using normal backups, the schedules are created per disk. If you are using incremental backups, the schedules are created per virtual server. When a schedule is no longer needed, it can be deleted so that the task will no longer run. Get List of All Schedules This method outputs an array of all disk backups scheduled within your cloud. If there are no schedules, an empty array is returned. GET /settings/schedules.xml GET /settings/schedules.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/settings/schedules.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/settings/schedules.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <schedules> <schedule> <action>autobackup</action> <created_at type="datetime">2013-12-03T17:38:24+03:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">131</id> <params nil="true"/> <period>months</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2014-01-03T17:38:24+03:00</start_at> <status>enabled</status> <target_id type="integer">11542</target_id> <target_type>Disk</target_type> <updated_at type="datetime">2013-12-03T17:38:37+03:00</updated_at> <user_id type="integer">1875</user_id> <schedule_logs type="array"> <schedule_log> <created_at type="datetime">2013-12-03T17:38:37+03:00</created_at> <id type="integer">415</id> <log_output>Executing Rollback... Fatal: []</log_output> <schedule_id type="integer">131</schedule_id> <status>failed</status> <updated_at type="datetime">2013-12-03T17:38:37+03:00</updated_at> </schedule_log> </schedule_logs> </schedule> </schedules> Where: action – backup type created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when a schedule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format start_at - the date when a backup started in the [YYYY][MM][DD]T[hh][mm][ss]Z format duration - how often a backup is taken failure_count - the number of requests processed until the task fails id - schedule ID period - time period for a backup schedule (days, weeks, months, or years) rotation_period - number of backups after which the first backup will be deleted target_id - the disk ID for which a backup is taken target_type - currently, you can schedule backup of Disks only user_id - the ID of a user who created this schedule failure_count - the number of requests processed until the task fails status - the status of the backup schedule (enabled, disabled, or failed) schedule_logs – schedule’s log messages with the following details: OnApp Cloud 4.1 API Guide created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide id – log message ID log_output – log message text schedule_id – ID of a schedule to which the log message belongs to status – status of a scheduled backup performed Page history v3.2 Added the following parameters: rotation_period Get Schedule Details Use this method to get details for a particular disk backup schedule: GET /settings/schedules/:id.xml GET /settings/schedules/:id.json This method outputs an array of the disk backups scheduled within your cloud. If there are no schedules, an empty array is returned. XML Output example <?xml version="1.0" encoding="UTF-8"?> <schedule> <action>autobackup</action> <created_at type="datetime">2013-12-03T17:38:24+03:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">131</id> <params nil="true"/> <period>months</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2014-01-03T17:38:24+03:00</start_at> <status>enabled</status> <target_id type="integer">11542</target_id> <target_type>Disk</target_type> <updated_at type="datetime">2013-12-03T17:38:37+03:00</updated_at> <user_id type="integer">1875</user_id> <schedule_logs type="array"> <schedule_log> <created_at type="datetime">2013-12-03T17:38:37+03:00</created_at> <id type="integer">415</id> <log_output>Executing Rollback... Fatal: []</log_output> <schedule_id type="integer">131</schedule_id> <status>failed</status> <updated_at type="datetime">2013-12-03T17:38:37+03:00</updated_at> </schedule_log> </schedule_logs> </schedule> Where: action – backup type created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when a schedule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format start_at - the date when a backup started in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide duration - how often a backup is taken OnApp Cloud 4.1 API Guide failure_count - the number of requests processed until the task fails id - schedule ID period - time period for a backup schedule (days, weeks, months, or years) rotation_period - number of backups after which the first backup will be deleted target_id - the disk ID for which a backup is taken target_type - currently, you can schedule backup of Disks only user_id - the ID of a user who created this schedule failure_count - the number of requests processed until the task fails status - the status of the backup schedule (enabled, disabled, or failed) schedule_logs – schedule’s log messages with the following details: created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – log message ID log_output – log message text schedule_id – ID of a schedule to which the log message belongs to status – status of a scheduled backup performed Page history v3.2 Added the following parameters: rotation_period Get List of Schedules for a Disk To get a list of schedules for a particular disk, use the following methods: GET /settings/disks/:disk_id/schedules.xml GET /settings/disks/:disk_id/schedules.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <schedules> <schedule> <duration>1</duration> <created_at>2011-07-20T15:16:16Z</created_at> <target_id>112</target_id> <updated_at>2011-07-27T15:16:18Z</updated_at> <period>days</period> <action>autobackup</action> <start_at>2011-07-28T15:16:16Z</start_at> <id>33</id> <user_id>1</user_id> <schedule_logs> <schedule_log> <created_at>2011-07-27T15:16:18Z</created_at> <updated_at>2011-07-27T15:16:18Z</updated_at> <schedule_id>33</schedule_id> <id>10</id> <log_output></log_output> <status>complete</status> </schedule_log> ... <schedule_log></Schedule_log> ... <params nil="true"></params> <failure_count>0</failure_count> <status>enabled</status> <target_type>Disk</target_type> </schedule> ... <schedule></schedule> </schedules> Where: duration - the number specifying how often a backup should be taken target_id – ID of the action target period - the time period (days, weeks, months, or years) action – the action performed start_at – time, when the action starts id – schedule id user_id – ID of the disk (action target) user schedule_logs – an array with schedule log details, where: schedule_id – ID of a schedule id – ID of the schedule log log_output – an array with log details status – status of the action (complete, failed, etc.) failure_count – number of failures during the action status – schedule status (enabled or disabled) target_type – type of the target OnApp Cloud 4.1 API Guide Get List of Virtual Server Schedules OnApp Cloud 4.1 API Guide To get a list of schedules for a particular virtual server, use the following methods: GET /virtual_machines/:id/schedules.xml GET /virtual_machines/:id/schedules.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <schedules type="array"> <schedule> <action>autobackup</action> <created_at type="datetime">2014-01-20T14:23:44+02:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">17</id> <params nil="true"/> <period>days</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2014-01-22T14:23:44+02:00</start_at> <status>enabled</status> <target_id type="integer">9</target_id> <target_type>VirtualMachine</target_type> <updated_at type="datetime">2014-01-21T14:23:49+02:00</updated_at> <user_id type="integer">2</user_id> <schedule_logs type="array"> <schedule_log> <created_at type="datetime">2014-01-21T14:23:49+02:00</created_at> <id type="integer">39</id> <log_output></log_output> <schedule_id type="integer">17</schedule_id> <status>complete</status> <updated_at type="datetime">2014-01-21T14:23:49+02:00</updated_at> </schedule_log> <schedule_log> <created_at type="datetime">2014-01-20T14:23:49+02:00</created_at> <id type="integer">32</id> <log_output></log_output> <schedule_id type="integer">17</schedule_id> <status>complete</status> <updated_at type="datetime">2014-01-20T14:23:49+02:00</updated_at> </schedule_log> </schedule_logs> </schedule> <schedule> <action>autobackup</action> <created_at type="datetime">2014-01-20T14:23:44+02:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">18</id> <params nil="true"/> <period>weeks</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2014-01-27T14:23:44+02:00</start_at> <status>enabled</status> <target_id type="integer">9</target_id> <target_type>VirtualMachine</target_type> <updated_at type="datetime">2014-01-20T14:23:54+02:00</updated_at> <user_id type="integer">2</user_id> OnApp Cloud 4.1 API Guide <schedule_logs type="array"> <schedule_log> OnApp Cloud 4.1 API Guide <created_at type="datetime">2014-01-20T14:23:54+02:00</created_at> <id type="integer">33</id> <log_output></log_output> <schedule_id type="integer">18</schedule_id> <status>complete</status> <updated_at type="datetime">2014-01-20T14:23:54+02:00</updated_at> </schedule_log> </schedule_logs> </schedule> <schedule> <action>autobackup</action> <created_at type="datetime">2014-01-20T14:23:44+02:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">19</id> <params nil="true"/> <period>months</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2014-02-20T14:23:44+02:00</start_at> <status>enabled</status> <target_id type="integer">9</target_id> <target_type>VirtualMachine</target_type> <updated_at type="datetime">2014-01-20T14:23:59+02:00</updated_at> <user_id type="integer">2</user_id> <schedule_logs type="array"> <schedule_log> <created_at type="datetime">2014-01-20T14:23:59+02:00</created_at> <id type="integer">34</id> <log_output></log_output> <schedule_id type="integer">19</schedule_id> <status>complete</status> <updated_at type="datetime">2014-01-20T14:23:59+02:00</updated_at> </schedule_log> </schedule_logs> </schedule> <schedule> <action>autobackup</action> <created_at type="datetime">2014-01-20T14:23:44+02:00</created_at> <duration type="integer">1</duration> <failure_count type="integer">0</failure_count> <id type="integer">20</id> <params nil="true"/> <period>years</period> <rotation_period type="integer">1</rotation_period> <start_at type="datetime">2015-01-20T14:23:44+02:00</start_at> <status>enabled</status> <target_id type="integer">9</target_id> <target_type>VirtualMachine</target_type> <updated_at type="datetime">2014-01-20T14:24:04+02:00</updated_at> <user_id type="integer">2</user_id> <schedule_logs type="array"> <schedule_log> <created_at type="datetime">2014-01-20T14:24:04+02:00</created_at> <id type="integer">35</id> <log_output></log_output> <schedule_id type="integer">20</schedule_id> <status>complete</status> OnApp Cloud 4.1 API Guide <updated_at type="datetime">2014-01-20T14:24:04+02:00</updated_at> </schedule_log> OnApp Cloud 4.1 API Guide </schedule_logs> </schedule> </schedules> Where: duration - the number specifying how often a backup should be taken target_id – ID of the action target period - the time period (days, weeks, months, or years) action – the action performed start_at – time, when the action starts id – schedule id user_id – ID of the disk (action target) user schedule_logs – an array with schedule log details, where: schedule_id – ID of a schedule id – ID of the schedule log log_output – an array with log details status – status of the action (complete, failed, etc.) failure_count – number of failures during the action status – schedule status (enabled or disabled) target_type – type of the target Add Schedule to Disk You can add a schedule to a disk using the following method: POST /settings/disks/:disk_id/schedules.xml POST /settings/disks/:disk_id/schedules.json XML Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/schedules.xml -d '<schedule><action>autobackup</action><duration>1</duration><period>days</period><rot a tion_period>1</rotation_period><status>enabled</status><start_at>2014-11-12 10:36</start_at></schedule>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/schedules.json -d '{"schedule":{"action":"autobackup","duration":"1","period":"days","rotation_period": " 1","status":"enabled","start_at": "2014-11-12 10:36"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: action* - set Autobackup to add a backup schedule duration* - specify duration period* - set the period (days/weeks/months) rotation_period - number of backups after which the first backup will be deleted OnApp Cloud 4.1 API Guide status* - set enabled to activate a schedule. OnApp Cloud 4.1 API Guide start_at - set the time when backup scheduling transaction will be created. Page history OnApp 3.5: start_at OnApp 3.2: rotation_period Add Schedule to Virtual Server To add incremental backup schedule to a virtual server: POST /virtual_machines/:virtual_machine_id/schedules.xml POST /virtual_machines/:virtual_machine_id/schedules.json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/virtual_machines/:virtual_machine_id/schedules.xml -d '<schedule><duration>6</duration><period>weeks</period><rotation_period>5</rotation_p e riod><enabled>1</enabled><action>autobackup</action><start_at>2014-11-12 10:36</start_at></schedule>' JSON Request example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/virtual_machines/:virtual_machine_id/schedules.json -d '{"schedule":{"duration":"6", "period":"weeks", "rotation_period":"5", "enabled":"1", "action":"autobackup","start_at": "2014-11-12 10:36"}}' Where: duration* - how often a disk backup is taken period* - time period for a backup schedule (days, weeks, months, or years) rotation_period - number of backups after which the first backup will be deleted status* - set enabled to activate a schedule. start_at - set the time when backup scheduling transaction will be created. Page history OnApp 3.5: start_at OnApp 3.2: rotation_period Edit Disk Schedule OnApp Cloud 4.1 API Guide To edit disk's schedule, use the following method: OnApp Cloud 4.1 API Guide PUT /settings/schedules/:id.xml PUT /settings/schedules/:id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' d'<schedule><duration>3</duration><period>days</period><rotation_period>1</rotation_p eriod><status>enabled</status><start_at>2014-11-12 10:36</start_at></schedule>' -u user:userpass --url http://onapp.test/settings/schedules/:id.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' d'{"schedule":{"duration":"1","rotation_period":"1","period":"years","status":"enable d","start_at": "2014-11-12 10:36"}}' -u user:userpass --url http://onapp.test/settings/schedules/:id.json Currently, you can edit the following parameters: duration* - how often a disk backup is taken period* - time period for a backup schedule (days, weeks, months, or years) rotation_period - number of backups after which the first backup will be deleted status* - set enabled to activate a schedule. start_at - set the time when backup scheduling transaction will be created. Page history OnApp 3.5: start_at OnApp 3.2: rotation_period Edit Virtual Server Schedule To edit virtual server's incremental backup schedule, use the following method: PUT /virtual_machines/:id/schedules/:schedule_id.xml PUT /virtual_machines/:id/schedules/:schedule_id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.xml -d '<schedule><duration>6</duration><period>weeks</period><rotation_period>5</rotation_p e riod><enabled>1</enabled><action>autobackup</action><start_at>2014-11-12 10:36</start_at></schedule>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.json -d '{"schedule":{"duration":"6","period":"weeks","rotation_period":"5", "enabled":"1", "action":"autobackup","start_at": "2014-11-12 10:36"}}' Currently, you can edit the following parameters: duration* - how often a disk backup is taken period* - time period for a backup schedule (days, weeks, months, or years) rotation_period - number of backups after which the first backup will be deleted status* - set enabled to activate a schedule. start_at - set the time when backup scheduling transaction will be created. Page history OnApp 3.5: start_at OnApp 3.2: rotation_period Delete Disk Schedule DELETE /settings/schedules/:id.xml DELETE /settings/schedules/:id.json XML Request example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/settings/schedules/:id.xml JSON Request example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/settings/schedules/:id.json Delete Virtual Server Schedule DELETE /settings/schedules/:id.xml DELETE /settings/schedules/:id.json XML Request example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.xml JSON Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.json Where you have to specify backup server ID and schedule ID. Background Task Daemon Background task daemon starts/stops/reloads/checks status of all background tasks that run in the system. Get Background Task Daemon Status To get backgrounbd task daemon status: GET /sysadmin_tools/daemon/status.xml GET /sysadmin_tools/daemon/status.json XML Request example: curl -i -X GET -u user:userpass http://onapp.test/sysadmin_tools/daemon/status.xml H 'Accept: application/xml' -H 'Content-type: application/xml' XML Response example: <?xml version="1.0" encoding="UTF-8"?> <daemon> <status>Online</status> </daemon> Where: status - background task status Start Background Task Daemon To start background task daemon, run: POST /sysadmin_tools/daemon/start.xml POST /sysadmin_tools/daemon/start.json XML Request example: curl -i -X POST -u user:userpass http://onapp.test/sysadmin_tools/daemon/start.xml 'Accept: application/xml' -H 'Content-type: application/xml' XML Response example: <?xml version="1.0" encoding="UTF-8"?> <daemon> <status>Online</status> </daemon> Where: status - background task status OnApp Cloud 4.1 API Guide Stop Background Task Daemon OnApp Cloud 4.1 API Guide To stop background task daemon: POST /sysadmin_tools/daemon/stop.xml POST /sysadmin_tools/daemon/stop.json Request example: curl -i -X POST -u user:userpass http://onapp.test/sysadmin_tools/daemon/stop.xml 'Accept: application/xml' -H 'Content-type: application/xml' Response example: <?xml version="1.0" encoding="UTF-8"?> <daemon> <status>Offline</status> </daemon> Where: status - background task status Reload Background Task Daemon To reload a background task daemon: POST /sysadmin_tools/daemon/reload.xml POST /sysadmin_tools/daemon/reload.json XML Request example: curl -i -X POST -u user:userpass http://onapp.test/sysadmin_tools/daemon/reload.xml H 'Accept: application/xml' -H 'Content-type: application/xml' XML Response example: <?xml version="1.0" encoding="UTF-8"?> <daemon> <status>OK</status> </daemon> Where: status - background task status Backups/ Snapshots Lists the backups/snapshots taken of that virtual server, and provides tools to restore a backup, delete backups, and convert backups to templates. OnApp supports two backup types: normal and incremental: Normal backup - simple method of taking backups by making full copy of target data. Incremental - advanced method of taking backups. During the incremental backup, only the changes made after the last backup are archived instead of backing up the whole target. If you are using incremental backups option, you should either enable dedicated backup servers in your cloud or share the backups and templates folders (paths) between your compute resources. SSH file transfer option will be skipped for virtual servers using incremental backups. Existing full backups will be still accessible via Backups > Images menu. OnApp Cloud 4.1 API Guide Get List of All VS Backups GET /virtual_machines/:virtual_machine_id/backups.xml GET /virtual_machines/:virtual_machine_id/backups.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups.json An array of backups is returned. If there are no backups, an empty array is returned. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">310896</backup_size> <built type="boolean">true</built> <built_at type="datetime">2013-12-24T14:34:06+03:00</built_at> <created_at type="datetime">2013-12-24T14:31:20+03:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">1951</id> <identifier>uml64qyvbzv1kb</identifier> <image_type nil="true"/> <initiated>days</initiated> <iqn nil="true"/> <locked type="boolean">false</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">11860</target_id> <target_type>Disk</target_type> <template_id type="integer">897</template_id> <updated_at type="datetime">2013-12-24T14:34:06+03:00</updated_at> <user_id type="integer">1875</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">11860</disk_id> </backup> </backups> Explanation of the data returned: allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed up allowed_hot_migrate – true if hot migration is allowed for the storage server backed up allowed_swap – true if swap disk is allowed for storage server backed up, otherwise false backup_server_id – the ID of the backup server on which the backup is stored backup_size – the disk space taken by this backup in kB backup_type – normal or incremental built – true if the storage server backed up has been built built_at – the date when the disk backup was built created_at – the date when the record in the database was created updated_at – the date when this record in database was updated data_store_type - data store type: lvm, vmware or solidfire id – the ID of this backup identifier - disk identifier OnApp Cloud 4.1 API Guide image_type - backup type (currently only tar is available) initiated - period when backup is initiated: days, weeks, months, or years locked – true if the storage server backed up has been locked marked_for_delete – the backup is marked for deletion (for auto-backups) min_disk_size – the minimum disk size operating_system_distro – the OS distribution of the storage server backed up operating_system – the OS of the storage server backed up target_id - ID of a backup target target_type - target for which the backup was taken; For normal backups it is a disk. For incremental backups it's virtual server. template_id – the ID of a template from which the storage server backed up was built user_id - the ID of a user the storage server belongs to volume_id - data store ID SolidFire - related parameters: iqn - volume ISCSI qualified name Get List of Normal Backups GET /virtual_machines/:virtual_machine_id/backups/images.xml GET /virtual_machines/:virtual_machine_id/backups/images.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups/images.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups/images.json An array of backups is returned. If there are no backups, an empty array is returned. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">310896</backup_size> <built type="boolean">true</built> <built_at type="datetime">2013-12-24T14:34:06+03:00</built_at> <created_at type="datetime">2013-12-24T14:31:20+03:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">1951</id> <identifier>uml64qyvbzv1kb</identifier> <image_type nil="true"/> <initiated>days</initiated> <iqn nil="true"/> <locked type="boolean">false</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">11860</target_id> <target_type>Disk</target_type> <template_id type="integer">897</template_id> <updated_at type="datetime">2013-12-24T14:34:06+03:00</updated_at> <user_id type="integer">1875</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">11860</disk_id> </backup> </backups> Explanation of the data returned: allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed up allowed_hot_migrate – true if hot migration is allowed for the storage server backed up allowed_swap – true if swap disk is allowed for storage server backed up, otherwise false backup_server_id – the ID of the backup server on which the backup is stored backup_size – the disk space taken by this backup in kB backup_type – normal or incremental built – true if the storage server backed up has been built built_at – the date when the disk backup was built created_at – the date when the record in the database was created updated_at – the date when this record in database was updated data_store_type - data store type: lvm, vmware or solidfire id – the ID of this backup identifier - disk identifier OnApp Cloud 4.1 API Guide image_type - backup type (currently only tar is available) initiated - period when backup is initiated: days, weeks, months, or years locked – true if the storage server backed up has been locked marked_for_delete – the backup is marked for deletion (for auto-backups) min_disk_size – the minimum disk size operating_system_distro – the OS distribution of the storage server backed up operating_system – the OS of the storage server backed up target_id - ID of a backup target target_type - target for which the backup was taken; For normal backups it is a disk. For incremental backups it's virtual server. template_id – the ID of a template from which the storage server backed up was built user_id - the ID of a user the storage server belongs to volume_id - data store ID SolidFire - related parameters: iqn - volume ISCSI qualified name Get List of Incremental Backups GET /virtual_machines/:virtual_machine_id/backups/files.xml GET /virtual_machines/:virtual_machine_id/backups/files.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups/files.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/backups/files.json An array of backups is returned. If there are no backups, an empty array is returned. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <backup_size type="integer">1121652</backup_size> <built type="boolean">true</built> <built_at type="datetime">2013-12-18T11:00:47+00:00</built_at> <created_at type="datetime">2013-12-18T10:59:41+00:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">698</id> <identifier>y5cc19dv7bsdrk</identifier> <initiated>manual</initiated> <iqn nil="true"/> <locked type="boolean">false</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <note>Stuarts backup</note> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">74</target_id> <target_type>VirtualMachine</target_type> <template_id type="integer">6</template_id> <updated_at type="datetime">2013-12-18T11:00:47+00:00</updated_at> <user_id type="integer">8</user_id> <volume_id nil="true"/> <backup_type>incremental</backup_type> <disk_id nil="true"/> </backup> </backups> Explanation of the data returned: allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed up allowed_hot_migrate – true if hot migration is allowed for the storage server backed up allowed_swap – true if swap disk is allowed for storage server backed up, otherwise false backup_server_id – the ID of the backup server on which the backup is stored backup_size – the disk space taken by this backup in kB backup_type – normal or incremental built – true if the storage server backed up has been built built_at – the date when the disk backup was built created_at – the date when the record in the database was created updated_at – the date when this record in database was updated data_store_type - data store type: lvm, vmware or solidfire id – the ID of this backup identifier - disk identifier OnApp Cloud 4.1 API Guide image_type - backup type (currently only tar is available) OnApp Cloud 4.1 API Guide initiated - period when backup is initiated: days, weeks, months, or years locked – true if the storage server backed up has been locked marked_for_delete – the backup is marked for deletion (for auto-backups) min_disk_size – the minimum disk size operating_system_distro – the OS distribution of the storage server backed up operating_system – the OS of the storage server backed up target_id - ID of a backup target target_type - target for which the backup was taken; For normal backups it is a disk. For incremental backups it's virtual server. template_id – the ID of a template from which the storage server backed up was built user_id - the ID of a user the storage server belongs to volume_id - data store ID SolidFire - related parameters: iqn - volume ISCSI qualified name Get List of Disk Backups To view the list of disk backups: GET GET /virtual_machines/:vm_id/disks/:disk_id/backups.xml /virtual_machines/:vm_id/disks/:disk_id/backups.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/virtual_machines/:vm_id/disks/:disk_id/backups.xml JSON Request example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:vm_id/disks/:disk_id/backups.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">310896</backup_size> <built type="boolean">true</built> <built_at type="datetime">2013-12-24T14:34:06+03:00</built_at> <created_at type="datetime">2013-12-24T14:31:20+03:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">1951</id> <identifier>uml64qyvbzv1kb</identifier> <image_type nil="true"/> <initiated>days</initiated> <iqn nil="true"/> <locked type="boolean">false</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">11860</target_id> <target_type>Disk</target_type> <template_id type="integer">897</template_id> <updated_at type="datetime">2013-12-24T14:34:06+03:00</updated_at> <user_id type="integer">1875</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">11860</disk_id> </backup> </backups> Explanation of the data returned: allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed up allowed_hot_migrate – true if hot migration is allowed for the storage server backed up allowed_swap – true if swap disk is allowed for storage server backed up, otherwise false backup_server_id – the ID of the backup server on which the backup is stored backup_size – the disk space taken by this backup in kB backup_type – normal or incremental built – true if the storage server backed up has been built built_at – the date when the disk backup was built created_at – the date when the record in the database was created updated_at – the date when this record in database was updated data_store_type - data store type: lvm, vmware,solidfire or id – the ID of this backup identifier - disk identifier OnApp Cloud 4.1 API Guide image_type - backup type (currently only tar is available) OnApp Cloud 4.1 API Guide initiated - period when backup is initiated: days, weeks, months, or years locked – true if the storage server backed up has been locked marked_for_delete – the backup is marked for deletion (for auto-backups) min_disk_size – the minimum disk size operating_system_distro – the OS distribution of the storage server backed up operating_system – the OS of the storage server backed up target_id - ID of a backup target target_type - target for which the backup was taken; For normal backups it is a disk. For incremental backups it's virtual server. template_id – the ID of a template from which the storage server backed up was built user_id - the ID of a user the storage server belongs to volume_id - data store ID SolidFire - related parameters: iqn - volume ISCSI qualified name Create Incremental Backup To take an incremental backup, use the following method: POST /virtual_machines/:id/backups.xml POST /virtual_machines/:id/backups.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' u user:password --url http://onapp.test/virtual_machines/:id/backups.xml -d '<backup><note>manual BU</note></backup>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type:application/json' u user:password --url http://onapp.test/virtual_machines/:id/backups.json -d '{"backup":{"note":"manual BU"}}' Where you have to specify the virtual server's ID note - optional backup note Create Disk Backup To take incremental backups for virtual servers that have incremental backups enabled, use Create Incremental Backup API call. To create a backup of a disk, use the following method: POST /settings/disks/:disk_id/backups.xml POST /settings/disks/:disk_id/backups.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' u user:password --url http://onapp.test/settings/disks/:id/backups.xml -d '<backup><note>manual backup</note><force_windows_backup>0</force_windows_backup></backup> JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type:application/json' u user:password --url http://onapp.test/settings/disks/:id/backups.json -d '{"backup":{"note":"manual backup", "force_windows_backup":"0"}}' note - optional note force_windows_backup - for Windows virtual servers only; enabling this option will guarantee the disk backup will be taken regardless of any file system problems This option should be only used as a last resort. If you enable this option there is no guarantee that backup will be consistent. Create Backups for All Disks It is not possible to take incremental backups for virtual servers that have incremental backups enabled. Use Create Incremental Backup API call instead. To create backups/snapshots of all VS disks: POST /virtual_machines/:vm_id/backups.xml POST /virtual_machines/:vm_id/backups.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/virtual_machines/irs1j5cl0l7pw2/backups.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/irs1j5cl0l7pw2/backups.json Where you have set the ID of a virtual server. Convert Backup to Template You can convert a backup into a custom template. A label for a template can be set with the backup[label], minimum disk size and minimum memory size parameters. POST /backups/:backup_id/convert.xml POST /backups/:backup_id/convert.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d'<?xml version="1.0" encoding="UTF-8" ?><backup><label>template.label</label><min_disk_size>50</min_disk_size><min_memory_s i ze>1024</min_memory_size></backup>' --url http://onapp.test/backups/:backup_id/convert.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d'{"backup":{"label":"backup_label", "min_disk_size":"20", "min_memory_size":"512"}}' --url http://onapp.test/backups/:backup_id/convert.json Where you have to specify the following parameters: label - template label min_disk_size - minimum disk size required in GB min_memory_size - minimum RAM required for the template Delete Backup To delete a disk backup: DELETE /backups/:id.xml DELETE /backups/:id.json XML Request example *curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/backups/:id.xml* JSON Request example *curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/backups/:id.json* An HTTP 204 response is returned on success, an HTTP 404 error is returned if a requested backup does not exist. Restore Backup You can restore a disk from a backup, using the following method: POST /backups/:backup_id/restore.xml POST /backups/:backup_id/restore.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/backups/:backup_id/restore.xml JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/backups/:backup_id/restore.json OnApp Cloud 4.1 API Guide Add/Edit Backup Note Use the following API request to update backup with a note: XML Request example curl -X PUT http://onapp.test/backups/:backup_id/note.xml -d '<backup><note>test note</note></backup>' -u user:password -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -X PUT http://onapp.test/backups/:backup_id/note.json -d '{"backup":{"note":"test note"}}' -u user:password -H 'Accept: application/json' -H 'Content-type: application/json' Where you have to specify backup ID in the URL. Backup Servers The backup servers feature allows users to store their backups and templates on the backup servers set up in the cloud. Backup servers can be organized into backup server zones. All API calls are available to this class. Get List of Backup Servers GET /settings/backup_servers.xml GET /settings/backup_servers.json Returns the array of backup servers. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backup_servers type="array"> <backup_server> <label>bk1</label> <created_at type="datetime">2012-01-04T10:18:59Z</created_at> <updated_at type="datetime">2012-01-16T14:11:30Z</updated_at> <backup_server_group_id type="integer">28</backup_server_group_id> <id type="integer">1</id> <backup_ip_address>192.168.123.1</backup_ip_address> <enabled type="boolean">true</enabled> <backups type="array"> <backup> <marked_for_delete type="boolean">false</marked_for_delete> <disk_id type="integer">3908</disk_id> <built_at type="datetime">2012-02-09T16:05:21Z</built_at> <operating_system_distro>rhel</operating_system_distro> <created_at type="datetime">2012-02-09T16:03:45Z</created_at> <template_id type="integer">233</template_id> <operating_system>linux</operating_system> <updated_at type="datetime">2012-02-09T16:05:21Z</updated_at> <backup_type>normal</backup_type> <allowed_swap type="boolean">true</allowed_swap> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <id type="integer">1508</id> <backup_server_id type="integer">1</backup_server_id> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <backup_size>175264</backup_size> <min_disk_size type="integer">5</min_disk_size> <identifier>pkg0v4k4n34ym8</identifier> <locked type="boolean">false</locked> <built type="boolean">true</built> </backup> </backup_server> </backup_servers> Explanation of the data returned: Backup server parameters: label – the backup server label created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format backup_server_group_id – the ID of a backup server group the backup server belongs to id – the backup server ID backup_server_ip_address - provisioning network IP address enabled – backup server parameter; if "enabled" = true, the backup server is enabled; if enabled = false, the backup server is disabled. Backup parameters: marked_for_delete – the backup is marked for deletion (for auto-backups) disk_id – the ID of a disk backed up built_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format operating_system_distro – the OS distribution of the VS from which the backup was created OnApp Cloud 4.1 API Guide created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format template_id – the ID of the template the VS is based on updated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format backup_type – disk backup type (normal, Days auto-backup, Weeks auto-backup, Months auto-backup, Years auto-backup) allowed_swap – true if the template to which the backup can be restored will allow swap, otherwise false. allow_resize_without_reboot – true if the template to which the backup can be restored will support resize without reboot option, otherwise false id – the backup ID backup_server_id – the ID of the backup server on which the backup is stored. allowed_hot_migrate – true if the template to which the backup can be restored will support hot migration, otherwise false. backup_size – the size of the backup min_disk_size – minimum disk size required for restoring a backup identifier – the backup identifier locked – true if the backup is being built, otherwise false built – true if the backup is already built, otherwise false Get Backup Server Details This method outputs the details for a particular backup server: GET /settings/backup_servers/:id.xml GET /settings/backup_servers/:id.json XML Output example OnApp Cloud 4.1 API Guide <backup_server> <label>bk1</label> <created_at type="datetime">2012-01-04T1204T10:18:59+02:0059Z</created_at> <backups type="array"> <backup> <marked_for_delete type="boolean">false</marked_for_delete> <disk_id type="integer">4097</disk_id> <built_at nil="true"/> <operating_system_distro>rhel</operating_system_distro> <created_at type="datetime">2012-02-11T00:36:17Z</created_at> <template_id type="integer">211</template_id> <operating_system>linux</operating_system> <updated_at type="datetime">2012-03-05T13:42:15+02:0002-11T00:36:17Z</updated_at> <backup_type>months-autobackup</backup_type> <allowed_swap type="boolean">true</allowed_swap> <allow_resize_without_reboot type="boolean">true</allow_resize_without_reboot> <id type="integer">1526</id> <backup_server_id type="integer">1</backup_server_id> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <backup_size nil="true"/> <min_disk_size nil="true"/> <identifier>gmkrf5k0s4hsnj</identifier> <locked type="boolean">true</locked> <built type="boolean">false</built> </backup> </backups> <updated_at type="datetime">2012-02-14T14:01:20Z</updated_at> <backup_ip_address>192.168.123.1</backup_ip_address> <backup_server_group_id nil="true"/>type="integer">28</backup_server_group_id> <id type="integer">1</id> <enabled type="boolean">true</enabled> <capacity type="integer">460</capacity> <ip_address>109.123.105.162</ip_address> </backup_server> Explanation of the data returned: label – backup server label created at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – the backup server ID backups – a list of backups stored on this backup server ID with the following details: template_id – the ID of the template the VS from which the backup was created was based on operating_system – the operating system of the VA from which the backup was created backup_server_group_id – the ID of the backup server zone the backup server belongs to enabled – backup server parameter; if "enabled" = true, the backup server will be enabled; if enabled=false, the backup server iswill be disabled. capacity – the backup server capacity ip_address – the backup server IP backup_server_ip_address - provisioning network IP address OnApp Cloud 4.1 API Guide To view the list of backups with their details, please refer to the Search Backups section. Add Backup Server To create a backup server where users will be able to store backups and templates, send the following request: POST /settings/backup_servers.xml POST /settings/backup_servers.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_servers.xml -d '<backup_server><label>az_val</label><enabled>1</enabled><capacity>40</capacity><ip_a d dress>172.0.0.1</ip_address><backup_ip_address>192.168.123.1</backup_ip_address></bac k up_server>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_servers.json d '{"backup_server":{"label":"az_val", "enabled":"1", "capacity":"40", "ip_address":"172.0.0.1","backup_ip_address":"192.168.123.1"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* – backup server label ip_address* – valid Ipv4 address backup_server_ip_address - provisioning network IP address capacity* – set the backup server capacity enabled – set the "enabled" as 1 if you want the backup server to be enabled, or 0 if you want it to be disabled. If you skip the enabled parameter, the backup server will be disabled by default. XML Output example <?xml version="1.0" encoding="UTF-8"?> <backup_server> <label>az_val_1</label> <created_at type="datetime">2012-02-10T15:14:53Z</created_at> <updated_at type="datetime">2012-02-10T15:14:53Z</updated_at> <backup_ip_address>192.168.123.1</backup_ip_address> <backup_server_group_id nil="true"></backup_server_group_id> <id type="integer">25</id> <enabled type="boolean">true</enabled> <backups type="array"/> <capacity type="integer">40</capacity> <ip_address>172.0.0.2</ip_address> </backup_server> Edit Backup Server Use the following method to edit a backup server: OnApp Cloud 4.1 API Guide PUT /settings/backup_server/:id.xml PUT /settings/backup_server/:id.json XML Request example curl -i -X PUT -u user:userpass http://onapp.test/settings/backup_servers/:id.xml -d '<backup_server><label>az_val_ue_xml</label><enabled>1</enabled><capacity>40</capacit y ><ip_address>172.0.0.2</ip_address><backup_ip_address>192.168.123.1</backup_ip_address ></backup_server>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/settings/backup_servers/:id.json d '{"backup_server":{"label":"az_val_ue_json", "enabled":"1", "capacity":"40", "ip_address":"172.0.0.1","backup_ip_address":"192.168.123.1"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: label – backup server label enabled – set the "enabled" as 1 if you want the backup server to be enabled, or 0 if you it to be disabled. If you skip the enabled parameter, the backup server will be disabled by default. capacity* – set the backup server capacity ip_address* – valid Ipv4 address backup_server_ip_address - provisioning network IP address You will get a 204 status response on success, and 404 if there is no such a backup server with a requested ID or you entered incorrect URL. Delete Backup Server DELETE /settings/backup_servers/:id.xml DELETE /settings/backup_servers/:id.json XML Request example curl -i -X DELETE -u user:userpass http://onapp.test/settings/backup_servers/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/settings/backup_servers/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' You will get a 204 status response on success, and 404 if there is no such a backup server with a requested ID or you entered incorrect URL. Search Backups To find a backup stored at a particular backup server, use the following request: GET /settings/backup_servers/:id/backups_search.xml GET /settings/backup_servers/:id/backups_search.json OnApp Cloud 4.1 API Guide You can set the following search parameters: size – set the size [from] and [to] backup search parameters to search backups by their size OnApp Cloud 4.1 API Guide date – set the date [startdate] and [enddate]backup search parameters to search for backups created between two dates. The following request returns the array of backups created between 02/01/12 and 02/24/2012 dates and having the size from 10 to 300 GB. XML Request example curl -i -X GET -u user:userpass 'http://onapp.test/settings/backup_servers/1/backups_search.xml?size[from]=10&size[to ] =300&period[startdate]=02/01/12&period[enddate]=02/24/2012&searching=az' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET -u user:userpass 'http://onapp.test/settings/backup_servers/1/backups_search.json?size[from]=10&size[t o ]=300&period[startdate]=02/01/12&period[enddate]=02/24/2012&searching=az' -H 'Accept: application/json' -H 'Content-type: application/json' Please be aware that some Unix command shells can output an error because of square brackets. To prevent the error, use the back slash escape symbol. The example curl with back slashes is as follows: XML Request example curl -i -X GET -u user:userpass 'http://onapp.test/settings/backup_servers/1/backups_search.xml?size\\[from\\]=10&siz e \\[to\\]=300&period\\[startdate\\]=02/01/12&period\\[enddate ]=02/24/2012&searching=az' -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X GET -u user:userpass 'http://onapp.test/settings/backup_servers/1/backups_search.json?size\\[from\\]=10&si z e\\[to\\]=300&period\\[startdate\\]=02/01/12&period\\[enddate ]=02/24/2012&searching=az' -H 'Accept: application/json' -H 'Contenttype: application/json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <marked_for_delete type="boolean">false</marked_for_delete> <disk_id type="integer">3908</disk_id> <built_at type="datetime">2012-02-09T16:05:21Z</built_at> <operating_system_distro>rhel</operating_system_distro> <created_at type="datetime">2012-02-09T16:03:45Z</created_at> <template_id type="integer">233</template_id> <operating_system>linux</operating_system> <updated_at type="datetime">2012-02-09T16:05:21Z</updated_at> <backup_type>normal</backup_type> <allowed_swap type="boolean">true</allowed_swap> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <id type="integer">1508</id> <backup_server_id type="integer">1</backup_server_id> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <backup_size>175264</backup_size> <min_disk_size type="integer">5</min_disk_size> <identifier>pkg0v4k4n34ym8</identifier> <locked type="boolean">false</locked> <built type="boolean">true</built> </backup> </backups> Explanation of the data returned: backups – an array of backups stored on the backup server: marked_for_delete – the backup is marked for deletion (for auto-backups) disk_id – the ID of a disk backed up built_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format operating_system_distro – the OS distribution of the VS from which the backup was created created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format template_id – the ID of the template the VS is based on updated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format backup_type – disk backup type (normal, Days auto-backup, Weeks auto-backup, Months auto-backup, Years auto-backup) allowed_swap – true if the template to which the backup can be restored will allow swap, otherwise false. allow_resize_without_reboot – true if the template to which the backup can be restored will support resize without reboot option, otherwise false id – the backup ID backup_server_id – the ID of the backup server on which the backup is stored. allowed_hot_migrate – true if the template to which the backup can be restored will support hot migration, otherwise false. backup_size – the size of the backup min_disk_size – minimum disk size required for restoring a backup identifier – the backup identifier locked – true if the backup is being built, otherwise false built – true if the backup is already built, otherwise false OnApp Cloud 4.1 API Guide For details refer to Get The List Of Backup Servers section. OnApp Cloud 4.1 API Guide Note that the backup search returns only the list of backups, stored on a specified backup server, which a user has permission to see ( own backups or all backups). For instructions on how to see the list of all backup servers, refer to Get The List of Backup Servers sectio n. Create Cloud Boot Backup Server To create a backup server where users will be able to store backups and templats, send the following request: POST /settings/backup_servers.xml POST /settings/backup_servers.json Before creating a Cloud Boot backup server, you have to create new KVM compute resource with an IP address from the dynamic range. XML Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_servers.xml -d '<backup_server><label>az_val</label><enabled>1</enabled><capacity>40</capacity><back u p>true</backup><ip_address>172.0.0.1</ip_address><backup_ip_address>192.168.123.1</ba c kup_ip_address></backup_server>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_servers.json d '{"backup_server":{"label":"az_val", "enabled":"1", "capacity":"40", "ip_address":"172.0.0.1","backup_ip_address":"192.168.123.1"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* – backup server label ip_address* – IP address of a KVM compute resource backup - set true to create a Cloud Boot backup server backup_server_ip_address - provisioning network IP address capacity* – set the backup server capacity enabled – set the "enabled" as 1 if you want the backup server to be enabled, or 0 if you want it to be disabled. If you skip the enabled parameter, the backup server will be disabled by default. PLEASE NOTE: You should configure some local or remote attached storage for persistent backups on the provisioning/backup server. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backup_server> <label>az_val_1</label> <created_at type="datetime">2012-02-10T15:14:53Z</created_at> <updated_at type="datetime">2012-02-10T15:14:53Z</updated_at> <backup_ip_address>192.168.123.1</backup_ip_address> <backup_server_group_id nil="true"></backup_server_group_id> <id type="integer">25</id> <enabled type="boolean">true</enabled> <backups type="array"/> <capacity type="integer">40</capacity> <ip_address>172.0.0.2</ip_address> </backup_server> Backup Server Zones Backup server zone consists of several backup servers that share the same user permissions and are assigned to one billling plan. Backup server zones can be used for organizing and managing backup servers and creating different tiers of servers for customers. Get List of Backup Server Zones To get the list of backup server zones: GET /settings/backup_server_zones.xml GET /settings/backup_server_zones.json XML Response example <?xml version="1.0" encoding="UTF-8"?> <backup_server_groups type="array"> <backup_server_group> <label>bsz</label> <location_group_id type="integer">1</location_group_id> <created_at type="datetime">2012-01-04T11:50:40Z</created_at> <updated_at type="datetime">2012-01-04T11:50:40Z</updated_at> <id type="integer">28</id> </backup_server_group> </backup_server_groups> Where: label – backup server zone title location_group_id - ID of a location group the backup server zone is assigned to id – backup server zone ID Page history v. 3.1: Added the location_group_id parameter Get Backup Server Zone Details OnApp Cloud 4.1 API Guide To get the backup server zone details: OnApp Cloud 4.1 API Guide GET /settings/backup_server_zones/:id.xml GET /settings/backup_server_zones/:id.json XML Response example <?xml version="1.0" encoding="UTF-8"?> <backup_server_group> <label>bsz</label> <location_group_id type="integer">1</location_group_id> <created_at type="datetime">2012-01-04T11:50:40Z</created_at> <updated_at type="datetime">2012-01-04T11:50:40Z</updated_at> <id type="integer">28</id> </backup_server_group> Where: label – backup server zone title location_group_id - ID of a location group the backup server zone is assigned to id – backup server zone ID Page history v. 3.1: Added the location_group_id parameter Add Backup Server Zone To create a backup server zone, use the following request: POST /settings/backup_server_zones.xml POST /settings/backup_server_zones.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones.xml d '<backup_server_group><label>az_val_xml</label><location_group_id>1</location_group_i d ></backup_server_group>' -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones.json -d '{"backup_server_group":{"label":"az_val_json","location_group_id":"1"}}' H 'Accept: application/json' -H 'Content-type: application/json' Where: label *– specify a new label of the backup server zone location_group_id - ID of a location group you wish to assign the backup server zone to Page history v. 3.1: Added the location_group_id parameter OnApp Cloud 4.1 API Guide Edit Backup Server Zone PUT /settings/backup_server_zones/:id.xml PUT /settings/backup_server_zones/:id.json XML Request example curl -i -X PUT -u user:userpass http://onapp.test/settings/backup_server_zones/:id.xml -d '<backup_server_group><label>az_val_change</label><location_group_id>1</location_grou p _id></backup_server_group>' -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/settings/backup_server_zones/:id.json -d '{"backup_server_group":{"label":"az_val_change","location_group_id":"1"}}' H 'Accept: application/json' -H 'Content-type: application/json' Where: label *– specify a new label of the backup server zone location_group_id - ID of a location group you wish to assign the backup server zone to. You can change the already assigned location only if there are no backups or templates stores on backup servers of current zone. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no backup server zone with a requested ID, or URL is incorrect. Page history v. 3.1: Added the location_group_id parameter Delete Backup Server Zone To delete a backup server zone, use the following API call: DELETE /settings/backup_server_zones/:id.xml DELETE /settings/backup_server_zones/:id.json XML Request example curl -i -X DELETE -u user:userpass http://onapp.test/settings/backup_server_zones/:id.xml -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/settings/backup_server_zones/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Returns HTTP 204 response on successful processing, and HTTP 404 when there is no backup server zone with a requested ID, or URL is incorrect. Get List of Servers Assigned to Backup Server Zone To get the list of servers assigned to the backup server zone, use the following request: GET /settings/backup_server_zones/:backup_server_zone_id/backup_servers.xml GET /settings/backup_server_zones/:backup_server_zone_id/backup_servers.json JSON Request example curl -i -X GET -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers. j son -H 'Accept: application/json' -H 'Content-type: application/json' XML Request example curl -i -X GET -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers. x ml -H 'Accept: application/xml' -H 'Content-type: application/xml' XML Output example <?xml version="1.0" encoding="UTF-8"?> <backup_servers type="array"> <backup_server> <label>az_val_ue_xml</label> <created_at type="datetime">2012-02-10T15:14:53Z</created_at> <updated_at type="datetime">2012-02-10T15:31:13Z</updated_at> <backup_server_group_id type="integer">55</backup_server_group_id> <id type="integer">25</id> <enabled type="boolean">true</enabled> <backups type="array"/> <capacity type="integer">40</capacity> <ip_address>172.0.0.2</ip_address> </backup_server> </backup_servers> Explanation of the data returned: backup_servers –the array of backup servers assigned to this zone with the following details: label – backup server label created at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format backup_server_group_id – the ID of the backup server zone the backup server belongs to id – the backup server ID enabled – backup server parameter; if "enabled" = true, the backup server is enabled; if enabled=false, the backup server is disabled. backups – the list of backups stored at the backup server capacity – the backup server capacity OnApp Cloud 4.1 API Guide ip_address – the backup server IP OnApp Cloud 4.1 API Guide Assign Backup Server to Backup Server Zone POST /settings/backup_server_zones/:backup_server_zone_id/backup_servers/:backup_server_id/attach.xml POST /settings/backup_server_zones/:backup_server_zone_id/backup_servers/:backup_server_id/attach.json Using this request you attach an unassigned backup server (:backup_server_id *) to a backup server zone (:backup_server_zone_id *) XML Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers/ : backup_server_id/attach.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers/ : backup_server_id/attach.json -H 'Accept: application/json' -H 'Content-type: application/json' Unassign Backup Server from Backup Server Zone POST /settings/backup_server_zones/backup_server_zone_id/backup_server/:backup_server_id/detach.xml POST /settings/backup_server_zones/backup_server_zone_id/backup_server/:backup_server_id/detach.json Using this request you detach an assigned backup server (:backup_server_id *) from a backup server zone (:backup_server_zone_id *) XML Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers/ : backup_server_id/detach.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/settings/backup_server_zones/:backupserver_zone_id/backup_servers/: backup_server_id/detach.json -H 'Accept: application/json' -H 'Content-type: application/json' Baremetal Servers Baremetal servers are physical servers deployed for a single user, that reside directly on the hardware without the virtualization layer. NOTE: VLANs are not configured automatically on baremetal servers. You need to configure them manually in accordance with your OS and hardware settings. OnApp Cloud 4.1 API Guide Get List of Baremetal Servers OnApp Cloud 4.1 API Guide GET /baremetal_servers.xml GET /baremetal_servers.json Returns the array of baremetal servers <baremetal_servers type="array"> <baremetal_server> <admin_note nil="true"/> <allowed_swap type="boolean">true</allowed_swap> <built type="boolean">true</built> <cpu_sockets nil="true"/> <cpu_threads nil="true"/> <cpu_units nil="true"/> <created_at type="datetime">2015-03-04T17:10:24+02:00</created_at> <deleted_at nil="true"/> <hostname>zaza</hostname> <hypervisor_id type="integer">123</hypervisor_id> <id type="integer">3842</id> <identifier>vjktmvdlf0pyg3</identifier> <initial_root_password>qwaszx!Q2</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_BM</label> <local_remote_access_ip_address nil="true"/> <locked type="boolean">false</locked> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <recovery_mode nil="true"/> <state>delivered</state> <template_id type="integer">19</template_id> <template_label>debian-7.0-x64-1.4-xen.kvm.kvm_virtio.tar.gz</template_label> <updated_at type="datetime">2015-03-04T17:15:26+02:00</updated_at> <user_id type="integer">1</user_id> <ip_addresses type="array"> <ip_address> <address>109.123.105.156</address> <broadcast>109.123.105.159</broadcast> <created_at type="datetime">2014-01-15T11:18:12+02:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.105.145</gateway> <hypervisor_id nil="true"/> <id type="integer">324</id> <ip_address_pool_id nil="true"/> <network_address>109.123.105.144</network_address> <network_id type="integer">4</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2014-01-15T11:18:12+02:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.240</netmask> </ip_address> </ip_addresses> </baremetal_server> </baremetal_servers> OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide admin_note - an optional note of the administrator allowed_swap - true if swap disk is allowed (depends on the template the server is based on); otherwise false built - true if the server is built; otherwise false cpu_sockets - the amount of CPU sockets per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_threads - the amount of CPU threads per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan. created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format deleted_at - time when the VS was deleted hostname - the name of your host hypervisor_id - the ID of the compute resource used by this baremetal server id - the baremetal server ID identifier - the baremetal server identifier initial_root_password - the baremetal server root password initial_root_password_encrypted - true, if the baremetal server root password is encrypted, otherwise false label - the baremetal server label local_remote_access_ip_address - IP address used for remote access locked - true if the baremetal server is locked; otherwise false note - an optional reminder for this baremetal server made by a user account operating_system - operating system used by the baremetal server operating_system_distro - the distribution of the OS from which this baremetal server is built template_id - the ID of the template the baremetal server is based on template_label - the name of the template from which this baremetal server is built updated_at - the date when the baremetal server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format ip_addresses - an array of IP addresses with their details assigned to this baremetal server: address – baremetal server IP broadcast – a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. created_at – time when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - customer network ID disallowed_primary – true if not allowed to be used as primary (for baremetal server), otherwise false gateway - gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated at - time when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user this IP address is assigned to free – true if free, otherwise false netmask — netmask for the IP address Get Baremetal Server Details GET /baremetal_servers/:id.xml GET /baremetal_servers/:id.json Returns the array of baremetal servers OnApp Cloud 4.1 API Guide <baremetal_servers type="array"> <baremetal_server> <admin_note nil="true"/> <allowed_swap type="boolean">true</allowed_swap> <built type="boolean">true</built> <cpu_sockets nil="true"/> <cpu_threads nil="true"/> <cpu_units nil="true"/> <created_at type="datetime">2015-03-04T17:10:24+02:00</created_at> <deleted_at nil="true"/> <hostname>zaza</hostname> <hypervisor_id type="integer">123</hypervisor_id> <id type="integer">3842</id> <identifier>vjktmvdlf0pyg3</identifier> <initial_root_password>qwaszx!Q2</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_BM</label> <local_remote_access_ip_address nil="true"/> <locked type="boolean">false</locked> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <recovery_mode nil="true"/> <state>delivered</state> <template_id type="integer">19</template_id> <template_label>debian-7.0-x64-1.4-xen.kvm.kvm_virtio.tar.gz</template_label> <updated_at type="datetime">2015-03-04T17:15:26+02:00</updated_at> <user_id type="integer">1</user_id> <ip_addresses type="array"> <ip_address> <address>109.123.105.156</address> <broadcast>109.123.105.159</broadcast> <created_at type="datetime">2014-01-15T11:18:12+02:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.105.145</gateway> <hypervisor_id nil="true"/> <id type="integer">324</id> <ip_address_pool_id nil="true"/> <network_address>109.123.105.144</network_address> <network_id type="integer">4</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2014-01-15T11:18:12+02:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.240</netmask> </ip_address> </ip_addresses> </baremetal_server> </baremetal_servers> Where: admin_note - an optional note of the administrator allowed_swap - true if swap disk is allowed (depends on the template the server is based on); otherwise false OnApp Cloud 4.1 API Guide built - true if the server is built; otherwise false cpu_sockets - the amount of CPU sockets per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_threads - the amount of CPU threads per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan. created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format deleted_at - time when the VS was deleted hostname - the name of your host hypervisor_id - the ID of the compute resource used by this baremetal server id - the baremetal server ID identifier - the baremetal server identifier initial_root_password - the baremetal server root password initial_root_password_encrypted - true, if the baremetal server root password is encrypted, otherwise false label - the baremetal server label local_remote_access_ip_address - IP address used for remote access locked - true if the baremetal server is locked; otherwise false note - an optional reminder for this baremetal server made by a user account operating_system - operating system used by the baremetal server operating_system_distro - the distribution of the OS from which this baremetal server is built template_id - the ID of the template the baremetal server is based on template_label - the name of the template from which this baremetal server is built updated_at - the date when the baremetal server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format ip_addresses - an array of IP addresses with their details assigned to this baremetal server: address – baremetal server IP broadcast – a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. created_at – time when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - customer network ID disallowed_primary – true if not allowed to be used as primary (for baremetal server), otherwise false gateway - gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated at - time when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user this IP address is assigned to free – true if free, otherwise false netmask — netmask for the IP address Create Baremetal Server The management network should be disconnected during the bare metal server deployment. POST /baremetal_servers.xml POST /baremetal_servers.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST http://onapp.test/baremetal_servers.xml -d '<baremetal_server><template_id>2</template_id><label>test_baremetal</label><hostname > test</hostname><hypervisor_group_id>121</hypervisor_group_id><hypervisor_id>38</hyper v isor_id><initial_root_password>qwaszx</initial_root_password><primary_network_group_i d >120</primary_network_group_id><selected_ip_address_id>63</selected_ip_address_id><re q uired_ip_address_assignment>1</required_ip_address_assignment><recipe_ids type='array'><recipe_id>11</recipe_id></recipe_ids></baremetal_server>' -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/baremetal_servers.json -d '{"baremetal_server":{"template_id":"2","label":"test_baremetal","hostname":"test","h y pervisor_group_id":"121","hypervisor_id":"38", "initial_root_password":"qwaszx","primary_network_group_id":"120","selected_ip_addres s _id":"63","required_ip_address_assignment":"1", "recipe_ids":["11"]}}' -u user:password -H 'Accept:application/json' -H 'Contenttype: application/json' The following parameters should be sent: template_id* - the ID of a template from which a baremetal server should be built label* - user-friendly baremetal server description hostname* - specify the baremetal server hostname hypervisor_group_id - the ID of the baremetal zone in which the server will be created. Optional: if no compute zone is set, the baremetal server will be built in any available baremetal compute zone. hypervisor_id - the ID of a baremetal compute resource where the baremetal server will be built. If no baremetal compute resource ID is specified, the server will be built on the compute resource with the least available RAM (but sufficient RAM for the server) initial_root_password - the root password for a baremetal server. If none specified, the system will provide a random password. It can consist of 6-32 characters, letters [A-Za-z], digits [0-9], dash [ - ] and lower dash [ _ ]. You can use both lower- and uppercase letters. primary_network_group_id - the ID of the primary network group. Optional parameter. required_ip_address_assignment - set "1" if you want IP address to be assigned automatically after creation. Otherwise set "0" recipe_ids - an array of recipe IDs that can be used during the recipe server creation. You can only run recipes on baremetal server provisioning. Delete Baremetal Server DELETE /baremetal_servers/:id.xml DELETE /baremetal_servers/:id.json XML Request example curl -i -X DELETE -u user:userpass http://onapp.test/baremetal_servers/:id.xml H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -u user:userpass http://onapp.test/baremetal_servers/:id.json H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where: id – the ID of a baremetal server you want to delete Add/Edit Admin/User Note for Baremetal Server To edit/make an admin note, use the following request: PUT /baremetal_servers/:baremetal_server_id.xml PUT /baremetal_servers/:baremetal_server_id.json Add/Edit Admin Note XML Request example curl -i -X PUT -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id.xml -d '<baremetal_server><admin_note>agfagwe tiuuytjgh yuytu</admin_note></baremetal_server>' -H 'Accept:application/xml' H 'Content-type:application/xml' Add/Edit Admin Note JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id.json -d '{"baremetal_server":{"admin_note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' H 'Content-type:application/json' Where: admin_note – enter the text of your note. baremetal_server_id - the ID of the baremetal server for which you add/edit a note. Add/Edit User Note XML Request example curl -i -X PUT -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id.xml -d '<baremetal_server><note>agfagwe tiuuytjgh yuytu</note></baremetal_server>' H 'Accept:application/xml' -H 'Content-type:application/xml' Add/Edit User Note JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id.json -d '{"baremetal_server":{"note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' H 'Content-type:application/json' Where: note – enter the text of your note. baremetal_server_id - the ID of the baremetal server for which you add/edit a note. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no baremetal server with a requested ID, or URL is incorrect. OnApp Cloud 4.1 API Guide Enable Recovery Mode for Baremetal Server PUT /baremetal_servers/:id/enable_recovery.xml PUT /baremetal_servers/:id/enable_recovery.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:password --url http://onapp.test/baremetal_servers/:id/enable_recovery.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' u user:password --url http://onapp.test/baremetal_servers/:id/enable_recovery.json Where you have to specify baremetal server's ID. Disable Recovery Mode for Baremetal Server PUT /baremetal_servers/:id/enable_recovery.xml PUT /baremetal_servers/:id/enable_recovery.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:password --url http://onapp.test/baremetal_servers/:id/disable_recovery.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' u user:password --url http://onapp.test/baremetal_servers/:id/disable_recovery.json Where you have to specify baremetal server's ID. Billing Plans This class manages billing plans, which incorporate prices and resource limits for users. Billing plans can be associated with compute resource, network, data store and backup server zones, as well as template and edge groups. Consequently, these plans enable you to control overall user resource limits, and limits for resources in different zones of the cloud. To manage billing plans and their resources for a particular user, specify the request by a user_id parameter, e.g: GET /users/:user_id/billing_plans/:billing_plan_id/base_resources.xml These are the resources you can limit and set prices for, along with the units in which they are measured: User VS limits Pricing Virtual servers (Max) VS/hour Customer networks (Free, Max) customer network/hour Backup (Free, Max) backup/hour OnApp Cloud 4.1 API Guide Template (Free, Max) template/hour OnApp Cloud 4.1 API Guide Templates, ISOs & backup storage (Free, Max) GB/hour Autoscaling (Free, Max) VS/hour ISO (Free, Max) ISO/hour Limits for Template Store Template Store(s) Limits for Recipe Groups Recipe Group(s) Limits for Compute Zones Pricing CPU cores (Free, Max, On, Off) CPU core/hour (for VSs on and off) CPU share (Free, Max, On, Off) CPU share %/hour (for VSs on and off) CPU units (Free, Max, On, Off) CPU unit/hour (for VSs on and off) Memory (Free, Max, On, Off) Mb/hour CPU Priority (Min, Default) Data store zone limits Pricing Disk size (Free, Max, On, Off) GB/hour Data read (Free per hour, Price over free units) GB/hour Data written (Free per hour, Price over free units) GB/hour Input requests (Free per hour, Price over free units) 1M requests/hour Output requests (Free per hour, Price over free units) 1M requests/hour Network zone limits Pricing IP address (Free, Max, On, Off) IP/hour Port speed (Free, Max, On, Off) Mbps/hour Data reeived (free per hour/month, price over free units) GB/hour Data sent (free per hour/month, price over free units) GB/hour Backup server zone limits Pricing Backups (Free, Max) backup/hour Backups disk size (Free, Max) GB/hour Templates (Free, Max) template/hour Templates disk size (Free, Max) GB/hour Limits for Edge Groups Pricing Edge group GB/hour Limits for Guaranteed min IOPS Solidfire data store zones (Free, Max, On, Off) 1M requests/hour Limits for Instance Types Instance Types ( On, Off) VS/hour For the complete list of billing plan limits along with their details, refer to the Set Billing Plan Prices And Resource Limits section of the Admin guide. OnApp Cloud 4.1 API Guide Starting from the 3.1 release, the master bucket and master template zones are introduced: OnApp Cloud 4.1 API Guide Master bucket zones are set for compute zone limits. Master template zones set for data store zone and network zone limits, respectively. The master zones are added to each billing plan automatically. When the master bucket or master template zone limits are applied to a base resource, each virtual server within that base resource (compute resource, data store or network zone) will come under these values. NOTE: You can not edit a base resource which is a part of a master bucket or a master template zone. The HTTP status 422 will be returned. The relevant API calls have been added for the master zones management are added to the Billing Plans section of this guide: Add Base Resource to Master Bucket Zone Remove Base Resource form Master Bucket Zone Add Base Resource to Master Template Zone Remove Base Resource From Master Template Zone Get the List of Billing Plans To get the list of billing plans created in your cloud, use the following method: GET /billing_plans.xml GET /billing_plans.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <billing_plans type="array"> <billing_plan> <allows_kms type="boolean">false</allows_kms> <allows_mak type="boolean">true</allows_mak> <allows_own type="boolean">false</allows_own> <created_at type="datetime">2013-09-03T15:31:30+03:00</created_at> <currency_code>USD</currency_code> <id type="integer">1</id> <label>default billing</label> <monthly_price type="decimal">0.0</monthly_price> <show_price nil="true"/> <updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at> <associated_with_users type="integer">1</associated_with_users> <base_resources type="array"> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:30+03:00</created_at> <id type="integer">1</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit_data_read_free type="integer">0</limit_data_read_free> <limit_data_written_free type="integer">0</limit_data_written_free> <limit_reads_completed_free type="integer">0</limit_reads_completed_free> <limit_writes_completed_free type="integer">0</limit_writes_completed_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price_on>0.00000000</price_on> OnApp Cloud 4.1 API Guide <price_off>0.00000000</price_off> <price_data_read>0.00000000</price_data_read> OnApp Cloud 4.1 API Guide <price_data_written>0.00000000</price_data_written> <price_reads_completed>0.00000000</price_reads_completed> <price_writes_completed>0.00000000</price_writes_completed> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at> <label>Master Template Zone</label> <resource_name>data_store_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:31+03:00</created_at> <id type="integer">3</id> <is_bucket type="boolean">true</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free_cpu type="integer">0</limit_free_cpu> <limit_free_cpu_share type="integer">0</limit_free_cpu_share> <limit_free_memory type="integer">0</limit_free_memory> <limit_cpu nil="true"/> <limit_cpu_share nil="true"/> <limit_memory nil="true"/> <limit_default_cpu type="integer">1</limit_default_cpu> <limit_default_cpu_share type="integer">100</limit_default_cpu_share> <limit_cpu_units nil="true"/> <limit_free_cpu_units type="integer">0</limit_free_cpu_units> </limits> <preferences> <use_default_cpu type="boolean">false</use_default_cpu> <use_default_cpu_share type="boolean">false</use_default_cpu_share> <use_cpu_units type="boolean">false</use_cpu_units> </preferences> <prices> <price_on_cpu>0.00000000</price_on_cpu> <price_off_cpu>0.00000000</price_off_cpu> <price_on_cpu_share>0.00000000</price_on_cpu_share> <price_off_cpu_share>0.00000000</price_off_cpu_share> <price_on_memory>0.00000000</price_on_memory> <price_off_memory>0.00000000</price_off_memory> <price_on_cpu_units type="integer">0</price_on_cpu_units> <price_off_cpu_units type="integer">0</price_off_cpu_units> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-03T15:31:31+03:00</updated_at> <label>Master Bucket Zone</label> <resource_name>hypervisor_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:31+03:00</created_at> OnApp Cloud 4.1 API Guide <id type="integer">2</id> <is_bucket type="boolean">false</is_bucket> OnApp Cloud 4.1 API Guide <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_rate_free type="integer">0</limit_rate_free> <limit_ip_free type="integer">0</limit_ip_free> <limit_data_sent_free type="integer">0</limit_data_sent_free> <limit_data_received_free type="integer">0</limit_data_received_free> <limit_rate nil="true"/> <limit_ip nil="true"/> </limits> <preferences> </preferences> <prices> <price_rate_on>0.00000000</price_rate_on> <price_rate_off>0.00000000</price_rate_off> <price_ip_on>0.00000000</price_ip_on> <price_ip_off>0.00000000</price_ip_off> <price_data_sent>0.00000000</price_data_sent> <price_data_received>0.00000000</price_data_received> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-03T15:31:31+03:00</updated_at> <label>Master Template Zone</label> <resource_name>network_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> OnApp Cloud 4.1 API Guide </base_resources> </billing_plan> </billing_plans> Where: allows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise false allows_mak - true, if the MAK licensing is allowed, otherwise false allows_own - true, if adding own licenses is allowed for this billing plan, otherwise false created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format currency_code - the currency in which the users are charged id - the billing type ID label - the billing plan name monthly_price * - monthly fee for plan usage show_price - true, if users can see the prices set up for them, otherwise false. updated_at - the date when the billing plan was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format associated_with_users - the number of users with which this billing plan is associated base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false is_template - true, if this resource is a template zone, otherwise false label - name of the base resource target resource_name – the name of the base resource in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false in_template_zone - true, if this resource belongs to the template zone, otherwise false target_id – ID of a base resource target (e.g. compute zone). unit – a unit per which the price is set prices – an array of base resource prices limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits. limit_free – the number of GB user gets for free limit_cpu_units - the total number of CPU units users can get with this plan limit_free_cpu_units - the number of CPU units get for free use_cpu_units - true if CPU units are used instead of CPU shares price_on_cpu_units - price per unit per hour per VSs powered on price_off_cpu_units - price per CPU unit for VSs powered off See Get Base Resources for details on each resource limits type. Page history v3.3: limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units v3.1: Added the following parameters: associated_with_users OnApp Cloud 4.1 API Guide is_bucket is_template OnApp Cloud 4.1 API Guide in_bucket_zone in_template_zone Removed the following parameters: is_default use_default Get Billing Plan Details To get the list of billing plans created in your cloud, use the following method: GET /billing_plans/:id.xml GET /billing_plans/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <billing_plan> <allows_kms type="boolean">false</allows_kms> <allows_mak type="boolean">true</allows_mak> <allows_own type="boolean">false</allows_own> <created_at type="datetime">2013-09-03T15:31:30+03:00</created_at> <currency_code>USD</currency_code> <id type="integer">1</id> <label>default billing</label> <monthly_price type="decimal">0.0</monthly_price> <show_price nil="true"/> <updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at> <associated_with_users type="integer">1</associated_with_users> <base_resources type="array"> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:30+03:00</created_at> <id type="integer">1</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit_data_read_free type="integer">0</limit_data_read_free> <limit_data_written_free type="integer">0</limit_data_written_free> <limit_reads_completed_free type="integer">0</limit_reads_completed_free> <limit_writes_completed_free type="integer">0</limit_writes_completed_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price_on>0.00000000</price_on> <price_off>0.00000000</price_off> <price_data_read>0.00000000</price_data_read> <price_data_written>0.00000000</price_data_written> <price_reads_completed>0.00000000</price_reads_completed> <price_writes_completed>0.00000000</price_writes_completed> </prices> <target_id nil="true"/> <unit>gb</unit> OnApp Cloud 4.1 API Guide <updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at> OnApp Cloud 4.1 API Guide <label>Master Template Zone</label> <resource_name>data_store_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:31+03:00</created_at> <id type="integer">3</id> <is_bucket type="boolean">true</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free_cpu type="integer">0</limit_free_cpu> <limit_free_cpu_share type="integer">0</limit_free_cpu_share> <limit_free_memory type="integer">0</limit_free_memory> <limit_cpu nil="true"/> <limit_cpu_share nil="true"/> <limit_memory nil="true"/> <limit_default_cpu type="integer">1</limit_default_cpu> <limit_default_cpu_share type="integer">100</limit_default_cpu_share> <limit_cpu_units type="integer">10000</limit_cpu_units> <limit_free_cpu_units type="integer">100</limit_free_cpu_units> </limits> <preferences> <use_default_cpu type="boolean">false</use_default_cpu> <use_default_cpu_share type="boolean">false</use_default_cpu_share> <use_cpu_units type="boolean">true</use_cpu_units> </preferences> <prices> <price_on_cpu>0.00000000</price_on_cpu> <price_off_cpu>0.00000000</price_off_cpu> <price_on_cpu_share>0.00000000</price_on_cpu_share> <price_off_cpu_share>0.00000000</price_off_cpu_share> <price_on_memory>0.00000000</price_on_memory> <price_off_memory>0.00000000</price_off_memory> <price_on_cpu_units type="integer">0</price_on_cpu_units> <price_off_cpu_units type="integer">0</price_off_cpu_units> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-03T15:31:31+03:00</updated_at> <label>Master Bucket Zone</label> <resource_name>hypervisor_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> <base_resource> <billing_plan_id type="integer">1</billing_plan_id> <created_at type="datetime">2013-09-03T15:31:31+03:00</created_at> <id type="integer">2</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_rate_free type="integer">0</limit_rate_free> <limit_ip_free type="integer">0</limit_ip_free> OnApp Cloud 4.1 API Guide <limit_data_sent_free type="integer">0</limit_data_sent_free> <limit_data_received_free type="integer">0</limit_data_received_free> OnApp Cloud 4.1 API Guide <limit_rate nil="true"/> <limit_ip nil="true"/> </limits> <preferences> </preferences> <prices> <price_rate_on>0.00000000</price_rate_on> <price_rate_off>0.00000000</price_rate_off> <price_ip_on>0.00000000</price_ip_on> <price_ip_off>0.00000000</price_ip_off> <price_data_sent>0.00000000</price_data_sent> <price_data_received>0.00000000</price_data_received> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-03T15:31:31+03:00</updated_at> <label>Master Template Zone</label> <resource_name>network_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> OnApp Cloud 4.1 API Guide </base_resource> </base_resources> </billing_plan> Where: allows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise false allows_mak - true, if the MAK licensing is allowed, otherwise false allows_own - true, if adding own licenses is allowed for this billing plan, otherwise false created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format currency_code - the currency in which the users are charged id - the billing type ID label - the billing plan name monthly_price * - monthly fee for plan usage show_price - true, if users can see the prices set up for them, otherwise false. updated_at - the date when the billing plan was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format associated_with_users - the number of users with which this billing plan is associated base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false is_template - true, if this resource is a template zone, otherwise false label - name of the base resource target resource_name – the name of the base resource in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false in_template_zone - true, if this resource belongs to the template zone, otherwise false target_id – ID of a base resource target (e.g. compute zone). unit – a unit per which the price is set prices – an array of base resource prices limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits. limit_free –the number of GB user gets for free limit_cpu_units - the total number of CPU units users can get with this plan limit_free_cpu_units - the number of CPU units get for free use_cpu_units - true if CPU units are used instead of CPU shares price_on_cpu_units - price per unit per hour per VSs powered on price_off_cpu_units - price per CPU unit for VSs powered off See Get Base Resources for details on each resource limits type. Page history v3.3: limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units v3.1: Added the following parameters: OnApp Cloud 4.1 API Guide associated_with_users is_bucket OnApp Cloud 4.1 API Guide is_template in_bucket_zone in_template_zone Removed the following parameters: is_default use_default Add Billing Plan To add new billing plan: POST /billing_plans.xml POST /billing_plans.json XML Request example curl -i -X POST http://onapp.test/billing_plans.xml d'<billing_plan><label>billing_label</label><currency_code>USD</currency_code><monthl y_price>10</monthly_price><allows_kms>false</allows_kms><allows_mak>true</allows_mak> < allows_own>false</allows_own></billing_plan>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON request example curl -i -X POST http://onapp.test/billing_plans.json -d'{"billing_plan":{"label":"billing_label","currency_code":"USD","monthly_price":"10" ,"allows_kms":"false","allows_mak":"true","allows_own":"false"}}' -u user:userpass H 'Accept: application/json' -H 'Content-type:application/json' Where: label * - the billing plan name currency_code* - the currency that users will be charged in within this billing plan (USD by default) monthly_price * - set monthly fee for plan usage allows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise false allows_mak - true, if the MAK licnsing is allowed, otherwise false allows_own - true, if adding own licenses is allowed for this billing plan, otherwise false XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <billing_plan> <allows_kms type="boolean">false</allows_kms> <allows_mak type="boolean">true</allows_mak> <allows_own type="boolean">false</allows_own> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> OnApp Cloud 4.1 API Guide <currency_code>USD</currency_code> <id type="integer">6</id> <label>apitest</label> <monthly_price type="decimal">1.0</monthly_price> <show_price nil="true"/> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <associated_with_users type="integer">0</associated_with_users> <base_resources type="array"> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">41</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit_data_read_free type="integer">0</limit_data_read_free> <limit_data_written_free type="integer">0</limit_data_written_free> <limit_reads_completed_free type="integer">0</limit_reads_completed_free> <limit_writes_completed_free type="integer">0</limit_writes_completed_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price_on>0.00000000</price_on> <price_off>0.00000000</price_off> <price_data_read>0.00000000</price_data_read> <price_data_written>0.00000000</price_data_written> <price_reads_completed>0.00000000</price_reads_completed> <price_writes_completed>0.00000000</price_writes_completed> </prices> <target_id nil="true"/> <template_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Template Zone</label> <resource_name>hypervisor_group</resource_name> </base_resource> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">40</id> <is_bucket type="boolean">true</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free_cpu type="integer">0</limit_free_cpu> <limit_free_cpu_share type="integer">0</limit_free_cpu_share> <limit_free_memory type="integer">0</limit_free_memory> <limit_cpu nil="true"/> <limit_cpu_share nil="true"/> <limit_memory nil="true"/> <limit_default_cpu type="integer">1</limit_default_cpu> OnApp Cloud 4.1 API Guide <limit_default_cpu_share type="integer">100</limit_default_cpu_share> </limits> OnApp Cloud 4.1 API Guide <preferences> <use_default_cpu type="boolean">false</use_default_cpu> <use_default_cpu_share type="boolean">false</use_default_cpu_share> </preferences> <prices> <price_on_cpu>0.00000000</price_on_cpu> <price_off_cpu>0.00000000</price_off_cpu> <price_on_cpu_share>0.00000000</price_on_cpu_share> <price_off_cpu_share>0.00000000</price_off_cpu_share> <price_on_memory>0.00000000</price_on_memory> <price_off_memory>0.00000000</price_off_memory> </prices> <target_id nil="true"/> <template_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Bucket Zone</label> <resource_name>Hypervisor_group</resource_name> </base_resource> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">42</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_rate_free type="integer">0</limit_rate_free> <limit_ip_free type="integer">0</limit_ip_free> <limit_data_sent_free type="integer">0</limit_data_sent_free> <limit_data_received_free type="integer">0</limit_data_received_free> <limit_rate nil="true"/> <limit_ip nil="true"/> </limits> <preferences> </preferences> <prices> <price_rate_on>0.00000000</price_rate_on> <price_rate_off>0.00000000</price_rate_off> <price_ip_on>0.00000000</price_ip_on> <price_ip_off>0.00000000</price_ip_off> <price_data_sent>0.00000000</price_data_sent> <price_data_received>0.00000000</price_data_received> </prices> <target_id nil="true"/> <template_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Template Zone</label> <resource_name>network_group</resource_name> OnApp Cloud 4.1 API Guide </base_resource> </base_resources> </billing_plan> Returns 201 on success. You can't create a billing plan with a code of nonexistent currency. Edit Billing Plan To edit an existing plan: PUT /billing_plans/:id.xml PUT /billing_plans/:id.json XML Request example curl -i -X PUT http://onapp.test/billing_plans/:billing_plan_id.xml -d '<billing_plan><label>new_label</label><currency_code>USD</currency_code><monthly_pri c e>10</monthly_price><allows_kms>false</allows_kms><allows_mak>true</allows_mak><allow s _own>false</allows_own></billing_plan>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT http://onapp.test/billing_plans/:billing_plan_id.json -d '{billing_plan:{label:"new_label",currency_code:"USD",monthly_price:"10","allows_kms" : false,"allows_mak":true,"allows_own":false}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan with a requested ID, or URL is incorrect. With this method you can edit the following parameters: label* - the desired billing plan name currency_code* - the code of the currency you're going to charge in. show_price - specify if users can see plan prices allows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise false allows_mak - true, if the MAK licensing is allowed, otherwise false allows_own - true, if adding own licenses is allowed for this billing plan, otherwise false Editing a billing plan that is associated with more than one user will affect all users attached to it. If you wish to only affect that user then copy the billing plan and associate it only with the single user. Get Base Resources OnApp Cloud 4.1 API Guide This section provides detailed description of all the parameters returned for all base resources of a billing plan. OnApp Cloud 4.1 API Guide Get List of Base Resources To view which base resources were added to a particular billing plan, use the following method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json This API call returns only those base resources (and their details), which are assigned to this billing plan. See the Get Base Resources section to learn more about base resources and their details. XML Request example curl -i -X GET http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET http://onapp.test/billing_plans/:billing_plan_id/base_resources.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP status 200 on success XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resources type="array"> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">41</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit_data_read_free type="integer">0</limit_data_read_free> <limit_data_written_free type="integer">0</limit_data_written_free> <limit_reads_completed_free type="integer">0</limit_reads_completed_free> <limit_writes_completed_free type="integer">0</limit_writes_completed_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price_on>0.00000000</price_on> <price_off>0.00000000</price_off> <price_data_read>0.00000000</price_data_read> <price_data_written>0.00000000</price_data_written> <price_reads_completed>0.00000000</price_reads_completed> <price_writes_completed>0.00000000</price_writes_completed> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Template Zone</label> <resource_name>data_store_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> OnApp Cloud 4.1 API Guide <in_template_zone type="boolean">false</in_template_zone> OnApp Cloud 4.1 API Guide </base_resource> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">40</id> <is_bucket type="boolean">true</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free_cpu type="integer">0</limit_free_cpu> <limit_free_cpu_share type="integer">0</limit_free_cpu_share> <limit_free_memory type="integer">0</limit_free_memory> <limit_cpu nil="true"/> <limit_cpu_share nil="true"/> <limit_memory nil="true"/> <limit_default_cpu type="integer">1</limit_default_cpu> <limit_default_cpu_share type="integer">100</limit_default_cpu_share> <limit_cpu_units nil="true"/> <limit_free_cpu_units type="integer">100</limit_free_cpu_units> </limits> <preferences> <use_default_cpu type="boolean">false</use_default_cpu> <use_default_cpu_share type="boolean">false</use_default_cpu_share> <use_cpu_units type="boolean">false</use_cpu_units> </preferences> <prices> <price_on_cpu>0.00000000</price_on_cpu> <price_off_cpu>0.00000000</price_off_cpu> <price_on_cpu_share>0.00000000</price_on_cpu_share> <price_off_cpu_share>0.00000000</price_off_cpu_share> <price_on_memory>0.00000000</price_on_memory> <price_off_memory>0.00000000</price_off_memory> </prices> <target_id nil="true"/> <template_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Bucket Zone</label> <resource_name>hypervisor_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> <base_resource> <billing_plan_id type="integer">6</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-10T13:41:53+00:00</created_at> <id type="integer">42</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_rate_free type="integer">0</limit_rate_free> <limit_ip_free type="integer">0</limit_ip_free> <limit_data_sent_free type="integer">0</limit_data_sent_free> <limit_data_received_free type="integer">0</limit_data_received_free> <limit_rate nil="true"/> OnApp Cloud 4.1 API Guide <limit_ip nil="true"/> </limits> OnApp Cloud 4.1 API Guide <preferences> </preferences> <prices> <price_rate_on>0.00000000</price_rate_on> <price_rate_off>0.00000000</price_rate_off> <price_ip_on>0.00000000</price_ip_on> <price_ip_off>0.00000000</price_ip_off> <price_data_sent>0.00000000</price_data_sent> <price_data_received>0.00000000</price_data_received> </prices> <target_id nil="true"/> <template_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-10T13:41:53+00:00</updated_at> <label>Master Template Zone</label> <resource_name>network_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> OnApp Cloud 4.1 API Guide </base_resource> </base_resources> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. label - name of the base resource target resource_name – the name of the base resource in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. target_id – ID of a base resource target (e.g. compute zone). unit – a unit per which the price is set prices – an array of base resource prices limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits. limit_free –the number of GB user gets for free limit_cpu_units - the total number of CPU units users can get with this plan limit_free_cpu_units - the number of CPU units get for free use_cpu_units - true if CPU units are used instead of CPU shares price_on_cpu_units - price per unit per hour per VSs powered on price_off_cpu_units - price per CPU unit for VSs powered off See Get Base Resources for details on each resource limits type. Page history v3.3: limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Backup Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml OnApp Cloud 4.1 API Guide GET /billing_plans/:billing_plan_id/base_resources/:id.json OnApp Cloud 4.1 API Guide You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T08:43:17+03:00</created_at> <id type="integer">35793</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-11T08:43:17+03:00</updated_at> <label>Backups</label> <resource_name>backup</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free - the number of backups users can create for free limit - the total amount of backups allowed prices – an array of base resource prices price - price per backup unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is backups. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: OnApp Cloud 4.1 API Guide associated_with_users is_bucket OnApp Cloud 4.1 API Guide is_template in_bucket_zone in_template_zone Get Customer Networks Resource Details The number of customer networks users can create for free, and the maximum number of customer networks they can create. GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T08:43:31+03:00</created_at> <id type="integer">35796</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-11T08:43:31+03:00</updated_at> <label>Customer Network</label> <resource_name>customer_network</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free - the number of customer networks users can create for free limit - the total number of customer networks users can add OnApp Cloud 4.1 API Guide prices – an array of base resource prices OnApp Cloud 4.1 API Guide price - price per customer network target_id – ID of a base resource target unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is customer networks. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Template, ISOs & Backup Storage Resource Details To get details about the disk space limits and prices allocated to backups, ISOs and templates, use the following method: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T08:43:25+03:00</created_at> <id type="integer">35795</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-11T08:43:25+03:00</updated_at> <label>Templates &amp; Backups Storage</label> <resource_name>storage_disk_size</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free - the amount of free disk space (in GB) users can allocate to store backups, ISOs and templates together limit - the total disk space users can allocate to store backups, ISOs and templates together prices – an array of base resource prices price - price per GB unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is template, ISO & backup storage. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Template Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-08-20T11:35:57+03:00</created_at> <id type="integer">25747</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit>1</limit> </limits> <preferences> </preferences> <prices> <price>1.00000000</price> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-08-20T11:36:06+03:00</updated_at> <label>Template</label> <resource_name>template</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free - the amount of free disk space (in GB) users can allocate to store backups and templates together limit - the total disk space users can allocate to store backups and templates together prices – an array of base resource prices price - price per template target_id – ID of a base resource target unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is template. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone OnApp Cloud 4.1 API Guide Get Virtual Server Resource Details To see the limits set for a virtual servers resource: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-08-20T11:35:50+03:00</created_at> <id type="integer">25746</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit>1</limit> </limits> <preferences> </preferences> <prices> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-08-20T11:36:02+03:00</updated_at> <label>Virtual Server</label> <resource_name>vm_limit</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free - the number of virtual servers users can create for free limit - the total amount of virtual servers allowed prices – an array of base resource prices price - price per virtual server unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is template & backup storage. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. OnApp Cloud 4.1 API Guide Page history OnApp Cloud 4.1 API Guide v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get VS Autoscaling Resource Details The number of VSs using Autoscaling a user can create for free as well as total amount of such VSs. You can also set the price for the VSs using Autoscaling (per VS). GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T08:43:21+03:00</created_at> <id type="integer">35794</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-09-11T08:43:21+03:00</updated_at> <label>Autoscaling Limits</label> <resource_name>vm_monit</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan OnApp Cloud 4.1 API Guide created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit – maximum number of VS using autoscaling limit_free - the number of VSs using autoscaling a user can create for free prices – an array of base resource prices price - price per VS unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is autoscaling llimits. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Template Store Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T10:08:24+03:00</created_at> <id type="integer">35797</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> </limits> <preferences> </preferences> <prices> </prices> <target_id type="integer">1</target_id> <unit nil="true"/> <updated_at type="datetime">2013-09-11T10:08:24+03:00</updated_at> <label>Linux</label> <resource_name>template_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource label - name of the base resource target. In this case, it is the name of the template group you set as a limit to the current billing plan resource_name – the name of the base resource.In this case it is template group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. When you add a template group to a billing plan, you limit the number of preconfigured system templates available to a user signed up for this billing plan – they can only choose from templates available in that template group. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Recipe Group Resource Details OnApp Cloud 4.1 API Guide GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-08-20T11:36:15+03:00</created_at> <id type="integer">25749</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> </limits> <preferences> </preferences> <prices> </prices> <target_id type="integer">4</target_id> <unit nil="true"/> <updated_at type="datetime">2013-08-20T11:36:15+03:00</updated_at> <label>new</label> <resource_name>recipe_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource target_id – ID of a base resource target. In this case it is the ID of a recipe group. unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is recipe_group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. When you add a recipe group to a billing plan, you limit the number of preconfigured plugins called recipes to users signed up for this billing plan - they can only choose from the recipe groups specified. If nothing added to a billing plan, the users can use all the recipe groups in the system. Page history OnApp Cloud 4.1 API Guide v3.1: OnApp Cloud 4.1 API Guide Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Compute Zone Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <base_resource> <billing_plan_id type="integer">253</billing_plan_id> <created_at type="datetime">2013-04-23T11:47:04+03:00</created_at> <id type="integer">3220</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free_cpu>15</limit_free_cpu> <limit_free_cpu_share>100</limit_free_cpu_share> <limit_free_memory>512</limit_free_memory> <limit_cpu nil="true"/> <limit_cpu_share nil="true"/> <limit_memory nil="true"/> <limit_default_cpu>1</limit_default_cpu> <limit_default_cpu_share type="integer">100</limit_default_cpu_share> <limit_cpu_units nil="true"/> <limit_free_cpu_units type="integer">100</limit_free_cpu_units> </limits> <preferences> <use_default_cpu type="boolean">false</use_default_cpu> <use_default_cpu_share type="boolean">false</use_default_cpu_share> <use_cpu_units type="boolean">false</use_cpu_units> </preferences> <prices> <price_on_cpu>6.00000000</price_on_cpu> <price_off_cpu>3.00000000</price_off_cpu> <price_on_cpu_share>89.00000000</price_on_cpu_share> <price_off_cpu_share>2.00000000</price_off_cpu_share> <price_on_memory>11.00000000</price_on_memory> <price_off_memory>1.00000000</price_off_memory> <price_on_cpu_units type="integer">0</price_on_cpu_units> <price_off_cpu_units type="integer">0</price_off_cpu_units> </prices> <target_id nil="true"/> <unit nil="true"/> <updated_at type="datetime">2013-05-08T18:09:04+03:00</updated_at> <use_default type="boolean">false</use_default> <label>Master Defaults</label> <resource_name>hypervisor_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of limits set up for this resource limit_free_cpu - the limit of CPU users get fir free within this billing plan (CPU core/hour) limit_free_cpu_share - the limit of CPU Priority users get for free within this billing plan (in %) limit_free_memory - the amount of free RAM users get for free with this billing plan (Mb/hour) OnApp Cloud 4.1 API Guide limit_cpu - the total amount of CPU allowed within this billing plan (CPU core/hour ) OnApp Cloud 4.1 API Guide limit_cpu_share - the total of CPU Priority allowed within this billing plan (in %) limit_memory - the entire amount of RAM (Mb/hour) limit_default_cpu - the number of CPU cores users can add to each VS limit_default_cpu_share - CPU priority users can assign to each VS limit_cpu_units - the total number of CPU units users can get with this plan limit_free_cpu_units - the number of CPU units get for free preferences - the array of settings for all VSs running on compute resources within this zone prices – an array of base resource prices use_default_cpu - true if users cannot see the CPU parameter when creating or editing a VS, otherwise false use_default_cpu_share - true if users cannot see the CPU Share parameter when creating or editing a VS, otherwise false price_on_cpu - price per CPU core when a VS is powered on price_off_cpu - price per CPU core when a VS is powered off price_on_cpu_share - the price for the resource for powered on VSs price_off_cpu_share- the price for the resource for powered off VSs price_on_memory - the price for memory per MB for powered on VS price_off_memory - the price for memory per MB for powered off VS price_on_cpu_units - price per unit per hour per VSs powered on price_off_cpu_units - price per CPU unit for VSs powered off target_id – ID of a base resource target unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource. In this case it is compute resource group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. use_cpu_units - true if CPU units are used instead of CPU shares By adding compute zone resources to a billing plan, you limit the user only to the compute resources in that zone. For details how to add or remove compute zone from the master bucket zone, see: Add Base Resource to Master Bucket Zone Remove Base Resource form Master Bucket Zone Page history v3.3: limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone limit_free_cpu limit_free_cpu_share limit_free_memory limit_cpu limit_cpu_share limit_memory limit_default_cpu limit_default_cpu_share use_default_cpu use_default_cpu_share price_on_cpu OnApp Cloud 4.1 API Guide price_off_cpu price_on_cpu_share OnApp Cloud 4.1 API Guide price_off_cpu_share price_on_memory price_off_memory Get Data Store Zone Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example: <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-08-20T11:35:04+03:00</created_at> <id type="integer">25743</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">true</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit_data_read_free type="integer">0</limit_data_read_free> <limit_data_written_free type="integer">0</limit_data_written_free> <limit_reads_completed_free type="integer">0</limit_reads_completed_free> <limit_writes_completed_free type="integer">0</limit_writes_completed_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price_on>0.00000000</price_on> <price_off>0.00000000</price_off> <price_data_read>1.00000000</price_data_read> <price_data_written>0.00000000</price_data_written> <price_reads_completed>1.00000000</price_reads_completed> <price_writes_completed>0.00000000</price_writes_completed> </prices> <target_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-08-20T11:36:35+03:00</updated_at> <label>Master Template Zone</label> <resource_name>data_store_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: OnApp Cloud 4.1 API Guide billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of limits set up for this resource: limit_free – free disk space on data store zone limit – maximum available disk space limit_data_written_free - the amount of data users get for free for write operations (in GB) limit_data_read_free - the amount of data users get for free for read operations (in GB) limit_reads_completed_free - the maximum number (in millions) of input requests which can happen at once limit_writes_completed_free - the maximum number (in millions) of output requests which can happen at once prices – an array of base resource prices: price_data_read – price per GB of data for read operations price_data_written - price per GB of data for write operations price_on – price per GB of disk size, when VS is on price_off - price per GB of disk size, when VS is off price_writes_completed – price per million of output requests which can happen at once price_reads_completed - price per million of input requests which can happen at once target_id – ID of a base resource target. In this case it is the ID of a recipe group. unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is data store group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Network Zone Resource Details GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-08-20T11:37:03+03:00</created_at> <id type="integer">25751</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_rate_free type="integer">0</limit_rate_free> <limit_ip_free type="integer">0</limit_ip_free> <limit_data_sent_free type="integer">1</limit_data_sent_free> <limit_data_received_free type="integer">1</limit_data_received_free> <limit_rate nil="true"/> <limit_ip nil="true"/> </limits> <preferences> </preferences> <prices> <price_rate_on>0.00000000</price_rate_on> <price_rate_off>0.00000000</price_rate_off> <price_ip_on>0.00000000</price_ip_on> <price_ip_off>0.00000000</price_ip_off> <price_data_sent>0.00000000</price_data_sent> <price_data_received>0.00000000</price_data_received> </prices> <target_id type="integer">4</target_id> <unit>gb</unit> <updated_at type="datetime">2013-08-21T11:43:41+03:00</updated_at> <label>NTZ</label> <resource_name>network_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_ip - the total amount of IP addresses limit_ip_free - the amount of IP addresses users get for free limit_data_sent_free - the amount of data users can send for free limit_data_received_free - the amount of data users can receive for free limit_rate - the total available port speed users limit_rate_free - the port speed users get for free prices – an array of base resource prices price_ip_on – price per IP when VS is on price_ip_off - price per IP when VS is off price_rate_on – price for port speed (Mbps) when VS is on price_rate_off - price for port speed (Mbps) when VS is off price_data_sent – price for sent data per GB per hour OnApp Cloud 4.1 API Guide price_data_received – price for received data per GB per hour target_id – ID of a base resource target OnApp Cloud 4.1 API Guide unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is network group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Edge Group Resource Details To get details about the backup server zone limits and prices, use the following method: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <created_at type="datetime">2013-09-11T12:49:00+03:00</created_at> <id type="integer">35802</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id type="integer">2</target_id> <unit>gb</unit> <updated_at type="datetime">2013-09-11T12:49:00+03:00</updated_at> <label>OwnLocation</label> <resource_name>edge_group</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: OnApp Cloud 4.1 API Guide base_resources - an array of billing plan base resources with their details: OnApp Cloud 4.1 API Guide billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_free –the number of GB user gets for free limit - the total number of GB user can add prices – an array of base resource prices price - price per GB over limit target_id – ID of a base resource target unit – a unit per which the price is set label - name of the base resource target resource_name – the name of the base resource.In this case it is edge group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Backup Server Zone Resource Details To get details of the backup server zone limits and prices, use the following method: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <base_resource> <billing_plan_id type="integer">1194</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-11T13:43:31+03:00</created_at> <id type="integer">35803</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit_backup_free type="integer">0</limit_backup_free> <limit_backup_disk_size_free type="integer">0</limit_backup_disk_size_free> <limit_template_free type="integer">0</limit_template_free> <limit_template_disk_size_free type="integer">0</limit_template_disk_size_free> <limit_backup nil="true"/> <limit_backup_disk_size nil="true"/> <limit_template nil="true"/> <limit_template_disk_size nil="true"/> </limits> <preferences> </preferences> <prices> <price_backup>0.00000000</price_backup> <price_backup_disk_size>0.00000000</price_backup_disk_size> <price_template>0.00000000</price_template> <price_template_disk_size>0.00000000</price_template_disk_size> </prices> <target_id type="integer">6</target_id> <template_id nil="true"/> <unit>gb</unit> <updated_at type="datetime">2013-09-11T13:43:31+03:00</updated_at> <label>BSZ</label> <resource_name>backup_server_group</resource_name> </base_resource> Where: base_resources - an array of billing plan base resources with their details: billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false. This parameter applies to compute zone limits only. is_template - true, if this resource is a template zone, otherwise false.This parameter applies to data store and network zone limits only. limit_type – hourly or monthly limit type set for the resource limits - an array of resource limits: limit_backup_free –the number of backups user gets for free limit_backup – the total number of backups allowed limit_backup_disk_size_free –disk size user gets for free to store their backups limit_backup_disk_size – maximum backup disk size allowed limit_template_disk_size – maximum template disk size allowed limit_template – the total number of templates allowed limit_template_free –the number of templates user gets for free limit_template_disk_size_free – template disk size user gets for free prices – an array of base resource prices price_backup – price per backup over limit price_template – price per template over limit price_template_disk_size – price per GB of template disk size over limit target_id – ID of a base resource target unit – a unit per which the price is set OnApp Cloud 4.1 API Guide label - name of the base resource target OnApp Cloud 4.1 API Guide resource_name – the name of the base resource.In this case it is backup server group. in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false. This parameter applies to compute zone limits only. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get MinIOPS Resource Details To get details of a Memories resource for a particular billing plan, use the following method: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example <base_resource> <billing_plan_id type="integer">3</billing_plan_id><billing_plan_id type="integer">1194</billing_plan_id> <bucket_id nil="true"/> <created_at type="datetime">2013-09-11T13:43:31+03:00</created_at> <id type="integer">35803</id> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <limit_type>hourly</limit_type> <limits> <limit type="integer">15000</limit> <limit_free type="integer">100</limit_free> </limits> <prices> <price_on>0.00000000</price_on> <price_off>0.00000000</price_off> </prices> <target_id type="integer">5</target_id> <unit>request</unit> <updated_at type="datetime">2012-11-12T07:40:56+00:00</updated_at> <label>SF DataStore Zone </label> <resource_name>solid_fire</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Explanation of the data returned: billing_plan_id - the ID of the billing plan OnApp Cloud 4.1 API Guide created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide id – resource ID is_bucket - true, if this resource is a bucket zone, otherwise false is_template - true, if this resource is a template zone, otherwise false limits – an array of limits set up for this resource limit - the entire amount of I/O operations limit_free - the amount of I/O users get for free prices - an array of prices set for this resource price_on - the price for unit for powered on data store zone price_off - the price for unit per powered off data store zone unit – a unit per which the price is set label – name of the data store zone assigned to the billing plan resource_name – the name of the base resource. In this case it is memory in_bucket_zone - true, if this resource belongs to the bucket zone, otherwise false in_template_zone - true, if this resource belongs to the template zone, otherwise false Page history v3.1: Added the following parameters: associated_with_users is_bucket is_template in_bucket_zone in_template_zone Get Instance Types Resource Details To get details of the instance type resource for a particular billing plan, use the following method: GET /billing_plans/:billing_plan_id/base_resources/:id.xml GET /billing_plans/:billing_plan_id/base_resources/:id.json You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <base_resource> <id type="integer">786</id> <limits> </limits> <prices> <price_on type="float">2.0</price_on> <price_off type="float">1.0</price_off> </prices> <unit nil="true"/> <target_id type="integer">10</target_id> <billing_plan_id type="integer">141</billing_plan_id> <created_at type="datetime">2015-06-25T12:08:22+03:00</created_at> <updated_at type="datetime">2015-07-03T12:06:45+03:00</updated_at> <limit_type>hourly</limit_type> <preferences> <hypervisor_group_ids type="array"> <fixnum type="integer">2</fixnum> </hypervisor_group_ids> <data_store_group_ids type="array"> <fixnum type="integer">3</fixnum> </data_store_group_ids> <network_group_ids type="array"> <fixnum type="integer">5</fixnum> </network_group_ids> </preferences> <is_bucket type="boolean">false</is_bucket> <is_template type="boolean">false</is_template> <label>test1</label> <resource_name>instance_type</resource_name> <in_bucket_zone type="boolean">false</in_bucket_zone> <in_template_zone type="boolean">false</in_template_zone> </base_resource> Where: id - resource ID limits - an array of limits set up for this resource prices - an array of prices set for this resource price_on - the price for unit for powered on data store zone price_off - the price for unit per powered off data store zone unit - a unit per which the price is set target_id - the ID of the instance type which you add to the billing plan billing_plan_id - the ID of the billing plan created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format limit_type - limit type set for the resource. For instance types this parameter is always "hourly". preferences - the compute/data store/network zones to which the instance type will apply: hypervisor_group_ids - the IDs of the compute zones limited by the instance type data_store_group_ids - the IDs of the data store zones limited by the instance type network_group_ids - the IDs of the network zones limited by the instance type OnApp Cloud 4.1 API Guide is_bucket - true, if this resource is a bucket zone, otherwise false OnApp Cloud 4.1 API Guide is_template - true, if this resource is a template zone, otherwise false label - the label of the instance type assigned to the billing plan resource_name - the name of the base resource. In this case it is instance_type Add Base Resources to Billing Plan To add base resources to the billing plan, use the following request: POST /billing_plans/:billing_plan_id/base_resources.xml POST /billing_plans/:billing_plan_id/base_resources.json Base resources can be priced differently: some may have different prices, depending whether VS is on or off (Virtual servers base resource limits); some of the resources are charged per unit, regardless if they are on or off (Other base resource limits); another type of resource serves only as a limit to the billing plan, without any charges (Template groups limits, compute zone limits). Add Limits for User VSs XML Request example curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml d '<base_resource><resource_class>Resource::resource_name</resource_class><billing_plan _ id>21</billing_plan_id><limit>30</limit><limit_free>10</limit_free><prices><price>10< / price></prices></base_resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.json -d'{"base_resource":{"resource_class":"Resource::resource_name","billing_plan_id":"21" ,"limits":{"limit":"30","limit_free":"10"},"prices":{"price":"10"}}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: resource_class * - the name of the base resource you add to the billing plan in the following format: Resource:resource_name, where the resourc e_name can be: resource_name UI Label VmMonit Autoscaling limit VmLimit Virtual Server limit Template Template limit StorageDiskSize Templates, ISOs & Backups Storage limit Backup Backups limit CustomerNetwork Customer network limit TemplateIso ISO limit For the virtual server limit you should only specify the billing_plan_id and limit parameters. billing_plan_id - the ID of the billing plan limit - sets maximum amount of units of the resource limit_free - amount of units which are given for free price – price per unit OnApp Cloud 4.1 API Guide Page history OnApp Cloud 4.1 API Guide v. 4.0: added TemplateIso base resource v. 3.1: added info on CustomerNetwork base resource Add Limits for Template Store XML Request example curl -i -X POST -u user:userpass -H'Content-type: application/xml' H'Accept: application/xml' http://onapp.test/billing_plans/21/base_resources.xml d'<base_resource><resource_class>Resource::TemplateGroup</resource_class><billing_pla n_id>21</billing_plan_id><target_id>22</target_id><target_type>ImageTemplateGroup</ta r get_type></base_resource>' JSON Request example curl -i -X POST -u user:userpass -H'Content-type: application/json' H'Accept: application/json' http://onapp.test/billing_plans/21/base_resources.json -d'{"base_resource":{"resource_class":"Resource::TemplateGroup","billing_plan_id":"21" ,"target_id":"22","target_type":"ImageTemplateGroup"}}' Where: resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::[resource_name], where [resource_name] is TemplateGroup for Limits for Template Store. billing_plan_id - the ID of the billing plan target_type* - the type of the group you add to the billing plan limits. For Limits for Template Store, it is ImageTemplateGroup. target_id* - the ID of the group you add to billing plan limits Check the ID of the necessary group with the following call: GET /settings/image_template_groups.xml Add Limits for Recipe Groups XML Request example curl -i -X POST http://onapp.test/billing_plans/919/base_resources.xml -d '<base_resource><resource_class>Resource::RecipeGroup</resource_class><target_type>Re c ipeGroup</target_type><target_id>1</target_id></base_resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST http://onapp.test/billing_plans/919/base_resources.json -d '{"base_resource":{"resource_class":"Resource::RecipeGroup", "target_type":"RecipeGroup","target_id":"2"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json' Where: resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::[resource_name], where [resource_name] is RecipeGroup for Limits for Recipe Group. billing_plan_id - the ID of the billing plan target_type* - the type of the group you add to the billing plan limits. For Limits for Recipe Group, it is RecipeGroup. target_id* - the ID of the group you add to billing plan limits Check the ID of the necessary group with the following call: GET /recipe_groups.xml Add Limits for Compute Zones When you add a billing plan, the master bucket compute zone is created automatically. You can add your custom compute zones and set the limits and prices for them at any time later. For details how to add or remove compute zone from the master bucket zone, use the following requests: Add Base Resource to Master Bucket Zone Remove Base Resource from Master Bucket Zone To set the limits for the default zone or add a custom zone and set the limits/prices, run: XML Request example curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml d'<base_resource><billing_plan_id>1194</billing_plan_id><resource_class>Resource::Hyp ervisorGroup</resource_class><in_bucket_zone>1</in_bucket_zone><target_type>Pack</tar g et_type><target_id>14</target_id><limits><limit_free_cpu>5</limit_free_cpu><limit_fre e _cpu_share>50</limit_free_cpu_share><limit_free_memory>128</limit_free_memory><limit_ c pu>10</limit_cpu><limit_cpu_share>80</limit_cpu_share><limit_memory>256</limit_memory > </limits><prices><price_on_cpu>10</price_on_cpu><price_off_cpu>5</price_off_cpu><price _on_cpu_share>10</price_on_cpu_share><price_off_cpu_share>5</price_off_cpu_share><pri JSON c Request example e_on_memory>10</price_on_memory><price_off_memory>5</price_off_memory></prices></base _ resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml' OnApp Cloud 4.1 API Guide curl -s -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.json H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"base_resource":{"resource_class":"Resource::HypervisorGroup","in_bucket_zone":"1", " target_type":"Pack","target_id":"14","limits":{"limit_free_cpu":"10","limit_free_cpu_ s hare":"10","limit_free_memory":"1000","limit_cpu":"10","limit_cpu_share":"10","limit_ m emory":"1000","limit_default_cpu":"10","limit_default_cpu_share":"10"},"prices":{"pri c Where:e_on_cpu":"10","price_off_cpu":"10","price_on_cpu_share":"10","price_off_cpu_share":" 1 0","price_on_memory":"10","price_off_memory":"10"}}}' resource_class * - the name of the base resource you add to the billing plan in the following format: Resource::[resource_name], where [resource_name] is HypervisorGroup for compute zone limits in_bucket_zone - set 1 to add the compute resource to the master bucket zone. This parameter applies to compute zone limits only. use_cpu_units - set 1 to use CPU units instead of CPU shares billing_plan_id* - the ID of the billing plan target_type* - the type of the group you add to the billing plan limits, for Limits for compute Zones it is Pack. target_id* - the ID of the group (or zone) you add to billing plan limits Check the ID of the necessary compute zone with the GET /settings/hypervisor_zones call limits - the array of limits for compute zone, all parameters are optional. The empty field sets the unlimited parameter. limit_free_cpu - set the free amount of CPU limit_free_cpu_share - set the free amount of CPU shares limit_free_memory - set the free amount of RAM limit_cpu - set the CPU limit limit_cpu_share - set CPU share limit limit_memory - set the RAM limit limit_cpu_units - if CPU units are used, set the total number of CPU units users can get with this plan limit_free_cpu_units - if CPU units are used, set the number of CPU units get for free prices - the array of resource prices. Optional parameters. price_on_cpu - the price per CPU core/hour when a VS is on price_off_cpu - the price per CPU core/hour when a VS is off price_on_cpu_share - the price per CPU core/hour when a VS is on price_off_cpu_share - the price per CPU core/hour when a VS is off price_on_memory - the price per Mb/hour for RAM when a VS is on price_off_memory - the price per Mb/hour for RAM when a VS is off price_on_cpu_units - if CPU units are used, set price per unit per hour per VSs powered on price_off_cpu_units - if CPU units are used, set price per CPU unit for VSs powered off Page History v.3.3 limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units Add Compute Zone Base Resource to Master Bucket Zone To add a compute zone to the master bucket zone, use the following request: POST /billing_plans/:billing_plan_id/base_resources.xml OnApp Cloud 4.1 API Guide POST /billing_plans/:billing_plan_id/base_resources.json To add or remove existing compute zone base resources from the master bucket zone, use the following requests: Add Base Resource to Master Bucket Zone Remove Base Resource from Master Bucket Zone XML Request example curl -i -X POST -u user:userpass -H 'Content-type: application/xml' -H 'Accept: application/xml' http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml -d '<base_resource><resource_class>Resource::HypervisorGroup</resource_class><target_typ e >Pack</target_type><in_bucket_zone>1</in_bucket_zone><target_id>14</target_id></base_ r esource>' JSON Request example curl -i -X POST -u user:userpass -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing_plans/:billing_plan_id/base_resources.json -d '{"base_resource":{"resource_class":"Resource::HypervisorGroup", "target_type":"Pack", "in_bucket_zone":"1", "target_id":"14"}}' Where: resource_class * - the name of the base resource you add to the billing plan in the following format: Resource::[resource_name], where [resource_name] is Compute resource Group for compute zone limits target_type* - the type of the group you add to the billing plan limits, for Limits for compute Zones it is Pack in_bucket_zone - set 1 to add the compute resource to the master bucket zone. This parameter applies to compute zone limits only. target_id* - the ID of the compute zone which you add to the master bucket zone Check the ID of the required compute zone with the GET /settings/hypervisor_zones call. Add Limits for Data Store Zones By adding data store zone resources to a billing plan, you limit the user only to the data stores in that zone. When you add a billing plan, the master template zone is created automatically. You can add your custom data store zones and set the limits and prices for them at any time later. For details how to add or remove data store zone from the master template zone, use the following requests: Add Base Resource to Master Template Zone Remove Base Resource From Master Template Zone To set the limits for the default zone or add a custom zone and set the limits/prices, use the following request: XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H'Content-type: application/xml' -H'Accept: application/xml' http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml d'<base_resource><resource_class>Resource::DataStoreGroup</resource_class><billing_pl an_id>41</billing_plan_id><in_template_zone>1</in_template_zone><target_id>56</target _ id><target_type>Pack</target_type><limits><limit_free>1</limit_free><limit>20</limit> < limit_reads_completed_free>2</limit_reads_completed_free><limit_data_written_free>3</ l imit_data_written_free><limit_data_read_free>4</limit_data_read_free><limit_writes_co m JSON pleted_free>5</limit_writes_completed_free></limits><prices><price_data_written>6</pr Request example i ce_data_written><price_off>7</price_off><price_on>8</price_on><price_data_read>9</pri curl -i -X POST -u user:userpass -H'Content-type: application/json' -H'Accept: c application/json' e_data_read><price_writes_completed>10</price_writes_completed><price_reads_completed http://onapp.test/billing_plans/:billing_plan_id/base_resources.json > - 11</price_reads_completed></prices><limit_type>hourly</limit_type></base_resource>' d'{"base_resource":{"resource_class":"Resource::DataStoreGroup","billing_plan_id":"41 ","in_template_zone":"1","target_id":"56","target_type":"Pack","limits":{"limit_free" : "1","limit":"20","limit_reads_completed_free":"2","limit_data_written_free":"3","limi t _data_read_free":"4","limit_writes_completed_free":"5"},"limit_type":"hourly","prices" Where::{"price_data_written":"6","price_off":"7","price_on":"8","price_data_read":"9","price _writes_completed":"10","price_reads_completed":"11"}}}' resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::DataStoreGroup billing_plan_id - the ID of the billing plan target_type* - type of the group you add to the billing plan limits Pack target_id * - the ID of the group (or zone) you add to billing plan limits Check the ID of the necessary data store zone with GET /data_store_zones call. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. limits - the array of limits for data store zone, all parameters are optional. The empty field sets the unlimited parameter. limit_free – free disk space on data store zone limit – maximum available disk space limit_data_written_free - the amount of data users get for free for write operations (in GB) limit_data_read_free - the amount of data users get for free for read operations (in GB) limit_reads_completed_free - the maximum number (in millions) of input requests which can happen at once limit_writes_completed_free - the maximum number (in millions) of output requests which can happen at once prices - the array of resource prices. Optional parameters. price_data_read – price per GB of data for read operations price_data_written - price per GB of data for write operations price_on – price per GB of disk size, when VS is on price_off - price per GB of disk size, when VS is off price_writes_completed – price per million of output requests which can happen at once price_reads_completed - price per million of input requests which can happen at once limit_type – limit type set for the resource; can be hourly or monthly OnApp Cloud 4.1 API Guide Add Data Store Zone Base Resource to Master Template Zone OnApp Cloud 4.1 API Guide To add a data store zone to the template zone, use the following request: POST /billing_plans/:billing_plan_id/base_resources.xml POST /billing_plans/:billing_plan_id/base_resources.json To add or remove existing data store zone base resources from the master template zone, use the following requests: Add Base Resource to Master Template Zone Remove Base Resource From Master Template Zone XML Request example curl -i -X POST -u user:password -H 'Content-type: application/xml' -H 'Accept: application/xml' http://onapp.test/billing_plans/:bp_id/base_resources.xml -d '<base_resource><resource_class>Resource::DataStoreGroup</resource_class><target_type > Pack</target_type><in_template_zone>1</in_template_zone><target_id>1</target_id><limi t _type>hourly</limit_type></base_resource>' JSON Request example curl -i -X POST -u user:password -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing_plans/:bp_id/base_resources.json -d '{"base_resource":{"resource_class":"Resource::DataStoreGroup", "target_type":"Pack", "in_template_zone":"1", "target_id":"1", "limit_type":"hourly"}}' Where: resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::DataStoreGroup target_type* - type of the group you add to the billing plan limits Pack in_template_zone - set 1 to add the data store zone to the master template zone.This parameter applies to data store and network zone limits only. target_id* - the ID of the data store zone which you add to the master template zone Check the ID of the required data store zone with the GET /settings/data_store_zones call. limit_type – limit type set for the resource; can be hourly or monthly Add Limits for Network Zones By adding network zone resources to a billing plan, you limit the user only to the network(s) in that zone. When you add a billing plan, the master template zone is created automatically. You can add your custom network zones and set the limits and prices for them at any time later. For details how to add or remove network zone from the master template zone, use the following requests: Add Base Resource to Master Template Zone Remove Base Resource From Master Template Zone XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H'Content-type: application/xml' -H'Accept: application/xml' http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml -d'<base_resource><resource_class>Resource::NetworkGroup</resource_class><billing_plan _id>41</billing_plan_id><in_template_zone>1</in_template_zone><target_id>33</target_id ><target_type>Pack</target_type><limits><limit_ip>20</limit_ip><limit_rate>20</limit_ r ate><limit_data_sent_free>1</limit_data_sent_free><limit_rate_free>2</limit_rate_free > <limit_ip_free>3</limit_ip_free><limit_data_received_free>4</limit_data_received_free> </limits><prices><price_ip_off>6</price_ip_off><price_ip_on>2</price_ip_on><price_rate _off>3</price_rate_off><price_rate_on>4</price_rate_on><price_data_sent>5</price_data _ JSON sent><price_data_received>6</price_data_received></prices><limit_type>hourly</limit_t Request example y pe></base_resource>' curl -i -X POST -u user:userpass -H'Content-type: application/json' -H'Accept: application/json' http://onapp.test/billing_plans/:billing_plan_id/base_resources.json d'{"base_resource":{"resource_class":"Resource::NetworkGroup","billing_plan_id":"41", "in_template_zone":"1","target_id":"33","target_type":"Pack","limits":{"limit_ip":"20 " ,"limit_rate":"20","limit_data_sent_free":"1","limit_rate_free":"2","limit_ip_free":" 3 ","limit_data_received_free":"4"},"limit_type":"hourly","prices":{"price_ip_off":"6", Where:" price_ip_on":"2","price_rate_off":"3","price_rate_on":"4","price_data_sent":"5","pric resource_class * -name of the base resource you add to the billing plan in the following format: Resource::NetworkGroup e billing_plan_id - ID of the billing plan _data_received":"6"}}}' target_type * - type of the group you add to the billing plan limits: Pack target_id * - ID of the network zone you add to billing plan limits Check the ID of the necessary network zone with GET /settings/network_zones call. in_template_zone - true, if this resource belongs to the template zone, otherwise false. This parameter applies to data store and network zone limits only. limits - the array of limits for network zone, all parameters are optional. The empty field sets the unlimited parameter. limit_ip - the total amount of IP addresses limit_ip_free - the amount of IP addresses users get for free limit_data_sent_free - the amount of data users can send for free limit_data_received_free - the amount of data users can receive for free limit_rate - the total available port speed users limit_rate_free - the port speed users get for free prices - the array of resource prices. Optional parameters. price_ip_on – price per IP when VS is on price_ip_off - price per IP when VS is off price_rate_on – price for port speed (Mbps) when VS is on price_rate_off - price for port speed (Mbps) when VS is off price_data_sent – price for sent data per GB per hour price_data_received – price for received data per GB per hour limit_type – limit type set for the resource; can be hourly or monthly OnApp Cloud 4.1 API Guide Add Network Zone Base Resource to Master Template Zone OnApp Cloud 4.1 API Guide To add a network zone to the template zone, use the following request: POST /billing_plans/:billing_plan_id/base_resources.xml POST /billing_plans/:billing_plan_id/base_resources.json To add or remove existing network zone base resources from the master template zone, use the following requests: Add Base Resource to Master Template Zone Remove Base Resource From Master Template Zone XML Request example curl -i -X POST -u user:password -H 'Content-type: application/xml' -H 'Accept: application/xml' http://onapp.test/billing_plans/:bp_id/base_resources.xml -d '<base_resource><resource_class>Resource::NetworkGroup</resource_class><target_type>P a ck</target_type><in_template_zone>1</in_template_zone><target_id>1</target_id><limit_ t ype>hourly</limit_type></base_resource>' JSON Request example curl -i -X POST -u user:password -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing_plans/:bp_id/base_resources.json -d '{"base_resource":{"resource_class":"Resource::NetworkGroup", "target_type":"Pack", "in_template_zone":"1", "target_id":"1", "limit_type":"hourly"}}' Where: resource_class * -name of the base resource you add to the billing plan in the following format: Resource::NetworkGroup target_type* - type of the group you add to the billing plan limits Pack in_template_zone - set 1 to add the network store zone to the master template zone target_id* - the ID of the network zone which you add to the master template zone. This parameter applies to data store and network zone limits only. Check the ID of the required network zone with the GET /settings/data_store_zones call. limit_type – limit type set for the resource; can be hourly or monthly Add Limits for Edge Groups By assigning edge groups to a billing plan, you set the prices for the bandwidth users signed up for this plan consume. XML request example: OnApp Cloud 4.1 API Guide curl -i -X POST -d '<base_resource><resource_class>Resource::EdgeGroup</resource_class><billing_plan_id> 1 07</billing_plan_id><target_id>1</target_id><target_type>EdgeGroup</target_type><pric e >6</price></base_resource>' -u user:userpass http://onapp.test/billing_plans/:biling_plan_id/base_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' OnApp Cloud 4.1 API Guide JSON request example: curl -i -X POST -d '{"base_resource":{"resource_class":"Resource::EdgeGroup","billing_plan_id":"107","ta r get_id":"1","target_type":"EdgeGroup","price":"6"}}' -u user:userpass http://onapp.test/billing_plans/:billing_plan_id/base_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::EdgeGroup billing_plan_id - ID of the billing plan target_id* – the ID of the edge group you add to a billing plan target_type* - type of the group you add to the billing plan limits: EdgeGroup price – price per GB of bandwidth Add Limits for Backup Server Zones By adding backup server zone resources to a billing plan, you limit the user only to the backup servers in that zone. XML Request example curl -i -X POST -u user:userpass http://onapp.test/billing_plans/:id/base_resources.xml -d '<base_resource><resource_class>Resource::BackupServerGroup</resource_class><billing_ p lan_id>182</billing_plan_id><target_id>28</target_id><target_type>Pack</target_type>< l imits><limit_backup_free>2</limit_backup_free><limit_backup>10</limit_backup><limit_b a ckup_disk_size_free>2</limit_backup_disk_size_free><limit_backup_disk_size>10</limit_ b ackup_disk_size><limit_template_free>2</limit_template_free><limit_template>10</limit _ template><limit_template_disk_size_free>2</limit_template_disk_size_free><limit_templ a JSON te_disk_size>10</limit_template_disk_size></limits><prices><price_backup>50</price_ba Request example c kup><price_backup_disk_size>50</price_backup_disk_size><price_template_disk_size>50</ curl -i -X POST -u user:userpass p http://onapp.test/billing_plans/:id/base_resources.json -d rice_template_disk_size><price_template>50</price_template></prices></base_resource>' '{"base_resource":{"resource_class": -H 'Accept: application/xml' -H 'Content-type: application/xml' "Resource::BackupServerGroup","billing_plan_id":"182","target_id":"28","target_type": " Pack","limits":{"limit_backup_free":"2", "limit_backup":"10","limit_backup_disk_size_free":"2","limit_backup_disk_size":"10"," l imit_template_free":"2","limit_template":"10","limit_template_disk_size_free":"2", "limit_template_disk_size":"10"},"prices":{"price_backup":"50","price_backup_disk_siz e ":"50","price_template_disk_size":"50","price_template":"50"}}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* – name of the backup server zone assigned to the billing plan OnApp Cloud 4.1 API Guide resource_name– the name of the base resource. In this case it is BackupServerGroup OnApp Cloud 4.1 API Guide created at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format target_id* – backup server zone id target_type * - type of the group you add to the billing plan limits: Pack limits – an array of limits set up for this resource limit_backup_free –the number of backups user gets for free limit_backup – the total number of backups allowed limit_backup_disk_size_free –disk size user gets for free to store their backups limit_backup_disk_size – maximum backup disk size allowed limit_template_disk_size – maximum template disk size allowed limit_template – the total number of templates allowed limit_template_free –the number of templates user gets for free limit_template_disk_size_free – template disk size user gets for free updated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format billing_plan_id - the ID of the billing plan id – resource ID unit – a unit per which the price is set price_backup – price per backup over limit price_template – price per template over limit price_template_disk_size – price per GB of template disk size over limit price_backup_disk_size - price per GB of backup disk size over limit limit type – this parameter doesn't mean anything for backup server zone resource Add Limits for minIOPS XMLRequest example: curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml d '<base_resource><resource_class>Resource::SolidFire</resource_class><billing_plan_id> 4 </billing_plan_id><target_id>5</target_id><target_type>Pack</target_type><limits><lim i t>10000</limit><limit_free>600</limit_free></limits><prices><price_on>100</price_on>< p rice_off>50</price_off></prices></base_resource>' -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example: curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.json -d '{"base_resource":{"resource_class":"Resource::SolidFire","billing_plan_id":"4", "target_id":"5", "target_type":"Pack", "limits":{"limit":"10000","limit_free":"600"},"prices":{"price_on":"100", "price_off":"50"}}}' -u user:password -H 'Accept: application/json' -H 'Contenttype: application/json' Where: resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::SolidFire OnApp Cloud 4.1 API Guide billing_plan_id - the ID of the billing plan OnApp Cloud 4.1 API Guide target_type * - the type of the group you add to the billing plan limits: Pack target_id * - the ID of the data store zone you create a limit for limits - an array of minimum IO limits: limit_free – free disk space on data store zone limit – maximum available disk space prices - an array of resource prices: price_on – price per GB of disk size, when VS is on price_off - price per GB of disk size, when VS is off XML Response example <?xml version="1.0" encoding="UTF-8"?> <base_resource> <billing_plan_id type="integer">4</billing_plan_id> <created_at type="datetime">2012-11-23T00:56:53+11:00</created_at> <id type="integer">20</id> <limit_type>hourly</limit_type> <limits> <limit>10000</limit> <limit_free>600</limit_free> </limits> <prices> <price_on>100</price_on> <price_off>50</price_off> </prices> <target_id type="integer">5</target_id> <unit>request</unit> <updated_at type="datetime">2012-11-23T00:56:53+11:00</updated_at> <label>SF DataStore Zone </label> <resource_name>solid_fire</resource_name> </base_resource> Add Limits for Instance Types To add instance type(s) to a billing plan, use the following request: POST billing_plans/:billing_plan_id/base_resources.xml POST billing_plans/:billing_plan_id/base_resources.json XMLRequest example: curl -i -X POST -u user:userpass --url http://onapp.test/billing_plans/142/base_resources.xml -d '<base_resource><resource_class>Billing::Resource::InstanceType</resource_class><targ e t_type>InstanceType</target_type><target_id>10</target_id><hypervisor_group_ids>1</hy p ervisor_group_ids><data_store_group_ids>7, 37</data_store_group_ids><network_group_ids>11</network_group_ids><price_on>0.3</pric e _on><price_off>0.2</price_off></base_resource>' -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example: OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass --url http://onapp.test/billing_plans/142/base_resources.json -d '{"base_resource": {"resource_class": "Billing::Resource::InstanceType", "target_type": "InstanceType", "target_id": "10", "hypervisor_group_ids": "1", "data_store_group_ids": "7, 37", "network_group_ids": "11", "price_on": "0.3", "price_off": "0.2"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: resource_class - name of the base resource you add to the billing plan in the following format: Billing::Resource::InstanceType target_type - type of the group you add to the billing plan limits: InstanceType target_id - the ID of the instance type that you add to the billing plan hypervisor_group_ids - ID(s) of the compute zone(s) to which the instance type will apply data_store_group_ids - ID(s) of the data store zone(s) to which the instance type will apply network_group_ids - ID(s) of the network zone(s) to which the instance type will apply price_on - the hourly price for a VS built using this instance type that is powered on price_off - the hourly price for a VS built using this instance type that is powered off Edit Base Resources This section provides the info on how to change limits and prices for base resources, together with the examples and parameters explanation. PLEASE NOTE: You cannot edit a base resource which belongs to the master bucket or master template zone. HTTP 422 status will be returned. Edit Virtual Server Base Resource Limits To change limits and prices for a base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit>5</limit></base_resource>' -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{ "base_resource": { "limit": "10" }}' -H 'Accept: application/json' -H 'Contenttype: application/json' Where: OnApp Cloud 4.1 API Guide limit - the number of virtual servers allowed by this billing plan OnApp Cloud 4.1 API Guide You can check ID of the Virtual Server base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Autoscaling Base Resource Limits To change limits and prices for a base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>10</limit_free><limit>20</limit><price>10</price></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free":"1000","limit": "200","price":"100"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit - the total amount of VSs using autoscaling. limit_free - the number of VSs using autoscaling that user can create for free. price - the price for the VSs using autoscaling (per VS). You can check ID of the Autoscaling base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Backups Base Resource Limits To change limits and prices for a Backups base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>10</limit_free><limit>20</limit><price>10</price></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free": "100","limit": "200","price": "100"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit - the maximum number of backups users can create according to their template/backup storage space limit. limit_free - the number of backups users can create for free. price - set prices per backup per hour. You can check ID of the Backups base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Customer Network Base Resource Limits To change limits and prices for a Customer Network base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>10</limit_free><limit>20</limit><price>10</price></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free": "100","limit": "200","price": "100"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: OnApp Cloud 4.1 API Guide limit - the maximum number of customer networks users can create. limit_free - the number of customer networks users can create for free. price - the price per customer network per hour. You can check ID of the Customer Network base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Template Base Resource Limits To change limits and prices for a Template base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>100</limit_free><limit>200</limit><price>100</price></bas e _resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free":"10","limit": "20","price":"10"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit - the maximum number of user templates which can be created, according to their template/backup storage space limit. limit_free - the maximum number of user templates which can be created for free price - price per user template per hour. You can check ID of the Template base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Templates, ISOs & Backups Storage Base Resource Limits To change limits and prices for a base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json OnApp Cloud 4.1 API Guide XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>10</limit_free><limit>20</limit><price>10</price></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free": "100","limit": "200","price": "100"}}' -H 'Accept: application/json' -H 'Content-type:application/json' Where: limit - the total amount of disk space users can use for backups, ISOs and templates (in GB) limit_free - the amount of free disk space users get for backup, ISO and template storage. price - price per hour You can check ID of the Templates&Backups Storage base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit ISO Base Resource Limits To change limits and prices for an ISO base resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_free>10</limit_free><limit>20</limit><price>10</price></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_free": "100","limit": "200","price": "100"}}' -H 'Accept: application/json' -H 'Content-type:application/json' Where: OnApp Cloud 4.1 API Guide limit - the maximum number of user ISOs which can be created, according to their template/ISO/backup storage space limit. limit_free - the maximum number of user ISOs which can be created for free OnApp Cloud 4.1 API Guide price - price per user ISO per hour. You can check ID of the ISO base resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits for Template Store To change limits and prices for a Template store resource, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml d '<base_resource><target_id>11</target_id></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": { "target_id": "11" }}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: target_id - specify the ID of the template group of a preconfigured system template available to users signed up for this billing plan You can check ID of the Template store resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits for Recipe Groups To change limits and prices for Recipe Groups, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml d '<base_resource><target_id>11</target_id></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": { "target_id": "1" }}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: target_id - specify the ID of the recipe group which will be available to users signed up for this billing plan You can check ID of the Recipe group resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits & Pricing for Compute Zones To change limits and prices for compute zones, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json For compute zones, you can change the limits for the following resources: CPU limits, CPU share limits, Memory limits, CPU units. Edit CPU limits XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_cpu>10</limit_cpu><limit_free_cpu>1</limit_free_cpu><price_on_ c pu>100</price_on_cpu><price_off_cpu>50</price_off_cpu><limit_default_cpu>1</limit_def a ult_cpu></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit CPU limits JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_cpu": "1","limit_free_cpu":"0","price_on_cpu": "10","price_off_cpu": "5","limit_default_cpu": "1"}}' -H 'Accept: application/json'H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide limit_cpu - the maximum number of CPU cores they can request under this plan limit_free_cpu - the number of CPU cores that users get for free price_on_cpu - the price per CPU core per hour, for VSs powered on price_off_cpu - the price per CPU core per hour for VSs powered off limit_default_cpu - the default values for CPU cores for each VS, which set the amount of CPU cores automatically added per each VS Use the following request, to reset CPU limits to default: XML Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><use_default_cpu>1</use_default_cpu></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Json request example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource":{"use_default_cpu": "true"}}' -H 'Accept: application/json' H 'Content-type: application/json' Edit CPU Share limits XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_cpu_share>1</limit_cpu_share><limit_free_cpu_share>0</limit_fr e e_cpu_share<price_on_cpu_share>10</price_on_cpu_share><price_off_cpu_share>5</price_o f f_cpu_share><limit_default_cpu_share>100</limit_default_cpu_share></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit CPU Share limits JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": {"limit_cpu_share": "10","limit_free_cpu_share": "1","price_on_cpu_share": "100","price_off_cpu_share": "50", "limit_default_cpu_share": "100"}}' -H 'Accept: application/x json ml' -H 'Content-type: application/json' Where: limit_cpu_share - the maximum CPU priority % the users can request under this plan limit_free_cpu_share - the CPU priority % that users get for free price_on_cpu_share - the prices per CPU priority % per hour, for VSs powered on price_off_cpu_share - the prices per CPU priority % per hour, for VSs powered off OnApp Cloud 4.1 API Guide limit_default_cpu_share - the default values for CPU share for each VS, which set the amount of CPU share automatically assigned to each VS. OnApp Cloud 4.1 API Guide Use the following request, to reset CPU Share limits to default: XML Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><use_default_cpu_share>1</use_default_cpu_share></base_resource>' H 'Accept: application/xml' -H 'Content-type: application/xml' Json request example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"use_default_cpu_share": "true"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Edit Memory limits XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_memory>128</limit_memory><limit_free_memory>0</limit_free_memo r y><price_on_memory>10</price_on_memory><price_off_memory>5</price_off_memory></base_r e source>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Memory limits JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_memory": "256","limit_free_memory": "10","price_on_memory": "100","price_off_memory": "50"}}' -H 'Accept:application/json' -H 'Content-type: application/json' Where: limit_memory - the maximum RAM users can request under this plan limit_free_memory - the amount of RAM users get for free price_on_memory - the prices for RAM for VSs powered on price_off_memory - the prices for RAM for VSs powered off. RAM is measured in MB and priced per hour. You can check ID of the Compute Zone resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit CPU Units limits XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_cpu_units>1000</limit_cpu_units><limit_free_cpu_units>0</limit _ free_cpu_units><price_on_cpu_units>10</price_on_cpu_units><price_off_cpu_units>5</pri c e_off_cpu_units></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit CPU Share limits JSON Request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": {"limit_cpu_units": "100000","limit_free_cpu_units": "1","price_on_cpu_units": "100","price_off_cpu_units": "50", "limit_default_cpu_units": "100"}}' -H 'Accept: application/x json ml' -H 'Content-type: application/json' Where: limit_cpu_units - if CPU units are used, set the total number of CPU units users can get with this plan limit_free_cpu_units - if CPU units are used, set the number of CPU units get for free price_on_cpu_units - if CPU units are used, set price per unit per hour per VSs powered on price_off_cpu_units - if CPU units are used, set price per CPU unit for VSs powered off Page History v.3.3 limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units Edit Limits & Pricing for Data Store Zones To change limits and prices for Data store zones, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json You can change the following limits and pricing for data store zone limits: Disk Size, Data read, Data written, Input requests, Output requests. Edit Disk size limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit>60</limit><limit_free>10</limit_free><price_on>100</price_on>< p rice_off>50</price_off></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit CPU limits JSON request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit": "6","limit_free": "0","price_on": "10","price_off": "5"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit - the maximum disk space users can request under this plan limit_free - the disk space that users get for free price_on - the price per CPU core per hour, for VSs powered on price_off - the price per CPU core per hour for VSs powered off Edit Data read limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_data_read_free>20</limit_data_read_free><price_data_read>100.0 0 000000</price_data_read></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Data read limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_data_read_free": "2","price_data_read": "10.00000000"}}' H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_data_read_free - the amount of data read users can send for free price_data_read - the price over free units Edit Data written limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_data_written_free>20</limit_data_written_free><price_data_writ t en>100.00000000</price_data_written></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Data written limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_data_written_free": "2","price_data_written": "10.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_data_written_free - the amount of data written users can send for free OnApp Cloud 4.1 API Guide price_data_written - the price over free units OnApp Cloud 4.1 API Guide Edit Input requests limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_reads_completed_free>20</limit_reads_completed_free><price_rea d s_completed>100.00000000</price_reads_completed></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Input requests limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_reads_completed_free": "2","price_reads_completed": "10.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_reads_completed_free - the number of input requests per hour users can get for free. price_reads_completed - the price over free units. Input requests are measured in millions and priced per million requests. Edit Output requests limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_writes_completed_free>20</limit_writes_completed_free><price_w r ites_completed>100.00000000</price_writes_completed></base_resource>'-H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Output requests limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_writes_completed_free": "2","price_writes_completed": "10.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_writes_completed_free - the number of output requests per hour users can get for free. price_writes_completed - the price over free units. Output requests are measured in millions and priced per million requests. You can check ID of the Data store zone resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits & Pricing for Network Zones To change limits and prices for Network zones, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json OnApp Cloud 4.1 API Guide For Network zones, you can change the limits for the following resources: IP Address, Port Speed, Data received, Data sent. OnApp Cloud 4.1 API Guide Edit IP Address limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xm l -d '<base_resource><limit_ip>20</limit_ip><limit_ip_free>10</limit_ip_free><price_ip_on> 1 00</price_ip_on><price_ip_off>50</price_ip_off></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit IP Address limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": {"limit_ip": "2","limit_ip_free": "1","price_ip_on": "10","price_ip_off": "5"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_ip - the maximum number of IP addresses users can request under this plan limit_ip_free - the number of IP addresses users get for free price_ip_on - the price per Mbps per hour for VSs powered on price_ip_off - the price per Mbps per hour for VSs powered off Edit Port speed limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_rate>99</limit_rate><limit_rate_free>50</limit_rate_free><pric e _rate_on>100</price_rate_on><price_rate_off>50</price_rate_off></base_resource>' H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Port speed limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_rate": "99","limit_rate_free": "50","price_rate_on": "10","price_rate_off": "5"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_rate - the maximum port speed amount user can request limit_rate_free - the amount of port speed user gets for free price_rate_on - the price per Mb per hour for VSs powered on price_rate_off - the price per Mb per hour for VSs powered off OnApp Cloud 4.1 API Guide Edit Data received limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_data_received_free>10</limit_data_received_free><price_data_re c eived>1000.00000000</price_data_received></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Data received limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_data_received_free": "1","price_data_received": "100.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_data_received_free - the amount of data received users can send for free price_data_received - the price over free units Edit Data sent limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_data_sent_free>100</limit_data_sent_free><price_data_sent>1000 . 00000000</price_data_sent></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Data sent limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_data_sent_free": "10","price_data_sent": "100.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_data_sent_free - the amount of data sent users can send for free price_data_sent - the price over free units. Data sent is measured in GB and priced per GB. You can check ID of the Network zone resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. OnApp Cloud 4.1 API Guide Edit Limits for Edge Groups To change limits and prices for Edge groups, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><target_id>32</target_id><price>10</price></base_resource>'-H 'Accept: application/xml' -H 'Content-type: application/xml' JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"target_id":"1","price": "100"}}' -H 'Accept:application/json' H 'Content-type: application/json' Where: target_id - the ID of the edge group that you add to this billing plan price - the price per GB You can check ID of the Edge group resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits & Pricing for Backup Server Zones To change limits and prices for Backup Server zones, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:id.xml PUT /billing_plans/:billing_plan_id/base_resources/:id.json For Backup server zones, you can change the limits for the following resources: Backups, Backup disk size, Templates, Template disk size. Edit Backups limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_backup>5</limit_backup><limit_backup_free>10</limit_backup_fre e ><price_backup>10</price_backup></base_resource>' -H 'Accept: application/xml' H 'Content-type: application/xml' Edit Backups limits JSON request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_backup":"50","limit_backup_free":"100","price_backup": "100"}}' -H 'Accept:application/json' -H 'Content-type: application/json' Where: limit_backup - the total amount of backups users can request limit_backup_free - the amount of backups users can get for free price_backup - the prices for each backup over the limit Edit Backup disk size limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_backup>5</limit_backup><limit_backup_free>10</limit_backup_fre e ><price_backup>10</price_backup></base_resource>'-H 'Accept: application/xml' H 'Content-type: application/xml' Edit Backup disk size limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_backup":"50","limit_backup_free":"100","price_backup": "100"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_backup - the total amount of backup server space users get under this plan limit_backup_free - maximum amount of backup server space users get for free price_backup - price for backup server space. Backup server space is measured in GB. Edit Templates limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_template>10</limit_template><limit_template_free>1</limit_temp l ate_free><price_template>10.00000000</price_template></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' Edit Templates limits JSON request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json d '{"base_resource": {"limit_template": "100","limit_template_free": "10","price_template": "100.00000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_template - the total amount of templates users can have limit_template_free - the amount of templates users can send for free price_template - the price for each template over the free limit Edit Templates disk size limits XML request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml -d '<base_resource><limit_template_disk_size>10</limit_template_disk_size>limit_template _ disk_size_free>5</limit_template_disk_size_free><price_template_disk_size>10.00000000 < /price_template_disk_size></base_resource>' -H 'Accept: application/xml' H 'Content-type: application/xml' Edit Templates disk size limits JSON request example curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json -d '{"base_resource": {"limit_template_disk_size": "100","limit_template_disk_size_free": "50","price_template_disk_size": "100.0000000"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: limit_template_disk_size - the total amount of template disk size users can receive for free limit_template_disk_size_free - the amount of template disk size users can receive for free price_template-disk_size - the prices for each GB over the limit You can check ID of the Backup Server zone resource with GET method. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Edit Limits for Instance Types To add instance type(s) to a billing plan, use the following request: PUT /billing_plans/:billing_plan_id/base_resources/:base_resource_id.xml PUT /billing_plans/:billing_plan_id/base_resources/:base_resource_id.json OnApp Cloud 4.1 API Guide You can edit the limits for an instance type if there are no VSs created on it. OnApp Cloud 4.1 API Guide XMLRequest example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.xm l -d '<base_resource><price_on>0.3</price_on><hypervisor_group_ids>2</hypervisor_group_ids > <data_store_group_ids>5</data_store_group_ids><network_group_ids>12</network_group_ids ></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.jso n -d '{"base_resource": {"price_on": "0.4"}, "base_resource": {"hypervisor_group_ids": "2"}, "base_resource": {"data_store_group_ids": "5"}, "base_resource": {"network_group_ids": "12"}}' -H 'Accept: application/json' -H 'Contenttype: application/json' Where: base_resource_id - the ID of the Instance type resource You can check ID of the required base resource with GET method: GET /billing_plans/:billing_plan_id/base_resources.xml GET /billing_plans/:billing_plan_id/base_resources.json hypervisor_group_ids - ID(s) of the compute zone(s) to which the instance type will apply data_store_group_ids - ID(s) of the data store zone(s) to which the instance type will apply network_group_ids - ID(s) of the network zone(s) to which the instance type will apply price_on - the hourly price for a VS built using this instance type that is powered on price_off - the hourly price for a VS built using this instance type that is powered off Delete Base Resource From Billing Plan DELETE /billing_plans/:billing_plan_id/base_resources/:id.xml DELETE /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example *curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml * JSON Request example *curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json * OnApp Cloud 4.1 API Guide Where you have to specify ID of a billing plan and ID of a resource you want to delete. OnApp Cloud 4.1 API Guide Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan or base resource with a requested ID, or URL is incorrect. Add Base Resource to Master Bucket Zone Use the following request to add base resource to the master bucket zone: PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.xml PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.json Currently the master bucket zone is used for compute zone base resource limits only. XML Request example: curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<base_resource><in_bucket_zone>1</in_bucket_zone></base_resource>' http://onapp.test/billing_plans/:billing_plan_id/base_resources/base_resource_id.xm l JSON Request example: curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d '{"base_resource":{"in_bucket_zone":"1"}}' http://onapp.test/billing_plans/:billing_plan_id/base_resources/base_resource_id.jso n Where: in_template_zone - set 1 to add this resource belongs to the template zone Remove Base Resource from Master Bucket Zone Use the following request to remove base resource from the master bucket zone: PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.xml PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.json Currently the master bucket zone is used for compute zone base resource limits only. XML Request example: curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<base_resource><in_bucket_zone>0</in_bucket_zone></base_resource>' http://onapp.test/billing_plans/:billing_plan_id/base_resources/base_resource_id.xm l JSON Request example: OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d '{"base_resource":{"in_bucket_zone":"0"}}' http://onapp.test/billing_plans/:billing_plan_id/base_resources/base_resource_id.jso n Where: in_bucket_zone - leave this field empty to remove this resource from the bucket zone Add Base Resource to Master Template Zone Use the following request to add base resource to the master bucket zone: PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.xml PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.json Currently the master template zone is used for data store zone and network zone base resource limits only. XML Request example: curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<base_resource><template_id>25</template_id></base_resource>' http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.xm l JSON Request example: curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' u user:userpass -d '{"base_resource":{"template_id":"25"}}' http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.jso n Where: template_id - ID of the master template zone Remove Base Resource From Master Template Zone Use the following request to remove base resource to the master bucket zone: PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.xml PUT /billing_plans/:billing_plan_id/base_resources/base_resource_id.json OnApp Cloud 4.1 API Guide Currently the master template zone is used for data store zone and network zone base resource limits only. OnApp Cloud 4.1 API Guide XML Request example: curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<base_resource><in_template_zone>0</in_template_zone></base_resource>' http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.xm l JSON Request example: curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' u user:userpass -d '{"base_resource":{"in_template_zone":"0"}}' http://onapp.test/billing_plans/:billing_plan_id/base_resources/:base_resource_id.jso n Where: in_template_zone - set 0 to remove this resource from the template zone Delete Billing Plan To delete a billing plan: DELETE /billing_plans/:id.xml DELETE /billing_plans/:id.json XML Request example curl -i -X DELETE http://onapp.test/billing_plans/:billing_plan_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/billing_plans/billing_plan_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no billing plan with a requested ID, or URL is incorrect. Editing a billing plan that is associated with more than one user will affect all users attached to it. If you wish to only affect that user then copy the billing plan and associate it only with the single user. Blueprints Blueprints allow to create and manage multiple VMware virtual servers using imported VMware vApps images (blueprint templates). Blueprint is a set of VMware virtual servers managed as a single multi-tiered application. OnApp Cloud 4.1 API Guide Get List of Blueprints To get the list of all blueprints, use the following request: GET /blueprints.xml GET /blueprints.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprints.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprints.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprints type="array"> <blueprint> <blueprint_template_id type="integer">1</blueprint_template_id> <created_at type="datetime">2013-06-04T15:31:25+03:00</created_at> <customer_network_id type="integer">14</customer_network_id> <data_store_id type="integer">5</data_store_id> <id type="integer">9</id> <identifier>x12wptaopx61sh</identifier> <label>test</label> <state>off</state> <updated_at type="datetime">2013-06-04T15:31:25+03:00</updated_at> <user_id type="integer">1</user_id> </blueprint> </blueprints> Where: blueprint_template_id - ID of a template the blueprint is built from created_at - the date when the blueprint was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the blueprint was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - ID of a customer network data_store_id - ID of a data store the blueprint belongs to id - blueprint ID identifier -blueprint identifier label - blueprint name state - blueprint state: on or off user_id - ID of a user the blueprint belongs to OnApp Cloud 4.1 API Guide Get Blueprint Details OnApp Cloud 4.1 API Guide To get the list of all blueprints, use the following request: GET /blueprints/:blueprint_id.xml GET /blueprints:blueprint_id.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprints/:blueprint_id.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprints/:blueprint_id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint> <blueprint_template_id type="integer">1</blueprint_template_id> <created_at type="datetime">2013-06-04T15:31:25+03:00</created_at> <customer_network_id type="integer">14</customer_network_id> <data_store_id type="integer">5</data_store_id> <id type="integer">9</id> <identifier>x12wptaopx61sh</identifier> <label>test</label> <state>off</state> <updated_at type="datetime">2013-06-04T15:31:25+03:00</updated_at> <user_id type="integer">1</user_id> </blueprint> Where: blueprint_template_id - ID of a template the blueprint is built from created_at - the date when the blueprint was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the blueprint was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - ID of a customer network data_store_id - ID of a data store the blueprint belongs to id - blueprint ID identifier -blueprint identifier label - blueprint name state - blueprint state: on or off user_id - ID of a user the blueprint belongs to Add Blueprint OnApp Cloud 4.1 API Guide Use the following request to add new blueprint: POST /blueprints.xml OnApp Cloud 4.1 API Guide POST /blueprints.json XML Request example curl -i -u user:userpass -X POST http://onapp.test/blueprints.xml -d '<blueprint><label>johnblueprint</label><blueprint_template_id>14</blueprint_template _ id><data_store_id>5</data_store_id><customer_network_id>116</customer_network_id><req u ired_startup>1</required_startup></blueprint>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass -X POST http://onapp.test/blueprints.json d '{"blueprint":{"label":"johnblueprint", "blueprint_template_id": "14","data_store_id":"5","customer_network_id":"116", "required_startup":"1"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: label - blueprint name blueprint_template_id - ID of the template to build the blueprint from data_store_id - ID of a data store to which the blueprint will be assigned customer_network - ID of the customer network which will be used for this blueprint required_startup - set 1 to start up the blueprint after creation XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint> <blueprint_template_id type="integer">14</blueprint_template_id> <built type="boolean">false</built> <created_at type="datetime">2013-08-28T16:13:55+03:00</created_at> <customer_network_id type="integer">116</customer_network_id> <data_store_id type="integer">5</data_store_id> <hypervisor_id nil="true"/> <id type="integer">59</id> <identifier>tdo20mf3ue792s</identifier> <label>blueprint</label> <state>off</state> <updated_at type="datetime">2013-08-28T16:13:55+03:00</updated_at> <user_id type="integer">618</user_id> </blueprint> Delete Blueprint Use the following request to add new blueprint: DELETE /blueprints/blueprint_id.xml DELETE /blueprints/blueprint_id.json OnApp Cloud 4.1 API Guide XML Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprints/blueprint_id.xml JSON Request example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/blueprints/blueprint_id.json Where you need to specify ID of a blueprint you want to delete. Blueprint Template Groups Blueprint template groups allow OnApp administrators to organize individual templates into groups for convenient template management. Blueprint templates are not associated with billing plans. Get List of Blueprint Template Groups To get the list of blueprint template groups, use the following request: GET /blueprint_template_groups.xml GET /blueprint_template_groups.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprint_template_groups.xml JSON Request example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprint_template_groups.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <objects type="array"> <object> <id type="integer">6</id> <label>in_blueprints</label> <parent_id nil="true"/> <lft type="integer">1</lft> <rgt type="integer">2</rgt> <depth type="integer">0</depth> <created_at type="datetime">2013-06-05T14:42:37+00:00</created_at> <updated_at type="datetime">2013-06-05T14:42:37+00:00</updated_at> <children type="array"/> <relations type="array"> <relation> <id type="integer">8</id> <blueprint_template_id type="integer">12</blueprint_template_id> <blueprint_template_group_id type="integer">6</blueprint_template_group_id> <created_at type="datetime">2013-06-05T14:42:43+00:00</created_at> <updated_at type="datetime">2013-06-05T14:42:43+00:00</updated_at> <blueprint_template> <id type="integer">12</id> <label>vmware_template_vapp</label> <user_id type="integer">1</user_id> <created_at type="datetime">2013-06-05T14:41:13+00:00</created_at> <updated_at type="datetime">2013-06-05T14:41:13+00:00</updated_at> <vapp_name>invapp</vapp_name> <hypervisor_id type="integer">28</hypervisor_id> </blueprint_template> </relation> </relations> </object> </objects> Where: objects - the blueprint template groups array with the following parameters: id - blueprint template group ID label – blueprint template group name parent_id - id of the target blueprint template group lft - left nested set identifier rgt - right nested set identifier depth - the depth of a given node (distance from this blueprint template group to the root) created_at – the date when the blueprint template group was created updated_at – the date when the blueprint template group was updated children - the array of child blueprint template groups relations - the array of blueprints assigned to the blueprint template groups with the following parameters: id - relation ID blueprint_template_id - blueprint template ID blueprint_template_group_id - blueprint template group ID created_at – the date when the blueprint template group was created updated_at – the date when the blueprint template group was updated blueprint_template - an array of blueprint template parameters: OnApp Cloud 4.1 API Guide id - recipe ID OnApp Cloud 4.1 API Guide user_id - ID - the ID of a blueprint template owner created_at – the date when the blueprint template was created updated_at – the date when the blueprint template was updated label - blueprint template label vapp_name - name of the vApp this template is created from hypervisor_id - ID of a compute resource the vApp is located on Get Blueprint Template Group Details To get the list of blueprint template groups, use the following request: GET /blueprint_template_groups.xml GET /blueprint_template_groups.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprint_template_groups.xml JSON Request example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprint_template_groups.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint_template_group> <created_at type="datetime">2013-06-05T17:42:37+03:00</created_at> <depth type="integer">0</depth> <id type="integer">6</id> <label>in_blueprints</label> <lft type="integer">1</lft> <parent_id nil="true"/> <rgt type="integer">2</rgt> <updated_at type="datetime">2013-06-05T17:42:37+03:00</updated_at> </blueprint_template_group> Where: created_at – the date when the blueprint template group was created updated_at – the date when the blueprint template group was updated depth - the depth of a given node (distance from this blueprint template group to the root) lft - left nested set identifier rgt - right nested set identifier id - blueprint template group ID label – blueprint template group name parent_id - id of the target blueprint template group OnApp Cloud 4.1 API Guide Add Blueprint Template Group OnApp Cloud 4.1 API Guide To create new blueprint template group, use the following request: POST /blueprint_template_groups.xml POST /blueprint_template_groups.json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<blueprint_template_group><label>newgroup</label></blueprint_template_group>' -url http://onapp.test/blueprint_template_groups.xml JSON Request example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"blueprint_template_group":{"label":"newgroup"}}' --url http://onapp.test/blueprint_template_groups.json Where you have to specify the blueprint template group's label. XML Response example <?xml version="1.0" encoding="UTF-8"?> <blueprint_template_group> <created_at type="datetime">2013-06-07T10:49:39+00:00</created_at> <depth type="integer">0</depth> <id type="integer">9</id> <label>newgroup</label> <lft type="integer">5</lft> <parent_id nil="true"/> <rgt type="integer">6</rgt> <updated_at type="datetime">2013-06-07T10:49:39+00:00</updated_at> </blueprint_template_group> Where: created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format id — the blueprint template group ID label - the blueprint template group name Edit Blueprint Template Group To edit the blueprint template group, use the following request: PUT /blueprint_template_groups/blueprint_template_group_id.xml PUT /blueprint_template_groups/blueprint_template_group_id.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<blueprint_template_group><label>newgroup</label></blueprint_template_group>' -url http://onapp.test/blueprint_template_groups/blueprint_template_group_id.xml OnApp Cloud 4.1 API Guide JSON Request example: curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"blueprint_template_group":{"label":"newgroup"}}' --url http://onapp.test/blueprint_template_groups/blueprint_template_group_id.json Where you can edit blueprint template group's label. XML Output example <objects type="array"> <object> <id type="integer">2</id> <label>windows_blueprints</label> <parent_id nil="true"/> <lft type="integer">5</lft> <rgt type="integer">6</rgt> <depth type="integer">0</depth> <created_at type="datetime">2014-01-15T17:30:34+02:00</created_at> <updated_at type="datetime">2014-01-15T17:30:34+02:00</updated_at> <children type="array"/> <relations type="array"/> </object> </objects> Where: objects - the blueprint template groups array with the following parameters: id - blueprint template group ID label – blueprint template group name parent_id - id of the target blueprint template group lft - left nested set identifier rgt - right nested set identifier depth - the depth of a given node (distance from this blueprint template group to the root) created_at – the date when the blueprint template group was created updated_at – the date when the blueprint template group was updated children - the array of child blueprint template groups relations - the array of blueprints assigned to the blueprint template groups Delete Blueprint Template Group Use the following API request to delete a blueprint template group: DELETE /blueprint_template_groups/blueprint_template_group_id.xml DELETE /blueprint_template_groups/blueprint_template_group_id.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprint_template_groups/blueprint_template_group_id.xml OnApp Cloud 4.1 API Guide JSON Request example: curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprint_template_groups/blueprint_template_group_id.json Where you have to specify the blueprint template group's label. XML Output example <objects type="array"> <object> <id type="integer">2</id> <label>windows_blueprints</label> <parent_id nil="true"/> <lft type="integer">5</lft> <rgt type="integer">6</rgt> <depth type="integer">0</depth> <created_at type="datetime">2014-01-15T17:30:34+02:00</created_at> <updated_at type="datetime">2014-01-15T17:30:34+02:00</updated_at> <children type="array"/> <relations type="array"/> </object> </objects> Where: objects - the blueprint template groups array with the following parameters: id - blueprint template group ID label – blueprint template group name parent_id - id of the target blueprint template group lft - left nested set identifier rgt - right nested set identifier depth - the depth of a given node (distance from this blueprint template group to the root) created_at – the date when the blueprint template group was created updated_at – the date when the blueprint template group was updated children - the array of child blueprint template groups relations - the array of blueprints assigned to the blueprint template groups Add Child Blueprint Template Group To create new child blueprint template group, use the following request: POST /blueprint_template_groups.xml POST /blueprint_template_groups.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<blueprint_template_group><label>newgroup</label><parent_id>1</parent_id></blueprint _ template_group>' --url http://onapp.test/blueprint_template_groups.xml JSON Request example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"blueprint_template_group":{"label":"newgroup","parent_id":"1"}}' --url http://onapp.test/blueprint_template_groups.json Where you have to specify the blueprint template group's label and ID of the parent group. Get List of Blueprint Templates Attached to Blueprint Template Group To get the list of blueprint template groups, use the following request: GET /blueprint_template_groups/:blueprint_template_group_id/blueprint_template_group_relations.xml GET /blueprint_template_groups/:blueprint_template_group_id/blueprint_template_group_relations.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/blueprint_template_groups/:blueprint_template_group_id/blueprint_te m plate_group_relations.xml JSON Request example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/blueprint_template_groups/:blueprint_template_group_id/blueprint_te m plate_group_relations.json Where you have to specify the template group's ID in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <blueprint_templates type="array"> <blueprint_template> <built type="boolean">false</built> <created_at type="datetime">2013-06-07T11:26:53+00:00</created_at> <hypervisor_id type="integer">28</hypervisor_id> <id type="integer">16</id> <label>vmware_template_vapp</label> <updated_at type="datetime">2013-06-07T11:26:53+00:00</updated_at> <user_id type="integer">1</user_id> <vapp_name>invapp</vapp_name> </blueprint_template> </blueprint_templates> Where: created_at - the date when the blueprint template was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format hypervisor_id - ID of a compute resource the vApp is located on id - blueprint template ID label - blueprint template name user_id - ID of a user the blueprint template belongs to vapp_name - name of the vApp this template is created from Attach Blueprint Template to Group Use the following request to attach blueprint template to the blueprint template group: POST /blueprint_template_groups/:blueprint_template_group_id/blueprint_template_group_relations.xml POST /blueprint_template_groups/:blueprint_template_group_id/blueprint_template_group_relations.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d '<blueprint_template_group_relation><blueprint_template_id>1</blueprint_template_id>< / blueprint_template_group_relation>' --url http://onapp.test/blueprint_template_groups/:blueprint_template_group_id/blueprint_te m plate_group_relations.xml JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"blueprint_template_group_relation":{"blueprint_template_id":":1"}}' --url http://onapp.test/blueprint_template_groups/:blueprint_template_group_id/blueprint_te m plate_group_relations.json Where you have to specify the blueprint template ID and the blueprint template group ID. Remove Blueprint Template from Blueprint Temlate Group Use the following request to attach blueprint template to the blueprint template group: DELETE /blueprint_template_groups/:id/blueprint_template_group_relations/:id.xml DELETE /blueprint_template_groups/:id/blueprint_template_group_relations/:id.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass http://onapp.test/blueprint_template_groups/:id/blueprint_template_group_relations/:i d .xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass http://onapp.test/blueprint_template_groups/:id/blueprint_template_group_relations/:i d .json Where you have to specify the blueprint template ID and the blueprint template group ID in the URL. Blueprint Templates Blueprint templates are VMware vApps images with operating system and network configuration settings that are used for blueprint creation. Get List of Blueprint Templates Use the following API call to get the list of blueprint templates: GET /blueprint_templates.xml GET /blueprint_templates.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprint_templates.xml OnApp Cloud 4.1 API Guide JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprint_templates.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint_templates type="array"> <blueprint_template> <created_at type="datetime">2013-06-01T09:09:09+00:00</created_at> <hypervisor_id type="integer">28</hypervisor_id> <id type="integer">1</id> <label>vmware_template_vapp</label> <updated_at type="datetime">2013-06-01T09:09:09+00:00</updated_at> <user_id type="integer">1</user_id> <vapp_name>invapp</vapp_name> </blueprint_template> </blueprint_templates> Where: created_at - the date when the blueprint template was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format hypervisor_id - ID of a compute resource the vApp is located on id - blueprint template ID label - blueprint template name user_id - ID of a user the blueprint template belongs to vapp_name - name of the vApp this template is created from Get Blueprint Template Details Use the following API call to get blueprint template details: GET /blueprint_templates/:blueprint_template_id.xml GET /blueprint_templates/:blueprint_template_id.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/blueprint_templates/:blueprint_template_id.xml JSON Request example OnApp Cloud 4.1 API Guide curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/blueprint_templates/:blueprint_template_id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint_template> <created_at type="datetime">2013-06-01T09:09:09+00:00</created_at> <hypervisor_id type="integer">28</hypervisor_id> <id type="integer">1</id> <label>vmware_template_vapp</label> <updated_at type="datetime">2013-06-01T09:09:09+00:00</updated_at> <user_id type="integer">1</user_id> <vapp_name>invapp</vapp_name> </blueprint_template> Where: created_at - the date when the blueprint template was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format hypervisor_id - ID of a compute resource the vApp is located on id - blueprint template ID label - blueprint template name user_id - ID of a user the blueprint template belongs to vapp_name - name of the vApp this template is created from Add Blueprint Template Use the following API call to create a blueprint template: POST /blueprint_templates.xml POST /blueprint_templates.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' -d '<blueprint_template><label>newlabel</label><hypervisor_id>28</hypervisor_id><vapp_na m e>vapp1</vapp_name></blueprint_template>' -u user:userpass --url http://onapp.test/blueprint_templates/import.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type:application/json' -d '{"blueprint_template":{"label":"newlabel","hypervisor_id":"28","vapp_name":"vapp1"}} ' -u user:userpass --url http://onapp.test/blueprint_templates/import.json OnApp Cloud 4.1 API Guide Where you have to specify: label - blueprint template label hypervisor_id - ID of a compute resource on which the vApps is located vapp_name - name of the vApp to create the template from XML Output example <?xml version="1.0" encoding="UTF-8"?> <blueprint_template> <built type="boolean">false</built> <created_at type="datetime">2013-06-05T11:57:54+00:00</created_at> <hypervisor_id type="integer">28</hypervisor_id> <id type="integer">9</id> <label>newlabel</label> <updated_at type="datetime">2013-06-05T11:57:54+00:00</updated_at> <user_id type="integer">2326</user_id> <vapp_name>vapp1</vapp_name> </blueprint_template> Edit Blueprint Template Use the following API request to edit blueprint template: PUT /blueprint_templates/:blueprint_template_id.xml PUT /blueprint_templates/:blueprint_template_id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type:application/xml' -d '<blueprint_template><label>newlabel</label></blueprint_template>' -u user:userpass http://onapp.test/blueprint_templates/:blueprint_template_id.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type:application/json' d '{"blueprint_template":{"label":"newlabel"}}' -u user:userpass --url http://onapp.test/blueprint_templates/:blueprint_template_id.json Where you can edit the template's label. XML Output example OnApp Cloud 4.1 API Guide <blueprint_template> <built type="boolean">true</built> <created_at type="datetime">2014-04-02T09:57:27+03:00</created_at> <hypervisor_id type="integer">70</hypervisor_id> <id type="integer">4</id> <label>linux_vapp</label> <updated_at type="datetime">2014-04-02T09:57:27+03:00</updated_at> <user_id type="integer">5</user_id> <vapp_name>lin_vapp</vapp_name> </blueprint_template> Where: built - true if the template is built; otherwise false created_at – the date when the blueprint template was created hypervisor_id - the ID of the compute resource used by this blueprint template id - blueprint template ID label – blueprint template name updated_at – the date when the blueprint template was updated user_id - the ID of the user vapp_name - name of the vApp to create the template from Delete Blueprint Template Use the following API call to delete a blueprint template: DELETE /blueprint_templates/:blueprint_template_id.xml DELETE /blueprint_templates/:blueprint_template_id.json XML Request example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/blueprint_templates/:blueprint_template_id.xml JSON Request example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/blueprint_templates/:blueprint_template_id.json Where you have to specify ID of a blueprint template you want to remove. XML Response example OnApp Cloud 4.1 API Guide <blueprint_templates type="array"> <blueprint_template> <built type="boolean">true</built> <created_at type="datetime">2014-04-02T09:57:27+03:00</created_at> <hypervisor_id type="integer">70</hypervisor_id> <id type="integer">4</id> <label>linux_vapp</label> <updated_at type="datetime">2014-04-02T09:57:27+03:00</updated_at> <user_id type="integer">5</user_id> <vapp_name>lin_vapp</vapp_name> </blueprint_template> </blueprint_templates> Where: built - true if the template is built; otherwise false created_at – the date when the blueprint template was created hypervisor_id - the ID of the compute resource used by this blueprint template id - blueprint template ID label – blueprint template name updated_at – the date when the blueprint template was updated user_id - the ID of the user vapp_name - name of the vApp to create the template from CDN Edge Groups CDN edge groups are groups of edge servers – your own, and those you subscribe to from the CDN marketplace. They are usually grouped by location, so they represent a pool of servers for a given geographical area. Once you have created an edge group containing edge servers in specific locations, you can then assign the group (or groups) to a specific CDN resource. You need to associate CDN Edge groups with billing plans to make them available for users. PLEASE NOTE: Starting from the OnApp Cloud v3.0, CDN is enabled automatically after adding the first DNS record or CDN resource. Get List of CDN Edge Groups To view CDN edge groups available in the cloud: GET /edge_groups.xml GET /edge_groups.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <edge_groups type="array"> <edge_group> <label>tredty</label> <created_at type="datetime">2011-10-11T12:58:40Z</created_at> <updated_at type="datetime">2011-10-11T12:58:40Z</updated_at> <id type="integer">1</id> </edge_group> ... <edge_group></edge_group> ... </edge_groups> Where: label – the edge group label id – the group id in the database Get List of Available CDN Edge Groups To view the list of all the edge groups and their locations, which are available to create CDN resources on, use the following request: GET /cdn_resources/available_edge_groups.xml GET /cdn_resources/available_edge_groups.json The list of available edge groups is defined by the billing plan to which a user is assigned. XML Output example: <?xml version="1.0" encoding="UTF-8"?> <edge_groups type="array"> <edge_group> <label>eg01</label> <edge_group_locations type="array"> <edge_group_location> <city>dallas</city> <price type="decimal">0.7</price> <created_at type="datetime">2012-03-01T11:16:10+02:00</created_at> <country>US</country> <aflexi_location_id type="integer">147</aflexi_location_id> <updated_at type="datetime">2012-03-01T11:16:10+02:00</updated_at> <id type="integer">10</id> <operator>WK</operator> <edge_group_id type="integer">35</edge_group_id> </edge_group_location> </edge_group_locations> <created_at type="datetime">2012-03-01T11:09:28+02:00</created_at> <updated_at type="datetime">2012-03-01T11:09:28+02:00</updated_at> <id type="integer">35</id> </edge_group> </edge_groups> Where: edge_groups – the array of edge groups with their locations available for a user to create a CDN resource on. edge_group – the particular edge group details: OnApp Cloud 4.1 API Guide label – the edge group label OnApp Cloud 4.1 API Guide edge_group_locations – the array of locations assigned to this group: edge_group_location – the list of details for a particular edge group city – the city where the edge server is located price - price per GB of sold excess bandwidth created_at – the date when the record was created in DB country –- country codes, related to country_access_policy in ISO 3166-1 alpha-2 format aflexi_location_id – the ID of this location in Aflexi database updated_at – the date when the record was updated in DB id – the location ID operator – the location operator edge_group_id – the ID of the edge group to which this location is assigned Get CDN Edge Group Details To view the edge group details, use the following request: GET /edge_groups/:id.xml GET /edge_groups/:id.json XML Request example curl -i -X GET -u user:userpass http://onapp.test/edge_groups/:edge_group_id.xml?available_locations=true -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET -u user:userpass http://onapp.test/edge_groups/:edge_group_id.json d '{"available_locations":true}' -H 'Accept: application/json' -H 'Content-type:application/json' Where: available_locations - set true to view the list of locations available to this edge group; set false to view only the list of assigned locations. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <edge_group> <created_at type="datetime">2012-04-18T11:33:01+00:00</created_at> <id type="integer">152</id> <label>CDN Edge group name</label> <updated_at type="datetime">2012-04-18T11:33:01+00:00</updated_at> <assigned_locations type="array"> <location> <description/> <id type="integer">146</id> <price type="float">0.3</price> <region>DC</region> <city>washington</city> <latitude type="float">38.895</latitude> <country>US</country> <deleted type="boolean">false</deleted> <longitude type="float">-77.0367</longitude> </location> <location> ... </location> </assigned_locations> <available_locations type="array"> <location> <description>abc</description> <id type="integer">2</id> <price type="float">10.0</price> <region>T2</region> <city>bangor</city> <latitude type="float">54.65</latitude> <country>GB</country> <deleted type="boolean">false</deleted> <longitude type="float">-5.7</longitude> </location> <location> ... </location> </available_locations> </edge_group> Explanation of the data returned: available_locations – an array of all available locations assigned_locations – an array of locations, which are assigned to the group city – city where the edge server is located region – region where the edge server is located price – price per GB of sold excess bandwidth latitude – latitude of the server location longitude – longitude of the server location country –country codes related to country_access_policy in ISO 3166-1 alpha-2 format updated_at – date when the location was updated deleted – true if the location is deleted; otherwise false OnApp Cloud 4.1 API Guide id – the ID of location in the OnApp CP data base OnApp Cloud 4.1 API Guide created_at- date, when the location was created description – optional description of the location Add CDN Edge Group To create an edge group, use the following API call: POST /edge_groups.xml POST /edge_groups.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups.xml -d '<edge_group><label>az_3</label></edge_group>' -H 'Accept:application/xml' H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups.json d '{"edge_group":{"label":"az_4"}}' -H 'Accept:application/json'-H 'Content-type:application/json' Parameters: label * - the name of new group Edit CDN Edge Group You can edit the label of the edge group: PUT /edge_groups/:id.xml PUT /edge_groups/:id.json XML request example curl -i -X PUT -u user:userpass http://onapp.test/edge_groups/:id.xml -d '<edge_group><label>az_5</label></edge_group>' -H 'Accept:application/xml' H 'Content-type:application/xml' JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/edge_groups/:id.json d '{"edge_group":{"label":"az_6"}}' -H 'Accept:application/json' -H 'Content-type:application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge group with a requested ID, or URL is incorrect. Delete CDN Edge Group To delete the edge group, use the following request: DELETE /edge_groups/:id.xml DELETE /edge_groups/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -u user:userpass http://onapp.test/edge_groups/:id.xml H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/edge_groups/:id.json H 'Accept:application/json' -H 'Content-type:application/json' Where you have to specify ID of a CDN group you want to delete in the URL. NOTE: To delete a CDN edge group which is associated with CDN resources, add the force=true parameter to the request, as shown is the examples below: XML Request example curl -i -X DELETE -u user:userpass http://onapp.test/edge_groups/:id.xml -H 'Accept:application/xml' -d ' <force>1</force>' -H 'Contenttype:application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/edge_groups/:id.json -d '{"force":"1"}' -H 'Accept:application/json' -H 'Contenttype:application/json' Be careful when deleting an edge group which is associated with CDN resources. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge group with a requested ID, or URL is incorrect. Page History v. 3.1: info on force parameter, that allows to delete edge group that is associated with CDN resources. Assign Location to CDN Edge Group CDN edge group details return the array of all locations available to your cloud. Check the ID of the required location and assign it to the group with the following API call: POST /edge_groups/:edge_group_id/assign.xml POST /edge_groups/:edge_group_id/assign.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/assign.xml d '<location>175</location>' -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/assign.json -d '{"location":"175"}' -H 'Accept:application/json' -H 'Contenttype:application/json' Where: location * - input the ID of the required location You can retrieve the list of location IDs with the Get CDN Edge Group Details API call. Unassign Location From CDN Edge Group To remove a location from the group, use the following method: POST /edge_groups/:edge_group_id/unassign.xml POST /edge_groups/:edge_group_id/unassign.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/unassign.xml d '<location>175</location>' -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/unassign.json -d '{"location":"175"}' -H 'Accept:application/json' -H 'Contenttype:application/json' Where you have to specify ID of a location you want to unassign. You can retrieve the list of location IDs with the Get CDN Edge Group Details API call. Modify CDN Edge Group To modify CDN edge group, run: POST /edge_groups/:edge_group_id/modify.xml POST /edge_groups/:edge_group_id/modify.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/modify.xml -d '<locations type="array"><location>123</location><location>123</location><location>123</location> < /locations>' -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/modify.json d '{"locations":["123","456","789"]}' -H 'Accept:application/json' -H 'Content-type:application/json' Where you have to specify IDs of locations you want to see eventually in the required CDN resource (at least one ID is required). You can retrieve the list of location IDs with the Get CDN Edge Group Details API call. Search CDN Edge Groups To search for a specific CDN Edge Group, use the following request: GET /edge_groups.xml?q=label GET /edge_groups.json?q=label Where you have to specify the Edge Group label. XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/edge_groups.xml?q=test JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/edge_groups.json?q=test The request will search for the Edge Group with the test label. XML output example: <?xml version="1.0" encoding="UTF-8"?> <edge_groups type="array"> <edge_group> <created_at type="datetime">2013-08-12T11:39:09+03:00</created_at> <id type="integer">228</id> <label>PItest</label> <updated_at type="datetime">2013-08-12T11:39:09+03:00</updated_at> <cdn_reference type="integer">426776953</cdn_reference> </edge_group> <edge_group> <created_at type="datetime">2013-08-19T14:32:54+03:00</created_at> <id type="integer">232</id> <label>TestPI</label> <updated_at type="datetime">2013-08-19T14:32:54+03:00</updated_at> <cdn_reference type="integer">668633450</cdn_reference> </edge_group> </edge_groups> OnApp Cloud 4.1 API Guide Where: created_at - the date when the edge group was created id – the resource ID in the database label - the edge group label updated_at – the date when the edge group was updated cdn_reference - the identifier in database CDN Edge Servers CDN edge servers are the virtual server which form a Content Delivery Network. In this network the web content is cached and delivered to end users from the server which is closest to the user or has the best availability. Get List of CDN Edge Servers To view all edge servers in the cloud with their details, use the following request: GET /edge_servers.xml GET /edge_servers.json XML Request example curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json To get the list of HTTP edge servers XML Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml?type=http JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json?type=http To get the list of streaming edge servers: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml?type=streaming JSON Request example: OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json?type=streaming OnApp Cloud 4.1 API Guide XML Output example <edge_servers type="array"> <edge_server> <add_to_marketplace type="boolean">true</add_to_marketplace> <admin_note nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">false</booted> <built type="boolean">true</built> <cpu_shares type="integer">7</cpu_shares> <cpu_sockets nil="true"/> <cpu_threads nil="true"/> <cpu_units type="integer">140</cpu_units> <cpus type="integer">1</cpus> <created_at type="datetime">2015-02-10T14:19:45+02:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type>streaming</edge_server_type> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">true</firewall_notrack> <hypervisor_id type="integer">25</hypervisor_id> <id type="integer">3781</id> <identifier>kcs0o46otoxbr0</identifier> <initial_root_password>3yV4Orl1B1Le</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>qawsedrf</label> <local_remote_access_ip_address>109.123.91.36</local_remote_access_ip_address> <local_remote_access_port nil="true"/> <locked type="boolean">false</locked> <memory type="integer">2054</memory> <min_disk_size type="integer">20</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode type="boolean">false</recovery_mode> <remote_access_password>GPRdQyq28jVR</remote_access_password> <service_password nil="true"/> <state>delivered</state> <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">11</template_id> <template_label>debian-6.0-x64-1.14-xen.kvm.kvm_virtio.tar.gz</template_label> <updated_at type="datetime">2015-03-05T10:18:53+02:00</updated_at> <user_id type="integer">4</user_id> <vip nil="true"/> <xen_id nil="true"/> <ip_addresses type="array"> <ip_address> <address>109.123.91.154</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2014-01-14T14:19:52+02:00</created_at> <customer_network_id nil="true"/> OnApp Cloud 4.1 API Guide <disallowed_primary type="boolean">false</disallowed_primary> OnApp Cloud 4.1 API Guide <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">25</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2014-11-06T17:10:35+02:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used>0</monthly_bandwidth_used> <total_disk_size type="integer">20</total_disk_size> <price_per_hour type="float">20540.0</price_per_hour> <price_per_hour_powered_off type="float">0.0</price_per_hour_powered_off> <support_incremental_backups type="boolean">true</support_incremental_backups> <cpu_priority type="integer">7</cpu_priority> OnApp Cloud 4.1 API Guide <edge_status>Active</edge_status> <cdn_reference type="integer">276964394</cdn_reference> </edge_server> Explanation of the data returned: add_to_marketplace – true if this edge server is added to the marketplace; otherwise false admin_note – an optional reminder for this VS created by an administrator allow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise false allowed_hot_migrate – true if hot migration is allowed; otherwise false allowed_swap – true if swap is allowed; otherwise false booted – true if the server is booted; otherwise false cpu_shares – the CPU priority percentage cpu_sockets - the amount of CPU sockets per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_threads - the amount of CPU threads per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan. cpus – number of CPU cores allocated to this edge server created_at – the date when the CDN edge server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - ID of a customer network deleted_at - time when the VS was deleted edge_server_type - true if this is the edge server enable_autoscale – false; not available for edge servers enable_monitis - deprecated attribute; will be removed in upcoming release firewall_notrack - true if the NOTRACK rule is set in iptables hypervisor_id – the ID of the compute resource, on which the server is deployed id – the edge server ID in OnApp CP database identifier – the edge server identifier initial_root_password – the server root password initial_root_password_encrypted – true, if the server root password is encrypted, otherwise false label – an arbitrary name of the edge server local_remote_access_port – the port ID used for console access locked – true if locked; otherwise false memory – the amount of RAM resources allocated to this edge server min_disk_size – minimum disk space required by the template note - an optional reminder for this VS made by a user account operating_system – type of operating system operating_system_distro – the distribution of the operating system preferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settings OnApp Cloud 4.1 API Guide recovery_mode – true if the server is booted in the recovery mode; otherwise false remote_access_password – the password for remote access OnApp Cloud 4.1 API Guide service_password - service account password state – deprecated attribute; will be removed in upcoming release storage_server_type - true if this is a storage server strict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this server suspended – true if suspended; otherwise false template_id – the ID of the template, on which the edge server is based template_label – label of the template on which the server is based; currently – OnApp CDN compute resource updated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user, who is the server owner vip – true if the server has VIP status for migration; otherwise false xen_id – the edge server ID set by the virtualization engine ip_addresses – an array of assigned IP addresses with their details assigned to this edge server: address – baremetal server IP broadcast – a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. created_at – time when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - customer network ID disallowed_primary – true if not allowed to be used as primary (for baremetal server), otherwise false gateway - gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated at - time when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user this IP address is assigned to free – true if free, otherwise false netmask — netmask for the IP address monthly_bandwidth_used - VS monthly bandwidth in KB total_disk_size – total disk space in GB of primary and swap disks price_per_hour - server's price per hour price_per_hour_powered_off - price per hour when server is powered off support_incremental_backups - 1, if virtual server supports incremental backups, and 0 if it does not cpu_priority - this is a new parameter reserved for further use; currently will have the same value as cpu_shares edge_status - the edge server status cdn_reference - the identifier in database Get CDN Edge Server Details To view the edge server details: GET /edge_servers/:id.xml GET /edge_servers/:id.json XML Request example curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json OnApp Cloud 4.1 API Guide To get the list of HTTP edge servers XML Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml?type=http JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json?type=http To get the list of streaming edge servers: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.xml?type=streaming JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/edge_servers.json?type=streaming XML Output example <edge_servers type="array"> <edge_server> <add_to_marketplace type="boolean">true</add_to_marketplace> <admin_note nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">false</booted> <built type="boolean">true</built> <cpu_shares type="integer">7</cpu_shares> <cpu_sockets nil="true"/> <cpu_threads nil="true"/> <cpu_units type="integer">140</cpu_units> <cpus type="integer">1</cpus> <created_at type="datetime">2015-02-10T14:19:45+02:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type>streaming</edge_server_type> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">true</firewall_notrack> <hypervisor_id type="integer">25</hypervisor_id> <id type="integer">3781</id> <identifier>kcs0o46otoxbr0</identifier> <initial_root_password>3yV4Orl1B1Le</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>qawsedrf</label> <local_remote_access_ip_address>109.123.91.36</local_remote_access_ip_address> <local_remote_access_port nil="true"/> OnApp Cloud 4.1 API Guide <locked type="boolean">false</locked> OnApp Cloud 4.1 API Guide <memory type="integer">2054</memory> <min_disk_size type="integer">20</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode type="boolean">false</recovery_mode> <remote_access_password>GPRdQyq28jVR</remote_access_password> <service_password nil="true"/> <state>delivered</state> <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">11</template_id> <template_label>debian-6.0-x64-1.14-xen.kvm.kvm_virtio.tar.gz</template_label> <updated_at type="datetime">2015-03-05T10:18:53+02:00</updated_at> <user_id type="integer">4</user_id> <vip nil="true"/> <xen_id nil="true"/> <ip_addresses type="array"> <ip_address> <address>109.123.91.154</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2014-01-14T14:19:52+02:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">25</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2014-11-06T17:10:35+02:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used>0</monthly_bandwidth_used> <total_disk_size type="integer">20</total_disk_size> <price_per_hour type="float">20540.0</price_per_hour> <price_per_hour_powered_off type="float">0.0</price_per_hour_powered_off> <support_incremental_backups type="boolean">true</support_incremental_backups> <cpu_priority type="integer">7</cpu_priority> OnApp Cloud 4.1 API Guide <edge_status>Active</edge_status> <cdn_reference type="integer">276964394</cdn_reference> </edge_server> Explanation of the data returned: add_to_marketplace – true if this edge server is added to the marketplace; otherwise false admin_note – an optional reminder for this VS created by an administrator allow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise false allowed_hot_migrate – true if hot migration is allowed; otherwise false allowed_swap – true if swap is allowed; otherwise false booted – true if the server is booted; otherwise false cpu_shares – the CPU priority percentage cpu_sockets - the amount of CPU sockets per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_threads - the amount of CPU threads per core. This parameter can be set for KVM compute resources only by those users who have Enable CPU topology permission granted cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan. cpus – number of CPU cores allocated to this edge server created_at – the date when the CDN edge server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - ID of a customer network deleted_at - time when the VS was deleted edge_server_type - true if this is the edge server enable_autoscale – false; not available for edge servers enable_monitis - deprecated attribute; will be removed in upcoming release firewall_notrack - true if the NOTRACK rule is set in iptables hypervisor_id – the ID of the compute resource, on which the server is deployed id – the edge server ID in OnApp CP database identifier – the edge server identifier initial_root_password – the server root password initial_root_password_encrypted – true, if the server root password is encrypted, otherwise false label – an arbitrary name of the edge server local_remote_access_port – the port ID used for console access locked – true if locked; otherwise false memory – the amount of RAM resources allocated to this edge server min_disk_size – minimum disk space required by the template note - an optional reminder for this VS made by a user account operating_system – type of operating system operating_system_distro – the distribution of the operating system preferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settings OnApp Cloud 4.1 API Guide recovery_mode – true if the server is booted in the recovery mode; otherwise false remote_access_password – the password for remote access OnApp Cloud 4.1 API Guide service_password - service account password state – deprecated attribute; will be removed in upcoming release storage_server_type - true if this is a storage server strict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this server suspended – true if suspended; otherwise false template_id – the ID of the template, on which the edge server is based template_label – label of the template on which the server is based; currently – OnApp CDN compute resource updated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user, who is the server owner vip – true if the server has VIP status for migration; otherwise false xen_id – the edge server ID set by the virtualization engine ip_addresses – an array of assigned IP addresses with their details assigned to this edge server: address – baremetal server IP broadcast – a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. created_at – time when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - customer network ID disallowed_primary – true if not allowed to be used as primary (for baremetal server), otherwise false gateway - gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated at - time when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user this IP address is assigned to free – true if free, otherwise false netmask — netmask for the IP address monthly_bandwidth_used - VS monthly bandwidth in KB total_disk_size – total disk space in GB of primary and swap disks price_per_hour - server's price per hour price_per_hour_powered_off - price per hour when server is powered off support_incremental_backups - 1, if virtual server supports incremental backups, and 0 if it does not cpu_priority - this is a new parameter reserved for further use; currently will have the same value as cpu_shares edge_status - the edge server status cdn_reference - the identifier in database Add CDN Edge Server To create an edge server, use the following API call: POST /edge_servers.xml POST /edge_servers.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -d '<edge_server><label>az_CDN_test</label><add_to_marketplace>true</add_to_marketplace> < cpus>1</cpus><data_store_group_primary_id>2</data_store_group_primary_id><primary_net w ork_group_id>3</primary_network_group_id><cpu_shares>1</cpu_shares><memory>512</memor y ><required_virtual_machine_build>1</required_virtual_machine_build><hypervisor_group_ i d>1</hypervisor_group_id><hypervisor_id>1</hypervisor_id><required_ip_address_assignm e nt>1</required_ip_address_assignment><primary_disk_size>5</primary_disk_size><rate_li m JSON it>0</rate_limit><cdn_location>5</cdn_location><edge_server_type>http</edge_server_ty Request example p e></edge_server>' -u user:userpass http://onapp.test/edge_servers.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' curl -i -X POST -d '{"edge_server":{"label":"az_CDN_test","add_to_marketplace":"true","cpus":"1","data_s t ore_group_primary_id":"2","primary_network_group_id":"3","cpu_shares":"1" ,"memory":"512","required_virtual_machine_build":"1","hypervisor_group_id":"1","hyper v isor_id":"1","required_ip_address_assignment":"1","primary_disk_size":"5","rate_limit " :"0", "cdn_location":"5","edge_server_type":"http"}}' -u user:userpass http://onapp.test/edge_servers.json -H 'Accept: application/json' -H 'Contenttype: application/json' Where: label* – a unique name of your CDN edge server. The label can consist of letters [A-Za-z], digits [0-9], dash [ - ], lower dash [ _ ], space character [ ], at sign [@], round brackets [()],slashes [/], comma [,] and dot [.]. You can use both lower- and uppercase letters. The label should begin with an alphanumeric character or lower dash [ _ ] hypervisor_id - indicate the ID of the compute resource, on which the server will be deployed hypervisor_group_id - indicate the compute zone ID cpus * - the amount of CPU cores allocated to this edge server cpu_shares * - the percentage of allocated CPU priority resource memory * - the amount of RAM, which you want to allocate to this edge server primary_disk_size * - the size in GB of the primary disk data_store_group_primary_id – specify the ID of a data store zone, where you want to locate the disk of your server. If not specified – the system will select the data store zone with higher available capacity primary_network_group_id – indicate the network zone ID required_virtual_machine_build – set "1" to build the server automatically after creation. Otherwise set "0" required_ip_address_assignment - set "1" if you want IP address to be assigned automatically after creation. Otherwise set "0" add_to_marketplace – set "true", if the edge server is added to marketplace; otherwise set "false". The default value is "false". cdn_location - the ID of the CDN location. Use the following API call to find the ID Get List of CDN Locations for Location Group. The parameter is optional. If not set, the edge server will be assigned to the first CDN Location in its Location Group. edge_server_type - set http or streaming server type ATTENTION! Creating a Streaming Edge or Storage server will result in an additional monthly charge. You will be charged 50$ per month for deploying this Streaming server once it is provisioned. OnApp Cloud 4.1 API Guide Page History v. 3.3.1 cdn_location parameter edge_server_type Edit CDN Edge Server To change the server label and resource allocation: PUT /edge_servers/:id.xml PUT /edge_servers/:id.json XML Request example curl -i -X PUT -d '<edge_server><label>az_CDN_test_1</label><add_to_marketplace>true</add_to_marketplac e ><cpus>1</cpus><cpu_shares>10</cpu_shares><memory>512</memory></edge_server>' -u onapp.test http://onapp.test/edge_servers/:id.xml -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example curl -i -X PUT -d '{"edge_server":{"label":"az_CDN_test_3","add_to_marketplace":"true","cpus":"1","cpu_ s hares":"20","memory":"512"}}' -u onapp.test http://onapp.test/edge_servers/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: label – a unique name of your CDN edge server. The label can consist of letters [A-Za-z], digits [0-9], dash [ - ], lower dash [ _ ], space character [ ], at sign [@], round brackets [()],slashes [/], comma [,] and dot [.]. You can use both lower- and uppercase letters. The label should begin with an alphanumeric character or lower dash [ _ ] add_to_marketplace – set "true", if the edge server is added to marketplace; otherwise set "false". The default value is "false" cpus - the amount of CPU cores allocated to this edge server cpu_shares - the percentage of allocated CPU priority resource memory - the amount of RAM, which you want to allocate to this edge server Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect. Reboot CDN Edge Server To reboot the edge server: POST /edge_servers/:edge_server_id/reboot.xml POST /edge_servers/:edge_server_id/reboot.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/reboot.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/reboot.json -H 'Accept: application/json' -H 'Content-type: application/json' Reboot CDN Edge Server in Recovery To reboot the edge server in recovery mode with a temporary login ("root") and password ("recovery"), use the following API calls: POST /edge_servers/:edge_server_id/reboot.xml POST /edge_servers/:edger_server_id/reboot.json XML Request example *curl -i -X POST -u user:userpass '<mode>recovery</mode>' -url http://onapp.test/edge_servers/:edger_server_id/reboot.xml JSON Request example *curl -i -X POST -u user:userpass '{"mode":"recovery"}' -url http://onapp.test/edge_servers/:edge_server_id/reboot.json Start up CDN Edge Server POST /edge_servers/:edge_server_id/startup.xml POST /edge_servers/:edge_server_id/startup.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/startup.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/startup.json -H 'Accept: application/json' -H 'Content-type: application/json' Shut down CDN Edge Server To terminate the edge server gracefully: POST /edge_servers/:edge_server_id/shutdown.xml POST /edge_servers/:edge_server_id/shutdown.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/shutdown.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' OnApp Cloud 4.1 API Guide JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/shutdown.json -H 'Accept: application/json' -H 'Content-type: application/json' Stop CDN Edge Server To terminate the edge server forcefully: POST /edge_servers/:edge_server_id/stop.xml POST /edge_servers/:edge_server_id/stop.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/stop.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/stop.json -H 'Accept: application/json' -H 'Content-type: application/json' Rebuild CDN Edge Server To rebuild (or build manually) the edge server, use the following request: POST /edge_servers/:edge_server_id/build.xml POST /edge_servers/:edge_server_id/build.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/build.xml -d'<?xml version="1.0" encoding="UTF8"?><edge_server><template_id>398</template_id><required_startup>1</requ ired_startup></edge_server>'-H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/build.json* *-d '{"edge_server":{"template_id":"398","required_startup":"1"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: template_id * - the ID of the template on which this server will be based required_startup – set "1" to start up the server automatically after build, otherwise set "0" Suspend CDN Edge Server OnApp Cloud 4.1 API Guide POST /edge_servers/:edge_server_id/suspend.xml POST /edge_servers/:edge_server_id/suspend.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/suspend.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/suspend.json -H 'Accept: application/json' -H 'Content-type: application/json' To unsuspend the server, run the request again. Rerun CDN Edge Server Creation Scripts When an edge server is built, the system will run the scripts for creation of an edge server. You can do it manually, using the following request: POST /edge_servers/:edge_server_id/rerun_edge_scripts.xml POST /edge_servers/:edge_server_id/rerun_edge_scripts.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/rerun_edge_scripts.xml H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/rerun_edge_scripts.json H 'Accept:application/json' -H 'Content-type:application/json Unlock CDN Edge Server To unlock the edge server: POST /edge_servers/:edge_server_id/unlock.xml POST /edge_servers/:edge_server_id/unlock.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/unlock.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/edge_servers/:edge_server_id/unlock.json -H 'Accept: application/json' -H 'Content-type: application/json' Delete CDN Edge Server DELETE /edge_servers/:id.xml DELETE /edge_servers/:id.json XML Request example curl -i -X DELETE -u user:userpass http://onapp.test/edge_servers/edge_server_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/edge_servers/:edge_server_id.json -H 'Content-type: application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect. Migrate CDN Edge Server To migrate an edge server to another compute resource, use the following request: POST /edge_servers/:edge_server_id/migrate.xml POST /edge_servers/:edge_server_id/migrate.json XML Request example *curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d "<edge_server><destination>1</destination><cold_migrate_on_rollback>1</cold_migrate_o n _rollback></edge_server>" --url http://onapp.test/edge_servers/:edge_server_id/migrate.xml * JSON Request example *curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"edge_server":{"destination":"1","cold_migrate_on_rollback":"1"}}' --url http://onapp.test/edge_servers/:edge_server_id/migrate.json* Where: destination * - the ID of a target compute resource, to which you migrate the edge server cold_migrate_on_rollback - set 1 if you wish to switch to a cold migration if hot migration fails, otherwise set 0. Segregate CDN Edge Server To segregate an edge server (that is, instruct it never to reside on the same compute resource as another VS or edge server), use the following method: POST /edge_servers/:edge_server_id/strict_vm.xml OnApp Cloud 4.1 API Guide POST /edge_servers/:edge_server_id/strict_vm.json OnApp Cloud 4.1 API Guide XML Request example *curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d '<?xml version="1.0" encoding="UTF8"?><edge_server><strict_virtual_machine_id>bb6oa3eqdzpcgl</strict_virtu al_machine_id></edge_server>' --url http://onapp.test/edge_servers/:edge_server_id/strict_vm.xml* JSON Request example *curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"edge_server":{"strict_virtual_machine_id":"gv03xz1x31t53h"}}' --url http://onapp.test/edge_servers/:edge_server_id/strict_vm.json* Where: strict_virtual_machine_id * - the ID of virtual server you wish to segregate from the given edge server Open CDN Edge Server Console To open an edge server console: 1. Run the following request: GET /edge_servers/:edge_server_id/console.xml GET /edge_servers/:edge_server_id/console.json 2. Find and copy the value for the remote_key parameter in the response output. 3. Open the following URL in the browser: *http://onapp.test/console_remote/\[remote_key_parameter_value\]* Change CDN Edge Server Owner Use the following request to reassign an edge server to another user: POST /edge_servers/:edge_server_id/change_owner.xml POST /edge_servers/:edge_server_id/change_owner.json XML Request example *curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d '<user_id>4</user_id>' --url http://onapp.test/edge_servers/:edge_server_id/change_owner.xml* JSON Request example *curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d "{'user_id':'1'}" --url http://onapp.test/edge_servers/:edge_server_id/change_owner.json* Where: user_id * – input ID of a new server owner Set VIP Status for CDN Edge Server OnApp Cloud 4.1 API Guide To give your edge server a migration priority, set the VIP status for it with the following request: OnApp Cloud 4.1 API Guide POST /edge_servers/:edge_server_id/set_vip.xml POST /edge_servers/:edge_server_id/set_vip.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/edge_servers/:edge_server_id/set_vip.xml -d '<vip>true</vip>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/edge_servers/:edge_server_id/set_vip.json d '{"vip": true}' Where: vip - whether VIP status is enabled for the server or not. Set this parameter to 'true' to enable and to 'false' to disable the VIP status. Add/Edit Admin/User Note for CDN Edge Server To edit/make an admin note, use the following request: PUT /edge_servers/:edge_server_id.xml PUT /edge_servers/:edge_server_id.json XML Request example curl -i -X PUT -u user:userpass http://onapp.test/edge_servers/:edge_server_id.xml d '<edge_server><admin_note>agfagwe tiuuytjgh yuytu</admin_note></edge_server>' -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/edge_servers/:edge_server_id.json d '{"edge_server":{"admin_note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' -H 'Content-type:application/json' Where: admin_note – enter the text of your note. Add/Edit User Note XML Request example curl -i -X PUT -u user:userpass http://onapp.test/edge_servers/:edge_server_id.xml d '<edge_server><note>changed</note></edge_server>' -H 'Accept:application/xml' -H 'Content-type:application/xml' Add/Edit User Note JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass http://onapp.test/edge_servers/:edge_server_id.json d '{"edge_server":{"note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' -H 'Content-type:application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect. CDN Edge Server Disks Since CDN edge servers are virtual servers in their essence, you may perform all the same actions with edge servers' disks as with VS disks, except POST and DELETE. The only difference would be in the routes for the following requests: To view the edge server disks: GET /edge_servers/:edge_server_id/disks.xml GET /edge_servers/:edge_server_id/disks.json Parameters description and output example. For other possible requests, refer to corresponding sections of Disks chapter. CDN Edge Server Network Interfaces Here is the list of API calls for managing CDN edge servers' network interfaces. Edge servers' network interfaces have the same attributes as network interfaces of virtual servers. To get the list of network interfaces allocated to this particular edge server: GET /edge_servers/:edge_server_id/network_interfaces.xml GET /edge_servers/:edge_server_id/network_interfaces.json To get a particular network interface details: GET /edge_servers/:edge_server_id/network_interfaces/:id.xml GET /edge_servers/:edge_server_id/network_interfaces/:id.json To edit network interface details: PUT /edge_servers/:edge_server_id/network_interfaces/:id.xml PUT /edge_servers/:edge_server_id/network_interfaces/:id.json To add a new network interface: POST /edge_servers/:edge_server_id/network_interfaces.xml POST /edge_servers/:edge_server_id/network_interfaces.json To delete a network interface from the edge server: DELETE /edge_servers/:edge_server_id/network_interfaces/:id.xml DELETE /edge_servers/:edge_server_id/network_interfaces/:id.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <network_interface> <label>eth0</label> <usage nil="true"></usage> <created_at type="datetime">2011-03-18T17:45:07+07:00</created_at> <updated_at type="datetime">2011-04-08T18:57:20+07:00</updated_at> <primary type="boolean">true</primary> <usage_month_rolled_at nil="true"></usage_month_rolled_at> <id type="integer">502</id> <mac_address>00:16:3e:50:35:52</mac_address> <usage_last_reset_at nil="true"></usage_last_reset_at> <default_firewall_rule>DROP</default_firewall_rule> <rate_limit type="integer">0</rate_limit> <virtual_machine_id type="integer">518</virtual_machine_id> <network_join_id type="integer">4</network_join_id> <identifier>pdfjrtpkday9e1</identifier> </network_interface> Where: label - network interface name created_at - the timestamp in the database when this network interface was created updated_at - the timestamp in the database when this network interface was updated primary - True if this network interface is primary, otherwise false id - the ID of this network interface mac_address – network interface mac address rate_limit - port speed in Mbps identifier - the identifier in the database of this network interface network_join_id - the ID of the network join to which this network interface belongs virtual_machine_id - the ID of a virtual server to which this network interface is attached CDN Edge Server IP Address Joins An IP address allocated to an edge server is an IP address join. Use the following methods to view, assign and delete IP address joins of your CDN edge servers. To get the list of IP address assignments for a particular edge server: GET /edge_servers/:edge_server_id/ip_addresses.xml GET /edge_servers/:edge_server_id/ip_addresses.json XML Request Example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/edge_servers/: edge_server_id/ip_addresses.xml Json Request Example OnApp Cloud 4.1 API Guide curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/edge_servers/: edge_server_id/ip_addresses.json OnApp Cloud 4.1 API Guide To assign an IP Address to an edge server: POST /edge_servers/:edge_server_id/ip_addresses.xml POST /edge_servers/:edge_server_id/ip_addresses.json XML Request Example curl -i -X POST -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<ip_address_join><ip_address_id>7</ip_address_id><network_interface_id>131</network_ i nterface_id></ip_address_join>' --url http://onapp.test/edge_servers/:edge_server_id/ip_addresses.xml Json Request Example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"ip_address_join":{"ip_ address_id":"7", "network_interface_id":"131"}}' --url http:///onapp.test/edge_servers/:edge_server_id/ip_addresses.jso n XML Response Example OnApp Cloud 4.1 API Guide Status: 201 Content-Length: 1065 Connection: close Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <ip_address_join> <created_at type="datetime">2013-10-31T13:04:05+03:00</created_at> <id type="integer">173</id> <ip_address_id type="integer">7</ip_address_id> <network_interface_id type="integer">131</network_interface_id> <updated_at type="datetime">2013-10-31T13:04:05+03:00</updated_at> <ip_address> <address>1.1.1.3</address> <broadcast>1.1.1.255</broadcast> <created_at type="datetime">2013-08-07T13:29:09+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>1.1.1.1</gateway> <hypervisor_id nil="true"/> <id type="integer">7</id> <ip_address_pool_id nil="true"/> <network_address>1.1.1.0</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-07T13:29:09+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.0</netmask> </ip_address> </ip_address_join> Where: created_at - the date when the record was created in DB id - the IP address join ID ip_address_id - the IP address ID network_interface_id - the network interface ID updated_at - the date when the record was updated in DB ip_address - the array of IP address details address - the IP address broadcast - a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. customer_network_id - the ID of the customer network disallowed_primary - true if this address is not set as primary (for VS build), otherwise false gateway - gateway address OnApp Cloud 4.1 API Guide hypervisor_id - the ID of the compute resource OnApp Cloud 4.1 API Guide ip_address_pool_id - the ID of the IP address poll to which this join belongs network_address - the address of a VLAN network address that will be associated with this IP address pool network_id - the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource free - true if free, otherwise false netmask — netmask for the IP address To delete an IP address assignment from a particular edge server: DELETE /edge_servers/:edge_server_id/ip_addresses/:id.xml DELETE /edge_servers/:edge_server_id/ip_addresses/:id.json XML Request Example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/edge_servers/: edge_server_id/ip_addresses/: ip_address_join_id.xml Json Request Example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/edge_servers/: edge_server_id/ip_addresses/: ip_address_join_id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store_joins type="array"> <data_store_join> <created_at type="datetime">2011-10-11T12:50:02+03:00</created_at> <data_store_id type="integer">2</data_store_id> <hypervisor_id nil="true"></hypervisor_id> <id type="integer">7</id> <target_join_id type="integer">2</target_join_id> <target_join_type>Hypervisor</target_join_type> <updated_at type="datetime">2011-10-11T12:50:02+03:00</updated_at> </data_store_join> ... <data_store_join></data_store_join> ... </data_store_joins> Where: data_store_id - the ID of the data store, which is attached to the compute resource hypervisor_id - reserved parameter id - the join ID target_join_id - the ID of the join target; in this case it is the compute resource ID OnApp Cloud 4.1 API Guide target_join_type - type of join target; in this case it is compute resource Rebuild Network for CDN Edge Server OnApp Cloud 4.1 API Guide It is required to rebuild network after any changes on IP address joins or network interfaces. To rebuild network, use the following request: POST /edge_servers/:edge_server_id/rebuild_network.xml POST /edge_servers/:edge_server_id/rebuild_network.json XML Request example curl -X POST -u user:userpass --url 'http://onapp.test/edge_servers/:edge_server_id/rebuild_network.xml?force=1&shutdown_ t ype=hard&required_startup=1' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X POST -u user:userpass --url 'http://onapp.test/edge_servers/:edge_server_id/rebuild_network.json?force=1&shutdown _ type=hard&required_startup=1' -H 'Accept: application/json' -H 'Content-type: application/json' Where: storage_server_id - ID of the edge server shutdown_type - type of the edge server shutdown: hard, graceful or soft required_startup - set 1 to start up the server automatically after build, otherwise set 0 Get CDN Edge Server Billing Statistics You can view the billing statistics for a particular edge server using the following request: GET /edge_servers/:edge_server_id/vm_stats.xml GET /edge_servers/:edge_server_id/vm_stats.json Define a shorter period by setting Start and End time in the API call: GET /edge_servers/:edge_server_id/vm_stats.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:m m:ss&period[use_local_time]=1 GET /edge_servers/:edge_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:m m:ss&period[use_local_time]=1 XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <vm_stats type="array"> <vm_hourly_stat> <created_at type="datetime">2011-11-01T00:00:13Z</created_at> <updated_at type="datetime">2011-11-01T00:00:13Z</updated_at> <stat_time type="datetime">2011-11-01T00:00:00Z</stat_time> <total_cost type="float">0.0</total_cost> <id type="integer">9582</id> <vm_billing_stat_id type="integer">7795</vm_billing_stat_id> <user_id type="integer">1</user_id> <billing_stats> <virtual_machines type="array"> <virtual_machine> OnApp Cloud 4.1 API Guide <label>QAVP XEN serveridze</label> <costs type="array"> <cost> <value type="integer">100</value> <resource_name>cpu_shares</resource_name> <cost type="float">0.0</cost> </cost> ... <cost></cost> ... </costs> <id type="integer">237</id> </virtual_machine> </virtual_machines> <network_interfaces type="array"> <network_interface> <label>eth0</label> <costs type="array"> <cost> <value type="integer">1</value> <resource_name>ip_addresses</resource_name> <cost type="float">0.0</cost> </cost> ... <cost></cost> ... </costs> <id type="integer">254</id> </network_interface> </network_interfaces> <disks type="array"> <disk> <label>#499</label> <costs type="array"> <cost> <value type="integer">20</value> <resource_name>disk_size</resource_name> <cost type="float">0.0</cost> </cost> ... <cost></cost> ... </costs> <id type="integer">499</id> </disk> </disks> <edge_servers type="array"> <edge_server> <label>QAVP XEN serveridze</label> <costs type="array"> <cost> <value type="integer">14</value> <resource_name>template</resource_name> <cost type="float">0.0</cost> </cost> </costs> <id type="integer">237</id> OnApp Cloud 4.1 API Guide </edge_server> </edge_servers> OnApp Cloud 4.1 API Guide </billing_stats> <usage_cost type="float">0.0</usage_cost> <virtual_machine_id type="integer">237</virtual_machine_id> <currency_code>USD</currency_code> OnApp Cloud 4.1 API Guide <vm_resources_cost type="float">0.0</vm_resources_cost> </vm_hourly_stat> </vm_stats> Where: created_at – the timestamp in DB when this record was created updated_at – the date when these statistics were updated cost – the total amount of money owed by this particular edge server for the resources spent at stat_time stat_time – the particular hour for which these statistics were generated id – the ID of these statistics user_id - the ID of edge server owner currency_code - currency in which this virtual machine is charged within the billing plan billing_stats - an array of billing details for the resources used by this edge server virtual_machine - an array of edge server billing details: label – name of the edge server costs- an array of edge server resources with their total prices for the period specified in the stat-time parameter, where: resource_name - the resource in question. This can be cpu_shares, cpus, memory, cpu_usage and template value - the amount of resources allocated to this edge server. Here are the units of measurment for each type of resource_name: cpu_shares - CPU priority percentage cpus - number of CPU cores memory - amount of RAM in Mb cpu_usage - CPU time in seconds cost - the total due for this resource id - Virtual machine ID network_interfaces - an array of network interfaces used by this edge server with their billing statistics: label - network interface name used in OnApp id - network interface ID costs- an array of network interface related resources with their total prices for the period specified in the stat-time parameter, where: resource_name - the resource in question. This can be ip_addresses, rate, data_received and data_sent value- the amount of resources used by this network interface. Here are the units of measurment for each type of resource_name: ip_addresses - number of IPs rate - the port speed in Mb per second data_received - amount of received data in Kb data_sent - amount of sent data in Kb cost - the total due for the resource disks - an array of disks used by this edge server with their billing details: label - disk name used in UI id - disk ID used in database costs- an array of disk related resources with their total prices for the period specified in the stat-time parameter, where: resource_name - the resource in question. This can be disk_size, data_read, data_written, reads_completed and writes_completed value - the amount of resources used. Here are the units of measurment for each type of resource_name: disk_size - size in GB data_read - read data in Kb data_writen - amount of written data in Kb reads - number read operations writes - number of write operations cost - the total due for the resource edge_server - an array of edge server with its billing details: label – edge server name used in UI OnApp Cloud 4.1 API Guide id – server ID used in database costs- an array of related resources with their total prices for the period specified in the stat-time parameter, where: OnApp Cloud 4.1 API Guide resource_name - the resource in question. In this case - template value – here, the template ID in the database cost - the total due for the resource total_cost – the total amount of money owed for the edge server specified by id parameter for a particular hour specified by stat_time parameter (total_cost = vm_resources_cost + usage_cost) vm_resources_cost – the amount of money due for the edge server resources for the particular hour specified by stat_time parameter (memory, disks, templates) usage_cost – the total due for edge server usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage). Get CDN Edge Server CPU Usage Statistics To view CPU usage statistics of a CDN edge server, run: GET GET /edge_servers/:edge_server_id/cpu_usage.xml /edge_servers/:edge_server_id/cpu_usage.json Define a shorter period by setting Start and End time in the API call: GET /edge_servers/:edge_server_id/vm_stats.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:m m:ss&period[use_local_time]=1 GET /edge_servers/:edge_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:m m:ss&period[use_local_time]=1 XML Request example: curl -i GET -u user:userpass --url http://onapp.test/edge_servers/:edge_server_id/cpu_usage.xm l XML Request example: curl -i GET -u user:userpass --url http://onapp.test/edge_servers/:edge_server_id/cpu_usage.jso n Where you have to specify the edge server ID. Search CDN Edge Server by Label To search an edge server by label, run the following request XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/edge_servers.xml?q=label JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/edge_servers.json?q=label OnApp Cloud 4.1 API Guide Where you have to specify the label of a CDN edge server you are searching for. OnApp Cloud 4.1 API Guide CDN Resources A CDN resource is a host (e.g. a specific web server), the content of which you are going to distribute over the network of edge servers. The list of servers taking part in distributing/caching of data is limited to the locations added to those edge groups assigned to the resource. Get List of CDN Resources To see all CDN resources in the cloud, use the following request: GET /cdn_resources.xml GET /cdn_resources.json XML Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.xml JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.json To view the list of HTTP resources: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.xml?type=http JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.json?type=http To view the list of VoD resources: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.xml?type=vod JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.json?type=vod To view the list of live streaming resources: XML Request example: OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.xml?type=live_streaming OnApp Cloud 4.1 API Guide JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.json?type=live_streaming XML Output example <?xml version="1.0" encoding="UTF-8"?> <cdn_resources type="array"> <cdn_resource> <cdn_hostname>cdn.1example.com</cdn_hostname> <cdn_ssl_certificate_id nil="true"/> <cname>990113320.r.worldcdn-beta.net</cname> <created_at type="datetime">2012-05-10T14:19:02+00:00</created_at> <id type="integer">2</id> <resource_type>HTTP_PULL</resource_type> <updated_at type="datetime">2012-05-10T14:19:02+00:00</updated_at> <user_id type="integer">1</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <cname>990113320.r.worldcdn-beta.net</cname> <origins type="array"> <origin> <key/> <value>1example.com</value> </origin> </origins> </cdn_resource> ... <cdn_resource></cdn_resource> ... </cdn_resources> Explanation of the data returned: cdn_hostname - the hostname which will serve static content cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate added to the resource cname - CNAME record created_at – the date when the CDN resource was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – the resource ID in the database resource_type – CDN resource type updated_at – the date when the CDN resource was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user, who owns the resource last_24h_cost - the amount due for the last 24 hours cdn_reference - ID of the SSL certificate on the remote Aflexi server origins – an array of CDN origins with the following parameters: origin – the path from which the CDN requests the content key – access key, if any value – the path to the content OnApp Cloud 4.1 API Guide Get CDN Resource Basic Details To view details of the particular CDN resource: GET /cdn_resources/:id.xml GET /cdn_resources/:id.json XML Output example: <?xml version="1.0" encoding="UTF-8"?> <cdn_resource> <cdn_hostname>cdn.test.com</cdn_hostname> <created_at type="datetime">2012-05-14T10:19:37+00:00</created_at> <id type="integer">3</id> <resource_type>HTTP_PULL</resource_type> <updated_at type="datetime">2012-05-14T10:19:37+00:00</updated_at> <user_id type="integer">1</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <edge_groups type="array"> <edge_group> <created_at type="datetime">2012-04-18T11:58:05+00:00</created_at> <id type="integer">158</id> <label>dfgfg</label> <updated_at type="datetime">2012-04-18T11:58:05+00:00</updated_at> </edge_group> </edge_groups> <status>ACTIVE</status> <secondary_hostnames type="array"/> <ssl_on type="boolean">false</ssl_on> <ssl nil="true"/> <origins type="array"> <origin> <key/> <value>test.com</value> </origin> </origins> </cdn_resource> Explanation of the data returned: cdn_hostname - the hostname which will serve static content created_at – the date when the resource was created id – the resource ID in the database resource_type – HTTP PULL or PUSH updated_at – the date when the resource was updated user_id – the ID of the user, who owns the resource last_24h_cost – the amount of money owed for the resource for the last 24 hours. edge_groups – the array of edge groups assigned to this resource, where: created_at – the date when the edge group was created label – the label of the particular edge group assigned id – the edge group id updated_at – the date when the edge group was updated OnApp Cloud 4.1 API Guide status – the resource status (can be Preparing, Active, Suspended) OnApp Cloud 4.1 API Guide secondary hostname – secondary CDN hostname ssl_on - whether SSL is enabled for the resource or not ssl - custom SNI SSL certificate if it is added to the resource origins – the path from which the CDN requests the content key – access key, if any value – the path to the content Get CDN Resource Advanced Details To view advanced details of the CDN resource, use the following request: GET /cdn_resources/:id/advanced.xml GET /cdn_resources/:id/advanced.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <cdn_resource> <secondary_hostnames type="array"> <secondary_hostname>test.com</secondary_hostname> </secondary_hostnames> <ip_access_policy>ALLOW_BY_DEFAULT</ip_access_policy> <ip_addresses/> <country_access_policy>BLOCK_BY_DEFAULT</country_access_policy> <countries type="array"> <country>AL</country> <country>AR</country> <country>GT</country> <country>HR</country> </countries> <url_signing_on type="boolean">true</url_signing_on> <url_signing_key>dcahcgDAD</url_signing_key> <hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy> <domains>www.example.com</domains> <password_on type="boolean">true</password_on> <passwords> <username2>password2</username2> <username1>password1</username1> </passwords> <password_unauthorized_html>password unauthorized</password_unauthorized_html> <flv_pseudo_on type="boolean">true</flv_pseudo_on> <mp4_pseudo_on type="boolean">true</mp4_pseudo_on> <limit_rate type="integer">80</limit_rate> <limit_rate_after type="integer">13</limit_rate_after> </cdn_resource> Explanation of the data returned: secondary hostname – secondary CDN hostname ip_access_policy – displays access policy from a range of IP addresses; either NONE (disabled), ALLOW_BY_DEFAULT or BLOCKED_BY_DEFAULT country_access_policy_ – displays access policy to the CDN resource's content for specified countries; either NONE (disabled), ALLOW_BY_DEFAULT or BLOCKED_BY_DEFAULT OnApp Cloud 4.1 API Guide url_signing_on – true if the access requires URL signing; otherwise false OnApp Cloud 4.1 API Guide url_signing_key – the key for URL signing; a signed URL looks like: _http://example.com/filename?hash=url-signing-key==_ hotlink_policy – displays the hotlink policy; either NONE (disabled), ALLOW_BY_DEFAULT or BLOCKED_BY_DEFAULT domains - domains related to hotlink_policy password_on – true, if the access to the resource is restricted; otherwise false passwords – an array of username and password for restricted access in the following format: <username>password</username> mp4_pseudo_on - 1 if MP4 preudo streaming is enabled, otherwise set 0 flv_pseudo_on - 1 if FLV preudo streaming is enabled, otherwise set 0 limit_rate - speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s limit_rate_after - the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB Add HTTP CDN Resource To create an HTTP resource, use the following request: POST /cdn_resources.xml POST /cdn_resources.json Add HTTP PULL XML Request example curl -i -X POST -d '<cdn_resource><cdn_hostname>cdn.test.co</cdn_hostname><cdn_ssl_certificate_id>ssl_se r t_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id type="integer">1</edge_group_id></edge_group_ids><resource_type>HTTP_PULL</resource_t y pe><origin>test.origin.com</origin></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' Add HTTP PULL JSON Request example curl -i -u user:userpass -X POST http://onapp.test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"cdn.test.co","resource_type":"HTTP_PULL","cdn_ssl_c e rtificate_id":"ssl_cert_id","edge_group_ids":[1],"origin":"test.origin.com"}}' Add HTTP PUSH XML Request example curl -i -X POST -d '<cdn_resource><cdn_hostname>cdn.test.co</cdn_hostname><cdn_ssl_certificate_id>ssl_se r t_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id type="integer">7</edge_group_id></edge_group_ids><resource_type>HTTP_PUSH</resource_t y pe><ftp_password>j3x8svqybA2gmrgYOZSrOlYToQ</ftp_password></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' Add HTTP PUSH JSON Request example OnApp Cloud 4.1 API Guide curl -i -u user:userpass -X POST http://onapp.test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"cdn.test.co","resource_type":"HTTP_PUSH","cdn_ssl_c e rtificate_id":"ssl_cert_id","edge_group_ids":[7],"ftp_password":"j3x8svqybA2gmrgYOZSr O lYToQ"}}' Where: origin* - the path from which the CDN requests the content. You can specify up to 3 origins. You can specify custom origin port (for HTTP pull resource only). To use the custom port for resource's origin, specify a port number using a colon (":"). For example, <origin>1.2.3.4:80</origin>. When you are specifying only one origin, it can be either a CDN hostname or an IP address. In case you are specifying more than one origin, they can only be IP addresses. To send two or more origins in the API request, use array: XML example <origins type="array"> <origin>111.111.11.111</origin> <origin>111.111.11.111</origin> </origins> JSON example {"origins":["111.111.11.111", "222.222.22.222"]} cdn_hostname * - indicate the hostname which will serve static content. Specify the following fourth-level domain name for this parameter to create a resource with SSL enabled: "example.r.worldssl.net", where replace the example with the desired name. resource_type * - HTTP_PULL or HTTP_PUSH cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource edge_group_ids * - indicate the ID(s) of required CDN edge groups ftp_password * - specify the FTP password if you add an HTTP PUSH CDN resource type. It can consist of 6-32 alphanumeric characters. Response You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Page history OnApp 4.0: origin parameter allows adding port to HTTP pull resource. Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource Add Video on Demand CDN Resource OnApp Cloud 4.1 API Guide To create an HTTP resource, use the following request: OnApp Cloud 4.1 API Guide POST /cdn_resources.xml POST /cdn_resources.json Add VoD PULL XML Request example curl -i -X POST -d '<cdn_resource><cdn_hostname>az.test.api</cdn_hostname><edge_group_ids type="array"><edge_group_id type="integer">7</edge_group_id></edge_group_ids><resource_type>STREAM_VOD_PULL</reso u rce_type><origin>test.origin.com</origin></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' Add VoD PULL JSON Request example curl -i -u user:userpass -X POST http://onapp.test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"cdn.test.co","resource_type":"STREAM_VOD_PULL","edg e _group_ids":[7],"origin":"test.origin.com"}}' Add VoD PUSH XML Request example curl -i -X POST -d '<cdn_resource><cdn_hostname>cdn.test.co</cdn_hostname><edge_group_ids type="array"><edge_group_id type="integer">7</edge_group_id></edge_group_ids><resource_type>STREAM_VOD_PUSH</reso u rce_type><ftp_password>j3x8svqybA2gmrgYOZSrOlYToQ</ftp_password></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' Add VoD PUSH JSON Request example curl -i -u user:userpass -X POST http://onapp.test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"cdn.test.co","resource_type":"STREAM_VOD_PUSH","edg e _group_ids":[7],"ftp_password":"j3x8svqybA2gmrgYOZSrOlYToQ"}}' Where: cdn_hostname * - specify the name which will serve as a label only resource_type* - specify the resource type - STREAM_VOD_PULL or STREAM_VOD_PUSH origin* - the path from which the CDN requests the content (for VoD PULL request). edge_group_ids * - indicate the ID(s) of required CDN edge groups ftp_password * - specify the FTP password for VoD PUSH type. It should consist of 6-32 alphanumeric symbols. Response You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Add Live Streaming CDN Resource OnApp Cloud 4.1 API Guide To create a live streaming CDN resource, use the following request: POST /cdn_resources.xml POST /cdn_resources.json XML Request example (with external publishing point ) curl -i -X POST -d '<cdn_resource><cdn_hostname>onapp.stream.resource</cdn_hostname><edge_group_ids type="array"><edge_group_id type="integer">1</edge_group_id></edge_group_ids><resource_type>STREAM_LIVE</resource _ type><publishing_point>external</publishing_point><publishing_location>www.google.com < /publishing_location><failover_publishing_location>rtmp://test.com/test</failover_pub l ishing_location></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml JSON -H Request exampleapplication/xml' (with external publishing ) 'Accept: -Hpoint 'Content-type: application/xml' curl -i -u user:userpassword -X POST http://onapp.test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"onapp.stream.resource","resource_type":"STREAM_LIVE " ,"edge_group_ids":[7],"publishing_point":"external","publishing_location":"rtmp://test .me/test","failover_publishing_location":"rtmp://test.com/test"}}' XML Request example (with internal publishing point ) curl -i -X POST -d '<cdn_resource><cdn_hostname>onapp.stream.resource</cdn_hostname><edge_group_ids type="array"><edge_group_id type="integer">1</edge_group_id></edge_group_ids><resource_type>STREAM_LIVE</resource _ type><publishing_point>internal</publishing_point><publishing_location>532</publishin g _location><failover_publishing_location>128</failover_publishing_location></cdn_resou r ce>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' JSON -H Request example (with internal publishing point ) 'Content-type: application/xml' curl -i -u user:userpass -X POST http://test/cdn_resources.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"cdn_resource":{"cdn_hostname":"onapp.stream.resource","resource_type":"STREAM_LIVE " ,"edge_group_ids":[7],"publishing_point":"internal","publishing_location":"532","fail o ver_publishing_location":"128"}}' Where: cdn_hostname* - specify the name which will serve as a label only resource_type* - STREAM_LIVE publishing_point* - the publishing point type: external or internal publishing_location*- specify the URL address for external publishing point. Set the ID of a location that will serve as a publishing point for internal type. failover_publishing_location - publishing point failover URL for external publishing point. Specify the ID of a location that will serve as a failover OnApp Cloud 4.1 API Guide publishing point for internal type. OnApp Cloud 4.1 API Guide edge_group_ids* - indicate the ID(s) of required CDN edge groups Response You will get a response consisting of two parts - the header with HTTP status code (see Introduction for details) and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Add HTTP Pull CDN Resource with Advanced Settings To create an HTTP resource with advanced settings, use the following request: POST /cdn_resources.xml POST /cdn_resources.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><resource_type>HTTP_PULL</resource_type><cdn_hostname>PIHTTPPULCDNreso urce.com</cdn_hostname><origin>109.123.105.178</origin><cdn_ssl_certificate_id>ssl_se r t_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id>225</edge_group_id></edge_group_ids><secondary_hostnames type="array"><secondary_hostname>test110.com</secondary_hostname><secondary_hostname> t est220.com</secondary_hostname></secondary_hostnames><ip_access_policy>BLOCK_BY_DEFAU L T</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_addresses><countr y _access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><hotlink_policy>AL L OW_BY_DEFAULT</hotlink_policy><domains>abuse.co.ua abuse.org</domains><url_signing_on>1</url_signing_on><url_signing_key>12345qwertyyu</ u rl_signing_key><cache_expiry>45</cache_expiry><password_on>1</password_on><form_pass> < user type="array"><string>user123new</string><string>user234new</string></user><pass type="array"><string>passw123new</string><string>passw234new</string></pass></form_pa s s><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html><flv_pseudo_on>1</flv_pseudo_on><mp4_pseudo_on > 0</mp4_pseudo_on><limit_rate>150</limit_rate><limit_rate_after>1</limit_rate_after><p JSON Request example r oxy_cache_key>$host$uri</proxy_cache_key><proxy_read_time_out>60</proxy_read_time_out > <proxy_connect_time_out>20</proxy_connect_time_out><http_bot_blocked>1</http_bot_bloc k ed><origin_policy>HTTP</origin_policy></cdn_resource>' OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"resource_type":"HTTP_PULL","origin":"109.123.105.178","cdn_hostnam e ":"jsonPIHTTPPULCDNresource.com","cdn_ssl_certificate_id":"ssl_cert_id","edge_group_i ds":["225"],"secondary_hostnames":["name11.co","name22.co"],"ip_access_policy":"ALLOW _ BY_DEFAULT","ip_addresses":"111.111.11.111,222.222.22.222","country_access_policy":"B L OCK_BY_DEFAULT","countries":["AL","AR","GT","HR"],"hotlink_policy":"ALLOW_BY_DEFAULT" , "domains":"mnw.netggl.com","url_signing_on":"1","url_signing_key":"12345sfdfdsfsd","c a che_expiry":45,"password_on":1,"form_pass":{"user":["user190","user278"],"pass":["pas s 123","pass2348"]},"password_unauthorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","mp4_pseudo_on":"1","flv_pseudo_on":"1","ignore_set Where:_ cookie_on":"1","limit_rate":"150","limit_rate_after":"1","proxy_cache_key":"$host$uri origin* - the path from which the CDN requests the content. When using the hostnames according to RFC 1035, the origin may consist of letters " (case insensitive manner), digits [0-9], and dash [ - ]. The limit for hostname is 255 chars. You can specify up to 3 origins. [A-Z a-z] ,"proxy_read_time_out":"60","proxy_connect_time_out":"20","http_bot_blocked":1,"origin _policy":"HTTP"}}' When you are specifying only one origin, it can be either a CDN hostname or an IP address. In case you are specifying more than one origin, they can only be IP addresses. To send two or more origins in the API request, use array. For example: <origins type="array"> <origin>111.111.11.111</origin> <origin>111.111.11.111</origin> </origins> cdn_hostname* - indicate the hostname which will serve static content. Specify the following fourth-level domain name for this parameter to create a resource with SSL enabled: "example.r.worldssl.net", where replace the example with the desired name. If the CDN hostname ends with '.r.worldssl.net', SSL will be enabled automatically. resource_type* - HTTP_PULL cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. edge_group_ids* - indicate the ID(s) of required CDN edge groups secondary_hostnames - an array of secondary CDN hostnames. You can add up to 7 secondary CDN hostnames. For example: <secondary_hostnames type="array"> <secondary_hostname>test100.com</secondary_hostname> <secondary_hostname>test200.com</secondary_hostname> </secondary_hostnames> To be able to use a secondary hostname for the CDN resource with SSL enabled, you require an SSL certificate for your custom hostname. For help with questions about the SSL certificate purchase, please contact OnApp support. ip_access_policy - configure a rule to control access to the CDN resource's content for a range of IP addresses: OnApp Cloud 4.1 API Guide ALLOW_BY_DEFAULT - allow IP access policy by default, except for IP addresses specified in the ip_addresses parameter OnApp Cloud 4.1 API Guide BLOCK_BY_DEFAULT - block IP access policy by default, except for IP addresses specified in the ip_addresses parameter NONE - switch off the IP access policy ip_addresses - IP address(es) related to ip_access_policy parameter; The comma-separated list of IP addresses or IP ranges allowed/blocked by default. Use the following format "10.10.10.10, 20.20.20.0/24" hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: ALLOW_BY_DEFAULT - allow hotlink policy by default, except for domains specified in the domains parameter BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format cache_expiry - set the cache expiry time in minutes (min=1, max=35000000) url_signing_on - set 1 to enable and protect your files from unauthorized access with a key url_signing_key - input the key for URL signing. Input letters and digits (6-32 symbols). password_on - set 1 to enable and to restrict access to the resource (cdn_hostname), otherwise set 0 form_pass - an array with usernames and passwords to access the resource pass - the user password. user - the user login, which may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], underscore [ _ ], and dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated. password_unauthorized_html - text, which will be displayed in case of fail of authentication. Max 1000 chars. mp4_pseudo_on - set 1 to enable MP4 pseudo streaming, otherwise set 0 flv_pseudo_on - set 1 to enable FLV pseudo streaming, otherwise set 0 ignore_set_cookie_on -set 1 to enable caching content with Set-Cookie response headers, otherwise set 0 to ignore content caching Nginx Settings limit_rate - sets speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s limit_rate_after - sets the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB proxy_read_time_out - proxy server response timeout in seconds. Maximum proxy read timeout value - 65535 seconds proxy_connect_time_out - timeout for establishing connection with proxy server in seconds. Maximum proxy connect time out value - 75 seconds. proxy_cache_key - specify the key for caching. This parameter defines what information is included in the cache key.You can set the following options: $host$request_uri $host$uri $proxy_host$request_uri $proxy_host$uri http_bot_blocked - set 1 to block web crawling bots from indexing the CDN content (for HTTP Pull CDN resources only) origin_policy - set the parameter to choose the type of connection. Possible values are: HTTP, HTTPS, AUTO. Response You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. XML Response Example OnApp Cloud 4.1 API Guide HTTP/1.1 201 Date: Wed, 31 Jul 2013 09:19:55 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.17 X-UA-Compatible: IE=Edge,chrome=1 ETag: "915066feccf0b14edaa50af485b3b705" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: f48bc47604a5784aafc5f98dab733465 X-Runtime: 0.387472 X-Rack-Cache: invalidate, pass Set-Cookie: _session_id=2cc141e9002d8d3df5c4033dbda2a090; path=/; HttpOnly Location: http://onapp.test/cdn_resources/10743 Status: 201 Content-Length: 797 Connection: close Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <cdn_resource> <cdn_hostname>PI-HTTPPULCDNresource.com</cdn_hostname> <cname></cname> <created_at type="datetime">2013-07-31T12:19:55+03:00</created_at> <id type="integer">10743</id> <resource_type>HTTP_PULL</resource_type> <updated_at type="datetime">2013-07-31T12:19:55+03:00</updated_at> <user_id type="integer">20</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <cname></cname> <cdn_reference type="integer">431059243</cdn_reference> <secondary_hostnames type="array"> <secondary_hostname>test100.com</secondary_hostname> <secondary_hostname>test200.com</secondary_hostname> </secondary_hostnames> <origins type="array"> <origin>111.111.111.1</origin> </origins> <ssl_on nil="true"/> </cdn_resource> Page history v 4.0 Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource v. 3.3.1 Added the following parameter: origin_policy Add HTTP Push CDN Resource with Advanced Settings To create an HTTP resource with advanced settings, use the following request: POST /cdn_resources.xml POST /cdn_resources.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept:application/xml' -H 'Content-type: application/xml' -d '<cdn_resource><resource_type>HTTP_PUSH</resource_type><cdn_hostname>xmlcdn.apitest.c o m</cdn_hostname><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id><edge_gro u p_ids type="array"><edge_group_id type="integer">225</edge_group_id></edge_group_ids><storage_server_location>816382921 < /storage_server_location><ftp_password>qwerty123</ftp_password><secondary_hostnames type="array"><secondary_hostname>name13311.co</secondary_hostname><secondary_hostname > name11122.co</secondary_hostname></secondary_hostnames><ip_access_policy>ALLOW_BY_DEF A ULT</ip_access_policy><ip_addresses>111.111.11.111</ip_addresses><hotlink_policy>ALLO W _BY_DEFAULT</hotlink_policy><domains>example.com</domains><url_signing_on>1</url_sign i ng_on><url_signing_key>12345qwertyyu</url_signing_key><country_access_policy>ALLOW_BY _ DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><lim i JSONt_rate>150</limit_rate><limit_rate_after>1</limit_rate_after><password_on>1</password Request example _ on><form_pass><user type="array"><string>user123new</string><string>user234new</string></user><pass curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u type="array"><string>passw123new</string><string>passw234new</string></pass></form_pa user:userpass --url http://onapp.test/cdn_resources.json -d s s><password_unauthorized_html>YOU ARE NOT '{"cdn_resource":{"resource_type":"HTTP_PUSH","cdn_hostname":"jsoncdn.apitest.com","c AUTHORIZED</password_unauthorized_html></cdn_resource>' d n_ssl_certificate_id":"ssl_cert_id","edge_group_ids":["225"],"storage_server_location " :"816382921", "ftp_password":"qwerrtyuio","secondary_hostnames":["test122.com","test234.com"],"ip_a c cess_policy":"ALLOW_BY_DEFAULT","ip_addresses":"111.111.11.111,222.222.22.222","count r y_access_policy":"BLOCK_BY_DEFAULT","countries":["AL","AR","GT","HR"],"hotlink_policy " :"ALLOW_BY_DEFAULT","domains":"mnw.netggl.com","url_signing_on":"1","url_signing_key" : "12345qwqew","password_on":1,"form_pass":{"user":["user190","user278"],"pass":["pass1 2 3","pass2348"]},"password_unauthorized_html":"<b>You are Where: blocked!</b>","mp4_pseudo_on":"1","mp4_pseudo_on":"1","flv_pseudo_on":"1","limit_rate " cdn_hostname* - indicate the hostname which will serve static content. Specify the following fourth-level domain name for this parameter to create :"150","limit_rate_after":"1"}}' a resource with SSL enabled: "example.r.worldssl.net", where replace the example with the desired name. If the CDN hostname ends with '.r.worldssl.net', SSL will be enabled automatically. resource_type* - HTTP_PUSH cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. edge_group_ids* - indicate the ID(s) of required CDN edge groups storage_server_location - the ID of the storage server location which should be assigned to this resource. To get the ID of the required storage server location, use the request described at the Get List of Available Storage Locations section. If no location set, the first active storage server is chosen automatically. ftp_password* - indicate the FTP server password. It should consist of 6-32 alphanumeric symbols. OnApp Cloud 4.1 API Guide secondary_hostnames - an array of secondary CDN hostnames. You can add up to 7 secondary CDN hostnames. <secondary_hostnames type="array"> <secondary_hostname>test100.com</secondary_hostname> <secondary_hostname>test200.com</secondary_hostname> </secondary_hostnames> To be able to use a secondary hostname for the CDN resource with SSL enabled, you require an SSL certificate for your custom hostname. For help with questions about the SSL certificate purchase, please contact OnApp support. ip_access_policy - configure a rule to control access to the CDN resource's content for a range of IP addresses: ALLOW_BY_DEFAULT - allow IP access policy by default, except for IP addresses specified in the ip_addresses parameter BLOCK_BY_DEFAULT - block IP access policy by default, except for IP addresses specified in the ip_addresses parameter NONE - switch off the IP access policy ip_addresses - IP address(es) related to ip_access_policy parameter; The comma-separated list of IP addresses or IP ranges allowed/blocked by default. Use the following format "10.10.10.10, 20.20.20.0/24" hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: ALLOW_BY_DEFAULT - allow hotlink policy by default, except for domains specified in the domains parameter BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. url_signing_on - set 1 to enable and protect your files from unauthorized access with a key url_signing_key - input the key for URL signing. Input letters and digits (6-32 symbols). form_pass - an array with usernames and passwords to access the resource: pass - the user password. user - the user login, which may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], underscore [ _ ], and dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated. password_unauthorized_html - text, which will be displayed in case of fail of authentication. Max 1000 chars. mp4_pseudo_on - set 1 to enable MP4 preudo streaming, otherwise set 0 flv_pseudo_on - set 1 to enable FLV preudo streaming, otherwise set 0 Nginx Settings limit_rate - sets speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s limit_rate_after - sets the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB Page History v. 4.0 Updated cdn_hostname parameter with ability to enable SSL Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource v. 3.1.1 OnApp Cloud 4.1 API Guide Added storage_server_location parameter. OnApp Cloud 4.1 API Guide https://docs.onapp.com/display/40API/Add+HTTP+Push+CDN+Resource+with+Advanced+Settings Add VoD Push CDN Resource With Advanced Settings To create new video on demand resource with advanced settings: POST /cdn_resources.xml POST /cdn_resources.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><resource_type>STREAM_VOD_PUSH</resource_type><cdn_hostname>apitest.co m </cdn_hostname><ftp_password>testpassword</ftp_password><edge_group_ids type="array"><edge_group_id>1</edge_group_id><edge_group_id>2</edge_group_id></edge_g r oup_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</dom a ins><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><secure_wowza_on>1 < /secure_wowza_on><secure_wowza_token>test123456</secure_wowza_token><storage_server_l o cation>4637643278</storage_server_location><token_auth_on>1</token_auth_on><token_aut h _secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu r JSON e_path>/Video2</token_auth_secure_path></token_auth_secure_paths><token_auth_backup_k Request example e y>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>' user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":"resource_type":"STREAM_VOD_PUSH","ftp_password":"testpassword","cdn _ hostname":"apitest.com","edge_group_ids":["1","2"],"hotlink_policy":"BLOCK_BY_DEFAULT " ,"domains":"test.com","country_access_policy":"ALLOW_BY_DEFAULT","countries":["AL","G T "],"storage_server_location":"4545566","secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdf a sga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' Where: cdn_hostname* - specify the name which will serve as a label only resource_type* - STREAM_VOD_PUSH ftp_password* - indicate the FTP server password. It should consist of 6-32 alphanumeric symbols. edge_group_ids* - indicate the ID(s) of required CDN edge groups advanced_settings* - set 1 to enable advanced settings hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter OnApp Cloud 4.1 API Guide NONE - switch off the country access policy OnApp Cloud 4.1 API Guide countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 secure_wowza_token - specify the Wowza token token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource. token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that mark streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] storage_server_location - the ID of the storage server location which should be assigned to this resource. To get the ID of the required storage server location, use the request described at the Get List of Available Storage Locations section. If no location set, the first active storage server is chosen automatically. Response You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths storage_server_location Add VoD Pull CDN Resource With Advanced Settings To create new video on demand resource with advanced settings: POST /cdn_resources.xml POST /cdn_resources.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><resource_type>STREAM_VOD_PULL</resource_type><cdn_hostname>apitest.co m .ua</cdn_hostname><origin>111.111.11.111</origin><edge_group_ids type="array"><edge_group_id>1</edge_group_id><edge_group_id>2</edge_group_id></edge_g r oup_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</dom a ins><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><secure_wowza_on>1 < /secure_wowza_on><secure_wowza_token>test123456</secure_wowza_token><token_auth_on>1< / token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_s e cure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths><token_auth_backup_k JSON e Request example y>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>' curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"resource_type":"STREAM_VOD_PULL","origin":"111.111.11.111","cdn_ho s tname":"apitest.com","edge_group_ids":["1","2"],"hotlink_policy":"BLOCK_BY_DEFAULT"," d omains":"test.com","country_access_policy":"ALLOW_BY_DEFAULT","countries":["AL","GT"] , "secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdf a sga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' Where: cdn_hostname* - specify the name which will serve as a label only resource_type* - STREAM_VOD_PULL origin* - the path from which the CDN requests the content. When using the hostnames according to RFC 1035, the origin may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], and dash [ - ]. The limit for hostname is 255 chars. The VoD Pull resource can have only one origin. edge_group_ids* - indicate the ID(s) of required CDN edge groups advanced_settings* - set 1 to enable advanced settings hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 secure_wowza_token - specify the Wowza token token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live OnApp Cloud 4.1 API Guide Streaming resource. OnApp Cloud 4.1 API Guide token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] Response You will get a response consisting of two parts - the header with HTTP status code (see Introduction for details) and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths storage_server_location Add Live Streaming CDN Resource with Advanced Settings POST /cdn_resources.xml POST /cdn_resources.json XML Request example (with internal publishing point): curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><cdn_hostname>testLV.internal</cdn_hostname><resource_type>STREAM_LIVE < /resource_type><publishing_point>internal</publishing_point><publishing_location>532< / publishing_location><failover_publishing_location>336</failover_publishing_location>< h otlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>www.google.com</domains><coun t ry_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><co u ntries>BH</countries><secure_wowza_on>1</secure_wowza_on><secure_wowza_token>4t534564 t yrt</secure_wowza_token><edge_group_ids>224</edge_group_ids><token_auth_on>1</token_a JSONuRequest example (with internal publishing point): th_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_backup_ke y >fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>' OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"cdn_hostname":"testLSJ.internal", "resource_type":"STREAM_LIVE", "publishing_point":"internal","publishing_location":"532","failover_publishing_locati o n":"336", "hotlink_policy":"BLOCK_BY_DEFAULT", "domains":"www.google.com", "country_access_policy":"ALLOW_BY_DEFAULT", "countries":["AO", "BH"], "secure_wowza_on":"1", "secure_wowza_token":"4t534564tyrt", "edge_group_ids":["224"],"token_auth_on":"1","token_auth_primary_key":"zsfdfasga","to k en_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' XML Request example (with external publishing point): curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources.xml -d '<cdn_resource><cdn_hostname>testLV1.external</cdn_hostname><resource_type>STREAM_LIV E </resource_type><publishing_point>external</publishing_point><publishing_location>http ://www.google.com</publishing_location><failover_publishing_location>rtmp://test.com/ t est</failover_publishing_location><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><d o mains>www.google.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access _ policy><countries>AO</countries><countries>BH</countries><secure_wowza_on>1</secure_w JSON o Request example (with external publishing point): wza_on><secure_wowza_token>4t534564tyrt</secure_wowza_token><edge_group_ids>224</edge _ group_ids></cdn_resource>' curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources.json -d '{"cdn_resource":{"cdn_hostname":"testLSJ.external", "resource_type":"STREAM_LIVE", "publishing_point":"external","publishing_location":"http://www.google.com","failover _ publishing_location":"rtmp://test.com/test", "hotlink_policy":"BLOCK_BY_DEFAULT", "domains":"www.google.com", "country_access_policy":"ALLOW_BY_DEFAULT", "countries":["AO", "BH"], "secure_wowza_on":"1", "secure_wowza_token":"4t534564tyrt", "edge_group_ids":["224"]}}' Where: cdn_hostname* - specify the name which will serve as a label only resource_type* - STREAM_LIVE publishing_point* - the publishing point type: external or internal publishing_location*- specify the URL address for external publishing point. Set the ID of a location that will serve as a publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters and comply with RFC2396. failover_publishing_location* - publishing point failover URL for external publishing point. Specify the ID of a location that will serve as a failover publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters, and comply with RFC2396. The failover_publishing_location can't be the same as publishing_location parameter. advanced_settings* - set 1 to enable advanced settings hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule OnApp Cloud 4.1 API Guide domains - domains related to hotlink_policy OnApp Cloud 4.1 API Guide country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 secure_wowza_token - specify the Wowza token token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource. token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] Response You will get a response consisting of two parts - the header with HTTP status code and the response body including the parameters. At this stage some of the parameters can be empty. This is expected behavior, because the full process of creation takes some time, and remote service cannot fill in the parameters at this time. For the complete list of parameters use GET request. Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths Edit CDN Resource To edit details of the CDN resource, use the following API call: PUT /cdn_resources/:id.xml PUT /cdn_resources/:id.json XML Request example curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/:id.xml' -d '<cdn_resource><edge_group_ids type="array"><edge_group_id type="integer">1</edge_group_id></edge_group_ids><origin>origin4.com</origin><cdn_hos t name>az.test.api</cdn_hostname><cdn_ssl_certificate_id>8</cdn_ssl_certificate_id></cd n _resource>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_resources/:id.json' -d '{"cdn_resource":{"edge_group_ids":["12"],"origin":"1.1.1.1","cdn_hostname":"CORE3606 -2.com", "cdn_ssl_certificate_id":"8"}}' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. Where you can edit all strings: origin* - the path from which the CDN requests the content (for HTTP Pull DN resources only). You can specify up to 3 origins. When you are specifying only one origin, it can be either a CDN hostname or an IP address. In case you are specifying more than one origin, they can only be IP addresses. To send two or more origins in the API request, use array. For example: <origins type="array"> <origin>111.111.11.111</origin> <origin>111.111.11.111</origin> </origins> cdn_hostname - indicate the hostname which will serve static content edge_group_ids - indicate the ID(s) of required CDN edge groups Edit HTTP Pull CDN Resource with Advanced Settings To edit HTTP Pull CDN resource: PUT /cdn_resources/:cdn_resource_id.xml PUT /cdn_resources/:cdn_resource_id.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/cdn_resources/12710.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<cdn_resource><cdn_hostname>testnewnewpull.qwe</cdn_hostname><origin>111.111.11.111< / origin><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id>225</edge_group_id></edge_group_ids><secondary_hostnames type="array"><secondary_hostname>test100.com</secondary_hostname><secondary_hostname> t est200.com</secondary_hostname></secondary_hostnames><ip_access_policy>BLOCK_BY_DEFAU L T</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_addresses><countr y _access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><hotlink_policy>AL L OW_BY_DEFAULT</hotlink_policy><domains>abuse.co.ua abuse.org</domains><url_signing_on>1</url_signing_on><url_signing_key>newurlkey</url_ s igning_key><cache_expiry>45</cache_expiry><password_on>1</password_on><form_pass><use r type="array"><string>user123new</string><string>user234new</string></user><pass type="array"><string>passw123new</string><string>passw234new</string></pass></form_pa s s><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html><flv_pseudo_on>1</flv_pseudo_on><mp4_pseudo_on > 1</mp4_pseudo_on><limit_rate>1000</limit_rate><limit_rate_after>1500</limit_rate_afte r OnApp Cloud 4.1 API Guide ><proxy_cache_key>$host$uri</proxy_cache_key><proxy_read_time_out>60</proxy_read_time _ out><proxy_connect_time_out>20</proxy_connect_time_out><http_bot_blocked>1</http_bot_ b locked><origin_policy>HTTP</origin_policy></cdn_resource>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/12711.json -d '{"cdn_resource":{"origin":"test123test.com","cdn_hostname":"jssscdn.apitestpull.com" , "cdn_ssl_certificate_id":"ssl_cert_id","edge_group_ids":["225"],"secondary_hostnames" : ["name11test.con","name21test.con"],"ip_access_policy":"ALLOW_BY_DEFAULT","ip_address e s":"10.10.5.6,125.125.125.125","country_access_policy":"BLOCK_BY_DEFAULT","countries" : ["AL","AR","GT","HR"],"hotlink_policy":"ALLOW_BY_DEFAULT","domains":"mnw.netggl.com", " url_signing_on":"1","url_signing_key":"123456789321","cache_expiry":45,"password_on": 1 ,"form_pass":{"user":["user190","user278"],"pass":["pass123","pass2348"]},"password_u n authorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","flv_pseudo_on":"1","ignore_set_cookie_on":"1","lim Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. i Where:t_rate":"150","limit_rate_after":"1","proxy_cache_key":"$host$uri","proxy_read_time_o u origin* - the path from which the CDN requests the content. When using the hostnames according to RFC 1035, the origin may consist of letters t":"60","proxy_connect_time_out":"60","http_bot_blocked":"1","origin_policy":"HTTP"}} [A-Z a-z] (case insensitive manner), digits [0-9], and dash [ - ]. The limit for hostname is 255 characters. You can specify up to 3 origins. ' cdn_hostname* - indicate the hostname which will serve static content SSL If the CDN hostname ends with '.r.worldssl.net', SSL will be enabled automatically. To disable, remove the '.r.worldssl.net' ending and send the "ssl_on":false parameter. To enable, add the '.r.worldssl.net' ending to the cdn_hostname and send the "ssl_on":true parameter. cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. edge_group_ids* - indicate the ID(s) of required CDN edge groups secondary_hostnames - an array of secondary CDN hostnames. You can add up to 7 secondary CDN hostnames. <secondary_hostnames type="array"> <secondary_hostname>test100.com</secondary_hostname> <secondary_hostname>test200.com</secondary_hostname> </secondary_hostnames> To be able to use a secondary hostname for the CDN resource with SSL enabled, you require an SSL certificate for your custom hostname. For help with questions about the SSL certificate purchase, please contact OnApp support. advanced_settings* - set 1 to enable advanced settings: ip_access_policy - configure a rule to control access to the CDN resource's content for a range of IP addresses: ALLOW_BY_DEFAULT - allow IP access policy by default, except for IP addresses specified in the ip_addresses parameter BLOCK_BY_DEFAULT - block IP access policy by default, except for IP addresses specified in the ip_addresses parameter NONE - switch off the IP access policy ip_addresses - IP address(es) related to ip_access_policy parameter; The comma-separated list of IP addresses or IP ranges allowed/blocked by default. Use the following format "10.10.10.10, 20.20.20.0/24" hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: ALLOW_BY_DEFAULT - allow hotlink policy by default, except for domains specified in the domains parameter OnApp Cloud 4.1 API Guide BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter OnApp Cloud 4.1 API Guide NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. cache_expiry - set the cache expiry time in minutes (min=1, max=71582788) url_signing_on - set 1 to enable and protect your files from unauthorized access with a key url_signing_key - input the key for URL signing. Input letters and digits (6-32 symbols). password_on - set 1 to enable and to restrict access to the resource (cdn_hostname), otherwise set 0 form_pass - an array with usernames and passwords to access the resource pass - the user password. user - the user login, which may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], underscore [ _ ], dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated. password_unauthorized_html - text, which will be displayed in case of fail of authentication. Max 1000 chars. mp4_pseudo_on - set 1 to enable MP4 pseudo streaming, otherwise set 0 flv_pseudo_on - set 1 to enable FLV pseudo streaming, otherwise set 0 ignore_set_cookie_on -set 1 to enable caching content with Set-Cookie response headers, otherwise set 0 to ignore content caching Nginx Settings limit_rate - sets speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s limit_rate_after - sets the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB proxy_read_time_out - proxy server response timeout in seconds. Maximum proxy read timeout value - 65535 seconds proxy_connect_time_out - timeout for establishing connection with proxy server in seconds. Maximum proxy connect time out value - 75 seconds. proxy_cache_key - specify the cache key. You can set the following options: $host$request_uri $host$uri $proxy_host$request_uri $proxy_host$uri http_bot_blocked - set 1 to block Google web crawling bot from indexing the CDN content (for HTTP Pull CDN resources only) origin_policy - set the parameter to choose the type of connection. Possible values are: HTTP, HTTPS, AUTO. Page history v. 4.0 Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource v. 3.3.1 Added the following parameter: origin_policy Edit HTTP Push CDN Resource with Advanced Settings To edit HTTP Push CDN resource: PUT /cdn_resources/:cdn_resource_id.xml PUT /cdn_resources/:cdn_resource_id.json OnApp Cloud 4.1 API Guide XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass http://onapp.test/cdn_resources/12712.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<cdn_resource><cdn_hostname>sfcdn.123apitest.com</cdn_hostname><cdn_ssl_certificate_ i d>ssl_sert_id</cdn_ssl_certificate_id><edge_group_ids type="array"><edge_group_id type="integer">225</edge_group_id></edge_group_ids><ftp_password>qwertyuiopqwer</ftp_ p assword><secondary_hostnames type="array"><secondary_hostname>name1nedwqwtest.con</secondary_hostname><secondary_h o stname>nafme2newqtest.con</secondary_hostname></secondary_hostnames><ip_access_policy > ALLOW_BY_DEFAULT</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_ad d resses><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><url_signing_on>1</url_signin g _on><url_signing_key>newtest12345</url_signing_key><password_on>1</password_on><form_ p ass><user type="array"><string>user123new</string><string>user234new</string></user><pass type="array"><string>passw123new</string><string>passw234new</string></pass></form_pa s s><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html><domains>example.com</domains><country_access_ p olicy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH< / JSON Request example countries><flv_pseudo_on>1</flv_pseudo_on><mp4_pseudo_on>1</mp4_pseudo_on><limit_rate > 140</limit_rate><limit_rate_after>11</limit_rate_after></cdn_resource>' curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/12713.json -d '{"cdn_resource":{"cdn_hostname":"Jcdn.apitestruhu.com","cdn_ssl_certificate_id":"ssl _ cert_id","edge_group_ids":["225"],"ftp_password":"password123","secondary_hostnames": [ "name1test12.co","name2test34.co"],"ip_access_policy":"ALLOW_BY_DEFAULT","ip_addresse s ":"10.10.5.6,125.125.125.125","country_access_policy":"BLOCK_BY_DEFAULT","countries": [ "AL","AR","GT","HR"],"hotlink_policy":"ALLOW_BY_DEFAULT","domains":"mnw.netggl12.com" , "url_signing_on":"1","url_signing_key":"new123456789321","password_on":1,"form_pass": { "user":["user190","user278"],"pass":["pass123","pass2348"]},"password_unauthorized_ht m l":"<b>You are Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. blocked!</b>","mp4_pseudo_on":"1","flv_pseudo_on":"1","limit_rate":"80","limit_rate_a Where:f ter":"13"}}' origin* - the path from which the CDN requests the content cdn_hostname* - indicate the hostname which will serve static content SSL If the CDN hostname ends with '.r.worldssl.net', SSL will be enabled automatically. To disable, remove the '.r.worldssl.net' ending and set the "ssl_on":false parameter. To enable, add the '.r.worldssl.net' ending to the cdn_hostname and set the "ssl_on":true parameter. cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource. You should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. edge_group_ids* - indicate the ID(s) of required CDN edge groups ftp_password* - indicate the FTP server password. It should consist of 6-32 alphanumeric symbols. OnApp Cloud 4.1 API Guide secondary_hostnames - an array of secondary CDN hostnames. You can add up to 7 secondary CDN hostnames. <secondary_hostnames type="array"> <secondary_hostname>test100.com</secondary_hostname> <secondary_hostname>test200.com</secondary_hostname> </secondary_hostnames> To be able to use a secondary hostname for the CDN resource with SSL enabled, you require an SSL certificate for your custom hostname. For help with questions about the SSL certificate purchase, please contact OnApp support. advanced_settings* - set 1 to enable advanced settings: ip_access_policy - configure a rule to control access to the CDN resource's content for a range of IP addresses: ALLOW_BY_DEFAULT - allow IP access policy by default, except for IP addresses specified in the ip_addresses parameter BLOCK_BY_DEFAULT - block IP access policy by default, except for IP addresses specified in the ip_addresses parameter NONE - switch off the IP access policy ip_addresses - IP address(es) related to ip_access_policy parameter; the comma-separated list of IP addresses or IP ranges allowed/blocked by default. Use the following format "10.10.10.10, 20.20.20.0/24" hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: ALLOW_BY_DEFAULT - allow hotlink policy by default, except for domains specified in the domains parameter BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink_policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. cache_expiry - set the cache expiry time in minutes url_signing_on - set 1 to enable and protect your files from unauthorized access with a key url_signing_key - input the key for URL signing. Input letters and digits (6-32 symbols). password_on - set 1, if the access to the resource is restricted; otherwise 0 form_pass - an array with usernames and passwords to access the resource pass -the user password. user - the user login, which may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], underscore [ _ ], dash [ - ].The first symbol should be alphabetic. The username cannot be duplicated. password_unauthorized_html – the message that is displayed when there is unauthorized access. Max 1000 chars. mp4_pseudo_on - set 1 to enable MP4 preudo streaming, otherwise set 0 flv_pseudo_on - set 1 to enable FLV preudo streaming, otherwise set 0 ignore_set_cookie_on -set 1 to enable caching content with Set-Cookie response headers, otherwise set 0 Nginx Settings limit_rate - sets speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/s limit_rate_after - sets the amount after which the speed of a response to a client will be limited in KB. Maximum limit rate after value -2147483647 KB OnApp Cloud 4.1 API Guide Page History OnApp Cloud 4.1 API Guide v. 4.0 Updated cdn_hostname parameter with ability to enable or disable SSL Added cdn_ssl_certificate_id parameter that enables a user to associate a custom SNI SSL certificate with a CDN resource Edit VoD Push CDN Resource with Advanced Settings To create new video on demand resource with advanced settings: PUT /cdn_resources/:cdn_resource_id.xml PUT /cdn_resources/:cdn_resource_id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.xml -d '<cdn_resource><cdn_hostname>apitest.com</cdn_hostname><ftp_password>testpassword</ft p _password><edge_group_ids type="array"><edge_group_id>466</edge_group_id><edge_group_id>1</edge_group_id></edge _ group_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</d o mains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><secure_wowza_on>1 < /secure_wowza_on><secure_wowza_token>test123456</secure_wowza_token><token_auth_on>1< / token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_b a ckup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths JSON type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu Request example r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource> curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.json -d '{"cdn_resource":{"ftp_password":"testpassword","cdn_hostname":"apitest.com","edge_gr o up_ids":["1"],"hotlink_policy":"BLOCK_BY_DEFAULT","domains":"test.com","country_acces s _policy":"ALLOW_BY_DEFAULT","countries":["AL","GT"], "secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdf a sga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. Where: cdn_hostname* - specify the name which will serve as a label only ftp_password* - indicate the FTP server password. It should consist of 6-32 alphanumeric symbols. edge_group_ids* - indicate the ID(s) of required CDN edge groups advanced_settings* - set 1 to enable advanced settings: hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter OnApp Cloud 4.1 API Guide NONE - switch off the country access policy OnApp Cloud 4.1 API Guide countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 secure_wowza_token - specify the Wowza token token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource. token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths storage_server_location Edit VoD Pull CDN Resource with Advanced Settings To create new video on demand resource with advanced settings: PUT /cdn_resources/:cdn_resource_id.xml PUT /cdn_resources/:cdn_resource_id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.xml -d '<cdn_resource><cdn_hostname>apitest.com</cdn_hostname><origin>111.111.11.111</origin > <edge_group_ids type="array"><edge_group_id>466</edge_group_id><edge_group_id>1</edge_group_id></edge _ group_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</d o mains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><secure_wowza_on>1 < /secure_wowza_on><secure_wowza_token>test123456</secure_wowza_token><token_auth_on>1< / token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_b a ckup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths JSON type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu Request example r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>' OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.json -d '{"cdn_resource":{"origin":"test.com","cdn_hostname":"ohcdn235.apitest.com","edge_gro u p_ids":["1","2"],"hotlink_policy":"BLOCK_BY_DEFAULT","domains":"test.com","country_ac c ess_policy":"ALLOW_BY_DEFAULT","countries":["AL","GT"], "secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdf a sga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. Where: cdn_hostname* - specify the name which will serve as a label only origin* - the path from which the CDN requests the content. When using the hostnames according to RFC 1035, the origin may consist of letters [A-Z a-z] (case insensitive manner), digits [0-9], and dash [ - ]. The limit for hostname is 255 chars. The VoD Pull resource can have only one origin. edge_group_ids* - indicate the ID(s) of required CDN edge groups advanced_settings* - set 1 to enable advanced settings: hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 secure_wowza_token - specify the Wowza token token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource. token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths storage_server_location OnApp Cloud 4.1 API Guide Edit Live Streaming CDN Resource with Advanced Settings OnApp Cloud 4.1 API Guide PUT /cdn_resources/:id.xml PUT /cdn_resources/:id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.xml -d '<cdn_resource><cdn_hostname>apitest.com</cdn_hostname><edge_group_ids type="array"><edge_group_id>1</edge_group_id><edge_group_id>1</edge_group_id></edge_g r oup_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>test.test.com</doma i ns><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><secure_wowza_on>1 < /secure_wowza_on><secure_wowza_token>test123456</secure_wowza_token><publishing_point > external</publishing_point><publishing_location>rtmp://teststream.com</publishing_loc ation><failover_publishing_location>rtmp://teststream2.com</failover_publishing_locat ion><token_auth_on>1</token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_pri m ary_key><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_sec u re_paths JSONtype="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secu Request example r e_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>' curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/cdn_resources/:cdn_resource_id.json -d '{"cdn_resource":{"cdn_hostname":"apitest.com","edge_group_ids":["466"],"hotlink_poli c y":"BLOCK_BY_DEFAULT","domains":"test.test.com","country_access_policy":"ALLOW_BY_DEF A ULT","countries":["AL","GT"],"secure_wowza_on":"1","secure_wowza_token":"test123456", " publishing_point":"external", "publishing_location":"rtmp://teststream.com","failover_publishing_location":"rtmp:// teststream2.com","token_auth_on":"1","token_auth_primary_key":"zsfdfasga","token_auth _secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. Where: cdn_hostname* - specify the name which will serve as a label only edge_group_ids* - indicate the ID(s) of required CDN edge groups advanced_settings* - set 1 to enable advanced settings: hotlink_policy - configure hotlink policy properties to protect your content from unauthorized hotlinking: BLOCK_BY_DEFAULT - block hotlink_policy by default, except for domains specified in the domains parameter NONE - switch off the rule domains - domains related to hotlink policy country_access_policy - configure a rule to control access to the CDN resource's content for specified countries: ALLOW_BY_DEFAULT - allow country access policy by default, except for countries specified in the countries parameter BLOCK_BY_DEFAULT - block country access policy by default, except for countries specified in the countries parameter NONE - switch off the country access policy countries - country codes, related to country_access_policy in ISO 3166-1 alpha-2 format. secure_wowza_on - set 1 to enable secure Wowza streaming encryption, otherwise set 0 OnApp Cloud 4.1 API Guide secure_wowza_token - specify the Wowza token publishing_point* - the publishing point type: external or internal publishing_location*- specify the URL address for external publishing point. Set the ID of a location that will serve as a publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters and comply with RFC2396. failover_publishing_location* - publishing point failover URL for external publishing point. Specify the ID of a location that will serve as a failover publishing point for internal type. For external type, the field can't be blank, must begin with 'rtmp', contain maximum 255 characters, and comply with RFC2396. The failover_publishing_location can't be the same as publishing_location parameter. token_auth_on - indicate whether Token Authentication is enabled for this resource. It's only supported for VoD PUSH, VoD PULL, and Live Streaming resource. token_auth_primary_key - set primary key to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. This must not be blank if token_auth_on is enabled. token_auth_backup_key - set backup key (optional) to encrypt Token Authentication security parameters to generate token for streaming playback. This same key is used to decrypt (if primary key failed) the token at Wowza Server. The key must be alphanumeric with length 6 to 32 characters. token_auth_secure_paths - set secure paths that marks streaming to these paths requires a valid token to play a stream. Include only the relative path that appears after the content access point. If undefined, forward slash (/) will be set, means the resource is secured at root level and all streaming request to the resource will be granted only if the provided token is valid. Example - ["/video1", "/video2"] Page History v.3.3.1 adds the following parameters: token_auth_on token_auth_primary_key token_auth_backup_key token_auth_secure_paths Delete CDN Resource To delete a CDN resource: DELETE /cdn_resources/:id.xml DELETE /cdn_resources/:id.json XML Request example curl -i -X DELETE -u user:userpass http://onapp.test /cdn_resources/:id.xml JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/cdn_resources/:id.json Where you have to specify ID of a CDN resource you want to delete. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CDN resource with a requested ID, or URL is incorrect. Change CDN Resource FTP Password Using the following request, you can change FTP password of HTTP Push and VoD PUSH resources: PUT /cdn_resources/:cdn_resource_id.xml PUT /cdn_resources/:cdn_resource_id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/cdn_resources/:cdn_resource_id.xml -d '<cdn_resource><ftp_password>pass-w+123</ftp_password></cdn_resource>' JSON Request example curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url http://test.onap.com/cdn_resources/:cdn_resource_id.json d '{"cdn_resource":{"ftp_password":"pass-w+123"}}' Where: cdn_resource_id - CDN resource ID ftp_password - required FTP password Prefetch CDN Resource Content To pre-populate HTTP PULL and PUSH content to the CDN, use the following API call: POST /cdn_resources/:id/prefetch.xml POST /cdn_resources/:id/prefetch.json PLEASE NOTE: You can only prefetch content of HTTP CDN resources. You can use prefetch CDN resouce content API requests with entry slashes: <prefetch_paths>/home/123.jpeg</prefetch_paths> as well as without them: <prefetch_paths>home/123.jpeg</prefetch_paths> XML Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.xml -d '<prefetch_paths>/home/123.jpeg</prefetch_paths>' -H 'Accept:application/xml' H 'Content-type:application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.json -d '{"prefetch_paths":"/home/123.jpeg"}' -H 'Accept:application/json' H 'Content-type:application/json' Where: prefetch_path *– path to the file you want to prefetch To prefetch an array of paths: XML Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.xml -d '<prefetch_paths type="array"><prefetch_path>/ui3/test1</prefetch_path><prefetch_path>/ui3/test2</pref e tch_path><prefetch_path>/ui3/test3</prefetch_path><prefetch_path>/ui3/test4</prefetch _ path></prefetch_paths>' -H 'Accept:application/xml' -H 'Contenttype:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/prefetch.json -d '{"prefetch_paths":["/ui3/test1","/ui3/test2","/ui3/test3","/ui3/test4"]}' H 'Accept:application/json' -H 'Content-type:application/json' Purge CDN Resource Content To remove content from HTTP Pull and PUSH cache, use the following request: POST /cdn_resources/:id/purge.xml POST /cdn_resources/:id/purge.json PLEASE NOTE: You can only purge content of HTTP CDN resources. <purge_paths>/home/123.jpeg</purge_paths> You can use purge CDN resouce content API requests with entry slashes: as well as without them: OnApp Cloud 4.1 API Guide <purge_paths>home/123.jpeg</purge_paths> XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/purge.xml -d '<purge_paths>/home/123.jpeg</purge_paths>' -H 'Accept:application/xml' H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:cdn_resource_id/purge.json -d '{"purge_paths":"/home/123.jpeg"}' -H 'Accept:application/json' H 'Content-type:application/json' Where: purge_path – path to the content you want to remove To purge an array of paths: XML Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.xml -d '<purge_paths type="array"><purge_path>/ui3/test1</purge_path><purge_path>/ui3/test2</purge_path><p u rge_path>/ui3/test3</purge_path><purge_path>/ui3/test4</purge_path></purge_paths>' -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.json d '{"purge_paths":["/ui3/test1", "/ui3/test2", "/ui3/test3", "/ui3/test4"]}' -H 'Accept:application/json' -H 'Content-type:application/json' Where you have to specify an array of paths to the content you want to remove. To purge all content: XML Request example curl -i -u user:userpass -X POST http://onapp.test/cdn_resources/:cdn_resource_id/purge_all.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass -X POST http://onapp.test/cdn_resources/:cdn_resource_id/purge_all.json -H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where you have to specify a CDN resource ID. OnApp Cloud 4.1 API Guide If you are using version 3.0 or earlier, use the folowing request: XML Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.xml -d '<purge_paths>/ui3/test1\r\n/ui3/test2\r\n/ui3/test3\r\n/ui3/test4</purge_paths>' H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/cdn_resources/:id/purge.json d '{"purge_paths":"/ui3/test1\r\n/ui3/test2\r\n/ui3/test3\r\n/ui3/test4"}' -H 'Accept:application/json' -H 'Content-type:application/json' View CDN Resource Bandwidth Statistics To get bandwidth statistics for the resources or a particular resource, use the following request: GET /cdn_resources/bandwidth.xml GET /cdn_resources/bandwidth.json Bandwidth statistics is returned in gigabytes in the SI format (1 GB = 1000 MB). You can also define a shorter period, specify a particular resource or location, set the type and specify how to sort the result returned: XML Request example curl -i -X GET -u user:userpass "http://onapp.test/cdn_resources/bandwidth.xml" -d '<bandwidth><type>GB</type><group_by>location</group_by><start>2014-1125T18:25</start ><end>2014-11-27T11:43</end><locations type="array"><location>532</location><location>331</location></locations><resources type = "array"><resource>977655738</resource><resource>389478438</resource><resource>7256187 1 4</resource></resources></bandwidth>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url "http://onapp.test/cdn_resources/bandwidth.json" -d '{"bandwidth":{"start":"2014-11-25T18:25","end":"2014-1127T11:43","resources":[977655 738,389478438,725618714], "locations":[532,331],"type":"GB", "group_by":"location"}}' Where: start – the start date to generate statistics in the YYYY-MM-DD+hh:mm:ss format end – the end date to generate statistics in the YYYY-MM-DD+hh:mm:ss format OnApp Cloud 4.1 API Guide resources – the identifier of the resource in Aflexi database. To get the identifier, check with cdn_reference parameter in the GET /cdn_resources/:id.{format} request locations – the ID of the location type – the statistics type (MBPS or GB). In MBPS mode you can get statistics for the last 10 days only. The older statistics is removed. There are no restrictions for GB mode. group_by - to get the bandwidth statistics breaking down per location or per resource via API, use the group_by parameter with two possible values: location and resource. In case group_by = location bandwidth stats is breaking down per location, and if group_by = resource is breaking down per resource. This is the optional parameter. XML output example with resources grouped by resource: OnApp Cloud 4.1 API Guide Status: 200 OK Connection: close Transfer-Encoding: chunked Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <stats type="array"> <stat> <date type="datetime">2014-11-26T18:25:00+02:00</date> <resources type="array"> <resource> <977655738> <cached type="float">1.4193601249999999</cached> <non_cached type="float">0.0</non_cached> </977655738> </resource> <resource> <389478438> <cached type="float">1.4193601249999999</cached> <non_cached type="float">0.0</non_cached> </389478438> </resource> </resources> </stat> <stat> <date type="datetime">2014-11-25T18:25:00+02:00</date> <resources type="array"> <resource> <977655738> <cached type="float">0.425808015</cached> <non_cached type="float">0.047311991</non_cached> </977655738> </resource> <resource> <725618714> <cached type="float">1.187458449</cached> <non_cached type="float">0.13193981700000001</non_cached> </725618714> </resource> <resource> <389478438> <cached type="float">0.425808007</cached> <non_cached type="float">0.047311991</non_cached> </389478438> </resource> </resources> </stat> </stats> XML request example with resources without group_by parameter: OnApp Cloud 4.1 API Guide Status: 200 OK Connection: close Transfer-Encoding: chunked Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <stats type="array"> <stat> <date type="datetime">2014-11-25T18:25:00+02:00</date> <cached type="float">2.0390744709999997</cached> <non_cached type="float">0.22656379899999998</non_cached> </stat> <stat> <date type="datetime">2014-11-26T18:25:00+02:00</date> <cached type="float">2.8387202499999997</cached> <non_cached type="float">0.0</non_cached> </stat> </stats> Where: non_cached – the amount of content which is not cached cached – the amount of data cached date – the point of time for which the statistics is generated The frequency of the points of time for which the statistics is generated depends on the period of time of requested statistics: Time Period Frequency in seconds Equivalent 0 - 30 days 86400 1 day 31 - 93 days 604800 1 week equal or more than 93 days 1209600 2 weeks Statistics available in the frequency higher than selected will be accumulated to a single point of applicable frequency. E.g. The statistics was requested for the period of 31-93 days, so the frequency of points in the graph is 7 days. If the statistics was generated few times during those 7 days (day1+day2+dayn) it will be added up and displayed as a single point, with a time stamp marked as the first day of such 7 days. View CDN Resource Streaming Statistics To gview streaming statistics for the live streaming CDN resources or a particular resource, use the following request: GET/cdn_resources/stream_stats.xml GET/cdn_resources/stream_stats.json You can also define a shorter period, specify a particular resource or location and set the type: GET /cdn_resources/stream_stats.xml?start=2011-09-01&end=2012-09-01&resources[\]=787341593&locations[\]=18 GET /cdn_resources/stream_stats.json?start=2011-09-01&end=2012-0901&resources[\]=787341593&locations[\]=18 OnApp Cloud 4.1 API Guide PLEASE NOTE: In Bash shell you have to use backslashes to enclose square brackets (see example below): OnApp Cloud 4.1 API Guide resources\[\]=787341593&locations\[\] Where: start – the start date to generate statistics in the YYYY-MM-DD format end – the end date to generate statistics in the YYYY-MM-DD format resources – the identifier of the resource in Aflexi database. To get the identifier, check with cdn_reference parameter in the GET /cdn_resources/:id.{format} request locations – the ID of the location View CDN Resource Billing Statistics To view billing statistics for a resource: GET /cdn_resources/:id/billing.xml GET /cdn_resources/:id/billing.json You can also define a shorter period by setting Start and End date (set use_local_time to 1 to use local time): GET /cdn_resources/:id/billing.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:m m:ss&period[use_local_time]=1 GET /cdn_resources/:id/billing.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh: mm:ss&period[use_local_time]=1 XML Output example: OnApp Cloud 4.1 API Guide HTTP/1.1 200 OK Date: Thu, 01 Nov 2012 08:46:57 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9 X-UA-Compatible: IE=Edge,chrome=1 ETag: "5639dcb4af97cc6b5614f0e7102414a6" Cache-Control: must-revalidate, private, max-age=0 X-Request-Id: b4aa84f305441fa8e791a2b597ed0c8e X-Runtime: 0.064716 X-Rack-Cache: miss Set-Cookie: _session_id=e01cb0aac4fc66becbd5bb294966d12e; path=/; HttpOnly Status: 200 Connection: close Transfer-Encoding: chunked Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <user_hourly_stats type="array"> <user_hourly_stat> <cost type="float">1.51980002556229e-05</cost> <edge_group_id type="integer">78</edge_group_id> <edge_group_label>OH_203</edge_group_label> <stat_time type="datetime">2012-10-10T14:00:00+03:00</stat_time> <value type="decimal">0.0</value> </user_hourly_stat> </user_hourly_stats> Where: cost - the total due for this resource edge_group_id – the ID of the edge group edge_group_label – the label of the edge group stat_time - time when the statistics was gathered value - traffic value View CDN Resource Raw Log Configuration To view the raw log configuration, use the following request: GET /cdn_resources/raw_log.xml GET /cdn_resources/raw_log.json XML Request Example: curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url "http://onapp.test/cdn_resources/raw_log.xml" JSON Request Example: curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url "http://onapp.test/cdn_resources/raw_log.json" OnApp Cloud 4.1 API Guide XML Response Example: OnApp Cloud 4.1 API Guide Disabled: <raw_log> <protocol></protocol> </raw_log> Where: protocol - delivery protocol For the FTP/SFTP delivery protocol: <raw_log> <protocol>ftp</protocol> <uri>rawlog.com</uri> <user>username</user> <pass>password</pass> </raw_log> Where: protocol - delivery protocol uri - the hostname of the server to which the log will be delivered user - the user name of the FTP/SFTP client on the server to which the log will be delivered pass - the password of the FTP/SFTP client on the server to which the log will be delivered For the Syslog delivery protocol: <raw_log> <protocol>syslog</protocol> <uri>rawlog.com</uri> <syslog_protocol>tcp</syslog_protocol> <port>80</port> </raw_log> Where: protocol - delivery protocol uri - the hostname of the server to which the log will be delivered syslog_protocol - the protocol that will be used for sending the log: TCP or UDP port - the port number of the syslog the server to which the log will be delivered Edit CDN Resource Raw Log Configuration To edit the raw log configuration, use the following request: POST /cdn_resources/raw_log.json POST /cdn_resources/raw_log.json To disable raw logs: XML Request Example: OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url 'http://onapp.test/cdn_resources/raw_log.xml' -d '<raw_log><protocol/></raw_log>' JSON Request Example: curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url 'http://onapp.test/cdn_resources/raw_log.json' -d '{"raw_log":{"protocol":""}}' Where: protocol - delivery protocol To configure the FTP/SFTP delivery protocol: XML Request Example: curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/raw_log.xml' -d '<raw_log><protocol>ftp</protocol><uri>rawlog.com</uri><user>password</user><pass>pas s word</pass></raw_log>' JSON Request Example: curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_resources/raw_log.json' -d '{"raw_log":{"protocol":"ftp","uri":"rawlog.com","user":"username","pass":"password"} } ' Where: protocol - delivery protocol uri - the hostname of the server to which the log will be delivered user - the user name of the FTP/SFTP client on the server to which the log will be delivered pass - the password of the FTP/SFTP client on the server to which the log will be delivered To configure the Syslog delivery protocol: XML Request Example: curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/raw_log.xml' -d '<raw_log><protocol>syslog</protocol><uri>rawlog.com</uri><syslog_protocol>tcp</syslo g _protocol><port>80</port></raw_log>' JSON Request Example: OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_resources/raw_log.json' -d '{"raw_log":{"protocol":"syslog","uri":"rawlog.com","syslog_protocol":"tcp","port":"8 0 "}}' Where: protocol - delivery protocol uri - the hostname of the server to which the log will be delivered syslog_protocol - the protocol that will be used for sending the log: TCP or UDP port - he port number of the syslog server to which the log will be delivered Get Instruction for Live Streaming CDN Internal Resource GET /cdn_resources/:cdn_resource_id/instructions.xml GET /cdn_resources/:cdn_resource_id/instructions.json XML Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/:id/instructions.xml Json Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/:id/instructions.json XML Response example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <cdn_resource> <cdn_hostname>LV.Inter</cdn_hostname> <cname>881661104.r.worldcdn-beta.net</cname> <created_at>2013-08-06T16:21:45+03:00</created_at> <id type="integer">11639</id> <resource_type>STREAM_LIVE</resource_type> <updated_at>2013-08-06T16:39:30+03:00</updated_at> <user_id type="integer">20</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <cdn_reference type="integer">881661104</cdn_reference> <publishing_point>internal</publishing_point> <instructions> <streaming> <credentials> <username>P881661104</username> <password>bUHzhj61MG</password> <stream>mystream</stream> </credentials> <urls> <fms>rtmp://881661104.publishstream.worldcdn-beta.net/P881661104</fms> <backup>rtmp://backup.881661104.publishstream.worldcdn-beta.net/P881661104</backup> </urls> </streaming> <publishing> <urls> <smil>http://video.worldcdn-beta.net/881661104/mystream.smil</smil> <apple_http_live_streaming>http://video.worldcdn-beta.net/881661104/_definst_/mystream .m3u8</apple_http_live_streaming> <adobe_http_dynamic_streaming>http://video.worldcdnbeta.net/881661104/_definst_/mystr eam.f4m</adobe_http_dynamic_streaming> <microsoft_smooth_streaming>http://video.worldcdnbeta.net/881661104/_definst_/mystrea m.ism</microsoft_smooth_streaming> </urls> </publishing> </instructions> </cdn_resource> Where: cdn_hostname* - indicate the hostname which will serve the content cname - a CNAME for the CDN Hostname which can then be used to view the contents. resource_type - the Stream Live resource id - the ID of the resource user_id - the user ID last_24h_cost - cost of the resource for the last 24 hours. cdn_reference - the ID in OnApp Dashboard OnApp Cloud 4.1 API Guide publishing_point - - the publishing point type: internal OnApp Cloud 4.1 API Guide instructions - the array of parameters for embedding video and enabling live streaming for Live Streaming CDN resources. credentials - the array with user credentials: username - the user log in password - the user password stream - the stream name urls - the array with URLs fms - the FMS URL backup - the Backup URL smil - The SMIL playlist provides an RTMP URL and should be used with Flash-based players only. apple_http_live_streaming - This returns a 302 redirect to a Apple HLS manifest and should be used with Apple HLS-compatible players only. adobe_http_dynamic_streaming - This returns an Adobe HDS manifest and should be used with Adobe HDS-compatible players only. microsoft_smooth_streaming - This returns a 302 redirect to Smooth Streaming manifest and should be used with Smooth Streaming-compatible players only. Search CDN Resource To search for a specific CDN resource, use the following request: GET /cdn_resources.xml?q=search_param GET /cdn_resources.json?q=search_param The request will search the CDN hostname, origin (both the hostname and an IP address, including redundant origins). For Live Stream CDNs, the request searches the pattern inside Publishing Location fields (main and failover) and Aflexi ID. XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/cdn_resources.xml?q=111.111.111.1 JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/cdn_resources.json?q=111.111.111.1 The example request will search all the CDN resources where the 111.111.111.1 IP is used. XML output example: OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <cdn_resources type="array"> <cdn_resource> <cdn_hostname>oldtestnewnewpull.qwe</cdn_hostname> <cname>438335686.r.worldcdn-beta.net</cname> <created_at type="datetime">2013-07-29T13:58:55+03:00</created_at> <id type="integer">10375</id> <resource_type>HTTP_PULL</resource_type> <updated_at type="datetime">2013-08-20T17:18:21+03:00</updated_at> <user_id type="integer">20</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <cname>438335686.r.worldcdn-beta.net</cname> <cdn_reference type="integer">438335686</cdn_reference> <origins type="array"> <origin>111.111.11.111</origin> </origins> </cdn_resource> </cdn_resources> Where: cdn_hostname - the hostname which will serve static content cname - CNAME record created_at - the date when the resource was created id – the resource ID in the database resource_type – HTTP PULL or PUSH updated_at – the date when the resource was updated user_id – the ID of the user, who owns the resource last_24h_cost – the amount of money owed for the resource for the last 24 hours. cdn_reference - the identifier in database origins – the path from which the CDN requests the content Suspend CDN Resource To suspend a specific CDN resource, use the following request: PUT /cdn_resources/resource_id/suspend.xml PUT /cdn_resources/resource_id/suspend.json XML Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/cdn_resources/resource_id/suspend.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example: OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass --url http://onapp.test/cdn_resources/resource_id/suspend.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: resource_id - the ID of the CDN resource which you wish to suspend. You will get a 204 status response on success, and 404 if there is no such CDN Resource with a requested ID or you entered incorrect ID. Resume CDN Resource To resume a specific suspended CDN resource, use the following request: PUT /cdn_resources/resource_id/resume.xml PUT /cdn_resources/resource_id/resume.json XML Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/cdn_resources/resource_id/resume.xml -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example: curl -i -X PUT -u user:userpass --url http://onapp.test/cdn_resources/resource_id/resume.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: resource_id - the ID of the CDN resource which you wish to resume. You will get a 204 status response on success, and 404 if there is no such CDN Resource with a requested ID or you entered incorrect ID. View CDN Advanced Reporting To view CDN advanced reporting for HTTP PULL and HTTP PUSH resources: GET /cdn_resources/resource_id/advanced_reporting.xml GET /cdn_resources/resource_id/advanced_reporting.json OnApp Cloud 4.1 API Guide Get Advanced Bandwidth Reporting (including Cache utilization) XML request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/resource_id/advanced_reporting.xml -d '<report><start>YYYY-MM-DD HH:MM:SS</start><end>YYYY-MM-DD HH:MM:SS</end><locations type="array"><location>location_id</location></locations></report>' -H 'Contenttype: application/xml' Get Advanced Bandwidth Reporting (including Cache utilization) JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/resource_id/advanced_reporting.json d '{"report":{"start":"YYYY-MM-DD HH:MM:SS","end":"YYYY-MM-DD HH:MM:SS","locations":["location_id"]}}' -H 'Accept: application/json' H 'Content-type: application/json' Where: report - the array with the time points for generating statistics start- the start date of the period for which the statistics should be generated end - the end date of the period for which the statistics should be generated locations - the location ID for which the statistics should be generated The default request returns Bandwidth and Caching report for the last five days covering all Locations. Default XML Request: curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/resource_id/advanced_reporting.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' Get Advanced Status Codes Reporting XML API request example: (for HTTP Pull request only) curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/resource_id/advanced_reporting.xml -d '<report><stats_type>status_codes</stats_type><start>YYYY-MM-DD HH:MM:SS</start><end>YYYY-MM-DD HH:MM:SS</end><locations type="array"><location>location_id</location></locations></report>' -H 'Contenttype: application/xml' Get Advanced Status Codes Reporting Json API request example: (for HTTP Pull request only) OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass http://onapp.test/cdn_resources/resource_id/advanced_reporting.json -d '{"report":{"stats_type":"status_codes", "start":"YYYY-MM-DD HH:MM:SS","end":"YYYY-MM-DD HH:MM:SS","locations":["location_id"]}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: report - the array with the time points for generating statistics stats_type* - required parameter, in this case status_codes start - the start date of the period for which the statistics should be generated end - the end date of the period for which the statistics should be generated locations - the location ID for which the statistics should be generated Get List of Available Storage Locations To create a CDN PUSH resource, it is necessary to specify a storage location. To view the list of available storage locations, run the following request: GET /cdn_resources/available_storage_server_locations.xml GET /cdn_resources/available_storage_server_locations.json XML Request Example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url "http://onapp.test/cdn_resources/available_storage_server_locations.xml?type=streamin g &only_active=false" Json Request Example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url "http://onapp.test/cdn_resources/available_storage_server_locations.json?type=streami n g&only_active=false" Where type - the optional parameter which describes the Storage Server's type - streaming or http; only_active - the optional parameter which describes the Storage Server's status (only_active = true if only all active SSs or only_active = false if all the available SSs ). On success HTTP 200 status is returned. OnApp Cloud 4.1 API Guide XML Response Example: OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <storage_server_locations type="array"> <storage_server_location> <city>Kolin</city> <country>CZ</country> <id type="integer">816382921</id> <storage_server> <id type="integer">670906719</id> <status>ACTIVE</status> <http_push_on type="boolean">false</http_push_on> <vod_push_on type="boolean">true</vod_push_on> </storage_server> </storage_server_location> </storage_server_locations> Where: city - the city where the storage server is located country - the country where the storage server is located id - the ID of the location storage_server - the array of the storage server details id - the ID of the storage server status - the status of the storage server http_push_on vod_push_on CDN SSL Certificates OnApp customers can import their own SSL certificates with the Subject Name Indication (SNI) extension. One SSL certificate can be associated with several CDN resources, but a resource can only be linked to one SSL certificate. However, some of the older browsers do not support SNI. In this case, users who prefer browsers that do not support SNI can purchase an SSL certificate and the SAN solution will be applied. On questions about the SSL certificate purchase, please contact OnApp support. For the list of browsers that do not support SNI, kindly refer to the Server Name Indication article. OnApp currently supports the following types of certificates: domain-validated (DV) certificate (example.com) single certificate wildcard certificate (*.example.com) SAN certificate (any domains) organization validation (OV) certificates single certificate wildcard certificate (*.example.com) SAN certificate (any domains) extended validation (EV) certificates single certificate wildcard certificate (*.example.com) SAN certificate (any domains) high-assurance certificates OnApp Cloud 4.1 API Guide This feature is available for HTTP Pull and HTTP Push resources only. To add custom SNI SSL certificates, the user needs to have CDN resources in the cloud and CDN SSL Certificates permission s. Custom SNI SSL certificates can be used for secondary hostnames. A custom SNI SSL certificate can only be associated with a CDN resource if the certificate and the resource have the same owner. When you link a resource to a certificate you should only specify the IDs of those certificates that were added by the user with whom the new resource will be associated. If you indicate some other certificate's ID an error will occur. When a custom SNI SSL certificate is associated with a CDN resource, the certificate applies only to the edge servers OnApp Cloud 4.1 API Guide subscribed to that resource. Get List of Custom SNI SSL Certificates To view the list of available custom SNI SSL certificates, use the following request: GET /cdn_ssl_certificates.xml GET /cdn_ssl_certificates.json XML Request example: curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml '--url "http://onapp.test/cdn_ssl_certificates.xml" JSON Request example: curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json ' --url "http://onapp.test/cdn_ssl_certificates.json" XML Output example: <?xml version="1.0" encoding="UTF-8"?> <cdn_ssl_certificates type="array"> <cdn_ssl_certificate> <created_at type="datetime">2015-03-25T14:20:26+00:00</created_at> <id type="integer">1</id> <name>cert3</name> <updated_at type="datetime">2015-03-25T14:20:26+00:00</updated_at> <user_id type="integer">3</user_id> <cdn_reference type="integer">616544962</cdn_reference> </cdn_ssl_certificate> <cdn_ssl_certificate>...</cdn_ssl_certificate> </cdn_ssl_certificates> Where: created_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - ID of the certificate name - name of the certificate updated_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user who added the certificate cdn_reference - the ID of the certificate on the remote Aflexi server Get Custom SNI SSL Certificate Details To view the details of a custom SNI SSL certificate, use the following request: GET /cdn_ssl_certificates/:id.xml GET /cdn_ssl_certificates/:id.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml ' --url 'http://onapp.test/cdn_ssl_certificates/:id.xml' JSON Request example: curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json ' --url 'http://onapp.test/cdn_ssl_certificates/:id.json' Where: id - ID of the certificate XML Output example: <?xml version="1.0" encoding="UTF-8"?> <cdn_ssl_certificate> <created_at type="datetime">2015-04-08T03:52:00-10:00</created_at> <id type="integer">35</id> <name></name> <updated_at type="datetime">2015-04-08T03:52:00-10:00</updated_at> <user_id type="integer">30</user_id> <cdn_resources type="array"> <cdn_resource> <cdn_hostname>res1.test.com</cdn_hostname> <cdn_ssl_certificate_id type="integer">35</cdn_ssl_certificate_id> <cname>535478274.r.worldcdn-beta.net</cname> <created_at type="datetime">2014-11-25T23:29:54-10:00</created_at> <id type="integer">7401</id> <resource_type>HTTP_PULL</resource_type> <updated_at type="datetime">2015-04-09T04:30:29-10:00</updated_at> <user_id type="integer">30</user_id> <last_24h_cost type="float">0.0</last_24h_cost> <cname>535478274.r.worldcdn-beta.net</cname> <cdn_reference type="integer">535478274</cdn_reference> <origins type="array"> <origin>1.1.1.1</origin> </origins> </cdn_resource> </cdn_resources> <cdn_reference type="integer">729656986</cdn_reference> </cdn_ssl_certificate> Where: created_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - ID of the certificate name - name of the certificate updated_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - ID of the user who added the certificate cdn_resources - array of parameters related to the CDN resources associated with the certificate: cdn_hostname - the hostname that will serve static content OnApp Cloud 4.1 API Guide cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate associated with the resource OnApp Cloud 4.1 API Guide cname - CNAME record created_at - the date when the CDN resource was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - the resource ID in the database resource_type - CDN resource type updated_at - the date when the CDN resource was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user, who owns the resource last_24h_cost - the amount due for the last 24 hours cdn_reference - ID of the SSL certificate on the remote Aflexi server origin - the path from which the CDN requests the content cdn_reference - ID of the certificate on the remote Aflexi server Add Custom SNI SSL Certificate To add a custom SNI SSL certificate, use the following request: POST /cdn_ssl_certificates.xml POST /cdn_ssl_certificates.json To add custom SNI SSL certificates, the user needs to have CDN resources in the cloud and CDN SSL Certificates permissions. XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url 'http://onapp.test/cdn_ssl_certificates.xml' -d '<cdn_ssl_certificate><name>cert1</name><cert>-----BEGIN CERTIFICATE-----\r\nMIIFKzCCBBOgAwIBAgIQMvEFlcrw7X8kOaJ/Sy1eYjANBgkqhkiG9w0BAQUFADB/\r \nMQswCQYDVQQGEwJCRTEfMB0GA1UECxMWRm9yIFRlc3QgUHVycG9zZXMgT25seTEZ\r\nMBcGA1UEChMQR2x v YmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQ V QgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQ L ExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\ng g EiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkam e kCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718q I M6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231 V ITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ5 1 SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgN V HQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ 2 xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgN V HRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdod H RwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgE F BQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ 3 Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWd u \r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1C D AfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQin g Xy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskab V 0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\ n uPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsS l Q9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn 1 x+eDqw==\r\n-----END CERTIFICATE-----</cert><key>-----BEGIN RSA PRIVATE KEY----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPw QE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oG I OeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWI d gdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/Qy Q jTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs 3 OnApp Cloud 4.1 API Guide lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2 z O/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5p Y 49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHY P \r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3 e ap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H 1 9W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7 l 4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\ n Dz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/ g d7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABV a EEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSB u XMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80v P vXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRI Q s+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1 J xJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+ F 9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----</key></cdn_ssl_certificate>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_ssl_certificates.json' -d '{"cdn_ssl_certificate":{"name":"cert1","cert":"-----BEGIN CERTIFICATE-----\r\nMIIFKzCCBBOgAwIBAgIQMvEFlcrw7X8kOaJ/Sy1eYjANBgkqhkiG9w0BAQUFADB/\r \nMQswCQYDVQQGEwJCRTEfMB0GA1UECxMWRm9yIFRlc3QgUHVycG9zZXMgT25seTEZ\r\nMBcGA1UEChMQR2x v YmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQ V QgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQ L ExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\ng g EiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkam e kCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718q I M6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231 V ITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ5 1 SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgN V HQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ 2 xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgN V HRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdod H RwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgE F BQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ 3 Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWd u \r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1C D AfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQin g Xy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskab V 0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\ n uPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsS l Q9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn 1 x+eDqw==\r\n-----END CERTIFICATE-----","key":"-----BEGIN RSA PRIVATE KEY----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPw QE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oG I OeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWI d gdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/Qy Q jTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs 3 OnApp Cloud 4.1 API Guide lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2 z O/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5p Y 49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHY P \r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3 e ap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H 1 9W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7 l 4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\ n Dz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/ g d7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABV a EEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSB u XMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80v P vXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRI Q s+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1 J xJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+ F 9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----"}}' Where: name - the name of the certificate cert - the certificate key key - the SSL key issued by your SSL provider Every line must be separated by \r\n. Make sure there are no spaces between lines of cert and key. Except delimiters: OnApp Cloud 4.1 API Guide -----BEGIN CERTIFICATE---------END CERTIFICATE---------BEGIN RSA PRIVATE KEY---------END RSA PRIVATE KEY----- Edit Custom SNI SSL Certificate To update a custom SNI SSL certificate, use the following request: PUT /cdn_ssl_certificates/:id.xml PUT /cdn_ssl_certificates/:id.xml XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url 'http://onapp.test/cdn_ssl_certificates/:id.xml' '<cdn_ssl_certificate><name>cert1</name><cert>-----BEGIN CERTIFICATE-----\r\nMIIFKzCCBBOgAwIBAgIQMvEFlcrw7X8kOaJ/Sy1eYjANBgkqhkiG9w0BAQUFADB/\r \nMQswCQYDVQQGEwJCRTEfMB0GA1UECxMWRm9yIFRlc3QgUHVycG9zZXMgT25seTEZ\r\nMBcGA1UEChMQR2x v YmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQ V QgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQ L ExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\ng g EiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkam e kCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718q I M6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231 V ITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ5 1 SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgN V HQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ 2 xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgN V HRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdod H RwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgE F BQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ 3 Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWd u \r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1C D AfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQin g Xy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskab V 0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\ n uPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsS l Q9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn 1 x+eDqw==\r\n-----END CERTIFICATE-----</cert><key>-----BEGIN RSA PRIVATE KEY----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPw QE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oG I OeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWI d gdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/Qy Q jTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs 3 OnApp Cloud 4.1 API Guide lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2 z O/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5p Y 49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHY P \r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3 e ap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H 1 9W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7 l 4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\ n Dz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/ g d7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABV a EEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSB u XMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80v P vXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRI Q s+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1 J xJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+ F 9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----</key></cdn_ssl_certificate>' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url 'http://onapp.test/cdn_ssl_certificates/:id.json' -d '{"cdn_ssl_certificate":{"name":"cert1","cert":"-----BEGIN CERTIFICATE-----\r\nMIIFKzCCBBOgAwIBAgIQMvEFlcrw7X8kOaJ/Sy1eYjANBgkqhkiG9w0BAQUFADB/\r \nMQswCQYDVQQGEwJCRTEfMB0GA1UECxMWRm9yIFRlc3QgUHVycG9zZXMgT25seTEZ\r\nMBcGA1UEChMQR2x v YmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQ V QgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQ L ExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\ng g EiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkam e kCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718q I M6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231 V ITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ5 1 SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgN V HQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ 2 xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgN V HRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdod H RwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgE F BQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ 3 Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWd u \r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1C D AfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQin g Xy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskab V 0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\ n uPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsS l Q9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn 1 x+eDqw==\r\n-----END CERTIFICATE-----","key":"-----BEGIN RSA PRIVATE KEY----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPw QE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oG I OeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWI d gdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/Qy Q jTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs OnApp Cloud 4.1 API Guide 3 lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2 z O/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5p Y 49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHY P \r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3 e ap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H 1 9W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7 l 4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\ n Dz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/ g d7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABV a EEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSB u XMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80v P vXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRI Q s+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1 J xJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+ F 9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----"}}' Where: id - ID of the certificate name - the name of the certificate cert - the certificate key key - the SSL key issued by your SSL provider Every line should be separated by \r\n. OnApp Cloud 4.1 API Guide Make sure that cert and key parameters do not contain spaces between lines. Except delimiters: -----BEGIN CERTIFICATE---------END CERTIFICATE---------BEGIN RSA PRIVATE KEY---------END RSA PRIVATE KEY----- Delete Custom SNI SSL Certificate To delete a custom SNI SSL certificate, use the following request: DELETE /cdn_ssl_certificates/:id.xml DELETE /cdn_ssl_certificates/:id.json XML Request example curl -i -X DELETE -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url 'http://onapp.test/cdn_ssl_certificates/:id.xml' JSON Request example curl -i -X DELETE -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url 'http://onapp.test/cdn_ssl_certificates/:id.json' Where: id - the ID of the certificate Add Custom SNI SSL Certificate to CDN Resource To add a custom SNI SSL certificate to a CDN HTTP Pull or Push resource, use the following API call: PUT /cdn_resources/:id.xml PUT /cdn_resources/:id.json XML Request example curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/:cdn_resource_id.xml' -d '<cdn_resource><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id></cdn_reso u rce>' JSON Request example curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url 'http://onapp.test/cdn_resources/:cdn_resource_id.json' d '{"cdn_resource":{"cdn_ssl_certificate_id":"ssl_cert_id"}}' Where: cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate you want to add to the resource CDN Storage Servers OnApp Cloud 4.1 API Guide A CDN storage server is a server used for storing the content to be distributed over CDN. When the content is requested on the CDN, it is served OnApp Cloud 4.1 API Guide by the edge server nearest to the customer’s geographical location. There are two types of CDN storage servers in OnApp: HTTP and Streaming. Get List of CDN Storage Servers To get the list of all CDN storage servers in the cloud, run: GET GET /storage_servers.xml /storage_servers.json XML Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.xml JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <storage_servers type="array"> <storage_server> <add_to_marketplace type="boolean">false</add_to_marketplace> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">true</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">true</booted> <built type="boolean">true</built> <cpu_shares type="integer">1</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2012-08-07T05:41:02-10:00</created_at> <customer_network_id nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hypervisor_id type="integer">12</hypervisor_id> <id type="integer">4891</id> <identifier>dgsfyze4lu9m6q</identifier> <initial_root_password>1is9qsjtsjmf</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>storage3</label> <local_remote_access_port type="integer">5903</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <recovery_mode type="boolean">false</recovery_mode> <remote_access_password nil="true"/> <state>new</state> <storage_server_type>streaming</storage_server_type> <strict_virtual_machine_id nil="true"/> OnApp Cloud 4.1 API Guide <suspended type="boolean">false</suspended> <template_id type="integer">8</template_id> OnApp Cloud 4.1 API Guide <template_label>OnApp CDN hypervisor</template_label> <updated_at type="datetime">2012-08-08T23:37:20-10:00</updated_at> <user_id type="integer">1</user_id> <vip nil="true"/> <xen_id type="integer">69</xen_id> <ip_addresses type="array"><ip_address> <address>109.123.105.189</address> <broadcast>109.123.105.191</broadcast> <created_at type="datetime">2012-04-03T06:08:07-10:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.105.177</gateway><hypervisor_id nil="true"/> <id type="integer">12</id> <ip_address_pool_id nil="true"/> <network_address>109.123.105.176</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2012-07-13T00:58:21-10:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.240</netmask> </ip_address> </ip_addresses> <total_disk_size type="integer">5</total_disk_size> OnApp Cloud 4.1 API Guide <cpu_priority type="integer">1</cpu_priority> <edge_status>Active</edge_status> </storage_server> Explanation of the data returned: add_to_marketplace – true if this storage server is added to the marketplace; otherwise false admin_note – an optional reminder for this server created by an administrator allow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise false allowed_hot_migrate – true if hot migration is allowed; otherwise false allowed_swap – true if swap is allowed; otherwise false booted – true if the server is booted; otherwise false built - true if the server is already built; otherwise false cpu_shares – the CPU priority percentage cpus – number of CPU cores allocated to this storage server created_at – the date when the CDN storage server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format edge_server_type - type of the CDN storage server enable_autoscale – false; not available for edge servers enable_monitis - deprecated attribute; will be removed in upcoming release hypervisor_id – the ID of the compute resource, on which the server is deployed id – the edge server ID in OnApp CP database identifier – the edge server identifier initial_root_password – the server root password initial_root_password_encrypted – true, if the server root password is encrypted, otherwise false label – an arbitrary name of the edge server local_remote_access_port – the port ID used for console access locked – true if locked; otherwise false memory – the amount of RAM resources allocated to this edge server min_disk_size – minimum disk space required by the template note - an optional reminder for this VS made by a user account operating_system – type of operating system operating_system_distro – the distribution of the operating system recovery_mode – true if the server is booted in the recovery mode; otherwise false remote_access_password – the password for remote access state – deprecated attribute; will be removed in upcoming release strict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this server suspended – true if suspended; otherwise false template_id – the ID of the template, on which the edge server is based template_label – label of the template on which the server is based; currently – OnApp CDN compute resource updated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide user_id – the ID of the user, who is the server owner OnApp Cloud 4.1 API Guide vip – true if the server has VIP status for migration; otherwise false xen_id – the edge server ID set by the virtualization engine ip_addresses – an array of assigned IP addresses with the following parameters: address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id disallowed_primary – true if not allowed to be used as primary (for VS build), otherwise false gateway – gateway address id –the ID of the IP address ip_address_pool_id - ID of the IP address pool network_address – the address of the network network_id –the ID of the network updated_at – the date when the Network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format free – true if free, otherwise false netmask – netmask for the IP address total_disk_size – total disk space in GB of primary and swap disks edge_status - status of the storage server cpu_priority - this is a new parameter reserved for further use; currently will have the same value as cpu_shares Get List of HTTP Storage Servers To get the list of HTTP storage servers, use the following request: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.xml?type=http JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.json?type=http For output example and parameters description, refer to Get List of CDN Storage Servers section. Get List of Streaming Storage Servers To get the list of streaming edge servers, run: XML Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.xml?type=streaming JSON Request example: curl -i -X GET -u user:userpass http://onapp.test/storage_servers.json?type=streaming For output example and parameters description, refer to Get List of CDN Storage Servers section. Get CDN Storage Server Details To view details of a particular storage server, run: XML Request example OnApp Cloud 4.1 API Guide curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:id.xml JSON Request example curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:id.json Where: id - ID of the CDN storage server XML Output example <?xml version="1.0" encoding="UTF-8"?> <storage_server> <add_to_marketplace type="boolean">false</add_to_marketplace> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">true</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">true</booted> <built type="boolean">true</built> <cpu_shares type="integer">1</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2012-08-07T05:41:02-10:00</created_at> <customer_network_id nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hypervisor_id type="integer">12</hypervisor_id> <id type="integer">4891</id> <identifier>dgsfyze4lu9m6q</identifier> <initial_root_password>1is9qsjtsjmf</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>storage3</label> <local_remote_access_port type="integer">5903</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <recovery_mode type="boolean">false</recovery_mode> <remote_access_password nil="true"/> <state>new</state> <storage_server_type>streaming</storage_server_type> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">8</template_id> <template_label>OnApp CDN hypervisor</template_label> <updated_at type="datetime">2012-08-08T23:37:20-10:00</updated_at> <user_id type="integer">1</user_id> <vip nil="true"/> OnApp Cloud 4.1 API Guide <xen_id type="integer">69</xen_id> OnApp Cloud 4.1 API Guide <ip_addresses type="array"><ip_address> <address>109.123.105.189</address> <broadcast>109.123.105.191</broadcast> <created_at type="datetime">2012-04-03T06:08:07-10:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.105.177</gateway><hypervisor_id nil="true"/> <id type="integer">12</id> <ip_address_pool_id nil="true"/> <network_address>109.123.105.176</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2012-07-13T00:58:21-10:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.240</netmask> </ip_address> </ip_addresses> OnApp Cloud 4.1 API Guide <total_disk_size type="integer">5</total_disk_size> <edge_status>Active</edge_status> </storage_server> For parameters description, refer to Get List of CDN Storage Servers section. Add CDN Storage Server To create new CDN storage server, run: POST POST /storage_servers.xml /storage_servers.json XML Request example: curl -i -X POST -d '<storage_server><label>az_CDN_test</label><cpus>1</cpus><data_store_group_primary_id > 2</data_store_group_primary_id><primary_network_group_id>3</primary_network_group_id> < cpu_shares>1</cpu_shares><memory>512</memory><required_virtual_machine_build>1</requi r ed_virtual_machine_build><hypervisor_group_id>1</hypervisor_group_id><hypervisor_id>1 < /hypervisor_id><required_ip_address_assignment>1</required_ip_address_assignment><pri m ary_disk_size>5</primary_disk_size><rate_limit>0</rate_limit><cdn_location>5</cdn_loc tion><storage_server_type>http</storage_server_type></storage_server>' -u JSON a Request example user:userpass http://onapp.test/storage_servers.xml -H 'Accept: application/xml' -H 'Content-type: curl -i -X POSTapplication/xml' -d '{"storage_server":{"label":"az_CDN_test", "cpus":"1","data_store_group_primary_id":"2","primary_network_group_id":"3","cpu_shar e s":"1" ,"memory":"512","required_virtual_machine_build":"1","hypervisor_group_id":"1","hyper v isor_id":"1","required_ip_address_assignment":"1","primary_disk_size":"5","rate_limit " :"0","cdn_location":"5","storage_server_type":"http"}}' -u user:userpass http://onapp.test/storage_servers.json -H 'Accept: application/json' -H 'Contenttype: application/json' Where: label* – a unique name of your CDN storage server. The label can consist of letters [A-Za-z], digits [0-9], dash [ - ], lower dash [ _ ], space character [ ], at sign [@], round brackets [()],slashes [/], comma [,] and dot [.]. You can use both lower- and uppercase letters. The label should begin with an alphanumeric character or lower dash [ _ ] hypervisor_id - indicate the ID of the compute resource, on which the server will be deployed hypervisor_group_id - indicate the compute zone ID cpus * - the amount of CPU cores allocated to this storage server cpu_shares * - the percentage of allocated CPU priority resource memory * - the amount of RAM, which you want to allocate to this storage server primary_disk_size * - the size in GB of the primary disk data_store_group_primary_id – specify the ID of a data store zone, where you want to locate the disk of your server. If not specified – the system will select the data store zone with higher available capacity primary_network_group_id – indicate the network zone ID OnApp Cloud 4.1 API Guide required_virtual_machine_build – set "1" to build the server automatically after creation. Otherwise set "0" OnApp Cloud 4.1 API Guide required_ip_address_assignment - set "1" if you want IP address to be assigned automatically after creation. Otherwise set "0" cdn_location - the ID of the CDN location. Use the following API call to find the ID Get List of CDN Locations for Location Group. The parameter is optional. If not set, the edge server will be assigned to the first CDN Location in its Location Group. storage_server_type - set http or streaming server type. ATTENTION! Creating a Streaming Edge or Storage server will result in an additional monthly charge. You will be charged 50$ per month for deploying this Streaming server once it is provisioned. Page History v. 3.3.1 cdn_location parameter storage_server_type Edit CDN Storage Server To edit a CDN storage server, run: PUT /storage_servers/:id.xml PUT /storage_servers/:id.json XML Request example curl -i -X PUT -d '<storage_server><label>az_CDN_test_1</label><add_to_marketplace>true</add_to_marketp l ace><cpus>1</cpus><cpu_shares>10</cpu_shares><memory>512</memory></storage_server>' -u onapp.test http://onapp.test/storage_servers/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT -d '{"storage_server":"label":"az_CDN_test_3","add_to_marketplace":"true","cpus":"1","cp u _shares":"20","memory":"512"}}' -u onapp.test http://onapp.test/storage_servers/:id.json -H 'Accept: application/json' H 'Content-type: application/json' Where: label – a unique name of your CDN storage server. The label can consist of letters [A-Za-z], digits [0-9], dash [ - ], lower dash [ _ ], space character [ ], at sign [@], round brackets [()],slashes [/], comma [,] and dot [.]. You can use both lower- and uppercase letters. The label should begin with an alphanumeric character or lower dash [ _ ] cpus - the amount of CPU cores allocated to this storage server cpu_shares - the percentage of allocated CPU priority resource memory - the amount of RAM, which you want to allocate to this storage server Returns HTTP 204 response on successful processing, and HTTP 404 when there is no storage server with a requested ID, or URL is incorrect. Reboot CDN Storage Server To reboot the storage server: OnApp Cloud 4.1 API Guide POST /storage_servers/:storage_server_id/reboot.xml POST /storage_servers/:storage_server_id/reboot.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/reboot.xm l JSON Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/reboot.jso n Start up CDN Storage Server POST /storage_servers/:storage_server_id/startup.xml POST /storage_servers/:storage_server_id/startup.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/startup.xm l JSON Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/startup.jso n Shut down CDN Storage Server POST /storage_servers/:storage_server_id/shutdown.xml POST /storage_servers/:storage_server_id/shutdown.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/shutdown.xm l JSON Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/shutdown.jso n Stop CDN Storage Server OnApp Cloud 4.1 API Guide To terminate the storage server forcefully: OnApp Cloud 4.1 API Guide POST /storage_servers/:storage_server_id/stop.xml POST /storage_servers/:storage_server_id/stop.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/stop.xm l JSON Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/stop.jso n Rebuild CDN Storage Server To rebuild (or build manually) the CDN storage server, use the following request: POST /storage_servers/storage_server_id/build.xml POST /storage_servers/storage_server_id/build.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<storage_server><template_id>8</template_id><required_startup>1</required_startup></ s torage_server>' --url http://onapp.test/storage_servers/storage_server_id/build.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"storage_server":{"template_id":"8","required_startup":"1"}}' -url http://onapp.test/storage_servers/storage_server_id/build.json Where: template_id * - the ID of the template on which this server will be based required_startup – set "1" to start up the server automatically after build, otherwise set "0" Suspend CDN Storage Server To suspend a CDN storage server, run: POST /storage_servers/:storage_server_id/suspend.xml POST /storage_servers/:storage_server_id/suspend.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/suspend.xm l OnApp Cloud 4.1 API Guide JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/suspend.jso n To unsuspend a storage server, run the request again. Unlock CDN Storage Server To unlock CDN storage server: POST /storage_servers/:storage_server_id/unlock.xml POST /storage_servers/:storage_server_id/unlock.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/unlock.xm l JSON Request example curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/unlock.jso n Set VIP Status for CDN Storage Server To give your storage server a migration priority, set the VIP status for it with the following request: POST /storage_servers/:storage_server_id/set_vip.xml POST /storage_servers/:storage_server_id/set_vip.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/set_vip.xml -d '<vip>true</vip>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/set_vip.json -d '{"vip": true}' Where: vip - whether VIP status is enabled for the server or not. Set this parameter to 'true' to enable and to 'false' to disable the VIP status. Delete CDN Storage Server OnApp Cloud 4.1 API Guide DELETE /storage_servers/:id.xml DELETE /storage_servers/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE -u user:userpass http://onapp.test/storage_servers/storage_server_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE -u user:userpass http://onapp.test/storage_servers/:storage_server_id.json -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful processing, and HTTP 404 when there is no storage server with a requested ID, or URL is incorrect. Migrate CDN Storage Server To migrate a storage server, run: POST /storage_servers/:storage_server_id/migrate.xml POST /storage_servers/:storage_server_id/migrate.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<storage_server><destination>13</destination><cold_migrate_on_rollback>1</cold_migra t e_on_rollback></storage_server>' --url http://onapp.test/storage_servers/:storage_server_id/migrate.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"storage_server":{"destination":"18","cold_migrate_on_rollback":"1"}}' --url http://onapp.test/storage_servers/:storage_server_id/migrate.json Where: destination* - the ID of a target compute resource where you migrate a storage server cold_migrate_on_rollback - set to 1 if you wish to switch to a cold migration if hot migration fails, otherwise set 0 Segregate CDN Storage Server To segregate an edge server (that is, instruct it never to reside on the same compute resource as another VS or edge server), use the following method: POST /storage_servers/:storage_server_id/strict_vm.xml POST /storage_servers/:storage_server_id/strict_vm.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<storage_server><strict_storage_server_id>l615jn0d9tlv0s</strict_storage_server_id>< / storage_server>' --url http://onapp.test/storage_servers/:storage_server_id/strict_vm.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"storage_server":{"strict_storage_server_id":"l615jn0d9tlv0s"}}' --url http://onapp.test/storage_servers/:storage_server_id/strict_vm.json Where: strict_storage_\server_id * - the ID of storage server you wish to segregate Resize CDN Storage Server To resize a CDN storage server: XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<storage_server><memory>700</memory><cpus>2</cpus></storage_server>' --url http://onapp.test/storage_servers/storage_server_id/resize.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"storage_server":{"memory":"513","cpus":"1"}}' --url http://onapp.test1/storage_servers/storage_server_id/resize.json Where: memory - the amount of RAM, which you want to allocate to this storage server cpus - the amount of CPU cores allocated to this storage server Change CDN Storage Server Owner To change owner of the CDN storage server, run: POST /storage_servers/:storage_server_id/change_owner.xml POST /storage_servers/:storage_server_id/change_owner.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass1 -d '<user_id>4</user_id>' --url http://onapp.test/storage_servers/:storage_server_id/change_owner.xml OnApp Cloud 4.1 API Guide JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"user_id":"1"}' --url http://onapp.test/storage_servers/:storage_server_id/change_owner.json Rebuild Network for CDN Storage Server It is required to rebuild network after any changes on IP address joins or network interfaces. To rebuild network, use the following request: POST /storage_servers/:storage_server_id/rebuild_network.xml POST /storage_servers/:storage_server_id/rebuild_network.json XML Request example curl -X POST -u user:userpass --url 'http://onapp.test/storage_servers/:storage_server_id/rebuild_network.xml?force=1&shu t down_type=hard&required_startup=1' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X POST -u user:userpass --url 'http://onapp.test/storage_servers/:storage_server_id/rebuild_network.json?force=1&sh u tdown_type=hard&required_startup=1' -H 'Accept: application/json' -H 'Content-type: application/json' Where: storage_server_id - ID of the storage server shutdown_type - type of the storage server shutdown: hard, graceful or soft required_startup - set 1 to start up the server automatically after build, otherwise set 0 CDN Storage Server Disks You can perform all the same actions with storage servers' disks as with VS disks, except POST and DELETE. The only difference would be in the routes for the following requests: To view the storage server disks: GET /storage_servers/:storage_server_id/disks.xml GET /storage_servers/:storage_server_id/disks.json Parameters description and output example. For other possible requests, refer to corresponding sections of Disks chapter. CDN Storage Server Network Interfaces Here is the list of API calls for managing CDN storage servers' network interfaces. The storage servers' network interfaces have the same attributes as network interfaces of virtual servers. To get the list of network interfaces allocated to the storage server: GET /storage_servers/:storage_server_id/network_interfaces.xml GET /storage_servers/:storage_server_id/network_interfaces.json To get a particular network interface details: OnApp Cloud 4.1 API Guide GET /storage_servers/:storage_server_id/network_interfaces/:id.xml GET /storage_servers/:storage_server_id/network_interfaces/:id.json To edit network interface details: PUT /storage_servers/:storage_server_id/network_interfaces/:id.xml PUT /storage_servers/:storage_server_id/network_interfaces/:id.json To add a new network interface: POST /storage_servers/:storage_server_id/network_interfaces.xml POST /storage_servers/:storage_server_id/network_interfaces.json To delete a network interface from the storage server: DELETE /storage_servers/:storage_server_id/network_interfaces/:id.xml DELETE /storage_servers/:storage_server_id/network_interfaces/:id.json Parameters description and output example. CDN Storage Server IP Address Joins An IP address allocated to a storage server is an IP address join. Use the following methods to manage IP address joins of your CDN storage servers. To get the list of IP address assignments for a particular storage server: GET /storage_servers/:storage_server_id/ip_addresses.xml GET /storage_servers/:storage_server_id/ip_addresses.json XML Request Example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.xml Json Request Example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.json To assign an IP Address to a storage server: POST /storage_servers/:storage_server_id/ip_addresses.xml POST /storage_servers/:storage_server_id/ip_addresses.json XML Request Example curl -i -X POST -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<ip_address_join><ip_address_id>7</ip_address_id><network_interface_id>113</network_ i nterface_id></ip_address_join>' --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.xml Json Request Example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"ip_address_join":{"ip_ address_id":"7", "network_interface_id":"113"}}' --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.jso n XML Response Example Status: 201 Content-Length: 1065 Connection: close Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <ip_address_join> <created_at type="datetime">2013-10-31T13:41:31+03:00</created_at> <id type="integer">174</id> <ip_address_id type="integer">7</ip_address_id> <network_interface_id type="integer">113</network_interface_id> <updated_at type="datetime">2013-10-31T13:41:31+03:00</updated_at> <ip_address> <address>1.1.1.3</address> <broadcast>1.1.1.255</broadcast> <created_at type="datetime">2013-08-07T13:29:09+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>1.1.1.1</gateway> <hypervisor_id nil="true"/> <id type="integer">7</id> <ip_address_pool_id nil="true"/> <network_address>1.1.1.0</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-07T13:29:09+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.0</netmask> </ip_address> </ip_address_join> Where: created_at - the date when the record was created in DB id - the IP address join ID ip_address_id - the IP address ID network_interface_id - the network interface ID OnApp Cloud 4.1 API Guide updated_at - the date when the record was updated in DB OnApp Cloud 4.1 API Guide ip_address - the array of IP address details address - the IP address broadcast - a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. customer_network_id - the ID of the customer network disallowed_primary - true if this address is not set as primary (for VS build), otherwise false gateway - gateway address hypervisor_id - the ID of the compute resource ip_address_pool_id - the ID of the IP address poll to which this join belongs network_address - the address of a VLAN network address that will be associated with this IP address pool network_id - the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource free - true if free, otherwise false netmask — netmask for the IP address To delete an IP address assignment from a particular storage server: DELETE storage_servers/:storage_server_id/ip_addresses/:id.xml DELETE storage_servers/:storage_server_id/ip_addresses/:id.json XML Request Example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/ip_ addresses/:ip_address_join_id.xml Json Request Example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/ip_ addresses/:ip_address_join_id.json Get CDN Storage Server CPU Usage Statistics To view CPU usage statistics of a CDN storage server, run: GET /storage_servers/:storage_server_id/cpu_usage.xml GET /storage_servers/:storage_server_id/cpu_usage.json Define a shorter period by setting Start and End time in the API call: GET /storage_servers/:storage_server_id/vm_stats.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+h h:mm:ss&period[use_local_time]=1 GET /storage_servers/:storage_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+ hh:mm:ss&period[use_local_time]=1 XML Request example: OnApp Cloud 4.1 API Guide curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/cpu_usage.xm l XML Request example: curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/cpu_usage.jso n Where you have to specify the storage server ID. Get CDN Storage Server Hourly Statistics You can view the hourly statistics for a particular storage server using the following request: GET /storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.xml GET /storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.json Define a shorter period by setting Start and End time in the API call: GET /storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.xml?period[s t artdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:mm:ss&period[use_loca l_time]=1 XML Request example GET /storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.json?period[ s tartdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:mm:ss&period[use_loc al_time]=1 XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <vm_stats type="array"> <vm_hourly_stat> <created_at type="datetime">2013-05-01T00:00:25Z</created_at> <currency_code>USD</currency_code> <id type="integer">13868</id> <stat_time type="datetime">2013-05-01T00:00:00Z</stat_time> <updated_at type="datetime">2013-05-01T00:00:25Z</updated_at> <user_id type="integer">1</user_id> <virtual_machine_id type="integer">156</virtual_machine_id> <vm_billing_stat_id type="integer">7780</vm_billing_stat_id> <total_cost type="float">0.0</total_cost> <vm_resources_cost type="float">0.0</vm_resources_cost> <usage_cost type="float">0.0</usage_cost> </vm_hourly_stat> </vm_stats> Where: created_at – the timestamp in DB when this record was created updated_at – the time stamp in DB when this record was updated currency_code - currency in which this storage server is charged within the billing plan id – the hourly statistics ID. Use this ID for retrieving the billing statistics. stat_time – the particular hour for which these statistics were generated user_id - the ID of storage server owner virtual_machine_id - ID of a storage server vm_billing_stat_id - billing statistics ID. total_cost – the total amount of money owed for the storage server specified by id parameter for a particular hour specified by stat_time parameter (total_cost = vm_resources_cost + usage_cost) vm_resources_cost – the amount of money due for the storage server resources for the particular hour specified by stat_time parameter (memory, disks, templates) usage_cost – the total due for storage server usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage) Get CDN Storage Server Billing Statistics You can view the billing statistics for a particular storage server using the following request: GET /storage_servers/:storage_server_id/vm_stats.xml GET /storage_servers/:storage_server_id/vm_stats.json OnApp Cloud 4.1 API Guide Define a shorter period by setting Start and End time in the API call: GET /storage_servers/:storage_server_id/vm_stats.xml?period[startdate]=YYYY-MM-DD+hh :mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1 OnApp Cloud 4.1 API Guide GET /storage_servers/:storage_server_id/vm_stats.json?period[startdate]=YYYY-MMDD+h h:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1 XML Output example <?xml version="1.0" encoding="UTF-8"?> <vm_stats> <created_at type="datetime">2013-05-02T06:00:27Z</created_at> <currency_code>USD</currency_code> <id type="integer">15490</id> <stat_time type="datetime">2013-05-02T06:00:00Z</stat_time> <updated_at type="datetime">2013-05-02T06:00:27Z</updated_at> <user_id type="integer">307</user_id> <virtual_machine_id type="integer">1214</virtual_machine_id> <vm_billing_stat_id type="integer">8089</vm_billing_stat_id> <billing_stats><disks type="array"> <disk> <id type="integer">2430</id> <costs type="array"> <cost> <value type="integer">100</value> <cost type="float">0.0</cost> <resource_name>disk_min_iops</resource_name> </cost> <cost> <value type="integer">5</value> <cost type="float">0.0</cost> <resource_name>disk_size</resource_name> </cost><cost><value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_read</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_written</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>reads_completed</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>writes_completed</resource_name> </cost> </costs> <label nil="true"/> </disk><disk> <id type="integer">2431</id> OnApp Cloud 4.1 API Guide <costs type="array"> <cost> OnApp Cloud 4.1 API Guide <value type="integer">100</value> <cost type="float">0.0</cost> <resource_name>disk_min_iops</resource_name> </cost> <cost> <value type="integer">1</value> <cost type="float">0.0</cost> <resource_name>disk_size</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_read</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_written</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>reads_completed</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>writes_completed</resource_name> </cost> </costs> <label nil="true"/> </disk> </disks> <network_interfaces type="array"> <network_interface> <id type="integer">1301</id> <costs type="array"> <cost> <value type="integer">1</value> <cost type="float">0.0</cost> <resource_name>ip_addresses</resource_name> </cost> <cost> <value type="integer">1</value> <cost type="float">0.0</cost> <resource_name>rate</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_received</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_sent</resource_name> </cost> OnApp Cloud 4.1 API Guide </costs> <label>eth0</label> OnApp Cloud 4.1 API Guide </network_interface> </network_interfaces> <virtual_machines type="array"> <virtual_machine> <id type="integer">1214</id> <costs type="array"> <cost> <value type="integer">6</value> <cost type="float">0.0</cost> <resource_name>template</resource_name </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>cpu_usage</resource_name> </cost> </costs> <label>OH-site</label> </virtual_machine> </virtual_machines> </billing_stats> <total_cost type="float">0.0</total_cost> OnApp Cloud 4.1 API Guide <vm_resources_cost type="float">0.0</vm_resources_cost> <usage_cost type="float">0.0</usage_cost> </vm_stats> Where: created_at – the timestamp in DB when this record was created updated_at – the time stamp in DB when this record was updated currency_code - currency in which this storage server is charged within the billing plan id – the ID of the storage server hourly statistics stat_time – the particular hour for which these statistics were generated user_id - the ID of storage server owner virtual_machine_id - ID of a storage server virtual_machine_billing_statistics_id -ID of a storage server billing statistics billing_stats - an array of billing details for the resources used by this storage server: disks - an array of disks used by this storage server with their billing details: label - disk name used in UI id - disk ID used in database costs- an array of disk related resources with their total prices for the period specified in the stat-time parameter, where: resource_name - the resource in question. This can be disk_size, data_read, data_written, reads_completed and writes_completed value - the amount of resources used (GBs of disk size, Kbs of data read/written, the number of reads/writes) cost - the total due for the resource network_interfaces - an array of network interfaces used by this storage server with their billing statistics: label - network interface name used in OnApp id - network interface ID costs- an array of network interface related resources with their total prices for the period specified in the stat-time parameter, where: resource_name- the resource in question. This can be ip_addresses, rate, data_received and data_sent value - the amount of resources used by this network interface (the number of IPs, the port speed in Mb per second, the data sent and received in GB ) cost - the total due for the resource virtual_machines - an array of storage server billing details: label - storage server name costs- An array of storage server resources with their total prices for the period specified in the stat-time parameter, where: resource_name - the resource in question. This can be cpu_shares, cpus, memory, cpu_usage and template value - the amount of resources allocated to this storage server. For the templates resource, this parameter means a template ID in database. cost - the total due for this resource id - storage server ID total_cost – the total amount of money owed for the storage server specified by id parameter for a particular hour specified by stat_time parameter (total_cost = vm_resources_cost + usage_cost) vm_resources_cost – the amount of money due for the storage server resources for the particular hour specified by stat_time parameter (memory, disks, templates) usage_cost – the total due for storage server usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage) Search CDN Storage Server by Label To search a storage server by label, run the following request XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/storage_servers?q=label JSON Request example OnApp Cloud 4.1 API Guide curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/storage_servers?q=label Where you have to specify the label of a CDN storage server you are searching for. Get List of CDN Storage Server Backups CDN storage server backups are managed exactly the same as virtual server backups. See the Backups/ Snapshots section of the API guide for details. GET /storage_servers/:storage_server_id/backups.xml GET /storage_servers/:storage_server_id/backups.json An array of backups is returned. If there are no backups, an empty array is returned. XML Output example <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">270692</backup_size> <backup_type>normal</backup_type> <built type="boolean">true</built> <built_at type="datetime">2013-02-04T11:19:28+02:00</built_at> <created_at type="datetime">2013-02-04T11:17:24+02:00</created_at> <disk_id type="integer">39</disk_id> <id type="integer">254</id> <identifier>kq6ecsscwg5z1d</identifier> <image_type nil="true"/> <iqn nil="true"/> <locked type="boolean">false</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">20</min_disk_size> <min_memory_size type="integer">2048</min_memory_size> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <template_id type="integer">62</template_id> <updated_at type="datetime">2013-02-04T11:19:28+02:00</updated_at> <user_id type="integer">3</user_id> <volume_id nil="true"/> </backup> </backups> Explanation of the data returned: allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed up allowed_hot_migrate – true if hot migration is allowed for the storage server backed up allowed_swap – true if swap disk is allowed for storage server backed up, otherwise false backup_server_id – the ID of the backup server on which the backup is stored OnApp Cloud 4.1 API Guide backup_size – the disk space taken by this backup in kB backup_type – disk backup OnApp Cloud 4.1 API Guide built – true if the storage server backed up has been built built_at – the date when the disk backup was built created_at – the date when the record in the database was created updated_at – the date when this record in database was updated disk_id – the id of a disk backed up id – the ID of this backup identifier - disk identifier image_type - backup type (currently only tar is available) locked – true if the storage server backed up has been locked marked_for_delete – the backup is marked for deletion (for auto-backups) min_disk_size – the minimum disk size operating_system_distro – the OS distribution of the storage server backed up operating_system – the OS of the storage server backed up template_id – the ID of a template from which the storage server backed up was built user_id - the ID of a user the storage server belongs to volume_id - data store ID SolidFire - related parameters: iqn - volume ISCSI quialified name Add/Edit Admin/User Note for CDN Storage Server To edit/make an admin note, use the following request: PUT /storage_servers/:storage_server_id.xml PUT /storage_servers/:storage_server_id.json XML Request example curl -i -X PUT -u user:userpass http://onapp.test/storage_servers/:storage_server_id.xml -d '<storage_server><admin_note>abcde</admin_note></storage_server>' H 'Accept:application/xml' -H 'Content-type:application/xml JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/storage_servers/:storage_server_id.json -d '{"storage_server":{"admin_note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' H 'Content-type:application/json Where: admin_note – enter the text of your note. Add/Edit User Note XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass http://onapp.test/storage_servers/:storage_server_id.xml -d '<storage_server><note>new notes</note></storage_server>' -H 'Accept:application/xml' -H 'Content-type:application/xml Add/Edit User Note JSON Request example curl -i -X PUT -u user:userpass http://onapp.test/storage_servers/:storage_server_id.json -d '{"storage_server":{"note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' H 'Content-type:application/json Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect. CDN Usage Statistics CDN usage statistics shows the detailed information on all the resources used by CDN. GET /cdn_usage_statistics.xml GET /cdn_usage_statistics.json XML Request example curl -i -X GET -u user:userpass --url http://onapp.test/cdn_usage_statistics.xml -d '<period><startdate>YYYY-MM-DD+hh:mm:ss</startdate><enddate>YYYY-MMDD+hh:mm:ss</endda te></period>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET -u user:userpass --url http://onapp.test/cdn_usage_statistics.json d '{"period":{"startdate":"YYYY-MM-DD+hh:mm:ss","enddate":"YYYY-MM-DD+hh:mm:ss"}}' -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example: OnApp Cloud 4.1 API Guide Status: 200 Content-Length: 1378 Connection: close Content-Type: application/xml; charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <cdn_stats> <cdn_stat> <user_id>1</user_id> <edge_group_id>6</edge_group_id> <cached>0.01901</cached> <non_cached>1.001</non_cached> <location_id>532</location_id> </cdn_stat> </cdn_stats> Where: user_id - the ID of the OnApp user edge_group_id - the ID of the edge group in use cached - the amount of cached data in GB non_cached - the amount of non-cached data in GB location_id - the ID of the location assigned to this particular edge group (edge_group_id) in OnApp. You can view the list of locations via the Get CDN Edge Group Details API request, where available_locations parameter is the array of locations available for this edge group. Check Password Strength Use the following API call to check password strength: XML Request example curl -X GET -u user:userpass http://onapp.test/password_strength_meter.xml?password=password_sampl e JSON Request example curl -X GET -u user:userpass http://onapp.test/password_strength_meter.json?password=password_sampl e Where you have to specify your password instead of the password_sample CloudBoot IP Addresses CloudBoot IP addresses are IP addresses that are in use and are available for compute resource cloudbooting. The CloudBoot IP addresses are managed similarly to regular IPs used for VSs. Get List of CloudBoot IP Addresses OnApp Cloud 4.1 API Guide GET /cloud_boot_ip_addresses.xml GET /cloud_boot_ip_addresses.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <ip_addresses type="array"> <ip_address> <address>192.168.1.160</address> <broadcast>192.168.1.255</broadcast> <created_at type="datetime">2012-07-31T03:04:42-11:00</created_at> <customer_network_id nil="true"/> <disallowed_primary nil="true"/> <gateway>192.168.1.1</gateway> <hypervisor_id nil="true"/> <id type="integer">72</id> <ip_address_pool_id nil="true"/> <network_address>192.168.1.0</network_address> <network_id nil="true"/> <pxe type="boolean">true</pxe> <updated_at type="datetime">2012-07-31T03:04:42-11:00</updated_at> <user_id nil="true"/> <free type="boolean">true</free> <netmask>255.255.255.0</netmask> </ip_address> ... </ip_addresses> Where: ip_addresses – an array with all CloudBoot IP addresses address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - the ID of the customer VLAN the IP address belongs to disallowed_primary – true if not allowed to be used as primary, otherwise false gateway – gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with network_address – the address of the network network_id –the ID of the network pxe - true, if this compute resource address can be used for cloudbooting a compute resource updated_at — the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - the ID of the user this IP address is assigned to free – true if free, otherwise false netmask — netmask for the IP address OnApp Cloud 4.1 API Guide Add CloudBoot IP Address OnApp Cloud 4.1 API Guide POST /cloud_boot_ip_addresses.xml POST /cloud_boot_ip_addresses.json XML Request example *curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<ip_address><address>109.123.105.192</address><netmask>255.255.255.240</netmask><bro a dcast>109.123.105.191</broadcast><disallowed_primary>true</disallowed_primary><networ k _address>109.123.105.176</network_address><gateway>109.123.105.177</gateway></ip_addr e ss>' --url http://onapp.test/cloud_boot_ip_addresses.xml* JSON Request example *curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"ip_address":{"address":"109.123.105.192","netmask":"255.255.255.240","broadcast":" 1 09.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gate w ay":"109.123.105.177"}}' --url http://onapp.test/cloud_boot_ip_addresses.json* Where: address* - IP address netmask* - network mask broadcast* - a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. network_address* - IP address of the network gateway* - gateway address disallowed_primary – set true not to use this address as primary. Otherwise set false Edit CloudBoot IP Address PUT /cloud_boot_ip_addresses/:id.xml PUT /cloud_boot_ip_addresses/:id.xml XML Request example *curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<ip_address><address>109.123.105.192</address><netmask>255.255.255.240</netmask><bro a dcast>109.123.105.191</broadcast><network_address>109.123.105.176</network_address><d i sallowed_primary>true</disallowed_primary><gateway>109.123.105.177</gateway></ip_addr e ss>' --url http://onapp.test/cloud_boot_ip_addresses/:id.xml* JSON Request example OnApp Cloud 4.1 API Guide *curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"ip_address":{"address":"109.123.105.186","netmask":"255.255.255.240","broadcast":" 1 09.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gate w ay":"109.123.105.177"}}' --url http:cloud_boot_ip_addresses/:id.json* OnApp Cloud 4.1 API Guide The following parameters can be passed to be changed: address, netmask, broadcast, network_address, gateway, disallowed_primary option (all strings). Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CloudBoot IP address with a requested ID, or URL is incorrect. Delete Cloud Boot IP Address DELETE /cloud_boot_ip_addresses/:id.xml DELETE /cloud_boot_ip_addresses/:id.json XML Request example *curl -i -X DELETE -u user:userpass --url http://onapp.test/cloud_boot_ip_addresses/:id.xml* JSON Request example *curl -i -X DELETE -u user:userpass --url http://onapp.test/cloud_boot_ip_addresses/:id.json* Where you have to specify ID of a Cloud Boot IP address you want to delete. PLEASE NOTE: You can't delete an IP address that is in use. Returns HTTP 204 response on successful processing, and HTTP 404 when there is no CloudBoot IP address with a requested ID, or URL is incorrect. Currencies This class allows you to set up the currency for your payments. There are four currencies in a default installation: USD, EUR, GBP and JPY. You can add more currencies at any time. Get List of Currencies To get the list of available currencies, use the following request: GET /settings/currencies.xml GET /settings/currencies.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <currencies> <currency> <name>United States dollar</name> <format>%u%n</format> <created_at>2011-03-02T12:09:36+02:00</created_at> <code>USD</code> <updated_at>2011-03-22T16:12:41+02:00</updated_at> <id>1</id> <unit>$</unit> <separator>.</separator> <precision>5</precision> <precision_for_unit>2</precision_for_unit> <delimiter>,</delimiter> </currency> </currencies> OnApp Cloud 4.1 API Guide Where: name – the currency label format - how the currency is displayed in the control panel. The following parameters are used: %n ( for the digits), %u ( for the currency symbol) created_at – the date when the record in DB was added updated_at – the date when the record in DB was updated code - three-character currency code that is generally used to represent the currency id – the ID of the currency unit – a currency symbol separator - a character used to format decimal numbers, e.g 100.99 precision - the number of digits after the delimiter. This parameter is used when showing the costs total for a certain period, e.g. Outstanding amount, Total Cost, Payments. precision_per_unit - the number of digits after the delimiter. The precision per unit parameter is used to display the prices for the resources , e.g. for CPU, Disk size, RAM, IP, Data stores, Edge servers, Disks, Backups, Templates, etc. delimiter - a grouping character used to separate thousands, e.g: 100,000,000. Get Currency Details To get details for a particular currency, use the following request: GET /settings/currencies/:id.xml GET /settings/currencies/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <currency> <name>British pound</name> <format>%u%n</format> <created_at>2011-03-02T12:09:36+02:00</created_at> <code>GBP</code> <updated_at>2011-03-22T15:31:10+02:00</updated_at> <id>2</id> <unit>£</unit> <separator>.</separator> <precision>1</precision> <precision_for_unit>2</precision_for_unit> <delimiter>,</delimiter> </currency> Where: name – the currency label format - how the currency is displayed in the control panel. The following parameters are used: %n ( for the digits), %u ( for the currency symbol) created_at – the date when the record in DB was added updated_at – the date when the record in DB was updated code - three-character currency code that is generally used to represent the currency id – the ID of the currency unit – a currency symbol separator - a character used to format decimal numbers, e.g 100.99 precision - the number of digits after the delimiter. This parameter is used when showing the costs total for a certain period, e.g. Outstanding OnApp Cloud 4.1 API Guide amount, Total Cost, Payments. precision_per_unit - the number of digits after the delimiter. The precision per unit parameter is used to display the prices for the resources , e.g. for CPU, Disk size, RAM, IP, Data stores, Edge servers, Disks, Backups, Templates, etc. delimiter - a grouping character used to separate thousands, e.g: 100,000,000. Add Currency To add a currency, use the following request: POST /settings/currencies.xml POST /settings/currencies.json XML Request example *curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<currency><name>Ukrainian Gruvna</name><unit>§</unit><format>%n%u</format><code>UAH</code><separator>.</separat o r><precision>2</precision><precision_for_unit>4</precision_for_unit><delimiter>,</del i miter></currency>' --url http://onapp.test/settings/currencies.xml* JSON Request example curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"currency":{"name":"Polski Zloti","unit":"§","format":"%n%u","code":"POZ","separator":".","precision":"4","preci s ion_for_unit":"4","delimiter":","}}' --url http://onapp.test/settings/currencies.json Where: name*– the currency label unit* – a currency symbol ($, €, £, etc. ) format* - how the currency is displayed in the control panel. The following parameters are used: %n ( for the digits), %u ( for the currency symbol) code* - three-character currency code that is generally used to represent the currency separator* - a character used to format decimal numbers, e.g.: 100.99 precision* - the number of digits after the delimiter to display the costs precision_for_unit – the numberof digits after the delimiter to display the prices for resources delimiter* - a grouping character used to separate thousands, e.g.: 100,000,000. JSON Output example {"currency":{"name":"Polski Zloti","created_at":"2011-04-19T17:20:26+03:00","format":"%n%u","code":"POZ","updated_ at":"2011-0419T17:20:26+03:00","id":7,"unit":"§","separator":".","precision":4,"delim iter":","}} Edit Currency To edit details of a currency, use the following request: PUT /settings/currencies/:id.xml PUT /settings/currencies/:id.json OnApp Cloud 4.1 API Guide XML Request example OnApp Cloud 4.1 API Guide *curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<currency><name>British_changed</name><unit>§</unit><format>%n%u</format><separator> . </separator><precision>2</precision><precision_for_unit>4</precision_for_unit><delimi t er>,</delimiter></currency>' --url http://onapp.test/settings/currencies/:id.xml* JSON Request example *curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"currency":{"name":"British_changed","unit":"§","format":"%n%u","separator":".","pr e cision":"4", "precision_for_unit":"4","delimiter":","}}' --url http://onapp.test/settings/currencies/:id.json* Where: name – the currency label unit – a currency symbol ($, €, £, etc. ) format - how the currency is displayed in the control panel. The following parameters are used: %n ( for the digits), %u ( for the currency symbol) code - three-character currency code that is generally used to represent the currency separator - a character used to format decimal numbers, e.g 100.99 precision - the number of digits after the delimiter to display the costs precision_for_unit – the number of digits after the delimiter to display the prices for resources delimiter - a grouping character used to separate thousands, e.g: 100,000,000. Delete Currency To delete a currency, use the following request: DELETE /settings/currencies/:id.xml DELETE /settings/currencies/:id.json XML Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/currencies/:id.xml JSON Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/currencies/:id.json Returns HTTP 204 response on successful processing, and HTTP 404 when there is no currency with a requested ID, or URL is incorrect. Customer Networks Customer networks are used for isolation of customer’s virtual servers from other customers' VSs within a VLAN. OnApp Cloud 4.1 API Guide To charge for customer networks, you need to attach the required customer network to the network zone first, and then add this zone to the user's billing plan. After that, user will be able to select this customer network during the VMware VS creation. OnApp Cloud 4.1 API Guide Get List of Customer Networks GET /customer_networks.xml GET /customer_networks.json XML Request example curl -i -u user:userpass http://onapp.test/customer_networks.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/customer_networks.json -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <customer_networks type="array"> <customer_network> <created_at type="datetime">2012-09-06T09:15:55+00:00</created_at> <default_nat_rule_number type="integer">9949</default_nat_rule_number> <default_outside_ip_address_id type="integer">245944</default_outside_ip_address_id> <id type="integer">11</id> <identifier>x1wv13cbbc83lp</identifier> <ip_address_pool_id type="integer">66</ip_address_pool_id> <is_nated nil="true"></is_nated> <label>esx(i)-customer</label> <network_group_id nil="true"></network_group_id> <prefix_size type="integer">25</prefix_size> <updated_at type="datetime">2012-09-06T09:15:55+00:00</updated_at> <user_id type="integer">1</user_id> <vlan type="integer">1</vlan> </customer_network> </customer_networks> Explanation of the data returned: id - customer network ID prefix_size – subnet prefix size is_nated – boolean indicator behind NAT default_nat_rule_number – default NAT rule (Vyatta firewall) default_outside_ip_address_id – ID of a free IPv4 address OnApp Cloud 4.1 API Guide identifier – auto-generated network identifier ip_address_pool_id – ID of the Ip Address Pool OnApp Cloud 4.1 API Guide label – visible network identifier network_group_id – network zone ID (currently null for Vmware) user_id – owner ID vlan – VLAN number created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format Get List of User Customer Networks To view customer networks of a particular user, run: GET /users/:user_id/customer_networks.xml GET /users/:user_id/customer_networks.json Where you have to specify user ID. Add Customer Network POST /users/:user_id/customer_networks.xml POST /users/:user_id/customer_networks.json XML Request example curl -i -u user:userpass -X POST http://onapp.test/users/:user_id/customer_networks.xml -d '<customer_network><default_outside_ip_address><hypervisor_id>9</hypervisor_id></defa u lt_outside_ip_address><ip_address_pool_id>1</ip_address_pool_id><label>test</label><p r efix_size>29</prefix_size><network_group_id>1</network_group_id><is_nated>true</is_na t ed></customer_network>' -H 'Accept: application/xml' -H 'Content-tylpe: application/xml' JSON Request example curl -i -u user:userpass -X POST http://onapp.test/users/:user_id/customer_networks.json -d '{"customer_network": {"default_outside_ip_address": { "hypervisor_id": "9" },"ip_address_pool_id": "1","label": "test","prefix_size": "29","network_group_id":"1","is_nated":"1"}}' H 'Accept: application/json' -H 'Content-type: application/json' Where: default_outside_ip_address - the default IP address field with the following details: hypervisor_id - ID of a VMware compute resource from which the IP address will be fetched ip_address_pool_id – IP address pool ID label – visible network identifier prefix_size – subnet prefix size network_group_id* - ID of a network zone to which the customer network will be assigned OnApp Cloud 4.1 API Guide NOTE: Do not assign customer network to a network zone with other network types. OnApp Cloud 4.1 API Guide is_nated - set true to use NAT for translating the traffic from Vyatta's single eternal IP to local customer network IPs . Set false if you are using your own firewall with external IP address Delete Customer Network DELETE /customer_networks/:id.xml DELETE /customer_networks/:id.json XML Request example curl -i -u user:userpass http://onapp.test/customer_networks/:id.xml -X DELETE H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/customer_networks/:id.json -X DELETE H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a customer network with the ID specified is not found, or the URL requested is incorrect. Customer VLANs VLANs are used to to separate the core networks. All VMware-based virtual machines are running inside VLANs. Get List of Customer VLANs To get the list of customer VLANs, run: GET /settings/customer_vlans.xml GET /settings/customer_vlans.json XML Request example curl -i -u user:userpass http://onapp.test/settings/customer_vlans.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/settings/customer_vlans.json -H 'Accept: application/json' -H 'Content-type: application/json' XML Response example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <customer_vlans type="array"> <customer_vlan> <created_at type="datetime">2012-08-30T00:41:27-11:00</created_at> <id type="integer">1</id> <updated_at type="datetime">2012-08-30T00:41:27-11:00</updated_at> <user_id nil="true"/> <vlan type="integer">1</vlan> </customer_vlans> Where: customer vlans - an array of customer VLANs created_at — the date when the VLAN was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at — the date when the VLAN was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - the VLAN ID user ID - the ID of the user this VLAN is assigned to Get Customer VLAN Details GET /settings/customer_vlans/:id.xml GET /settings/customer_vlans/:id.json XML Request example curl -i -u user:userpass http://onapp.test/settings/customer_vlans/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/settings/customer_vlans/:id.json H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <customer_vlan> <created_at type="datetime">2012-08-30T00:41:27-11:00</created_at> <id type="integer">1</id> <updated_at type="datetime">2012-08-30T00:41:27-11:00</updated_at> <user_id nil="true"/> <vlan type="integer">1</vlan> </customer_vlan> Where: customer vlans - an array of customer VLANs created_at — the date when the VLAN was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at — the date when the VLAN was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide id - the VLAN ID OnApp Cloud 4.1 API Guide user ID - the ID of the user this VLAN is assigned to Add Customer VLAN To create new customer VLAN: POST /settings/customer_vlans.xml POST /settings/customer_vlans.json XML Request example curl -i -u user:userpass -X POST http://onapp.test/settings/customer_vlans.xml -d '<customer_vlan_range><vlan_starts>1000</vlan_starts><vlan_ends>1001</vlan_ends></cus t omer_vlan_range>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass -X POST http://onapp.test/settings/customer_vlans.json d '{"customer_vlan_range":{"vlan_starts":"1000","vlan_ends":"1001"}}' -H 'Accept: application/json' -H 'Content-type: application/json' Where: vlan_starts – first number of the VLAN range vlan_ends – last number of the VLAN range XML Response example HTTP/1.1 201 Created Location: http://onapp.test/settings/customer_vlans?vlan_ends=1001&vlan_starts=1000 ContentType: application/xml; charset=utf-8 X-Ua-Compatible: IE=Edge Etag: "1b875987e64d5a0d3ea620336ef119e9" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 5b1182d88f48f1a58cd87ff5073c49a6 X-Runtime: 0.292950 Content-Length: 118 Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20) Date: Thu, 06 Sep 2012 15:18:21 GMT Connection: Keep-Alive Set-Cookie: _session_id=6241d8a8388a9e3370b72ada9387635d; path=/; HttpOnly <?xml version="1.0" encoding="UTF-8"?> <hash> <vlan-starts>1000</vlan-starts> <vlan-ends>1001</vlan-ends> </hash> Edit Customer VLAN PUT /settings/customer_vlans/:id.xml PUT /settings/customer_vlans/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -u user:userpass -X PUT http://onapp.test/settings/customer_vlans/:id.xml -d'<customer_vlan><user_id>2</user_id></customer_vlan>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass -X PUT http://onapp.test/settings/customer_vlans/:id.json -d'{"customer_vlan":{"user_id":2}}' -H 'Accept: application/json' -H 'Contenttype: application/json' Where: user_id - ID of a user the VLAN is associated with Returns HTTP 204 response on successful deletion, or HTTP 404 when a customer VLAN with the ID specified is not found, or the URL requested is incorrect. Delete Customer VLAN DELETE /settings/customer_vlans/:id.xml DELETE /settings/customer_vlans/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/customer_vlans/:customer_vlan_id.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/customer_vlans/:customer_vlan_id.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a customer VLAN with the ID specified is not found, or the URL requested is incorrect. Custom Recipe Variables Custom variables are name-value sets that can be used in server and template recipes. You can create custom variables for virtual, smart and baremetal servers and image templates. All API calls are available to this class. Get List of Custom Variables To get the list of virtual server custom variables: GET /virtual_machines/:virtual_machine_id/custom_recipe_variables.xml GET /virtual_machines/:virtual_machine_id/custom_recipe_variables.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:id/custom_recipe_variables.xml JSON Response example: OnApp Cloud 4.1 API Guide curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://localhost:3000/virtual_machines/:virtual_machine_id/custom_recipe_variables.js o n Where you have to specify ID of a virtual server in the URL. XML Output example <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variables type="array"> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>1234</value> <virtual_machine_id type="integer">3898</virtual_machine_id> </custom_recipe_variable> </custom_recipe_variables> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script virtual_machine_id - ID of a virtual machine the variable belongs to Get Custom Variable Details To get the list of virtual server custom variables: GET /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml GET /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:id/custom_recipe_variables/:custom_recipe_variabl e _id.xml JSON Response example: OnApp Cloud 4.1 API Guide curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://localhost:3000/virtual_machines/:virtual_machine_id/custom_recipe_variables/:c u stom_recipe_variable_id.json Where you have to specify ID of a virtual server in the URL. XML Output example <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>value_sample</value> <virtual_machine_id type="integer">3898</virtual_machine_id> </custom_recipe_variable> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script virtual_machine_id - ID of a virtual machine the variable belongs to Edit Custom Variable To edit a virtual server custom recipe variable: PUT /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml PUT /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X PUT -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled>< /custom_recipe_variable>' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.xml JSON Response example: OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.json Where you can edit: enabled - true, if the variable is enabled, otherwise false name - variable name value - variable value script Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found. Add Custom Variable To create a virtual server custom variables: POST /virtual_machines/:virtual_machine_id/custom_recipe_variables.xml POST /virtual_machines/:virtual_machine_id/custom_recipe_variables/json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled> < /custom_recipe_variable>' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables.xm l JSON Response example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables.json Where: enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script You also have to specify ID of a virtual server in the URL. XML Output example OnApp Cloud 4.1 API Guide <custom_recipe_variable> <created_at type="datetime">2013-05-27T10:15:54+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">7</id> <name>varname</name> <updated_at type="datetime">2013-05-27T10:15:54+03:00</updated_at> <value>varvalue</value> <virtual_machine_id type="integer">3992</virtual_machine_id> </custom_recipe_variable> Delete Custom Variable To delete a custom variable: DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.xml JSON Response example: curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.json Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found. Get List of Virtual Server Custom Variables To get the list of virtual server custom variables: GET /virtual_machines/:virtual_machine_id/custom_recipe_variables.xml GET /virtual_machines/:virtual_machine_id/custom_recipe_variables.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:id/custom_recipe_variables.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://localhost:3000/virtual_machines/:virtual_machine_id/custom_recipe_variables.js o n OnApp Cloud 4.1 API Guide Where you have to specify ID of a virtual server in the URL. OnApp Cloud 4.1 API Guide XML Output example <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variables type="array"> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>1234</value> </custom_recipe_variable> </custom_recipe_variables> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script parent_id - ID of a baremetal server the variable belongs to parent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine Get List of Smart Server Custom Variables To get the list of smart server custom variables: GET /smart_servers/:smart_server_id/custom_recipe_variables.xml GET /smart_servers/:smart_server_id/custom_recipe_variables.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/smart_servers/:id/custom_recipe_variables.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/smart_servers/:id/custom_recipe_variables.json Where you have to specify ID of a smart server in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variables type="array"> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>1234</value> </custom_recipe_variable> </custom_recipe_variables> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script parent_id - ID of a smart server the variable belongs to parent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine Get List of Baremetal Server Variables To get the list of baremetal server custom variables: GET /baremetal_servers/:baremetal_server_id/custom_recipe_variables.xml GET /baremetal_servers/:baremetal_server_id/custom_recipe_variables.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/baremetal_servers/:id/custom_recipe_variables.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/baremetal_servers/:id/custom_recipe_variables.json Where you have to specify ID of a baremetal server in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variables type="array"> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>1234</value> </custom_recipe_variable> </custom_recipe_variables> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script parent_id - ID of a baremetal server the variable belongs to parent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine Get Virtual Server Custom Variable Details To get the list of virtual server custom variables: GET /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml GET /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:id/custom_recipe_variables/:custom_recipe_variabl e _id.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.json Where you have to specify ID of a virtual server in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>value_sample</value> </custom_recipe_variable> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script virtual_machine_id - ID of a virtual machine the variable belongs to Get Smart Server Custom Variable Details To get the list of smart server custom variables: GET /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml GET /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.json Where you have to specify ID of a smart server in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>value_sample</value> </custom_recipe_variable> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script parent_id - ID of a smart server the variable belongs to parent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine Get Baremetal Server Custom Variable Details To get the list of baremetal server custom variables: GET /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml GET /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.xml JSON Response example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.json Where you have to specify ID of a baremetal server in the URL. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <custom_recipe_variable> <created_at type="datetime">2013-05-24T11:56:25+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">2</id> <name>sample</name> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> <updated_at type="datetime">2013-05-24T11:56:25+03:00</updated_at> <value>value_sample</value> </custom_recipe_variable> Where: custom_recipe_variable - an array of custom variable details: created_at - the time when the variable was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script parent_id - ID of a baremetal server the variable belongs to parent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine Add Virtual Server Custom Variable To create a virtual server custom variable: POST /virtual_machines/:virtual_machine_id/custom_recipe_variables.xml POST /virtual_machines/:virtual_machine_id/custom_recipe_variables/json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled> < /custom_recipe_variable>' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables.xm l JSON Response example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables.json Where: enabled - true, if the variable is enabled, otherwise false OnApp Cloud 4.1 API Guide id - variable ID OnApp Cloud 4.1 API Guide name - variable name value - variable value script You also have to specify ID of a virtual server in the URL. XML Output example <custom_recipe_variable> <created_at type="datetime">2013-05-27T10:15:54+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">7</id> <name>varname</name> <updated_at type="datetime">2013-05-27T10:15:54+03:00</updated_at> <value>varvalue</value> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> </custom_recipe_variable> Add Smart Server Custom Variable To create a smart server custom variable: POST /smart_servers/:smart_server_id/custom_recipe_variables.xml POST /smart_servers/:smart_server_id/custom_recipe_variables/json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled> < /custom_recipe_variable>' --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables.xm l JSON Response example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/smart_servers/:smart_server/custom_recipe_variables.json Where: enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script You also have to specify ID of a smart server in the URL. XML Output example OnApp Cloud 4.1 API Guide <custom_recipe_variable> <created_at type="datetime">2013-05-27T10:15:54+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">7</id> <name>varname</name> <updated_at type="datetime">2013-05-27T10:15:54+03:00</updated_at> <value>varvalue</value> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> </custom_recipe_variable> Add Baremetal Server Custom Variable To create a baremetal server custom variable: POST /baremetal_servers/:baremetal_server_id/custom_recipe_variables.xml POST /baremetal_servers/:baremetal_server_id/custom_recipe_variables/json XML Request example: curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled> < /custom_recipe_variable>' --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables.xm l JSON Response example: curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables.jso n Where: enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script You also have to specify ID of a baremetal server in the URL. XML Output example OnApp Cloud 4.1 API Guide <custom_recipe_variable> <created_at type="datetime">2013-05-27T10:15:54+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">7</id> <name>varname</name> <updated_at type="datetime">2013-05-27T10:15:54+03:00</updated_at> <value>varvalue</value> <parent_id type="integer">1476</parent_id> <parent_type>VirtualMachine</parent_type> </custom_recipe_variable> Edit Virtual Server Custom Variable To edit a virtual server custom recipe variable: PUT /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml PUT /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X PUT -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled>< /custom_recipe_variable>' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.xml JSON Response example: curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.json Where you can edit: enabled - true, if the variable is enabled, otherwise false name - variable name value - variable value script Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found. Edit Smart Server Custom Variable To edit a smart server custom recipe variable: PUT /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml PUT /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled>< /custom_recipe_variable>' --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.xml JSON Response example: curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.json Where you can edit: enabled - true, if the variable is enabled, otherwise false name - variable name value - variable value script Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found. Edit Baremetal Server Custom Variable To edit a baremetal server custom recipe variable: PUT /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml PUT /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X PUT -H 'Accept: application/xml' -H 'Contenttype: application/xml' -u user:userpass -d '<custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled>< /custom_recipe_variable>' --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.xml JSON Response example: curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.json Where you can edit: enabled - true, if the variable is enabled, otherwise false name - variable name OnApp Cloud 4.1 API Guide value - variable value script OnApp Cloud 4.1 API Guide Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found. Delete Virtual Server Custom Variable To delete a custom variable: DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xml DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.xml JSON Response example: curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custo m _recipe_variable_id.json Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found. Delete Smart Server Custom Variable To delete a custom variable: DELETE /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml DELETE /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.xml JSON Response example: curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_reci p e_variable_id.json Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found. Delete Baremetal Server Custom Variable To delete a custom variable: DELETE /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.xml DELETE /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example: OnApp Cloud 4.1 API Guide curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.xml JSON Response example: curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:cus t om_recipe_variable_id.json Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found. Data Stores Data stores provide disk space for your virtual servers and operating systems. Data stores are attached to compute resources, and may also form part of a data store zone. All CRUD operations are available to data stores. There are three types of data stores supported by OnApp: 1. Traditional logical volume data stores based on a centralized SAN. 2. ESXi datastores used under VMware. 3. Integrated storage data stores (see Integrated Storage chapter for details). Get List of Data Stores GET /settings/data_stores.xml GET /settings/data_stores.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <data-stores type="array"> <data_store> <label>SAN1</label> <created_at type="datetime">2010-04-27T15:55:08Z</created_at> <updated_at type="datetime">2010-08-04T09:02:15Z</updated_at> <data_store_group_id type="integer">81</data_store_group_id> <id type="integer">1</id> <local_hypervisor_id type="integer" nil="true"></local_hypervisor_id> <data_store_size type="integer">890</data_store_size> <data_store_type>lvm</data_store_type> <enabled type="boolean">true</enabled> <hypervisor_group_id nil="true"/> <identifier>radar-san1</identifier> <usage type="integer">57</usage> <label>DS1 doesn't work</label> <local_hypervisor_id nil="true"/> <zombie_disks_size type="integer">15</zombie_disks_size> </data_store> </data_stores> Where: created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide data_store_size - the size of your data store shown in GB data_store_type - data store type. Can be either lvm or vmware. id - the data store ID label - the data store label local_hypervisor_id - the ID of the compute resource using this Data Store updated_at - the date when the Data Store was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_store_group_id - the ID of a data store zone to which a particular data store is attached zombie_disk_size - the size of zombie disks attached to this data store in GB. enabled - True if a data store is enabled and you can attach disks to it. Otherwise, false. usage - the total disk usage on the data store in GB. Get Data Store Details To get details of a particular data store, use this request: GET /settings/data_stores/:id.xml GET /settings/data_stores/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store> <label>SAN1</label> <created_at type="datetime">2010-10-28T03:18:51+07:00</created_at> <updated_at type="datetime">2011-07-19T21:21:42+07:00</updated_at> <zombie_disks_size type="integer">93</zombie_disks_size> <id type="integer">1</id> <enabled type="boolean">true</enabled> <data_store_group_id type="integer">1</data_store_group_id> <ip nil="true"></ip> <iscsi_ip nil="true"/> <local_hypervisor_id nil="true"></local_hypervisor_id> <hypervisor_group_id nil="true"/> <identifier>onapp-9yblt1m70pdtdp</identifier> <data_store_size type="integer">500</data_store_size> <data_store_type>lvm</data_store_type> <usage type="integer">57</usage> </data_store> Where: created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_store_size — the size of your data store shown in GB data_store_type - data store type. Can be either lvm or vmware. id — the data store ID label — the data store label local_hypervisor_id — IDs of the compute resources using this Data Store hypervisor_group_id - the ID of the zone to which this data store is attached. updated_at — the date when the Data Store was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide data_store_group_id — the ID of a data store zone to which a particular data store is attached OnApp Cloud 4.1 API Guide zombie_disk_size — the size of zombie disks attached to this data store in GB. enabled — true if a data store is enabled and you can attach disks to it, otherwise false. usage - the total disk usage on this data store in GB. Add LVM Data Store POST /settings/data_stores.xml POST /settings/data_stores.json XML Output example curl -i -X POST http://onapp.test/settings/data_stores.xml -d '<data_store><label>:DS_label</label><data_store_group>DS_zone_id</data_store_group>< l ocal_hypervisor_id>1</local_hypervisor_id><ip>:DS_ip</ip><enabled>true/false</enabled > <data_store_size>40</data_store_size><data_store_type>lvm</data_store_type></data_sto r e>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: JSON application/xml' Request example curl -i -X POST http://onapp.test/settings/data_stores.json -d '{data_store:{label:"DS_label",data_store_group:"DS_zone_id",local_hypervisor_id:"1", i p"DS_ip",enabled:"true/false",data_store_size:"40","data_store_type":"lvm"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* - the data store name data_store_group* - the group to which this DS is assigned ip* - the data store IP enabled* - set 1 if data store is enabled, otherwise set 0 data_store_size* - set size in GB data_store_type - set lvm data store type local_hypervisor_id - ID of a local compute resource Add VMware Data Store POST /settings/data_stores.xml POST /settings/data_stores.json XML Request example curl -i POST -d '<data_store><label>zaza_api</label><ip>192.168.1.27</ip><enabled>1</enabled><data_st o re_size>40</data_store_size><local_hypervisor_id></local_hypervisor_id><data_store_gr o up_id>84</data_store_group_id><data_store_type>vmware</data_store_type></data_store>' -u user:userpass http://onapp.test/settings/data_stores.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i POST -d '{"data_store":{"label":"zaza_api_json", "ip":"192.168.1.27", "enabled":"1", "data_store_size":"40", "local_hypervisor_id":"", "data_store_group_id":"84", "data_store_type":"vmware"}}' -u user:userpass http://onapp.test/settings/data_stores.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* - the data store name data_store_group* - the group to which this DS is assigned ip* - the data store IP enabled* - set 1 if data store is enabled, otherwise set 0 data_store_size* - set size in GB data_store_type - set VMware data store type local_hypervisor_id - ID of a local compute resource Add SolidFire Data Store POST /settings/data_stores.xml POST /settings/data_stores.json XML Request example curl -i -X POST -u user:userpass --url http://onapp.test/settings/data_stores.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<data_store><label>API_SF_test_xml</label><ip>10.98.0.101</ip><data_store_type>solid f ire</data_store_type><enabled>1</enabled><data_store_size>40</data_store_size><local_ h ypervisor_id></local_hypervisor_id><data_store_group_id>5</data_store_group_id><iscsi _ ip>10.99.99.101</iscsi_ip><admin_attributes><username>onapp</username><password>passw o rd</password></admin_attributes><account_attributes><username>onapp</username><initia t JSON or_secret>ttttt123456790</initiator_secret><target_secret>ttttt123456780</target_secr Request example e t></account_attributes></data_store>' curl -i -X POST -u user:userpass --url http://onapp.test/settings/data_stores.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"data_store":{"label":"API_SF_test_json","ip":"10.98.0.101","data_store_type":"soli d fire","enabled":"1","data_store_size":"40","local_hypervisor_id":"","data_store_group _ id":"5","iscsi_ip":"10.99.99.101", "admin_attributes":{"username":"onapp", "password":"password"}, "account_attributes":{"username":"onapp", "initiator_secret":"ttttt123456790", "target_secret":"ttttt123456780"}}}' Where: OnApp Cloud 4.1 API Guide label* - the data store name OnApp Cloud 4.1 API Guide data_store_group* - the group to which this DS is assigned ip* - the data store IP enabled* - set 1 if data store is enabled, otherwise set 0 data_store_size* - set size in GB data_store_type - set solidfire data store type local_hypervisor_id - ID of a local compute resource iscsi_ip - iSCSI IP address admin_attributes - an array of cluster admin attributes: username - username for cluster authorization password - password for cluster authorization account_attributes - an array of SolidFire account attributes: username - specify SolidFire account username initiator_secret - iSCSI initiator secret (optional) target_secret - iSCSI initiator secret (optional) XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store> <created_at type="datetime">2012-11-16T11:47:18+00:00</created_at> <data_store_group_id type="integer">5</data_store_group_id> <data_store_size type="integer">40</data_store_size> <data_store_type>solidfire</data_store_type> <enabled type="boolean">true</enabled> <id type="integer">12</id> <identifier>onapp-ndnminre4r4r9h</identifier> <ip>10.98.0.101</ip> <iscsi_ip nil="true"/> <label>API_SF_test_xml</label> <local_hypervisor_id nil="true"/> <updated_at type="datetime">2012-11-16T11:47:18+00:00</updated_at> <zombie_disks_size type="integer">0</zombie_disks_size> <usage type="integer">40</usage> </data_store> Edit LVM Data Store PUT /settings/data_stores/:id.xml PUT /settings/data_stores/:id.json You can edit the data store's disk capacity and label. XML Request example curl -i -X PUT http://onapp.test/settings/data_stores/:data_store_id.xml -d '<data_store><label>:DS_label</label><data_store_group>DS_zone_id</data_store_group>< l ocal_compute resource_id>1</local_compute resource_id><ip>:DS_ip</ip><enabled>true/false</enabled><data_store_size>DS_size</dat a _store_size><data_store_type>lvm</data_store_type></data_store>' -u user:userpass H 'Accept: application/xml' -H 'Content-type: application/xml' OnApp Cloud 4.1 API Guide JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT http://onapp.test/settings/data_stores/:data_store_id.json -d '{data_store:{label:"DS_label",data_store_group:"DS_zone_id",local_compute resource_id:"1",ip"DS_ip",enabled:"true/false",data_store_size:"DS_size","data_store_ t ype":"lvm"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store> <data_store_size>{SIZE}</data_store_size> <label>{LABEL}</label> </data_store> Returns HTTP 204 response on successful deletion, or HTTP 404 when a data sore with the ID specified is not found, or the URL requested is incorrect. Edit SolidFire Data Store PUT /settings/data_stores.xml PUT /settings/data_stores.json XML Request example curl -i -X PUT -u user:userpass --url http://onapp.test/settings/data_stores/12.xml H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<data_store><label>API_SF_test_xml</label><ip>10.98.0.101</ip><data_store_type>solid f ire</data_store_type><enabled>1</enabled><data_store_size>60</data_store_size><local_ c ompute resource_id></local_compute resource_id><data_store_group_id>5</data_store_group_id><iscsi_ip>10.99.99.101</iscsi _ ip><admin_attributes><username>onapp</username><password>password</password></admin_a t tributes><account_attributes><username>onapp</username><initiator_secret>ttttt1234567 9 0</initiator_secret><target_secret>ttttt123456780</target_secret></account_attributes JSON > Request example </data_store>' curl -i -X PUT -u user:userpass --url http://onapp.test/settings/data_stores/11.json -H 'Accept: application/json' -H 'Content-type: application/json' -d {"data_store":{"label":"API_SF_test_json","ip":"10.98.0.101", "data_store_type":"solidfire", "enabled":"1","data_store_size":"60","local_compute resource_id":"","data_store_group_id":"5", "iscsi_ip":"10.99.99.101","admin_attributes":{"username":"onapp", "password":"password"}, "account_attributes":{"username":"onapp","initiator_secret":"ttttt123456790", "target_secret":"ttttt123456780"}}}' Where you can edit: label* - the data store name OnApp Cloud 4.1 API Guide data_store_group * - the group to which this DS is assigned OnApp Cloud 4.1 API Guide ip* - the data store IP enabled* - set 1 if data store is enabled, otherwise set 0 data_store_size* - set size in GB data_store_type - set solidfire data store type local_compute resource_id - ID of a local compute resource iscsi_ip - iSCSI IP address admin_attributes - an array of cluster admin attributes: username - username for cluster authorization password - password for cluster authorization account_attributes - an array of SolidFire account attributes: username - specify SolidFire account username initiator_secret - iSCSI initiator secret (optional) target_secret - iSCSI initiator secret (optional) Returns HTTP 204 response on successful deletion, or HTTP 404 when a data sore with the ID specified is not found, or the URL requested is incorrect. Delete Data Store DELETE /settings/data_stores/:id.xml DELETE /settings/data_stores/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/data_stores/:data_store_id.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/data_stores/:data_store_id.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a data sore with the ID specified is not found, or the URL requested is incorrect. Data Store Zones This class manages all the Data store zones created in the cloud. A data store zone consists of several data stores sharing the same permissions and assigned to the same billing plan. By setting up different zones, you can create different tiers of storage with different pricing and performance. Get List of Data Store Zones To get the list of available data store zones, use the following method: GET /settings/data_store_zones.xml GET /settings/data_store_zones.json You will get an array of data store zones set up within your cloud. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <data-store-groups type="array"> <data-store-group> <label>DSZ_1</label> <location_group_id type="integer">1</location_group_id> <created_at type="datetime">2011-01-11T11:11:15Z</created_at> <updated_at type="datetime">2011-01-17T12:56:41Z</updated_at> <id type="integer">5</id> </data-store-group> Where: label - the data store zone title location_group_id - ID of a location group the data store zone is assigned to created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the Data store zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - the data store zone ID Page history v. 3.1: Added the location_group_id parameter Get Data Store Zone Details GET /settings/data_store_zones/:id.xml GET /settings/data_store_zones/:id.json This method returns details of a particular Data store zone. XML Output example <?xml version="1.0" encoding="UTF-8"?> <data-store-group> <label>DSZ_2</label> <location_group_id type="integer">1</location_group_id> <created_at type="datetime">2011-01-11T11:55:00Z</created_at> <updated_at type="datetime">2011-01-17T12:56:27Z</updated_at> <id type="integer">8</id> </data-store-group> </data-store-groups> Where: label - the data store zone title location_group_id - ID of a location group the data store zone is assigned to created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the Data store zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - the data store zone ID Page history OnApp Cloud 4.1 API Guide v. 3.1: Added the location_group_id parameter Add Data Store Zone Use the following methods to create a new data store zone: POST /settings/data_store_zones.xml POST /settings/data_store_zones.json XML Request example curl -i -X POST http://onapp.test/settings/data_store_zones.xml -d '<?xml version="1.0" encoding="UTF8"?><hypervisor_zone><label>TEST_XML</label><location_group_id>1</locati on_group_id></hypervisor_zone>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/data_store_zones.json -d '{"hypervisor_zone":{"label":"TEST_JSON","location_group_id":"1"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* - is new data_store_zone title location_group_id - ID of a location group you wish to assign the data store zone to Page history v. 3.1: Added the location_group_id parameter Edit Data Store Zone To edit a label of a particular data store zone: PUT /settings/data_store_zones/:id.xml PUT /settings/data_store_zones/:id.json XML Request example curl -X PUT http://onapp.test/settings/data_store_zones/:id.xml -d '<hypervisor_zone><label>Data_Store_Name</label><location_group_id>1</location_group_ i d></hypervisor_zone>' -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -X PUT http://onapp.test/settings/data_store_zones.json -d '{data_store_group: {label:"Data_Store_name","location_group_id":"1"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where: label* - data_store_zone title location_group_id - ID of a location group you wish to assign the data store zone to. You can change the already assigned location group only if there are no disks or ISOs built on data stores of current zone. Page history v. 3.1: Added the location_group_id parameter Delete Data Store Zone To delete a particular data store zone: DELETE /settings/data_store_zones/:id.xml DELETE /settings/data_store_zones/:id.json XML Request example curl -X DELETE http://onapp.test/settings/data_store_zones/:id.xml -u user:userpass H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X DELETE http://onapp.test/settings/data_store_zones/:id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' You will get a 204 status response on success, and 404 if there is no such a data store zone with a requested ID or you entered incorrect URL. Get the List of Data Stores Attached to Data Store Zone GET /settings/data_store_zones/:data_store_group_id/data_stores.xml GET /settings/data_store_zones/:data_store_group_id/data_stores.json On success, an array of data stores is returned. XML Output example <?xml version="1.0" encoding="UTF-8"?> <data-stores type="array"> <data-store> <label>ds1</label> <created_at type="datetime">2011-01-06T10:54:30Z</created_at> <updated_at type="datetime">2011-02-07T12:27:32Z</updated_at> <data_store_group_id type="integer">5</data_store_group_id> <enabled type="boolean">false</enabled> <id type="integer">1</id> <zombie_disks_size type="integer">110</zombie_disks_size> <ip></ip> <local_compute resource_id type="integer" nil="true"></local_compute resource_id> <data_store_size type="integer">465</data_store_size> <identifier>onapp-ojgg2jk75zfzmw</identifier> </data-store> OnApp Cloud 4.1 API Guide Explanation of the data returned: label - the name of the data store attached to this data store zone OnApp Cloud 4.1 API Guide created_at - time when the DB record was created updated_at - time when the DB record was updated data_store_group_id - the ID of a data store zone to which this data store is attached enabled - true if the data store is enabled and you can create virtual servers on it, otherwise false id - the data store ID zombie_disks_size - the disk space in GB allocated to zombie disks ip - the data store IP address local_compute resource_id - the ID of the compute resource to which this data store is assigned data_store_size - the data store disk capacity in GB identifier - the data store identifier in DB Attach Data Store to Data Store Zone POST /settings/data_store_zones/:data_store_zone_id/data_stores/:id/attach.xml POST /settings/data_store_zones/:data_store_zone_id/data_stores/:id/attach.json XML Request example curl -X POST http://onapp.test/settings/data_store_zones/:data_store_zone_id/data_stores/:data_sto r e_id/attach.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X POST http://onapp.test/settings/data_store_zones/:data_store_zone_id/data_stores/:data_sto r e_id/attach.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Using this request you attach an unassigned data store (:data_store_id*) to a data store zone (:data_store_zone_id*) Detach Data Store from Data Store Zone POST /settings/data_store_zones/:data_store_group_id/data_stores/:id/detach.xml POST /settings/data_store_zones/:data_store_group_id/data_stores/:id/detach.json XML Request example curl -X POST http://onapp.test/settings/data_store_zones/:data_store_zone_id/data_stores/:data_sto r e_id/detach.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -X POST http://onapp.test/settings/data_store_zones/:data_store_zone_id/data_stores/:data_sto r e_id/detach.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Disks Disks provide space for virtual server data. A disk is a partition of a data store that is allocated to a specific virtual server. All CRUD operations are available for disks. Get List of Disks GET /settings/disks.xml GET /settings/disks.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <disks type="array"> <disk> <add_to_freebsd_fstab nil="true"/> <add_to_linux_fstab nil="true"/> <built type="boolean">true</built> <burst_bw type="integer">1000</burst_bw> <bus nil="true"/> <created_at type="datetime">2013-01-21T12:59:06+02:00</created_at> <data_store_id type="integer">6</data_store_id> <disk_size type="integer">60</disk_size> <disk_vm_number type="integer">0</disk_vm_number> <file_system type="symbol">ext3</file_system> <id type="integer">868</id> <identifier>wtqpz628vbdasx</identifier> <iqn nil="true"/> <is_swap type="boolean">false</is_swap> <label nil="true"/> <locked type="boolean">false</locked> <max_bw type="integer">1000</max_bw> <mount_point nil="true"/> <primary type="boolean">true</primary> <updated_at type="datetime">2013-01-21T13:00:18+02:00</updated_at> <virtual_machine_id type="integer">458</virtual_machine_id> <volume_id nil="true"/> <has_autobackups type="boolean">false</has_autobackups> </disk> </disks> Where: add_to_freebsd_fstab - true, if this disk is added to the FreeBSD fstab, otherwise false add_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise false built - true if the disk is built, otherwise false created_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide updated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide data_store_id - the ID of the data store this disk is located disk_size - disk size in GB disk_vm_number - the number of virtual servers using this disk file_system - disk filesystem (ext3 or ext4) id - the disk ID identifier - disk identifier is_swap - true if this is a swap disk, otherwise false label - disk's label locked - true if the disk is locked, otherwise false mount_point - disk mount point. primary - true if the disk is primary. Otherwise false. virtual_machine_id - the ID of the virtual server using this disk volume_id - data store ID has_autobackups - true if the disk has automatic backups set up, otherwise false SolidFire - related parameters: iqn - volume ISCSI qualified name burst_bw - maximum bandwidth allowed set in MB/sec max_bw -maximum bandwidth allowed set in MB/sec Get List of VS Disks To get the list of disks available for a particular VS, use the following request: GET /virtual_machines/:virtual_machine_id/disks.xml GET /virtual_machines/:virtual_machine_id/disks.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <disks type="array"> <disk> <add_to_freebsd_fstab nil="true"/> <add_to_linux_fstab nil="true"/> <built type="boolean">true</built> <burst_bw type="integer">1000</burst_bw> <bus nil="true"/> <created_at type="datetime">2013-01-21T12:59:06+02:00</created_at> <data_store_id type="integer">6</data_store_id> <disk_size type="integer">60</disk_size> <disk_vm_number type="integer">0</disk_vm_number> <file_system type="symbol">ext3</file_system> <id type="integer">868</id> <identifier>wtqpz628vbdasx</identifier> <iqn nil="true"/> <is_swap type="boolean">false</is_swap> <label nil="true"/> <locked type="boolean">false</locked> <max_bw type="integer">1000</max_bw> <mount_point nil="true"/> <primary type="boolean">true</primary> <updated_at type="datetime">2013-01-21T13:00:18+02:00</updated_at> <virtual_machine_id type="integer">458</virtual_machine_id> <volume_id nil="true"/> <has_autobackups type="boolean">false</has_autobackups> </disk> </disks> Where: add_to_freebsd_fstab - true, if this disk is added to the FreeBSD fstab, otherwise false add_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise false built - true if the disk is built, otherwise false created_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_store_id - the ID of the data store this disk is located disk_size - disk size in GB disk_vm_number - the number of virtual servers using this disk file_system - disk filesystem (ext3 or ext4) id - the disk ID identifier - disk identifier is_swap - true if this is a swap disk, otherwise false label - disk's label locked - true if the disk is locked, otherwise false mount_point - disk mount point. primary - true if the disk is primary. Otherwise false. virtual_machine_id - the ID of the virtual server using this disk OnApp Cloud 4.1 API Guide volume_id - data store ID OnApp Cloud 4.1 API Guide has_autobackups - true if the disk has automatic backups set up, otherwise false. SolidFire - related parameters: iqn - volume ISCSI quialified name burst_bw - maximum bandwidth allowed set in MB/sec max_bw -maximum bandwidth allowed set in MB/sec Add New Disk POST /virtual_machines/:virtual_machine_id/disks.xml POST /virtual_machines/:virtual_machine_id/disks.json XML Request example curl -i -X POST http://onapp.test/virtual_machines/:virtual_machine_id/disks.xml -d '<disk><primary>0</primary><disk_size>5</disk_size><file_system>ext4</file_system><da t a_store_id>5</data_store_id><mount_point>true</mount_point><hot_attach>1</hot_attach> < min_iops>600</min_iops><is_swap>true</is_swap><require_format_disk>1</require_format_ d isk><add_to_linux_fstab>true</add_to_linux_fstab><add_to_freebsd_fstab>false</add_to_ f reebsd_fstab></disk>' -u user:userpass -H 'Accept: application/xml' -H 'ContentJSON type: Requestapplication/xml' example curl -i -X POST http://onapp.test/virtual_machines/:virtual_machine_id/disks.json -d '{"disk":{"primary":"0","disk_size":"2","file_system":"ext4","data_store_id":"5","lab e l":"qwerq", "require_format_disk":"1","mount_point":"/mnt/aaa","hot_attach":"1","min_iops":"600", " add_to_linux_fstab":"true","add_to_freebsd_fstab":"false"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' To add a new disk, send the following parameters: data_store_id* - The ID of a data store where this disk is located label - disk label primary - set 1 if the disk is primary, otherwise set 0 disk_size* - the disk space in GB is_swap - set true if this is a swap disk, otherwise set false mount_point - a physical location in the partition used as a root filesystem hot_attach -set 1 to enable hot attachment, otherwise set 0. In this case virtual server will not be stopped when adding a disk. Hot attach option is only available for virtual servers on KVM 6/ CentOS 6 compute resources. min_iops - minimum number of IO operations per second (this is a SolidFire related parameter) add_to_linux_fstab -set true to add the disk to your Linux fstab file, otherwise set false add_to_freebsd_fstab - set true to add the disk to your FreeBSD fstab file, otherwise set false require_format_disk – set 1 to format disk, otherwise set 0 OnApp Cloud 4.1 API Guide file_system - for Linux templates, you can choose ext4 file system instead of the ext3 default one. To set the file-system parameter, you must set the require_format_disk option OnApp Cloud 4.1 API Guide Edit Disk PUT /settings/disks/:id.xml PUT /settings/disks/:id.json XML Request example curl -i -X PUT http://onapp.test/settings/disks/:id.xml -d '<disk><label>for BU</label><disk_size>1</disk_size><require_format_disk>1</require_format_disk><add_to _ linux_fstab>1</add_to_linux_fstab><add_to_freebsd_fstab>0</add_to_freebsd_fstab><moun t _point>/mnt/disk1</mount_point><file_system>ext4</file_system></disk>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: JSON application/xml' Request example curl -i -X PUT http://onapp.test/settings/disks/:id.json -d '{"disk":{"label":"for BU", "disk_size":"1", "require_format_disk":"1", "add_to_linux_fstab":"1", "add_to_freebsd_fstab":"0", "mount_point":"/mnt/disk1", "file_system":"ext4"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: label - disk label disk_size - the disk space in GB require_format_disk – set 1 to format disk, otherwise set 0 add_to_linux_fstab - set 1 to add the disk to your Linux fstab file, otherwise set 0 add_to_freebsd_fstab - set 1 to add the disk to your FreeBSD fstab file, otherwise set 0 mount_point - a physical location in the partition used as a root file system file_system - for Linux templates, you can choose ext4 file system instead of the ext3 default one To set the file system parameter, you must set the require_format_disk option min_iops - minimum number of IO operations per second. This is a SolidFire related parameter. Returns HTTP 204 response on successful deletion, or HTTP 404 when a disk with the ID specified is not found, or the URL requested is incorrect. You also can edit a disk through another URL: onapp.test/virtual_machines/:virtual_machines_id/disks/:id You can not decrease disk size for Windows-based and FreeBSD-based virtual servers. Only the increase disk size option is available. You can't resize the primary disk for FreeBSD-based virtual servers. Decreasing disk size for Linux-based virtual servers may lead to filesystem inconsistencies. Make sure you have current backups before proceeding. Migrate Disk OnApp Cloud 4.1 API Guide To migrate a VS disk to another data store, use the following request: POST /virtual_machines/:virtual_machine_id/disks/:disk_id/migrate.xml POST /virtual_machines/:virtual_machine_id/disks/:disk_id/migrate.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/disks/:disk_id/migrate.xml d '<disk><data_store_id>6</data_store_id></disk>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/disks/:disk_id/migrate.json d '{"disk":{"data_store_id":"6"}}'-H 'Accept: application/json' -H 'Content-type: application/json' Where: data_store_id* - the ID of a data store you migrate the disk to. Note, that you can only move disks between data stores which are attached to the same compute resource or compute zone. Delete Disk DELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.xml DELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.json XML Request example curl -i -X DELETE http://onapp.test/settings/disks/:id.xml?force=1&shutdown_type=graceful&required_star t up=0 -u user:userpass -H 'Accept: application/xml' -H 'Contenttype:application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/disks/:id.json?force=1&shutdown_type=graceful&required_sta r tup=0 -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json' shutdown_type - type of the VS shutdown: hard, graceful or soft required_startup - set 1 to start up the VS automatically after deleting a disk, otherwise set 0 Returns HTTP 204 response on successful deletion, or HTTP 404 when a disk with the ID specified is not found, or the URL requested is incorrect. View Disk IOPS To view Input/Output statistics for your disks, use the following method: GET /settings/disks/:id/usage.xml OnApp Cloud 4.1 API Guide GET /settings/disks/:id/usage.json OnApp Cloud 4.1 API Guide XML Output example <?xml version="1.0" encoding="UTF-8"?> <disk_hourly_stats type="array"> <disk_hourly_stat> <disk_id type="integer">64</disk_id> <created_at type="datetime">2011-07-19T13:00:10Z</created_at> <updated_at type="datetime">2011-07-19T13:00:10Z</updated_at> <writes_completed type="integer">345685</writes_completed> <stat_time type="datetime">2011-07-19T13:00:00Z</stat_time> <data_written type="integer">11061920</data_written> <data_read type="integer">53840</data_read> <id type="integer">1028</id> <user_id type="integer">13</user_id> <virtual_machine_id type="integer">34</virtual_machine_id> <reads_completed type="integer">1684</reads_completed> </disk_hourly_stat> ... <disk_hourly_stat></disk_hourly_stat> ... </disk_hourly_stats> Where: disk_id - the ID of a disk created_at - the timestamp in DB when the record was created updated_at - the timestamp in DB when the record was updated data_read – the amount of data read from this disk data_written - the amount of data written to the disk stat_time - the time when statistics were generated writes_completed - the number of completed write operations reads_completed - the number of completed read operations user_id – ID of the user whose VS is using this disk virtual_machine_id – ID of the VS using this disk Use the following formulas to convert disk usage statistics data received in the API output: (data_read / 1024) / 3600 (data_written / 1024) / 3600 Build Disk To build a disk, use the following methods: POST /settings/disks/:id/build.xml POST /settings/disks/:id/build.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST http://onapp.test/settings/disks/:disk_id/build.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POSThttp://onapp.test/settings/disks/:disk_id/build.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: disk_id* - the ID of the disk you want to build Unlock Disk To unlock a disk, use the following methods: POST /settings/disks/:disk_id/unlock.xml POST /settings/disks/:disk_id/unlock.json XML Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/unlock.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/disks/:disk_id/unlock.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Get List of Backups Available for a Disk To get the list of backups available to a particular disk, use the following method: GET /settings/disks/:disk_id/backups.xml GET /settings/disks/:disk_id/backups.json An array of backups with their details is returned on success. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <backups type="array"> <backup> <disk_id type="integer">112</disk_id> <built_at type="datetime">2011-07-27T15:19:47Z</built_at> <operating_system_distro>rhel</operating_system_distro> <created_at type="datetime">2011-07-27T15:16:18Z</created_at> <template_id type="integer">1</template_id> <operating_system>linux</operating_system> <updated_at type="datetime">2011-07-27T15:19:47Z</updated_at> <backup_type>days-autobackup</backup_type> <allowed_swap type="boolean">true</allowed_swap> <allow_resize_without_reboot type="boolean">true</allow_resize_without_reboot> <id type="integer">12</id> <backup_server_id type="integer">1</backup_server_id> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <backup_size>315552</backup_size> <min_disk_size type="integer">5</min_disk_size> <identifier>ytfgbj2drbs2d7</identifier> <locked type="boolean">false</locked> <built type="boolean">true</built> </backup> ... <backup></backup> ... </backups> Where: backup – an array of backup details disk_id – ID of the disk built_at – time, when the disk was built operating_system_distro – distribution of the operating system template_id – ID of the template, used for assigned VS operating_system – OS of the virtual server, which is allocated at this disk backup_type – type of the backup (type of period: days/weeks/months/years) allowed_swap – true, if this is a swap disk; otherwise false allow_resize_without_reboot – true, if VS's CPU and RAM can be resized without reboot id – ID of the backup backup_server_id – the ID of the backup server where the backup is stored allowed_hot_migrate – true, if hot migration is allowed backup_size - size of the backup in Kilobytes min_disk_size – minimum disk size required in GB identifier – identifier in the DB locked – true, if the disk is locked built - true, if the disk is built DNS Setup OnApp Cloud 4.1 API Guide The DNS setup chapter provides OnApp customers with information how to create a DNS hostname. After you create a DNS hostname, you get access to creating and managing DNS zones. Get DNS Domain Details To view the DNS domain details, send the following request: GET /settings/dns_setup.xml GET /settings/dns_setup.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <dns_setup> <domain>mydns.com</domain> </dns_setup> Where: domain – DNS domain name. Set Up DNS Domain To set up DNS domain, use the following methods: POST /settings/dns_setup.xml POST /settings/dns_setup.json XML Request example curl -i -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass http://onapp.test/settings/dns_setup.xml -X POST -d "<dns_setup><domain>new-mydns.com</domain></dns_setup>" JSON Request example curl -i -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass http://onapp.test/settings/dns_setup.json -X PUT -d '{"dns_setup": {"domain": "my-dns2.com"}}' Where: The only required parameter is domain* – DNS domain name. XML Response example <?xml version="1.0" encoding="UTF-8"?> <dns_setup> <domain>mydns.com</domain> </dns_setup> Edit DNS Domain To edit DNS domain, send the following request: PUT /settings/dns_setup.xml PUT /settings/dns_setup.json XML Request example OnApp Cloud 4.1 API Guide curl -i -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass http://onapp.test/settings/dns_setup.xml -X PUT -d "<dns_setup><domain>my-dns.com</domain></dns_setup>" JSON Request example curl -i -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass http://onapp.test/settings/dns_setup.json -X PUT -d '{"dns_setup": {"domain": "my-dns2.com"}}' Where: The only required parameter is domain* – DNS domain name. You will get a 204 status response on success and 404 if the domain name is invalid or you entered incorrect URL. Get List of Glue Records To get the list of glue records, use the following request: GET /settings/dns_setup/glue_records.xml GET /settings/dns_setup/glue_records.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <hash> <ns1>109.23.125.206</ns1> <ns2>109.23.125.206</ns2> <ns3>109.23.125.206</ns3> <ns4>109.23.125.206</ns4> </hash> Where: ns1, ns2, ns3, ns4 – DNS domain glue records. DNS Zones OnApp DNS Zone feature allows you to manage your and your clients' domain DNS. Each time DNS zone, record or setup settings are refreshed, the DNS configuration is immediately updated on the DNS vendor server. Get List of Own DNS Zones To get the list of your own DNS zones: GET /dns_zones.xml GET /dns_zones.json XMLResponse example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <dns_zones type="array"> <dns_zone> <name>dns_example</name> <created_at type="datetime">2011-12-19T12:51:02Z</created_at> <updated_at type="datetime">2011-12-19T12:51:02Z</updated_at> <id type="integer">5</id> <user_id type="integer">1</user_id> </dns_zone> Where: name – DNS zone name created_at – the date when the DNS zone was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – DNS zone ID user_id – the ID of a user who has created a DNS zone Get Domain Zone Details The following method returns details for a particular domain zone: GET /dns_zones/:id.xml GET /dns_zones/:id.json XMLOutput example <?xml version="1.0" encoding="UTF-8"?> <dns_zone> <name>abc3.com</name> <created_at type="datetime">2011-12-19T12:51:02Z</created_at> <updated_at type="datetime">2011-12-19T12:51:02Z</updated_at> <id type="integer">5</id> <user_id type="integer">1</user_id> </dns_zone> Where: name– DNS zone name created_at – the date when the DNS zone was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – DNS zone ID user_id – the ID of a user who has created a DNS zone Get List of Users DNS Zones To get the list of DNS zones created by users: GET /dns_zones/user.xml GET /dns_zones/user.json XMLOutput example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <dns_zones type="array"> <dns_zone> <name>yoyohow.com</name> <created_at type="datetime">2011-12-30T11:56:55Z</created_at> <updated_at type="datetime">2011-12-30T11:56:55Z</updated_at> <id type="integer">13</id> <user_id type="integer">1</user_id> </dns_zone> </dns_zones> Where: name – DNS zone name created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – DNS zone ID user_id – the ID of a user who has created a DNS zone Add DNS Zone Use the following methods to create a new DNS zone: POST /dns_zones.xml POST /dns_zones.json XML Request example curl -i -X POST http://onapp.test/dns_zones.xml -d '<dns_zone><name>domain.com</name><auto_populate>1</auto_populate></dns_zone>' u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POSThttp://onapp.test/dns_zones.json-d '{"dns_zone":{"name":"domain.com", "auto_populate":"1"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: name* – name of a DNS zone you create auto_populate – autopopulate option lets you automatically import your existing DNS settings. To autopopulate your DNS settings, set the autopopulate value 1, otherwise set 0. You will get a 200 status response on success, and 404 if there is no DNS zone with a requested ID or you entered incorrect URL. Delete DNS Zone To delete a DNS zone, use the following API call: DELETE /dns_zones/:id.xml DELETE /dns_zones/:id.json XML Request example OnApp Cloud 4.1 API Guide Curl -i -X DELETE --url http://onapp.test/dns_zones/:dns_zone_id.xml -u user:userpass JSON Request example curl -i -X DELETE --url http://onapp.test/dns_zones/:dns_zone_id.json -u user:userpass You will get a 204 status response on success, and 404 if there is no DNS zone with a requested ID or you entered incorrect URL. Get List of Name Servers To get the list of name servers, use the following request: GET /dns_zones/name_servers.xml GET /dns_zones/name_servers.json XML Output example <strings type="array"> <string>ns1.ay.my</string> <string>ns2.ay.my</string> <string>ns3.ay.my</string> <string>ns4.ay.my</string> </strings> Get List of DNS Zone Records Use the following API calls to view DNS zone records: GET /dns_zones/:dns_zone_id/records.xml GET /dns_zones/:dns_zone_id/records.json XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> dns_zone> <name>example.com</name> <created_at type="datetime">2012-01-19T16:53:47Z</created_at> <updated_at type="datetime">2012-01-19T16:53:47Z</updated_at> <id type="integer">322</id> <user_id type="integer">1</user_id> <records> <MX type="array"> <dns_record> <name>@</name> <ttl type="integer">3600</ttl> <priority type="integer">10</priority><id type="integer">3540</id> <type>MX</type> <hostname>mx1.me.com.akadns.net</hostname> </dns_record> </MX> <SRV type="array"> <dns_record> <name>_xmpp._tcp</name> <ttl type="integer">86400</ttl> <port type="integer">5222</port> <weight type="integer">1</weight> <priority type="integer">0</priority> <id type="integer">4533</id><type>SRV</type> <hostname>jabber.example.com</hostname> </dns_record> </SRV> <A type="array"> <dns_record> OnApp Cloud 4.1 API Guide <name>@</name> <ttl type="integer">20</ttl> <id type="integer">3547</id> <type>A</type> <ip>17.172.192.8</ip> </dns_record> </A> <CNAME type="array"> <dns_record> <name>www</name> <ttl type="integer">3600</ttl> <id type="integer">3551</id> <type>CNAME</type> <hostname>www.me.com.edgekey.net</hostname> </dns_record> </CNAME> <AAAA type="array"> <dns_record> <name>sdfgeg</name> <ttl type="integer">456</ttl> <id type="integer">4052</id> <type>AAAA</type> <ip>::</ip> </dns_record> </AAAA> <TXT type="array"> <dns_record> <name>@</name> <ttl type="integer">3600</ttl> <id type="integer">3546</id> <txt>v=spf1 ip4:17.0.0.0/8 ~all</txt> <type>TXT</type> </dns_record> </TXT> <NS type="array"> <dns_record> <name>@</name> <ttl type="integer">86400</ttl> <id type="integer">3555</id> <type>NS</type> <hostname>ns1.testeteststestt.com</hostname> </dns_record> </NS> <SOA type="array"> <dns_record> <name>@</name> <serial type="integer">2010111206</serial> <primaryNs>ns1.testeteststestt.com</primaryNs> <retry type="integer">172800</retry> <ttl type="integer">86400</ttl> <id type="integer">3539</id> <refresh type="integer">12096007</refresh> <type>SOA</type> <minimum type="integer">1200</minimum> <expire type="integer">2592000</expire> <hostmaster>admin.example.com</hostmaster> </dns_record> OnApp Cloud 4.1 API Guide </SOA> </records> </dns_zone> Where: name – DNS zone name. created_at – the date when the DNS zone was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format id – DNS zone ID user_id – the ID of a user who has created a DNS zone The array of DNS records sorted by type with their details: MX – the array of mail exchange records with the following parameters: name – DNS domain set for the record ttl – time to live value id – DNS zone ID type – the type of the record. For this array, it is MX priority - the mail server preference hostname – DNS hostname SRV – the array of service records with the following parameters: name – DNS domain set for the record ttl – time to live value port – the port on this target host of this service. weight – the proportion of traffic the server pointed to will handle. priority – the priority of the target host id – DNS zone ID hostname – DNS hostname A – the array of A host records with the following parameters: name – DNS domain set for the record ttl – time to live value id – DNS zone ID type – the type of the record. For this array, it is A ip – domain IP CNAME – the array of CNAME records with the following parameters: name – DNS domain set for the record ttl – time to live value id – DNS zone ID type – the type of the record. For this array, it is CNAME hostname – DNS hostname AAAA – the array of AAAA record with the following parameters: OnApp Cloud 4.1 API Guide name – DNS domain set for the record OnApp Cloud 4.1 API Guide ttl – time to live value id – DNS zone ID type – the type of the record. For this array, it is AAAA ip – domain IP TXT – the array of TXT record with the following parameters: name – DNS domain set for the record ttl – time to live value id – DNS zone ID txt – TXT value type - the type of the record. For this array, it is TXT NS – the array of name server records with the following parameters: name – DNS domain set for the record ttl – time to live value id – DNS zone ID type – the type of the record. For this array, it is NS hostname – DNS hostname SOA – the array of start of authority record with the following parameters: name – DNS domain set for the record serial – DNS zone serial number primaryNs – primary name server retry - the amount of time your secondary name servers will wait to contact the primary name server again if the last attempt failed ttl – time to live value id – DNS zone ID refresh – the number of seconds between update requests type – DNS record name. For this array, it is SOA minimum – value of negative caching (in seconds) expire - the number of seconds a server will wait before considering the data invalid if it cannot reach the primary name server hostmaster – a hostmaster e-mail address Get DNS Record Details GET /dns_zones/:dns_zone_id/records/:record_id.xml GET /dns_zones/:dns_zone_id/records/:record_id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <dns_record> <name>sub2</name> <ttl type="integer">121</ttl> <id type="integer">2689</id> <type>A</type> <ip>127.0.0.0</ip> </dns_record> OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide name – DNS zone name ttl – the time to live value type – the record type. This can be one of the following records: NS, A, AAAA, CNAME, MX, TXT or SRV id – DNS zone ID ip – domain IP Add DNS Record To create a DNS record: POST /dns_zones/:dns_zone_id/records.xml POST /dns_zones/:dns_zone_id/records.json XML Request example curl -i-X POST http://onapp.test/dns_zones/:dns_zone_id/records.xml -d "<dns_record><name>test</name><ttl>111</ttl><type>A</type><ip>127.1.1.1</ip></dns_rec o rd>" -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/dns_zones/:dns_zone_id/records.json -d '{"dns_record":{"name":"TEST_NAME",ttl:"111",type:"A",ip:"127.1.1.1"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: name* - DNS record name ttl* - the time to live value type* - the record type ip* - host IP ( for A and AAAA records) XML Response example <?xml version="1.0" encoding="UTF-8"?> <dns_record> <name>test23</name> <ttl>111</ttl> <id type="integer">2696</id> <type>A</type> <ip>127.1.1.1</ip> </dns_record> Starting from the 3.0.6 version of the OnApp Cloud it is possible to use underscore character in the CNAME records. Edit DNS Records To edit a DNS record: PUT /dns_zones/:dns_zone_id/records/:record_id.xml PUT /dns_zones/:dns_zone_id/records/:record_id.json XML Request example OnApp Cloud 4.1 API Guide curl -i-X PUT http://onapp.test/dns_zones/:dns_zone_id/records/:record_id.xml d "<dns_record><name>test</name><ttl>86400</ttl></dns_record>" -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT http://onapp.test/dns_zones/:dns_zone_id/records/:record_id.json d '{"dns_record":{"name":"TEST_NAME","ttl":"111"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' You can edit the following parameters for the following DNS records: MX record: name* – DNS domain set for the record ttl* – time to live value priority* – the mail server preference hostname* – DNS hostname SRV record: name* – DNS domain set for the record ttl* – time to live value port* – the port on this target host of this service. weight* – the proportion of traffic the server pointed to will handle. priority* – the priority of the target host hostname* – DNS hostname A record: name* – DNS domain set for the record ttl* – time to live value ip* – domain IP CNAME record name* – DNS domain set for the record ttl* – time to live value hostname* – DNS hostname AAAA record name* – DNS domain set for the record ttl* – time to live value ip* – domain IP TXT record name* – DNS domain set for the recor ttl* – time to live value txt* – TXT value NS record name* – DNS domain set for the record ttl* – time to live value hostname* – DNS hostname SOA record name* – DNS domain set for the record serial* – zone serial number primaryNs* – primary name server retry* – the amount of time your secondary name servers will wait to contact the primary name server again if the last attempt failed (in seconds) ttl* – time to live value OnApp Cloud 4.1 API Guide refresh* – the number of seconds between update requests OnApp Cloud 4.1 API Guide minimum* – value of negative caching (in seconds) expire* – the number of seconds a server will wait before considering the data invalid if it cannot reach the primary name server hostmaster * – a hostmaster email address XML Response example <?xml version="1.0" encoding="UTF-8"?> <dns_record> <name>@</name> <ttl type="integer">1001</ttl> <id type="integer">2680</id> <type>NS</type> <hostname>ns1.worldcdn-beta-operator.doubleukay.com</hostname> </dns_record> You will get a 204 status response on success, and 404 if there is no DNS zone with a requested ID or you entered incorrect URL. Delete DNS Record To delete a record: DELETE /dns_zones/:dns_zone_id/records/:record_id.xml DELETE /dns_zones/:dns_zone_id/records/:record_id.json XML Request example *curl -i-X DELETE --url http://onapp.test/dns_zones/:dns_zone_id/records/:record_id.xml * -u user:userpass JSON Request example curl -X DELETE --url http://onapp.test/dns_zones/:dns_zone_id/record/:record_id.json -u user:userpass You will get a 204 status response on success, and 404 if there is no DNS record with a requested ID or you entered incorrect URL. Embed Statistics Charts The following request allows to get an OnApp statistics chart HTML code that can be then used for embedding to third party applications. 1. Include jquery (if you didn't include it before in your code): http://onapp.test/assets/jquery.js 2. Include highcharts: http://onapp.test/assets/highcharts/highcharts.js 3. Get the required chart with the following API call: OnApp Cloud 4.1 API Guide curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/cpu_usage.char t HTML Example <!DOCTYPE html> <html> <head> <title>Testing</title> </head <body> <!--Include jquery--> <script src="http://onapp.test/assets/jquery.js"></script> <!--Include highcharts--> <script src="http://onapp.test/assets/highcharts/highcharts.js"></script> <!--Output from the .chart request--> <div class='chart'> <div id="highcharts-interface_usage-7b20c219e68594228a6d"> </div> <script type="text/javascript"> //<![CDATA[ new Highcharts.Chart({chart: {renderTo: 'highcharts-interface_usage-7b20c219e68594228a6d', defaultSeriesType: 'line', minWidth: 700, height: 350, zoomType: 'x'}, lang: {decimalPoint: '.', downloadPNG: 'Download PNG image', downloadJPEG: 'Download JPEG image', downloadPDF: 'Download PDF document', downloadSVG: 'Download SVG vector image', exportButtonTitle: 'Export to raster or vector image', loading: 'Loading....', months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], printButtonTitle: 'Print the chart', resetZoom: 'Reset zoom', resetZoomTitle: 'Reset zoom level 1:1', thousandsSep: 3, weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']}, credits: {enabled: false}, title: {text: 'Instant', x: -20}, xAxis: {type: 'datetime', labels: {formatter: function() { return Highcharts.dateFormat("%e %b %H:%M", this.value); }}}, yAxis: {title: {text: '<span class="translation_missing" title="translation missing: en.mbps">Mbps</span>'}}, plotOptions: {series: {marker: {enabled: false, lineWidth: 0, states: {hover: {enabled: true}}}}}, tooltip: {shared: true, crosshairs: true}, series: [{name: 'Data Sent', data: [[1361542648000, 0.0]]}, {name: 'Data Received', data: [[1361542648000, 0.0]]}]}); //]] </script> </div> <div class='chart'><div id="highcharts-interface_usage-20c18666715eb47e1c92"></div> <script type="text/javascript"> //<![CDATA[ new Highcharts.Chart({chart: {renderTo: 'highcharts-interface_usage-20c18666715eb47e1c92', defaultSeriesType: 'line', minWidth: 700, height: 350, zoomType: 'x'}, lang: {decimalPoint: '.', OnApp Cloud 4.1 API Guide downloadPNG: 'Download PNG image', downloadJPEG: 'Download JPEG image', OnApp Cloud 4.1 API Guide downloadPDF: 'Download PDF document', downloadSVG: 'Download SVG vector image', exportButtonTitle: 'Export to raster or vector image', loading: 'Loading....', months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], printButtonTitle: 'Print the chart', resetZoom: 'Reset zoom', resetZoomTitle: 'Reset zoom level 1:1', thousandsSep: 3, weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']}, credits: {enabled: false}, title: {text: 'Hourly', x: -20}, xAxis: {type: 'datetime', labels: {formatter: function() { return Highcharts.dateFormat("%e %b %H:%M", this.value); }}}, yAxis: {title: {text: '<span class="translation_missing" title="translation missing: en.mbps">Mbps</span>'}}, plotOptions: {series: {marker: {enabled: false, lineWidth: 0, states: {hover: {enabled: true}}}}}, tooltip: {shared: true, crosshairs: true}, series: [{name: 'Data Sent', data: [[1361358000000, 0.01], [1361361600000, 0.01], [1361365200000, 0.0]]}, {name: 'Data Received', data: [[1361358000000, 0.16], [1361361600000, 0.29], [1361365200000, 0.0]]}]}); //]] </script> </div> OnApp Cloud 4.1 API Guide </body > </html > 4. Embed the HTML to your page. Firewall Rules for VSs Firewall rules are applied to the VSs of your cloud to prevent unauthorized or unwanted requests to their network interfaces. You can configure your firewall to Accept/Drop specific request types. All methods are available for this class. Get List of Firewall Rules To get the list of firewall rules assigned to a VS, use the following request: GET /virtual_machines/:virtual_machine_id/firewall_rules.xml GET /virtual_machines/:virtual_machine_id/firewall_rules.json XML Response example <?xml version="1.0" encoding="UTF-8"?> <firewall_rules> <firewall_rule> <position>1</position> <address> </address> <created_at>2011-04-20T12:52:10+03:00</created_at> <command>ACCEPT</command> <updated_at>2011-04-20T12:52:10+03:00</updated_at> <port>21</port> <protocol>TCP</protocol> <id>1</id> <network_interface_id>5</network_interface_id> </firewall_rule> </firewall_rules> Where: position – the rule priority address* – the IP address for which this rule is active. If none is specified, all IPs will be subject to this rule. created_at – the date when the record in DB was created command – the action which will be performed with the IP specified by the address parameter updated_at – the date when the record was updated in DB port – the port for which this rule is active. If the field is empty, the rule will apply to all ports protocol – the IP protocol (TCP or UDP)for which this rule is active id – the ID of this record network_interface_id – the ID of a network interface for which this rule is active Apply Firewall Rule To apply firewall rules for a virtual server: POST /virtual_machines/:virtual_machine_id/update_firewall_rules.xml POST /virtual_machines/:virtual_machine_id/update_firewall_rules.json OnApp Cloud 4.1 API Guide XML request example: OnApp Cloud 4.1 API Guide curl -i -X POST -u user:userpass -H 'Accept: application/xml' --url http://onapp.test/virtual_machines/:virtual_machine_id/update_firewall_rules.xm l JSON request example: curl -i -X POST -u user:userpass -H 'Accept: application/xml' --url http://onapp.test/virtual_machines/:virtual_machine_id/update_firewall_rules.jso n Add Firewall Rule To add a firewall rule, use the request listed below. After you add a rule, you have to apply it to initiate a transaction responsible for running firewall rules. See the Apply Firewall Rule section for details. POST /virtual_machines/:virtual_machine_id/firewall_rules.xml POST /virtual_machines/:virtual_machine_id/firewall_rules.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d '<?xml version="1.0" encoding="UTF8"?><firewall_rule><address></address><command>DROP</command><port></por t><protocol>TCP</protocol><network_interface_id>105</network_interface_id></firewall_ r ule>' --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"firewall_rule":{"address":"","command":"DROP","protocol":"TCP","network_interface_ i d":"105","port":""}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules.json Send the following parameters: address* - Set the IP address for which this rule is active. Leave the empty field to apply this rule to all IPs Enter hyphen-separated IPs to apply the rule to an IP range (e.g. 192.168.1.1-192.168.1.10) Enter the IPs with slash to apply the rule to CIDR (e.g. 192.168.1.1/24) command* - sets the command to ACCEPT or DROP the abovementioned IPs port - sets the port addresses Leave the empty field to apply the rule to all ports Enter colon-separated ports to apply the rule to a port range (e.g. 1024:1028) Enter comma-separated ports to apply the rule to the list of ports (e.g. 80,443,21) protocol* - protocol type (TCP or UDP) network_interface_id* - interface of the network Edit Firewall Rule To edit a firewall rule, use the following request: PUT /virtual_machines/:virtual_machine_id/firewall_rules/:id.xml OnApp Cloud 4.1 API Guide PUT /virtual_machines/:virtual_machine_id/firewall_rules/:id.json OnApp Cloud 4.1 API Guide XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<firewall_rule><address>192.168.128.133</address><command>ACCEPT</command><port>70</ p ort><protocol>TCP</protocol><network_interface_id>105</network_interface_id></firewal l _rule>' http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"firewall_rule":{"address":"192.168.128.133","command":"ACCEPT","port":"70","protoc o l":"TCP","network_interface_id":"105"}}' -url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.json You can edit the following parameters: address* - Set the IP address for which this rule is active. Leave the empty field to apply this rule to all IPs Enter hyphen-separated IPs to apply the rule to an IP range (e.g. 192.168.1.1-192.168.1.10) Enter the IPs with slash to apply the rule to CIDR (e.g. 192.168.1.1/24) command - sets the command to ACCEPT or DROP the abovementioned IPs port - sets the port addresses Leave the empty field to apply the rule to all ports Enter colon-separated ports to apply the rule to a port range (e.g. 1024:1028) Enter comma-separated ports to apply the rule to the list of ports (e.g. 80,443,21) protocol - protocol type (TCP or UDP) network_interface_id - interface of the network You will get a 204 status response on success, and 404 if there is no firewall rule with a requested ID or you entered incorrect URL. Delete Firewall Rule To delete a firewall rule, use the following request: DELETE /virtual_machines/:virtual_machine_id/firewall_rules/:id.xml DELETE /virtual_machines/:virtual_machine_id/firewall_rules/:id.json XML Request example curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.xml JSON Request example curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:id.json To destroy several firewall rules: OnApp Cloud 4.1 API Guide DELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.xml DELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.json XML Request example curl -X DELETE -u user:userpass http://onapp.test/virtual_machines/omxa18ecx5e5y1/firewall_rules/destroy_batch.xml?id s =24,25 -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X DELETE -u user:userpass http://onapp.test/virtual_machines/:id/firewall_rules/destroy_batch.json?ids=20,22 H 'Accept: application/json' -H 'Content-type: application/json' You will get a 204 status response on success, and 404 if there is no firewall rule with a requested ID or you entered incorrect URL. Change Firewall Rule Position GET GET /virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_id/move.xml /virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_id/move.json XML Request example curl -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_ i d/move.xml?position=down -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example: curl -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_ i d/move.json?position=up -H 'Accept: application/json' -H 'Content-type: application/json' To change a firewall rule position, specify the following parameters: virtual_machine_id - ID of a virtual server the firewall rule belongs to firewall_rule_id - ID of the firewall rule position - specify the position change: up or down Set Default Firewall Rules To set default firewall rules for a VS (either DROP or ACCEPT), you need to set the rule for each network interface the VS is using. To do so, check the network interface ID and run the following request: PUT /virtual_machines/:virtual_machine_id/network_interfaces/:id.xml PUT /virtual_machines/:virtual_machine_id/network_interfaces/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network_interface><default_firewall_rule>ACCEPT</default_firewall_rule></network_in t erface>' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:network_in t erface_id.xml JSON Request example curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network_interface":{"default_firewall_rule":"DROP"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:network_in t erface_id.json Where: default_firewall_rule* - set default firewall rule for the particular VS network interface – either DROP or ACCEPT Firewalls Firewalls are Vyatta Community Edition firewall used used for managing VLANs and route VS networking traffic in and out of OnApp. Get List of Firewalls To view the list of firewalls: GET /settings/firewalls.xml GET /settings/firewalls.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <firewalls type="array"> <firewall> <created_at type="datetime">2012-08-30T17:51:28+03:00</created_at> <firewall_cluster_id type="integer" nil="true"/> <id type="integer">1</id> <inside_cidr type="integer">24</inside_cidr> <inside_interface>eth1</inside_interface> <inside_ip_address>192.168.1.1</inside_ip_address> <name_of_default_rule/> <outside_cidr type="integer">24</outside_cidr> <outside_gateway_address>87.116.6.254</outside_gateway_address> <outside_interface>eth0</outside_interface> <outside_ip_address>87.116.6.249</outside_ip_address> <password>vyatta</password> <updated_at type="datetime">2012-08-30T18:16:57+03:00</updated_at> <username>vyatta</username> </firewall> </firewalls> Where: created_at — the date when the rule was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at — the date when the rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format OnApp Cloud 4.1 API Guide firewall_cluster_id - ID of a Vyatta firewall cluster OnApp Cloud 4.1 API Guide id - ID of the Vyatta Firewall rule inside_cidr - internal IP address prefix size inside_interface - interface used for managing firewall via CP inside_ip_address - IP address used to manage firewall via CP name_of_default_rule - default firewall settings for new VSs (DROP/ACCEPT) outside_cidr_type - external IP address prefix size outside_gateway_address - external gateway address outside_interface - external firewall interface outside_ip_address - external firewall IP preshared_cluster_secret - Vyatta shared key for heartbeat authentication password - password for remote Vyatta management username - specify username for the remote Vyatta management Get Firewall Details To get details of a particular firewall: GET /settings/firewalls/:id.xml GET /settings/firewalls/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <firewall> <created_at type="datetime">2012-08-30T17:51:28+03:00</created_at> <firewall_cluster_id type="integer" nil="true"/> <id type="integer">1</id> <inside_cidr type="integer">24</inside_cidr> <inside_interface>eth1</inside_interface> <inside_ip_address>192.168.1.1</inside_ip_address> <name_of_default_rule/> <outside_cidr type="integer">24</outside_cidr> <outside_gateway_address>87.116.6.254</outside_gateway_address> <outside_interface>eth0</outside_interface> <outside_ip_address>87.116.6.249</outside_ip_address> <password>vyatta</password> <preshared_cluster_secret nil="true"/> <updated_at type="datetime">2012-08-30T18:16:57+03:00</updated_at> <username>vyatta</username> </firewall> Where: created_at — the date when the rule was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at — the date when the rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format firewall_cluster_id - ID of the Vyatta firewall cluster id - ID of the Vyatta Firewall rule inside_cidr - internal CIDR notation inside_interface - interface used for managing firewall via CP inside_ip_address - IP address used to manage firewall via CP OnApp Cloud 4.1 API Guide name_of_default_rule - default firewall settings for new VSs (DROP/ACCEPT) outside_cidr_type - external CIDR notation OnApp Cloud 4.1 API Guide outside_gateway_address - external gateway address outside_interface - external firewall interface outside_ip_address - external firewall IP preshared_cluster_secret - Vyatta shared key for heartbeat authentication password - password for remote Vyatta management username - specify username for the remote Vyatta management Add Firewall POST /settings/firewalls.xml POST /settings/firewalls.json XML Request example curl -i POST -d '<firewall><inside_ip_address>192.168.1.34</inside_ip_address><inside_cidr>22</inside _ cidr><inside_interface>eth0</inside_interface><outside_ip_address>192.168.2.35</outsi d e_ip_address><outside_cidr>24</outside_cidr><outside_interface>eth1</outside_interfac e ><outside_gateway_address>192.168.0.0</outside_gateway_address><name_of_default_rule>< /name_of_default_rule><username>admin</username><password>tryrgfdghetrj</password></f i rewall>' -u user:userpass http://onapp.test/settings/firewalls.xml -H 'Accept: -H 'Content-type: application/xml' JSON application/xml' Request example curl -i POST -d '{"firewall":{"inside_ip_address":"192.168.1.34", "inside_cidr":"22", "inside_interface":"eth0", "outside_ip_address":"192.168.2.35", "outside_cidr":"24", "outside_interface":"eth1", "outside_gateway_address":"192.168.0.0", "name_of_default_rule":"", "username":"admin", "password":"tryrgfdghetrj"}}' -u user:userpass http://onapp.test/settings/firewalls.json -H 'Accept: application/json' -H 'Content-type: application/json' Where you have to specify the following parameters: inside_cidr - internal IP address prefix size inside_interface - interface used for managing firewall via CP inside_ip_address - IP address used to manage firewall via CP name_of_default_rule - default firewall settings for new virtual servers (DROP/ACCEPT) outside_cidr_type - external IP address prefix size outside_gateway_address - external gateway address outside_interface - external firewall interface outside_ip_address - external firewall IP password - password for remote Vyatta management username - specify username for the remote Vyatta management Edit Firewall PUT /settings/firewalls/:id.xml PUT /settings/firewalls/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -d '<firewall><inside_ip_address>192.168.1.34</inside_ip_address><inside_cidr>22</inside _ cidr><inside_interface>eth0</inside_interface><outside_ip_address>192.168.2.35</outsi d e_ip_address><outside_cidr>24</outside_cidr><outside_interface>eth1</outside_interfac e ><outside_gateway_address>192.168.0.0</outside_gateway_address><name_of_default_rule>< /name_of_default_rule><username>admin</username><password>tryrgfdghetrj</password></f i rewall>' -u user:userpass http://onapp.test/settings/firewalls/3.xml -H 'Accept: -H 'Content-type: application/xml' JSON application/xml' Request example curl -i -X PUT -d '{"firewall":{"inside_ip_address":"192.168.1.34", "inside_cidr":"22", "inside_interface":"eth0", "outside_ip_address":"192.168.2.35", "outside_cidr":"24", "outside_interface":"eth1", "outside_gateway_address":"192.168.0.0", "name_of_default_rule":"", "username":"admin", "password":"tryrgfdghetrj"}}' -u user:userpass http://onapp.test/settings/firewalls/4.json -H 'Accept: application/json' -H 'Content-type: application/json' Where you can edit: inside_cidr - internal IP address prefix size inside_interface - interface used for managing firewall via CP inside_ip_address - IP address used to manage firewall via CP name_of_default_rule - default firewall settings for new virtual servers (DROP/ACCEPT) outside_cidr_type - external IP address prefix size outside_gateway_address - external gateway address outside_interface - external firewall interface outside_ip_address - external firewall IP password - password for remote Vyatta management username - specify username for the remote Vyatta management Delete Firewall To delete a firewall, run: DELETE /settings/firewalls/:id.xml DELETE /settings/firewalls/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/firewalls/:id.xml -u user:userpass H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/firewalls/:id.json -u user:userpass H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Returns HTTP 204 response on successful deletion, or HTTP 404 when a firewall with the ID specified is not found, or the URL requested is incorrect. OnApp Cloud 4.1 API Guide High Availability Control Panel OnApp High Availability brings new opportunity to deploy more than one Control Panel within one cloud. This chapter provides the API requests for the clusters. Get List of Clusters To view the list of clusters, use the following request: GET /settings/availability/clusters.xml GET /settings/availability/clusters.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' http://onapp.test/settings/availability/clusters.xml -H 'Contenttype: application/xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' http://onapp.test/settings/availability/clusters.json 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <availability_clusters type="array"> <availability_cluster> <created_at type="datetime">2015-04-15T14:29:45+00:00</created_at> <id type="integer">9</id> <name>UI</name> <updated_at type="datetime">2015-04-17T15:27:48+00:00</updated_at> <virtual_ip>10.0.2.210</virtual_ip> <nodes type="array"> <node> <cluster_id type="integer">9</cluster_id> <created_at type="datetime">2015-04-15T14:29:45+00:00</created_at> <id type="integer">17</id> <interface>eth0</interface> <ip_address>10.55.2.33</ip_address> <master type="boolean">false</master> <name>ui_1</name> <priority type="integer">103</priority> <updated_at type="datetime">2015-04-17T15:43:08+00:00</updated_at> </node> </nodes> </availability_cluster> <availability_cluster>...</availability_cluster> </availability_clusters> Where: OnApp Cloud 4.1 API Guide id - the ID of the high availability cluster OnApp Cloud 4.1 API Guide name - UI for UI cluster, Daemon for Daemon cluster, Cloud_boot for Cloudboot cluster virtual_ip - the virtual IP address for the cluster nodes - the array of the parameters for each node, where: cluster_id - the ID of the cluster to which this node belongs created_at - the date when the node has been created id - the node ID interface - the network interface for the node ip_address - the physical IP address of the node master - true if this is a master node, otherwise - false name - the hostname of the node priority - the priority for the node. The node with the highest priority will take over the virtual IP address when the component of the cluster fails. Get Status of OnApp Subsystems To view the status of OnApp Engine subsystems use the following API call: GET /sysadmin_tools/infrastructure/services.xml GET /sysadmin_tools/infrastructure/services.json XML Request example: curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass http://onapp.test/sysadmin_tools/infrastructure/services.xml JSON Request example: curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass http://onapp.test/sysadmin_tools/infrastructure/services.json XML Response example: OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <objects type="array"> <object> <node_name>onapp_ha_cp1</node_name> <services type="array"> <service> <name>cloudboot-ip</name> <pid>N/A</pid> <status>N/A</status> </service> <service> <name>crond</name> <pid type="integer">17004</pid> <status>Online</status> </service> <service> <name>dhcpd</name> <pid>N/A</pid> <status>N/A</status> </service> <service>...</service> </services> </object> <object>...</object> </objects> The output contains a number of nodes each containing an array of services running on this node. Where: node_name - node name. name - name of service/process pid - PID of related service/process. Can be a digit or "N/A" status - human readable status of service/process. Can be "online" or "offline" Update High Availability Clusters Use the following API call to update a High Availability Cluster: PUT /settings/availability/clusters.xml PUT /settings/availability/clusters.json XML Request example curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/clusters/139.xml -d '<availability_cluster><virtual_ip>2.2.2.2</virtual_ip><name>UI</name><nodes type="array"><nodes><id>277</id><name>hacp1</name><interface>eth4</interface><ip_addr ess>2.2.2.3</ip_address><priority>103</priority></node></nodes></availability_cluster > ' -H 'Accept: application/xml' -H 'Content-Type: application/xml' OnApp Cloud 4.1 API Guide JSON Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"availability_cluster": {"virtual_ip": "1.1.1.1", "name": "UI", "nodes": [{"id": 277, "name": "ha-cp1", "interface": "eth5", "ip_address": "2.2.2.2", "priority": 104}]}}' http://onapp.test/settings/availability/clusters/139.json Where: availability_cluster - the array of the high availability cluster parameters virtual_ip - set the desired virtual IP address of the control panels name - the cluster type ( UI for UI cluster, Daemon for Daemon cluster, Cloud_boot for Cloudboot cluster) nodes - the array of the node's parameters id* - the ID of the node interface - set the network interface for the node Compute Resources Compute resources provide hardware resources for virtual servers. A specific physical compute resource server supplies the CPU, RAM and storage capacity from the Data Stores attached to that compute resource. All API calls are available to this class. Get List of Compute Resources GET /settings/hypervisors.xml GET /settings/hypervisors.json Returns the array of available compute resources. XML Output example <?xml version="1.0" encoding="UTF-8"?> <hypervisors type="array"> <hypervisor> <backup type="boolean">false</backup> <backup_ip_address/> <blocked type="boolean">true</blocked> <built type="boolean">false</built> <called_in_at nil="true"/> <connection_options nil="true"/> <cpu_idle type="integer">0</cpu_idle> <cpu_mhz nil="true"/><cpus nil="true"/> <created_at type="datetime">2013-06-10T12:09:48+00:00</created_at> <custom_config nil="true"/> <disable_failover type="boolean">false</disable_failover> <disk_pcis nil="true"/> <distro nil="true"/> <enabled type="boolean">true</enabled> <failure_count type="integer">0</failure_count> <format_disks type="boolean">false</format_disks> <free_mem type="integer">0</free_mem> <host nil="true"/><host_id nil="true"/> <hypervisor_group_id nil="true"/> <hypervisor_type>kvm</hypervisor_type> <id type="integer">7</id> <ip_address>109.123.105.132</ip_address> <label>KVM C5 HV1</label> OnApp Cloud 4.1 API Guide <list_of_logical_volumes/> OnApp Cloud 4.1 API Guide <list_of_volume_groups/> <list_of_zombie_domains nil="true"/> <locked type="boolean">false</locked> <mac nil="true"/> <machine nil="true"/> <mem_info type="integer">0</mem_info> <mtu type="integer">1500</mtu> <online type="boolean">false</online> <ovs nil="true"/> <passthrough_disks type="boolean">false</passthrough_disks> <release nil="true"/> <server_type>virtual</server_type> <spare type="boolean">false</spare> <storage_channel>224.3.28.1</storage_channel> <threads_per_core nil="true"/> <total_mem nil="true"/> <total_zombie_mem nil="true"/> <updated_at type="datetime">2013-06-10T12:09:48+00:00</updated_at> <uptime nil="true"/> <vmware_total_cpu_cores type="integer">0</vmware_total_cpu_cores> <total_cpus type="integer">0</total_cpus> <free_memory type="integer">0</free_memory> <used_cpu_resources type="integer">0</used_cpu_resources> <total_memory type="integer">0</total_memory> <cpu_cores type="integer">0</cpu_cores> <free_disk_space><onapp-fv4zl7t2h5wbeq type="integer">184</onappfv4zl7t2h5wbeq></free_disk_space> <memory_allocated_by_running_vms type="integer">0</memory_allocated_by_running_vms> <total_memory_allocated_by_vms type="integer">0</total_memory_allocated_by_vms> OnApp Cloud 4.1 API Guide <cpu_units type="integer">282</cpu_units> </hypervisors> </hypervisors> Where: hypervisor – an array of all compute resources in the cloud and their details backup - true, if the CloudBoot compute resource is used as a backup server. This parameter is for CloudBoot compute resources only. For other compute resource types the backup value is 0. backup_ip_address - provisioning network IP address blocked - true if the compute resource is blocked, otherwise false built - true if the compute resource is built, otherwise false called_in_at – the date when the compute resource was called in the [YYYY][MM][DD]T[hh][mm][ss]Z format connection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name distributed_virtual_switch_name - distributed virtual switch label cpu_idle - time of CPU delay cpu_mhz - CPU operating frequency created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format custom_config - custom commands that run when the compute resource is booted disable_failover – true if compute resource failover is disabled, otherwise false. disk_pcis - comma-separated list of hypervisor disk pcis distro - distributive label enabled - true, if the compute resource is enabled, otherwise false failure_count – the number of failures format_disks - true, if the compute resource's disks are formatted during creation, otherwise false free_mem - free compute resource memory host - host label hypervisor_group_id - the ID of a compute zone to which this compute resource is attached hypervisor_type - the compute resource type id - the compute resource ID ip_address – the compute resource IP address label - the compute resource label list_of_logical_volumes - an array of compute resource logical volumes list_of_volume_groups - an array of compute resource volume groups list_of_zombie_domains - an array of zombie virtual servers locked - true if the compute resource is locked, otherwise false mac - compute resource MAC address machine - architecture type OnApp Cloud 4.1 API Guide mem_info - Xen compute resource Dom0 size. This parameter is for Xen compute resources only. For other compute resource types the mem_inf OnApp Cloud 4.1 API Guide o value is 0. mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. online - true if online, otherwise false ovs - whether the OpenvSwitch is enabled or not. Redundant parameter. passthrough_disks - true, if the disks are passed through to the storage nodes, otherwise 0 release - compute resource kernel version server_type - server type: virtual smart baremetal spare – true if no VSs are assigned, otherwise false storage_channel - storage channel for the communication threads_per_core - compute resource core and CPU ratio. For example, if threads_per_core = 2, compute resource with 2 cores will have 4 CPUs. total_mem - total compute resource memory total_zombie_mem - memory space occupied by zombie disks updated_at – the date when the record was made in the DB in the [YYYY][MM][DD]T[hh][mm][ss]Z format uptime - compute resource uptime value; shows how long the compute resource is online vmware_total_cpu_cores - the total number of VMware compute resource CPU cores total_cpus – the number of virtual cores free_memory – free RAM (MB) of compute resource used_cpu_resources – the percentage of used CPU resources total_memory – total RAM (MB) of compute resource cpu_cores – the number of physical cores per compute resource free_disk_space - free compute resource disk space in GB memory_allocated_by_running_vms - the compute resource RAM in MB allocated to the virtual servers, which are currently running on this compute resource total_memory_allocated_by_vms - the compute resource RAM in MB allocated to all virtual servers of this compute resource cpu_units - the amount of CPU units assigned to this compute resource Page History v. 3.3: cpu_units v. 3.1.: cpu_idle cpu_mhz list_of_logical_volumes list_of_volume_groups list_of_zombie_domains OnApp Cloud 4.1 API Guide machine server_type OnApp Cloud 4.1 API Guide storage_channel total_mem total_zombie_mem free_disk_space free_mem free_memory Get Compute Resource Details GET /settings/hypervisors/:id.xml GET /settings/hypervisors/:id.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <hypervisor> <allow_unsafe_assigned_interrupts type="boolean">false</allow_unsafe_assigned_interrupts> <backup type="boolean">false</backup> <backup_ip_address></backup_ip_address> <blocked type="boolean">false</blocked> <built type="boolean">false</built> <called_in_at nil="true"/> <connection_options nil="true"/> <cpu_cores type="integer">4</cpu_cores> <cpu_idle type="integer">93</cpu_idle> <cpu_mhz>1995</cpu_mhz> <cpu_units type="integer">3000</cpu_units> <cpus type="integer">4</cpus> <created_at type="datetime">2014-01-14T15:14:43+03:00</created_at> <custom_config nil="true"/> <disable_failover type="boolean">false</disable_failover> <disks_per_storage_controller type="integer">4</disks_per_storage_controller> <distro>centos6</distro> <enabled type="boolean">true</enabled> <failure_count type="integer">0</failure_count> <format_disks type="boolean">false</format_disks> <free_mem type="integer">1206</free_mem> <host nil="true"/> <host_id nil="true"/> <hypervisor_group_id type="integer">1</hypervisor_group_id> <hypervisor_type>kvm</hypervisor_type> <id type="integer">1</id> <infiniband_identifier nil="true"/> <ip_address>109.123.91.38</ip_address> <label>KVM C6 HV1</label> <list_of_logical_volumes>...</list_of_logical_volumes> <list_of_volume_groups>...</list_of_volume_groups> <list_of_zombie_domains></list_of_zombie_domains> <locked type="boolean">false</locked> <mac nil="true"/> <machine>x86_64</machine> <mem_info type="integer">0</mem_info> <mtu type="integer">1500</mtu> <online type="boolean">true</online> <ovs nil="true"/> OnApp Cloud 4.1 API Guide <passthrough_disks type="boolean">false</passthrough_disks> OnApp Cloud 4.1 API Guide <power_cycle_command>echo "I want to reboot! I'am LAZY!"</power_cycle_command> <release>2.6.32-431.5.1.el6.x86_64</release> <server_type>virtual</server_type> <spare type="boolean">false</spare> <storage_controller_memory_size type="integer">640</storage_controller_memory_size> <threads_per_core type="integer">1</threads_per_core> <total_mem type="integer">15936</total_mem> <total_zombie_mem type="integer">0</total_zombie_mem> <updated_at type="datetime">2014-08-06T15:17:16+03:00</updated_at> <uptime> 13:16:42 up 41 days, 23:20, 1 user, load average: 0.04, 0.05, 0.06</uptime> <total_cpus type="integer">4</total_cpus> <free_memory type="integer">612</free_memory> <used_cpu_resources type="integer">880</used_cpu_resources> <total_memory type="integer">15936</total_memory> <cpu_cores type="integer">4</cpu_cores> <free_disk_space> <onapp-fv4zl7t2h5wbeq type="integer">24</onapp-fv4zl7t2h5wbeq> </free_disk_space> <memory_allocated_by_running_vms type="integer">10460</memory_allocated_by_running_vms> <total_memory_allocated_by_vms type="integer">13788</total_memory_allocated_by_vms> <storage> <disks type="array"/> <nics type="array"/> OnApp Cloud 4.1 API Guide <custom_pcis type="array"/> </storage> </hypervisor> Where: hypervisor – an array of compute resource details backup - true, if the CloudBoot compute resource is used as a backup server. This parameter is for CloudBoot compute resources only. For other compute resource types the backup value is 0. backup_ip_address - provisioning network IP address blocked - true if the compute resource is blocked, otherwise false built - true if the compute resource is built, otherwise false called_in_at – the date when the compute resource was called in the [YYYY][MM][DD]T[hh][mm][ss]Z format connection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name distributed_virtual_switch_name - distributed virtual switch label cpu_idle - time of CPU delay cpu_mhz - CPU operating frequency created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format custom_config - custom commands that run when the compute resource is booted disable_failover – true if compute resource failover is disabled, otherwise false. distro - distributive label enabled - true, if the compute resource is enabled, otherwise false failure_count – the number of failures format_disks - true, if the compute resource's disks are formatted during creation, otherwise false free_mem - free compute resource memory host - host label hypervisor_group_id - the ID of a compute zone to which this compute resource is attached hypervisor_type - the compute resource type id - the compute resource ID ip_address – the compute resource IP address label - the compute resource label list_of_logical_volumes - an array of compute resource logical volumes list_of_volume_groups - an array of compute resource volume groups list_of_zombie_domains - an array of zombie virtual servers locked - true if the compute resource is locked, otherwise false mac - compute resource MAC address machine - architecture type mem_info - Xen compute resource Dom0 size. This parameter is for Xen compute resources only. For other compute resource types the mem_inf o value is 0. OnApp Cloud 4.1 API Guide mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. OnApp Cloud 4.1 API Guide The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. online - true if online, otherwise false ovs - whether the OpenvSwitch is enabled or not. Redundant parameter. passthrough_disks - true, if the disks are passed through to the storage nodes, otherwise 0 release - compute resource kernel version server_type - server type: virtual smart baremetal spare – true if no VSs are assigned, otherwise false storage_channel - storage channel for the communication threads_per_core - compute resource core and CPU ratio. For example, if threads_per_core = 2, compute resource with 2 cores will have 4 CPUs. total_mem - total compute resource memory total_zombie_mem - memory space occupied by zombie disks updated_at – the date when the record was made in the DB in the [YYYY][MM][DD]T[hh][mm][ss]Z format uptime - compute resource uptime value; shows how long the compute resource is online vmware_total_cpu_cores - the total number of VMware compute resource CPU cores total_cpus – the number of virtual cores free_memory – free RAM (MB) of compute resource used_cpu_resources – the percentage of used CPU resources total_memory – total RAM (MB) of compute resource cpu_cores – the number of physical cores per compute resource free_disk_space - free compute resource disk space in GB memory_allocated_by_running_vms - the compute resource RAM in MB allocated to the virtual servers, which are currently running on this compute resource total_memory_allocated_by_vms - the compute resource RAM in MB allocated to all virtual servers of this compute resource cpu_units - the amount of cpu units assigned to a compute resource allow_unsafe_assigned_interrupts - true if the compute resource does not support the interrupt remapping, otherwise set false. With allow_unsafe_assigned_interrupts parameter enabled, smart server is exposed to the PCI passthrough MSI trap injection. cpus - a parameter duplicating total_cpus; reserved for future use disks_per_storage_controller - the number of disks per controller virtual server. You can set form 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives infiniband_identifier - the identifier of the InfiniBand interface. For CloudBoot Compute resources only. power_cycle_command - arbitrary command string to be executed by IPMI from the CP server. This parameter is for CloudBoot Compute resources. OnApp Cloud 4.1 API Guide Page History v. 3.3: cpu_units v. 3.1: cpu_idle cpu_mhz list_of_logical_volumes list_of_volume_groups list_of_zombie_domains machine server_type storage_channel total_mem total_zombie_mem free_disk_space free_mem free_memory Add Xen/KVM Compute Resource POST /settings/hypervisors.xml POST /settings/hypervisors.json XML Request example curl -X POST http://onapp.test/settings/hypervisors.xml -d '<hypervisor><label>HV_LABEL</label><ip_address>HV_IP</ip_address><hypervisor_type>kv m /xen</hypervisor_type><enabled>true/false</enabled><disable_failover>true</disable_fa i lover><collect_stats>1</collect_stats><hypervisor_group_id>HV_Group_id</hypervisor_gr o up_id><backup_ip_address>192.168.123.1</backup_ip_address><cpu_units>1000</cpu_units> < JSON /hypervisor>' Request example -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' curl -X POST http://onapp.test/settings/hypervisors.json d'{hypervisor:{"label":"HV_LABEL","ip_address":"HV_IP","backup_ip_address":"192.168.1 23.1","hypervisor_type":"kvm/xen","enabled":"true","disable_failover":"true/false","c o llect_stats":"1","hypervisor_group_id":"HV_Group_id","cpu_units":"1000"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' To add a new compute resource, send the following parameters: ip_address* - the compute resource IP address backup_server_ip_address - provisioning network IP address label* - the name of the compute resource hypervisor_type* - specify if this is Xen or KVM compute resource enabled - set true to enable a compute resource, otherwise set false hypervisor_group_id* - the ID of the group to which this compute resource is assigned collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - set true to disable compute resource failover, otherwise set false OnApp Cloud 4.1 API Guide cpu_units - set the amount of CPU units for this compute resource OnApp Cloud 4.1 API Guide Page History v. 3.3: cpu_units Add CloudBoot Compute Resource To create a CloudBoot compute resource, use the following request: POST /settings/assets/:asset_mac_address/hypervisors.xml POST /settings/assets/:asset_mac_address/hypervisors.json For details how to create CloudBoot compute resources for smart/baremetal server deployment, refer to the Add Smart CloudBoot Compute Resource and Add Baremetal CloudBoot Compute Resource sections, accordingly. XML Request example curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.xml -d '<hypervisor><label>CB_Virtual</label><pxe_ip_address_id>1248</pxe_ip_address_id><hyp e rvisor_type>xen</hypervisor_type><server_type>virtual</server_type><backup>0</backup> < backup_ip_address></backup_ip_address><enabled>1</enabled><collect_stats>1</collect_s t ats><disable_failover>0</disable_failover><format_disks>0</format_disks><passthrough_ d isks>0</passthrough_disks><storage><disks type="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</ s elected></disk></disks><nics type="array"><nic><mac>00:30:48:fd:74:c7</mac><type>1</type></nic><nic><mac>00:1b:21: 6 f:3a:ff</mac><type>0</type></nic></nics><custom_pcis type="array"><custom_pci><pci>00:00.0</pci><selected>1</selected></custom_pci></custo m _pcis></storage><mtu>1500</mtu><storage_controller_memory_size>640</storage_controller _memory_size><disks_per_storage_controller>4</disks_per_storage_controller><cloud_boot _os>centos5</cloud_boot_os><custom_config>iscsiadm -m discovery -t sendtargets p 109.123.105.131\r\n\r\n/etc/init.d/iscsi restart</custom_config></hypervisor>' -u user:userpass -H 'Accept:application/xml' H 'Content-type:application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.json -d '{"hypervisor":{"label":"CB_Virtual","pxe_ip_address_id":"1248","hypervisor_type":"xe n ","server_type":"virtual","backup":"0", "backup_ip_address":"","enabled":"1","collect_stats":"1","disable_failover":"0","form a t_disks":"0","passthrough_disks":"0", "storage":{"disks":[{"scsi":"DC0710130DBA80013_TAII_DC0710130DBA80013","selected":"1" } ],"nics":[{"mac":"00:30:48:fd:74:c7", "type":"1"},{"mac":"00:1b:21:6f:3a:ff","type":"0"}], "custom_pcis":[{"pci":"00:00.0","selected":"1"}]},"mtu":"1500","storage_controller_me m ory_size":"640", "disks_per_storage_controller":"4","cloud_boot_os":"centos5","custom_config":"iscsiad m -m discovery -t sendtargets -p 109.123.105.131\r\n\r\n/etc/init.d/iscsi restart"}}' u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where: hypervisor - an array of compute resource details: label * - the name of the compute resource pxe_ip_address_id* - the ID of Cloud Boot IP address that will be used for this compute resource type - compute resource type: xen kvm server_type - specify the type of servers that will be deployed on this compute resource: virtual - specify the virtual server type to use this compute resource for virtual servers deployment. The server_type is virtual by default. backup - select this checkbox if you want to use this CloudBoot compute resource as a backup/transaction Server. OnApp Storage cannot be provisioned if this option is selected. backup_ip_address - provisioning network IP address enabled - set 1 to enable this compute resource, otherwise set 0 collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false format_disks - set 1 to format compute resource's disks during creation, otherwise set 0 passthrough_disks - set 1 if the disks should be passed through to the storage nodes, otherwise set 0. This parameter is for Xen compute resources only. storage - an array of compute resource disks' details: disks - an array of compute resource disks, where: scsi - SCSI inquiry product revision number selected - set 1 to select a disk , otherwise set 0 nics - network interfaces that will be used for storage, where: mac - network interface MAC address type - network interface type: 0 - leave the NIC unused 1 - SAN subnet - select this option to use this interface for storage network. In this case, NIC interface will be bonded with virtual network interface of the Storage Control Panel server 2 - passthrough to storage - this option is available for Xen CloudBoot compute resources. The network interface will be added to the Storage Controller Server without the bond and the Storage Control Panel server will have the complete control over this interface 3 - passthrough to Guest - this option is available for smart CloudBoot compute resources. The network interface will be added to the smart server custom_pcis - an array of custom PCI devices pci - NIC PCI selected - 1 if the PCI is selected, otherwise false mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. storage_controller_memory_size - specify the storage controller memory size (minimum 640 MB) disks_per_storage_controller - specify the number of disks per controller virtual server. You can set form 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives cloud_boot_os - specify the compute resource OS. This parameter is for Xen compute resources only. CentOS 6 support for Xen is in the experimental mode. custom_config - specify any custom commands you want to run when compute resource is booted PLEASE NOTE: It is currently only possible to set NICs and disk information parameters via UI. XML Output example OnApp Cloud 4.1 API Guide OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <hypervisor> <allow_unsafe_assigned_interrupts type="boolean">true</allow_unsafe_assigned_interrupts> <backup type="boolean">false</backup> <backup_ip_address nil="true"/> <blocked type="boolean">true</blocked> <built type="boolean">false</built> <called_in_at nil="true"/> <cloud_boot_os>centos5</cloud_boot_os> <connection_options nil="true"/> <cpu_idle type="integer">0</cpu_idle> <cpu_mhz nil="true"/> <cpus nil="true"/> <created_at type="datetime">2013-07-25T10:24:41+03:00</created_at> <custom_config>iscsiadm -m discovery -t sendtargets -p 109.123.105.131\r\n\r\n/etc/init.d/iscsi restart</custom_config> <disable_failover type="boolean">false</disable_failover> <disks_per_storage_controller type="integer">4</disks_per_storage_controller> <distro nil="true"/> <enabled type="boolean">true</enabled> <failure_count type="integer">0</failure_count> <format_disks type="boolean">false</format_disks> <free_mem type="integer">0</free_mem> <host nil="true"/> <host_id type="integer">2</host_id> <hypervisor_group_id nil="true"/> <hypervisor_type>xen</hypervisor_type> <id type="integer">43</id> <ip_address>109.123.105.133</ip_address> <label>CB_Virtual</label> <list_of_logical_volumes nil="true"/> <list_of_volume_groups nil="true"/> <list_of_zombie_domains nil="true"/> <locked type="boolean">false</locked> <mac>00:30:48:fd:74:c6</mac> <machine nil="true"/> <mem_info type="integer">0</mem_info> <mtu type="integer">1500</mtu> <online type="boolean">false</online> <ovs nil="true"/> <passthrough_disks type="boolean">false</passthrough_disks> <release nil="true"/> <server_type>virtual</server_type> <spare type="boolean">false</spare> <storage_channel>224.3.28.1</storage_channel> <storage_controller_memory_size type="integer">640</storage_controller_memory_size> <threads_per_core nil="true"/> <total_mem nil="true"/> <total_zombie_mem nil="true"/> <updated_at type="datetime">2013-07-25T10:24:41+03:00</updated_at> <uptime nil="true"/> <vmware_total_cpu_cores type="integer">0</vmware_total_cpu_cores> <total_cpus type="integer">0</total_cpus> <free_memory type="integer">0</free_memory> <used_cpu_resources type="integer">0</used_cpu_resources> <total_memory type="integer">0</total_memory> OnApp Cloud 4.1 API Guide <cpu_cores type="integer">0</cpu_cores> <free_disk_space nil="true"/> OnApp Cloud 4.1 API Guide <memory_allocated_by_running_vms type="integer">0</memory_allocated_by_running_vms> <total_memory_allocated_by_vms type="integer">0</total_memory_allocated_by_vms> <storage> <disks type="array"> <disk> <name>sda</name> <scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi> <selected type="boolean">true</selected> </disk> </disks> <nics type="array"> <nic> <name>eth1</name> <mac>00:30:48:fd:74:c7</mac> <type type="integer">1</type> </nic> <nic> <name>eth2</name> <mac>00:1b:21:6f:3a:ff</mac> <type type="integer">0</type> </nic> </nics> <custom_pcis type="array"> <custom_pci> <name>Intel Corporation 5520/5500/X58 I/O Hub to ESI Port [8086:3405] (rev 13)</name> <pci>00:00.0</pci> <selected type="boolean">true</selected> </custom_pci> </custom_pcis> OnApp Cloud 4.1 API Guide </storage> </hypervisor> Page history v3.1 Added the following parameters: cloud_boot_os storage_controller_memory_size disks_per_storage_controller custom_pcis passthrough_custom_pcis server_type type (storage parameter) Add Smart CloudBoot Compute Resource To create a CloudBoot compute resource, use the following request: POST /settings/assets/:asset_mac_address/hypervisors.xml POST /settings/assets/:asset_mac_address/hypervisors.json XML Request example curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.xml -d '<hypervisor><label>smart zaza</label><pxe_ip_address_id>1248</pxe_ip_address_id><hypervisor_type>kvm</hypervis o r_type><server_type>smart</server_type><backup_ip_address></backup_ip_address><enable d >1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_failover><fo r mat_disks>1</format_disks><passthrough_disks>0</passthrough_disks><storage><disks type="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</ s elected></disk></disks><nics type="array"><nic><mac>00:30:48:fd:74:c7</mac><type>1</type></nic><nic><mac>00:1b:21: 6 f:3a:ff</mac><type>3</type></nic></nics><custom_pcis type="array"><custom_pci><pci>00:00.0</pci><selected>1</selected></custom_pci></custo m _pcis></storage><passthrough_custom_pcis>1</passthrough_custom_pcis><mtu>1500</mtu><s t orage_controller_memory_size>640</storage_controller_memory_size><disks_per_storage_c o ntroller>4</disks_per_storage_controller><allow_unsafe_assigned_interrupts>true</allo w _unsafe_assigned_interrupts><custom_config></custom_config> JSON Request example </hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' OnApp Cloud 4.1 API Guide curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.json -d '{"hypervisor":{"label":"smart","pxe_ip_address_id":"2","hypervisor_type":"kvm","serv e r_type":"smart","backup_ip_address":"", "enabled":"1","collect_stats":"1","disable_failover":"1","format_disks":"1", "passthrough_disks":"0","storage":{"disks":[{"scsi":"9VM51JELS_9VM51JEL","selected":" 1 "}],"nics":[{"mac":"00:25:90:10:62:5b","type":"1"}, {"mac":"00:1b:21:72:9d:06","type":"3"}],"custom_pcis":[{"pci":"00:00.0","selected":"1" }]},"passthrough_custom_pcis":"1","mtu":"1500","storage_controller_memory_size":"640" , "disks_per_storage_controller":"4", "allow_unsafe_assigned_interrupts":"true","custom_config":""}}' -u user:userpass -H 'Accept:application/json' -H 'Content-type: application/json' Where: hypervisor - an array of compute resource details: label* - the name of the compute resource pxe_ip_address_id* - the ID of Cloud Boot IP address that will be used for this compute resource type - compute resource type: kvm You can only specify the KVM type for smart CloudBoot compute resource provisioning. server_type - specify the type of servers that will be deployed on this compute resource: smart - specify the smart server type to use this compute resource for smart server deployment. The server_type is virtual by default. backup_ip_address - provisioning network IP address enabled - set 1 to enable this compute resource, otherwise set 0 collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false format_disks - set 1 to format compute resource's disks during creation, otherwise set 0 passthrough_disks - set 1 if the disks should be passed through to the storage nodes, otherwise set 0. This parameter is for Xen compute resources only. storage - an array of compute resource disks' details: disks - an array of compute resource disks, where: scsi - SCSI inquiry product revision number selected - set 1 to select a disk , otherwise set 0 nics - network interfaces that will be used for storage, where: mac - network interface MAC address type - network interface type: 0 - leave the NIC unused 1 - SAN subnet - select this option to use this interface for storage network. In this case, NIC interface will be bonded with virtual network interface of the Storage Controller Server 2 - passthrough to storage - this option is available for Xen CloudBoot compute resources. The network interface will be added to the Storage Controller Server without the bond and the Storage Controller Server will have the complete control over this interface 3 - passthrough to Guest - this option is available for smart CloudBoot compute resources. The network interface will be added to the smart server custom_pcis - an array of custom PCI devices pci - NIC PCI selected - 1 if the PCI is selected, otherwise false mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. OnApp Cloud 4.1 API Guide storage_controller_memory_size - specify the storage controller memory size (minimum 640 MB) OnApp Cloud 4.1 API Guide disks_per_storage_controller - specify the number of disks per controller virtual server. You can specify from 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives allow_unsafe_assigned_interrupts - set true if the compute resource does not support the interrupt remapping, otherwise set false. Note: With allo w_unsafe_assigned_interrupts parameter enabled, smart server is exposed to the PCI passthrough MSI trap injection. custom_config - specify any custom commands you want to run when compute resource is booted PLEASE NOTE: It is currently only possible to set NICs and disk information parameters via UI. XML Output example <?xml version="1.0" encoding="UTF-8"?> <hypervisor> <allow_unsafe_assigned_interrupts type="boolean">true</allow_unsafe_assigned_interrupts> <backup type="boolean">false</backup> <backup_ip_address nil="true"/> <blocked type="boolean">true</blocked> <built type="boolean">false</built> <called_in_at nil="true"/> <cloud_boot_os>centos5</cloud_boot_os> <connection_options nil="true"/> <cpu_idle type="integer">0</cpu_idle> <cpu_mhz nil="true"/> <cpus nil="true"/> <created_at type="datetime">2013-07-25T10:24:41+03:00</created_at> <custom_config>iscsiadm -m discovery -t sendtargets -p 109.123.105.131\r\n\r\n/etc/init.d/iscsi restart</custom_config> <disable_failover type="boolean">false</disable_failover> <disks_per_storage_controller type="integer">4</disks_per_storage_controller> <distro nil="true"/> <enabled type="boolean">true</enabled> <failure_count type="integer">0</failure_count> <format_disks type="boolean">false</format_disks> <free_mem type="integer">0</free_mem> <host nil="true"/> <host_id type="integer">2</host_id> <hypervisor_group_id nil="true"/> <hypervisor_type>xen</hypervisor_type> <id type="integer">43</id> <ip_address>109.123.105.133</ip_address> <label>CB_Virtual</label> <list_of_logical_volumes nil="true"/> <list_of_volume_groups nil="true"/> <list_of_zombie_domains nil="true"/> <locked type="boolean">false</locked> <mac>00:30:48:fd:74:c6</mac> <machine nil="true"/> <mem_info type="integer">0</mem_info> <mtu type="integer">1500</mtu> <online type="boolean">false</online> <ovs nil="true"/> <passthrough_disks type="boolean">false</passthrough_disks> <release nil="true"/> <server_type>virtual</server_type> OnApp Cloud 4.1 API Guide <spare type="boolean">false</spare> <storage_channel>224.3.28.1</storage_channel> OnApp Cloud 4.1 API Guide <storage_controller_memory_size type="integer">640</storage_controller_memory_size> <threads_per_core nil="true"/> <total_mem nil="true"/> <total_zombie_mem nil="true"/> <updated_at type="datetime">2013-07-25T10:24:41+03:00</updated_at> <uptime nil="true"/> <vmware_total_cpu_cores type="integer">0</vmware_total_cpu_cores> <total_cpus type="integer">0</total_cpus> <free_memory type="integer">0</free_memory> <used_cpu_resources type="integer">0</used_cpu_resources> <total_memory type="integer">0</total_memory> <cpu_cores type="integer">0</cpu_cores> <free_disk_space nil="true"/> <memory_allocated_by_running_vms type="integer">0</memory_allocated_by_running_vms> <total_memory_allocated_by_vms type="integer">0</total_memory_allocated_by_vms> <storage> <disks type="array"> <disk> <name>sda</name> <scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi> <selected type="boolean">true</selected> </disk> </disks> <nics type="array"> <nic> <name>eth1</name> <mac>00:30:48:fd:74:c7</mac> <type type="integer">1</type> </nic> <nic> <name>eth2</name> <mac>00:1b:21:6f:3a:ff</mac> <type type="integer">0</type> </nic> </nics> <custom_pcis type="array"> <custom_pci> <name>Intel Corporation 5520/5500/X58 I/O Hub to ESI Port [8086:3405] (rev 13)</name> <pci>00:00.0</pci> <selected type="boolean">true</selected> </custom_pci> </custom_pcis> OnApp Cloud 4.1 API Guide </storage> </hypervisor> Page history v3.1 Added the following parameters: allow_unsafe_assigned_interrupts cloud_boot_os storage_controller_memory_size disks_per_storage_controller custom_pcis passthrough_custom_pcis server_type type (storage parameter) Add Baremetal CloudBoot Compute Resource To create a CloudBoot compute resource, use the following request: POST /settings/assets/:asset_mac_address/hypervisors.xml POST /settings/assets/:asset_mac_address/hypervisors.json XML Request example curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.xml -d '<hypervisor><label>baremetal</label><pxe_ip_address_id>2</pxe_ip_address_id><hypervi s or_type>xen</hypervisor_type><server_type>baremetal</server_type><enabled>1</enabled> < /hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.json -d '{"hypervisor":{"label":"baremetal","pxe_ip_address_id":"2","hypervisor_type":"xen"," s erver_type":"baremetal","enabled":"1"}}' -u user:userpass -H 'Accept:application/json' -H 'Content-type: application/json' Where: hypervisor - an array of compute resource details: label * - the name of the compute resource pxe_ip_address_id* - the ID of Cloud Boot IP address that will be used for this compute resource type - compute resource type: xen You can only specify the Xen type for baremetal CloudBoot compute resource provisioning. OnApp Cloud 4.1 API Guide server_type - specify the type of servers that will be deployed on this compute resource: baremetal - specify the baremetal server type to use this compute resource for baremetal server deployment. The server_type is virtual by default. enabled - set 1 to enable this compute resource, otherwise set 0 Page history v. 3.1 RC1: Added the following parameters: server_type type (storage parameter) Add VMware Compute Resource POST /settings/hypervisors.xml POST /settings/hypervisors.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisors.xml -d '<hypervisor><label>zaza_fake_ware_xml</label><ip_address>10.10.10.12</ip_address><ba c kup_ip_address>10.10.10.13</backup_ip_address><hypervisor_type>vmware</hypervisor_typ e ><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_fai l over><connection_options><login>login</login><password>password</password><cluster_na m e>OnApp</cluster_name><distributed_virtual_switch_name>dvSwitch</distributed_virtual_ s witch_name></connection_options></hypervisor>' -u user:userpass -H 'Accept: -H 'Content-type: JSON application/xml' Request example application/xml' curl -i -X POST http://onapp.test/settings/hypervisors.json -d '{"hypervisor":{"label":"zaza_fake_ware_json", "ip_address":"10.10.10.2","backup_ip_address":"10.10.10.3","hypervisor_type":"vmware" , "enabled":"1","collect_stats":"1", "disable_failover":"1", "connection_options":{"login":"login","password":"password","cluster_name":"OnApp","d i stributed_virtual_switch_name":"dvSwitch"}}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' To add a new VMware compute resource, send the following parameters: ip_address* - the compute resource IP address backup_server_ip_address - provisioning network IP address label* - the name of the compute resource hypervisor_type* - specify if this is Xen or KVM compute resource enabled - optional parameter, set True to enable a compute resource hypervisor_group_id* - the ID of the group to which this compute resource is assigned collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 OnApp Cloud 4.1 API Guide disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false OnApp Cloud 4.1 API Guide connection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name distributed_virtual_switch_name - distributed virtual switch label Edit Xen/KVM Compute Resource PUT /settings/hypervisors/:id.xml PUT /settings/hypervisors/:id.json XML Request example curl -X PUT http://onapp.test/settings/hypervisors/:id.xml -d '<hypervisor> <label>HV_LABEL</label><ip_address>HV_IP</ip_address><hypervisor_type>kvm/xen</hyperv i sor_type><enabled>true/false</enabled><disable_failover>true/false</disable_failover> < backup_ip_address>192.168.123.1</backup_ip_address><hypervisor_group_id>HV_Group_id</ h ypervisor_group_id><cpu_units>1000<cpu_units></hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X PUT http://onapp.test/settings/hypervisors/:id.json -d '{hypervisor: {"label":"HV_LABEL","ip_address":"HV_IP","hypervisor_type":"kvm/xen", "enabled":"true/false","disable_failover":"true/false","backup_ip_address":"192.168.1 2 3.1","cpu_units":"1000"}}hypervisor_group_id:"HV_Group_id"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' You can edit the following parameters: ip_address - the compute resource IP address label - the name of the compute resource backup_server_ip_address - provisioning network IP address hypervisor_type - compute resource type enabled - set true to enable a compute resource, otherwise set false hypervisor_group_id - set ID of the compute zone to attach this compute resource to it, or send the empty value to remove the compute resource from the compute zone disable_failover – set true to disable compute resource failover, otherwise set false cpu_units - set the amount of CPU units for this compute resource Returns HTTP 204 response on successful deletion, or HTTP 404 when a compute resource with the ID specified is not found, or the URL requested is incorrect. Page history v. 3.3: cpu_units Edit CloudBoot Compute Resource To edit a virtual CloudBoot compute resource, use the following request: OnApp Cloud 4.1 API Guide PUT /settings/assets/:asset_mac_address/hypervisors.xml OnApp Cloud 4.1 API Guide PUT /settings/assets/:asset_mac_address/hypervisors.json For details how to edit CloudBoot compute resources for smart/baremetal server deployment, refer to the Edit Smart CloudBoot Compute Resource and Edit Baremetal CloudBoot Compute Resource sections, accordingly. XML Request example curl -i -X PUT http://onapp.test/settings/hypervisors/:id.xml -d '<hypervisor><label>CB_Virtual</label><backup_ip_address></backup_ip_address><enabled > 1</enabled><collect_stats>1</collect_stats><disable_failover>0</disable_failover><pas s through_disks>0</passthrough_disks><storage><disks><scsi>DC0710130DBA80013_TAII_DC071 0 130DBA80013</scsi><selected>1</selected></disks><nics><mac>00:30:48:fd:74:c7</mac><ty p e>1</type></nics><nics><mac>00:1b:21:6f:3a:ff</mac><type>0</type></nics><custom_pcis> < pci>00:00.0</pci><selected>1</selected></custom_pcis></storage><mtu>1500</mtu><storag e _controller_memory_size>640</storage_controller_memory_size><disks_per_storage_contro l ler>4</disks_per_storage_controller><custom_config>iscsiadm -m discovery -t sendtargets -p 109.123.105.131\r\n\r\n/etc/init.d/iscsi JSON Request example restart</custom_config></hypervisor>' -u user:userpass -H 'Accept:application/xml' -H 'Content-type:application/xml' curl -i -X PUT http://onapp.test/settings/hypervisors/:id.json -d '{"hypervisor":{"label":"virtual", "backup_ip_address":"","enabled":"1","collect_stats":"1", "disable_failover":"0","passthrough_disks":"0", "storage":{"disks":[{"scsi":"DC0710130DBA80013_TAII_DC0710130DBA80013","selected":"1" } ], "nics":[{"mac":"00:30:48:fd:74:c7","type":"1"},{"mac":"00:1b:21:6f:3a:ff","type":"0"}] ,"custom_pcis":[{"pci":"00:00.0","selected":"1"}]},"mtu":"1500","storage_controller_m e mory_size":"640", "disks_per_storage_controller":"4", "custom_config":"iscsiadm -m discovery -t sendtargets -p 109.123.105.131\r\n\r\n/etc/init.d/iscsi restart"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where you can edit: hypervisor - an array of compute resource details: label * - the name of the compute resource backup_ip_address - provisioning network IP address enabled - set 1 to enable this compute resource, otherwise set 0 collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false format_disks - set 1 set 1 to format compute resource's disks during creation, otherwise set 0 passthrough_disks - set 1 if the disks should be passed through to the storage nodes, otherwise set 0. This parameter is for Xen compute resources only. storage - an array of compute resource disks' details: disks - an array of compute resource disks, where: scsi - SCSI inquiry product revision number selected - set 1 to select a disk , otherwise set 0 nics - network interfaces that will be used for storage, where: mac - network interface MAC address type - network interface type: 0 - unassigned (is not used for storage) 1 - SAN subnet OnApp Cloud 4.1 API Guide 2 - passthrough to storage 3 - passthrough to guest (for smart appliance) OnApp Cloud 4.1 API Guide custom_pcis - an array of custom PCI devices pci - NIC PCI selected - 1 if the PCI is selected, otherwise false mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. storage_controller_memory_size - specify the storage controller memory size (minimum 640 MB) disks_per_storage_controller - specify the number of disks per controller virtual server. You can set form 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives power_cycle_command - arbitrary command string to be executed by IPMI from the CP server Currently, a command or commands should be written in one line separated with semicolon. If the command(s) is written in two lines you will receive a "fail" response, although the transaction will be performed. The power cycle command is executed on Control Panel under user onapp, this may be any script created in bash. Edit Smart CloudBoot Compute Resource To edit a smart CloudBoot compute resource, use the following request: PUT /settings/assets/:asset_mac_address/hypervisors.xml PUT /settings/assets/:asset_mac_address/hypervisors.json XML Request example curl -i -X PUT http://onapp.test/settings/hypervisors/:hv_id.xml -d '<hypervisor><label>smart</label><backup_ip_address></backup_ip_address><enabled>1</e n abled><collect_stats>0</collect_stats><disable_failover>0</disable_failover><storage> < disks type="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</ s elected></disk></disks><nics><mac>00:30:48:fd:74:c7</mac><type>1</type></nics><nics>< m ac>00:1b:21:6f:3a:ff</mac><type>3</type></nics></storage><mtu>1500</mtu><storage_cont r oller_memory_size>640</storage_controller_memory_size><disks_per_storage_controller>4 < /disks_per_storage_controller><allow_unsafe_assigned_interrupts>0</allow_unsafe_assig n ed_interrupts><custom_config></custom_config></hypervisor>' -u user:userpass -H JSON Request example 'Accept: application/xml' -H 'Content-type: application/xml' OnApp Cloud 4.1 API Guide curl -i -X PUT http://onapp.test/settings/hypervisors/:hv_id.json -d '{"hypervisor":{"label":"smart", "backup_ip_address":"","enabled":"1","collect_stats":"1","disable_failover":"1","pass t hrough_disks":"0", "storage":{"disks":[{"scsi":"9VM51JELS_9VM51JEL","selected":"1"}]},"mtu":"1500","stor a ge_controller_memory_size":"640", "disks_per_storage_controller":"4", "allow_unsafe_assigned_interrupts":"1","custom_config":""}}' -u user:userpass H 'Accept: application/json' -H 'Content-type: application/json' Where you can edit: hypervisor - an array of compute resource details: label * - the name of the compute resource backup_ip_address - provisioning network IP address enabled - set 1 to enable this compute resource, otherwise set 0 collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false format_disks - set 1 set 1 to format compute resource's disks during creation, otherwise set 0 passthrough_disks - set 1 if the disks should be passed through to the storage nodes, otherwise set 0. This parameter is for Xen compute resources only. storage - an array of compute resource disks' details: disks - an array of compute resource disks, where: scsi - SCSI inquiry product revision number selected - set 1 to select a disk , otherwise set 0 mtu - maximum transferrable unit value. You can set the frame size from 1500 to 9000 bytes. The maximum transportation unit (MTU) is the maximum size of a unit that can be transmitted transferred via ethernet traffic. Any data that exceed the specified MTU value will be divided into smaller units before being transferred. Utilization of jumbo frames allows to reduce increase throughput and increase CPU utilization during large size file transfers. storage_controller_memory_size - specify the storage controller memory size (minimum 640 MB) disks_per_storage_controller - specify the number of disks per controller virtual server. You can specify from 1 to 4 disks. By default, the controller virtual server is created per 4 disk drives allow_unsafe_assigned_interrupts - set true if the compute resource does not support the interrupt remapping, otherwise set false. Note: With allo w_unsafe_assigned_interrupts parameter enabled, smart server is exposed to the PCI passthrough MSI trap injection. custom_config - specify any custom commands you want to run when compute resource is booted PLEASE NOTE: It is currently only possible to set NICs and disk information parameters via UI. Edit Baremetal CloudBoot Compute Resource To edit a baremetal CloudBoot compute resource, use the following request: PUT /settings/assets/:asset_mac_address/hypervisors.xml PUT OnApp Cloud 4.1 API Guide /settings/assets/:asset_mac_address/hypervisors.json OnApp Cloud 4.1 API Guide XML Request example curl -i -X PUT http://onapp.test/settings/hypervisors/:id.xml -d '<hypervisor><label>baremetal</label><enabled>1</enabled></hypervisor>' u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X PUT http://onapp.test/settings/hypervisors/:id.json d '{"hypervisor":{"label":"baremetal", "enabled":"1"}}' -u user:userpass -H 'Accept:application/json' -H 'Contenttype: application/json' Where you can edit: label * - the name of the compute resource enabled - set 1 to enable this compute resource, otherwise set 0 Reboot Compute Resource POST /settings/hypervisors/:hypervisor_id/reboot.xml POST /settings/hypervisors/:hypervisor_id/reboot.json XML Request example curl -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/reboot.xml d '<hypervisor><confirm>1</confirm><force_reboot>1</force_reboot></hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/reboot.json -d '{confirm:"1",force_reboot:"1"}' -u user:userpass -H 'Accept: application/json' H 'Content-type: application/json' An HTTP 201 response is returned on a successful reboot. Unsuccessful reboot responses include HTTP 404 (resource not found – e.g. if the compute resource isn't online) and HTTP 422 (request cannot be processed – e.g. if parameters were incorrect). PLEASE NOTE: Reboot option is not available for VMware compute resources. Delete Compute Resource DELETE /settings/hypervisors/:id.xml DELETE /settings/hypervisors/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id.xml u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' OnApp Cloud 4.1 API Guide JSON Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id.json u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a compute resource with the ID specified is not found, or the URL requested is incorrect. Edit VMware Compute Resource PUT /settings/hypervisors.xml PUT /settings/hypervisors.json XML Request example curl -i -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id.xml -d '<hypervisor><label>zaza_fake_ware_xml_ch</label><ip_address>10.10.10.12</ip_address> < backup_ip_address>10.10.10.13</backup_ip_address><hypervisor_type>vmware</hypervisor_ t ype><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_ f ailover><connection_options><login>login</login><password>password</password><cluster _ name>OnApp</cluster_name><distributed_virtual_switch_name>dvSwitch</distributed_virtu a l_switch_name></connection_options></hypervisor>' user:userpass -H 'Accept: application/xml' -H 'ContentJSON -u Request example type: application/xml' curl -i -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id.json -d '{"hypervisor":{"label":"zaza_fake_ware_json","ip_address":"10.10.10.2","backup_ip_ad d ress":"10.10.10.3","hypervisor":"vmware", "enabled":"1", "collect_stats":"1","disable_failover":"1","connection_options":{"login":"login","pas s word":"password","cluster_name":"OnApp", "distributed_virtual_switch_name":"dvSwitch"}}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json' Where you can edit: ip_address* - the compute resource IP address backup_server_ip_address - provisioning network IP address label* - the name of the compute resource hypervisor_type* - compute resource type enabled - optional parameter, set True to enable a compute resource collect_stats - set 1 to collect statistics for this compute resource, otherwise set 0 disable_failover - optional parameter. Set true to disable compute resource failover, otherwise false connection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name distributed_virtual_switch_name - distributed virtual switch label Get List of VSs Running on Compute Resource OnApp Cloud 4.1 API Guide GET /hypervisors/:hypervisor_id/virtual_machines.xml GET /hypervisors/:hypervisor_id/virtual_machines.json Returns the list of virtual servers deployed on the compute resource. For details, see Get List of VSs section. Get List of Data Store Joins Attached to Compute Resource To get the list of compute resource data store joins (data stores which are attached to the compute resource), use the following request: GET /settings/hypervisors/:hypervisor_id/data_store_joins.xml GET /settings/hypervisors/:hypervisor_id/data_store_joins.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store_joins type="array"> <data_store_join> <created_at type="datetime">2011-10-11T12:50:02+03:00</created_at> <data_store_id type="integer">2</data_store_id> <hypervisor_id nil="true"></hypervisor_id> <id type="integer">7</id> <target_join_id type="integer">2</target_join_id> <target_join_type>Hypervisor</target_join_type> <updated_at type="datetime">2011-10-11T12:50:02+03:00</updated_at> </data_store_join> ... <data_store_join></data_store_join> ... </data_store_joins> Where: data_store_id - the ID of the data store, which is attached to the compute resource hypervisor_id - the compute resource ID id - the join ID target_join_id - the ID of the join target; in this case it is the compute resource ID target_join_type - type of join target; in this case it is compute resource Get List of Data Stores Attached to Compute Resource To get the list of data stores attached to the compute resource: GET /settings/hypervisor_zones/:hypervisor_zone_id/data_stores.xml GET /settings/hypervisor_zones/:hypervisor_zone_id/data_stores.xml XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <data_stores type="array"> <data_store> <created_at type="datetime">2012-04-03T16:07:07+00:00</created_at> <data_store_group_id type="integer">3</data_store_group_id> <data_store_size type="integer">460</data_store_size> <enabled type="boolean">true</enabled> <id type="integer">1</id> <identifier>onapp-ojgg2jk75zfzmw</identifier> <ip>109.123.105.163</ip> <label>ds6</label> <local_hypervisor_id nil="true"/> <updated_at type="datetime">2012-05-25T10:51:21+00:00</updated_at> <zombie_disks_size type="integer">0</zombie_disks_size> <usage type="integer">188</usage> </data_store> <data_store> ... </data_store> </data_stores> Where: created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_store_size — the size of your data store shown in GB id — the data store ID label — the data store label local_hypervisor_id — the ID of the compute resource using this Data Store updated_at — the date when the Data Store was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_store_group_id — the ID of a data store zone to which a particular data store is attached zombie_disk_size — the size of zombie disks attached to this data store in GB. enabled — true if a data store is enabled and you can attach disks to it, otherwise false. Add Data Store Join to Compute Resource To add a data store to the compute resource, use the following request to create a data store join: POST /settings/hypervisors/:hypervisor_id/data_store_joins.xml POST /settings/hypervisors/:hypervisor_id/data_store_joins.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/data_store_joins.xml -d '<data_store_id>5</data_store_id>' -u admin:passwod -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/data_store_joins.json d '{"data_store_id":"5"}' -u admin:passwod -H 'Accept: application/json' -H 'Content-type: application/json' This request creates a data store join, attaching a data store (data_store_id*) to a specified compute resource. Remove Data Store Join from Compute Resource DELETE /settings/hypervisors/:hypervisor_id/data_store_joins/:id.xml DELETE /settings/hypervisors/:hypervisor_id/data_store_joins/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/data_store_joins/:data_store_jo i n_id.xml -u admin:passwod -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/data_store_joins/:data_store_jo i n_id.json -u admin:passwod -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a compute resource with the ID specified is not found, or the URL requested is incorrect. Get List of Compute Resource Network Joins To see the network joins of the compute resource, use the following request: GET/settings/hypervisors/:hypervisor_id/network_joins.xml GET/settings/hypervisors/:hypervisor_id/network_joins.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <network_joins type="array"> <network_join> <created_at type="datetime">2011-11-15T13:27:38+03:00</created_at> <hypervisor_id nil="true"></hypervisor_id> <id type="integer">5</id> <interface>eth0</interface> <network_id type="integer">1</network_id> <target_join_id type="integer">2</target_join_id> <target_join_type>Hypervisor</target_join_type> <updated_at type="datetime">2011-11-15T13:27:38+03:00</updated_at> </network_join> </network_joins> Where: OnApp Cloud 4.1 API Guide hypervisor_id – reserved parameter OnApp Cloud 4.1 API Guide id - the network join ID interface - label of the network interface used to create a network join target_join_id - the ID of the join target; in this case it is the compute resource ID target_join_type - type of join target; in this case it is compute resource Add Network Join to Compute Resource To create a network join (assign the network to the compute resource), use the following request: POST /settings/hypervisors/:hypervisor_id/network_joins.xml POST /settings/hypervisors/:hypervisor_id/network_joins.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/network_joins.xml -d '<network_join><network_id>4</network_id><interface>interface_test</interface></netwo r k_join>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON request example curl -i -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/network_joins.json -d '{"network_join":{"network_id":"4", "interface":"interface_test"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Send the following parameters: network_id* - ID of the network you wish to attach interface* - the name of the appropriate network interface Remove Network Join from Compute Resource DELETE /settings/hypervisors/:hypervisor_id/network_joins/:id.xml DELETE /settings/hypervisors/:hypervisor_id/network_joins/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/network_joins/:network_join_id. x ml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/network_joins/:network_join_id. j son -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion or HTTP 404 when a resolver with the ID specified is not found, or the URL requested is incorrect. Power Cycle CloudBoot Compute Resource This OnApp Cloud 4.1 API Guide POST /settings/hypervisors/:id/power_cycle.xml POST /settings/hypervisors/:id/power_cycle.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisors/:id/power_cycle.xml u user:userpass -H 'Accept: application/xml' -H 'Contenttype:application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/hypervisors/:id/power_cycle.json u user:userpass -H 'Accept: application/json' -H 'Contenttype:application/json' Compute Zones A compute zone consists of several compute resources sharing the same permissions and assigned to the same billing plan. This class manages all the compute zones created in the cloud. compute zones can have data stores and networks attached to them. The combination of compute resource, data store and network zones can be used to create private clouds and tiered services for customers. All API calls are available to this class. Get List of Compute Zones To get an array of compute zones set up within your cloud, use the following request: GET /settings/hypervisor_zones.xml GET /settings/hypervisor_zones.json XML Output example OnApp Cloud 4.1 API Guide <hypervisor_groups type="array"> <hypervisor_group> <created_at type="datetime">2013-04-11T11:39:01+03:00</created_at> <default_gateway>127.0.0.1</default_gateway> <failover_timeout type="integer">15</failover_timeout> <id type="integer">1</id> <label>XEN4</label> <location_group_id type="integer">38</location_group_id> <max_vms_start_at_once type="integer">2</max_vms_start_at_once> <network_failure type="boolean">false</network_failure> <prefer_local_reads type="boolean">false</prefer_local_reads> <recovery_type>roundrobin</recovery_type> <release_resource_type>memory_guarantee</release_resource_type> <run_sysprep type="boolean">true</run_sysprep> <server_type>virtual</server_type> <storage_channel type="integer">2</storage_channel> <updated_at type="datetime">2013-05-08T11:00:02+03:00</updated_at> <vlan nil="true"/> <max_host_free_memory type="integer">6435</max_host_free_memory> <max_host_cpu type="integer">4</max_host_cpu> <cpu_units type="integer">282</cpu_units> <supplier_version nil="true"/> <supplier_provider nil="true"/> </hypervisor_group> </hypervisor_groups> Where: created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the compute zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format default_gateway - external gateway IP address used for the VMware utilization with the external firewall. All virtual machines within a compute zone will be rerouted to this gateway vlan - address of a VLAN the default gateway is located on. id - the compute zone ID label* - title of a compute zone location_group_id - ID of a location group the compute zone is assigned to max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zone network_failure - true, if all compute resources in the compute zone failed prefer_local_reads - 1 if the network throughput dependency for read heavy workloads, otherwise set 0. When the Use Local Read Path feature is enabled, reads go over the local software bridge to a local replica of the data rather than traverse a physical NIC + switch recovery_type - specify the compute resource selection algorithm, which will be used on virtual server provisioning and recovery: roundrobin - set the roundrobin type to select the compute resource with maximum free RAM during the VS recovery fillnext - select the fillnext type to select the compute resource with minimum required free RAM. This option allows to fill compute resource as tightly as possible before starting to use next aplliance in the zone release_resource_type - specify the release resource type. Release resource option allows to free up compute resource resources by over-committing RAM, CPU and CPU shares of virtual servers that are shut down. memory_guarantee - the actual free compute resource memory is calculated. All virtual servers residing on the compute resource will be able to start. ballooning - free compute resource memory is calculated with the ability to use memory over-committing. The ballooning option is only available for KVM compute resources. NOTE: Virtual server may be migrated to another compute resource if there is not enough memory for it to start up on the compute resource with the ballooning option enabled. OnApp Cloud 4.1 API Guide Do not use the ballooning option if there is at least one edge or storage server within the compute zone. OnApp Cloud 4.1 API Guide only_started_vms - only the free memory of running virtual servers is calculated. By default, the compute zone is created with the Memory Guarantee option enabled. In this case the release resources option is not used. Then, to enable resource over-committing you should choose either the Ballooning or Only Started VS option. failover_timeout - time period for which the iterations will run during the failover run-sysprep - set 1 to enable Windows virtual server deployment without running sysprep server_type - specify the type of servers that will reside within this compute zone: virtual - choose the virtual type to create a Xen, KVM, VMware or CloudBoot zone smart - choose the smart server type to create a smart server zone baremetal - choose the baremetal server type to create a baremetal server zone storage_channel - storage channel for the communication with the max_host_free_memory - compute resource with maximum RAM value in this zone max_host_cpu - compute resource with maximum RAM value in this zone cpu_units - the number of CPU units applied ti this zone Page history v. 3.3: cpu_units v. 3.1: server_type release_resource_type recovery_type run_sysprep failover_timeout storage_channel max_host_free_memory max_host_cpu Get Compute Zone Details The following method returns details for a particular compute zone: GET /settings/hypervisor_zones/:id.xml GET /settings/hypervisor_zones/:id.json XML Response example OnApp Cloud 4.1 API Guide <hypervisor_group> <closed type="boolean">false</closed> <created_at type="datetime">2013-09-04T12:49:45+03:00</created_at> <federation_enabled type="boolean">false</federation_enabled> <federation_id nil="true"/> <hypervisor_id nil="true"/> <id type="integer">1</id> <identifier nil="true"/> <label>KVM C5 HV Zone</label> <location_group_id type="integer">1</location_group_id> <server_type>virtual</server_type> <traded type="boolean">false</traded> <updated_at type="datetime">2015-06-11T17:56:12+03:00</updated_at> <max_host_free_memory type="integer">1191</max_host_free_memory> <max_host_cpu type="integer">4</max_host_cpu> <prefer_local_reads type="boolean">false</prefer_local_reads> <vlan nil="true"/> <release_resource_type>ballooning</release_resource_type> <network_failure type="boolean">false</network_failure> <storage_channel type="integer">2</storage_channel> <run_sysprep type="boolean">true</run_sysprep> <default_gateway nil="true"/> <recovery_type>roundrobin</recovery_type> <failover_timeout type="integer">15</failover_timeout> <cpu_units type="integer">1000</cpu_units> <supplier_version nil="true"/> <supplier_provider nil="true"/> </hypervisor_group> Where: created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at - the date when the compute zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format default_gateway - external gateway IP address used for the VMware utilization with the external firewall. All virtual machines within a compute zone will be rerouted to this gateway closed - true, if federated zone is suspended by buyer, otherwise false federation_id - the ID of a compute zone at the market federation_enabled - true, if federation is enabled by seller, otherwise false vlan - address of a VLAN the default gateway is located on. hypervisor_id - the ID of a compute resource id - the compute zone ID label* - title of a compute zone location_group_id - ID of a location group the compute zone is assigned to traded - true, if the zone came from the Federation and was subscribed to by the user max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zone network_failure - true, if all compute resources in the compute zone failed prefer_local_reads - 1 if the network throughput dependency for read heavy workloads, otherwise set 0. When the Use Local Read Path feature is enabled, reads go over the local software bridge to a local replica of the data rather than traverse a physical NIC + switch recovery_type - specify the compute resource selection algorithm, which will be used on virtual server provisioning and recovery: OnApp Cloud 4.1 API Guide roundrobin - set the roundrobin type to select the compute resource with maximum free RAM during the VS recovery OnApp Cloud 4.1 API Guide fillnext - select the fillnext type to select the compute resource with minimum required free RAM. This option allows to fill compute resource as tightly as possible before starting to use next aplliance in the zone release_resource_type - specify the release resource type. Release resource option allows to free up compute resource resources by over-committing RAM, CPU and CPU shares of virtual servers that are shut down. memory_guarantee - the actual free compute resource memory is calculated. All virtual servers residing on the compute resource will be able to start. ballooning - free compute resource memory is calculated with the ability to use memory over-committing. The ballooning option is only available for KVM compute resources. NOTE: Virtual server may be migrated to another compute resource if there is not enough memory for it to start up on the compute resource with the ballooning option enabled. Do not use the ballooning option if there is at least one edge or storage server within the compute zone. only_started_vms - only the free memory of running virtual servers is calculated. By default, the compute zone is created with the Memory Guarantee option enabled. In this case the release resources option is not used. Then, to enable resource over-committing you should choose either the Ballooning or Only Started VS option. failover_timeout - time period for which the iterations will run during the failover run-sysprep - set 1 to enable Windows virtual server deployment without running sysprep server_type - specify the type of servers that will reside within this compute zone: virtual - choose the virtual type to create a Xen, KVM, VMware or CloudBoot zone smart - choose the smart server type to create a smart server zone baremetal - choose the baremetal server type to create a baremetal server zone storage_channel - storage channel for the communication max_host_free_memory - compute resource with maximum RAM value in this zone max_host_cpu - compute resource with maximum RAM value in this zone cpu_units - the number of cpu units applied to a compute resource Page history v. 4.1: closed federation_id federation_enabled hypervisor_id traded v. 3.3: cpu_units v. 3.1: server_type release_resource_type recovery_type run_sysprep failover_timeout storage_channel max_host_free_memory max_host_cpu OnApp Cloud 4.1 API Guide Add Compute Zone To add a new compute zone, send the following request: POST /settings/hypervisor_zones.xml POST /settings/hypervisor_zones.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisor_zones.xml -d '<hypervisor_zone><label>zaza</label><server_type>virtual</server_type><location_grou p _id>38</location_group_id><release_resource_type>memory_guarantee</release_resource_t y pe><max_vms_start_at_once>5</max_vms_start_at_once><recovery_type>roundrobin</recover y _type><failover_timeout>15</failover_timeout><run_sysprep>1</run_sysprep><default_gat e way></default_gateway><vlan></vlan><cpu_units>1000</cpu_units></hypervisor_zone>' -u user:userpass -H 'Accept: application/xml' -H 'ContentJSON type: Requestapplication/xml' example curl -i -X POST http://onapp.test/settings/hypervisor_zones.json d '{"hypervisor_zone":{"label":"zaza", "server_type":"virtual","location_group_id":"38", "release_resource_type":"memory_guarantee","max_vms_start_at_once":"5","recovery_type" :"roundrobin", "failover_timeout":"15","run_sysprep":"1","default_gateway":"","vlan":"","cpu_units": " 1000"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where: label* - title of a new compute zone server_type - specify the type of servers that will reside within this compute zone: virtual - choose the virtual type to create a Xen, KVM, VMware or CloudBoot zone smart - choose the smart server type to create a smart server zone baremetal - choose the baremetal server type to create a baremetal server zone location_group - specify the location group to which the compute zone will be assigned release_resource_type - specify the release resource type. Release resource option allows to free up compute resource resources by over-committing RAM, CPU and CPU shares of virtual servers that are shut down. By default, the compute zone is created with the Memory Guarantee option enabled. In this case the release resources option is not used. Then, to enable resource over-committing you should choose either the Ballooning or Only Started VS option. memory_guarantee - the actual free compute resource memory is calculated. All virtual servers residing on the compute resource will be able to start. ballooning - free compute resource memory is calculated with the ability to use memory over-committing. The ballooning option is only available for KVM compute resources. NOTE: Virtual server may be migrated to another compute resource if there is not enough memory for it to start up on the compute resource with the ballooning option enabled. Do not use the ballooning option if there is at least one edge or storage server within the compute zone. only_started_vms - only the memory of running virtual servers is calculated. max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zone OnApp Cloud 4.1 API Guide recovery_type - specify the compute resource selection algorithm, which will be used on virtual server provisioning and recovery, per compute zone: roundrobin - set the roundrobin type to select the compute resource with maximum free RAM during the VS recovery Note: this option behaves in different ways, depending on the event: On provisioning, the round-robin algorithm will be used on compute resource selection. On recovery, the compute resource with maximum free RAM will be selected. fillnext - select the fillnext type to select the compute resource with minimum required free RAM. This option allows to fill compute resource as tightly as possible before starting to use next appliance in the zone failover_timeout - time period for which the iterations will run during the failover if the compute resource does not respond prefer_local_reads - set 1 to minimise the network throughput dependency for read heavy workloads. When this option is enabled, reads go over the local software bridge to a local replica of the data rather than traverse a physical NIC + switch. run_sysprep - set 1 to enable Windows virtual server deployment without running sysprep NOTE: It is not possible to set VS password when creating a Windows-based VMware virtual server without running a sysprep. cpu_units - set the number of cpu units for applied to each compute resource in this compute zone VMware parameters: default_gateway - external gateway IP address. All virtual servers within the compute zone will be rerouted to this gateway. vlan - address of a VLAN, on which the default gateway is located, with prefix length specified. For example: 10.0.0.1/24. Page history v. 3.3: cpu_units v. 3.1: server_type release_resource_type recovery_type run_sysprep failover_timeout Edit Compute Zone Use the following method to edit an existing compute zone: PUT /settings/hypervisor_zones/:id.xml PUT /settings/hypervisor_zones/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.xml -d '<hypervisor_zone><label>apliance zone</label><location_group_id>38</location_group_id><release_resource_type>memory_gu a rantee</release_resource_type><max_vms_start_at_once>10</max_vms_start_at_once><recov e ry_type>roundrobin</recovery_type><failover_timeout>20</failover_timeout><run_sysprep > 1</run_sysprep><cpu_units>1000</cpu_units><update_cpu_units>1</update_cpu_units><cpu_ g uarantee>1</cpu_guarantee></hypervisor_zone>' JSON -u Request example user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.json d '{"hypervisor_zone":{"label":"hypervisor","location_group_id":"1","release_resource_t y pe":"memory_guarantee","max_vms_start_at_once":"55", "recovery_type":"roundrobin","failover_timeout":"155", "run_sysprep":"1","cpu_units":"1000","update_cpu_units":"1", "cpu_guarantee":"1"}}' u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Where you can edit: label* - title of a new compute zone server_type - specify the type of servers that will reside within this compute zone: virtual - choose the virtual type to create a Xen, KVM, VMware or CloudBoot zone smart - choose the smart server type to create a smart server zone baremetal - choose the baremetal server type to create a baremetal server zone location_group - edit the location group to which the compute zone is assigned. You can change the already set location if there are no virtual servers built on compute resources of this zone. release_resource_type - specify the release resource type. Release resource option allows to free up compute resource resources by over-committing RAM, CPU and CPU shares of virtual servers that are shut down. By default, the compute zone is created with the Memory Guarantee option enabled. In this case the release resources option is not used. Then, to enable resource over-committing you should choose either the Ballooning or Only Started VS option. memory_guarantee - the actual free compute resource memory is calculated. All virtual servers residing on the compute resource will be able to start. ballooning - free compute resource memory is calculated with the ability to use memory over-committing. The ballooning option is only available for KVM compute resources. NOTE: Virtual server may be migrated to another compute resource if there is not enough memory for it to start up on the compute resource with the ballooning option enabled. Do not use the ballooning option if there is at least one edge or storage server within the compute zone. only_started_vms - only the free memory of running virtual servers is calculated. max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zone recovery_type - specify the compute resource selection algorithm, which will be used on virtual server provisioning and recovery: roundrobin - set the roundrobin type to select the compute resource with maximum free RAM during the VS recovery. This option behaves in different ways, depending on the event: On provisioning, the round-robin algorithm will be used on compute resource selection. On recovery, the compute resource with maximum free RAM will be selected. fillnext - select the fillnext type to select the compute resource with minimum required free RAM. This option allows to fill compute resource as tightly as possible before starting to use next appliance in the zone failover_timeout - time period for which the iterations will run during the failover if the compute resource does not respond prefer_local_reads - set 1 to minimise the network throughput dependency for read heavy workloads. When this option is enabled, reads go over the local software bridge to a local replica of the data rather than traverse a physical NIC + switch. OnApp Cloud 4.1 API Guide run-sysprep - set 1 to enable Windows virtual server deployment without running sysprep. NOTE: It is not possible to set VS password when creating a Windows-based VMware virtual server without running a sysprep. cpu_units - set the amount of CPU units applied to the whole compute zone. update_cpu_units - set 1 to update the amount of CPU units for each compute resource in this zone according to the cpu_units parameter cpu_guarantee - if 1, the system will make sure there is enough CPU in the compute zone to create a new VS VMware parameters: default_gateway - external gateway IP address. All virtual servers within the compute zone will be rerouted to this gateway. vlan - address of a VLAN, on which the default gateway is located, with prefix length specified. For example: 10.0.0.1/24. Page history v. 3.3: cpu_units update_cpu_units cpu_guarantee v. 3.1: server_type release_resource_type recovery_type run_sysprep failover_timeout Delete Compute Zone To delete a compute zone, use the following API call: DELETE /settings/hypervisor_zones/:id.xml DELETE /settings/hypervisor_zones/:id.json XML Request example curl -X DELETE http://onapp.test/settings/hypervisor_zones/:id.xml -u user:userpass H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -X DELETE http://onapp.test/settings/hypervisor_zones/:id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' You will get a 204 status response on success, and 404 if there is no such a compute zone with a requested ID or you entered incorrect URL. Get List of Compute Resources Attached to Compute Zone GET /settings/hypervisor_zones/:hypervisor_zone_id/hypervisors.xml GET /settings/hypervisor_zones/:hypervisor_zone_id/hypervisors.json Returns the array of all compute resources attached to a particular compute zone. Attach Compute Resource to Compute Zone Use the following request to attach compute resource to compute zone: XML Request example OnApp Cloud 4.1 API Guide curl -X POST -i http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/hypervisors/:hypervis o r_id/attach.xml -u user:userpass -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -X POST -i http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/hypervisors/:hypervis o r_id/attach.json -u user:userpass -H 'Accept:application/json' -H 'Content-type:application/json' Where you have to specify ID of a compute zone and IDs of the compute resources you want to attach in the URL. We strongly recommend that you avoid creating mixed compute zones: do not add CloudBoot and static boot compute resources to one compute zone do not add both XEN and KVM compute resources to one zone The reason is that XEN VSs cannot migrate/failover to a KVM compute resource and KVM VSs cannot migrate/failover to a XEN compute resource. Remove Compute Resource from Compute Zone Use the following request to remove compute resource from compute zone: XML Request example curl -X POST -i http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/hypervisors/:hypervis o r_id/detach.xml -u user:userpass -H 'Accept:application/xml' -H 'Content-type:application/xml' JSON Request example curl -X POST -i http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/hypervisors/:hypervis o r_id/detach.json -u user:userpass -H 'Accept:application/json' -H 'Content-type:application/json' Where you have to specify ID of a compute zone and IDs of the compute resources you want to remove in the URL. Get the List of Data Store Joins Attached to Compute Zone GET /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.xml GET /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.json XML Response example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <data_store_joins type="array"> <data_store_join> <created_at type="datetime">2011-01-17T13:16:31Z</created_at> <target_join_type>Hypervisor Group</target_join_type> <updated_at type="datetime">2011-01-17T13:16:31Z</updated_at> <data_store_id type="integer">2</data_store_id> <hypervisor_id type="integer" nil="true"> </hypervisor_id> <id type="integer">7</id> <target_join_id type="integer">9</target_join_id> </data_store_join> </data_store_joins> Where: created_at - timestamp in DB when the record was created updated_at - timestamp in DB when the record was updated target_join_type - compute resource group for data store joins data_store_id - the ID of a data store attached to a compute zone hypervisor_id - the ID of an compute resource to which a data store is attached id - the data store join ID target_join_id - the ID of a compute zone for which a join is created Add Data Store Join to Compute Zone POST /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.xml POST /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.xm l -d '<data_store_id>:data_store_id</data_store_id>' -u admin:passwod -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.jso n -d '{"data_store_id":":data_store_id"}' -u admin:passwod -H 'Accept: application/json' -H 'Content-type: application/json' This request attaches a particular data store join (:data_store_id*) to a specific compute zone (:hypervisor_zone_id) Remove Data Store Join from Compute Zone DELETE /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:id.xml DELETE /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X DELETE http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:dat a _store_join_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:dat a _store_join_id.json -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' Where: id* – is an ID of data store join Returns HTTP 204 response on successful deletion, or HTTP 404 when a data store join with the ID specified is not found, or the URL requested is incorrect. Get List of Network Joins Attached to Compute Zone GET /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.xml GET /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.json An array of network joins is returned on successful request. XML Output example <?xml version="1.0" encoding="UTF-8"?> <network_joins type="array"> <network_join> <created_at type="datetime">2011-02-01T12:27:52Z</created_at> <network_id type="integer">1</network_id> <target_join_type>Hypervisor Group</target_join_type> <updated_at type="datetime">2011-02-01T12:27:52Z</updated_at> <hypervisor_id type="integer" nil="true"></hypervisor_id> <id type="integer">6</id> <interface>eth2</interface> <target_join_id type="integer">1</target_join_id> </network_join> </network_joins> Where: created_at - the timestamp when the record was created network_id - the ID of a network attached to this zone target_join_type - compute resource group for a network join updated_at - the timestamp when the record was updated hypervisor_id - the ID of an compute resource to which this network is assigned id - the network join ID interface - the network join interface target_join_id - the ID of an compute zone to which this network join is attached OnApp Cloud 4.1 API Guide Add Network Join to Compute Zone POST /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.xml POST /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.json XML Request example curl -i -X POST http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/network_joins.xml -d '<network_join><network_id>4</network_id><interface>interface_test</interface></netwo r k_join>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X POST http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/network_joins.json d '{"network_join":{"network_id":"5","interface":"interface_test2"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Send the following parameters: network_id*- ID of the network you wish to attach interface*- the name of the appropriate network interface Remove Network Join from Compute Zone DELETE /settings/hypervisor_zones/:hypervisor_zone_id/network_joins/:id.xml DELETE /settings/hypervisor_zones/:hypervisor_zone_id/network_joins/:id.json XML Request example curl -i -X DELETE http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/network_joins/:networ k _join_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/network_joins/:networ k _join_id.json -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when a network join with the ID specified is not found, or the URL requested is incorrect. Instance Types Instance types are preconfigured CPU/RAM/Disk/Bandwidth packages that can be selected during the VS creation process. You can add multiple instance types specifying different values for the parameters to suit your customer's needs. Resources that are not set when creating an instance type, such as, for example, swap disk size, are calculated automatically. To provide your users with ability to choose VSs resources from the predefined instance type(s), add the necessary types to the users' billing plan OnApp Cloud 4.1 API Guide (s). After that, instance types will appear in the server creation wizard, on the Resources step. OnApp Cloud 4.1 API Guide Get List of Instance Types To view the list of instance types, use the following request: GET /instance_types.xml GET /instance_types.json XML Request example curl -i -X GET http://onapp.test/instance_types.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET http://onapp.test/instance_types.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <instance_types type="array"> <instance_type> <bandwidth type="integer">1</bandwidth> <cpus type="integer">2</cpus> <created_at type="datetime">2015-06-17T18:29:26+03:00</created_at> <disk_size type="integer">1</disk_size> <id type="integer">1</id> <label>Test</label> <memory type="integer">128</memory> <updated_at type="datetime">2015-06-17T18:29:26+03:00</updated_at> </instance_type> <instance_type>...</instance_type> </instance_types> Where: bandwidth - the bandwidth available in this instance type cpus - the number of CPU cores available in this instance type created_at - time when the instance type was created, in [YYYY][MM][DD]T[hh][mm][ss]Z disk_size - the disk size available in this instance type id - ID of the instance type label - the name of the instance type memory - the RAM size (GB) available in the instance type updated_at - time when the instance type was updated, in [YYYY][MM][DD]T[hh][mm][ss]Z Get Instance Type Details To view the details of an instance type, use the following request: GET /instance_types/:instance_type_id.xml GET /instance_types/:instance_type_id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X GET http://onapp.test/instance_types/:instance_type_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X GET http://onapp.test/instance_types/:instance_type_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example <?xml version="1.0" encoding="UTF-8"?> <instance_type> <id type="integer">1</id> <label>Test</label> <cpus type="integer">2</cpus> <disk_size type="integer">1</disk_size> <memory type="integer">128</memory> <bandwidth type="integer">1</bandwidth> <created_at type="datetime">2015-06-17T15:29:26+00:00</created_at> <updated_at type="datetime">2015-06-17T15:29:26+00:00</updated_at> <billing_plan_ids type="array"> <fixnum type="integer">1</fixnum> <fixnum type="integer">5</fixnum> <fixnum type="integer">140</fixnum> </billing_plan_ids> </instance_type> Where: id - ID of the instance type label - the name of the instance type cpus - the number of CPU cores available in this instance type disk_size - the disk size available in this instance type memory - the RAM size (GB) available in the instance type bandwidth - the bandwidth available in this instance type created_at - time when the instance type was created, in [YYYY][MM][DD]T[hh][mm][ss]Z updated_at - time when the instance type was updated, in [YYYY][MM][DD]T[hh][mm][ss]Z billing_plan_ids - the array of billing plans to which this instance type was added fixnum - the ID of the billing plan in which the instance type was used Edit Instance Type To edit an instance type, use the following request: PUT /instance_types/:instance_type_id.xml PUT /instance_types/:instance_type_id.json XML Request example OnApp Cloud 4.1 API Guide curl -i -X PUT -d '<instance_type><label>new_label</label><cpus>1</cpus><memory>1024</memory><disk_size > 50</disk_size><bandwidth>100</bandwidth></instance_type>' -u user:userpass http://onapp.test/instance_types/:instance_type_id.xml -H 'Accept: application/xml' H 'Content-type: application/xml' JSON Request example curl -i -X PUT -d '{"instance_type": {"label":"new_label", "cpus":"1", "memory":"1024", "disk_size":"50", "bandwidth":"100"}}' -u user:userpass http://onapp.test/instance_types/:instance_type_id.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: label - the name of the instance type cpus - the number of CPU cores available in this instance type. The maximum CPUs value is 8. memory - the RAM size available in the instance type. The maximum value is 16384 MB by default. disk_size - the disk size available in this instance type. The maximum value is 100 GB by default. bandwidth - the bandwidth available in this instance type. The maximum value is 450 GB by default. You can change the default minimum and/or maximum values for memory, disk size and bandwidth by adding the following parameters to the config/on_app.yml file and restarting OnApp services: instance_type_min_disk_size (GB) instance_type_max_disk_size (GB) instance_type_max_memory (MB) instance_type_min_bandwidth (GB) Add Instance Type To add a new instance type, use the following request: POST /instance_types.xml POST /instance_types.json XML Request example curl -i -X POST -d '<instance_type><label>example</label><cpus>1</cpus><memory>1024</memory><disk_size>5 0 </disk_size><bandwidth>100</bandwidth></instance_type>' -u user:userpass http://onapp.test/instance_types.xml -H 'Accept: application/xml' -H 'Contenttype: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -d '{"instance_type": {"label":"example", "cpus":"1", "memory":"1024", "disk_size":"50", "bandwidth":"100"}}' -u user:userpass http://onapp.test/instance_types.json -H 'Accept: application/json' -H 'Content-type: application/json' Where: OnApp Cloud 4.1 API Guide label - the name of the instance type cpus - the number of CPU cores available in this instance type. The maximum CPUs value is 8. memory - the RAM size (GB) available in the instance type. The maximum value is 16384 MB by default. disk_size - the disk size available in this instance type. The maximum value is 100 GB by default. bandwidth - the bandwidth available in this instance type. The maximum value is 450 GB by default. You can change the default minimum and/or maximum values for memory, disk size and bandwidth by adding the following parameters to the config/on_app.yml file and restarting OnApp services: instance_type_min_disk_size (GB) instance_type_max_disk_size (GB) instance_type_max_memory (MB) instance_type_min_bandwidth (GB) Delete Instance Type To delete an instance type, use the following request: DELETE /instance_types/:instance_type_id.xml DELETE /instance_types/:instance_type_id.xml XML Request example curl -i -X DELETE http://onapp.test/instance_types/:instance_type_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -X DELETE http://onapp.test/instance_types/:instance_type_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' Integrated Storage Integrated Storage functionality allows to build a highly scalable and resilient SAN using local disks in compute resource. Using the Integrated Storage, you can create a virtual data store in OnApp Cloud that spans multiple physical drives in compute resources, with RAID-like replication and striping across drives. Get List of Integrated Storage Data Stores To get the list of integrated storage data stores, use the following request: GET GET /storage/:hvz_id/data_stores.xml /storage/:hvz_id/data_stores.json XML Request example curl -X GET http://onapp.test/storage/:hvz_id/data_stores.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example OnApp Cloud 4.1 API Guide curl -X GET http://onapp.test/storage/:hvz_id/data_stores.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass OnApp Cloud 4.1 API Guide Where: hvz_id - compute zone ID (storage API enpoint zone) XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_stores type="array"> <data_store> <id>7fzvrpeyw46j3a</id> <name>igor-datastore-3</name> <total_size type="integer">160041885696</total_size> <free_size type="integer">160016719872</free_size> <performance type="integer">0</performance> <disk_count type="integer">2</disk_count> <nodes type="array"> <node> <id>3233314811</id> </node> </nodes> </data_store> </data_stores> Where: data_stores - an array of data stores with the following details id -integrated data store ID name - data store label total_size - the total size of the integrated data store in bytes free_size - the free size of the integrated data store in bytes performance - the storage node performance level (0- Low, 1 - Normal, 2 - High performance) disk_count - the number of disks on this data store nodes - an array of nodes with their details id - node ID Get Integrated Data Store Details To view details of a particular integrated data store: GET GET /storage/:hvz_id/data_stores/:data_store_id.xml /storage/:hvz_id/data_stores/:data_store_id.json XML Request example curl -X GET http://onapp.test/storage/:hvz_id/data_stores/:data_store_id.xml H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example curl -X GET http://onapp.test/storage/:hvz_id/data_stores/:data_store_id.json H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide hvz_id - compute zone ID (storage API enpoint zone) data_store_id - data store ID XML Output example <?xml version="1.0" encoding="UTF-8"?> <data_store> <id>7fzvrpeyw46j3a</id> <name>igor-datastore-3</name> <total_size type="integer">160041885696</total_size> <free_size type="integer">160016719872</free_size> <performance type="integer">0</performance> <disk_count type="integer">2</disk_count> <nodes type="array"> <node> <id>3233314811</id> </node> </nodes> </data_store> Where: id - integrated data store ID name - data store label total_size - the total size of the integrated data store in bytes free_size - the free size of the integrated data store in bytes performance - the storage node performance level (0- Low, 1 - Normal, 2 - High performance) disk_count - the number of disks on this data store nodes - an array of nodes with their details id - node ID Add Integrated Storage Data Store To add new integrated storage data store: POST POST /storage/:hvz_id/data_stores.xml /storage/:hvz_id/data_stores.json XML Request example curl -X POST -d '<storage_data_store><name>datastore-test2</name><replicas>1</replicas><stripes>1</st ripes><node_ids type="array"><string>190496273</string></node_ids><overcommit>0</overcommit></storage _ data_store>' http://onapp.test/storage/:hvz_id/data_stores.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example OnApp Cloud 4.1 API Guide curl -X POST -d'{"storage_data_store":{"name":"datastore-test2","replicas":"1","stripes":"1","over commit":"0","node_ids":["125120933","663678591"]}}' http://onapp.test/storage/:hvz_id/data_stores.json -H 'Accept: application/json' H 'Content-type: application/json' -u user:userpass Where: hvz_id* - compute zone ID (storage API enpoint zone) replicas - the number of replicas that will be used for data in this datastore and could be in range 1, 2, 4. The default value is 2. stripes – the number of stripes the data will be divided into, it can also be 1, 2, 4. The default value is 1. node_ids* – the array of identifiers of storage nodes, that will be used to store the data. overcommit - overcommit percentage. You can set overcommit to 0, 20, 50 or 100. The default value is 0. JSON Response example: {"name":"datastore-igor-2","replicas":1,"stripes":1,"performance":"0","overcommit":"0" ,"owner_ids":["125120933"," 663678591 "],"owners":"125120933,663678591","members":"125120933,663678591","membership_count":2 ,"uuid":"5lj3ac7hszbgro","provisioning":0,"result":"SUCCESS"} Where: performance - the storage node performance level (0- Low, 1 - Normal, 2 - High performance) owner_ids - the array of identifiers of storage nodes, that are used to store data owners - the array of identifiers of storage nodes, that are used to store data members - the storage node ids that are used to store the data membership_count - the total number of storage nodes used uuid - unique datastore identifier. PAGE HISTORY v. 3.2: The request now includes a hvz_id parameter. v. 3.0: An overcommit parameter has been added to this API request. Edit Integrated Data Store To edit the integrated data store: PUT PUT /storage/:hvz_id/data_stores/:id.xml /storage/:hvz_id/data_stores/:id.json Where: hvz_id - compute zone ID (storage API enpoint zone) OnApp Cloud 4.1 API Guide id - data store ID OnApp Cloud 4.1 API Guide XML Request example curl -X PUT -d '<data_store><owner_ids type="array"><string>190496273</string></owner_ids></data_store>' http://onapp.test/storage/:hvz_id/data_stores/:id.xml -H 'Accept: application/xml' H 'Content-type: application/xml' -u user:userpass JSON Request example curl -X PUT -d '{"data_store":{"owner_ids":["125120933", "663678591"]}}' http://onapp.test/storage/:hvz_id/data_stores/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass Where you can edit: owner_ids – the array of identifiers of storage nodes, that will be used to store the data. You will get a 204 status response on success, and 404 if there is no such data store with a requested ID or you entered incorrect URL. PAGE HISTORY v. 3.2: The request now includes a hvz_id parameter. Delete Integrated Storage Data Store To delete an integrated storage data store: DELETE /storage/:hvz_id/data_stores/:id.xml DELETE /storage/:hvz_id/data_stores/:id.json XML Request example curl -X DELETE http://onapp.test/storage/:hvz_id/data_stores/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example curl -X DELETE http://onapp.test/storage/:hvz_id/data_stores/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass Where: hvz_id - compute zone ID (storage API enpoint zone) id - data store ID You will get a 204 status response on success, and 404 if there is no such data store with a requested ID or you entered incorrect URL. PAGE HISTORY v. 3.2: The request now includes a hvz_id parameter. Add Disk Drive to Integrated Storage Data Store OnApp Cloud 4.1 API Guide To add a new VDisk to the integrated storage data store: POST /storage/:hvz_id/data_stores/:data_store_id/disks.xml POST /storage/:hvz_id/data_stores/:data_store_id/disks.json XML Request example curl -X POST -d '<storage_disk><name>testdisk</name><size>12</size></storage_disk>' http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example curl -X POST -d '{"storage_disk":{"name":"testdisk", "size":"12"}}' http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass Where you have to specify disk label and disk size in megabytes. PLEASE NOTE: You cannot decrease size of Integrated Storage data store disks. PAGE HISTORY v. 3.2: The request now includes a hvz_id parameter. Remove Disk Drive from Integrated Storage Data Store To delete VDisk from the integrated storage data store: DELETE /storage/:hvz_id/data_stores/:data_store_id/disks/:disk_id.xml DELETE /storage/:hvz_id/data_stores/:data_store_id/disks/:disk_id.json XML Request example curl -X DELETE http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks/:disk_id.xml H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass JSON Request example curl -X DELETE http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks/:disk_id.json H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass Where: hvz_id - the ID of the compute resource data_store_id - the ID of the data store to which the disk is attached disk_id - the ID of the disk you wish to remove You will get a 204 status response on success, and 404 if there is no such data store or disk with a requested ID or you entered incorrect URL. PAGE HISTORY OnApp Cloud 4.1 API Guide v. 3.2: OnApp Cloud 4.1 API Guide The request now includes a hvz_id parameter. Get Storage Node IO Statistics GET /storage/:hvz_id/nodes/:node_id/io_stats.xml GET /storage/:hvz_id/nodes/:node_id/io_stats.json XML Request Example GET -u 'user:userpass' http://onapp.test/storage/:hvz_id/nodes/:node_id/io_stats.xml?filter[start]=2014-0318 +14:29\&filter[type]=1\&filter[finish]=2014-03-18+14:35 -H 'Accept: application/xml' -H 'Content-type: application/xml' Json Request Example GET -u 'user:userpass' http://onapp.test/storage/:hvz_id/nodes/:node_id/io_stats.json?filter[start]=2014-031 8+14:29\&filter[type]=1\&filter[finish]=2014-03-18+14:35 -H 'Accept: application/json' -H 'Content-type: application/json' Where: hvz_id - compute zone ID (storage API enpoint zone) node_id - storage node ID filter[start] - defines the start period for the stats filter[finish] - defines the end period for which the stats should be generated filter[type] - specifies the type of stats. Use the following mapping: 0 - number of read IOs processed 1 - number of read IOs merged with in-queue IO 2 - number of sectors read 3 - total wait time for read requests 4 - number of write IOs processed 5 - number of write IOs merged with in-queue IO 6 - number of sectors written 7 - total wait time for write requests 8 - number of IOs currently in flight 9 - total time this block device has been active 10 - total wait time for all requests XML Response example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <node_io_stats type="array"> <node_io_stat> <created_at type="datetime">2012-12-27T08:30:28+00:00</created_at> <value type="integer">0</value> <node_id>"1635592966"</node_id> </node_io_stat> <node_io_stat> <created_at type="datetime">2012-12-27T08:31:28+00:00</created_at> <value type="integer">0</value> <node_id>"1635592967"</node_id> </node_io_stat> ... Get Integrated Storage Datastore Disk IO Statistics GET /storage/:hvz_id/nodes/:node_id/vdisk_id/io_stats.xml GET /storage/:hvz_id/nodes/:node_id/vdisk_id/io_stats.json XML Request example GET -u 'user:userpass' http://onapp.test/storage/:hvz_id/nodes/:node_id/vdisk_id/io_stats.xml?filter[start]= 2 014-03-18+14:29\&filter[type]=1\&filter[finish]=2014-03-18+14:35 -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example GET -u 'user:userpass' http://onapp.test/storage/:hvz_id/nodes/:node_id/vdisk_id/io_stats.json?filter[start] = 2014-03-18+14:29\&filter[type]=1\&filter[finish]=2014-03-18+14:35 -H 'Accept: application/json' -H 'Content-type: application/json' Where: hvz_id - compute zone ID (storage API enpoint zone) node_id - storage node ID vdisk_id - virtual disk ID filter[start] - defines the start period for the stats filter[finish] - defines the end period for which the stats should be generated filter[type] - specifies the type of stats. Use the following mapping: 0 - number of read IOs processed 1 - number of read IOs merged with in-queue IO 2 - number of sectors read 3 - total wait time for read requests 4 - number of write IOs processed 5 - number of write IOs merged with in-queue IO 6 - number of sectors written OnApp Cloud 4.1 API Guide 7 - total wait time for write requests OnApp Cloud 4.1 API Guide 8 - number of IOs currently in flight 9 - total time this block device has been active 10 - total wait time for all requests Forget Storage Node Use the following API call when the node that is down is still visible in nodes list: POST /storage/nodes/:node_id/forget.xml POST /storage/nodes/:node_id/forget.json XML Request example curl -i -X POST -u user:userpass http://onapp.test/storage/nodes/:node_id/forget.xml?storage_endpoint_zone=7 1 JSON Request example curl -i -X POST -u user:userpass http://onapp.test/storage/nodes/:node_id/forget.json?storage_endpoint_zone=7 1 Where you have to specify storage node ID and the storage API endpoint zone ID in the URL. Returns 200 status on succes and 422 on failure Get List of Backend Nodes on Integrated Storage Data Store To get the list of integrated storage backend nodes, use the following request: GET GET /storage/:hvz_id/hypervisors.xml /storage/:hvz_id/hypervisors.json XML Request example curl -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/storage/:hvz_id/hypervisors.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/storage/:hvz_id/hypervisors.json Where: hvz_id - compute zone ID (storage API enpoint zone) XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <hypervisor> <id>3</id> <nodes type="array"> <node> <id>2</id> </node> <node> <id>12</id> </node> </hypervisor> Where: nodes - an array of nodes with their IDs id - compute resource ID Get List of Integrated Storage Data Stores Disk Drives To get the list of integrated storage data store disk drives, use the following request: GET GET /storage/:hvz_id/data_stores/:data_store_id/disks.xml /storage/:hvz_id/data_stores/:data_store_id/disks.json XML Request example curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks.xml JSON Request example curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/storage/:hvz_id/data_stores/:data_store_id/disks.json Where: hvz_id - compute zone ID (storage API enpoint zone) data_store_id - the data store ID XML Output example <?xml version="1.0" encoding="UTF-8"?> <disks type="array"> <disk> <id>7fzvrpeyw46j3a</id> </disk> <name>igor-datastore-3</name> <disk> <id>clzhym8rod9kjn</id> </disk> </disks> OnApp Cloud 4.1 API Guide Where: OnApp Cloud 4.1 API Guide disks - an array of disks with the following details id -integrated data store ID IP Addresses This class represents all the IP addresses in your installation. Use the following methods to edit, create new and delete an existing IP addresses in your cloud. Get List of Network IP Addresses GET /settings/networks/:network_id/ip_addresses.xml GET /settings/networks/:network_id/ip_addresses.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <ip_addresses type="array"> <ip_address> <netmask>255.255.255.240</netmask> <disallowed_primary type="boolean">true</disallowed_primary> <address>83.170.81.179</address> <created_at type="datetime">2010-10-28T19:56:50+07:00</created_at> <updated_at type="datetime">2011-05-17T17:53:23+07:00</updated_at> <network_id type="integer">1</network_id> <network_address>83.170.81.176</network_address> <broadcast>83.170.81.191</broadcast> <id type="integer">2</id> <user_id nil="true"/> <gateway>83.170.81.177</gateway> <free type="boolean">false</free> </ip_address> ... <ip_address></ip_address> ... </ip_addresses> Where: ip_addresses – an array with all IP addresses in the selected network netmask — netmask for the IP address disallowed_primary – true if not allowed to be used as primary (for VS build), otherwise false address – IP address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at — the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format network_id –the ID of the network network_address – the address of the network broadcast – broadcast address id –the ID of the IP address user_id - the ID of the user this IP address is assigned to gateway – gateway address free – true if free, otherwise false OnApp Cloud 4.1 API Guide Add IP Address Record OnApp Cloud 4.1 API Guide POST /settings/networks/:network_id/ip_addresses.xml POST /settings/networks/:network_id/ip_addresses.json XML Request example *curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<ip_address><address>109.123.105.192</address><netmask>255.255.255.240</netmask><bro a dcast>109.123.105.191</broadcast><disallowed_primary>true</disallowed_primary><networ k _address>109.123.105.176</network_address><gateway>109.123.105.177</gateway></ip_addr e ss>' --url http://onapp.test/settings/networks/:network_id/ip_addresses.xml* JSON Request example *curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"ip_address":{"address":"109.123.105.192","netmask":"255.255.255.240","broadcast":" 1 09.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gate w ay":"109.123.105.177"}}' --url http://onapp.test/settings/networks/:network_id/ip_addresses.json* Parameters: address* - IP address netmask* - network mask broadcast* - a logical address at which all devices connected to a multiple-access communications network are enabled to receive datagrams. network_address* - IP address of the network gateway* - gateway address disallowed_primary – set true not to use this address as primary (for VS build), otherwise set false XML Output example <?xml version="1.0" encoding="UTF-8"?> <ip-addresses type="array"> <ip_address> <address>109.123.105.192</address> <netmask>255.255.255.240</netmask> <created_at type="datetime">2010-04-27T16:58:01Z</created_at> <broadcast>109.123.105.191</broadcast> <network_address>109.123.105.176</network_address> <network-id type="integer">1</network_id> <updated_at type="datetime">2010-04-27T16:58:01Z</updated_at> <id type="integer">1</id> <gateway>109.123.105.177</gateway> </ip_address></ip_addresses> Edit IP Address PUT /settings/networks/:network_id/ip_addresses/:id.xml PUT OnApp Cloud 4.1 API Guide /settings/networks/:network_id/ip_addresses/:id.json XML Request example OnApp Cloud 4.1 API Guide *curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<ip_address><address>109.123.105.192</address><netmask>255.255.255.240</netmask><bro a dcast>109.123.105.191</broadcast><network_address>109.123.105.176</network_address><d i sallowed_primary>true</disallowed_primary><gateway>109.123.105.177</gateway></ip_addr e ss>' --url http://onapp.test/settings/networks/:network_id/ip_addresses/:id.xml* JSON Request example *curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"ip_address":{"address":"109.123.105.186","netmask":"255.255.255.240","broadcast":" 1 09.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gate w ay":"109.123.105.177"}}' --url http://onapp.test/settings/networks/:network_id/ip_addresses/:id.json* The following parameters can be passed to be changed: address, netmask, broadcast, network_address, gateway,disallowed_primary option (all strings). You will get a 204 status response on success, and 404 if there is no such IP address with a requested ID or you entered incorrect URL. You can get the list of IPs assigned to a VS with GET /virtual_machines/:id request. Delete IP address DELETE /settings/networks/:network_id/ip_addresses/:id.xml DELETE /settings/networks/:network_id/ip_addresses/:id.json XML Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/networks/:network_id/ip_addresses/:id.xm l JSON Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/networks/:network_id/ip_addresses/:id.jso n You will get a 204 status response on success, and 404 if there is no such IP address with a requested ID or you entered incorrect URL. PLEASE NOTE: You can't delete an IP address that is in use. Assign IP Address to User To assign an IP Address or several IP addresses to a particular user, so that they could create a VS based on it, use the following request: POST /users/:user_id/assign_ip_addresses.xml POST /users/:user_id/assign_ip_addresses.json OnApp Cloud 4.1 API Guide XML Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/users/:user_id/assign_ip_addresses.xml -d '<ip_addresses type="array"><id>79</id><id>80</id></ip_addresses>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/users/:user_id/assign_ip_addresses.json -d '{"ip_address":["79", "80"]}' Where: ip_addresses - send the IDs of required IP addresses Unassign IP Address from User To unassign IP addresses from any user, use the following request: POST POST /ip_addresses/unassign.xml /ip_addresses/unassign.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/ip_addresses/unassign.xml -d '<ip_addresses type="array"><id>79</id><id>80</id></ip_addresses>' JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/ip_addresses/unassign.json -d '{"ip_address":["79", "80"]}' IP Address Joins An IP address allocated to a VS is an IP address join. Use the following methods to view, assign and delete an existing IP address joins in your cloud. Get List of IP Address Joins To get the list of IP address assignments for a particular VS: GET /virtual_machines/:virtual_machine_id/ip_addresses.xml GET /virtual_machines/:virtual_machine_id/ip_addresses.json An array of IP addresses is returned: OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <ip_address_joins type="array"> <ip_address_join> <ip_address_id type="integer">5</ip_address_id> <created_at type="datetime">2011-07-19T12:29:10Z</created_at> <updated_at type="datetime">2011-07-19T12:29:10Z</updated_at> <ip_address> <netmask>255.255.255.240</netmask> <disallowed_primary type="boolean">false</disallowed_primary> <address>109.123.105.182</address> <created_at type="datetime">2011-07-14T15:43:09Z</created_at> <updated_at type="datetime">2011-07-14T15:43:09Z</updated_at> <network_id type="integer">1</network_id> <network_address>109.123.105.176</network_address> <broadcast>109.123.105.191</broadcast> <id type="integer">5</id> <free type="boolean">false</free> <gateway>109.123.105.177</gateway> </ip_address> <id type="integer">46</id> <network_interface_id type="integer">34</network_interface_id> </ip_address_join> </ip_address_joins> Where: ip_address_joins – an array of all IP addresses, assigned to VS ip_address _id – ID of IP address created_at - the timestamp in DB when this record was created updated_at - the timestamp in DB when this record was updated ip_address – an array of IP address, assigned to the VS (for details see the Get List of Network IP Addresses section) id – ID of the IP address join network_interface_id - the ID of the network interface to which this IP address should be assigned Assign IP Address Join to VS Use the following class to assign an IP Address to a virtual server: POST /virtual_machines/:virtual_machine_id/ip_addresses.xml POST /virtual_machines/:virtual_machine_id/ip_addresses.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<ip_address_join><ip_address_id>13</ip_address_id><network_interface_id>84</network_ i nterface_id></ip_address_join>' --url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses.xml JSON Request example OnApp Cloud 4.1 API Guide curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"ip_address_join":{"ip_address_id":"13","network_interface_id":"84"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses.json Where: ip_address_id* - enter the ID of the IP you wish to attach to this VS network_interface_id* - specify the ID of network interface this IP address should be assigned to Delete IP Address Join To delete an IP address assignment from a particular VS, you have to remove the IP and rebuild the network. There are two API calls for IP deletion: one unassigns an address, but actually leaves it on a VS, and the second removes the address, rebuilds the network and thus reboots a VS. To delete an IP address without rebuilding a network: DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xml DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.json XML Request example curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.xm l JSON Request example curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.jso n To delete an IP address and rebuild a network: DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_network=1 DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.json?rebuild_network=1 XML Request example curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_n e twork=1 JSON Request example curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.json?rebuild_ n etwork=1 You will get a 204 status response on success, and 404 if there is no such IP address join with a requested ID or you entered incorrect URL. IP Address Pools OnApp Cloud 4.1 API Guide IP Address Pools are network configurations associated with customer VLANs. When configuring an IP Address Pool, you set a range of IPv4 or OnApp Cloud 4.1 API Guide IPv6 addresses and specify the network address of a VLAN that this pool will be available to. Get List of IP Address Pools To get the list of IP address pools: GET /settings/ip_address_pools.xml GET /settings/ip_address_pools.json XML Request example curl -i -u user:userpass http://onapp.test/settings/ip_address_pools.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:userpass http://onapp.test/settings/ip_address_pools.json -H 'Accept: application/json' -H 'Content-type: application/json' XML Output example HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 X-Ua-Compatible: IE=Edge Etag: "ee2c8d9a194b9efab74bdb26af627af0" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 2025e5192d7f4cafe43cf5fd14372b28 X-Runtime: 0.374566 Content-Length: 428 Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20) Date: Fri, 07 Sep 2012 07:10:12 GMT Connection: Keep-Alive Set-Cookie:_session_id=5b6ba8c6bbbc91de33e1df212c0b21ee; path=/; HttpOnly <?xml version="1.0" encoding="UTF-8"?> <ip_address_pools type="array"> <ip_address_pool> <cidr type="integer">24</cidr> <created_at type="datetime">2012-09-06T09:15:22+00:00</created_at> <id type="integer">66</id> <ipv4 type="boolean">true</ipv4> <network_address>192.168.1.0</network_address> <updated_at type="datetime">2012-09-06T09:15:22+00:00</updated_at> </ip_address_pool> </ip_address_pools> Where: OnApp Cloud 4.1 API Guide ip_address_pools - an array of IP address pools with the following details: OnApp Cloud 4.1 API Guide cidr - IP address prefix size created_at — the date when the IP address pool was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - IP address pool ID ipv4 - IPv4 boolean indicator network address - the address of a VLAN network address that will be associated with this IP address pool updated_at — the date when the IP address pool was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format Get IP Address Pool Details To get details of a particular IP address pool, run: GET /settings/ip_address_pools/:id.xml GET /settings/ip_address_pools/:id.json XML Request example curl -i -u user:userpass http://onapp.test/settings/ip_address_pools/:id.xml H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request exampl curl -i -u user:userpass http://onapp.test/settings/ip_address_pools/:id.json H 'Accept: application/json' -H 'Content-type: application/json' XML Output example OnApp Cloud 4.1 API Guide HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 X-Ua-Compatible: IE=Edge Etag: "912d1e77bdba7d3db87055253999ff45" Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 677cdab073210a599840f9f2b3805e2d X-Runtime: 0.156851 Content-Length: 362 Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20) Date: Fri, 07 Sep 2012 07:22:48 GMT Connection: Keep-Alive Set-Cookie: _session_id=33c2d8b3945c4b05a645e66d43bb9d31; path=/; HttpOnly <?xml version="1.0" encoding="UTF-8"?> <ip_address_pool> <cidr type="integer">30</cidr> <created_at type="datetime">2012-09-07T07:18:18+00:00</created_at> <id type="integer">68</id> <ipv4 type="boolean">true</ipv4> <network_address>192.168.10.10</network_address> <updated_at type="datetime">2012-09-07T07:18:18+00:00</updated_at> </ip_address_pool> Where: ip_address_pools - an array of IP address pools with the following details: cidr - IP address prefix size created_at — the date when the IP address pool was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format id - IP address pool ID ipv4 - IPv4 boolean indicator network address - the address of a VLAN network address that will be associated with this IP address pool updated_at — the date when the IP address pool was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format Add New IP Address Pool To add new IP address pool: POST /settings/ip_address_pools/:id.xml POST /settings/ip_address_pools/:id.json XML Request example curl -i -u user:userpass -X POST http://onapp.test/settings/ip_address_pools.xml d'<ip_address_pool><cidr>30</cidr><network_address>192.168.100.10</network_address></ ip_address_pool>' -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example OnApp Cloud 4.1 API Guide curl -i -u user:userpass -X POST http://onapp.test/settings/ip_address_pools.json -d'{"ip_address_pool":{"cidr":"30","network_address":"192.168.10.10"}}' -H 'Accept: application/json' -H 'Content-type: application/json' OnApp Cloud 4.1 API Guide Where you have to specify the following parameters: cidr – IP address prefix size network_address – the address of a VLAN network address that will be associated with this IP address pool Delete IP Address Pool To delete an IP address pool, run: DELETE /settings/ip_address_pools/:id.xml DELETE /settings/ip_address_pools/:id.json XML Request example curl -i -u user:userpass http://onapp.test/settings/ip_address_pools/:id.xml -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' JSON Request example curl -i -u user:password http://onapp.test/settings/ip_address_pools/:id.json X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' Returns HTTP 204 response on successful deletion, or HTTP 404 when an IP address pool with the ID specified is not found, or the URL requested is incorrect. ISOs OnApp allows uploading your custom bootable ISOs for recovery purposes. These could be different images for Windows/Linux/FreeBSD or any additional software. You can boot virtual servers from your own ISOs or the ISOs that are uploaded and made publicly available by other users. Currently, there is a limitation of 1 GB for the ISOs uploaded from the file system. There are no space limitations for the ISOs uploaded form the URL (except for your disk space limitations). OnApp supports rebooting existing virtual and smart servers from ISO. To build a new server from an ISO, create a virtual server and then reboot this VS from the appropriate ISO. Get List of ISOs To view the list of ISOs, use the following request: GET /template_isos.xml GET /template_isos.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_isos type="array"> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> <image_template_iso>...</image_template_iso> </image_template_isos type> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO OnApp Cloud 4.1 API Guide The following output parameters do not currently apply to ISOs: allow_resize_without_reboot allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Get ISO Details To view the details of the particular ISO, use the following request: GET /template_isos/:iso_id.xml GET /template_isos/:iso_id.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos/:iso_id.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos/:iso_id.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO The following output parameters do not currently apply to ISOs: allow_resize_without_reboot OnApp Cloud 4.1 API Guide allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Get List of Public ISOs To view the list of public ISOs, use the following request: GET /template_isos/system.xml GET /template_isos/system.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos/system.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos/system.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_isos type="array"> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> <image_template_iso>...</image_template_iso> </image_template_isos type> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO OnApp Cloud 4.1 API Guide The following output parameters do not currently apply to ISOs: allow_resize_without_reboot allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Get List of ISOs of Particular User To view the list of ISOs that a particular user uploaded, apply the following request: GET /template_isos/user/:user_id.xml GET /template_isos/user/:user_id.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos/user/:user_id.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos/user/:user_id.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_isos type="array"> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> <image_template_iso>...</image_template_iso> </image_template_isos type> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO OnApp Cloud 4.1 API Guide The following output parameters do not currently apply to ISOs: allow_resize_without_reboot allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Get List of User ISOs To view the list of user ISOs, apply the following request: GET /template_isos/user.xml GET /template_isos/user.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos/user.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos/user.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_isos type="array"> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> <image_template_iso>...</image_template_iso> </image_template_isos type> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO OnApp Cloud 4.1 API Guide The following output parameters do not currently apply to ISOs: allow_resize_without_reboot allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Get List of Own ISOs To view the list of own ISOs, use the following request: GET /template_isos/own.xml GET /template_isos/own.json XML Request example curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos/own.xml' JSON Request example curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Contenttype: application/json' --url http://onapp.test/template_isos/own.json' XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <image_template_isos type="array"> <image_template_iso> <allow_resize_without_reboot nil="true"/> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id nil="true"/> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum nil="true"/> <created_at type="datetime">2015-03-17T10:23:17+00:00</created_at> <disk_target_device nil="true"/> <ext4 type="boolean">false</ext4> <file_name>Fedora-20-x86_64-netinst.iso</file_name> <id type="integer">135</id> <initial_password nil="true"/> <initial_username nil="true"/> <label>Fedora-20-x86_64-netinst</label> <min_disk_size nil="true"/> <min_memory_size type="integer">512</min_memory_size> <operating_system>Linux</operating_system> <operating_system_arch nil="true"/> <operating_system_distro>redhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">1364</template_size> <updated_at type="datetime">2015-03-23T12:12:56+00:00</updated_at> <user_id nil="true"/> <version>1.0</version> <virtualization type="array"> <virtualization>xen</virtualization> <virtualization>kvm</virtualization> <virtualization>kvm_virtio</virtualization> </virtualization> </image_template_iso> <image_template_iso>...</image_template_iso> </image_template_isos type> Where: label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_system_distro - operating system distribution id - ID of the ISO template_size - size of the ISO virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO OnApp Cloud 4.1 API Guide The following output parameters do not currently apply to ISOs: OnApp Cloud 4.1 API Guide allow_resize_without_reboot allowed_hot_migrate allowed_swap backup_server_id baremetal_server cdn checksum created_at disk_target_device ext4 file_name initial_password initial_username min_disk_size operating_system_arch operating_system_edition operating_system_tail parent_template_id remote_id smart_server state updated_at user_id Update ISO Use the following API call to update an ISO: PUT /template_isos/:id.xml PUT /template_isos/:id.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass -d '<image_template_iso><label>zaza_loc12</label><min_disk_size>10</min_disk_size><versi o n>1.3</version><operating_system>Linux</operating_system><operating_system_distro>red h el</operating_system_distro><virtualization>xen</virtualization></image_template_iso> ' JSON --url Requesthttp://onapp.test/template_isos/:id.xml example OnApp Cloud 4.1 API Guide curl -i -X PUT -H 'Accept: application/json' -H 'Content-type:application/json' u user:userpass -d '{"image_template_iso":{"label":"zaza_loc12","version":"1.3","min_disk_size": "10","operating_system": "Linux", "operating_system_distro": "Fedore", "virtualization": ["xen", "kvm"]}}' --url http://onapp.test/template_isos/:id.json OnApp Cloud 4.1 API Guide Where: label – the ISO title min_memory_size – minimum memory size required to build a VS on this ISO (MB) version – file version operating_system - operating system name operating_system_distro - type in the operating system distribution in free form virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO Add New ISO To add a new ISO, use the following request: POST /template_isos.xml POST /template_isos.json XML Request example curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Contenttype: application/xml' --url http://onapp.test/template_isos.xml -d '<image_template_iso><make_public>1</make_public><label>test 1</label> <min_memory_size>320</min_memory_size><version>1.0</version><operating_system>Linux</ o perating_system> <operating_system_distro>Fedore</operating_system_distro><virtualization><virtualizat i on>xen</virtualization><virtualization>kvm</virtualization></virtualization><file_url > "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/iso/Fed ra-Server-netinst-x86_64-21.iso</file_url></image_template_iso>' JSON o Request example curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url http://onapp.test/template_isos.json -d '{"image_template_iso": {"make_public": "1", "label": "test 1", "min_memory_size": "320", "version": "1.0", "operating_system": "Linux", "operating_system_distro": "Fedore", "virtualization": ["xen", "kvm"], "file_url": "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/iso/Fed o ra-Server-netinst-x86_64-21.iso"}}' Where: make_public - whether the ISO will be available to all users label - the ISO title min_memory_size - minimum memory size required to build a VS on this ISO (MB) version - version of the file operating_system - operating system name operating_systen_distro - type in the operating system distribution in free form virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO file_url - the URL from which the ISO file is to uploaded Make ISO Public OnApp Cloud 4.1 API Guide Use the following API call to make an ISO public: OnApp Cloud 4.1 API Guide POST /template_isos/:id/make_public.xml POST /template_isos/:id/make_public.json XML Request example curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass --url http://onapp.test/template_isos/:id/make_public.xml JSON Request example curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass --url http://onapp.test/template_isos/:id/make_public.json If an ISO is queued to be moved to a public list successfully, an HTTP 201 response is returned. Only User ISOs can be made public. Delete ISO To delete an ISO from the system: DELETE /template_isos/:id.xml DELETE /template_isos/:id.json XML Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/template_isos/:id.xml -H'Content-type: application/xml' -H'Accept: application/xml' JSON Request example curl -i -X DELETE -u user:userpass --url http://onapp.test/template_isos/:id.json -H'Content-type: application/json' -H'Accept: application/json' The system won't delete the ISO if it is used by any VSs. License How to show the details of the OnApp license key edit license details. Get License Details To see the license details, use the following request: GET /settings/license.xml GET /settings/license.json Output example OnApp Cloud 4.1 API Guide application_state> <license_type>PAID</license_type> <core_limit type="integer">-1</core_limit> <valid_license type="boolean">true</valid_license> </application_state> Where: license_type – type of the license core_limit – number of CPU cores allowed by license; "-1" stands for unlimited number of cores valid_license – true, if valid Edit License Details To update license, use the following call: PUT /settings.xml PUT /settings.json XML Request example curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' u user:userpass -d '<configuration><license_key>NNNNN-NNNNN-NNNNN-NNNNN-NNNNNNNNNN</license_key></config uration>' --url http://onapp.test/settings.xml JSON Request example curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' u user:userpass -d '{"configuration":{"license_key":"NNNNN-NNNNN-NNNNN-NNNNN-NNNNN-NNNNN"}}' -url http://onapp.test/settings.json Where: license_key – the key of your OnApp license Load Balancers Load Balancers, both autoscaling clusters and load balancer clusters, can only be created on the basis of Virtual Servers, and are not available for Smart Servers, Baremetal Servers, or VMware Virtual Servers. Load balancers distribute requests evenly between clustered virtual servers (nodes), so that no virtual server is overloaded. Together with nodes, load balancers form Load Balancing Clusters. There are two options of load balancing clusters: Cluster type In this case you specify which VSs (nodes) will participate in a load balancing cluster. You can add and remove clustered VSs as required. Autoscaling type In this case you indicate minimum and maximum number of nodes for a cluster, as well as autoscaling parameters for automatic adding or removing nodes from the cluster. The system creates required number of identical nodes, with the same resource allocation and the same template for each node. Load balancing clusters of both types use the same requests. Only some parameters differ. Get List of Load Balancers OnApp Cloud 4.1 API Guide To get the list of available load balancers, use the following request: OnApp Cloud 4.1 API Guide GET /load_balancers.xml GET /load_balancers.json XML Output example <?xml version="1.0" encoding="UTF-8"?> <load_balancers type="array"> <load_balancer> <add_to_marketplace nil="true"/> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">true</booted> <built type="boolean">true</built> <cpu_shares type="integer">10</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2013-08-01T18:13:37+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>zaza</hostname> <hypervisor_id type="integer">3</hypervisor_id> <id type="integer">1654</id> <identifier>pop7ba0j4imc7e</identifier> <initial_root_password>Mvhn1gUjXpdS</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_B</label> <local_remote_access_ip_address>109.123.91.38</local_remote_access_ip_address> <local_remote_access_port type="integer">5904</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>lbva</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode nil="true"/> <remote_access_password>Y7wuNG1EpkZO</remote_access_password> <service_password nil="true"/> <state>new</state> <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">10</template_id> <template_label>Load Balancer Virtual Appliance</template_label> <updated_at type="datetime">2013-08-01T18:43:01+03:00</updated_at> <user_id type="integer">337</user_id> <vip nil="true"/> <xen_id type="integer">215</xen_id> <ip_addresses type="array"> <ip_address> <address>109.123.91.131</address> <broadcast>109.123.91.191</broadcast> OnApp Cloud 4.1 API Guide <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> OnApp Cloud 4.1 API Guide <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">2</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:38+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address><ip_address> <address>109.123.91.139</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">10</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:39+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used type="decimal">36945.0</monthly_bandwidth_used> <total_disk_size type="integer">6</total_disk_size> <price_per_hour type="decimal">5250.0</price_per_hour> OnApp Cloud 4.1 API Guide <price_per_hour_powered_off type="decimal">2625.0</price_per_hour_powered_off> </load_balancer> </load_balancers> Parameters description: load balancer - an array of load balancer details add_to_marketplace – this parameter is not applicable to load balancers admin_note – an optional text note allow_resize_without_reboot – true if you can resize a VS's CPU and RAM without rebooting it allowed_hot_migrate – true if hot migration is allowed allowed_swap – true if swap disks are allowed, otherwise false booted - true if the server is booted, otherwise false built – true if the load balancing cluster is built, otherwise false cpu_shares – the CPU priority of this load balancing cluster cpus – the number of CPU cores allocated to this load balancer created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - this parameter is not applicable to load balancers deleted_at the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format edge_server_type - this parameter is not applicable to load balancers enable_autoscale – true if autoscaling is enabled, otherwise false firewall_notrack - true if the NOTRACK rule is set in iptables hostname – the load balancer host name hypervisor_id – IDs of the compute resources used by this load balancing cluster id – the load balancing cluster ID identifier – identifier of the load balancer in the database initial_root_password — the LB root password initial_root_password_encrypted - true, if the root password is encrypted, otherwise false label – the load balancer name local_remote_access_ip_address - IP address used for remote access local_remote_access_port – the port ID used for used for console access locked – true if locked, otherwise false memory – the amount of RAM allocated to this load balancing cluster min_disk_size – the minimum disk size in GB required for a specified template note – an optional text, added as a note operating_system - the OS on which the load balancing cluster is based operating_system_distro – the distribution of the OS preferred_hvs - the array of preferable compute resources based on compute zone that meet some load balancer configuration settings recovery_mode – true if recovery mode is allowed, otherwise false remote_access_password – the password for remote access OnApp Cloud 4.1 API Guide service_password – this parameter is not applicable to load balancers OnApp Cloud 4.1 API Guide state – deprecated attribute storage_server_type – this parameter is not applicable to load balancers strict_virtual_machine_id – the ID of a VS that will never reside in this load balancing cluster suspended – true if suspended, otherwise false template_id – ID of the LB template template_label - the name of the template on which this load balancing cluster is based updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user who owns this load balancing cluster vip – true if the VIP status is set, otherwise false xen_id - the VS ID set by the virtualization engine ip_addresses - an array of IP addresses assigned to this load balancer and their details: address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - the ID of the customer VLAN the IP address belongs to disallowed_primary – true if not allowed to be used as primary, otherwise false gateway – gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with network_address – the address of the network network_id –the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource monthly_bandwidth_used - LB monthly bandwidth total_disk_size - total LB disk size price_per_hour - price per hour set for this load balancer price_per_hour_powered_off - price per hour set for this load balancer in the powered off state Get Load Balancer Details To get the list of load balancing clusters, use the following request: GET /load_balancing_clusters/:load_balancing_cluster_id.xml GET /load_balancing_clusters/:load_balancing_cluster_id.json Load balancing cluster array includes details on load balancers and attached nodes. XML Output example OnApp Cloud 4.1 API Guide <?xml version="1.0" encoding="UTF-8"?> <load_balancing_cluster> <cluster_type>autoscaleout</cluster_type> <config> <max_node_amount type="integer">4</max_node_amount> <min_node_amount type="integer">2</min_node_amount> </config> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <id type="integer">26</id> <identifier>b5886a2f0c7b811992b72b82cadee501c7f49c31</identifier> <image_template_id type="integer">1</image_template_id> <load_balancer_id type="integer">1669</load_balancer_id> <load_balancer_password>gPo96LEBwjWI</load_balancer_password> <name>az_AS</name> <node_attributes> <cpus>2</cpus> OnApp Cloud 4.1 API Guide <cpu_shares>2</cpu_shares> <memory>256</memory> <rate_limit>50</rate_limit> </node_attributes> <updated_at type="datetime">2013-08-05T12:27:21+03:00</updated_at> <user_id type="integer">337</user_id> <nodes type="array"> <load_balancing_cluster_node> <cluster_id type="integer">26</cluster_id> <created_at type="datetime">2013-08-05T10:58:44+03:00</created_at> <id type="integer">31</id> <ip_address_id type="integer">10</ip_address_id> <updated_at type="datetime">2013-08-05T10:58:44+03:00</updated_at> <virtual_machine_id type="integer">1670</virtual_machine_id> </load_balancing_cluster_node> </nodes> <ports type="array"> <port type="integer">80</port> <port type="integer">345</port> <port type="integer">678</port> </ports> <load_balancer> <add_to_marketplace nil="true"/> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">true</booted> <built type="boolean">true</built> <cpu_shares type="integer">10</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2013-08-01T18:13:37+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>zaza</hostname> <hypervisor_id type="integer">3</hypervisor_id> <id type="integer">1654</id> <identifier>pop7ba0j4imc7e</identifier> <initial_root_password>Mvhn1gUjXpdS</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_B</label> <local_remote_access_ip_address>109.123.91.38</local_remote_access_ip_address> <local_remote_access_port type="integer">5904</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>lbva</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode nil="true"/> <remote_access_password>Y7wuNG1EpkZO</remote_access_password> OnApp Cloud 4.1 API Guide <service_password nil="true"/> <state>new</state> OnApp Cloud 4.1 API Guide <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">10</template_id> <template_label>Load Balancer Virtual Appliance</template_label> <updated_at type="datetime">2013-08-01T18:43:01+03:00</updated_at> <user_id type="integer">337</user_id> <vip nil="true"/> <xen_id type="integer">215</xen_id> <ip_addresses type="array"> <ip_address> <address>109.123.91.131</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">2</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:38+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address><ip_address> <address>109.123.91.139</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">10</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:39+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used type="decimal">36945.0</monthly_bandwidth_used> <total_disk_size type="integer">6</total_disk_size> <price_per_hour type="decimal">5250.0</price_per_hour> <price_per_hour_powered_off type="decimal">2625.0</price_per_hour_powered_off> <cpu_priority type="integer">1</cpu_priority> </load_balancer> <auto_scaling_out_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">58</id> OnApp Cloud 4.1 API Guide <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> OnApp Cloud 4.1 API Guide <value type="float">101.0</value> </auto_scaling_out_memory> <auto_scaling_out_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">57</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">81.0</value> </auto_scaling_out_cpu> <auto_scaling_in_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">59</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">61.0</value> </auto_scaling_in_cpu> <auto_scaling_in_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">60</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">201.0</value> OnApp Cloud 4.1 API Guide </auto_scaling_in_memory> </load_balancing_cluster> Description: cluster_type – the type of the cluster (either cluster or autoscaleout) config – configuration array, where: max_node_amount – maximum number of nodes (for autoscaling types; remains empty for cluster types) min_node_amount – minimum number of nodes (for autoscaling types; remains empty for cluster types) created_at - the date when the cluster was created id – ID of the cluster identifier – the LB identifier in the DB image_template_id – the ID of a template on which the nodes of this load balancer are based (empty for cluster type) load_balancer_id - the ID of a load balancer added to this cluster load_balancer_password – root password, which is generated automatically name - load balancing cluster name node_attributes – an array of node attributes for autoscaling type, including cpu_shares, memory (RAM), rate_limit (port speed) and cpus (remain s empty for cluster type) cpus – the number of CPU cores allocated to this load balancer cpu_shares – the CPU priority of this load balancing cluster memory – the amount of RAM allocated to this load balancing cluster rate_limit - the port speed, set for the LB updated_at – the date when the cluster was updated user_id –ID of the load balancing cluster owner nodes - an array of load balancing cluster nodes with VS details: created_at – the date when the cluster node was created cluster_id - the ID of load balancing cluster to which this node belongs ip_address_id – the ID of VS IP address added to a cluster id – node ID updated_at – the date when the cluster node was updated virtual_machine_id – the ID of VS added to a cluster ports – the array of ports on which this cluster runs port – the cluster port load_balancer - an array of load balancer details: add_to_marketplace – this parameter is not applicable to load balancers admin_note – an optional text note allow_resize_without_reboot – true if you can resize a VS's CPU and RAM without rebooting it allowed_hot_migrate – true if hot migration is allowed allowed_swap – true if swap disks are allowed, otherwise false booted - true if the server is booted, otherwise false built – true if the load balancing cluster is built, otherwise false cpu_shares – the CPU priority of this load balancing cluster cpus – the number of CPU cores allocated to this load balancer created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - this parameter is not applicable to load balancers deleted_at the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format edge_server_type -this parameter is not applicable to load balancers enable_autoscale – true if autoscaling is enabled, otherwise false firewall_notrack - true if the NOTRACK rule is set in iptables hostname – the load balancer host name hypervisor_id – IDs of the compute resources used by this load balancing cluster id – the load balancing cluster ID OnApp Cloud 4.1 API Guide identifier – identifier of the load balancer in the database initial_root_password — the LB root password OnApp Cloud 4.1 API Guide initial_root_password_encrypted - true, if the root password is encrypted, otherwise false label – the load balancer name local_remote_access_ip_address - IP address used for remote access local_remote_access_port – the port ID used for used for console access locked – true if locked, otherwise false memory – the amount of RAM allocated to this load balancing cluster min_disk_size – the minimum disk size in GB required for a specified template note – an optional text, added as a note operating_system - the OS on which the load balancing cluster is based operating_system_distro – the distribution of the OS preferred_hvs - the array of preferable compute resources based on compute zone that meet some load balancer configuration settings recovery_mode – true if recovery mode is allowed, otherwise false remote_access_password – the password for remote access service_password – this parameter is not applicable to load balancers state – deprecated attribute storage_server_type – this parameter is not applicable to load balancers strict_virtual_machine_id – the ID of a VS that will never reside in this load balancing cluster suspended – true if suspended, otherwise false template_id – ID of the LB template template_label - the name of the template on which this load balancing cluster is based updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user who owns this load balancing cluster vip – true if the VIP status is set, otherwise false xen_id - the VS ID set by the virtualization engine ip_addresses - an array of IP addresses assigned to this load balancer and their details: address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - the ID of the customer VLAN the IP address belongs to disallowed_primary – true if not allowed to be used as primary, otherwise false gateway – gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with network_address – the address of the network network_id –the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource monthly_bandwidth_used - LB monthly bandwidth total_disk_size - total LB disk size price_per_hour - price per hour set for this load balancer price_per_hour_powered_off - price per hour set for this load balancer in the powered off state cpu_priority - this is a new parameter reserved for future use; currently it has the same value as cpu_shares parameter auto_scaling_out_cpu - an array of CPU autoscale out settings defining when the system should add more nodes to this autoscaling cluster: created_at - time when the CPU autoscale out settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be added when the value limit is reached updated_at - time when the CPU autoscale out settings were updated value - if the CPU usage is above percentage. An amount of nodes specified in units parameter will be added until the limit specified is reached. auto_scaling_in_cpu - an array of CPU autoscale in settings: created_at - time when the CPU autoscale in settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the CPU autoscale in settings were updated value - if the CPU usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. auto_scaling_in_memory - an array of memory autoscale in settings: created_at - time when the memory autoscale in settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID OnApp Cloud 4.1 API Guide units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the memory autoscale in settings were updated OnApp Cloud 4.1 API Guide value - if the memory usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. Get the List of Load Balancing Clusters To get the list of load balancing clusters, use the following request: GET /load_balancing_clusters.xml GET /load_balancing_clusters.json Load balancing cluster array includes details on load balancers and attached nodes. XML Output example <?xml version="1.0" encoding="UTF-8"?> <load_balancing_clusters type="array"> <load_balancing_cluster> <cluster_type>autoscaleout</cluster_type> <config> <max_node_amount type="integer">4</max_node_amount> <min_node_amount type="integer">2</min_node_amount> </config> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <id type="integer">26</id> <identifier>b5886a2f0c7b811992b72b82cadee501c7f49c31</identifier> <image_template_id type="integer">1</image_template_id> <load_balancer_id type="integer">1669</load_balancer_id> <load_balancer_password>gPo96LEBwjWI</load_balancer_password> <name>az_AS</name> <node_attributes> <cpus>2</cpus> <cpu_shares>2</cpu_shares> <memory>256</memory> <rate_limit>50</rate_limit> </node_attributes> <updated_at type="datetime">2013-08-05T12:27:21+03:00</updated_at> <user_id type="integer">337</user_id> <nodes type="array"> <load_balancing_cluster_node> <cluster_id type="integer">26</cluster_id> <created_at type="datetime">2013-08-05T10:58:44+03:00</created_at> <id type="integer">31</id> <ip_address_id type="integer">10</ip_address_id> <updated_at type="datetime">2013-08-05T10:58:44+03:00</updated_at> <virtual_machine_id type="integer">1670</virtual_machine_id> </load_balancing_cluster_node> </nodes> <ports type="array"> <port type="integer">80</port> <port type="integer">345</port> <port type="integer">678</port> </ports> <load_balancer> <add_to_marketplace nil="true"/> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> OnApp Cloud 4.1 API Guide <booted type="boolean">true</booted> <built type="boolean">true</built> OnApp Cloud 4.1 API Guide <cpu_shares type="integer">10</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2013-08-01T18:13:37+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>zaza</hostname> <hypervisor_id type="integer">3</hypervisor_id> <id type="integer">1654</id> <identifier>pop7ba0j4imc7e</identifier> <initial_root_password>Mvhn1gUjXpdS</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_B</label> <local_remote_access_ip_address>109.123.91.38</local_remote_access_ip_address> <local_remote_access_port type="integer">5904</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>lbva</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode nil="true"/> <remote_access_password>Y7wuNG1EpkZO</remote_access_password> <service_password nil="true"/> <state>new</state> <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">10</template_id> <template_label>Load Balancer Virtual Appliance</template_label> <updated_at type="datetime">2013-08-01T18:43:01+03:00</updated_at> <user_id type="integer">337</user_id> <vip nil="true"/> <xen_id type="integer">215</xen_id> <ip_addresses type="array"> <ip_address> <address>109.123.91.131</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">2</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:38+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> OnApp Cloud 4.1 API Guide </ip_address><ip_address> <address>109.123.91.139</address> OnApp Cloud 4.1 API Guide <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">10</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:39+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used type="decimal">36945.0</monthly_bandwidth_used> <total_disk_size type="integer">6</total_disk_size> <price_per_hour type="decimal">5250.0</price_per_hour> <price_per_hour_powered_off type="decimal">2625.0</price_per_hour_powered_off> <cpu_priority type="integer">1</cpu_priority> </load_balancer> <auto_scaling_out_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">58</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">101.0</value> </auto_scaling_out_memory> <auto_scaling_out_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">57</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">81.0</value> </auto_scaling_out_cpu> <auto_scaling_in_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">59</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">61.0</value> </auto_scaling_in_cpu> <auto_scaling_in_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">60</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> OnApp Cloud 4.1 API Guide <value type="float">201.0</value> OnApp Cloud 4.1 API Guide </auto_scaling_in_memory> </load_balancing_cluster> </load_balancing_clusters> Description: load_balancing_clusters – an array of all load balancing clusters (may be both cluster and autoscaling types) cluster_type – the type of the cluster (either cluster or autoscaleout) config – configuration array, where: max_node_amount – maximum number of nodes (for autoscaling types; remains empty for cluster types) min_node_amount – minimum number of nodes (for autoscaling types; remains empty for cluster types) created_at - the date when the cluster was created id – ID of the cluster identifier – the LB identifier in the DB image_template_id – the ID of a template on which the nodes of this load balancer are based (empty for cluster type) load_balancer_id - the ID of a load balancer added to this cluster load_balancer_password – root password, which is generated automatically name - load balancing cluster name node_attributes – an array of node attributes for autoscaling type, including cpu_shares, memory (RAM), rate_limit (port speed) and cpus (remain s empty for cluster type) cpus – the number of CPU cores allocated to this load balancer cpu_shares – the CPU priority of this load balancing cluster memory – the amount of RAM allocated to this load balancing cluster rate_limit - the port speed, set for the LB updated_at – the date when the cluster was updated user_id –ID of the load balancing cluster owner nodes - an array of load balancing cluster nodes with VS details: created_at – the date when the cluster node was created cluster_id - the ID of load balancing cluster to which this node belongs ip_address_id – the ID of VS IP address added to a cluster id – node ID updated_at – the date when the cluster node was updated virtual_machine_id – the ID of VS added to a cluster ports – the array of ports on which this cluster runs port – the cluster port load_balancer - an array of load balancer details: add_to_marketplace – this parameter is not applicable to load balancers admin_note – an optional text note allow_resize_without_reboot – true if you can resize a VS's CPU and RAM without rebooting it allowed_hot_migrate – true if hot migration is allowed allowed_swap – true if swap disks are allowed, otherwise false booted - true if the server is booted, otherwise false built – true if the load balancing cluster is built, otherwise false cpu_shares – the CPU priority of this load balancing cluster cpus – the number of CPU cores allocated to this load balancer created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - this parameter is not applicable to load balancers deleted_at the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format edge_server_type -this parameter is not applicable to load balancers enable_autoscale – true if autoscaling is enabled, otherwise false firewall_notrack - true if the NOTRACK rule is set in iptables OnApp Cloud 4.1 API Guide hostname – the load balancer host name hypervisor_id – IDs of the compute resources used by this load balancing cluster OnApp Cloud 4.1 API Guide id – the load balancing cluster ID identifier – identifier of the load balancer in the database initial_root_password — the LB root password initial_root_password_encrypted - true, if the root password is encrypted, otherwise false label – the load balancer name local_remote_access_ip_address - IP address used for remote access local_remote_access_port – the port ID used for used for console access locked – true if locked, otherwise false memory – the amount of RAM allocated to this load balancing cluster min_disk_size – the minimum disk size in GB required for a specified template note – an optional text, added as a note operating_system - the OS on which the load balancing cluster is based operating_system_distro – the distribution of the OS preferred_hvs - the array of preferable compute resources based on compute zone that meet some load balancer configuration settings recovery_mode – true if recovery mode is allowed, otherwise false remote_access_password – the password for remote access service_password – this parameter is not applicable to load balancers state – deprecated attribute storage_server_type – this parameter is not applicable to load balancers strict_virtual_machine_id – the ID of a VS that will never reside in this load balancing cluster suspended – true if suspended, otherwise false template_id – ID of the LB template template_label - the name of the template on which this load balancing cluster is based updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user who owns this load balancing cluster vip – true if the VIP status is set, otherwise false xen_id - the VS ID set by the virtualization engine ip_addresses - an array of IP addresses assigned to this load balancer and their details: address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - the ID of the customer VLAN the IP address belongs to disallowed_primary – true if not allowed to be used as primary, otherwise false gateway – gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with network_address – the address of the network network_id –the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource monthly_bandwidth_used - LB monthly bandwidth total_disk_size - total LB disk size price_per_hour - price per hour set for this load balancer price_per_hour_powered_off - price per hour set for this load balancer in the powered off state cpu_priority - this is a new parameter reserved for future use; currently it has the same value as cpu_shares parameter auto_scaling_out_cpu - an array of CPU autoscale out settings defining when the system should add more nodes to this autoscaling cluster: created_at - time when the CPU autoscale out settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be added when the value limit is reached updated_at - time when the CPU autoscale out settings were updated value - if the CPU usage is above percentage. An amount of nodes specified in units parameter will be added until the limit specified is reached. auto_scaling_in_cpu - an array of CPU autoscale in settings: created_at - time when the CPU autoscale in settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the CPU autoscale in settings were updated value - if the CPU usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. auto_scaling_in_memory - an array of memory autoscale in settings: created_at - time when the memory autoscale in settings were set OnApp Cloud 4.1 API Guide enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered OnApp Cloud 4.1 API Guide id - parameter ID units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the memory autoscale in settings were updated value - if the memory usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. Get Load Balancing Cluster Details To get details for a particular load balancing cluster, use the following request: GET /load_balancing_clusters/:id.xml GET /load_balancing_clusters/:id.json Load balancing cluster array includes details on load balancers and attached nodes. XML Output example <?xml version="1.0" encoding="UTF-8"?> <load_balancing_cluster> <cluster_type>autoscaleout</cluster_type> <config> <max_node_amount type="integer">4</max_node_amount> <min_node_amount type="integer">2</min_node_amount> </config> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <id type="integer">26</id> <identifier>b5886a2f0c7b811992b72b82cadee501c7f49c31</identifier> <image_template_id type="integer">1</image_template_id> <load_balancer_id type="integer">1669</load_balancer_id> <load_balancer_password>gPo96LEBwjWI</load_balancer_password> <name>az_AS</name> <node_attributes> <cpus>2</cpus> <cpu_shares>2</cpu_shares> <memory>256</memory> <rate_limit>50</rate_limit> </node_attributes> <updated_at type="datetime">2013-08-05T12:27:21+03:00</updated_at> <user_id type="integer">337</user_id> <nodes type="array"> <load_balancing_cluster_node> <cluster_id type="integer">26</cluster_id> <created_at type="datetime">2013-08-05T10:58:44+03:00</created_at> <id type="integer">31</id> <ip_address_id type="integer">10</ip_address_id> <updated_at type="datetime">2013-08-05T10:58:44+03:00</updated_at> <virtual_machine_id type="integer">1670</virtual_machine_id> </load_balancing_cluster_node> </nodes> <ports type="array"> <port type="integer">80</port> <port type="integer">345</port> <port type="integer">678</port> </ports> <load_balancer> <add_to_marketplace nil="true"/> <admin_note nil="true"/> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">true</allowed_hot_migrate> OnApp Cloud 4.1 API Guide <allowed_swap type="boolean">true</allowed_swap> OnApp Cloud 4.1 API Guide <booted type="boolean">true</booted> <built type="boolean">true</built> <cpu_shares type="integer">10</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2013-08-01T18:13:37+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale nil="true"/> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>zaza</hostname> <hypervisor_id type="integer">3</hypervisor_id> <id type="integer">1654</id> <identifier>pop7ba0j4imc7e</identifier> <initial_root_password>Mvhn1gUjXpdS</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>zaza_B</label> <local_remote_access_ip_address>109.123.91.38</local_remote_access_ip_address> <local_remote_access_port type="integer">5904</local_remote_access_port> <locked type="boolean">false</locked> <memory type="integer">512</memory> <min_disk_size type="integer">5</min_disk_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>lbva</operating_system_distro> <preferred_hvs type="array"/> <recovery_mode nil="true"/> <remote_access_password>Y7wuNG1EpkZO</remote_access_password> <service_password nil="true"/> <state>new</state> <storage_server_type nil="true"/> <strict_virtual_machine_id nil="true"/> <suspended type="boolean">false</suspended> <template_id type="integer">10</template_id> <template_label>Load Balancer Virtual Appliance</template_label> <updated_at type="datetime">2013-08-01T18:43:01+03:00</updated_at> <user_id type="integer">337</user_id> <vip nil="true"/> <xen_id type="integer">215</xen_id> <ip_addresses type="array"> <ip_address> <address>109.123.91.131</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">2</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:38+03:00</updated_at> <user_id nil="true"/> OnApp Cloud 4.1 API Guide <free type="boolean">false</free> <netmask>255.255.255.192</netmask> OnApp Cloud 4.1 API Guide </ip_address><ip_address> <address>109.123.91.139</address> <broadcast>109.123.91.191</broadcast> <created_at type="datetime">2013-06-10T15:11:02+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>109.123.91.129</gateway> <hypervisor_id nil="true"/> <id type="integer">10</id> <ip_address_pool_id nil="true"/> <network_address>109.123.91.128</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-08-01T18:13:39+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.192</netmask> </ip_address> </ip_addresses> <monthly_bandwidth_used type="decimal">36945.0</monthly_bandwidth_used> <total_disk_size type="integer">6</total_disk_size> <price_per_hour type="decimal">5250.0</price_per_hour> <price_per_hour_powered_off type="decimal">2625.0</price_per_hour_powered_off> <cpu_priority type="integer">10</cpu_priority> </load_balancer> <auto_scaling_out_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">58</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">101.0</value> </auto_scaling_out_memory> <auto_scaling_out_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">10</for_minutes> <id type="integer">57</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">81.0</value> </auto_scaling_out_cpu> <auto_scaling_in_cpu> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">59</id> <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> <value type="float">61.0</value> </auto_scaling_in_cpu> <auto_scaling_in_memory> <created_at type="datetime">2013-08-05T10:58:42+03:00</created_at> <enabled type="boolean">true</enabled> <for_minutes type="integer">30</for_minutes> <id type="integer">60</id> OnApp Cloud 4.1 API Guide <units type="integer">2</units> <updated_at type="datetime">2013-08-05T11:42:25+03:00</updated_at> OnApp Cloud 4.1 API Guide <value type="float">201.0</value> </auto_scaling_in_memory> </load_balancing_cluster> Description: cluster_type – the type of the cluster (either cluster or autoscaleout) config – configuration array, where: max_node_amount – maximum number of nodes (for autoscaling types; remains empty for cluster types) min_node_amount – minimum number of nodes (for autoscaling types; remains empty for cluster types) created_at - the date when the cluster was created id – ID of the cluster identifier – the LB identifier in the DB image_template_id – the ID of a template on which the nodes of this load balancer are based (empty for cluster type) load_balancer_id - the ID of a load balancer added to this cluster load_balancer_password – root password, which is generated automatically name - load balancing cluster name node_attributes – an array of node attributes for autoscaling type, including cpu_shares, memory (RAM), rate_limit (port speed) and cpus (remain s empty for cluster type) cpus – the number of CPU cores allocated to this load balancer cpu_shares – the CPU priority of this load balancing cluster memory – the amount of RAM allocated to this load balancing cluster rate_limit - the port speed, set for the LB updated_at – the date when the cluster was updated user_id –ID of the load balancing cluster owner nodes - an array of load balancing cluster nodes with VS details: created_at – the date when the cluster node was created cluster_id - the ID of load balancing cluster to which this node belongs ip_address_id – the ID of VS IP address added to a cluster id – node ID updated_at – the date when the cluster node was updated virtual_machine_id – the ID of VS added to a cluster ports – the array of ports on which this cluster runs port – the cluster port load_balancer - an array of load balancer details: add_to_marketplace – this parameter is not applicable to load balancers admin_note – an optional text note allow_resize_without_reboot – true if you can resize a VS's CPU and RAM without rebooting it allowed_hot_migrate – true if hot migration is allowed allowed_swap – true if swap disks are allowed, otherwise false booted - true if the server is booted, otherwise false built – true if the load balancing cluster is built, otherwise false cpu_shares – the CPU priority of this load balancing cluster cpus – the number of CPU cores allocated to this load balancer created_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - this parameter is not applicable to load balancers deleted_at the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format edge_server_type -this parameter is not applicable to load balancers enable_autoscale – true if autoscaling is enabled, otherwise false firewall_notrack - true if the NOTRACK rule is set in iptables hostname – the load balancer host name OnApp Cloud 4.1 API Guide hypervisor_id – IDs of the compute resources used by this load balancing cluster id – the load balancing cluster ID OnApp Cloud 4.1 API Guide identifier – identifier of the load balancer in the database initial_root_password — the LB root password initial_root_password_encrypted - true, if the root password is encrypted, otherwise false label – the load balancer name local_remote_access_ip_address - IP address used for remote access local_remote_access_port – the port ID used for used for console access locked – true if locked, otherwise false memory – the amount of RAM allocated to this load balancing cluster min_disk_size – the minimum disk size in GB required for a specified template note – an optional text, added as a note operating_system - the OS on which the load balancing cluster is based operating_system_distro – the distribution of the OS preferred_hvs - the array of preferable compute resources based on compute zone that meet some load balancer configuration settings recovery_mode – true if recovery mode is allowed, otherwise false remote_access_password – the password for remote access service_password – this parameter is not applicable to load balancers state – deprecated attribute storage_server_type – this parameter is not applicable to load balancers strict_virtual_machine_id – the ID of a VS that will never reside in this load balancing cluster suspended – true if suspended, otherwise false template_id – ID of the LB template template_label - the name of the template on which this load balancing cluster is based updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id – the ID of the user who owns this load balancing cluster vip – true if the VIP status is set, otherwise false xen_id - the VS ID set by the virtualization engine ip_addresses - an array of IP addresses assigned to this load balancer and their details: address – IP address broadcast – broadcast address created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format customer_network_id - the ID of the customer VLAN the IP address belongs to disallowed_primary – true if not allowed to be used as primary, otherwise false gateway – gateway address hypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP address ip_address_pool_id - ID of the IP address pool the IP address is associated with network_address – the address of the network network_id –the ID of the network pxe - true, if this address can be used for cloudbooting a compute resource monthly_bandwidth_used - LB monthly bandwidth total_disk_size - total LB disk size price_per_hour - price per hour set for this load balancer price_per_hour_powered_off - price per hour set for this load balancer in the powered off state cpu_priority - this is a new parameter reserved for future use; currently it has the same value as cpu_shares parameter auto_scaling_out_cpu - an array of CPU autoscale out settings defining when the system should add more nodes to this autoscaling cluster: created_at - time when the CPU autoscale out settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be added when the value limit is reached updated_at - time when the CPU autoscale out settings were updated value - if the CPU usage is above percentage. An amount of nodes specified in units parameter will be added until the limit specified is reached. auto_scaling_in_cpu - an array of CPU autoscale in settings: created_at - time when the CPU autoscale in settings were set enabled - true, if enabled, otherwise false for_minutes - the time threshold before scaling will be triggered id - parameter ID units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the CPU autoscale in settings were updated value - if the CPU usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. auto_scaling_in_memory - an array of memory autoscale in settings: created_at - time when the memory autoscale in settings were set enabled - true, if enabled, otherwise false OnApp Cloud 4.1 API Guide for_minutes - the time threshold before scaling will be triggered id - parameter ID OnApp Cloud 4.1 API Guide units - an amount of nodes that will be removed when the value limit is reached updated_at - time when the memory autoscale in settings were updated value - if the memory usage is less percentage. An amount of nodes specified in units parameter will be removed until the limit specified is reached. Get Load Balancer Billing Statistics You can view the billing statistics for a particular load balancer using the following request: GET /load_balancers/:load_balancer_id/vm_stats/:hourly_statistics_id.xml GET /load_balancers/:load_balancer_id/vm_stats/hourly_statistics_id.json Define a shorter period by setting Start and End time in the API call: GET /load_balancers/:load_balancer_id/vm_stats/hourly_statistics_id.xml?period[star t date]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:mm:ss&period[use_local_t ime]=1 XML Request example GET /load_balancers/:load_balancer_id/vm_stats/hourly_statistics_id.json?period[sta r tdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MMDD+hh:mm:ss&period[use_local_ time]=1 XML Output example <?xml version="1.0" encoding="UTF-8"?> <vm_stats> <created_at type="datetime">2013-05-02T06:00:27Z</created_at> <currency_code>USD</currency_code> <id type="integer">15490</id> <stat_time type="datetime">2013-05-02T06:00:00Z</stat_time> <updated_at type="datetime">2013-05-02T06:00:27Z</updated_at> <user_id type="integer">307</user_id> <virtual_machine_id type="integer">1214</virtual_machine_id> <vm_billing_stat_id type="integer">8089</vm_billing_stat_id> <billing_stats><disks type="array"> <disk> <id type="integer">2430</id> <costs type="array"> <cost> <value type="integer">100</value> <cost type="float">0.0</cost> <resource_name>disk_min_iops</resource_name> </cost> <cost> <value type="integer">5</value> <cost type="float">0.0</cost> <resource_name>disk_size</resource_name> </cost><cost><value type="integer">0</value> OnApp Cloud 4.1 API Guide <cost type="float">0.0</cost> <resource_name>data_read</resource_name> </cost> OnApp Cloud 4.1 API Guide <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>data_written</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>reads_completed</resource_name> </cost> <cost> <value type="integer">0</value> <cost type="float">0.0</cost> <resource_name>writes_completed</resource_name> </cost> </costs> <label nil="true"/> </disk><