OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

1447
0 Author: Admin Version: 3 Date: 2016.09.01 5.0 API Guide OnApp 5.0 API Guide

Transcript of OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

Page 1: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

0

Author: AdminVersion: 3Date: 2016.09.01

5.0 API GuideOnApp 5.0 API Guide

Page 2: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

TABLE OF CONTENTS

1 API Authentication................................44

2 HTTP Methods......................................45

3 HTTP response codes...............................46

4 Formatting and naming conventions.................47

5 FAQ...............................................48

6 OnApp 5.0.........................................49

7 Add Zabbix Server.................................51

8 Alerts............................................52

9 Application Servers...............................53

9.1 Create Application Server................................................................................................539.1.1 Page History.......................................................................................................................58

10 Apps for Application Servers......................59

10.1 Get List of All Installed Applications..............................................................................59

10.2 Get List of All Available for Installation Applications...................................................60

10.3 Get Application Attributes...............................................................................................61

10.4 Install Application.............................................................................................................61

10.5 Back Up Application.........................................................................................................62

BILLING PLANS - GET THE LIST OF BILLING PLANS 1

Page 3: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10.6 Delete Application.............................................................................................................63

10.7 Get List of All Application Backups................................................................................64

10.8 Restore Application Backup............................................................................................65

10.9 Remove Application Backup...........................................................................................65

10.10 System Applications.........................................................................................................6610.10.1 Get List of System Applications..........................................................................................6610.10.2 Install System Application...................................................................................................6710.10.3 Switch PHP Version............................................................................................................6710.10.4 Uninstall System Application..............................................................................................68

10.11 Domains.............................................................................................................................6910.11.1 Get List of Domains............................................................................................................6910.11.2 Create Domain....................................................................................................................6910.11.3 Delete Domain....................................................................................................................71

10.12 FTP Users..........................................................................................................................7210.12.1 Get List of FTP Users.........................................................................................................7210.12.2 Create FTP User.................................................................................................................7310.12.3 Delete FTP User.................................................................................................................73

10.13 Databases..........................................................................................................................7410.13.1 Get List of Databases.........................................................................................................7410.13.2 Create Database.................................................................................................................7510.13.3 Delete Database.................................................................................................................7510.13.4 Get List of Database Users.................................................................................................7610.13.5 Get List of Users Assigned to Database.............................................................................7710.13.6 Create Database User........................................................................................................7810.13.7 Assign User to Database....................................................................................................7810.13.8 Update Database User Privileges.......................................................................................7910.13.9 Change Database User Password.....................................................................................8010.13.10Unassign User from Database............................................................................................8110.13.11Delete Database User.........................................................................................................81

11 Assets............................................83

11.1 Get List of Assets.............................................................................................................83

11.2 Get Asset Details..............................................................................................................84

11.3 Get Lіst of Unassigned Assets........................................................................................85

12 Auto-Backups......................................90

BILLING PLANS - GET THE LIST OF BILLING PLANS 2

Page 4: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.1 Auto-backup Presets........................................................................................................9012.1.1 Get List of Auto-backup Presets.........................................................................................9012.1.2 Get Auto-backup Preset Details.........................................................................................9112.1.3 Edit Auto-backup Preset.....................................................................................................91

12.2 Manage Auto-Backups.....................................................................................................9212.2.1 Enable auto-backups for VS...............................................................................................9312.2.2 Disable auto-backups for VS..............................................................................................9312.2.3 Enable Auto-backups for Disk............................................................................................9312.2.4 Disable Auto-backups for Disk............................................................................................94

12.3 Schedules..........................................................................................................................9412.3.1 Get List of All Schedules.....................................................................................................9412.3.2 Get Schedule Details..........................................................................................................9612.3.3 Get List of Schedules for a Disk.........................................................................................9712.3.4 Get List of Virtual Server Schedules...................................................................................9912.3.5 Add Schedule to Disk........................................................................................................10212.3.6 Add Schedule to Virtual Server.........................................................................................10212.3.7 Edit Disk Schedule............................................................................................................10312.3.8 Edit Virtual Server Schedule.............................................................................................10412.3.9 Delete Disk Schedule........................................................................................................10512.3.10 Delete Virtual Server Schedule.........................................................................................105

13 Backups/ Snapshots...............................106

13.1 Get List of All VS Backups.............................................................................................106

13.2 Get List of Normal Backups...........................................................................................108

13.3 Get List of Incremental Backups...................................................................................110

13.4 Get List of Disk Backups...............................................................................................112

13.5 Create Incremental Backup...........................................................................................114

13.6 Create Disk Backup........................................................................................................114

13.7 Create Backups for All Disks.........................................................................................115

13.8 Convert Backup to Template.........................................................................................115

13.9 Delete Backup.................................................................................................................116

13.10 Restore Backup...............................................................................................................116

13.11 Add/Edit Backup Note....................................................................................................117

BILLING PLANS - GET THE LIST OF BILLING PLANS 3

Page 5: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

14 Backup Servers...................................118

14.1 Get List of Backup Servers............................................................................................118

14.2 Get Backup Server Details.............................................................................................119

14.3 Add Backup Server.........................................................................................................121

14.4 Edit Backup Server.........................................................................................................122

14.5 Delete Backup Server.....................................................................................................122

14.6 Search Backups..............................................................................................................123

14.7 Create Cloud Boot Backup Server................................................................................125

15 Backup Server Zones..............................127

15.1 Get List of Backup Server Zones..................................................................................12715.1.1 Page history......................................................................................................................127

15.2 Get Backup Server Zone Details...................................................................................12715.2.1 Page history......................................................................................................................128

15.3 Add Backup Server Zone...............................................................................................12815.3.1 Page history......................................................................................................................129

15.4 Edit Backup Server Zone...............................................................................................12915.4.1 Page history......................................................................................................................129

15.5 Delete Backup Server Zone...........................................................................................129

15.6 Get List of Servers Assigned to Backup Server Zone................................................130

15.7 Assign Backup Server to Backup Server Zone...........................................................131

15.8 Unassign Backup Server from Backup Server Zone...................................................132

16 Baremetal Servers................................133

16.1 Get List of Baremetal Servers.......................................................................................133

16.2 Get Baremetal Server Details........................................................................................135

16.3 Create Baremetal Server................................................................................................137

16.4 Delete Baremetal Server................................................................................................138

BILLING PLANS - GET THE LIST OF BILLING PLANS 4

Page 6: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

16.5 Add/Edit Admin/User Note for Baremetal Server........................................................139

16.6 Enable Recovery Mode for Baremetal Server..............................................................140

16.7 Disable Recovery Mode for Baremetal Server.............................................................140

17 Billing Plans....................................141

17.1 Get the List of Billing Plans...........................................................................................14317.1.1 Page history......................................................................................................................149

17.2 Get Billing Plan Details..................................................................................................15017.2.1 Page history......................................................................................................................156

17.3 Add Billing Plan..............................................................................................................157

17.4 Edit Billing Plan...............................................................................................................158

17.5 Get List of Base Resources...........................................................................................15917.5.1 Page history......................................................................................................................164

17.6 Get Base Resources Details..........................................................................................16517.6.1 Where:..............................................................................................................................16617.6.2 Page History.....................................................................................................................176

17.7 Get Master Template/Master Bucket Details................................................................17617.7.1 Where:..............................................................................................................................17717.7.2 Where:..............................................................................................................................18017.7.3 Where:..............................................................................................................................181

17.8 Add Base Resources to Billing Plan.............................................................................18217.8.1 Add User VS Limits...........................................................................................................18217.8.2 Add Limits for Template Store..........................................................................................18517.8.3 Add Limits for Recipe Groups...........................................................................................18617.8.4 Add Limits for Compute Zones.........................................................................................18817.8.5 Add Limits for Data Store Zones.......................................................................................19217.8.6 Add Limits for Network Zones...........................................................................................19717.8.7 Add Limits for Edge Groups..............................................................................................20117.8.8 Add Limits for Backup Server Zones................................................................................20317.8.9 Add Limits for minIOPS....................................................................................................20517.8.10 Add Limits for Instance Packages....................................................................................207

17.9 Edit Base Resources......................................................................................................209

17.10 Edit Limits & Pricing for Compute Zones.....................................................................213

17.11 Edit Limits & Pricing for Data Store Zones..................................................................217

BILLING PLANS - GET THE LIST OF BILLING PLANS 5

Page 7: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.12 Edit Limits & Pricing for Network Zones......................................................................220

17.13 Edit Limits & Pricing for Backup Server Zones...........................................................223

17.14 Delete Base Resource From Billing Plan.....................................................................226

17.15 Add Base Resource to Master Bucket..........................................................................227

17.16 Remove Base Resource from Master Bucket..............................................................229

17.17 Add Base Resource to Master Template......................................................................230

17.18 Remove Base Resource From Master Template.........................................................231

17.19 Delete Billing Plan...........................................................................................................233

18 Blueprints.......................................235

18.1 Get List of Blueprints.....................................................................................................235

18.2 Get Blueprint Details......................................................................................................236

18.3 Add Blueprint..................................................................................................................237

18.4 Delete Blueprint..............................................................................................................238

19 Blueprint Template Groups........................239

19.1 Get List of Blueprint Template Groups.........................................................................239

19.2 Get Blueprint Template Group Details..........................................................................241

19.3 Add Blueprint Template Group.....................................................................................241

19.4 Edit Blueprint Template Group......................................................................................242

19.5 Delete Blueprint Template Group..................................................................................244

19.6 Add Child Blueprint Template Group...........................................................................245

19.7 Get List of Blueprint Templates Attached to Blueprint Template Group..................245

19.8 Attach Blueprint Template to Group.............................................................................246

19.9 Remove Blueprint Template from Blueprint Temlate Group......................................247

BILLING PLANS - GET THE LIST OF BILLING PLANS 6

Page 8: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

20 Blueprint Templates..............................248

20.1 Get List of Blueprint Templates....................................................................................248

20.2 Get Blueprint Template Details.....................................................................................249

20.3 Add Blueprint Template.................................................................................................250

20.4 Edit Blueprint Template..................................................................................................251

20.5 Delete Blueprint Template.............................................................................................252

21 Catalogs.........................................254

21.1 Get List of Catalogs........................................................................................................254

21.2 Get Catalog Details.........................................................................................................255

21.3 Create Catalog.................................................................................................................256

21.4 Add vApp to Catalog......................................................................................................256

21.5 Delete Catalog.................................................................................................................257

21.6 Get List of vApp Templates...........................................................................................257

21.7 Get List of Media Files....................................................................................................258

21.8 Create vApp Template (Add to Catalog).......................................................................259

21.9 Delete vApp Template....................................................................................................260

22 CDN Accelerator..................................261

22.1 Get List of Accelerators.................................................................................................261

22.2 Get Accelerator Details..................................................................................................265

22.3 Add Accelerator..............................................................................................................269

22.4 Edit Accelerator..............................................................................................................270

22.5 Reboot Accelerator.........................................................................................................270

22.6 Start up Accelerator........................................................................................................271

22.7 Shut down Accelerator...................................................................................................271

BILLING PLANS - GET THE LIST OF BILLING PLANS 7

Page 9: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

22.8 Suspend Accelerator......................................................................................................272

22.9 Rebuild Accelerator........................................................................................................272

22.10 Migrate Accelerator........................................................................................................272

22.11 Delete Accelerator..........................................................................................................273

22.12 Unlock Accelerator.........................................................................................................273

22.13 Segregate Accelerator....................................................................................................274

22.14 Change Accelerator Owner............................................................................................274

22.15 Accelerator Network Interfaces.....................................................................................275

22.16 Accelerator IP Address Joins........................................................................................276

22.17 View Accelerator Disks..................................................................................................279

22.18 Rebuild Network for Accelerator...................................................................................280

22.19 Get Accelerator CPU Usage Statistics..........................................................................281

23 CDN Edge Groups..................................282

23.1 Get List of CDN Edge Groups........................................................................................282

23.2 Get List of Available CDN Edge Groups.......................................................................283

23.3 Get CDN Edge Group Details.........................................................................................284

23.4 Add CDN Edge Group.....................................................................................................285

23.5 Edit CDN Edge Group.....................................................................................................286

23.6 Delete CDN Edge Group.................................................................................................286

23.7 Assign Location to CDN Edge Group...........................................................................287

23.8 Unassign Location From CDN Edge Group.................................................................287

23.9 Modify CDN Edge Group................................................................................................288

23.10 Search CDN Edge Groups.............................................................................................288

24 CDN Edge Servers.................................290

BILLING PLANS - GET THE LIST OF BILLING PLANS 8

Page 10: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24.1 Get List of CDN Edge Servers.......................................................................................290

24.2 Get CDN Edge Server Details........................................................................................294

24.3 Add CDN Edge Server....................................................................................................29824.3.1 Page History.....................................................................................................................299

24.4 Edit CDN Edge Server....................................................................................................299

24.5 Reboot CDN Edge Server...............................................................................................300

24.6 Reboot CDN Edge Server in Recovery.........................................................................301

24.7 Start up CDN Edge Server.............................................................................................301

24.8 Shut down CDN Edge Server.........................................................................................301

24.9 Stop CDN Edge Server...................................................................................................302

24.10 Rebuild CDN Edge Server..............................................................................................302

24.11 Suspend CDN Edge Server............................................................................................303

24.12 Rerun CDN Edge Server Creation Scripts....................................................................303

24.13 Unlock CDN Edge Server...............................................................................................303

24.14 Delete CDN Edge Server................................................................................................304

24.15 Migrate CDN Edge Server..............................................................................................304

24.16 Segregate CDN Edge Server..........................................................................................305

24.17 Open CDN Edge Server Console...................................................................................305

24.18 Change CDN Edge Server Owner..................................................................................306

24.19 Set VIP Status for CDN Edge Server.............................................................................306

24.20 Add/Edit Admin/User Note for CDN Edge Server........................................................306

24.21 CDN Edge Server Disks.................................................................................................307

24.22 CDN Edge Server Network Interfaces...........................................................................308

24.23 CDN Edge Server IP Address Joins..............................................................................309

24.24 Rebuild Network for CDN Edge Server.........................................................................311

24.25 Get CDN Edge Server Billing Statistics........................................................................312

BILLING PLANS - GET THE LIST OF BILLING PLANS 9

Page 11: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24.26 Get CDN Edge Server CPU Usage Statistics................................................................316

24.27 Search CDN Edge Server by Label...............................................................................316

25 CDN HTTP Caching Rules...........................318

25.1 Get List of HTTP Caching Rules....................................................................................318

25.2 Add HTPP Caching Rule................................................................................................319

25.3 Edit HTTP Caching Rule.................................................................................................320

25.4 Delete HTTP Caching Rule.............................................................................................321

26 CDN Resources....................................322

26.1 Get List of CDN Resources............................................................................................322

26.2 Get CDN Resource Basic Details..................................................................................324

26.3 Get CDN Resource Advanced Details...........................................................................325

26.4 Add HTTP CDN Resource..............................................................................................32626.4.1 Page history......................................................................................................................328

26.5 Add Video on Demand CDN Resource.........................................................................328

26.6 Add Live Streaming CDN Resource..............................................................................329

26.7 Add HTTP Pull CDN Resource with Advanced Settings.............................................33126.7.1 Page history......................................................................................................................335

26.8 Add HTTP Push CDN Resource with Advanced Settings...........................................33626.8.1 Page History.....................................................................................................................339

26.9 Add VoD Push CDN Resource With Advanced Settings............................................339

26.10 Add VoD Pull CDN Resource With Advanced Settings...............................................341

26.11 Add Live Streaming CDN Resource with Advanced Settings....................................343

26.12 Edit CDN Resource.........................................................................................................346

26.13 Edit HTTP Pull CDN Resource with Advanced Settings.............................................34726.13.1 Page history......................................................................................................................350

26.14 Edit HTTP Push CDN Resource with Advanced Settings...........................................351

BILLING PLANS - GET THE LIST OF BILLING PLANS 10

Page 12: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.14.1 Page History.....................................................................................................................354

26.15 Edit VoD Push CDN Resource with Advanced Settings.............................................354

26.16 Edit VoD Pull CDN Resource with Advanced Settings...............................................356

26.17 Edit Live Streaming CDN Resource with Advanced Settings....................................358

26.18 Delete CDN Resource.....................................................................................................360

26.19 Change CDN Resource FTP Password.........................................................................360

26.20 Prefetch CDN Resource Content...................................................................................361

26.21 Purge CDN Resource Content.......................................................................................362

26.22 View CDN Resource Bandwidth Statistics...................................................................364

26.23 View CDN Resource Streaming Statistics....................................................................366

26.24 View CDN Resource Billing Statistics..........................................................................367

26.25 View CDN Resource Raw Log Configuration...............................................................368

26.26 Edit CDN Resource Raw Log Configuration................................................................369

26.27 Get Instruction for Live Streaming CDN Internal Resource.......................................371

26.28 Search CDN Resource....................................................................................................373

26.29 Suspend CDN Resource.................................................................................................374

26.30 Resume CDN Resource..................................................................................................374

26.31 View CDN Advanced Reporting.....................................................................................375

26.32 Get List of Available Storage Locations.......................................................................377

27 CDN SSL Certificates.............................379

27.1 Get List of Custom SNI SSL Certificates......................................................................380

27.2 Get Custom SNI SSL Certificate Details.......................................................................381

27.3 Add Custom SNI SSL Certificate...................................................................................382

27.4 Edit Custom SNI SSL Certificate...................................................................................385

27.5 Delete Custom SNI SSL Certificate...............................................................................388

BILLING PLANS - GET THE LIST OF BILLING PLANS 11

Page 13: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

27.6 Add Custom SNI SSL Certificate to CDN Resource....................................................388

28 CDN Storage Servers..............................389

28.1 Get List of CDN Storage Servers...................................................................................389

28.2 Get List of HTTP Storage Servers.................................................................................392

28.3 Get List of Streaming Storage Servers.........................................................................392

28.4 Get CDN Storage Server Details....................................................................................393

28.5 Add CDN Storage Server...............................................................................................39528.5.1 Page History.....................................................................................................................396

28.6 Edit CDN Storage Server................................................................................................396

28.7 Reboot CDN Storage Server..........................................................................................397

28.8 Start up CDN Storage Server.........................................................................................397

28.9 Shut down CDN Storage Server....................................................................................397

28.10 Stop CDN Storage Server..............................................................................................398

28.11 Rebuild CDN Storage Server.........................................................................................398

28.12 Suspend CDN Storage Server.......................................................................................399

28.13 Unlock CDN Storage Server..........................................................................................399

28.14 Set VIP Status for CDN Storage Server........................................................................400

28.15 Delete CDN Storage Server............................................................................................400

28.16 Migrate CDN Storage Server..........................................................................................401

28.17 Segregate CDN Storage Server.....................................................................................401

28.18 Resize CDN Storage Server...........................................................................................402

28.19 Change CDN Storage Server Owner.............................................................................402

28.20 Rebuild Network for CDN Storage Server....................................................................403

28.21 CDN Storage Server Disks.............................................................................................403

28.22 CDN Storage Server Network Interfaces......................................................................404

BILLING PLANS - GET THE LIST OF BILLING PLANS 12

Page 14: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.23 CDN Storage Server IP Address Joins.........................................................................404

28.24 Get CDN Storage Server CPU Usage Statistics...........................................................407

28.25 Get CDN Storage Server Hourly Statistics...................................................................407

28.26 Get CDN Storage Server Billing Statistics...................................................................409

28.27 Search CDN Storage Server by Label...........................................................................413

28.28 Get List of CDN Storage Server Backups.....................................................................413

28.29 Add/Edit Admin/User Note for CDN Storage Server....................................................415

29 CDN Usage Statistics.............................417

30 Check Password Strength..........................419

31 CloudBoot IP Addresses...........................420

31.1 Get List of CloudBoot IP Addresses.............................................................................420

31.2 Add CloudBoot IP Address............................................................................................421

31.3 Edit CloudBoot IP Address............................................................................................422

31.4 Delete Cloud Boot IP Address.......................................................................................422

32 Company Billing Plans............................423

32.1 Get List of Company Billing Plans................................................................................423

32.2 Get Company Billing Plan Details.................................................................................424

32.3 Get Company Billing Plan Resources..........................................................................42432.3.1 Page history......................................................................................................................430

32.4 Get Company Billing Plan Resource Details................................................................43032.4.1 Page history......................................................................................................................433

32.5 Create Company Billing Plan.........................................................................................434

32.6 Add Limits for Compute Zone.......................................................................................43432.6.1 Page history......................................................................................................................437

BILLING PLANS - GET THE LIST OF BILLING PLANS 13

Page 15: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

32.7 Add Limits for Data Store Zones...................................................................................43732.7.1 Page history......................................................................................................................438

32.8 Add Limits for Network Zone.........................................................................................438

32.9 Edit Company Billing Plan.............................................................................................439

32.10 Edit Limits & Pricing for Data Store Zones in Company Billing Plan........................43932.10.1 Page history......................................................................................................................440

32.11 Edit Limits & Pricing for Network Zones in Company Billing Plan............................440

32.12 Edit Limits & Pricing for Compute Zones in Company Billing Plan..........................44132.12.1 Page history......................................................................................................................443

32.13 Delete Resource From Company Billing Plan..............................................................443

32.14 Delete Company Billing Plan.........................................................................................443

33 Company Payments.................................445

33.1 Get List of Company Payments.....................................................................................445

33.2 Get List of Company Monthly Bills...............................................................................445

33.3 Create Company Payment.............................................................................................446

33.4 Edit Company Payment..................................................................................................447

33.5 Delete Company Payment..............................................................................................447

34 Compute Resources................................449

34.1 Get List of Compute Resources....................................................................................44934.1.1 Page History.....................................................................................................................453

34.2 Get Compute Resource Details.....................................................................................45434.2.1 Page History.....................................................................................................................458

34.3 Add Xen/KVM Compute Resource................................................................................459

34.4 Add CloudBoot Compute Resource.............................................................................46034.4.1 Page history......................................................................................................................465

34.5 Add Smart CloudBoot Compute Resource..................................................................46534.5.1 Page history......................................................................................................................470

BILLING PLANS - GET THE LIST OF BILLING PLANS 14

Page 16: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.6 Add Baremetal CloudBoot Compute Resource...........................................................47034.6.1 Page history......................................................................................................................471

34.7 Add VMware Compute Resource..................................................................................471

34.8 Edit Xen/KVM Compute Resource................................................................................472

34.9 Edit CloudBoot Compute Resource..............................................................................473

34.10 Edit Smart CloudBoot Compute Resource..................................................................475

34.11 Edit Baremetal CloudBoot Compute Resource...........................................................477

34.12 Reboot Compute Resource...........................................................................................478

34.13 Delete Compute Resource.............................................................................................479

34.14 Edit VMware Compute Resource..................................................................................479

34.15 Get List of Appliances Running on Compute Resource.............................................480

34.16 Get List of Data Store Joins Attached to Compute Resource....................................481

34.17 Get List of Data Stores Attached to Compute Resource............................................481

34.18 Add Data Store Join to Compute Resource.................................................................482

34.19 Remove Data Store Join from Compute Resource.....................................................483

34.20 Get List of Compute Resource Network Joins............................................................483

34.21 Add Network Join to Compute Resource.....................................................................484

34.22 Remove Network Join from Compute Resource.........................................................485

34.23 Enable/disable Open vSwitch........................................................................................485

34.24 Power Cycle CloudBoot Compute Resource...............................................................486

34.25 Enable Maintenance Mode for Xen/KVM Compute Resource....................................486

34.26 Disable Maintenance Mode for Xen/KVM Compute Resource...................................487

35 Compute Zones....................................488

35.1 Get List of Compute Zones............................................................................................48835.1.1 Page history......................................................................................................................490

35.2 Get Compute Zone Details.............................................................................................491

BILLING PLANS - GET THE LIST OF BILLING PLANS 15

Page 17: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

35.2.1 Page history......................................................................................................................493

35.3 Add Compute Zone.........................................................................................................49435.3.1 Page history......................................................................................................................496

35.4 Edit Compute Zone.........................................................................................................49735.4.1 Page history......................................................................................................................499

35.5 Delete Compute Zone.....................................................................................................499

35.6 Get List of Compute Resources Attached to Compute Zone.....................................500

35.7 Attach Compute Resource to Compute Zone..............................................................500

35.8 Remove Compute Resource from Compute Zone.......................................................501

35.9 Get the List of Data Store Joins Attached to Compute Zone.....................................501

35.10 Add Data Store Join to Compute Zone.........................................................................502

35.11 Remove Data Store Join from Compute Zone.............................................................503

35.12 Get List of Network Joins Attached to Compute Zone...............................................503

35.13 Add Network Join to Compute Zone.............................................................................504

35.14 Remove Network Join from Compute Zone.................................................................504

35.15 Update CPU Flags for Compute Zone...........................................................................505

35.16 Get Common CPU Flags for Compute Resources of Compute Zone........................505

36 Control Panel Maintenance........................507

36.1 Get Control Panel Maintenance Status.........................................................................507

36.2 Enable Control Panel Maintenance...............................................................................507

36.3 Disable Control Panel Maintenance..............................................................................508

37 Currencies.......................................509

37.1 Get List of Currencies....................................................................................................509

37.2 Get Currency Details......................................................................................................510

37.3 Add Currency..................................................................................................................511

BILLING PLANS - GET THE LIST OF BILLING PLANS 16

Page 18: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

37.4 Edit Currency..................................................................................................................511

37.5 Delete Currency..............................................................................................................512

38 Customer Networks................................513

38.1 Get List of Customer Networks.....................................................................................513

38.2 Get List of User Customer Networks............................................................................514

38.3 Add Customer Network..................................................................................................514

38.4 Delete Customer Network..............................................................................................515

39 Customer VLANs...................................517

39.1 Get List of Customer VLANs.........................................................................................517

39.2 Get Customer VLAN Details..........................................................................................518

39.3 Add Customer VLAN......................................................................................................518

39.4 Edit Customer VLAN.......................................................................................................519

39.5 Delete Customer VLAN...................................................................................................520

40 Custom Recipe Variables..........................521

40.1 Get List of Custom Variables.........................................................................................521

40.2 Get Custom Variable Details..........................................................................................522

40.3 Edit Custom Variable......................................................................................................523

40.4 Add Custom Variable......................................................................................................523

40.5 Delete Custom Variable..................................................................................................524

40.6 Get List of Virtual Server Custom Variables................................................................525

40.7 Get List of Smart Server Custom Variables.................................................................526

40.8 Get List of Baremetal Server Variables........................................................................527

40.9 Get Virtual Server Custom Variable Details.................................................................528

BILLING PLANS - GET THE LIST OF BILLING PLANS 17

Page 19: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

40.10 Get Smart Server Custom Variable Details..................................................................529

40.11 Get Baremetal Server Custom Variable Details...........................................................530

40.12 Add Virtual Server Custom Variable.............................................................................531

40.13 Add Smart Server Custom Variable..............................................................................532

40.14 Add Baremetal Server Custom Variable.......................................................................533

40.15 Edit Virtual Server Custom Variable.............................................................................534

40.16 Edit Smart Server Custom Variable..............................................................................535

40.17 Edit Baremetal Server Custom Variable.......................................................................535

40.18 Delete Virtual Server Custom Variable.........................................................................536

40.19 Delete Smart Server Custom Variable..........................................................................537

40.20 Delete Baremetal Server Custom Variable...................................................................537

41 Data Stores......................................538

41.1 Get List of Data Stores...................................................................................................538

41.2 Get Data Store Details....................................................................................................539

41.3 Add LVM Data Store.......................................................................................................540

41.4 Add VMware Data Store.................................................................................................540

41.5 Add SolidFire Data Store................................................................................................541

41.6 Edit LVM Data Store........................................................................................................543

41.7 Edit SolidFire Data Store................................................................................................544

41.8 Delete Data Store............................................................................................................545

42 Data Store Zones.................................546

42.1 Get List of Data Store Zones.........................................................................................54642.1.1 Page history......................................................................................................................546

42.2 Get Data Store Zone Details..........................................................................................54742.2.1 Page history......................................................................................................................547

BILLING PLANS - GET THE LIST OF BILLING PLANS 18

Page 20: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

42.3 Add Data Store Zone......................................................................................................54842.3.1 Page history......................................................................................................................548

42.4 Edit Data Store Zone.......................................................................................................54842.4.1 Page history......................................................................................................................549

42.5 Delete Data Store Zone...................................................................................................549

42.6 Get the List of Data Stores Attached to Data Store Zone...........................................550

42.7 Attach Data Store to Data Store Zone...........................................................................551

42.8 Detach Data Store from Data Store Zone.....................................................................551

43 Disks............................................552

43.1 Get List of Disks..............................................................................................................552

43.2 Get List of VS Disks........................................................................................................553

43.3 Get VS Disk Details.........................................................................................................555

43.4 Add New Disk..................................................................................................................556

43.5 Edit Disk...........................................................................................................................557

43.6 Migrate Disk.....................................................................................................................559

43.7 Delete Disk.......................................................................................................................559

43.8 View Disk IOPS................................................................................................................560

43.9 Build Disk........................................................................................................................561

43.10 Unlock Disk.....................................................................................................................561

43.11 Get List of Backups Available for a Disk......................................................................562

44 DNS Setup........................................564

44.1 Get DNS Domain Details................................................................................................564

44.2 Set Up DNS Domain........................................................................................................564

44.3 Edit DNS Domain............................................................................................................565

44.4 Get List of Glue Records................................................................................................565

BILLING PLANS - GET THE LIST OF BILLING PLANS 19

Page 21: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

45 DNS Zones........................................567

45.1 Get List of Own DNS Zones...........................................................................................567

45.2 Get Domain Zone Details...............................................................................................567

45.3 Get List of Users DNS Zones.........................................................................................568

45.4 Add DNS Zone.................................................................................................................569

45.5 Delete DNS Zone.............................................................................................................569

45.6 Get List of Name Servers...............................................................................................570

45.7 Get List of DNS Zone Records......................................................................................570

45.8 Get DNS Record Details.................................................................................................573

45.9 Add DNS Record.............................................................................................................574

45.10 Edit DNS Records...........................................................................................................575

45.11 Delete DNS Record.........................................................................................................576

46 Edge Gateways....................................578

46.1 Get List of Edge Gateways............................................................................................578

46.2 Get List of Edge Gateway Interfaces............................................................................580

46.3 Get Edge Gateway Details.............................................................................................581

46.4 Create Edge Gateway.....................................................................................................582

46.5 Edit Edge Gateway..........................................................................................................583

46.6 Delete Edge Gateway......................................................................................................584

47 Embed Statistics Charts..........................585

48 Errors...........................................587

48.1 Get List of Errors............................................................................................................587

48.2 Get Error Details.............................................................................................................589

BILLING PLANS - GET THE LIST OF BILLING PLANS 20

Page 22: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

49 Federation.......................................590

49.1 Add Zone to Federation..................................................................................................590

49.2 Enable Federated Zone..................................................................................................592

49.3 Disable Federated Zone.................................................................................................593

49.4 Remove Zone from Federation......................................................................................593

49.5 Get List of Federated Resources..................................................................................594

49.6 Get Federated Resource Details...................................................................................595

49.7 Subscribe to Federated Zone........................................................................................597

49.8 Unsubscribe from Federated Zone...............................................................................597

49.9 Suspend Zone.................................................................................................................598

49.10 Unsuspend Zone.............................................................................................................598

50 Firewall Rules for VSs...........................600

50.1 Get List of Firewall Rules...............................................................................................600

50.2 Apply Firewall Rule.........................................................................................................601

50.3 Add Firewall Rule............................................................................................................601

50.4 Edit Firewall Rule............................................................................................................604

50.5 Delete Firewall Rule........................................................................................................607

50.6 Change Firewall Rule Position......................................................................................608

50.7 Set Default Firewall Rules..............................................................................................609

51 Firewalls........................................610

51.1 Get List of Firewalls........................................................................................................610

51.2 Get Firewall Details.........................................................................................................611

51.3 Add Firewall.....................................................................................................................612

51.4 Edit Firewall.....................................................................................................................613

BILLING PLANS - GET THE LIST OF BILLING PLANS 21

Page 23: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

51.5 Delete Firewall.................................................................................................................613

52 High Availability Control Panel..................615

52.1 Get List of Clusters.........................................................................................................615

52.2 Get List of Cluster Nodes...............................................................................................617

52.3 Get Node Details.............................................................................................................618

52.4 Get List of Hosts.............................................................................................................620

52.5 Get Host Nodes...............................................................................................................621

52.6 Get List of Communication Rings.................................................................................622

52.7 Get Details of Communication Ring.............................................................................623

52.8 Get Status of OnApp Subsystems................................................................................624

52.9 Enable High Availability.................................................................................................625

52.10 Disable High Availability................................................................................................625

52.11 Deactivate Cluster...........................................................................................................626

52.12 Activate Deactivated Cluster.........................................................................................626

52.13 Apply Changes to High Availability Configuration......................................................627

52.14 Apply Changes to Multicast Configuration..................................................................627

52.15 Edit Host..........................................................................................................................627

52.16 Edit Cluster......................................................................................................................628

52.17 Edit Node.........................................................................................................................629

52.18 Edit Communication Ring..............................................................................................629

52.19 Add Cluster......................................................................................................................630

52.20 Add Host..........................................................................................................................630

52.21 Add New Node to Cluster...............................................................................................631

52.22 Add Communication Interface.......................................................................................632

52.23 Delete Host......................................................................................................................632

BILLING PLANS - GET THE LIST OF BILLING PLANS 22

Page 24: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52.24 Delete Node.....................................................................................................................633

52.25 Delete Communication Ring..........................................................................................633

53 Instance Packages................................634

53.1 Get List of Instance Packages.......................................................................................634

53.2 Get Instance Package Details........................................................................................636

53.3 Add Instance Package....................................................................................................637

53.4 Edit Instance Package....................................................................................................638

53.5 Delete Instance Package................................................................................................640

54 Integrated Storage...............................641

54.1 Get List of Integrated Storage Data Stores..................................................................641

54.2 Get Integrated Data Store Details..................................................................................642

54.3 Add Integrated Storage Data Store...............................................................................64354.3.1 PAGE HISTORY...............................................................................................................644

54.4 Edit Integrated Data Store..............................................................................................64454.4.1 PAGE HISTORY...............................................................................................................645

54.5 Delete Integrated Storage Data Store...........................................................................64554.5.1 PAGE HISTORY...............................................................................................................646

54.6 Add Disk Drive to Integrated Storage Data Store........................................................64654.6.1 PAGE HISTORY...............................................................................................................646

54.7 Remove Disk Drive from Integrated Storage Data Store............................................64654.7.1 PAGE HISTORY...............................................................................................................647

54.8 Get Storage Node IO Statistics......................................................................................647

54.9 Get Integrated Storage Datastore Disk IO Statistics...................................................648

54.10 Forget Storage Node......................................................................................................649

54.11 Get List of Backend Nodes on Integrated Storage Data Store...................................650

54.12 Get List of Integrated Storage Data Stores Disk Drives..............................................651

BILLING PLANS - GET THE LIST OF BILLING PLANS 23

Page 25: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

55 IP Addresses.....................................652

55.1 Get List of Network IP Addresses.................................................................................652

55.2 Add IP Address Record..................................................................................................653

55.3 Edit IP Address...............................................................................................................654

55.4 Delete IP address............................................................................................................654

55.5 Assign IP Address to User.............................................................................................655

55.6 Unassign IP Address from User....................................................................................655

56 IP Address Joins.................................657

56.1 Get List of IP Address Joins..........................................................................................657

56.2 Assign IP Address Join to VS.......................................................................................658

56.3 Delete IP Address Join...................................................................................................658

57 IP Address Pools.................................660

57.1 Get List of IP Address Pools.........................................................................................660

57.2 Get IP Address Pool Details..........................................................................................661

57.3 Add New IP Address Pool..............................................................................................662

57.4 Delete IP Address Pool...................................................................................................663

58 ISOs.............................................664

58.1 Get List of ISOs...............................................................................................................664

58.2 Get ISO Details................................................................................................................666

58.3 Get List of Public ISOs...................................................................................................668

58.4 Get List of ISOs of Particular User................................................................................670

58.5 Get List of User ISOs......................................................................................................672

58.6 Get List of Own ISOs......................................................................................................674

BILLING PLANS - GET THE LIST OF BILLING PLANS 24

Page 26: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

58.7 Update ISO.......................................................................................................................676

58.8 Add New ISO...................................................................................................................677

58.9 Make ISO Public..............................................................................................................678

58.10 Delete ISO........................................................................................................................678

59 License..........................................679

59.1 Get License Details.........................................................................................................679

59.2 Edit License Details........................................................................................................679

60 Load Balancers...................................681

60.1 Get List of Load Balancers............................................................................................681

60.2 Get Load Balancer Details.............................................................................................685

60.3 Get the List of Load Balancing Clusters......................................................................692

60.4 Get Load Balancing Cluster Details..............................................................................700

60.5 Get Load Balancer Billing Statistics.............................................................................708

60.6 Get List of Load Balancer Autoscaling Monitors........................................................712

60.7 Get Load Balancer Autoscaling Monitor Details.........................................................716

60.8 Add Load Balancing Cluster..........................................................................................721

60.9 Add Autoscaling Cluster................................................................................................722

60.10 Add Nodes to Cluster Type............................................................................................724

60.11 Remove Nodes from Cluster Type................................................................................725

60.12 Edit Load Balancing Cluster..........................................................................................725

60.13 Edit Autoscaling Cluster................................................................................................726

60.14 Edit Load Balancing Cluster Ports................................................................................727

60.15 Delete Load Balancing Cluster......................................................................................728

60.16 Rebuild Load Balancer...................................................................................................728

BILLING PLANS - GET THE LIST OF BILLING PLANS 25

Page 27: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

60.17 Search Load Balancer by Label....................................................................................729

60.18 Start up Load Balancer...................................................................................................729

60.19 Shut down Load Balancer..............................................................................................729

60.20 Suspend Load Balancer.................................................................................................730

60.21 Stop Load Balancer........................................................................................................730

60.22 Unlock Load Balancer....................................................................................................731

61 Locales..........................................732

62 Location Groups..................................733

62.1 Get List of Location Groups..........................................................................................733

62.2 Get Location Group Details...........................................................................................734

62.3 Refresh Location Groups...............................................................................................735

62.4 Attach Compute Zone to Location Group....................................................................735

62.5 Detach Compute Zone from Location Group...............................................................736

62.6 Attach Data Store Zone to Location Group.................................................................736

62.7 Detach Data Store Zone from Location Group............................................................737

62.8 Attach Network Zone to Location Group......................................................................737

62.9 Detach Network Zone from Location Group................................................................738

62.10 Attach Backup Server Zone to Location Group...........................................................738

62.11 Detach Backup Server Zone from Location Group.....................................................738

62.12 Get List of Compute Zones Attached to Location Group...........................................739

62.13 Get List of Data Store Zones Attached to Location Group.........................................742

62.14 Get List of Network Zones Attached to Location Group.............................................743

62.15 Get List of Backup Server Zones Attached to Location Group..................................744

62.16 Attach CDN Location to Location Group......................................................................744

BILLING PLANS - GET THE LIST OF BILLING PLANS 26

Page 28: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

62.17 Detach CDN Location from Location Group................................................................745

62.18 Get List of CDN Locations.............................................................................................745

62.19 Get List of CDN Locations for Location Group............................................................746

63 Logs.............................................748

63.1 Get List of Log Items......................................................................................................748

63.2 Get Log Item Details.......................................................................................................749

63.3 Get List of VS Log Items................................................................................................749

63.4 Get VS Log Item Details.................................................................................................750

64 My Template Groups...............................752

64.1 Get My Template Groups List........................................................................................752

64.2 Get My Template Group Details....................................................................................755

64.3 Add My Template Group................................................................................................757

64.4 Add Child Group.............................................................................................................758

64.5 Edit My Template Group.................................................................................................759

64.6 Delete My Template Group............................................................................................760

64.7 Get List of Templates Attached to Group.....................................................................761

64.8 Attach Template to Group..............................................................................................763

64.9 Detach Template from Group........................................................................................764

65 Network Interfaces...............................765

65.1 Get List of VS Network Interfaces.................................................................................765

65.2 Get Network Interface Details........................................................................................766

65.3 Add Network Interface to VS.........................................................................................766

65.4 Edit Network Interface....................................................................................................767

BILLING PLANS - GET THE LIST OF BILLING PLANS 27

Page 29: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

65.5 Delete Network Interface................................................................................................767

65.6 Get VS Network Interface Usage Statistics..................................................................768

66 Networks.........................................770

66.1 Get List of Networks.......................................................................................................770

66.2 Get Network Details........................................................................................................770

66.3 Add Network....................................................................................................................771

66.4 Edit Network....................................................................................................................772

66.5 Rebuild VS Network........................................................................................................772

66.6 Delete Network................................................................................................................773

67 Network Zones....................................774

67.1 Get List of Network Zones.............................................................................................77467.1.1 Page history......................................................................................................................774

67.2 Get Network Zone Details..............................................................................................77567.2.1 Page history......................................................................................................................775

67.3 Add Network Zone..........................................................................................................77667.3.1 Page history......................................................................................................................776

67.4 Edit Network Zone..........................................................................................................77667.4.1 Page history......................................................................................................................777

67.5 Delete Network Zone......................................................................................................777

67.6 Attach Network to Network Zone..................................................................................778

67.7 Remove Network from Network Zone...........................................................................778

68 OnApp Engine.....................................779

68.1 Get OnApp Engine Status..............................................................................................779

68.2 Start OnApp Engine........................................................................................................780

68.3 Stop OnApp Engine........................................................................................................780

BILLING PLANS - GET THE LIST OF BILLING PLANS 28

Page 30: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

68.4 Reload OnApp Engine....................................................................................................781

69 Orchestration Models.............................783

69.1 Get List of Orchestration Models..................................................................................783

69.2 Get Orchestration Model Details...................................................................................787

69.3 Create Orchestration Model...........................................................................................791

69.4 Deploy Orchestration Model..........................................................................................794

69.5 Delete Orchestration Model...........................................................................................796

70 Pagination.......................................797

71 Payments.........................................801

71.1 Get List of All User Payments.......................................................................................801

71.2 Get List of Payments of Particular User.......................................................................802

71.3 Get User Payment Details..............................................................................................803

71.4 Create User Payment......................................................................................................804

71.5 Edit User Payment..........................................................................................................804

71.6 Delete User Payment......................................................................................................805

72 Publishing Rules.................................806

72.1 Get List of Publishing Rules..........................................................................................806

72.2 Add Publishing Rule.......................................................................................................807

72.3 Delete Publishing Rule...................................................................................................808

73 Recipe Groups....................................809

73.1 Get List of Recipe Groups.............................................................................................809

73.2 Get Recipe Group Details..............................................................................................811

BILLING PLANS - GET THE LIST OF BILLING PLANS 29

Page 31: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

73.3 Add Recipe Group..........................................................................................................812

73.4 Add Child Recipe Group................................................................................................812

73.5 Edit Recipe Group...........................................................................................................813

73.6 Delete Recipe Group.......................................................................................................813

73.7 Get List of Recipes Attached to Recipe Group............................................................814

73.8 Attach Recipe to Recipe Group.....................................................................................814

73.9 Remove Recipe from Recipe Group.............................................................................815

74 Recipes..........................................816

74.1 Get List of Recipes.........................................................................................................816

74.2 Get List of Servers Using Recipe..................................................................................818

74.3 Get Recipe Details..........................................................................................................819

74.4 Add Recipe......................................................................................................................822

74.5 Edit Recipe......................................................................................................................822

74.6 Delete Recipe..................................................................................................................823

74.7 Manage Recipe Steps.....................................................................................................82474.7.1 Get the List of Recipe Steps.............................................................................................82474.7.2 Create Recipe Step...........................................................................................................82874.7.3 Edit Recipe Step...............................................................................................................82974.7.4 Remove Recipe Step........................................................................................................83074.7.5 Swap Recipe Steps Locations..........................................................................................830

74.8 Manage Virtual Server Recipes.....................................................................................83174.8.1 Get the List of Virtual Server Recipes...............................................................................83174.8.2 Assign Recipe to Virtual Server........................................................................................83174.8.3 Remove Recipe from Virtual Server.................................................................................83274.8.4 Run Recipe on Multiple Virtual Servers............................................................................832

74.9 Manage Smart Server Recipes......................................................................................83374.9.1 Get the List of Smart Server Recipes...............................................................................83374.9.2 Assign Recipe to Smart Server.........................................................................................83374.9.3 Remove Recipe from Smart Server..................................................................................83474.9.4 Run Recipe on Multiple Smart Servers.............................................................................835

74.10 Manage Baremetal Server Recipes...............................................................................835

BILLING PLANS - GET THE LIST OF BILLING PLANS 30

Page 32: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74.10.1 Get the List of Baremetal Server Recipes........................................................................83574.10.2 Assign Recipe to Baremetal Server..................................................................................83674.10.3 Remove Recipe from Baremetal Server...........................................................................836

74.11 Manage Template Recipes.............................................................................................83674.11.1 Get the List of Template Recipes.....................................................................................83674.11.2 Assign Recipe to Template...............................................................................................83774.11.3 Remove Recipe from Template........................................................................................837

74.12 Manage Compute Zone Recipes...................................................................................83874.12.1 Get the List of Compute Zone Recipes.............................................................................83874.12.2 Assign Recipe to Compute Zone......................................................................................83874.12.3 Remove Recipe from Compute Zone...............................................................................839

74.13 Manage Control Panel Recipes.....................................................................................83974.13.1 Get the List of Control Panel Recipes...............................................................................84074.13.2 Assign Recipe to Control Panel........................................................................................84074.13.3 Remove Recipe from Control Panel.................................................................................841

75 Resolvers........................................842

75.1 Get List of Resolvers......................................................................................................842

75.2 Get Resolver Details.......................................................................................................842

75.3 Add Resolver...................................................................................................................843

75.4 Edit Resolver...................................................................................................................843

75.5 Delete Resolver...............................................................................................................844

76 Resource Pools...................................845

76.1 Get List of Resource Pools............................................................................................845

76.2 Get Resource Pool Details.............................................................................................846

76.3 Get Billing Statistics for Resource Pool.......................................................................84876.3.1 Page history......................................................................................................................850

76.4 Create Resource Pool.....................................................................................................851

76.5 Edit Resource Pool.........................................................................................................852

76.6 Delete Resource Pool.....................................................................................................853

76.7 Create Resource Pool Data Store.................................................................................853

BILLING PLANS - GET THE LIST OF BILLING PLANS 31

Page 33: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

76.8 Edit Resource Pool Data Store......................................................................................854

76.9 Delete Resource Pool Data Store..................................................................................854

76.10 Get List of Provider Resource Pools............................................................................855

77 Restrictions Sets................................860

77.1 Get List of Restrictions Sets..........................................................................................860

77.2 Get Restrictions Set Details...........................................................................................861

77.3 Get List of All Restrictions Resources.........................................................................863

77.4 Create Restrictions Set..................................................................................................864

77.5 Edit Restrictions Set.......................................................................................................865

78 Roles............................................866

78.1 Get List of Roles.............................................................................................................866

78.2 Get Role Details..............................................................................................................867

78.3 Add Role..........................................................................................................................868

78.4 Edit Role..........................................................................................................................868

78.5 Delete Role......................................................................................................................869

78.6 Edit User Role Assignment............................................................................................869

78.7 Get List of All Permissions............................................................................................870

78.8 Clone Role.......................................................................................................................870

79 Smart Servers....................................872

79.1 Get List of Smart Servers...............................................................................................872

79.2 Get Smart Server Details................................................................................................875

79.3 Add Smart Server............................................................................................................876

79.4 View Encrypted Smart Server Password......................................................................877

BILLING PLANS - GET THE LIST OF BILLING PLANS 32

Page 34: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.5 Build Smart Server..........................................................................................................878

79.6 Edit Smart Server............................................................................................................879

79.7 Change Smart Server Owner.........................................................................................880

79.8 Migrate Smart Server......................................................................................................880

79.9 Delete Smart Server........................................................................................................881

79.10 Start up Smart Server.....................................................................................................881

79.11 Reboot Smart Server......................................................................................................882

79.12 Reboot Smart Server in Recovery.................................................................................882

79.13 Suspend Smart Server...................................................................................................883

79.14 Unsuspend Smart Server...............................................................................................883

79.15 Unlock Smart Server.......................................................................................................883

79.16 Shut down Smart Server................................................................................................884

79.17 Stop Smart Server...........................................................................................................884

79.18 Open Smart Server Console..........................................................................................885

79.19 Smart Server Autoscaling..............................................................................................88579.19.1 Get the List of Autoscaling Rules for Smart Server..........................................................88579.19.2 Create Autoscaling Rule for SS........................................................................................88679.19.3 Edit Autoscaling Rule for SS.............................................................................................88779.19.4 Delete Autoscaling Rule...................................................................................................887

79.20 Smart Server Billing Statistics......................................................................................887

79.21 Search Smart Servers by Label.....................................................................................891

79.22 Get Smart Server CPU Usage Statistics.......................................................................892

79.23 Resize Smart Server.......................................................................................................893

79.24 Add/Edit Admin/User Note for Smart Servers..............................................................893

80 Software Licenses................................895

80.1 Get List of Software Licenses.......................................................................................895

80.2 Get Software License Details........................................................................................896

BILLING PLANS - GET THE LIST OF BILLING PLANS 33

Page 35: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

80.3 Add Software License....................................................................................................896

80.4 Edit Software License.....................................................................................................897

80.5 Delete Software License................................................................................................897

81 SSH keys.........................................899

81.1 Get List of SSH Keys......................................................................................................899

81.2 Add SSH Key...................................................................................................................899

81.3 Edit SSH Key...................................................................................................................900

81.4 Delete SSH Key...............................................................................................................901

82 Statistics.......................................902

82.1 Usage Trends Statistics.................................................................................................902

82.2 Cloud Usage Statistics...................................................................................................903

83 Storage Server Backups...........................905

83.1 Get All Storage Server Backups Details.......................................................................905

83.2 Get Normal Storage Server Backups Details...............................................................907

83.3 Get Incremental Server Backups Details......................................................................908

83.4 Add Backup for Storage Server....................................................................................910

83.5 Add/Edit Storage Server Backup Note.........................................................................912

83.6 Restore Storage Server Backup....................................................................................913

84 System Configuration.............................914

84.1 View System Configuration...........................................................................................91484.1.1 Page history......................................................................................................................921

84.2 Edit System Configuration.............................................................................................92384.2.1 Page history......................................................................................................................929

BILLING PLANS - GET THE LIST OF BILLING PLANS 34

Page 36: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

85 Templates........................................933

85.1 Get List of All Templates................................................................................................933

85.2 Get List of System Templates.......................................................................................936

85.3 Get List of Own Templates............................................................................................938

85.4 Get List of User Templates............................................................................................941

85.5 Get List of Templates of Particular User......................................................................943

85.6 Get List of Inactive Templates.......................................................................................946

85.7 Get Template Details......................................................................................................948

85.8 Make Template Public....................................................................................................951

85.9 Delete Template..............................................................................................................951

85.10 Edit Template..................................................................................................................951

85.11 Get List of Available for Installation Templates...........................................................952

85.12 Get List of Available for Update Templates.................................................................954

85.13 Install Template...............................................................................................................956

85.14 Update Template.............................................................................................................957

85.15 Search for Particular Available for Installation Template...........................................958

85.16 Search for Particular Available for Upgrade Template...............................................959

86 Template Store...................................962

86.1 Get Template Store Details............................................................................................962

86.2 Get Template Group Details..........................................................................................963

86.3 Add Template Group......................................................................................................964

86.4 Add Child Group.............................................................................................................966

86.5 Edit Template Group.......................................................................................................968

86.6 Delete Template Group...................................................................................................969

BILLING PLANS - GET THE LIST OF BILLING PLANS 35

Page 37: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

86.7 Get List of Templates Attached to Group.....................................................................969

86.8 Attach Template to Group..............................................................................................972

86.9 Detach Template from Group........................................................................................973

86.10 Change Price for Template in the Group......................................................................973

87 Top IOPS Disks...................................975

87.1 Get TOP IOPS Disks.......................................................................................................975

88 Transactions.....................................977

88.1 Get List of Transactions.................................................................................................977

88.2 Get List of VS Transactions without Log Output.........................................................979

88.3 Get List of Transactions with Log Output....................................................................980

88.4 Get Transaction Details..................................................................................................982

88.5 Get Transaction Details without Log Output...............................................................983

89 User Additional Fields...........................985

89.1 Get List of Additional Fields..........................................................................................985

89.2 Get Additional Field Details...........................................................................................985

89.3 Add Additional Field.......................................................................................................986

89.4 Edit Additional Field.......................................................................................................987

89.5 Delete Additional Field...................................................................................................987

89.6 Search User by Additional Field Parameter.................................................................987

90 User Groups......................................989

90.1 Get List of User Groups.................................................................................................989

90.2 Get User Group Details..................................................................................................991

90.3 Add User Group..............................................................................................................993

BILLING PLANS - GET THE LIST OF BILLING PLANS 36

Page 38: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

90.4 Edit User Group..............................................................................................................993

90.5 Delete User Group..........................................................................................................994

91 Users............................................995

91.1 Get List of Users.............................................................................................................995

91.2 Get User Details............................................................................................................1000

91.3 Check Login/E-mail Availability..................................................................................1004

91.4 Add User........................................................................................................................100691.4.1 Page history....................................................................................................................1007

91.5 Edit User........................................................................................................................1007

91.6 Suspend User................................................................................................................1009

91.7 Activate User.................................................................................................................1009

91.8 Unlock User...................................................................................................................1009

91.9 Delete User....................................................................................................................1010

91.10 Drop Sessions...............................................................................................................1011

91.11 Get User Last Access Log...........................................................................................1011

91.12 Get User Statistics........................................................................................................1013

91.13 Get User's Statistics for Particular Period.................................................................1014

91.14 Get User Billing Statistics............................................................................................1017

91.15 Get List of User Monthly Bills......................................................................................1018

91.16 Get List of User Payments...........................................................................................1019

91.17 Add Payment.................................................................................................................1020

91.18 Edit Payment.................................................................................................................1020

91.19 Delete Payment.............................................................................................................1021

91.20 Get List of User VSs.....................................................................................................1021

91.21 Get List of Compute resources Used by Users' VSs.................................................1021

BILLING PLANS - GET THE LIST OF BILLING PLANS 37

Page 39: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

91.22 Get List of User Backups.............................................................................................1021

91.23 Get List of User Data Store Zones..............................................................................1022

91.24 Get List of User Limits.................................................................................................1022

91.25 Get List of User Network Zones..................................................................................1024

91.26 Search User Backups...................................................................................................1024

91.27 Generate API Key..........................................................................................................1026

91.28 Search Users by Name.................................................................................................1027

92 Users with Config Problems......................1029

92.1 Get the list of users without roles...............................................................................1029

92.2 Get the list of users without timezones......................................................................1029

92.3 Get the list of users without user groups...................................................................1030

93 vApps...........................................1031

93.1 Get List of vApps..........................................................................................................1031

93.2 Get List of vApp VSs....................................................................................................1032

93.3 Get vApp Details...........................................................................................................1036

93.4 Recompose vApp..........................................................................................................1038

93.5 Edit vApp.......................................................................................................................1038

93.6 Start vApp......................................................................................................................1039

93.7 Stop vApp......................................................................................................................1039

93.8 Delete vApp...................................................................................................................1039

93.9 Create vApp...................................................................................................................1040

93.10 Compose vApp..............................................................................................................1040

94 vApp Networks...................................1042

BILLING PLANS - GET THE LIST OF BILLING PLANS 38

Page 40: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

94.1 Get List of vApp Networks...........................................................................................1042

94.2 Get vApp Network Details............................................................................................1043

94.3 Get List of IP Addresses Assigned to vApp Network...............................................1045

95 vCloud External Networks........................1047

95.1 Get List of vCloud External Networks........................................................................1047

95.2 Get vCloud External Network Details.........................................................................1048

95.3 Get List of IP Addresses Assigned to vCloud External Network.............................1050

96 vCloud Firewall Rules...........................1052

96.1 Get List of vCloud Firewall Rules................................................................................1052

96.2 Get Firewall Rule Details..............................................................................................1053

96.3 Create vCloud Firewall Rule........................................................................................1054

96.4 Edit vCloud Firewall Rules...........................................................................................1055

96.5 Delete vCloud Firewall Rule.........................................................................................1057

97 vCloud Network Interfaces.......................1058

97.1 Get List of vCloud Network Interfaces........................................................................1058

97.2 Get vCloud Network Interface Details.........................................................................1059

97.3 Create vCloud Network Interface................................................................................1060

97.4 Edit vCloud Network Interface.....................................................................................1061

97.5 Delete vCloud Network Interface.................................................................................1061

98 vCloud Organization Networks....................1063

98.1 Get List of vCloud Organization Networks.................................................................1063

98.2 Get vCloud Organization Network Details..................................................................1064

98.3 Create vCloud Organization Network.........................................................................1066

BILLING PLANS - GET THE LIST OF BILLING PLANS 39

Page 41: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

98.4 Edit vCloud Organization Network..............................................................................1068

98.5 Delete vCloud Organization Network..........................................................................1069

99 vCloud VS Snapshots.............................1070

99.1 Get List of vCloud VS Snapshots................................................................................1070

99.2 Create vCloud VS Snapshot........................................................................................1071

99.3 Build vCloud VS Snapshot...........................................................................................1071

99.4 Restore vCloud VS Snapshot......................................................................................1072

99.5 Delete vCloud VS Snapshot.........................................................................................1072

100 Version.........................................1073

101 Virtual Servers.................................1074

101.1 Get List of VSs..............................................................................................................1074101.1.1 Page History:..................................................................................................................1080

101.2 Get VS Details...............................................................................................................1080101.2.1 Page History:..................................................................................................................1084

101.3 Get Statuses for all Virtual Servers.............................................................................1085

101.4 Get Virtual Server Status.............................................................................................1086

101.5 Add VS...........................................................................................................................1087101.5.1 Page history....................................................................................................................1093

101.6 Add Instance Package VS............................................................................................1094

101.7 Add VMware VS.............................................................................................................1096101.7.1 Page history....................................................................................................................1097

101.8 View Encrypted VS Password.....................................................................................1098

101.9 Build or Rebuild VS......................................................................................................1098

101.10 Edit VS...........................................................................................................................1099

101.11 Change VS Owner.........................................................................................................1100

BILLING PLANS - GET THE LIST OF BILLING PLANS 40

Page 42: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

101.12 Reset VS Root Password.............................................................................................1101

101.13 Set SSH Keys................................................................................................................1103

101.14 Migrate VS.....................................................................................................................1103

101.15 Set VIP Status for VS....................................................................................................1104

101.16 Delete VS.......................................................................................................................1104

101.17 Start up VS.....................................................................................................................1105

101.18 Segregate VS.................................................................................................................1105

101.19 Desegregate VS.............................................................................................................1106

101.20 Reboot VS......................................................................................................................1107

101.21 Enable Accelerator for Virtual Server.........................................................................1108

101.22 Disable Accelerator for Virtual Server........................................................................1108

101.23 Purge File(s)..................................................................................................................1109

101.24 Purge All Content..........................................................................................................1109

101.25 Reboot VS in Recovery................................................................................................1110

101.26 Reboot VS from ISO......................................................................................................1110

101.27 Boot VS from ISO..........................................................................................................1111

101.28 Suspend VS...................................................................................................................1111

101.29 Unlock VS......................................................................................................................1112

101.30 Unsuspend VS...............................................................................................................1112

101.31 Shut down VS................................................................................................................1112

101.32 Stop VS..........................................................................................................................1113

101.33 Open VS Console..........................................................................................................1113

101.34 VS Autoscaling..............................................................................................................1113101.34.1Enable Autoscaling for VS..............................................................................................1114101.34.2Get the List of Autoscaling Rules for VS.........................................................................1114101.34.3Create Autoscaling Rule for VS......................................................................................1115101.34.4Edit Autoscaling Rule for VS...........................................................................................1116101.34.5Delete Autoscaling Rule.................................................................................................1116

BILLING PLANS - GET THE LIST OF BILLING PLANS 41

Page 43: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

101.34.6Disable Autoscaling for VS.............................................................................................1116

101.35 VS Billing Statistics......................................................................................................1117

101.36 Search VS by Label.......................................................................................................1120

101.37 Get VS CPU Usage Statistics.......................................................................................1120

101.38 Add/Edit Admin/User Note for Virtual Server.............................................................1121101.38.1Add/Edit User Note.........................................................................................................1122

101.39 Enable Booting from CD for ISO Virtual Server.........................................................1123

101.40 Disable Booting from CD for ISO Virtual Server........................................................1123

101.41 Add Media File to vCloud VS.......................................................................................1124

101.42 Remove Media File from vCloud VS...........................................................................1124

101.43 View vCloud VS Guest Customization........................................................................1125

102 Whitelist IPs...................................1127

102.1 Get List of Whitelist IPs................................................................................................1127

102.2 Get Whitelist IP Details.................................................................................................1128

102.3 Add Whitelisted IP........................................................................................................1128

102.4 Edit Whitelisted IP.........................................................................................................1129

102.5 Delete Whitelisted IP.....................................................................................................1129

BILLING PLANS - GET THE LIST OF BILLING PLANS 42

Page 44: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 within one major version. However, a new major version might include changes that are not backward compatible with the previous one.

BILLING PLANS - GET THE LIST OF BILLING PLANS 43

Page 45: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

1 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 44

Page 46: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

2 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 45

Page 47: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

3 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.

503 Service Unavailable

The request cannot be handled currently, due to a temporary overloading or maintenance of the server. This condition is temporary and the request will be handed after a certain delay.

BILLING PLANS - GET THE LIST OF BILLING PLANS 46

Page 48: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

4 FORMATTING AND NAMING CONVENTIONS

The table below represents all the existing formatting and naming conventions used in this 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.

infoAn info message emphasizes or explains the information within the chapter.

Clicking the OFF button performs graceful shutdown and then powers off the VS.

noteA note message contains information essential for the task completion. The maximum length of a Mount

Point is 256 characters.

warningA 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 47

Page 49: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

5 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 *.

BILLING PLANS - GET THE LIST OF BILLING PLANS 48

Page 50: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

6 ONAPP 5.0

Added Added API for vCloud Director funtionalities

Added Get List of Edge Gateway Interfaces section

Added Databases chapter

Added Usage Trends Statistics section

Added Purge All Content section

Added Purge File(s) section

Added Get Master Template/Master Bucket Details section

Updated Added information that the limit parameter for the VmLimit resource in the billing plan now also

affects VSs created in Federation to the following docs:

o Edit Base Resources

o Add User VS Limits

Updated Company Billing Plans chapter: added parameters for Pay As You Go resource pool type, vCPU speed and for used disk size

Updated Get Billing Statistics for Resource Pool section with the following parameters: cost, compute zone, deployed_org_networks, data_store_zone_id, network_zone_id, cpu_limit, memory_limit

Added information on the output related to resources in the master template:

o Get List of Base Resources

o Get Base Resources Details

Updated the description of the archive_stats_period parameter in the following docs:

o View System Configuration

o Edit System Configuration

Updated Add VS section: updated description of the rate_limit parameter

Updated Change VS Owner section: added info about error message

Added information on vApp statuses:

o Get List of vApps

o Get vApp Details

BILLING PLANS - GET THE LIST OF BILLING PLANS 49

Page 51: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Updated Get List of Company Monthly Bills: added an API request to view monthly bills for a particular year

Added information on how to get status/stop/start/reload OnApp Engine on a particular node to the following docs:

o Get OnApp Engine Status

o Start OnApp Engine

o Stop OnApp Engine

o Reload OnApp Engine

BILLING PLANS - GET THE LIST OF BILLING PLANS 50

Page 52: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

7 ADD ZABBIX SERVER

To add a Zabbix server to your system, use the following request:POST /sysadmin_tools/infrastructure/zabbix_setup.xmlPOST /sysadmin_tools/infrastructure/zabbix_setup.json

If you already have a Zabbix server, you can connect it to your cloud. For more information, see Edit System Configuration.

XML Request example

curl -i -X POST http://onapp.test/sysadmin_tools/infrastructure/zabbix_setup.xml -d '<zabbix_setup><ip_address>1.2.3.4</ip_address></zabbix_setup>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST http://onapp.test/sysadmin_tools/infrastructure/zabbix_setup.json -d '{"zabbix_setup":{"ip_address": "1.2.3.4"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:ip_address - the IP address of the server on which OnApp will automatically configure Zabbix. It can be either a physical server or a virtual one.

BILLING PLANS - GET THE LIST OF BILLING PLANS 51

Page 53: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

8 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.xmlGET /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 resourcezombie_transactions - transactions, which have "running" status, but their PIDs do not exist in the systemzombie_disks - disks, whick exist on data stores, but are not in the databasezombie_domains - an array of zombie VSs, which are running on a compute resource, but are not in the DB

BILLING PLANS - GET THE LIST OF BILLING PLANS 52

Page 54: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

9 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 have up & running various PHP/Perl/Python frameworks (like Drupal, Joomla, Wordpress etc.) on a server using web interface.

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 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

9.1 Create Application ServerTo create an application server, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 53

Page 55: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /application_servers.xmlPOST /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><hypervisor_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</primary_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_address_assignment>1</required_ip_address_assignment><rate_limit>0</rate_limit><required_virtual_machine_build>1</required_virtual_machine_build></application_server>' --url http://onapp.test/application_servers.xml

JSON Request example

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 54

Page 56: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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_package_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> <storage_server_type nil="true"/> <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

BILLING PLANS - GET THE LIST OF BILLING PLANS 55

Page 57: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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> <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 server is added to marketplace. The default value is "false". This parameter is for CDN servers only.admin_note - administrator comment for the VSallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebooted - true, if the VS is boothed, otherwise falsebuilt - true, if the VS is built, otherwise falsecpu_shares - the percentage of allocated CPU priority resourcecpu_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 grantedcpu_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 grantedcpu_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 VScreated_at – the date when the VS was created in the [YYYY][MM][DD]T[hh][mm][ss] formatupdated_at – the date when the VS was updated in the [YYYY][MM][DD]T[hh][mm][ss] format

BILLING PLANS - GET THE LIST OF BILLING PLANS 56

Page 58: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

customer_network_id - ID of the customer networkedge_server_type - type of the CDN edge server. This parameter is for CDN servers only.enable_autoscale — true if autoscaling is allowed for this VSenable_monitis - deprecated attributefirewall notrack - parameter for adding firewall rules. It is true for edge servers only.hostname - VS hostnamehypervisor_id – the ID of the compute resource, on which the server is deployedid – the VS ID in OnApp CP databaseidentifier – the VS identifierinstance_package_id - ID of the instance packageiso_id - ID of the ISO you want to uselabel - user-friendly VS descriptionlocal_remote_access_ip_address - IP address for remote connectionlocal_remote_access_port - port for remote connectionlocked - true if the VS is locked; otherwise falsememory - the RAM size allocated to this VSmin_disk_size — the minimum disk size required to build a VS from a specified templatenote - optional noteoperating_system — operating system used by the VSoperating_system_distro — the distribution of the OS from which this VS is builtpreferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settingsrate_limit - the port speed. The minimum recommended speed is 10Mbps (if allowed by your billing plan)recovery_mode - true if recovery mode allowed, otherwise falseremote_access_password — the password for the remote accessservice_password - password of a service userstate – application server statestorage_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 VSsuspended - true if VS is suspended, otherwise falsetemplate_id - the ID of the template the VS is based ontemplate_label - the name of the template from which this VS is builttime_zone – the time zone of the useruser_id — the ID of a user assigned to this VSvip — true if the VS has VIP status (gives migration priority)xen_id — the VS ID set by the virtualization engineip_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 57

Page 59: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

9.1.1 Page Historyv.4.2

Removed initial_root_password and initial_root_password_encrypted parameters as they are not required and skipped when creating an application server

BILLING PLANS - GET THE LIST OF BILLING PLANS 58

Page 60: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10 APPS FOR APPLICATION SERVERS

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.

10.1 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.xmlGET /application_servers/:application_server_id/applications.jsonXML 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.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.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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 59

Page 61: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</application></applications>

Where:admin_url - this URL is a link for administrator, where they can enter credentials to log into applicationapplication_type - the name of applicationid - the ID of an applicationsoftware_url - this URL is a link to the application itselfsoftware_version - the version of the application software installed

10.2 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.xmlGET /application_servers/:application_server_id/applications/available.jsonXML 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.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/available.json'

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 60

Page 62: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 featuresname - the standard name of an applicationscript_id - the ID of an application in the list of all applications, available for installationsoftware_version - the version of application software

10.3 Get Application AttributesTo 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.xmlGET /application_servers/:application_server_id/script/script_id.jsonXML 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.xml

JSON Request example

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.json

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 61

Page 63: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 featuresname - the standard name of an applicationscript_id - the ID of an application in the list of all applications, available for installationsoftware_version - the version of application software

10.4 Install ApplicationTo install application:POST /application_servers/:application_server_id/applications.xmlPOST /application_servers/:application_server_id/applications.jsonXML 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>[email protected]</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": "[email protected]"}}'

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 label of the directory should contain only lowercase characters.

The following parameters depend on the type of an application:admin_username - the username of an administrator, who wants to install an application

BILLING PLANS - GET THE LIST OF BILLING PLANS 62

Page 64: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

admin_pass - the password of an administrator, who wants to install an applicationadmin_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.

10.5 Back Up ApplicationTo back up an application:POST /application_servers/:application_server_id/applications/:id/backup.xmlPOST /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/:application_id/backup.xml -d '<backup><application_id>1_31528</application_id><backup_directory>1</backup_directory><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/:application_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 0backup_database - set 1 to back up database, otherwise set 0note - 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 63

Page 65: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

back up particular part of an application.

10.6 Delete ApplicationTo delete an application:DELETE /application_servers/:application_server_id/applications/:id.xmlDELETE /application_servers/:application_server_id/applications/:id.jsonXML Request example

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_directory><remove_database>1</remove_database><remove_database_user>1</remove_database_user></application>'

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 applicationremove_database_user - set 1 to remove database user, otherwise set 0remove_database - set 1 to remove database, otherwise set 0remove_directory - set 1 to remove directory, otherwise set 0remove_data_directory - set 1 to remove data directory, otherwise set 0

BILLING PLANS - GET THE LIST OF BILLING PLANS 64

Page 66: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10.7 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.xmlGET /application_servers/:application_server_id/applications/backups.jsonXML 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.json'

XML Output example

<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

BILLING PLANS - GET THE LIST OF BILLING PLANS 65

Page 67: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

application_type - the name of the application, which was backed upbackup_note - the note, that was written during backup creationidentifier - identifier of the application backupsoftware_url - this URL is a link to application itselfsoftware_version - the version of application softwaresize - backup size

10.8 Restore Application BackupTo restore application backup:POST /application_servers/:application_server_id/applications/backups/:identifier/restore.xmlPOST /application_servers/:application_server_id/applications/backups/:identifier/restore.jsonXML 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/:application_id/backups/:identifier/restore.xml -d '<backup><restore_directory>1</restore_directory><restore_database>1</restore_database></backup>'

JSON Request example

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/:application_id/backups/:identifier/restore.json -d '{"backup": {"restore_directory": "1", "restore_database": "1"} }'

Where:restore_directory - set 1 to restore directory, otherwise set 0restore_database - set 1 to restore database, otherwise set 0identifier - identifier of the application backup. It can be found using the Get List of All Application Backups request.

BILLING PLANS - GET THE LIST OF BILLING PLANS 66

Page 68: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10.9 Remove Application BackupTo remove application backup:DELETE /application_servers/:application_server_id/applications/backups/:identifier/destroy.xmlDELETE /application_servers/:application_server_id/applications/backups/:identifier/destroy.jsonXML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/application_servers/:application_server_id/applications/backups/:identifier/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/:identifier/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.

10.10 System ApplicationsThere are system applications within an application server. You can install or switch PHP versions by means of system applications.

10.10.1 Get List of System ApplicationsTo get the list of system applications, use the following request:GET /application_servers/:application_server_id/system_apps.xmlGET /application_servers/:application_server_id/system_apps.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 67

Page 69: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/application_servers/:application_server_id/system_apps.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/system_apps.json

XML Output example

<system_apps type="array"><system_app><api_name>php54</api_name><default type="boolean">true</default><id>2</id><installed type="boolean">true</installed><name>PHP 5.4</name><version>5.4.45</version></system_app><system_app>...</system_app></system_apps>

Where:api_name - the API name of a system applicationid - the ID of a system applicationname - the name of a system applicationversion - the version number of a system application

10.10.2 Install System ApplicationTo install a system application:PUT /application_servers/:application_server_id/system_apps/system_app_id/install.xmlPUT /application_servers/:application_server_id/system_apps/system_app_id/install.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/system_apps/system_app_id/install.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 68

Page 70: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/system_apps/system_app_id/install.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:application_server_id* - the ID of an application server where you want to install a system applicationsystem_app_id* - the ID of the system application which you want to install

You can get system application ID with the Get List of System Applications API request.

10.10.3 Switch PHP VersionTo switch a PHP version:PUT /application_servers/:id/settings/switch_php_version.xmlPUT /application_servers/:id/settings/switch_php_version.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:id/settings/switch_php_version.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<php_version>php55</php_version>'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:id/settings/switch_php_version.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"php_version":"php55"}'

Where:php_version* - the name of PHP version to which you want to switch

10.10.4 Uninstall System ApplicationTo uninstall a system application:PUT /application_servers/:application_server_id/system_apps/system_app_id/uninstall.xmlPUT /application_servers/:application_server_id/system_apps/system_app_id/uninstall.jsonXML Request example

curl -i -X PUT -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 69

Page 71: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/application_servers/:application_server_id/system_apps/system_app_id/uninstall.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/system_apps/system_app_id/uninstall.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:application_server_id* - the ID of an application server where you want to uninstall a system applicationsystem_app_id* - the ID of the system application which you want to uninstall

You can get system application ID with the Get List of System Applications API request.

10.11 DomainsThis section contains the API requests you can apply to manage Application Server domains.

10.11.1 Get List of DomainsTo get the list of application server domains, use the following request:GET /application_servers/:application_server_id/domains.xmlGET /application_servers/:application_server_id/domains.jsonXML 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/domains.xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 70

Page 72: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/domains.json'

XML Output example

<domains type="array"><domain><identifier>3dd0d7734983e2db8ba7677bd5b11a70</identifier><name>domain_name</name><path>/home/onapp/public_html</path><type>primary</type></domain> <domain>...</domain></domains>

Where:identifier - the domain's identifiername - the name of the domainpath - the route to the domain foldertype - the type of the domain

10.11.2 Create DomainTo create a domain, use the following request:POST /application_servers/:application_server_id/domains.xmlPOST /application_servers/:application_server_id/domains.json

There are several options for domain creation: Addon domain creation with custom path Domain addition to an existing application Creation of parked domain

10.11.2.1 Addon domain creation with custom pathXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<domain><path>ZikulaTest</path><domain>addon.com</domain></domain>'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 71

Page 73: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"domain": {"path": "ZikulaTest","domain": "addon.com"}}'

Where:domain - specify the name of the domain

path - indicate the route to domain folder

10.11.2.2 Domain addition to an existing applicationXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains.xml 'Accept: application/xml' -H 'Content-type: application/xml' -d '<domain><domain>existed.com</domain><application_id>None</application_id></domain>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains.json 'Accept: application/json' -H 'Content-type: application/json' -d '{"domain": {"domain": "existed.com","application_id": null}}'

Where:domain - the name of the domain

application_id - the ID of an application to which you want to add the domain

10.11.2.3 Creation of parked domainXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains

BILLING PLANS - GET THE LIST OF BILLING PLANS 72

Page 74: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

.xml 'Accept: application/xml' -H 'Content-type: application/xml' -d '<domain><domain>parked.com</domain><application_id>Null</application_id></domain>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/domains.json 'Accept: application/json' -H 'Content-type: application/json' -d '{"domain": {"domain": "parked.com","application_id": null}}'

Where:domain - the name of the domain

10.11.3 Delete DomainTo delete a domain:DELETE /application_servers/:application_server_id/domains/:domain_identifier.xmlDELETE /application_servers/:application_server_id/domains/:domain_identifier.jsonXML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/domains/:domain_identifier.xml

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/domains/:domain_identifier.json

Where:domain_identifier - the identifier of the domain you want to delete.

You can check identifier of the required domain with GET method:GET /application_servers/:application_server_id/domains.xmlGET /application_servers/:application_server_id/domains.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 73

Page 75: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10.12 FTP UsersThis section contains the API requests you can apply to manage FTP users.

10.12.1 Get List of FTP UsersTo get the list of FTP users, use the following request:GET /application_servers/:application_server_id/ftp_users.xmlGET /application_servers/:application_server_id/ftp_users.jsonXML 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/ftp_users.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/ftp_users.json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><ftp_users type="array"> <ftp_user> <identifier>eb9baa2fdc5043e4535a17862e5f2ab5</identifier> <login>onapp</login> <path>/home/onapp</path> <usage type="integer">0</usage> </ftp_user> <ftp_user> <identifier>0fd3345dcc4b4c20b46f8ee33f52ba75</identifier> <login>test_onapp.test</login> <path>/home/onapp/www/test</path> <usage type="integer">0</usage>

BILLING PLANS - GET THE LIST OF BILLING PLANS 74

Page 76: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</ftp_user> <ftp_user>...</ftp_user></ftp_users>

Where:identifier - the user's identifierlogin - the user's login namepath - the route to FTP folderusage - the amount of FTP folder space, used by this user (in MB)

10.12.2 Create FTP UserTo create an FTP user, use the following request:POST /application_servers/:application_server_id/ftp_users.xmlPOST /application_servers/:application_server_id/ftp_users.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/ftp_users.xml 'Accept: application/xml' -H 'Content-type: application/xml' -d '<ftp_user><password>1234</password><password_confirmation>1234</password_confirmation><login>login364</login><path>www/usr2</path></ftp_user>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/ftp_users.json 'Accept: application/json' -H 'Content-type: application/json' -d '{"ftp_user": {"password": "1234", "password_confirmation": "1234", "login": "login364", "path": "www/usr2"}}'

Where:password - create user's passwordpassword_confirmation - enter user's password one more timelogin - provide user's login namepath - indicate the route to FTP folder

10.12.3 Delete FTP UserTo delete an FTP user:DELETE /application_servers/:application_server_id/ftp_users/:ftp_user_identifier.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 75

Page 77: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DELETE /application_servers/:application_server_id/ftp_users/:ftp_user_identifier.jsonXML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/ftp_users/:ftp_user_identifier.xml

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/application_servers/:application_server_id/ftp_users/:ftp_user_identifier.json

Where:ftp_user_identifier - the identifier of the user you want to delete.

You can check identifier of the required FTP user with GET method:GET /application_servers/:application_server_id/ftp_users.xmlGET /application_servers/:application_server_id/ftp_users.json

10.13 DatabasesThis section contains the API requests you can apply to manage databases available for your Application Server.

10.13.1 Get List of DatabasesTo get the list of databases, use the following request:GET /application_servers/:application_server_id/databases.xmlGET /application_servers/:application_server_id/databases.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 76

Page 78: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'http://onapp.test/application_servers/:application_server_id/databases.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/databases.json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><databases type="array"> <database> <db>Test1</db> </database> <database> <db>cmfsfs</db> </database></databases>

Where:db - the name of the database

10.13.2 Create DatabaseTo create a database, use the following request:POST /application_servers/:application_server_id/databases.xmlPOST /application_servers/:application_server_id/databases.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/databases.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database><db>Test1</db></database>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/databases.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database": {"db":"Test1"}}'

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 77

Page 79: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

db - the name of the database

10.13.3 Delete DatabaseTo delete a database:DELETE /application_servers/:application_server_id/databases/:db.xmlDELETE /application_servers/:application_server_id/databases/:db.jsonXML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url 'http://onapp.test/application_servers/:application_server_id/databases/:db.xml'

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url 'http://onapp.test/application_servers/:application_server_id/databases/:db.json'

Where:db- the name of the database you want to delete.

You can check name of the required database with GET method:GET /application_servers/:application_server_id/databases.xmlGET /application_servers/:application_server_id/databases.json

10.13.4 Get List of Database UsersTo get the list of database users, use the following request:GET /application_servers/:application_server_id/database_users.xmlGET /application_servers/:application_server_id/database_users.jsonXML 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/database_users.xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 78

Page 80: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/database_users.json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><database_users type="array"> <database_user> <name>user</name> </database_user> <database_user> <name>cmfsfs</name> </database_user></database_users>

Where:name - the name of the database user

10.13.5 Get List of Users Assigned to DatabaseTo get the list of users assigned to a certain database and their permissions, use the following request:GET /application_servers/:application_server_id/databases/:db/privileges.xmlGET /application_servers/:application_server_id/databases/:db/privileges.jsonXML 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/databases/:db/privileges.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/databases/:db/privileges.json'

Where:db - the name of the required databaseXML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 79

Page 81: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?xml version="1.0" encoding="UTF-8"?><database_users type="array"> <database_user> <prilist> <DELETE>false</DELETE> <SHOW_VIEW>false</SHOW_VIEW> <HOST>localhost</HOST> <DROP>false</DROP> <CREATE>false</CREATE> <CREATE_VIEW>false</CREATE_VIEW> <EXECUTE>false</EXECUTE> <TRIGGER>false</TRIGGER> <INDEX>false</INDEX> <CREATE_ROUTINE>false</CREATE_ROUTINE> <CREATE_TEMPORARY_TABLES>false</CREATE_TEMPORARY_TABLES> <LOCK_TABLES>false</LOCK_TABLES> <REFERENCES>false</REFERENCES> <SELECT>true</SELECT> <INSERT>false</INSERT> <UPDATE>false</UPDATE> <ALTER>false</ALTER> </prilist> <name>test_db</name> </database_user> </database_users>

Where:prilist - the list of privileges (permissions) assigned to the database user.Below you can find the list of privileges:SELECTCREATEINSERTUPDATEALTERDELETEINDEXCREATE_TEMPORARY_TABLESEXECUTEDROPLOCK_TABLESREFERENCESCREATE_ROUTINECREATE_VIEWSHOW_VIEWTRIGGERname - the name of the database user

BILLING PLANS - GET THE LIST OF BILLING PLANS 80

Page 82: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

10.13.6 Create Database UserTo create a database user, use the following request:POST /application_servers/:application_server_id/database_users.xmlPOST /application_servers/:application_server_id/database_users.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database_user><name>user</name><password>pass</password></database_user>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database_user": {"name": "user", "password": "pass"}}'

Where:name - the name of the database user

The length of name should not exceed 11 characters.

password - the password for the database user

10.13.7 Assign User to DatabaseTo assign user to a database, use the following request:POST /application_servers/:application_server_id/databases/:db/assign_user.xmlPOST /application_servers/:application_server_id/databases/:db/assign_user.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/databases/:db/assign_user.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database><db_user>user</db_user><host>localhost</host><prilist><SELECT>true</SELECT></prilist></database>'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 81

Page 83: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -u user:userpass http://onapp.test/application_servers/:application_server_id/databases/:db/assign_user.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database": {"db_user": "user", "host": "localhost", "prilist":{"SELECT":true}}}'

Where:db - the name of the database to which you want to assign usersdb_user - the name of the database userprilist - the list of privileges (permissions) which you want to assign to the database user. Set `true` to the specific privilege to assign it to the user.Below you can find the list of privileges:SELECTCREATEINSERTUPDATEALTERDELETEINDEXCREATE_TEMPORARY_TABLESEXECUTEDROPLOCK_TABLESREFERENCESCREATE_ROUTINECREATE_VIEWSHOW_VIEWTRIGGER host - indicate a host name for the database. There are several options of host names: localhost - specify this parameter to choose a local host name % - specify this parameter to choose any host name 27.0.0.1 - specify any IP Address

10.13.8 Update Database User PrivilegesTo update a database user privileges, use the following request:PUT /application_servers/:application_server_id/database_users/:name/privileges.xmlPUT /application_servers/:application_server_id/database_users/:name/privileges.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/databas

BILLING PLANS - GET THE LIST OF BILLING PLANS 82

Page 84: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

e_users/:name/privileges.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database_user><db_name>label</db_name><host>localhost</host><prilist><SELECT>true</SELECT></prilist></database_user>'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users/:name/privileges.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database_user": {"db_name": "label", "host": "localhost", "prilist":{"SELECT":true}}}'

Where:db_name - the name of the databaseprilist - the list of privileges (permissions) which you want to assign to the database user. Put `true` next to the specific privilege to assign it to the user.Below you can find the list of privileges:SELECTCREATEINSERTUPDATEALTERDELETEINDEXCREATE_TEMPORARY_TABLESEXECUTEDROPLOCK_TABLESREFERENCESCREATE_ROUTINECREATE_VIEWSHOW_VIEWTRIGGERhost - indicate a host name for the database. There are several options of host names: localhost - specify this parameter to choose a local host name % - specify this parameter to choose any host name 27.0.0.1 - specify any IP Address

10.13.9 Change Database User PasswordTo change a database user password, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 83

Page 85: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /application_servers/:application_server_id/database_users/:name/change_password.xmlPUT /application_servers/:application_server_id/database_users/:name/change_password.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users/:name/change_password.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database_user><password>newpass</password></database_user>'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users/:name/change_password.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database_user": {"password": "newpass"}}'

Where:password - the password for the database user

10.13.10 Unassign User from DatabaseTo unassign user from a database, use the following request:PUT /application_servers/:application_server_id/database_users/:name/privileges.xmlPUT /application_servers/:application_server_id/database_users/:name/privileges.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users/:name/privileges.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<database_user><db_name>label</db_name></database_user>'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/application_servers/:application_server_id/database_users/:name/privileges.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"database_user": {"db_name":

BILLING PLANS - GET THE LIST OF BILLING PLANS 84

Page 86: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"label"}}'

Where:db_name - the name of the database

10.13.11 Delete Database UserTo delete a database user:DELETE /application_servers/:application_server_id/database_users/:name.xmlDELETE /application_servers/:application_server_id/database_users/:name.jsonXML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url 'http://onapp.test/application_servers/:application_server_id/database_users/:name.xml'

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url 'http://onapp.test/application_servers/:application_server_id/database_users/:name.json'

Where:name- the name of the database user you want to delete.

You can check name of the required database user with GET method:GET /application_servers/:application_server_id/database_users.xmlGET /application_servers/:application_server_id/database_users.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 85

Page 87: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

11 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 Lіst of Unassigned Assets request.

11.1 Get List of AssetsUse the following API call to view the list of assets:GET hypervisors/settings/assets.xmlGET hypervisors/settings/assets.jsonTo view the list of assets that are already created but not assigned to the compute zone, use the Get Lіst of Unassigned Assets API callXML 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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 86

Page 88: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

11.2 Get Asset DetailsUse the following API call to view the list of assets:GET /settings/assets/:asset_mac_address.xmlGET /settings/assets/:asset_mac_address.jsonXML 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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 87

Page 89: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<pci>02:01.0</pci> </pci> </pcis></asset>

Where:mac - asset MAC addressdisk - 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

11.3 Get Lіst of Unassigned AssetsUse the following API call to view the list of assets:GET hypervisors/not_grouped.xmlGET hypervisors/not_grouped.jsonXML 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

<?xml version="1.0" encoding="UTF-8"?><hypervisors type="array"> <hypervisor> <backup type="boolean">false</backup>

BILLING PLANS - GET THE LIST OF BILLING PLANS 88

Page 90: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 89

Page 91: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<free_disk_space><onapp-fv4zl7t2h5wbeq type="integer">184</onapp-fv4zl7t2h5wbeq></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> </hypervisors></hypervisors>

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 falsebuilt - 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 formatconnection_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 90

Page 92: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_info 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 91

Page 93: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 92

Page 94: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12 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.

12.1 Auto-backup PresetsAuto-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 parameter is enabled during VS creation.

12.1.1 Get List of Auto-backup PresetsTo get the list of available auto-backup presets, use the following request:GET /settings/autobackup_presets.xmlGET /settings/autobackup_presets.jsonAn array of auto-backup presets is returned. If there are no presets, an empty array is returned.XML Output example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 93

Page 95: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 takencreated at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatperiod - 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 formatenabled - true if the auto-backup preset is enabled, otherwise false.id - the ID of the auto-backup preset

12.1.2 Get Auto-backup Preset DetailsThis method will output the details for a particular auto-backup preset.GET /settings/autobackup_presets/:id.xmlGET /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 takencreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatperiod - 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 formatenabled - set True if auto-backup preset is enabled, otherwise Falseid - edit an auto-backup preset ID

12.1.3 Edit Auto-backup PresetTo edit an auto-backup preset, use the following method:

BILLING PLANS - GET THE LIST OF BILLING PLANS 94

Page 96: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /settings/autobackup_presets/:id.xmlPUT /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="UTF-8"?><autobackup_template><duration>5</duration><period>days</period><enabled>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 takenenabled - 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.

12.2 Manage Auto-BackupsAuto-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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 95

Page 97: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.2.1 Enable auto-backups for VSTo enable incremental auto-backups for a Virtual Server:POST /virtual_machines/:id/autobackup_enable.xmlPOST /virtual_machines/:id/autobackup_enable.jsonXML 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

12.2.2 Disable auto-backups for VSTo disable incremental auto-backups for a Virtual Server:POST /virtual_machines/:id/autobackup_disable.xmlPOST /virtual_machines/:id/autobackup_disable.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 96

Page 98: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.2.3 Enable Auto-backups for DiskYou can enable auto-backups for a disk using the following methods:POST /settings/disks/:disk_id/autobackup_enable.xmlPOST /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

12.2.4 Disable Auto-backups for DiskTo disable auto-backups for a disk, use the following method:POST /settings/disks/:id/autobackup_disable.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 97

Page 99: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.3 SchedulesSchedules 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.

12.3.1 Get List of All SchedulesThis 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.xmlGET /settings/schedules.jsonXML 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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 98

Page 100: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 formatupdated_at - the date when a schedule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatstart_at - the date when a backup started in the [YYYY][MM][DD]T[hh][mm][ss]Z formatduration - how often a backup is takenfailure_count - the number of requests processed until the task failsid - schedule IDperiod - time period for a backup schedule (days, weeks, months, or years)rotation_period - number of backups after which the first backup will be deletedtarget_id - the disk ID for which a backup is takentarget_type - currently, you can schedule backup of Disks onlyuser_id - the ID of a user who created this schedulefailure_count - the number of requests processed until the task failsstatus - 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 99

Page 101: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.3.1.1 Page historyv3.2

Added the following parameters:

rotation_period

12.3.2 Get Schedule DetailsUse this method to get details for a particular disk backup schedule:GET /settings/schedules/:id.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 100

Page 102: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:action – backup type created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when a schedule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatstart_at - the date when a backup started in the [YYYY][MM][DD]T[hh][mm][ss]Z formatduration - how often a backup is takenfailure_count - the number of requests processed until the task failsid - schedule IDperiod - time period for a backup schedule (days, weeks, months, or years)rotation_period - number of backups after which the first backup will be deletedtarget_id - the disk ID for which a backup is takentarget_type - currently, you can schedule backup of Disks onlyuser_id - the ID of a user who created this schedulefailure_count - the number of requests processed until the task failsstatus - 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

12.3.2.1 Page historyv3.2

Added the following parameters:

rotation_period

12.3.3 Get List of Schedules for a DiskTo get a list of schedules for a particular disk, use the following methods:GET /settings/disks/:disk_id/schedules.xmlGET /settings/disks/:disk_id/schedules.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><schedules><schedule><duration>1</duration>

BILLING PLANS - GET THE LIST OF BILLING PLANS 101

Page 103: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 takentarget_id – ID of the action targetperiod - the time period (days, weeks, months, or years)action – the action performedstart_at – time, when the action startsid – schedule iduser_id – ID of the disk (action target) userschedule_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 102

Page 104: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.3.4 Get List of Virtual Server SchedulesTo get a list of schedules for a particular virtual server, use the following methods:GET /virtual_machines/:id/schedules.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 103

Page 105: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <schedule_logs type="array"> <schedule_log> <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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 104

Page 106: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <updated_at type="datetime">2014-01-20T14:24:04+02:00</updated_at> </schedule_log> </schedule_logs> </schedule></schedules>

Where:duration - the number specifying how often a backup should be takentarget_id – ID of the action targetperiod - the time period (days, weeks, months, or years)

BILLING PLANS - GET THE LIST OF BILLING PLANS 105

Page 107: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

action – the action performedstart_at – time, when the action startsid – schedule iduser_id – ID of the disk (action target) userschedule_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

12.3.5 Add Schedule to DiskYou can add a schedule to a disk using the following method:POST /settings/disks/:disk_id/schedules.xmlPOST /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><rotation_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 scheduleduration* - specify durationperiod* - set the period (days/weeks/months)rotation_period - number of backups after which the first backup will be deletedstatus* - set enabled to activate a schedule.start_at - set the time when backup scheduling transaction will be created.

BILLING PLANS - GET THE LIST OF BILLING PLANS 106

Page 108: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

12.3.5.1 Page historyOnApp 3.5:

start_at

OnApp 3.2:

rotation_period

12.3.6 Add Schedule to Virtual ServerTo add incremental backup schedule to a virtual server:POST /virtual_machines/:virtual_machine_id/schedules.xmlPOST /virtual_machines/:virtual_machine_id/schedules.jsonXML 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_period><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 takenperiod* - time period for a backup schedule (days, weeks, months, or years)rotation_period - number of backups after which the first backup will be deletedenabled - set 0 to deactivate a schedule. This parameter is activated (set to 1) by default.action* - specify an action for the schedule (e.g. - autobackup)start_at - set the time when backup scheduling transaction will be created.

12.3.6.1 Page historyOnApp 3.5:

start_at

BILLING PLANS - GET THE LIST OF BILLING PLANS 107

Page 109: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

OnApp 3.2:

rotation_period

12.3.7 Edit Disk ScheduleTo edit disk's schedule, use the following method:PUT /settings/schedules/:id.xmlPUT /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_period><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":"enabled","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 takenperiod* - time period for a backup schedule (days, weeks, months, or years)rotation_period - number of backups after which the first backup will be deletedstatus* - set enabled to activate a schedule.start_at - set the time when backup scheduling transaction will be created.

12.3.7.1 Page historyOnApp 3.5:

start_at

OnApp 3.2:

rotation_period

12.3.8 Edit Virtual Server ScheduleTo edit virtual server's incremental backup schedule, use the following method:PUT /virtual_machines/:id/schedules/:schedule_id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 108

Page 110: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /virtual_machines/:id/schedules/:schedule_id.jsonXML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -uuser:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.xml-d '<schedule><duration>6</duration><period>weeks</period><rotation_period>5</rotation_period><enabled>1</enabled><action>autobackup</action><start_at>2014-11-12 10:36</start_at></schedule>'

JSON Request example

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 takenperiod* - time period for a backup schedule (days, weeks, months, or years)rotation_period - number of backups after which the first backup will be deletedstatus* - set enabled to activate a schedule.start_at - set the time when backup scheduling transaction will be created.

12.3.8.1 Page historyOnApp 3.5:

start_at

OnApp 3.2:

rotation_period

12.3.9 Delete Disk ScheduleDELETE /settings/schedules/:id.xmlDELETE /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 109

Page 111: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

12.3.10 Delete Virtual Server ScheduleDELETE /settings/schedules/:id.xmlDELETE /settings/schedules/:id.json XML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -uuser:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.xml

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type: application/json' -uuser:password --url http://onapp.test/virtual_machines/:id/schedules/:schedule_id.json

Where you have to specify backup server ID and schedule ID.

BILLING PLANS - GET THE LIST OF BILLING PLANS 110

Page 112: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

13 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.

13.1 Get List of All VS BackupsGET /virtual_machines/:virtual_machine_id/backups.xmlGET /virtual_machines/:virtual_machine_id/backups.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 111

Page 113: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 upallowed_hot_migrate – true if hot migration is allowed for the storage server backed upallowed_swap – true if swap disk is allowed for storage server backed up, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 112

Page 114: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

backup_server_id – the ID of the backup server on which the backup is storedbackup_size – the disk space taken by this backup in kBbackup_type – normal or incrementalbuilt – true if the storage server backed up has been builtbuilt_at – the date when the disk backup was builtcreated_at – the date when the record in the database was createdupdated_at – the date when this record in database was updateddata_store_type - data store type: lvm, vmware or solidfireid – the ID of this backupidentifier - disk identifierimage_type - backup type (currently only tar is available)initiated - period when backup is initiated: days, weeks, months, or yearslocked – true if the storage server backed up has been lockedmarked_for_delete – the backup is marked for deletion (for auto-backups)min_disk_size – the minimum disk sizeoperating_system_distro – the OS distribution of the storage server backed upoperating_system – the OS of the storage server backed uptarget_id - ID of a backup targettarget_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 builtuser_id - the ID of a user the storage server belongs tovolume_id - data store IDSolidFire - related parameters:iqn - volume ISCSI qualified name

13.2 Get List of Normal BackupsGET /virtual_machines/:virtual_machine_id/backups/images.xmlGET /virtual_machines/:virtual_machine_id/backups/images.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 113

Page 115: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 114

Page 116: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Explanation of the data returned:

allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed upallowed_hot_migrate – true if hot migration is allowed for the storage server backed upallowed_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 storedbackup_size – the disk space taken by this backup in kBbackup_type – normal or incrementalbuilt – true if the storage server backed up has been builtbuilt_at – the date when the disk backup was builtcreated_at – the date when the record in the database was createdupdated_at – the date when this record in database was updateddata_store_type - data store type: lvm, vmware or solidfireid – the ID of this backupidentifier - disk identifierimage_type - backup type (currently only tar is available)initiated - period when backup is initiated: days, weeks, months, or yearslocked – true if the storage server backed up has been lockedmarked_for_delete – the backup is marked for deletion (for auto-backups)min_disk_size – the minimum disk sizeoperating_system_distro – the OS distribution of the storage server backed upoperating_system – the OS of the storage server backed uptarget_id - ID of a backup targettarget_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 builtuser_id - the ID of a user the storage server belongs tovolume_id - data store IDSolidFire - related parameters:iqn - volume ISCSI qualified name

13.3 Get List of Incremental BackupsGET /virtual_machines/:virtual_machine_id/backups/files.xmlGET /virtual_machines/:virtual_machine_id/backups/files.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 115

Page 117: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

.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

<?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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 116

Page 118: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</backup></backups>

Explanation of the data returned:

allowed_resize_without_reboot – true if resizing CPU & RAM is allowed without restarting the storage server backed upallowed_hot_migrate – true if hot migration is allowed for the storage server backed upallowed_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 storedbackup_size – the disk space taken by this backup in kBbackup_type – normal or incrementalbuilt – true if the storage server backed up has been builtbuilt_at – the date when the disk backup was builtcreated_at – the date when the record in the database was createdupdated_at – the date when this record in database was updateddata_store_type - data store type: lvm, vmware or solidfireid – the ID of this backupidentifier - disk identifierimage_type - backup type (currently only tar is available)initiated - period when backup is initiated: days, weeks, months, or yearslocked – true if the storage server backed up has been lockedmarked_for_delete – the backup is marked for deletion (for auto-backups)min_disk_size – the minimum disk sizeoperating_system_distro – the OS distribution of the storage server backed upoperating_system – the OS of the storage server backed uptarget_id - ID of a backup targettarget_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 builtuser_id - the ID of a user the storage server belongs tovolume_id - data store IDSolidFire - related parameters:iqn - volume ISCSI qualified name

13.4 Get List of Disk BackupsTo view the list of disk backups:

BILLING PLANS - GET THE LIST OF BILLING PLANS 117

Page 119: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /virtual_machines/:vm_id/disks/:disk_id/backups.xml GET /virtual_machines/:vm_id/disks/:disk_id/backups.jsonXML 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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 118

Page 120: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 upallowed_hot_migrate – true if hot migration is allowed for the storage server backed upallowed_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 storedbackup_size – the disk space taken by this backup in kBbackup_type – normal or incrementalbuilt – true if the storage server backed up has been builtbuilt_at – the date when the disk backup was builtcreated_at – the date when the record in the database was createdupdated_at – the date when this record in database was updateddata_store_type - data store type: lvm, vmware,solidfire orid – the ID of this backupidentifier - disk identifierimage_type - backup type (currently only tar is available)initiated - period when backup is initiated: days, weeks, months, or yearslocked – true if the storage server backed up has been lockedmarked_for_delete – the backup is marked for deletion (for auto-backups)min_disk_size – the minimum disk sizeoperating_system_distro – the OS distribution of the storage server backed upoperating_system – the OS of the storage server backed uptarget_id - ID of a backup targettarget_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 builtuser_id - the ID of a user the storage server belongs tovolume_id - data store IDSolidFire - related parameters:iqn - volume ISCSI qualified name

BILLING PLANS - GET THE LIST OF BILLING PLANS 119

Page 121: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

13.5 Create Incremental BackupTo 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 IDnote - optional backup note

13.6 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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 120

Page 122: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/settings/disks/:id/backups.json -d '{"backup":{"note":"manual backup", "force_windows_backup":"0"}}'

note - optional noteforce_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.

13.7 Create Backups for All Disks

The following request applies to configuration where normal backups are enabled for cloud, and will create backups for all disks.

To create backups/snapshots of all VS disks:POST /virtual_machines/:vm_id/backups.xmlPOST /virtual_machines/:vm_id/backups.jsonXML 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.

13.8 Convert Backup to TemplateYou 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.xmlPOST /backups/:backup_id/convert.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 121

Page 123: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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="UTF-8" ?><backup><label>template.label</label><min_disk_size>50</min_disk_size><min_memory_size>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 labelmin_disk_size - minimum disk size required in GB

min_memory_size - minimum RAM required for the template

13.9 Delete BackupTo delete a disk backup:DELETE /backups/:id.xmlDELETE /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 122

Page 124: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

13.10 Restore BackupYou can restore a disk from a backup, using the following method:POST /backups/:backup_id/restore.xmlPOST /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

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

13.11 Add/Edit Backup NoteUse 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 'Content-type: 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 123

Page 125: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

14 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.

14.1 Get List of Backup ServersGET /settings/backup_servers.xmlGET /settings/backup_servers.json Returns the array of backup servers.XML Output example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 124

Page 126: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 labelcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatbackup_server_group_id – the ID of a backup server group the backup server belongs toid – the backup server IDbackup_server_ip_address - provisioning network IP addressenabled – 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 upbuilt_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatoperating_system_distro – the OS distribution of the VS from which the backup was createdcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formattemplate_id – the ID of the template the VS is based onupdated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatbackup_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 falseid – the backup IDbackup_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 backupmin_disk_size – minimum disk size required for restoring a backupidentifier – the backup identifierlocked – true if the backup is being built, otherwise falsebuilt – true if the backup is already built, otherwise false

14.2 Get Backup Server DetailsThis method outputs the details for a particular backup server:

BILLING PLANS - GET THE LIST OF BILLING PLANS 125

Page 127: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /settings/backup_servers/:id.xmlGET /settings/backup_servers/:id.jsonXML Output example

<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 labelcreated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – the backup server ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 126

Page 128: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 onoperating_system – the operating system of the VA from which the backup was createdbackup_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 capacityip_address – the backup server IPbackup_server_ip_address - provisioning network IP address

To view the list of backups with their details, please refer to the Search Backups section.

14.3 Add Backup ServerTo create a backup server where users will be able to store backups and templates, send the following request:POST /settings/backup_servers.xmlPOST /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_address>172.0.0.1</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 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 labelip_address* – valid Ipv4 address

BILLING PLANS - GET THE LIST OF BILLING PLANS 127

Page 129: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

backup_server_ip_address - provisioning network IP addresscapacity* – set the backup server capacityenabled – 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>

14.4 Edit Backup ServerUse the following method to edit a backup server:PUT /settings/backup_server/:id.xmlPUT /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</capacity><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

BILLING PLANS - GET THE LIST OF BILLING PLANS 128

Page 130: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Accept: application/json' -H 'Content-type: application/json'

Where:label – backup server labelenabled – 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 capacityip_address* – valid Ipv4 addressbackup_server_ip_address - provisioning network IP addressYou 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.

14.5 Delete Backup ServerDELETE /settings/backup_servers/:id.xmlDELETE /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.

14.6 Search BackupsTo find a backup stored at a particular backup server, use the following request:GET /settings/backup_servers/:id/backups_search.xmlGET /settings/backup_servers/:id/backups_search.json You can set the following search parameters:

size – set the size [from] and [to] backup search parameters to search

BILLING PLANS - GET THE LIST OF BILLING PLANS 129

Page 131: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

backups by their sizedate – 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 datesand 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[to]=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&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\\[to\\]=300&period\\[startdate\\]=02/01/12&period\\[enddate]=02/24/2012&searching=az' -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 130

Page 132: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 upbuilt_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatoperating_system_distro – the OS distribution of the VS from which the backup was createdcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formattemplate_id – the ID of the template the VS is based onupdated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatbackup_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 falseid – the backup IDbackup_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 backupmin_disk_size – minimum disk size required for restoring a backup

BILLING PLANS - GET THE LIST OF BILLING PLANS 131

Page 133: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

identifier – the backup identifierlocked – true if the backup is being built, otherwise falsebuilt – true if the backup is already built, otherwise falseFor details refer to Get The List Of Backup Servers section.

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 section.

14.7 Create Cloud Boot Backup ServerTo create a backup server where users will be able to store backups and templats, send the following request:POST /settings/backup_servers.xmlPOST /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><backup>true</backup><ip_address>172.0.0.1</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 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 labelip_address* – IP address of a KVM compute resourcebackup - set true to create a Cloud Boot backup serverbackup_server_ip_address - provisioning network IP addresscapacity* – set the backup server capacity

BILLING PLANS - GET THE LIST OF BILLING PLANS 132

Page 134: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 133

Page 135: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

15 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.

15.1 Get List of Backup Server ZonesTo get the list of backup server zones:GET /settings/backup_server_zones.xmlGET /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 titlelocation_group_id - ID of a location group the backup server zone is assigned toid – backup server zone ID

15.1.1 Page historyv. 3.1:

Added the location_group_id parameter

BILLING PLANS - GET THE LIST OF BILLING PLANS 134

Page 136: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

15.2 Get Backup Server Zone DetailsTo get the backup server zone details:GET /settings/backup_server_zones/:id.xmlGET /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 titlelocation_group_id - ID of a location group the backup server zone is assigned toid – backup server zone ID

15.2.1 Page historyv. 3.1:

Added the location_group_id parameter

15.3 Add Backup Server ZoneTo create a backup server zone, use the following request:POST /settings/backup_server_zones.xmlPOST /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_id></backup_server_group>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 135

Page 137: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

15.3.1 Page historyv. 3.1:

Added the location_group_id parameter

15.4 Edit Backup Server ZonePUT /settings/backup_server_zones/:id.xmlPUT /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_group_id></backup_server_group>' -H 'Accept: application/xml' -H 'Content-type: 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 136

Page 138: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

15.4.1 Page historyv. 3.1:

Added the location_group_id parameter

15.5 Delete Backup Server ZoneTo delete a backup server zone, use the following API call:DELETE /settings/backup_server_zones/:id.xmlDELETE /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'

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.

15.6 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.xmlGET /settings/backup_server_zones/:backup_server_zone_id/backup_servers.json JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 137

Page 139: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET -u user:userpass http://onapp.test/settings/backup_server_zones/:backup_server_zone_id/backup_servers.json -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.xml -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 labelcreated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatbackup_server_group_id – the ID of the backup server zone the backup server belongs toid – the backup server IDenabled – 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 servercapacity – the backup server capacityip_address – the backup server IP

BILLING PLANS - GET THE LIST OF BILLING PLANS 138

Page 140: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

15.7 Assign Backup Server to Backup Server Zone

POST /settings/backup_server_zones/:backup_server_zone_id/backup_servers/:backup_server_id/attach.xmlPOST /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'

15.8 Unassign Backup Server from Backup Server Zone

POST /settings/backup_server_zones/backup_server_zone_id/backup_server/:backup_server_id/detach.xmlPOST /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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 139

Page 141: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/detach.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 140

Page 142: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

16 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.

16.1 Get List of Baremetal ServersGET /baremetal_servers.xmlGET /baremetal_servers.jsonReturns 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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 141

Page 143: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 administratorallowed_swap - true if swap disk is allowed (depends on the template the server is based on); otherwise falsebuilt - true if the server is built; otherwise falsecpu_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 grantedcpu_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 grantedcpu_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 formatdeleted_at - time when the VS was deletedhostname - the name of your hosthypervisor_id - the ID of the compute resource used by this baremetal serverid - the baremetal server IDidentifier - the baremetal server identifierinitial_root_password - the baremetal server root password

BILLING PLANS - GET THE LIST OF BILLING PLANS 142

Page 144: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

initial_root_password_encrypted - true, if the baremetal server root password is encrypted, otherwise falselabel - the baremetal server labellocal_remote_access_ip_address - IP address used for remote accesslocked - true if the baremetal server is locked; otherwise falsenote - an optional reminder for this baremetal server made by a user accountoperating_system - operating system used by the baremetal server operating_system_distro - the distribution of the OS from which this baremetal server is builttemplate_id - the ID of the template the baremetal server is based ontemplate_label - the name of the template from which this baremetal server is builtupdated_at - the date when the baremetal server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatip_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

16.2 Get Baremetal Server DetailsGET /baremetal_servers/:id.xmlGET /baremetal_servers/:id.jsonReturns the array of baremetal servers

<baremetal_servers type="array"><baremetal_server><admin_note nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 143

Page 145: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 144

Page 146: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</baremetal_servers>

Where:admin_note - an optional note of the administratorallowed_swap - true if swap disk is allowed (depends on the template the server is based on); otherwise falsebuilt - true if the server is built; otherwise falsecpu_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 grantedcpu_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 grantedcpu_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 formatdeleted_at - time when the VS was deletedhostname - the name of your hosthypervisor_id - the ID of the compute resource used by this baremetal serverid - the baremetal server IDidentifier - the baremetal server identifierinitial_root_password - the baremetal server root passwordinitial_root_password_encrypted - true, if the baremetal server root password is encrypted, otherwise falselabel - the baremetal server labellocal_remote_access_ip_address - IP address used for remote accesslocked - true if the baremetal server is locked; otherwise falsenote - an optional reminder for this baremetal server made by a user accountoperating_system - operating system used by the baremetal serveroperating_system_distro - the distribution of the OS from which this baremetal server is builttemplate_id - the ID of the template the baremetal server is based ontemplate_label - the name of the template from which this baremetal server is builtupdated_at - the date when the baremetal server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatip_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 145

Page 147: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

16.3 Create Baremetal Server

The management network should be disconnected during the bare metal server deployment.

POST /baremetal_servers.xmlPOST /baremetal_servers.json XML Request example

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</hypervisor_id><initial_root_password>qwaszx</initial_root_password><primary_network_group_id>120</primary_network_group_id><selected_ip_address_id>63</selected_ip_address_id><required_ip_address_assignment>1</required_ip_address_assignment><recipe_idstype='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","hypervisor_group_id":"121","hypervisor_id":"38","initial_root_password":"qwaszx","primary_network_group_id":"120","selected_ip_address_id":"63","required_ip_address_assignment":"1","recipe_ids":["11"]}}' -u user:password -H 'Accept:application/json' -H 'Content-type: application/json'

The following parameters should be sent:

BILLING PLANS - GET THE LIST OF BILLING PLANS 146

Page 148: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

template_id* - the ID of a template from which a baremetal server should be builtlabel* - user-friendly baremetal server descriptionhostname* - specify the baremetal server hostnamehypervisor_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 [ _ ], and the following special characters: ~ ! @ # $ * _ - + = ` \\ { } [ ] : ; ' , . ? /. 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.

16.4 Delete Baremetal ServerDELETE /baremetal_servers/:id.xmlDELETE /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

curl -i -X DELETE -u user:userpass http://onapp.test/baremetal_servers/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:id – the ID of a baremetal server you want to delete

BILLING PLANS - GET THE LIST OF BILLING PLANS 147

Page 149: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

16.5 Add/Edit Admin/User Note for Baremetal Server

To edit/make an admin note, use the following request:PUT /baremetal_servers/:baremetal_server_id.xmlPUT /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 148

Page 150: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

16.6 Enable Recovery Mode for Baremetal Server

PUT /baremetal_servers/:id/enable_recovery.xmlPUT /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.

16.7 Disable Recovery Mode for Baremetal Server

PUT /baremetal_servers/:id/enable_recovery.xmlPUT /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 149

Page 151: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/baremetal_servers/:id/disable_recovery.json

Where you have to specify baremetal server's ID.

BILLING PLANS - GET THE LIST OF BILLING PLANS 150

Page 152: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17 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:

Limits for Template Store

User VS limits Pricing

Virtual servers (Max) VS/hour

Customer networks (Free, Max) customer network/hour

Backup (Free, Max) backup/hour

Template (Free, Max) template/hour

Templates, ISOs & backup storage (Free, Max) GB/hour

Autoscaling (Free, Max) VS/hour

ISO (Free, Max) ISO/hour

Application Server (Max)

Acceleration (Free, Max) Accelerated VS/hour

DRaaS Disk Size - GB/hour

RAM - Mb/hour

CPU Cores - core/hour

CPU Shares - percent/hour or CPU Units - unit/hour

Template Store(s)

BILLING PLANS - GET THE LIST OF BILLING PLANS 151

Page 153: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Limits for Template Store

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 reсeived (free per hour/month, price over free units)

GB

Data sent (free per hour/month, price over free units)

GB

Backup server zone limits Pricing

Backups (Free, Max) backup/hour

Backups disk size (Free, Max) GB/hour

BILLING PLANS - GET THE LIST OF BILLING PLANS 152

Page 154: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Limits for Template Store

Templates (Free, Max) template/hour

Templates disk size (Free, Max) GB/hour

Limits for Edge Groups Pricing

Edge group GB

Limits for Guaranteed min IOPS

Solidfire data store zones (Free, Max, On, Off) 1M requests/hour

Limits for Instance Packages

Instance Packages ( 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.

Starting from the 3.1 release, the master bucket and master template are introduced:

Master buckets are set for compute zone limits.

Master templates 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 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. 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

Remove Base Resource form Master Bucket

Add Base Resource to Master Template

Remove Base Resource From Master Template

17.1 Get the List of Billing PlansTo get the list of billing plans created in your cloud, use one of the following methods:

BILLING PLANS - GET THE LIST OF BILLING PLANS 153

Page 155: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

1. For OnApp 4.2 and up:GET /billing/user/plans.xmlGET /billing/user/plans.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:GET /billing_plans.xmlGET /billing_plans.json

XML Request example 1

curl -i -X GET http://onapp.test/billing/user/plans.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X GET http://onapp.test/billing/user/plans.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

curl -i -X GET http://onapp.test/billing_plans.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

curl -i -X GET http://onapp.test/billing_plans.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example 1

<?xml version="1.0" encoding="UTF-8"?><user_plans type="array">

BILLING PLANS - GET THE LIST OF BILLING PLANS 154

Page 156: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<user_plan><id type="integer">2</id><label>Cloud Location manager Billing Plan</label><created_at type="datetime">2015-08-13T15:07:42+03:00</created_at><updated_at type="datetime">2015-08-13T15:07:42+03:00</updated_at><currency_code>USD</currency_code><show_price nil="true"/><monthly_price type="decimal">0.0</monthly_price><allows_mak type="boolean">true</allows_mak><allows_kms type="boolean">false</allows_kms><allows_own type="boolean">false</allows_own><type>Billing::User::Plan</type><associated_with_users type="integer">1</associated_with_users></user_plan><user_plan>...</user_plan></user_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

type - the type of billing plan

XML Output example 2

<?xml version="1.0" encoding="UTF-8"?><billing_plans type="array"> <billing_plan>

BILLING PLANS - GET THE LIST OF BILLING PLANS 155

Page 157: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <updated_at

BILLING PLANS - GET THE LIST OF BILLING PLANS 156

Page 158: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 157

Page 159: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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> </base_resources> </billing_plan> </billing_plans>

BILLING PLANS - GET THE LIST OF BILLING PLANS 158

Page 160: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 master bucket, otherwise false

is_template - true, if this resource is a master template, 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 master bucket, otherwise false

in_template_zone - true, if this resource belongs to the master template, 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 159

Page 161: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

17.1.1 Page history

v4.2:

Added the alternative request method - GET /billing/user/plans.

Added the following parameters:

type (for method GET /billing/user/plans)

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

Removed the following parameters:

is_default

use_default

BILLING PLANS - GET THE LIST OF BILLING PLANS 160

Page 162: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.2 Get Billing Plan DetailsTo get the details of billing plan created in your cloud, use one of the following methods:

1. For OnApp 4.2 and up:GET /billing/user/plans/:id.xmlGET /billing/user/plans/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:GET /billing_plans/:id.xmlGET /billing_plans/:id.json

XML Request example 1

curl -i -X GET http://onapp.test/billing/user/plans/:id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X GET http://onapp.test/billing/user/plans/:id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

curl -i -X GET http://onapp.test/billing_plans/:id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

curl -i -X GET http://onapp.test/billing_plans/:id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 161

Page 163: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example 1

<?xml version="1.0" encoding="UTF-8"?><user_plan> <id type="integer">1</id> <label>default billing</label> <created_at type="datetime">2015-08-13T15:07:41+03:00</created_at> <updated_at type="datetime">2015-08-13T15:07:41+03:00</updated_at> <currency_code>USD</currency_code> <show_price nil="true"/> <monthly_price type="decimal">0.0</monthly_price> <allows_mak type="boolean">true</allows_mak> <allows_kms type="boolean">false</allows_kms> <allows_own type="boolean">false</allows_own> <type>Billing::User::Plan</type> <associated_with_users type="integer">15</associated_with_users></user_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

type - the type of billing plan

XML Output example 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 162

Page 164: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 163

Page 165: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 164

Page 166: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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> </base_resources>

BILLING PLANS - GET THE LIST OF BILLING PLANS 165

Page 167: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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 master bucket, otherwise false

is_template - true, if this resource is a master template, 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 master bucket, otherwise false

in_template_zone - true, if this resource belongs to the master template, 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 166

Page 168: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

17.2.1 Page history

v4.2:

Added the alternative request method - GET /billing/user/plans/:id.

Added the following parameters:

type

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

Removed the following parameters:

is_default

BILLING PLANS - GET THE LIST OF BILLING PLANS 167

Page 169: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

use_default

17.3 Add Billing PlanTo add new billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans.xmlPOST /billing/user/plans.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans.xmlPOST /billing_plans.json

XML Request example 1

curl -i -X POST http://onapp.test/billing/user/plans.xml -d'<user_plan><label>billing_label</label><currency_code>USD</currency_code><monthly_price>10</monthly_price><allows_kms>false</allows_kms><allows_mak>true</allows_mak><allows_own>false</allows_own></user_plan>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON request example 1

curl -i -X POST http://onapp.test/billing/user/plans.json -d'{"user_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'

XML Request example 2

curl -i -X POST http://onapp.test/billing_plans.xml -d'<billing_plan><label>billing_label</label><currency_code>USD</currency_code><monthly_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 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 168

Page 170: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 namecurrency_code* - the currency that users will be charged in within this billing plan (USD by default)monthly_price * - set monthly fee for plan usageallows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise falseallows_mak - true, if the MAK licnsing is allowed, otherwise falseallows_own - true, if adding own licenses is allowed for this billing plan, otherwise falseReturns 201 on success.

You can't create a billing plan with a code of nonexistent currency.

17.4 Edit Billing PlanTo edit an existing plan, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/plans/:id.xmlPUT /billing/user/plans/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:id.xmlPUT /billing_plans/:id.json

XML Request example 1

curl -i -X PUT http://onapp.test/billing/user/plans/:id.xml -d '<user_plan><label>new_label</label><currency_code>USD</currency_code><monthly_price>10</monthly_price><allows_kms>false</allows_kms><allows_mak>true</allows_mak><allows_own>false</allows_own></user_plan>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 169

Page 171: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example 1

curl -i -X PUT http://onapp.test/billing/user/plans/1.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"user_plan":{"label":"new_label", "currency_code":"USD","monthly_price":"10","allows_kms":false,"allows_mak":true,"allows_own":false}}'

XML Request example 2

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_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 2

curl -i -X PUT http://onapp.test/billing_plans/1.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"billing_plan":{"label":"new_label", "currency_code":"USD","monthly_price":"10","allows_kms":false,"allows_mak":true,"allows_own":false}}'

Where:label* - the desired billing plan name

currency_code* - the code of the currency you're going to charge in.

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 licensing is allowed, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 170

Page 172: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

allows_own - true, if adding own licenses is allowed for this billing plan, otherwise false

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.

17.5 Get List of Base Resources.To view which base resources were added to a particular billing plan, use one of the following methods:

1. For OnApp 4.2 and up:GET /billing/user/plans/:id/resources.xmlGET /billing/user/plans/:id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:GET /billing_plans/:billing_plan_id/base_resources.xmlGET /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 1

curl -i -X GET http://onapp.test/billing/user/plans/:id/resources.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X GET http://onapp.test/billing/user/plans/:id/resources.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 171

Page 173: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example 2

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 2

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 172

Page 174: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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"/> <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> <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">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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 173

Page 175: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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"/> <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"/> <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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 174

Page 176: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> </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 master bucket, 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 master bucket, otherwise false. This parameter applies to compute zone limits only.

in_template_zone - true, if this resource belongs to the master template, otherwise false. This parameter applies to data store and network zone limits only.

In case of a data store or a network zone that has been added to a master template, the output will show the zone properties that were set before the master template has been applied to the zone. To view the current details of such a zone, you need to view the master template details. For more information refer to Get Master Template/Master Bucket Details .

target_id – ID of a base resource target (e.g. compute zone).

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 175

Page 177: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

If you use a new method (GET /billing/user/plans/:id/resources), then several parameters will be renamed as shown in the table below.

OnApp 4.2 and previous versions( /billing_plans/:billing_plan_id/base_resources )

OnApp 4.2 and up( /billing/user/plans/:id/resources)

base_resource resource

is_bucket and is_template master

in_bucket_zone and in_template_zone in_master_zone

template_id and bucket_id master_resource_id

See Get Base Resources for details on each resource limits type.

17.5.1 Page historyv4.2:

Added the alternative request method - GET /billing/user/plans/:id/resources.

Introduced new names for some parameters:

resource

master

in_master_zone

master_resource_id

v3.3:

limit_cpu_units

limit_free_cpu_units

use_cpu_units

BILLING PLANS - GET THE LIST OF BILLING PLANS 176

Page 178: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

17.6 Get Base Resources DetailsTo get the resource details, use one of the following methods:

For OnApp 4.2 and up:GET /billing/user/plans/:id/resources/:id.xmlGET /billing/user/plans/:id/resources/:id.jsonFor OnApp 4.2 and below. In the nearest major release this method will be deprecated:GET /billing_plans/:billing_plan_id/base_resources/:id.xmlGET /billing_plans/:billing_plan_id/base_resources/:id.json

You can check the ID of the required resource with GET method:GET /billing_plans/:billing_plan_id/base_resources.xmlGET /billing_plans/:billing_plan_id/base_resources.jsonORGET /billing/user/plans/:id/resources/:id.xmlGET /billing/user/plans/:id/resources/:id.jsonXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 177

Page 179: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<limits> <limit_free type="integer">0</limit_free> <limit nil="true"/> </limits> <preferences> </preferences> <prices> <price>0.00000000</price> </prices> <target_id nil="true"/> <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>

17.6.1 Where:base_resources - an array of billing plan resources with their details:

For all resources

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

limit_type - hourly or monthly limit type set for the resource

label - name of the base resource target

Depending on the resource type, you will also get the following details:

Backup limits

Template, ISOs & Backup Storage limits

Template limits

Customer networks limits

Virtual server limits

Autoscaling limits

ISO limits

Acceleration limits

DRaaS limits

Application server limits

BILLING PLANS - GET THE LIST OF BILLING PLANS 178

Page 180: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Template Store limits

Recipe groups limits

Compute zone limits

Data store zone limits

Network zone limits

Edge groups limits

Backup server limits

MinIOPS resource limits

Instance packages resource limits

In case of a data store or a network zone that has been added to a master template, the output will show the zone properties that were set before the master template has been applied to the zone. To view the current details of such a zone, you need to view the master template details. For more information refer to Get Master Template/Master Bucket Details.

Backups limits

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

resource_name the name of the base resource. In this case it is backups

Template, ISOs & Backup Storage limits

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 179

Page 181: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

resource_name the name of the base resource. In this case it is storage_disk_size.

Template limits

limits an array of resource limits

limit_free the number of custom templates users can create for free

limit the total amount of custom templates that user can convert from backups

prices an array of resource prices

price price per custom template

resource_name the name of the base resource. In this case it is template

Customer networks limits

limits an array of resource limits

limit_free the number of customer networks users can create for free

limit the total amount of customer networks allowed

prices an array of resource prices

price price per customer network

resource_name the name of the base resource. In this case it is customer_network

Virtual server limits

limits an array of resource limits

limit the total amount of virtual servers allowed

BILLING PLANS - GET THE LIST OF BILLING PLANS 180

Page 182: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

resource_name the name of the base resource. In this case it is vm_limit

Autoscaling limits

limits an array of resource limits

limit_free the number of VSs using autoscaling a user can create for free

limit maximum number of VS using autoscaling

prices an array of resource prices

price price per VS per hour

resource_name the name of the base resource. In this case it is vm_monit

ISO limits

limits an array of resource limits

limit_free the number of ISOs users can upload to the cloud for free

limit the total amount of ISOs users can upload to the cloud

prices an array of resource prices

price price per ISO

resource_name the name of the base resource. In this case it is ISO

Acceleration limits

limits an array of resource limits

limit_free the amount of VSs the user can accelerate for free

limit the total amount of accelerated VSs allowed

prices an array of resource prices

price price per accelerated VS per hour

BILLING PLANS - GET THE LIST OF BILLING PLANS 181

Page 183: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

resource_name the name of the base resource. In this case it is acceleration

DRaaS limits

prices an array of additional prices for a VS with DR enabled

price_disk_size the additional price for disk size per GB per hour

price_memory the additional price for RAM per MB per hour

price_cpus the additional price for CPU core per core per hour

price_cpu_shares the additional price for CPU per percent per hour

price_cpu_units the additional price for CPU per unit per hour if the compute zone uses CPU units instead of CPU shares

resource_name the name of the base resource. In this case it is draas

Application server limits

limits an array of resource limits

limit the total amount of application servers allowed

resource_name the name of the base resource. In this case it is vm_limit

Template Store limits

target_id specify the ID of the template group of a preconfigured system template available to users signed up for this billing plan

resource_name the name of the base resource. In this case it is template_group.

Recipe groups limits

target_id specify the ID of the recipe group which will be available to users signed up for this billing plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 182

Page 184: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

resource_name the name of the base resource. In this case it is recipe_group.

Compute zone limits

limit_type hourly or monthly limit type set for the resource

in_bucket_zone true, if this resource belongs to the master bucket, otherwise false. This parameter applies to compute zone limits only.

is_bucket true, if this resource is a master bucket, otherwise false. This parameter applies to compute zone limits only.

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)

limit_cpu the total amount of CPU allowed within this billing plan (CPU core/hour )

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 users get for free

preferences the array of settings for all VSs running on compute resources within this zone

use_default_cpu_share true if users cannot see the CPU Share parameter when creating or editing a VS, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 183

Page 185: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

use_default_cpu true if users cannot see the CPU parameter when creating or editing a VS, otherwise false

use_cpu_units true if CPU units are used instead of CPU shares

prices an array of base resource prices

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

Data store zone limits

limit_type hourly or monthly limit type set for the resource

is_template true, if this resource is a master template, otherwise false. This parameter applies to data store and network zone limits only.

in_template_zone true, if this resource belongs to the master template, otherwise false. This parameter applies to data store and network zone limits only.

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)

BILLING PLANS - GET THE LIST OF BILLING PLANS 184

Page 186: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

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

resource_name data_store_group

Network zone limits

is_template true, if this resource is a master template, otherwise false. This parameter applies to data store and network zone limits only.

in_template_zone true, if this resource belongs to the master template, 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 185

Page 187: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

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

price_data_received price for received data per GB per hour

resource_name the name of the base resource.In this case it is network_group.

Edge groups limits

target_id the ID of the edge group that you add to this billing plan

resource_name the name of the base resource. In this case it is edge_group.

Backup server limits

resource_name the name of the base resource. In this case it is backup_server_group.

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 186

Page 188: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

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

MinIOPS resource limits

limits an array of resource limits

limit_free the amount of I/O users get for free

limit the entire amount of I/O operations

prices an array of resource prices

price_on the price for unit for powered on data store zone

price_off the price for unit per powered off data store zone

resource_name the name of the base resource. In this case it is solid_fire

Instance packages resource limits

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

price_overused_bandwidth the price for overused bandwidth per GB/hr

preferences the compute/data store/network zones to which the instance package will apply

hypervisor_group_ids the IDs of the compute zones limited by the instance package

BILLING PLANS - GET THE LIST OF BILLING PLANS 187

Page 189: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

data_store_group_ids the IDs of the data store zones limited by the instance package

network_group_ids the IDs of the network zones limited by the instance package

resource_name instance_package

If you use a new method (GET /billing/user/plans/:id/resources), then several parameters will be renamed as shown in the table below.

OnApp 4.2 and previous versions( /billing_plans/:billing_plan_id/base_resources )

OnApp 4.2 and up( /billing/user/plans/:id/resources)

base_resource resource

is_bucket and is_template master

in_bucket_zone and in_template_zone in_master_zone

template_id and bucket_id master_resource_id

17.6.2 Page Historyv4.2:

Added the alternative request method - GET /billing/user/plans/:id/resources.

introduced new names for some parameters

o resource

o master

o in_master_zone

o master_resource_id

v3.1:

Added the following parameters:

associated_with_users

BILLING PLANS - GET THE LIST OF BILLING PLANS 188

Page 190: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

is_bucket

is_template

in_bucket_zone

in_template_zone

17.7 Get Master Template/Master Bucket Details

To get the Master Template/Master Bucket details, use the following method:GET /billing/user/resources/:id.xmlGET /billing/user/resources/:id.json

You can view the ID of the Master Template/Master Bucket using the the following method:GET /billing/user/plans/:id/resources.xmlGET /billing/user/plans/:id/resources.jsonThe resource that has the master parameter set to true is a Master Template or a Master Bucket.

There are three types of master resources: Master Bucket for compute zones Master Template for data store zones Master Template for network zones

XML Output example: Master Bucket for Compute Zones

<?xml version="1.0" encoding="UTF-8"?><resource> <id type="integer">15407</id> <limits> <limit_cpu type="integer">105</limit_cpu> <limit_cpu_share type="integer">25</limit_cpu_share> <limit_cpu_units nil="true"/> <limit_memory type="integer">20</limit_memory> <limit_free_cpu type="integer">1000</limit_free_cpu> <limit_free_cpu_share type="integer">10</limit_free_cpu_share> <limit_free_cpu_units type="integer">0</limit_free_cpu_units> <limit_free_memory type="integer">15</limit_free_memory> <limit_default_cpu type="integer">1</limit_default_cpu> <limit_min_cpu type="integer">1</limit_min_cpu> <limit_min_memory type="integer">128</limit_min_memory <limit_default_cpu_share type="integer">100</limit_default_cpu_share>

BILLING PLANS - GET THE LIST OF BILLING PLANS 189

Page 191: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<limit_min_cpu_priority type="integer">1</limit_min_cpu_priority> </limits> <prices> <price_on_cpu type="float">5.0</price_on_cpu> <price_off_cpu type="float">2.0</price_off_cpu> <price_on_cpu_share type="float">5.0</price_on_cpu_share> <price_off_cpu_share type="float">2.0</price_off_cpu_share> <price_on_cpu_units type="integer">0</price_on_cpu_units> <price_off_cpu_units type="integer">0</price_off_cpu_units> <price_on_memory type="float">5.0</price_on_memory> <price_off_memory type="float">2.0</price_off_memory> </prices> <target_id nil="true"/> <billing_plan_id type="integer">704</billing_plan_id> <created_at type="datetime">2016-08-02T17:29:50+03:00</created_at> <updated_at type="datetime">2016-08-02T17:35:13+03:00</updated_at> <limit_type>hourly</limit_type> <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> <master type="boolean">true</master> <label>Master Bucket</label> <resource_name>hypervisor_group</resource_name> <in_master_zone type="boolean">false</in_master_zone></resource>

17.7.1 Where:id - resource ID

limits - array of resource limits

limit_cpu - the total amount of CPU allowed within the billing plan (CPU core/hour )

limit_cpu_share - the total of CPU Share allowed within the billing plan (in %)

limit_cpu_units - the total number of CPU units users can get with this plan

limit_memory - the entire amount of RAM (Mb/hour)

limit_free_cpu - the limit of CPU users get for free within the billing plan (CPU core/hour)

limit_free_cpu_share - the limit of CPU Share (%) users get for free within the billing plan (in %)

limit_free_cpu_units - the number of CPU units users get for free

BILLING PLANS - GET THE LIST OF BILLING PLANS 190

Page 192: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_free_memory - the amount of free RAM users get for free with the billing plan (Mb/hour)

limit_default_cpu - the number of CPU cores users can add to each VS

limit_min_cpu - minimum amount of CPU that can be set when creating a VS under the billing plan

limit_min_memory - minimum amount memory that can be set when creating a VS under the billing plan

limit_default_cpu_share - true if users cannot see the CPU Share parameter when creating or editing a VS, otherwise false

limit_min_cpu_priority - minimum amount of CPU priority that can be set when creating a VS under the billing plan

prices - array of resource prices:

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_cpu_units - price per unit per hour per VSs powered on

price_off_cpu_units - price per CPU unit for VSs powered off

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

target_id - the ID of the compute zone which will be available to users signed up for 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 - hourly or monthly limit type set for the resource. The hourly limit is used for the Master Bucket.

preferences - the array of settings for all VSs running on compute resources within this zone

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

use_cpu_units - true if CPU units are used instead of CPU shares

master - true, if this resource is a master bucket, otherwise false. This parameter applies to compute zone limits only.

label - name of the base resource target, in this case it is 'Master Bucket'

resource_name - the name of the base resource. In this case it is 'hypervisor_group'

in_master_zone - this parameter is not applicable to the Master Bucket resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 191

Page 193: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example: Master Template for Data Store Zones

<?xml version="1.0" encoding="UTF-8"?><resource> <id type="integer">15408</id> <limits> <limit type="integer">100</limit> <limit_free type="integer">10</limit_free> <limit_data_read_free type="integer">1000</limit_data_read_free> <limit_data_written_free type="integer">1004</limit_data_written_free> <limit_reads_completed_free type="integer">100</limit_reads_completed_free> <limit_writes_completed_free type="integer">111</limit_writes_completed_free> </limits> <prices> <price_on type="float">5.0</price_on> <price_off type="float">2.0</price_off> <price_data_read type="float">2.0</price_data_read> <price_data_written type="float">5.0</price_data_written> <price_reads_completed type="float">2.0</price_reads_completed> <price_writes_completed type="float">5.0</price_writes_completed> </prices> <target_id nil="true"/> <billing_plan_id type="integer">704</billing_plan_id> <created_at type="datetime">2016-08-02T17:29:50+03:00</created_at> <updated_at type="datetime">2016-08-02T17:34:46+03:00</updated_at> <limit_type>hourly</limit_type> <preferences> </preferences> <master type="boolean">true</master> <label>Master Template</label> <resource_name>data_store_group</resource_name> <in_master_zone type="boolean">false</in_master_zone></resource>

17.7.2 Where:id - the ID of the billing plan

limits - array of resource limits

limit - maximum available disk space

BILLING PLANS - GET THE LIST OF BILLING PLANS 192

Page 194: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_free - free disk space on data store zone

limit_data_read_free - the amount of data users get for free for read operations (in GB)

limit_data_written_free - the amount of data users get for free for write operations (in GB)

limit_reads_completed_free - the number (in millions) of input requests which can happen at once users get for free

limit_writes_completed_free - the number (in millions) of output requests which can happen at once users get for tree

prices - 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

price_data_read - price per GB of data for read operations

price_data_written - price per GB of data for write operations

price_reads_completed - price per million of input requests which can happen at once

price_writes_completed - price per million of output requests which can happen at once

target_id - the ID of the data store zone which will be available to users signed up for 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 - hourly or monthly limit type set for the resource. The hourly limit is used for the Master Template.

master - true, if this resource is a master template, otherwise false.

label - name of the base resource target, in this case it is 'Master Template'

resource_name - the name of the base resource. In this case it is 'data_store_group'

in_master_zone - this parameter is not applicable to the Master Template resource

XML Output example: Master Template for Network Zones

<?xml version="1.0" encoding="UTF-8"?><resource> <id type="integer">15409</id> <limits> <limit_ip type="integer">20</limit_ip> <limit_rate type="integer">200</limit_rate> <limit_rate_free type="integer">111</limit_rate_free> <limit_ip_free type="integer">10</limit_ip_free> <limit_data_sent_free type="integer">100</limit_data_sent_free>

BILLING PLANS - GET THE LIST OF BILLING PLANS 193

Page 195: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<limit_data_received_free type="integer">100</limit_data_received_free> </limits> <prices> <price_rate_on type="float">5.0</price_rate_on> <price_rate_off type="float">2.0</price_rate_off> <price_ip_on type="float">5.0</price_ip_on> <price_ip_off type="float">2.0</price_ip_off> <price_data_sent type="float">5.0</price_data_sent> <price_data_received type="float">5.0</price_data_received> </prices> <target_id nil="true"/> <billing_plan_id type="integer">704</billing_plan_id> <created_at type="datetime">2016-08-02T17:29:50+03:00</created_at> <updated_at type="datetime">2016-08-02T17:35:43+03:00</updated_at> <limit_type>hourly</limit_type> <preferences> </preferences> <master type="boolean">true</master> <label>Master Template</label> <resource_name>network_group</resource_name> <in_master_zone type="boolean">false</in_master_zone></resource>

17.7.3 Where:id - resource ID

limits - array of resource limits:

limit_ip - the total amount of IP addresses

limit_rate - the total available port speed

limit_rate_free - the port speed users get for free

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

prices - array of resource prices:

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_ip_on - price per IP when VS is on

price_ip_off - price per IP when VS is off

price_data_sent - price for sent data per GB per hour

BILLING PLANS - GET THE LIST OF BILLING PLANS 194

Page 196: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_data_received - price for received data per GB per hour

target_id - the ID of the network zone which will be available to users signed up for 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 - hourly or monthly limit type set for the resource. The hourly limit is used for the Master Template.

master - true, if this resource is a master template, otherwise false

label - name of the base resource target, in this case it is Master Template

resource_name - the name of the base resource.In this case it is 'network_group'

in_master_zone - this parameter is not applicable to the Master Template resource

17.8 Add Base Resources to Billing Plan.

To add base resources to the billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /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).

17.8.1 Add User VS Limits.To add user VS limits to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:

BILLING PLANS - GET THE LIST OF BILLING PLANS 195

Page 197: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Resource::resource_name</resource_class><limit>30</limit><limit_free>10</limit_free><prices><price>10</price></prices></resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.json -d'{"resource":{"resource_class":"Resource::resource_name", "limits":{"limit":"30","limit_free":"10"},"prices":{"price":"10"}}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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><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 2

curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.json -d'{"base_resource":{"resource_class":"Resource::resource_name", "limits":{"limit":"30","limit_free":"10"},"prices":{"price":"10"}}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 196

Page 198: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

-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 resource_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

ApplicationServer Application Server limit

Acceleration Acceleration limit

DRaaS DRaaS limits

For the VmLimit resource :

limit - sets maximum amount of units of the resource. This parameter affects the number of virtual servers, VSs in Federation and load balancers users can create.

For DRaaS base resource:

price_disk_size - set the price for disk size per GB per hour

price_memory - set the price for RAM per MB per hour

price_cpus - set the price for CPU core per core per hour

price_cpu_shares - set the price for CPU per percent per hour

price_cpu_units - set the price for CPU per unit per hour if the compute zone uses CPU units instead of CPU shares

BILLING PLANS - GET THE LIST OF BILLING PLANS 197

Page 199: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

For all other resources:

limit - sets maximum amount of units of the resource

limit_free - amount of units which are given for free

price – price per unit

17.8.1.1 Page historyv. 4.2:

added DRaaS base resource

added ApplicationServer base resource

added Acceleration base resource

v. 4.0:

added TemplateIso base resource

v. 3.1:

added info on CustomerNetwork base resource

17.8.2 Add Limits for Template Store.To add limits for template store to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST -u user:userpass -H'Content-type: application/xml' -H'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d'<resource><resource_class>Resource::TemplateGroup</resource_class><billing_plan_id>21</billing_plan_id><target_id>22</target_id><target_type>ImageTemplateGroup</target_type></resource>'

BILLING PLANS - GET THE LIST OF BILLING PLANS 198

Page 200: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example 1

curl -i -X POST -u user:userpass -H'Content-type: application/json' -H'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d'{"resource":{"resource_class":"Resource::TemplateGroup","billing_plan_id":"21","target_id":"22","target_type":"ImageTemplateGroup"}}'

XML Request example 2

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::TemplateGroup</resource_class><billing_plan_id>21</billing_plan_id><target_id>22</target_id><target_type>ImageTemplateGroup</target_type></base_resource>'

JSON Request example 2

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::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

BILLING PLANS - GET THE LIST OF BILLING PLANS 199

Page 201: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Check the ID of the necessary group with the following call:

GET /settings/image_template_groups.xml

17.8.3 Add Limits for Recipe Groups.To add limits for recipe groups to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Resource::RecipeGroup</resource_class><target_type>RecipeGroup</target_type><target_id>1</target_id></resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"resource":{"resource_class":"Resource::RecipeGroup","target_type":"RecipeGroup","target_id":"2"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json'

XML Request example 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 200

Page 202: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml -d '<base_resource><resource_class>Resource::RecipeGroup</resource_class><target_type>RecipeGroup</target_type><target_id>1</target_id></base_resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request example 2

curl -i -X POST http://onapp.test/billing_plans/:billing_plan_id/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

17.8.4 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, use the following requests:

Add Base Resource to Master Bucket

BILLING PLANS - GET THE LIST OF BILLING PLANS 201

Page 203: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Remove Base Resource from Master Bucket

To limits for compute zones to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.xml -d'<resource><billing_plan_id>1194</billing_plan_id><resource_class>Resource::HypervisorGroup</resource_class><in_master_zone>1</in_master_zone><target_type>Pack</target_type><target_id>14</target_id><limits><limit_free_cpu>5</limit_free_cpu><limit_free_cpu_share>50</limit_free_cpu_share><limit_free_memory>128</limit_free_memory><limit_cpu>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><price_on_memory>10</price_on_memory><price_off_memory>5</price_off_memory></prices></resource>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request example 1

curl -s -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.json -H'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d'{"resource":{"resource_class":"Resource::HypervisorGroup","in_master_zone":"1","target_type":"Pack","target_id":"14","limits":{"limit_free_cpu":"10","limit_free_cpu_share":"10","limit_free_memor

BILLING PLANS - GET THE LIST OF BILLING PLANS 202

Page 204: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

y":"1000","limit_cpu":"10","limit_cpu_share":"10","limit_memory":"1000","limit_default_cpu":"10","limit_default_cpu_share":"10"},"prices":{"price_on_cpu":"10","price_off_cpu":"10","price_on_cpu_share":"10","price_off_cpu_share":"10","price_on_memory":"10","price_off_memory":"10"}}}'

XML Request example 2

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::HypervisorGroup</resource_class><in_bucket_zone>1</in_bucket_zone><target_type>Pack</target_type><target_id>14</target_id><limits><limit_free_cpu>5</limit_free_cpu><limit_free_cpu_share>50</limit_free_cpu_share><limit_free_memory>128</limit_free_memory><limit_cpu>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><price_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'

JSON Request example 2

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_share":"10","limit_free_memory":"1000","limit_cpu":"10","limit_cpu_share":"10","limit_memory":"1000","limit_default_cpu":"10","limit_default_cpu_share":"10"},"prices":{"price_on_cpu":"10","price_off_cpu":"10","price_on_cpu_share":"10",

BILLING PLANS - GET THE LIST OF BILLING PLANS 203

Page 205: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"price_off_cpu_share":"10","price_on_memory":"10","price_off_memory":"10"}}}'

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 HypervisorGroup for compute zone limits

in_bucket_zone - set 1 to add the compute resource to the master bucket. This parameter applies to compute zone limits only. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 204

Page 206: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 Historyv.3.3

limit_cpu_units

limit_free_cpu_units

use_cpu_units

price_on_cpu_units

price_off_cpu_units

17.8.4.1 Add Compute Zone Base Resource to Master Bucket.To add a compute zone to the master bucket, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

To add or remove existing compute zone base resources from the master bucket, use the following requests:

Add Base Resource to Master Bucket

Remove Base Resource from Master Bucket

XML Request example 1

curl -i -X POST -u user:userpass -H 'Content-type: application/xml' -H 'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Resource::HypervisorGroup</resource_class

BILLING PLANS - GET THE LIST OF BILLING PLANS 205

Page 207: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

><target_type>Pack</target_type><in_master_zone>1</in_master_zone><target_id>14</target_id></resource>'

JSON Request example 1

curl -i -X POST -u user:userpass -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"resource":{"resource_class":"Resource::HypervisorGroup", "target_type":"Pack", "in_master_zone":"1", "target_id":"14"}}'

XML Request example 2

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_type>Pack</target_type><in_bucket_zone>1</in_bucket_zone><target_id>14</target_id></base_resource>'

JSON Request example 2

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 206

Page 208: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

in_bucket_zone - set 1 to add the compute resource to the master bucket. This parameter applies to compute zone limits only. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

target_id* - the ID of the compute zone which you add to the master bucket

Check the ID of the required compute zone with the GET /settings/hypervisor_zones call.

17.8.5 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 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, use the following requests:

Add Base Resource to Master Template

Remove Base Resource From Master Template

To add data store zones to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST -u user:userpass -H'Content-type: application/xml' -H'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d'<resource><resource_class>Resource::DataStoreGroup</resource_class><billing_plan_id>41</billing_plan_id><in_master_zone>1</in_master_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</

BILLING PLANS - GET THE LIST OF BILLING PLANS 207

Page 209: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_data_written_free><limit_data_read_free>4</limit_data_read_free><limit_writes_completed_free>5</limit_writes_completed_free></limits><prices><price_data_written>6</price_data_written><price_off>7</price_off><price_on>8</price_on><price_data_read>9</price_data_read><price_writes_completed>10</price_writes_completed><price_reads_completed>11</price_reads_completed></prices><limit_type>hourly</limit_type></resource>'

JSON Request example 1

curl -i -X POST -u user:userpass -H'Content-type: application/json' -H'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d'{"resource":{"resource_class":"Resource::DataStoreGroup","billing_plan_id":"41","in_master_zone":"1","target_id":"56","target_type":"Pack","limits":{"limit_free":"1","limit":"20","limit_reads_completed_free":"2","limit_data_written_free":"3","limit_data_read_free":"4","limit_writes_completed_free":"5"},"limit_type":"hourly","prices":{"price_data_written":"6","price_off":"7","price_on":"8","price_data_read":"9","price_writes_completed":"10","price_reads_completed":"11"}}}'

XML Request example 2

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_plan_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</limit_data_written_free><limit_data_read_free>4</limit_data_read_free><limit_writes_completed_free>5</limit_writes_completed_free></limits><prices><price_data_written>6</

BILLING PLANS - GET THE LIST OF BILLING PLANS 208

Page 210: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_data_written><price_off>7</price_off><price_on>8</price_on><price_data_read>9</price_data_read><price_writes_completed>10</price_writes_completed><price_reads_completed>11</price_reads_completed></prices><limit_type>hourly</limit_type></base_resource>'

JSON Request example 2

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::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","limit_data_read_free":"4","limit_writes_completed_free":"5"},"limit_type":"hourly","prices":{"price_data_written":"6","price_off":"7","price_on":"8","price_data_read":"9","price_writes_completed":"10","price_reads_completed":"11"}}}'

Where: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 master template, otherwise false. This parameter applies to data store and network zone limits only. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 209

Page 211: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 per hour, when VS is on

price_off - price per GB of disk size per hour, 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

17.8.5.1 Add Data Store Zone Base Resource to Master Template.To add a data store zone to the master template, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

To add or remove existing data store zone base resources from the master template, use the following requests:

Add Base Resource to Master Template

Remove Base Resource From Master Template

XML Request example 1

curl -i -X POST -u user:password -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 210

Page 212: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

-H 'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Resource::DataStoreGroup</resource_class><target_type>Pack</target_type><in_master_zone>1</in_master_zone><target_id>1</target_id><limit_type>hourly</limit_type></resource>'

JSON Request example 1

curl -i -X POST -u user:password -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"resource":{"resource_class":"Resource::DataStoreGroup", "target_type":"Pack", "in_master_zone":"1", "target_id":"1", "limit_type":"hourly"}}'

XML Request example 2

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><limit_type>hourly</limit_type></base_resource>'

JSON Request example 2

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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 211

Page 213: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.This parameter applies to data store and network zone limits only. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

target_id* - the ID of the data store zone which you add to the master template

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

17.8.6 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 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, use the following requests:

Add Base Resource to Master Template

Remove Base Resource From Master Template

To add network zone(s) to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

BILLING PLANS - GET THE LIST OF BILLING PLANS 212

Page 214: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -u user:userpass -H'Content-type: application/xml' -H'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d'<resource><resource_class>Resource::NetworkGroup</resource_class><billing_plan_id>41</billing_plan_id><in_master_zone>1</in_master_zone><target_id>33</target_id><target_type>Pack</target_type><limits><limit_ip>20</limit_ip><limit_rate>20</limit_rate><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_sent><price_data_received>6</price_data_received></prices><limit_type>hourly</limit_type></resource>'

JSON Request example 1

curl -i -X POST -u user:userpass -H'Content-type: application/json' -H'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d'{"resource":{"resource_class":"Resource::NetworkGroup","billing_plan_id":"41","in_master_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","price_ip_on":"2","price_rate_off":"3","price_rate_on":"4","price_data_sent":"5","price_data_received":"6"}}}'

XML Request example 2

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_rate><limit_data_sent_free>1</

BILLING PLANS - GET THE LIST OF BILLING PLANS 213

Page 215: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_sent><price_data_received>6</price_data_received></prices><limit_type>hourly</limit_type></base_resource>'

JSON Request example 2

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","price_ip_on":"2","price_rate_off":"3","price_rate_on":"4","price_data_sent":"5","price_data_received":"6"}}}'

Where:resource_class * -name of the base resource you add to the billing plan in the following format: Resource::NetworkGroup

billing_plan_id - ID of the billing plan

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 master template, otherwise false. This parameter applies to data store and network zone limits only. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 214

Page 216: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

price_data_received – price for received data per GB

limit_type – limit type set for the resource; can be hourly or monthly

17.8.6.1 Add Network Zone Base Resource to Master Template.To add a network zone to the master template, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

To add or remove existing network zone base resources from the master template, use the following requests:

Add Base Resource to Master Template

Remove Base Resource From Master Template

XML Request example 1

curl -i -X POST -u user:password -H 'Content-type: application/xml' -H 'Accept: application/xml' http://onapp.test/billing/user/plans/:plan_id/resources.xml -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 215

Page 217: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'<resource><resource_class>Resource::NetworkGroup</resource_class><target_type>Pack</target_type><in_master_zone>1</in_master_zone><target_id>1</target_id><limit_type>hourly</limit_type></resource>'

JSON Request example 1

curl -i -X POST -u user:password -H 'Content-type: application/json' -H 'Accept: application/json' http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"resource":{"resource_class":"Resource::NetworkGroup", "target_type":"Pack", "in_master_zone":"1", "target_id":"1", "limit_type":"hourly"}}'

XML Request example 2

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>Pack</target_type><in_template_zone>1</in_template_zone><target_id>1</target_id><limit_type>hourly</limit_type></base_resource>'

JSON Request example 2

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 216

Page 218: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

in_template_zone - set 1 to add the network store zone to the master template. This parameter is replaced by in_master_zone parameter if you use the first method (POST /billing/user/plans/:plan_id/resources)

target_id* - the ID of the network zone which you add to the master template. 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

17.8.7 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.

To add edge group(s) to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML request example 1

curl -i -X POST -d '<resource><resource_class>Resource::EdgeGroup</resource_class><billing_plan_id>107</billing_plan_id><target_id>1</target_id><target_type>EdgeGroup</target_type><price>6</price></resource>' -u user:userpass http://onapp.test/billing/user/plans/:plan_id/resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON request example 1

curl -i -X POST -d '{"resource":

BILLING PLANS - GET THE LIST OF BILLING PLANS 217

Page 219: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"resource_class":"Resource::EdgeGroup","billing_plan_id":"107","target_id":"1","target_type":"EdgeGroup","price":"6"}}' -u user:userpass http://onapp.test/billing/user/plans/:plan_id/resources.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML request example 2

curl -i -X POST -d '<base_resource><resource_class>Resource::EdgeGroup</resource_class><billing_plan_id>107</billing_plan_id><target_id>1</target_id><target_type>EdgeGroup</target_type><price>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'

JSON request example 2

curl -i -X POST -d '{"base_resource":{"resource_class":"Resource::EdgeGroup","billing_plan_id":"107","target_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 218

Page 220: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.8.8 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.

To add backup server zone(s) to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST -u user:userpass http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Resource::BackupServerGroup</resource_class><billing_plan_id>182</billing_plan_id><target_id>28</target_id><target_type>Pack</target_type><limits><limit_backup_free>2</limit_backup_free><limit_backup>10</limit_backup><limit_backup_disk_size_free>2</limit_backup_disk_size_free><limit_backup_disk_size>10</limit_backup_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_template_disk_size>10</limit_template_disk_size></limits><prices><price_backup>50</price_backup><price_backup_disk_size>50</price_backup_disk_size><price_template_disk_size>50</price_template_disk_size><price_template>50</price_template></prices></resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X POST -u user:userpass http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"resource":{"resource_class": "Resource::BackupServerGroup","billing_plan_id":"182","target_id":"28","target_type":"Pack","limits":{"limit_backup_free":"2",

BILLING PLANS - GET THE LIST OF BILLING PLANS 219

Page 221: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"limit_backup":"10","limit_backup_disk_size_free":"2","limit_backup_disk_size":"10","limit_template_free":"2","limit_template":"10","limit_template_disk_size_free":"2", "limit_template_disk_size":"10"},"prices":{"price_backup":"50","price_backup_disk_size":"50","price_template_disk_size":"50","price_template":"50"}}}' -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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_plan_id>182</billing_plan_id><target_id>28</target_id><target_type>Pack</target_type><limits><limit_backup_free>2</limit_backup_free><limit_backup>10</limit_backup><limit_backup_disk_size_free>2</limit_backup_disk_size_free><limit_backup_disk_size>10</limit_backup_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_template_disk_size>10</limit_template_disk_size></limits><prices><price_backup>50</price_backup><price_backup_disk_size>50</price_backup_disk_size><price_template_disk_size>50</price_template_disk_size><price_template>50</price_template></prices></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

curl -i -X POST -u user:userpass http://onapp.test/billing_plans/:id/base_resources.json -d '{"base_resource":{"resource_class": "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","limit_template_free":"2","limit_template":"10","limit_template_disk_size_free":"2", "limit_template_disk_size":"10"},"prices":

BILLING PLANS - GET THE LIST OF BILLING PLANS 220

Page 222: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"price_backup":"50","price_backup_disk_size":"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

resource_name– the name of the base resource. In this case it is BackupServerGroup

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

17.8.9 Add Limits for minIOPS.To add limits for minIOPS to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:

BILLING PLANS - GET THE LIST OF BILLING PLANS 221

Page 223: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XMLRequest example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<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><limit>10000</limit><limit_free>600</limit_free></limits><prices><price_on>100</price_on><price_off>50</price_off></prices></resource>' -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X POST http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"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 'Content-type: application/json'

XMLRequest example 2

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><limit>10000</limit><limit_free>600</limit_free></limits><prices><price_on>100</price_on><price_off>50</price_off></prices></base_resource>' -u

BILLING PLANS - GET THE LIST OF BILLING PLANS 222

Page 224: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

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 'Content-type: application/json'

Where:resource_class * -the name of the base resource you add to the billing plan in the following format: Resource::SolidFire

billing_plan_id - the ID of the billing plan

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 – the number of IOPS available for customer for free

limit – the maximum number of IOPS available

Limits for IOPS are set for a whole data store zone.

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 PLANS - GET THE LIST OF BILLING PLANS 223

Page 225: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

17.8.10 Add Limits for Instance Packages.To add instance package(s) to a billing plan, use one of the following methods:

1. For OnApp 4.2 and up:POST /billing/user/plans/:plan_id/resources.xmlPOST /billing/user/plans/:plan_id/resources.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:POST /billing_plans/:billing_plan_id/base_resources.xmlPOST /billing_plans/:billing_plan_id/base_resources.json

XML Request example 1

curl -i -X POST -u user:userpass --url http://onapp.test/billing/user/plans/:plan_id/resources.xml -d '<resource><resource_class>Billing::Resource::InstanceType</resource_class><target_type>InstanceType</target_type><target_id>10</target_id><hypervisor_group_ids>1</hypervisor_group_ids><data_store_group_ids>7, 37</data_store_group_ids><network_group_ids>11</network_group_ids><price_on>0.3</price_on><price_off>0.2</price_off><price_overused_bandwidth>0.03</price_overused_bandwidth></resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 224

Page 226: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example 1

curl -i -X POST -u user:userpass --url http://onapp.test/billing/user/plans/:plan_id/resources.json -d '{"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", "price_overused_bandwidth": "0.03"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

curl -i -X POST -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources.xml -d '<base_resource><resource_class>Billing::Resource::InstanceType</resource_class><target_type>InstanceType</target_type><target_id>10</target_id><hypervisor_group_ids>1</hypervisor_group_ids><data_store_group_ids>7, 37</data_store_group_ids><network_group_ids>11</network_group_ids><price_on>0.3</price_on><price_off>0.2</price_off><price_overused_bandwidth>0.03</price_overused_bandwidth></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

curl -i -X POST -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/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",

BILLING PLANS - GET THE LIST OF BILLING PLANS 225

Page 227: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"price_on": "0.3", "price_off": "0.2", "price_overused_bandwidth": "0.03"}}' -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 package that you add to the billing plan

hypervisor_group_ids - ID(s) of the compute zone(s) to which the instance package will apply

data_store_group_ids - ID(s) of the data store zone(s) to which the instance package will apply

network_group_ids - ID(s) of the network zone(s) to which the instance package will apply

price_on - the hourly price for a VS built using this instance package that is powered on

price_off - the hourly price for a VS built using this instance package that is powered off

price_overused_bandwidth - the price for overused bandwidth per GB

17.9 Edit Base ResourcesThis 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. HTTP 422 status will be returned.

To change limits and prices for a base resource, use one of the following methods:

For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.jsonFor OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json XML Request example 1

curl -i -X PUT -u user:userpass --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 226

Page 228: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/billing/user/resources/:id.xml -d '<resource><limit>5</limit></resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X PUT -u user:userpass --url http://onapp.test/billing/user/resources/:id.json -d '{"resource": { "limit": "10" }}' -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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 2

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 'Content-type: application/json'

You can check ID of the 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.Where:base_resource - an array of billing plan limits and prices depending on the resource type. See below for details: Backups limits Template, ISOs & Backup Storage limits Template limits Customer networks limits Virtual server limits Autoscaling limits ISO limits Acceleration limits DRaaS limits Application server limits Template Store limits Recipe groups limits Edge groups limits instance packages resource limits

BILLING PLANS - GET THE LIST OF BILLING PLANS 227

Page 229: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

limit_free the number of backups users can create for free

limit the maximum number of backups users can create according to their template/backup storage space limit.

price price per backup

resource_name the name of the base resource. In this case it is backups

Template, ISOs & Backup Storage 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

price price per GB

Template limits

limit_free the number of custom templates users can create for free

limit the maximum number of user templates which can be created, according to their template/backup storage space limit.

price price per user template

Customer networks limits

limit_free the number of customer networks users can create for free

limit the total amount of customer networks allowed

price price per customer network

Virtual server limits

BILLING PLANS - GET THE LIST OF BILLING PLANS 228

Page 230: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

limit the total amount of virtual servers allowed. This parameter affects the number of virtual servers, VSs in Federation and load balancers users can create.

Autoscaling limits

limit_free the number of VSs using autoscaling a user can create for free

limit maximum number of VS using autoscaling

price the price for the VSs using autoscaling (per VS).

ISO limits

limit_free the number of ISOs users can upload to the cloud for free

limit the total amount of ISOs users can upload to the cloud, according to their template/ISO/backup storage space limit.

price price per ISO per hour

Acceleration limits

limit_free the amount of VSs the user can accelerate for free

limit the total amount of accelerated VSs allowed

price price per accelerated VS per hour

DRaaS limits

price_disk_size the additional price for disk size per GB per hour

price_memory the additional price for RAM per MB per hour

price_cpus the additional price for CPU core per core per hour

price_cpu_shares the additional price for CPU per percent per hour

price_cpu_units the additional price for CPU per unit per hour if the compute zone

BILLING PLANS - GET THE LIST OF BILLING PLANS 229

Page 231: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Backups limits

uses CPU units instead of CPU shares

Application server limits

limit the total amount of application servers allowed

Template Store limits

target_id specify the ID of the template group of a preconfigured system template available to users signed up for this billing plan

Recipe groups limits

target_id specify the ID of the recipe group which will be available to users signed up for this billing plan

Edge groups limits

target_id the ID of the edge group that you add to this billing plan

instance packages resource limits

price_on the price for unit for powered on data store zone

price_off the price for unit per powered off data store zone

price_overused_bandwidth

the price for overused bandwidth per GB

hypervisor_group_ids the IDs of the compute zones limited by the instance package

data_store_group_ids the IDs of the data store zones limited by the instance package

network_group_ids the IDs of the network zones limited by the instance package

resource_name instance_package

BILLING PLANS - GET THE LIST OF BILLING PLANS 230

Page 232: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

You can update prices and zones for an instance package in billing plan even if this instance package has been used during virtual server creation. instance package price update takes effect on VS's price approximately five minutes after updating.

If you have VSs created with the instance package on a particular compute zone, you cannot remove this compute zone from instance packages limits.

If no compute zones are added to limits for instance packages, you can edit limits and add a compute zone, on which instance package VS is already built. Another compute zones can not be added.

17.10 Edit Limits & Pricing for Compute Zones

To change limits and prices for compute zones, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /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_cpu>100</price_on_cpu><price_off_cpu>50</price_off_cpu><limit_default_cpu>1</limit_default_cpu></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 231

Page 233: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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'

Where: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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 232

Page 234: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_free_cpu_share<price_on_cpu_share>10</price_on_cpu_share><price_off_cpu_share>5</price_off_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 planlimit_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

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.

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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 233

Page 235: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_memory><price_on_memory>10</price_on_memory><price_off_memory>5</price_off_memory></base_resource>' -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 planlimit_free_memory - the amount of RAM users get for freeprice_on_memory - the prices for RAM for VSs powered onprice_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 234

Page 236: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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</price_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 planlimit_free_cpu_units - if CPU units are used, set the number of CPU units get for freeprice_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 Historyv.3.3 limit_cpu_units limit_free_cpu_units use_cpu_units price_on_cpu_units price_off_cpu_units

BILLING PLANS - GET THE LIST OF BILLING PLANS 235

Page 237: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.11 Edit Limits & Pricing for Data Store Zones

To change limits and prices for Data store zones, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below.In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /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><price_off>50</price_off></base_resource>'-H 'Accept: application/xml' -H 'Content-type: application/xml'

Edit 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": "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 GB of disk size per hour, when VS is on

BILLING PLANS - GET THE LIST OF BILLING PLANS 236

Page 238: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_off - the price per GB of disk size per hour, when VS is 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.00000000</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_written>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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 237

Page 239: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:limit_data_written_free - the amount of data written users can send for free

price_data_written - the price over free units

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_reads_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_writes_completed>100.00000000</price_writes_completed></base_resource>'-H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 238

Page 240: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

17.12 Edit Limits & Pricing for Network Zones

To change limits and prices for Network zones, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json

For Network zones, you can change the limits for the following resources: IP Address, Port Speed, Data received, Data sent.

Edit IP Address limits XML request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 239

Page 241: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -u user:userpass --url http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml-d '<base_resource><limit_ip>20</limit_ip><limit_ip_free>10</limit_ip_free><price_ip_on>100</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><price_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 240

Page 242: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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_received>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

BILLING PLANS - GET THE LIST OF BILLING PLANS 241

Page 243: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_data_received - the price over free units. Data received is priced per GB.

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 242

Page 244: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.13 Edit Limits & Pricing for Backup Server Zones

To change limits and prices for Backup Server zones, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /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_free><price_backup>10</price_backup></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

Edit Backups 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 backups users can request

limit_backup_free - the amount of backups users can get for free

BILLING PLANS - GET THE LIST OF BILLING PLANS 243

Page 245: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_disk_size>5</limit_backup_disk_size><limit_backup_disk_size_free>10</limit_backup_disk_size_free><price_backup_disk_size>10</price_backup_disk_size></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_disk_size":"50","limit_backup_disk_size_free":"100","price_backup_disk_size": "100"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:limit_backup_disk_size_free –disk size user gets for free to store their backups

limit_backup_disk_size – maximum backup disk size allowed

price_backup_disk_size - price per GB of backup disk size over limit

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_template_free><price_template>10.00000000</price_template></base_resource>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 244

Page 246: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Edit Templates 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": "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

BILLING PLANS - GET THE LIST OF BILLING PLANS 245

Page 247: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

17.14 Delete Base Resource From Billing Plan

To delete a base resource from billing plan, use one of the following methods:

1. For OnApp 4.2 and up:DELETE /billing/user/resources/:id.xmlDELETE /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:DELETE /billing_plans/:billing_plan_id/base_resources/:id.xml DELETE /billing_plans/:billing_plan_id/base_resources/:id.json

XML Request example 1

*curl -i -X DELETE -u user:userpass http://onapp.test/billing/user/resources/:id.xml*

JSON Request example 1

*curl -i -X DELETE -u user:userpass http://onapp.test/billing/user/resources/:id.json*

XML Request example 2

*curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.xml*

JSON Request example 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 246

Page 248: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

*curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:billing_plan_id/base_resources/:id.json*

Where you have to specify ID of a billing plan and ID of a resource you want to delete.

To delete a CDN edge group which is associated with CDN resources, add the force=1 parameter to the request, as shown in the examples below.

XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:id/base_resources/:id.json -H 'Accept:application/xml' -d ' <force>1</force>' -H 'Content-type:application/xml'

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/billing_plans/:id/base_resources/:id.json -d '{"force":"1"}' -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 or base resource with a requested ID, or URL is incorrect.

Page Historyv. 3.1: info on force parameter, that allows to delete edge group that is

associated with CDN resources.

17.15 Add Base Resource to Master BucketTo add base resource to the master bucket, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 247

Page 249: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Currently the master bucket is used for compute zone base resource limits only.

XML Request example 1

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<resource><in_master_zone>1</in_master_zone></resource>' http://onapp.test/billing/user/resources/:id.xml

JSON Request example 1

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d '{"resource":{"in_master_zone":"1"}}' http://onapp.test/billing/user/resources/:id.json

XML Request example 2

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.xml

JSON Request example 2

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.json

Where:in_template_zone - set 1 to add this resource to the master template. This parameter is replaced by in_master_zone parameter if you use the first method (PUT /billing/user/resources/:id).

BILLING PLANS - GET THE LIST OF BILLING PLANS 248

Page 250: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

17.16 Remove Base Resource from Master Bucket

To remove base resource from the master bucket, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json

Currently the master bucket is used for compute zone base resource limits only.

XML Request example 1

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<resource><in_master_zone>0</in_master_zone></resource>' http://onapp.test/billing/user/resources/:id.xml

JSON Request example 1

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d '{"resource":{"in_master_zone":"0"}}' http://onapp.test/billing/user/resources/:id.json

XML Request example 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 249

Page 251: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.xml

JSON Request example 2

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.json

Where:in_bucket_zone - leave this field empty to remove this resource from the master bucket.This parameter is replaced by in_master_zone parameter if you use the first method (PUT /billing/user/resources/:id).

17.17 Add Base Resource to Master Template

To add base resource to the master template, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json

Currently the master template is used for data store zone and network zone base resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 250

Page 252: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limits only.

XML Request example 1

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<resource><master_resource_id>25</master_resource_id></resource>' http://onapp.test/billing/user/resources/:id.xml

JSON Request example 1

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d'{"resource":{"master_resource_id":"25"}}' http://onapp.test/billing/user/resources/:id.json

XML Request example 2

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.xml

JSON Request example 2

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.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 251

Page 253: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:template_id - ID of the master template. This parameter is replaced by master_resource_id parameter if you use the first method (PUT /billing/user/resources/:id).

17.18 Remove Base Resource From Master Template

To remove base resource from the master template, use one of the following methods:

1. For OnApp 4.2 and up:PUT /billing/user/resources/:id.xmlPUT /billing/user/resources/:id.json

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:PUT /billing_plans/:billing_plan_id/base_resources/:id.xmlPUT /billing_plans/:billing_plan_id/base_resources/:id.json

Currently the master template is used for data store zone and network zone base resource limits only.

XML Request example 1

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -u user:userpass -d '<resource><in_master_zone>0</in_master_zone></resource>' http://onapp.test/billing/user/resources/:id.xml

JSON Request example 1

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -u user:userpass -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 252

Page 254: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'{"resource":{"in_master_zone":"0"}}' http://onapp.test/billing/user/resources/:id.json

XML Request example 2

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.xml

JSON Request example 2

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.json

Where:in_template_zone - set 0 to remove this resource from the master template. This parameter is replaced by in_master_zone parameter if you use the first method (PUT /billing/user/resources/:id).

17.19 Delete Billing PlanTo delete a billing plan, , use one of the following methods:

1. For OnApp 4.2 and up::DELETE /billing/user/plans/:plan_id.xmlDELETE /billing/user/plans/:plan_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 253

Page 255: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

2. For OnApp 4.2 and below. In the nearest major release this method will be deprecated:DELETE /billing_plans/:id.xmlDELETE /billing_plans/:id.json

XML Request example 1

curl -i -X DELETE http://onapp.test/billing/user/plans/:plan_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X DELETE http://onapp.test/billing/user/plans/:plan_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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 2

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 254

Page 256: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

to it. If you wish to only affect that user then copy the billing plan and associate it only with the single user.

BILLING PLANS - GET THE LIST OF BILLING PLANS 255

Page 257: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

18 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.

18.1 Get List of BlueprintsTo get the list of all blueprints, use the following request:GET /blueprints.xmlGET /blueprints.jsonXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 256

Page 258: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 fromcreated_at - the date when the blueprint was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the blueprint was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer networkdata_store_id - ID of a data store the blueprint belongs toid - blueprint IDidentifier -blueprint identifierlabel - blueprint namestate - blueprint state: on or offuser_id - ID of a user the blueprint belongs to

18.2 Get Blueprint DetailsTo get the list of all blueprints, use the following request:GET /blueprints/:blueprint_id.xmlGET /blueprints:blueprint_id.jsonXML 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"?>

BILLING PLANS - GET THE LIST OF BILLING PLANS 257

Page 259: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 fromcreated_at - the date when the blueprint was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the blueprint was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer networkdata_store_id - ID of a data store the blueprint belongs toid - blueprint IDidentifier -blueprint identifierlabel - blueprint namestate - blueprint state: on or offuser_id - ID of a user the blueprint belongs to

18.3 Add BlueprintUse the following request to add new blueprint:POST /blueprints.xmlPOST /blueprints.jsonXML 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><required_startup>1</required_startup></blueprint>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 258

Page 260: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 nameblueprint_template_id - ID of the template to build the blueprint fromdata_store_id - ID of a data store to which the blueprint will be assignedcustomer_network - ID of the customer network which will be used for this blueprintrequired_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>

18.4 Delete BlueprintUse the following request to add new blueprint:DELETE /blueprints/blueprint_id.xmlDELETE /blueprints/blueprint_id.jsonXML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/blueprints/blueprint_id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 259

Page 261: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 260

Page 262: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

19 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.

19.1 Get List of Blueprint Template Groups

To get the list of blueprint template groups, use the following request:GET /blueprint_template_groups.xmlGET /blueprint_template_groups.jsonXML 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"?><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

BILLING PLANS - GET THE LIST OF BILLING PLANS 261

Page 263: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 IDlabel – blueprint template group nameparent_id - id of the target blueprint template grouplft - left nested set identifierrgt - right nested set identifierdepth - 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 createdupdated_at – the date when the blueprint template group was updatedchildren - the array of child blueprint template groupsrelations - the array of blueprints assigned to the blueprint template groups with the following parameters: id - relation ID blueprint_template_id - blueprint template ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 262

Page 264: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o id - recipe IDo user_id - ID - the ID of a blueprint template ownero created_at – the date when the blueprint template was createdo updated_at – the date when the blueprint template was updatedo label - blueprint template label o vapp_name - name of the vApp this template is created from o hypervisor_id - ID of a compute resource the vApp is located on

19.2 Get Blueprint Template Group Details

To get the list of blueprint template groups, use the following request:GET /blueprint_template_groups.xmlGET /blueprint_template_groups.jsonXML 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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 263

Page 265: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 createdupdated_at – the date when the blueprint template group was updateddepth - the depth of a given node (distance from this blueprint template group to the root)lft - left nested set identifierrgt - right nested set identifierid - blueprint template group IDlabel – blueprint template group nameparent_id - id of the target blueprint template group

19.3 Add Blueprint Template GroupTo create new blueprint template group, use the following request:POST /blueprint_template_groups.xmlPOST /blueprint_template_groups.jsonXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 264

Page 266: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 formatid — the blueprint template group IDlabel - the blueprint template group name

19.4 Edit Blueprint Template GroupTo edit the blueprint template group, use the following request:PUT /blueprint_template_groups/blueprint_template_group_id.xmlPUT /blueprint_template_groups/blueprint_template_group_id.jsonXML Request example:

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

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 265

Page 267: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 IDlabel – blueprint template group nameparent_id - id of the target blueprint template grouplft - left nested set identifierrgt - right nested set identifierdepth - 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 createdupdated_at – the date when the blueprint template group was updatedchildren - the array of child blueprint template groupsrelations - the array of blueprints assigned to the blueprint template groups

19.5 Delete Blueprint Template GroupUse the following API request to delete a blueprint template group:DELETE /blueprint_template_groups/blueprint_template_group_id.xmlDELETE /blueprint_template_groups/blueprint_template_group_id.jsonXML Request example:

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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 266

Page 268: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

_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 IDlabel – blueprint template group nameparent_id - id of the target blueprint template grouplft - left nested set identifierrgt - right nested set identifierdepth - 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 createdupdated_at – the date when the blueprint template group was updatedchildren - the array of child blueprint template groupsrelations - the array of blueprints assigned to the blueprint template groups

19.6 Add Child Blueprint Template GroupTo create new child blueprint template group, use the following request:POST /blueprint_template_groups.xmlPOST /blueprint_template_groups.jsonXML Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 267

Page 269: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

19.7 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.xmlGET /blueprint_template_groups/:blueprint_template_group_id/blueprint_template_group_relations.jsonXML 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_template_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_template_group_relations.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 268

Page 270: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where you have to specify the template group's ID in the URL.

XML Output example

<?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 formatupdated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formathypervisor_id - ID of a compute resource the vApp is located onid - blueprint template IDlabel - blueprint template nameuser_id - ID of a user the blueprint template belongs tovapp_name - name of the vApp this template is created from

19.8 Attach Blueprint Template to GroupUse 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 269

Page 271: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_template_group_relations.xml

JSON Request example

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_template_group_relations.json

Where you have to specify the blueprint template ID and the blueprint template group ID.

19.9 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.xmlDELETE /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/:id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 270

Page 272: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/:id.json

Where you have to specify the blueprint template ID and the blueprint template group ID in the URL.

BILLING PLANS - GET THE LIST OF BILLING PLANS 271

Page 273: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

20 BLUEPRINT TEMPLATES

Blueprint templates are VMware vApps images with operating system and network configuration settings that are used for blueprint creation.

20.1 Get List of Blueprint TemplatesUse the following API call to get the list of blueprint templates:GET /blueprint_templates.xmlGET /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

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 272

Page 274: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</blueprint_templates>

Where:created_at - the date when the blueprint template was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formathypervisor_id - ID of a compute resource the vApp is located onid - blueprint template IDlabel - blueprint template nameuser_id - ID of a user the blueprint template belongs tovapp_name - name of the vApp this template is created from

20.2 Get Blueprint Template DetailsUse the following API call to get blueprint template details:GET /blueprint_templates/:blueprint_template_id.xmlGET /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

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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 273

Page 275: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 formatupdated_at - the date when the blueprint template was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formathypervisor_id - ID of a compute resource the vApp is located onid - blueprint template IDlabel - blueprint template nameuser_id - ID of a user the blueprint template belongs tovapp_name - name of the vApp this template is created from

20.3 Add Blueprint TemplateUse the following API call to create a blueprint template:POST /blueprint_templates.xmlPOST /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_name>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

BILLING PLANS - GET THE LIST OF BILLING PLANS 274

Page 276: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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>

20.4 Edit Blueprint TemplateUse the following API request to edit blueprint template:PUT /blueprint_templates/:blueprint_template_id.xmlPUT /blueprint_templates/:blueprint_template_id.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 275

Page 277: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 falsecreated_at – the date when the blueprint template was createdhypervisor_id - the ID of the compute resource used by this blueprint templateid - blueprint template IDlabel – blueprint template nameupdated_at – the date when the blueprint template was updateduser_id - the ID of the uservapp_name - name of the vApp to create the template from

20.5 Delete Blueprint TemplateUse the following API call to delete a blueprint template:DELETE /blueprint_templates/:blueprint_template_id.xmlDELETE /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 276

Page 278: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where you have to specify ID of a blueprint template you want to remove.

XML Response example

<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 falsecreated_at – the date when the blueprint template was createdhypervisor_id - the ID of the compute resource used by this blueprint templateid - blueprint template IDlabel – blueprint template nameupdated_at – the date when the blueprint template was updateduser_id - the ID of the uservapp_name - name of the vApp to create the template from

BILLING PLANS - GET THE LIST OF BILLING PLANS 277

Page 279: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

21 CATALOGS

This section provides the API calls you can use to manage catalogs imported from vCloud Director.

21.1 Get List of CatalogsTo view the list of catalogs, use the following request:GET /catalogs.xmlGET /catalogs.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vcloud_catalogs type="array"> <vcloud_catalog> <user_id>null</user_id> <hypervisor_id>4</hypervisor_id> <created_at>2016-02-01T11:43:52+00:00</created_at> <updated_at>2016-02-01T11:43:52+00:00</updated_at> <label>vn-onapp-public8</label> <published>true</published> <user_group_id>11</user_group_id> <identifier>a6d6d29a-e8eb-4869-a9af-53a5ec9b792c</identifier> <id>8</id> </vcloud_catalog> <vcloud_catalog>...</vcloud_catalog> </vcloud_catalogs>

Where:user_id - the owner IDhypervisor_id - the ID of the compute resourcecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 278

Page 280: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlabel - the name of the catalogpublished - true if catalog is publisheduser_group_id - the ID of the organisation, to which the catalog is assignedidentifier - the identifier of the catalogid - the ID of the catalog

21.2 Get Catalog DetailsTo view the details of catalog, use the following request:GET /catalogs/:id.xmlGET /catalogs/:id.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vcloud_catalog> <user_id>null</user_id> <hypervisor_id>4</hypervisor_id> <created_at>2016-02-01T11:43:52+00:00</created_at> <updated_at>2016-02-01T11:43:52+00:00</updated_at> <label>vn-onapp-public8</label> <published>true</published> <user_group_id>11</user_group_id> <identifier>a6d6d29a-e8eb-4869-a9af-53a5ec9b792c</identifier> <id>8</id> </vcloud_catalog>

Where:user_id - the owner IDhypervisor_id - the ID of the compute resourcecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlabel - the name of the catalogpublished - true if catalog is published

BILLING PLANS - GET THE LIST OF BILLING PLANS 279

Page 281: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_group_id - the ID of the organisation, to which the catalog is assignedidentifier - the identifier of the catalogid - the ID of the catalog

21.3 Create CatalogTo create a catalog, use the following request:POST /catalogs.xmlPOST /catalogs.jsonXML Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/catalogs.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<vcloud_catalog><user_group_id>11</user_group_id><data_store_id>9</data_store_id><vdc_id>6</vdc_id><label>TestCatalog</label></vcloud_catalog>'

JSON Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/catalogs.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"vcloud_catalog": {"user_group_id": "11", "data_store_id": 9, "vdc_id": "6", "label": "TestCatalog"}}'

Where:user_group_id - the ID of the organisation, to which the catalog will be assigneddata_store_id - the ID of the data store, to which the catalog will be assignedvdc_id - the ID of the resource pool, to which the catalog will be assignedlabel - the name of the catalog

21.4 Add vApp to CatalogTo add a vApp to catalog, use the following request:POST /vapps/:vapp_id/conversion.xmlPOST /vapps/:vapp_id/conversion.jsonXML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H

BILLING PLANS - GET THE LIST OF BILLING PLANS 280

Page 282: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Content-Type: application/xml' http://onapp.test/vapps/:vapp_id/conversion.xml -d '<vcloud-vapp-template><catalog>1</catalog><overwrite-catalog-item>1</overwrite-catalog-item><label>vApp_system_111</label><description>test</description><target-vapp-template>1</target-vapp-template></vcloud-vapp-template>'

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/vapps/:vapp_id/conversion.json -d '{"vcloud_vapp_template":{"catalog":"1","overwrite_catalog_item":"1","label":"vApp_system_111","description":"test","target_vapp_template":"1"}}'

Where:catalog - choose the catalog to which the vApp will be added.overwrite-catalog-item - set "1" to save this vApp as template instead of another vApp template, otherwise set "0".label - specify the name of the vApp. This parameter is applicable only when the overwrite-catalog-item parameter is set to "0".description - add the appropriate vApp description.target-vapp-template - choose the appropriate vApp template, which will be replaced. This parameter is applicable only when the overwrite-catalog-item parameter is set to "1".

21.5 Delete CatalogTo delete a catalog, use the following request:DELETE /catalogs/:id.xmlDELETE /catalogs/:id.xmlXML Request example:

curl -i -X DELETE -u user:userpass --url http://onapp.test/catalogs/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X DELETE -u user:userpass --url http://onapp.test/catalogs/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 281

Page 283: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

21.6 Get List of vApp TemplatesTo view the list of vApp templates, use the following request:GET/catalogs/:id/vapp_templates.xmlGET/catalogs/:id/vapp_templates.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id/vapp_templates.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id/vapp_templates.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vcloud_vapp_templates type="array"> <vcloud_vapp_template> <virtual_machines> <names type="array"></names> </virtual_machines> <created_at>2016-02-01T11:44:24+00:00</created_at> <updated_at>2016-02-01T11:44:24+00:00</updated_at> <label>Centos66_net</label> <catalog_item_id>15</catalog_item_id> <identifier>vappTemplate-51e0fc11-5d6c-46a9-a96c-add3d5b6edca</identifier> <id>12</id> </vcloud_vapp_template> <vcloud_vapp_template>...</vcloud_vapp_template> </vcloud_vapp_templates>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlabel - the name of the vApp templatecatalog_item_id - ID of the catalogidentifier - the identifier of the vApp templateid - ID of the vApp template

BILLING PLANS - GET THE LIST OF BILLING PLANS 282

Page 284: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

21.7 Get List of Media FilesTo view the list of Media files, use the following request:GET/catalogs/:id/media.xmlGET/catalogs/:id/media.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id/media.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/catalogs/:id/media.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vcloud_media type="array"> <vcloud_media> <status>1</status> <user_id>null</user_id> <description>test</description> <data_store_id>2</data_store_id> <image_type>iso</image_type> <created_at>2016-02-04T14:19:26+02:00</created_at> <updated_at>2016-02-04T14:19:26+02:00</updated_at> <label>Kostya000</label> <catalog_item_id>3</catalog_item_id> <identifier>6677d99d-a3af-40d0-aa4a-907b41ab2559</identifier> <vdc_id>1</vdc_id> <id>1</id> <size>414187520</size> </vcloud_media> <vcloud_media>...</vcloud_media> </vcloud_media>

Where:status - the status of media fileuser_id - owner IDdescription - the media file descriptiondata_store_id - the ID of the data store to which the media file is assignedimage_type - the type of the media filecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 283

Page 285: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

label - the name of the media filecatalog_item_id - ID of the catalogidentifier - the identifier of the media filevdc_id - the ID of the resource poolid - the ID of the media filesize - the size of media file

21.8 Create vApp Template (Add to Catalog)

To create a vApp template, use the following request:POST /catalogs/:id/vapp_templates.xmlPOST /catalogs/:id/vapp_templates.jsonXML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/catalogs/:id/vapp_templates.xml -d '<vcloud_vapp_template><label>Template</label><ovf_url>url</ovf_url></vcloud_vapp_template>'

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/catalogs/20/vapp_templates.json -d '{"vcloud_vapp_template":{"label":"Template","ovf_url":"url"}}'

Where:label - the name of the vApp templateovf_url - the link to the vApp templateorfolder - path, where the vApp template is situated

21.9 Delete vApp TemplateTo delete a vApp template, use the following request:DELETE /catalogs/:id/vapp_templates/:id.xmlDELETE /catalogs/:id/vapp_templates/:id.xmlXML Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 284

Page 286: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X DELETE -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/catalogs/:id/vapp_templates/:id.xml

JSON Request example:

curl -i -X DELETE -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/catalogs/:id/vapp_templates/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 285

Page 287: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

22 CDN ACCELERATOR

This chapter provides requests for accelerators.

22.1 Get List of AcceleratorsTo view all accelerators in the cloud with their details, use the following request:GET /accelerators.xmlGET /accelerators.json XML Request example

curl -i -X GET -u user:userpass http://onapp.test/accelerators.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/accelerators.json

XML Output example

<accelerators type="array"><accelerator><admin_note nil="true"/><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><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-09-16T14:41:39+03:00</created_at><customer_network_id nil="true"/><deleted_at nil="true"/><enable_autoscale nil="true"/><enable_monitis type="boolean">false</enable_monitis><firewall_notrack type="boolean">true</firewall_notrack><hot_add_cpu nil="true"/><hot_add_memory nil="true"/><hypervisor_id type="integer">1</hypervisor_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 286

Page 288: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<id type="integer">323</id><identifier>g8u26b0gw5srl1</identifier><initial_root_password>5xkPnFToIv4J</initial_root_password><initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted><instance_package_id nil="true"/><iso_id nil="true"/><label>natalia</label><local_remote_access_ip_address>69.168.237.15</local_remote_access_ip_address><local_remote_access_port type="integer">5900</local_remote_access_port><locked type="boolean">false</locked><memory type="integer">2048</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>Y6eHcWfZsd8V</remote_access_password><service_password nil="true"/><state>delivered</state><strict_virtual_machine_id nil="true"/><suspended type="boolean">false</suspended><template_id type="integer">23</template_id><template_label>OnApp CDN Appliance</template_label><time_zone>Athens</time_zone><updated_at type="datetime">2015-09-23T17:58:03+03:00</updated_at><user_id type="integer">79</user_id><vip nil="true"/><xen_id type="integer">92</xen_id><ip_addresses type="array"><ip_address><address>194.44.20.82</address><broadcast>194.44.20.255</broadcast><created_at type="datetime">2013-11-14T15:48:37+03:00</created_at><customer_network_id nil="true"/><disallowed_primary type="boolean">false</disallowed_primary><gateway>194.44.20.1</gateway><hypervisor_id nil="true"/><id type="integer">3</id><ip_address_pool_id nil="true"/><network_address>194.44.20.0</network_address><network_id type="integer">1</network_id><pxe type="boolean">false</pxe><updated_at type="datetime">2015-09-14T12:16:16+03:00</updated_at><user_id nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 287

Page 289: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<free type="boolean">false</free><netmask>255.255.255.0</netmask></ip_address></ip_addresses><monthly_bandwidth_used type="integer">1095630</monthly_bandwidth_used><total_disk_size type="integer">20</total_disk_size><price_per_hour type="float">0.0</price_per_hour><price_per_hour_powered_off type="float">0.0</price_per_hour_powered_off><support_incremental_backups type="boolean">false</support_incremental_backups><cpu_priority type="integer">1</cpu_priority><edge_status>Active</edge_status><cdn_reference type="integer">410772127</cdn_reference></accelerator><accelerator>...</accelerator></accelerators>

Explanation of the data returned:admin_note – an optional reminder for this accelerator created by an administratorallowed_hot_migrate – true if hot migration is allowed; otherwise falseallowed_swap – true if swap is allowed; otherwise falsebooted – true if the accelerator is booted; otherwise falsebuilt - true if the accelerator is built; otherwise falsecores_per_socket - the number of cores per socket for acceleratorcpu_shares – the CPU priority percentagecpu_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 grantedcpu_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 grantedcpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plancpus – number of CPU cores allocated to this acceleratorcreated_at – the date when the accelerator was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer networkdeleted_at - time when the accelerator was deletedenable_autoscale – false; not available for acceleratorsenable_monitis - deprecated attribute; will be removed in upcoming releasefirewall_notrack - true if the NOTRACK rule is set in iptableshot_add_cpu - false; not available for acceleratorshot_add_memory - false; not available for accelerators

BILLING PLANS - GET THE LIST OF BILLING PLANS 288

Page 290: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

hypervisor_id – the ID of the compute resource, on which the accelerator is deployedid – the accelerator ID in OnApp CP databaseidentifier – the accelerator identifierinitial_root_password – the accelerator root passwordinitial_root_password_encrypted – true, if the accelerator root password is encrypted, otherwise falseinstance package_id - false; not available for acceleratorsiso_id - false; not available for acceleratorslabel – an arbitrary name of the acceleratorlocal_remote_access_ip_address - the IP address used for console accesslocal_remote_access_port – the port ID used for console accesslocked – true if locked; otherwise falsememory – the amount of RAM resources allocated to this acceleratormin_disk_size – minimum disk space required by the templatenote - an optional reminder for this accelerator made by a user accountoperating_system – type of operating systemoperating_system_distro – the distribution of the operating systempreferred_hvs - the array of preferable compute resources based on compute zone that meet some accelerator configuration settingsrecovery_mode – true if the accelerator is booted in the recovery mode; otherwise falseremote_access_password – the password for remote accessservice_password - service account passwordstate – deprecated attribute; will be removed in upcoming releasestrict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this acceleratorsuspended – true if suspended; otherwise falsetemplate_id – the ID of the template, on which the accelerator is basedtemplate_label – label of the template on which the accelerator is basedtime zone - the time zone set for the acceleratorupdated_at – the date when the accelerator was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id – the ID of the user, who is the accelerator ownervip – true if the accelerator has VIP status for migration; otherwise falsexen_id – the accelerator ID set by the virtualization engineip_addresses – an array of assigned IP addresses with their details assigned to this accelerator: address – IP address 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 289

Page 291: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ip_address_pool_id - ID of the IP address pool the IP address is associated with

network_address - IP 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 - 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 - accelerator monthly bandwidth in KB

total_disk_size – total disk space in GB of primary and swap disks

price_per_hour - accelerator's price per hour

price_per_hour_powered_off - price per hour when accelerator is powered off

support_incremental_backups - 1, if accelerator 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 CDN server status

cdn_reference - the identifier in database

22.2 Get Accelerator DetailsTo view the accelerator details:GET /accelerators/:id.xmlGET /accelerators/:id.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/accelerators/:id.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/accelerators/:id.json

XML Output example

<accelerator><admin_note nil="true"/><allowed_hot_migrate type="boolean">true</allowed_hot_migrate><allowed_swap type="boolean">true</allowed_swap>

BILLING PLANS - GET THE LIST OF BILLING PLANS 290

Page 292: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<booted type="boolean">true</booted><built type="boolean">true</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-09-16T14:41:39+03:00</created_at><customer_network_id nil="true"/><deleted_at nil="true"/><enable_autoscale nil="true"/><enable_monitis type="boolean">false</enable_monitis><firewall_notrack type="boolean">true</firewall_notrack><hot_add_cpu nil="true"/><hot_add_memory nil="true"/><hypervisor_id type="integer">1</hypervisor_id><id type="integer">323</id><identifier>g8u26b0gw5srl1</identifier><initial_root_password>5xkPnFToIv4J</initial_root_password><initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted><instance_package_id nil="true"/><iso_id nil="true"/><label>natalia</label><local_remote_access_ip_address>69.168.237.15</local_remote_access_ip_address><local_remote_access_port type="integer">5900</local_remote_access_port><locked type="boolean">false</locked><memory type="integer">2048</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>Y6eHcWfZsd8V</remote_access_password><service_password nil="true"/><state>delivered</state><strict_virtual_machine_id nil="true"/><suspended type="boolean">false</suspended><template_id type="integer">23</template_id><template_label>OnApp CDN Appliance</template_label><time_zone>Athens</time_zone><updated_at type="datetime">2015-09-23T17:58:03+03:00</updated_at><user_id type="integer">79</user_id><vip nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 291

Page 293: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<xen_id type="integer">92</xen_id><ip_addresses type="array"><ip_address><address>194.44.20.82</address><broadcast>194.44.20.255</broadcast><created_at type="datetime">2013-11-14T15:48:37+03:00</created_at><customer_network_id nil="true"/><disallowed_primary type="boolean">false</disallowed_primary><gateway>194.44.20.1</gateway><hypervisor_id nil="true"/><id type="integer">3</id><ip_address_pool_id nil="true"/><network_address>194.44.20.0</network_address><network_id type="integer">1</network_id><pxe type="boolean">false</pxe><updated_at type="datetime">2015-09-14T12:16:16+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 type="integer">938418</monthly_bandwidth_used><total_disk_size type="integer">20</total_disk_size><price_per_hour type="float">0.0</price_per_hour><price_per_hour_powered_off type="float">0.0</price_per_hour_powered_off><support_incremental_backups type="boolean">false</support_incremental_backups><cpu_priority type="integer">1</cpu_priority><edge_status>Active</edge_status><cdn_reference type="integer">410772127</cdn_reference></accelerator>

Explanation of the data returned:admin_note – an optional reminder for this accelerator created by an administratorallowed_hot_migrate – true if hot migration is allowed; otherwise falseallowed_swap – true if swap is allowed; otherwise falsebooted – true if the accelerator is booted; otherwise falsebuilt - true if the accelerator is built; otherwise falsecores_per_socket - the number of cores per socket for acceleratorcpu_shares – the CPU priority percentagecpu_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 292

Page 294: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 grantedcpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plancpus – number of CPU cores allocated to this acceleratorcreated_at – the date when the accelerator was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer networkdeleted_at - time when the accelerator was deletedenable_autoscale – false; not available for acceleratorsenable_monitis - deprecated attribute; will be removed in upcoming releasefirewall_notrack - true if the NOTRACK rule is set in iptableshot_add_cpu - false; not available for acceleratorshot_add_memory - false; not available for acceleratorshypervisor_id – the ID of the compute resource, on which the accelerator is deployedid – the accelerator ID in OnApp CP databaseidentifier – the accelerator identifierinitial_root_password – the accelerator root passwordinitial_root_password_encrypted – true, if the accelerator root password is encrypted, otherwise falseinstance package_id - false; not available for acceleratorsiso_id - false; not available for acceleratorslabel – an arbitrary name of the acceleratorlocal_remote_access_ip_address - the IP address used for console accesslocal_remote_access_port – the port ID used for console accesslocked – true if locked; otherwise falsememory – the amount of RAM resources allocated to this acceleratormin_disk_size – minimum disk space required by the templatenote - an optional reminder for this accelerator made by a user accountoperating_system – type of operating systemoperating_system_distro – the distribution of the operating systempreferred_hvs - the array of preferable compute resources based on compute zone that meet some accelerator configuration settingsrecovery_mode – true if the accelerator is booted in the recovery mode; otherwise falseremote_access_password – the password for remote accessservice_password - service account passwordstate – deprecated attribute; will be removed in upcoming releasestrict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this acceleratorsuspended – true if suspended; otherwise falsetemplate_id – the ID of the template, on which the accelerator is basedtemplate_label – label of the template on which the accelerator is basedupdated_at – the date when the accelerator was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id – the ID of the user, who is the accelerator ownervip – true if the accelerator has VIP status for migration; otherwise falsexen_id – the accelerator ID set by the virtualization engine

BILLING PLANS - GET THE LIST OF BILLING PLANS 293

Page 295: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ip_addresses – an array of assigned IP addresses with their details assigned to this accelerator: address – IP address 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 network_address - IP 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 - 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 - accelerator monthly bandwidth in KB

total_disk_size – total disk space in GB of primary and swap disks

price_per_hour - accelerator's price per hour

price_per_hour_powered_off - price per hour when accelerator is powered off

support_incremental_backups - 1, if accelerator 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 CDN server status

cdn_reference - the identifier in database

22.3 Add AcceleratorTo create an accelerator, use the following API call:POST /accelerators.xmlPOST /accelerators.json

Below you can find requirements for Accelerator creation:

BILLING PLANS - GET THE LIST OF BILLING PLANS 294

Page 296: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Minimum: 4 cores, 4GB RAM and 100GB disks Recommended: 8 cores, 16 GB RAM and 1TB disks SSD recommended to avoid slowing down access

XML Request example

curl -i -X POST -d '<accelerator><label>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</required_virtual_machine_build><hypervisor_group_id>1</hypervisor_group_id><hypervisor_id>1</hypervisor_id><required_ip_address_assignment>1</required_ip_address_assignment><primary_disk_size>5</primary_disk_size><rate_limit>0</rate_limit></accelerator>' -u user:userpass http://onapp.test/accelerators.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -d '{"accelerator":{"label":"test","cpus":"1","data_store_group_primary_id":"2","primary_network_group_id":"3","cpu_shares":"1" ,"memory":"512","required_virtual_machine_build":"1","hypervisor_group_id":"1","hypervisor_id":"1","required_ip_address_assignment":"1","primary_disk_size":"5","rate_limit":"0" }}' -u user:userpass http://onapp.test/accelerators.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label – a unique name of your accelerator. 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 accelerator will be deployedhypervisor_group_id - indicate the compute zone IDcpus * - the amount of CPU cores allocated to this acceleratorcpu_shares * - the percentage of allocated CPU priority resourcememory * - the amount of RAM, which you want to allocate to this acceleratorprimary_disk_size * - the size in GB of the primary diskrate_limit - the port speed

BILLING PLANS - GET THE LIST OF BILLING PLANS 295

Page 297: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

data_store_group_primary_id – specify the ID of a data store zone, where you want to locate the disk of your accelerator. If not specified – the system will select the data store zone with higher available capacityprimary_network_group_id – indicate the network zone IDrequired_virtual_machine_build – set "1" to build the accelerator 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"

22.4 Edit AcceleratorTo change the accelerator label, resource allocation:PUT /accelerators/:id.xmlPUT /accelerators/:id.json XML Request example

curl -i -X PUT -d '<accelerator><label>test</label><cpus>1</cpus><cpu_shares>10</cpu_shares><memory>512</memory></accelerator>' -u onapp.test http://onapp.test/accelerators/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -d '{"accelerator":{"label":"test","cpus":"1","cpu_shares":"20","memory":"512"}}' -u onapp.test http://onapp.test/accelerators/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label – a unique name of your accelerator. 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 acceleratorcpu_shares - the percentage of allocated CPU priority resourcememory - the amount of RAM, which you want to allocate to this acceleratorReturns HTTP 204 response on successful processing, and HTTP 404 when there is no accelerator with a requested ID, or URL is incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 296

Page 298: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

22.5 Reboot AcceleratorTo reboot the accelerator:POST /accelerators/:accelerator_id/reboot.xmlPOST /accelerators/:accelerator_id/reboot.json XML Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/reboot.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/reboot.json -H 'Accept: application/json' -H 'Content-type: application/json'

22.6 Start up AcceleratorPOST /accelerators/:accelerator_id/startup.xmlPOST /accelerators/:accelerator_id/startup.json XML Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_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/accelerators/:accelerator_id/startup.json -H 'Accept: application/json' -H 'Content-type: application/json'

22.7 Shut down AcceleratorTo terminate the edge server gracefully:POST /accelerators/:accelerator_id/shutdown.xmlPOST /accelerators/:accelerator_id/shutdown.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 297

Page 299: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/shutdown.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/shutdown.json -H 'Accept: application/json' -H 'Content-type: application/json'

22.8 Suspend AcceleratorPOST /accelerators/:accelerator_id/suspend.xmlPOST /accelerators/:accelerator_id/suspend.json XML Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_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/accelerators/:accelerator_id/suspend.json -H 'Accept: application/json' -H 'Content-type: application/json'

To unsuspend the accelerator, run the request again.

22.9 Rebuild AcceleratorTo rebuild (or build manually) the accelerator, use the following request:POST /accelerators/:accelerator_id/build.xmlPOST /accelerators/:accelerator_id/build.json XML Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/build.xml

JSON Request example

curl -i -X POST -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 298

Page 300: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/accelerators/:accelerator_id/build.json

22.10 Migrate AcceleratorTo migrate an accelerator to another compute resource, use the following request:POST /accelerators/:accelerator_id/migrate.xmlPOST /accelerators/:accelerator_id/migrate.json

Currently, accelerators support only cold migration.

XML Request example

*curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d "<accelerator><destination>1</destination><cold_migrate_on_rollback>1</cold_migrate_on_rollback></accelerator>" --url http://onapp.test/accelerators/:accelerator_id/migrate.xml*

JSON Request example

*curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"accelerator":{"destination":"1","cold_migrate_on_rollback":"1"}}' --url http://onapp.test/accelerators/:accelerator_id/migrate.json*

Where:destination * - the ID of a target compute resource, to which you migrate the acceleratorcold_migrate_on_rollback - set 1 if you wish to switch to a cold migration if hot migration fails, otherwise set 0.

22.11 Delete AcceleratorDELETE /accelerators/:id.xmlDELETE /accelerators/:id.json XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/accelerators/accelerator_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 299

Page 301: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X DELETE -u user:userpass http://onapp.test/accelerators/:accelerator_id.json -H 'Content-type: application/json'

If there are accelerated virtual servers in the cloud, these VSs will be still billed for acceleration even if you delete the accelerator.

Returns HTTP 204 response on successful processing, and HTTP 404 when there is no accelerator with a requested ID, or URL is incorrect.

22.12 Unlock AcceleratorTo unlock the accelerator:POST /accelerators/:accelerator_id/unlock.xmlPOST /accelerators/:accelerator_id/unlock.json XML Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/unlock.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/accelerators/:accelerator_id/unlock.json -H 'Accept: application/json' -H 'Content-type: application/json'

22.13 Segregate AcceleratorTo segregate an accelerator (that is, instruct it never to reside on the same compute resource with another accelerator), use the following method:POST /accelerators/:accelerator_id/strict_vm.xmlPOST /accelerators/:accelerator_id/strict_vm.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="UTF-8"?><virtual_machine><strict_virtual_machine_id>bb6oa3eqdzpcgl</strict_virtual_machine_id></virtual_machine>' --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 300

Page 302: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/accelerators/:accelerator_id/strict_vm.xml*

JSON Request example

*curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"strict_virtual_machine_id":"gv03xz1x31t53h"}}' --url http://onapp.test/accelerators/:accelerator_id/strict_vm.json*

Where:strict_virtual_machine_id * - the ID of accelerator you wish to segregate from the given accelerator

22.14 Change Accelerator OwnerUse the following request to reassign an accelerator to another user:POST /accelerators/:accelerator_id/change_owner.xmlPOST /accelerators/:accelerator_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/accelerators/:accelerator_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/accelerators/:accelerator_id/change_owner.json*

Where:user_id * – input ID of a new owner

22.15 Accelerator Network InterfacesHere is the list of API calls for managing accelerators' network interfaces. Accelerators' network interfaces have the same attributes as network interfaces of virtual servers.

To get the list of network interfaces allocated to this particular accelerator:GET /accelerators/:accelerator_id/network_interfaces.xmlGET /accelerators/:accelerator_id/network_interfaces.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 301

Page 303: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

To get a particular network interface details:GET /accelerators/:accelerator_id/network_interfaces/:id.xmlGET /accelerators/:accelerator_id/network_interfaces/:id.jsonTo edit network interface details:PUT /accelerators/:accelerator_id/network_interfaces/:id.xmlPUT /accelerators/:accelerator_id/network_interfaces/:id.jsonTo add a new network interface:POST /accelerators/:accelerator_id/network_interfaces.xmlPOST /accelerators/:accelerator_id/network_interfaces.jsonTo delete a network interface from the accelerator:DELETE /accelerators/:accelerator_id/network_interfaces/:id.xmlDELETE /accelerators/:accelerator_id/network_interfaces/:id.json

XML Output example

<network_interface><connected nil="true"/><created_at type="datetime">2015-09-25T14:33:13+03:00</created_at><default_firewall_rule>ACCEPT</default_firewall_rule><id type="integer">372</id><identifier>yekx0libarssan</identifier><label>eth0</label><mac_address>00:16:3e:81:42:83</mac_address><network_join_id type="integer">5</network_join_id><primary type="boolean">true</primary><rate_limit type="integer">1</rate_limit><updated_at type="datetime">2015-09-25T14:33:13+03:00</updated_at><usage nil="true"/><usage_last_reset_at nil="true"/><usage_month_rolled_at nil="true"/><virtual_machine_id type="integer">359</virtual_machine_id></network_interface>

Where:label - network interface namecreated_at - the timestamp in the database when this network interface was createddefault_firewall_rule - set default firewall rule for the particular network interface – either DROP or ACCEPTupdated_at - the timestamp in the database when this network interface was updatedprimary - True if this network interface is primary, otherwise falseid - the ID of this network interfacemac_address – network interface mac addressrate_limit - port speed in Mbpsidentifier - the identifier in the database of this network interfacenetwork_join_id - the ID of the network join to which this network interface belongsvirtual_machine_id - the ID of an accelerator to which this network interface is attached

BILLING PLANS - GET THE LIST OF BILLING PLANS 302

Page 304: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

connected - not relevant to acceleratorsusage - not relevant to acceleratorsusage_last_reset_at - not relevant to acceleratorsusage_month_rolled_at - not relevant to accelerators

22.16 Accelerator IP Address JoinsAn IP address allocated to an accelerator is an IP address join. Use the following methods to view, assign and delete IP address joins of your accelerators.

To get the list of IP address assignments for a particular accelerator:GET /accelerators/:accelerator_id/ip_addresses.xmlGET /accelerators/:accelerator_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/accelerators/:accelerator_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/accelerators/:accelerator_id/ip_addresses.json

To assign an IP Address to an accelerator:POST /accelerators/:accelerator_id/ip_addresses.xmlPOST /accelerators/:accelerator_id/ip_addresses.jsonXML 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>7</ip_address_id><network_interface_id>131</network_interface_id></ip_address_join>' --url http://onapp.test/accelerators/:accelerator_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 303

Page 305: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http:///onapp.test/accelerators/:accelerator_id/ip_addresses.json

XML Response Example

Status: 201Content-Length: 1065Connection: closeContent-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 DBid - the IP address join IDip_address_id - the IP address ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 304

Page 306: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

network_interface_id - the network interface IDupdated_at - the date when the record was updated in DBip_address - the array of IP address detailsaddress - the IP addressbroadcast - 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 networkdisallowed_primary - true if this address is not set as primary (for VS build), otherwise falsegateway - gateway addresshypervisor_id - the ID of the compute resourceip_address_pool_id - the ID of the IP address pool to which this join belongsnetwork_address - the address of a VLAN network address that will be associated with this IP address poolnetwork_id - the ID of the networkpxe - true, if this address can be used for cloudbooting a compute resourcefree - true if free, otherwise falsenetmask — netmask for the IP addressTo delete an IP address assignment from a particular accelerator:DELETE /accelerators/:accelerator_id/ip_addresses/:id.xmlDELETE /accelerators/:accelerator_id/ip_addresses/:id.jsonXML Request Example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/accelerators/:accelerator_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/accelerators/:accelerator_id/ip_addresses/:ip_address_join_id.json

Where:data_store_id - the ID of the data store, which is attached to the compute resourcehypervisor_id - reserved parameterid - the join IDtarget_join_id - the ID of the join target; in this case it is the compute resource IDtarget_join_type - type of join target; in this case it is compute resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 305

Page 307: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

22.17 View Accelerator DisksTo view the accelerator disks:GET /accelerators/:accelerator_id/disks.xmlGET /accelerators/:accelerator_id/disks.jsonXML Output example

<disks type="array"><disk><mounted>true</mounted><built type="boolean">true</built><burst_bw type="integer">1000</burst_bw><created_at type="datetime">2015-09-25T14:33:13+03:00</created_at><data_store_id type="integer">4</data_store_id><disk_size type="integer">20</disk_size><disk_vm_number type="integer">1</disk_vm_number><file_system type="symbol">ext3</file_system><id type="integer">460</id><identifier>pd60674pgnqfx4</identifier><iqn nil="true"/><is_swap type="boolean">false</is_swap><label>Disk#460</label><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">2015-09-27T19:26:54+03:00</updated_at><virtual_machine_id type="integer">359</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 falseadd_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise false

mounted - set 'true' to mount the disk inside OS automatically, otherwise set 'false'

You can use a single mounted parameter, to substitute the two add_to_linux_fstab andadd_to_freebsd_fstab parameters.

built - true if the disk is built, otherwise falsecreated_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 306

Page 308: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_id - the ID of the data store this disk is locateddisk_size - disk size in GBdisk_vm_number - the number of virtual servers using this diskfile_system - disk filesystem (ext3 or ext4)id - the disk IDidentifier - disk identifieris_swap - true if this is a swap disk, otherwise falselabel - disk's labellocked - true if the disk is locked, otherwise falsemount_point - disk mount point.primary - true if the disk is primary. Otherwise false.virtual_machine_id - the ID of the accelerator using this diskvolume_id - data store IDhas_autobackups - true if the disk has automatic backups set up, otherwise falseSolidFire - related parameters (irrelevant for accelerators)iqn burst_bwmax_bw

22.18 Rebuild Network for AcceleratorIt is required to rebuild network after any changes on IP address joins or network interfaces. To rebuild network, use the following request:POST /accelerators/:accelerator_id/rebuild_network.xmlPOST /accelerators/:accelerator_id/rebuild_network.json XML Request example

curl -X POST -u user:userpass --url 'http://onapp.test/accelerators/:accelerator_id/rebuild_network.xml?force=1&shutdown_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/accelerators/:accelerator_id/rebuild_network.json?force=1&shutdown_type=hard&required_startup=1' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 307

Page 309: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

accelerator_id - ID of the accelerator

shutdown_type - type of the accelerator shutdown: hard, graceful or softrequired_startup - set 1 to start up the accelerator automatically after build, otherwise set 0

22.19 Get Accelerator CPU Usage Statistics

To view CPU usage statistics of an accelerator, run:GET /accelerators/:accelerator_id/cpu_usage.xmlGET /accelerators/:accelerator_id/cpu_usage.json

Define a shorter period by setting Start and End time in the API call:GET /accelerators/:accelerator_id/vm_stats.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1GET /accelerators/:accelerator_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/accelerators/:accelerator_id/cpu_usage.xml

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/accelerators/:accelerator_id/cpu_usage.json

Where you have to specify the accelerator ID.

BILLING PLANS - GET THE LIST OF BILLING PLANS 308

Page 310: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

23 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.

23.1 Get List of CDN Edge GroupsTo view CDN edge groups available in the cloud:

GET /edge_groups.xmlGET /edge_groups.json XML Output example

<?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 labelid – the group id in the database

BILLING PLANS - GET THE LIST OF BILLING PLANS 309

Page 311: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

23.2 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.xmlGET /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:label – the edge group labeledge_group_locations – the array of locations assigned to this group:edge_group_location – the list of details for a particular edge groupcity – the city where the edge server is locatedprice - price per GB of sold excess bandwidthcreated_at – the date when the record was created in DBcountry –- country codes, related to country_access_policy in ISO 3166-1 alpha-2 format

BILLING PLANS - GET THE LIST OF BILLING PLANS 310

Page 312: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

aflexi_location_id – the ID of this location in Aflexi databaseupdated_at – the date when the record was updated in DBid – the location IDoperator – the location operatoredge_group_id – the ID of the edge group to which this location is assigned

23.3 Get CDN Edge Group DetailsTo view the edge group details, use the following request:GET /edge_groups/:id.xmlGET /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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 311

Page 313: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 locationsassigned_locations – an array of locations, which are assigned to the groupcity – city where the edge server is locatedregion – region where the edge server is locatedprice – price per GB of sold excess bandwidthlatitude – latitude of the server locationlongitude – longitude of the server locationcountry –country codes related to country_access_policy in ISO 3166-1 alpha-2 formatupdated_at – date when the location was updateddeleted – true if the location is deleted; otherwise falseid – the ID of location in the OnApp CP data basecreated_at- date, when the location was createddescription – optional description of the location

23.4 Add CDN Edge GroupTo create an edge group, use the following API call:

BILLING PLANS - GET THE LIST OF BILLING PLANS 312

Page 314: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /edge_groups.xmlPOST /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

23.5 Edit CDN Edge GroupYou can edit the label of the edge group:PUT /edge_groups/:id.xmlPUT /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 313

Page 315: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

23.6 Delete CDN Edge GroupTo delete the edge group, use the following request:DELETE /edge_groups/:id.xmlDELETE /edge_groups/:id.json XML Request example

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.

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.

23.7 Assign Location to CDN Edge GroupCDN 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.xmlPOST /edge_groups/:edge_group_id/assign.jsonXML 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

curl -i -X POST -u user:userpass http://onapp.test/edge_groups/1/assign.json -d '{"location":"175"}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 314

Page 316: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

-H 'Accept:application/json' -H 'Content-type: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.

23.8 Unassign Location From CDN Edge Group

To remove a location from the group, use the following method:POST /edge_groups/:edge_group_id/unassign.xmlPOST /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 'Content-type: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.

23.9 Modify CDN Edge GroupTo modify CDN edge group, run:POST /edge_groups/:edge_group_id/modify.xmlPOST /edge_groups/:edge_group_id/modify.jsonXML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 315

Page 317: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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.

23.10 Search CDN Edge GroupsTo search for a specific CDN Edge Group, use the following request:GET /edge_groups.xml?q=labelGET /edge_groups.json?q=labelWhere 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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 316

Page 318: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

Where:created_at - the date when the edge group was createdid – the resource ID in the databaselabel - the edge group labelupdated_at – the date when the edge group was updatedcdn_reference - the identifier in database

BILLING PLANS - GET THE LIST OF BILLING PLANS 317

Page 319: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24 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.

24.1 Get List of CDN Edge ServersTo view all edge servers in the cloud with their details, use the following request:GET /edge_servers.xmlGET /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 serversXML 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?

BILLING PLANS - GET THE LIST OF BILLING PLANS 318

Page 320: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"/><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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 319

Page 321: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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><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 falseadmin_note – an optional reminder for this VS created by an administratorallow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise falseallowed_hot_migrate – true if hot migration is allowed; otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 320

Page 322: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

allowed_swap – true if swap is allowed; otherwise falsebooted – true if the server is booted; otherwise falsecpu_shares – the CPU priority percentagecpu_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 grantedcpu_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 grantedcpu_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 servercreated_at – the date when the CDN edge server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer networkdeleted_at - time when the VS was deletededge_server_type - true if this is the edge serverenable_autoscale – false; not available for edge serversenable_monitis - deprecated attribute; will be removed in upcoming releasefirewall_notrack - true if the NOTRACK rule is set in iptableshypervisor_id – the ID of the compute resource, on which the server is deployedid – the edge server ID in OnApp CP databaseidentifier – the edge server identifierinitial_root_password – the server root passwordinitial_root_password_encrypted – true, if the server root password is encrypted, otherwise falselabel – an arbitrary name of the edge serverlocal_remote_access_port – the port ID used for console accesslocked – true if locked; otherwise falsememory – the amount of RAM resources allocated to this edge servermin_disk_size – minimum disk space required by the templatenote - an optional reminder for this VS made by a user accountoperating_system – type of operating systemoperating_system_distro – the distribution of the operating systempreferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settingsrecovery_mode – true if the server is booted in the recovery mode; otherwise falseremote_access_password – the password for remote accessservice_password - service account passwordstate – deprecated attribute; will be removed in upcoming releasestorage_server_type - true if this is a storage serverstrict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this serversuspended – true if suspended; otherwise falsetemplate_id – the ID of the template, on which the edge server is basedtemplate_label – label of the template on which the server is based; currently – OnApp CDN compute resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 321

Page 323: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id – the ID of the user, who is the server ownervip – true if the server has VIP status for migration; otherwise falsexen_id – the edge server ID set by the virtualization engineip_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

24.2 Get CDN Edge Server DetailsTo view the edge server details:

BILLING PLANS - GET THE LIST OF BILLING PLANS 322

Page 324: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /edge_servers/:id.xmlGET /edge_servers/:id.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/edge_servers/:id.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/edge_servers/:id.json

To get the list of HTTP edge serversXML 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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 323

Page 325: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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"/><disallowed_primary type="boolean">false</disallowed_primary>

BILLING PLANS - GET THE LIST OF BILLING PLANS 324

Page 326: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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><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 falseadmin_note – an optional reminder for this VS created by an administratorallow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise falseallowed_hot_migrate – true if hot migration is allowed; otherwise falseallowed_swap – true if swap is allowed; otherwise falsebooted – true if the server is booted; otherwise falsecpu_shares – the CPU priority percentagecpu_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 grantedcpu_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 grantedcpu_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 servercreated_at – the date when the CDN edge server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - ID of a customer network

BILLING PLANS - GET THE LIST OF BILLING PLANS 325

Page 327: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

deleted_at - time when the VS was deletededge_server_type - true if this is the edge serverenable_autoscale – false; not available for edge serversenable_monitis - deprecated attribute; will be removed in upcoming releasefirewall_notrack - true if the NOTRACK rule is set in iptableshypervisor_id – the ID of the compute resource, on which the server is deployedid – the edge server ID in OnApp CP databaseidentifier – the edge server identifierinitial_root_password – the server root passwordinitial_root_password_encrypted – true, if the server root password is encrypted, otherwise falselabel – an arbitrary name of the edge serverlocal_remote_access_port – the port ID used for console accesslocked – true if locked; otherwise falsememory – the amount of RAM resources allocated to this edge servermin_disk_size – minimum disk space required by the templatenote - an optional reminder for this VS made by a user accountoperating_system – type of operating systemoperating_system_distro – the distribution of the operating systempreferred_hvs - the array of preferable compute resources based on compute zone that meet some VS configuration settingsrecovery_mode – true if the server is booted in the recovery mode; otherwise falseremote_access_password – the password for remote accessservice_password - service account passwordstate – deprecated attribute; will be removed in upcoming releasestorage_server_type - true if this is a storage serverstrict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this serversuspended – true if suspended; otherwise falsetemplate_id – the ID of the template, on which the edge server is basedtemplate_label – label of the template on which the server is based; currently – OnApp CDN compute resourceupdated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id – the ID of the user, who is the server ownervip – true if the server has VIP status for migration; otherwise falsexen_id – the edge server ID set by the virtualization engineip_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 326

Page 328: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

24.3 Add CDN Edge ServerTo create an edge server, use the following API call:POST /edge_servers.xmlPOST /edge_servers.json XML Request example

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_network_group_id>3</primary_network_group_id><cpu_shares>1</cpu_shares><memory>2048</memory><required_virtual_machine_build>1</required_virtual_machine_build><hypervisor_group_id>1</hypervisor_group_id><hypervisor_id>1</hypervisor_id><required_ip_address_assignment>1</required_ip_address_assignment><primary_disk_size>20</primary_disk_size><rate_limit>0</rate_limit><cdn_location>5</cdn_location><edge_server_type>http</edge_server_type></

BILLING PLANS - GET THE LIST OF BILLING PLANS 327

Page 329: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

edge_server>' -u user:userpass http://onapp.test/edge_servers.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -d '{"edge_server":{"label":"az_CDN_test","add_to_marketplace":"true","cpus":"1","data_store_group_primary_id":"2","primary_network_group_id":"3","cpu_shares":"1" ,"memory":"2048","required_virtual_machine_build":"1","hypervisor_group_id":"1","hypervisor_id":"1","required_ip_address_assignment":"1","primary_disk_size":"20","rate_limit":"0", "cdn_location":"5","edge_server_type":"http"}}' -u user:userpass http://onapp.test/edge_servers.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 [ _ ]hypervisor_id - indicate the ID of the compute resource, on which the server will be deployedhypervisor_group_id - indicate the compute zone IDcpus * - the amount of CPU cores allocated to this edge servercpu_shares * - the percentage of allocated CPU priority resourcememory * - the amount of RAM, which you want to allocate to this edge serverprimary_disk_size * - the size in GB of the primary diskdata_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 capacityprimary_network_group_id – indicate the network zone IDrequired_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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 328

Page 330: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24.3.1 Page Historyv. 3.3.1

cdn_location parameter

edge_server_type

24.4 Edit CDN Edge ServerTo change the server label and resource allocation:PUT /edge_servers/:id.xmlPUT /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_marketplace><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_shares":"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 servercpu_shares - the percentage of allocated CPU priority resourcememory - the amount of RAM, which you want to allocate to this edge serverReturns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 329

Page 331: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24.5 Reboot CDN Edge ServerTo reboot the edge server:POST /edge_servers/:edge_server_id/reboot.xmlPOST /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

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'

24.6 Reboot CDN Edge Server in RecoveryTo 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.xmlPOST /edge_servers/:edger_server_id/reboot.jsonXML 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

24.7 Start up CDN Edge ServerPOST /edge_servers/:edge_server_id/startup.xmlPOST /edge_servers/:edge_server_id/startup.json XML Request example

curl -i -X POST -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 330

Page 332: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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'

24.8 Shut down CDN Edge ServerTo terminate the edge server gracefully:POST /edge_servers/:edge_server_id/shutdown.xmlPOST /edge_servers/:edge_server_id/shutdown.json XML Request example

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'

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'

24.9 Stop CDN Edge ServerTo terminate the edge server forcefully:POST /edge_servers/:edge_server_id/stop.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 331

Page 333: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/edge_servers/:edge_server_id/stop.json -H 'Accept: application/json' -H 'Content-type: application/json'

24.10 Rebuild CDN Edge ServerTo rebuild (or build manually) the edge server, use the following request:POST /edge_servers/:edge_server_id/build.xmlPOST /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="UTF-8"?><edge_server><template_id>398</template_id><required_startup>1</required_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 basedrequired_startup – set "1" to start up the server automatically after build, otherwise set "0"

24.11 Suspend CDN Edge ServerPOST /edge_servers/:edge_server_id/suspend.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 332

Page 334: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

24.12 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.xmlPOST /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

24.13 Unlock CDN Edge ServerTo unlock the edge server:POST /edge_servers/:edge_server_id/unlock.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 333

Page 335: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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'

24.14 Delete CDN Edge ServerDELETE /edge_servers/:id.xmlDELETE /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.

24.15 Migrate CDN Edge ServerTo migrate an edge server to another compute resource, use the following request:POST /edge_servers/:edge_server_id/migrate.xmlPOST /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_on_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 334

Page 336: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 servercold_migrate_on_rollback - set 1 if you wish to switch to a cold migration if hot migration fails, otherwise set 0.

24.16 Segregate CDN Edge ServerTo 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.xmlPOST /edge_servers/:edge_server_id/strict_vm.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="UTF-8"?><virtual_machine><strict_virtual_machine_id>bb6oa3eqdzpcgl</strict_virtual_machine_id></virtual_machine>' --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 '{"virtual_machine":{"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

24.17 Open CDN Edge Server ConsoleTo open an edge server console:

1. Run the following request:GET /edge_servers/:edge_server_id/console.xmlGET /edge_servers/:edge_server_id/console.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 335

Page 337: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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\]*

24.18 Change CDN Edge Server OwnerUse the following request to reassign an edge server to another user:POST /edge_servers/:edge_server_id/change_owner.xmlPOST /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

24.19 Set VIP Status for CDN Edge ServerTo give your edge server a migration priority, set the VIP status for it with the following request:POST /edge_servers/:edge_server_id/set_vip.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 336

Page 338: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'{"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.

24.20 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.xmlPUT /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

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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 337

Page 339: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Returns HTTP 204 response on successful processing, and HTTP 404 when there is no edge server with a requested ID, or URL is incorrect.

24.21 CDN Edge Server DisksSince 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.xmlGET /edge_servers/:edge_server_id/disks.jsonParameters description and output example.For other possible requests, refer to corresponding sections of Disks chapter.

24.22 CDN Edge Server Network InterfacesHere 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.xmlGET /edge_servers/:edge_server_id/network_interfaces.jsonTo get a particular network interface details:GET /edge_servers/:edge_server_id/network_interfaces/:id.xmlGET /edge_servers/:edge_server_id/network_interfaces/:id.jsonTo edit network interface details:PUT /edge_servers/:edge_server_id/network_interfaces/:id.xmlPUT /edge_servers/:edge_server_id/network_interfaces/:id.jsonTo add a new network interface:POST /edge_servers/:edge_server_id/network_interfaces.xmlPOST /edge_servers/:edge_server_id/network_interfaces.jsonTo delete a network interface from the edge server:DELETE /edge_servers/:edge_server_id/network_interfaces/:id.xmlDELETE /edge_servers/:edge_server_id/network_interfaces/:id.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?>

BILLING PLANS - GET THE LIST OF BILLING PLANS 338

Page 340: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 namecreated_at - the timestamp in the database when this network interface was createdupdated_at - the timestamp in the database when this network interface was updatedprimary - True if this network interface is primary, otherwise falseid - the ID of this network interfacemac_address – network interface mac addressrate_limit - port speed in Mbpsidentifier - the identifier in the database of this network interfacenetwork_join_id - the ID of the network join to which this network interface belongsvirtual_machine_id - the ID of a virtual server to which this network interface is attached

24.23 CDN Edge Server IP Address JoinsAn 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.xmlGET /edge_servers/:edge_server_id/ip_addresses.json

XML Request Example

BILLING PLANS - GET THE LIST OF BILLING PLANS 339

Page 341: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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

To assign an IP Address to an edge server:POST /edge_servers/:edge_server_id/ip_addresses.xmlPOST /edge_servers/:edge_server_id/ip_addresses.jsonXML 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>7</ip_address_id><network_interface_id>131</network_interface_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.json

XML Response Example

Status: 201Content-Length: 1065Connection: closeContent-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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 340

Page 342: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 DBid - the IP address join IDip_address_id - the IP address IDnetwork_interface_id - the network interface IDupdated_at - the date when the record was updated in DBip_address - the array of IP address detailsaddress - the IP addressbroadcast - 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 networkdisallowed_primary - true if this address is not set as primary (for VS build), otherwise falsegateway - gateway addresshypervisor_id - the ID of the compute resourceip_address_pool_id - the ID of the IP address poll to which this join belongsnetwork_address - the address of a VLAN network address that will be associated with this IP address poolnetwork_id - the ID of the networkpxe - true, if this address can be used for cloudbooting a compute resourcefree - true if free, otherwise falsenetmask — netmask for the IP addressTo delete an IP address assignment from a particular edge server:

BILLING PLANS - GET THE LIST OF BILLING PLANS 341

Page 343: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DELETE /edge_servers/:edge_server_id/ip_addresses/:id.xmlDELETE /edge_servers/:edge_server_id/ip_addresses/:id.jsonXML 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

Where:data_store_id - the ID of the data store, which is attached to the compute resourcehypervisor_id - reserved parameterid - the join IDtarget_join_id - the ID of the join target; in this case it is the compute resource IDtarget_join_type - type of join target; in this case it is compute resource

24.24 Rebuild Network for CDN Edge 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 /edge_servers/:edge_server_id/rebuild_network.xmlPOST /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_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/edge_servers/:edge_server_id/rebuild_network.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 342

Page 344: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

?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 softrequired_startup - set 1 to start up the server automatically after build, otherwise set 0

24.25 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.xmlGET /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-MM-DD+hh:mm:ss&period[use_local_time]=1GET /edge_servers/:edge_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh: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 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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 343

Page 345: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<virtual_machine><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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 344

Page 346: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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></edge_server></edge_servers></billing_stats><usage_cost type="float">0.0</usage_cost><virtual_machine_id type="integer">237</virtual_machine_id><currency_code>USD</currency_code><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 createdupdated_at – the date when these statistics were updatedcost – the total amount of money owed by this particular edge server for the resources spent at stat_timestat_time – the particular hour for which these statistics were generatedid – the ID of these statisticsuser_id - the ID of edge server ownercurrency_code - currency in which this virtual machine is charged within the billing planbilling_stats - an array of billing details for the resources used by this edge servervirtual_machine - an array of edge server billing details:label – name of the edge servercosts- 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:o cpu_shares - CPU priority percentageo cpus - number of CPU coreso memory - amount of RAM in Mbo 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 345

Page 347: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o ip_addresses - number of IPs

o rate - the port speed in Mb per second

o data_received - amount of received data in Kb

o 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:

o resource_name - the resource in question. This can be disk_size, data_read, data_written, reads_completed and writes_completed

o 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

o 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

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:

o resource_name - the resource in question. In this case - template

o value – here, the template ID in the database

BILLING PLANS - GET THE LIST OF BILLING PLANS 346

Page 348: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o 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).

24.26 Get CDN Edge Server CPU Usage Statistics

To view CPU usage statistics of a CDN edge server, run:GET /edge_servers/:edge_server_id/cpu_usage.xmlGET /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-MM-DD+hh:mm:ss&period[use_local_time]=1GET /edge_servers/:edge_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm: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.xml

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/edge_servers/:edge_server_id/cpu_usage.json

Where you have to specify the edge server ID.

BILLING PLANS - GET THE LIST OF BILLING PLANS 347

Page 349: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

24.27 Search CDN Edge Server by LabelTo 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

Where you have to specify the label of a CDN edge server you are searching for.

BILLING PLANS - GET THE LIST OF BILLING PLANS 348

Page 350: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

25 CDN HTTP CACHING RULES

This chapter includes API request for managing HTTP caching rules. The HTTP Rules engine allows users to customize the CDN edge server behavior, e.g. how the CDN will manage cache and redirection.

A CDN resource can be configured with up to 100 rules. This is collectively called a ruleset. A rule consists of conditions and actions. A condition consists of a subject, which determines the value to select, and a predicate, which specifies what to compare the subject against. Conditions are bonded by the connectives “AND” or “OR”. When all the conditions are met, the CDN edge server will perform the actions associated with the rule.

25.1 Get List of HTTP Caching RulesTo view the list of HTTP caching rules for a CDN resource, use the following request:GET /cdn_resources/:cdn_resource_id/http_caching_rules.xmlGET /cdn_resources/:cdn_resource_id/http_caching_rules.jsonXML Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' --url "http://onapp.test/cdn_resources/:cdn_resource_id/http_caching_rules.xml"

JSON Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/json' --url "http://onapp.test/cdn_resources/:cdn_resource_id/http_caching_rules.json"

XML Output example

<?xml version="1.0" encoding="UTF-8"?><objects type="array"> <object> <name>2</name> <conditions type="array"> <condition> <subject>url</subject> <predicate>ends with</predicate> <value>gif</value> </condition> </conditions>

BILLING PLANS - GET THE LIST OF BILLING PLANS 349

Page 351: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<actions type="array"> <action> <act>forbid client</act> </action> </actions> </object> <object>...</object></objects>

Where:name - the name of the ruleconditions - the array of parameters of the conditions associated with the rulesubject - the subject of the condition. For the list of subjects you can set for a rule refer to The List of Subjects.predicate - the predicate of the condition. For the list of predicates you can set for a rule refer to The List of Predicates.value - the value against which the subject is compared.act - the action associated with the rule. For the list of actions you can set for a rule refer to The list of Actions.

25.2 Add HTPP Caching RuleTo add an HTTP caching rule, use the following request:POST /cdn_resources/:cdn_resource_id/http_caching_rules.xmlPOST /cdn_resources/:cdn_resource_id/http_caching_rules.jsonXML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url 'http://onapp.test/cdn_resources/:cdn_resource_id/http_caching_rules.xml' -d '<rule><name>some_name</name><conditions><0><connective>if</connective><subject>url</subject><predicate>default</predicate><value></value></0><1><connective>and</connective><subject>cookie</subject><cookie></cookie><predicate>default</predicate><value></value></1><2><connective>and</connective><subject>param</subject><param></param><predicate>default</predicate><value></value></2><3><connective>and</connective><subject>header</subject><header></header><predicate>default</predicate><value></value></3></conditions><actions><0><act>force edge to cache</act><seconds></seconds></0><1><act>redirect client</act><url></url></1><2><act>set response header</act><header></header><value></value></2><3><act>set custom origin</act><value></value></3></actions></rule>'

BILLING PLANS - GET THE LIST OF BILLING PLANS 350

Page 352: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/:cdn_resource_id/http_caching_rules.json' -d '{"rule": {"name":"some_name", "conditions":{"0":{"connective":"if", "subject":"url", "predicate":"default", "value":""}, "1":{"connective":"and", "subject":"cookie", "cookie":"", "predicate":"default", "value":""}, "2":{"connective":"and", "subject":"param", "param":"", "predicate":"default", "value":""}, "3":{"connective":"and", "subject":"header", "header":"", "predicate":"default", "value":""}}, "actions":{"0":{"act":"force edge to cache", "seconds":""}, "1":{"act":"redirect client", "url":""}, "2":{"act":"set response header", "header":"", "value":""}, "3":{"act":"set custom origin", "value":""}}}}'

Where:name - name of the ruleconditions - the array of parameters of the conditions associated with the ruleconnective - the connective by which the conditions are bonded, either 'and' or 'or'.subject - the subject of the condition. The subject should be written using small letters only and with spaces between the words. For the list of subjects you can set for a rule refer to The List of Subjects.predicate - the predicate of the condition. The predicate should be written using small letters only and with spaces between the words. For the list of predicates you can set for a rule refer to The List of Predicates.value - the value against which the subject is compared.header - the subject that selects the value of a specific client request header. If the request header does not exist, then the value “” is selected.act - the action associated with the rule. The action should be written using small letters only and with spaces between the words. For the list of actions you can set for a rule refer to The list of Actions.url - the subject that selects the URL part of the request. It excludes the query string.cookie - the subject that selects the value of a specific cookie sent by the client.param - the subject that selects the value of a specific query string parameter. If there are multiple identical keys, the last value is selected.seconds - the time in seconds set for the action. For more information, refer to The list of Actions.

BILLING PLANS - GET THE LIST OF BILLING PLANS 351

Page 353: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

25.3 Edit HTTP Caching RuleUse the following request to edit an HTTP caching rule:PUT /cdn_resources/:cdn_resource_id/http_caching_rules.xmlPUT /cdn_resources/:cdn_resource_id/http_caching_rules.jsonXML 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/http_caching_rules.xml' -d '<id>1</id><rule><name>name</name><conditions><0><connective>if</connective><subject>url</subject><predicate>default</predicate><value></value></0><1><connective>and</connective><subject>cookie</subject><cookie></cookie><predicate>default</predicate><value></value></1><2><connective>and</connective><subject>param</subject><param></param><predicate>default</predicate><value></value></2><3><connective>and</connective><subject>header</subject><header></header><predicate>default</predicate><value></value></3></conditions><actions><0><act>force edge to cache</act><seconds></seconds></0><1><act>redirect client</act><url></url></1><2><act>set response header</act><header></header><value></value></2><3><act>set custom origin</act><value></value></3></actions></rule>'

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/http_caching_rules.json' -d '{"id":1, "rule": {"name":"name", "conditions":{"0":{"connective":"if", "subject":"url", "predicate":"default", "value":""}, "1":{"connective":"and", "subject":"cookie", "cookie":"", "predicate":"default", "value":""}, "2":{"connective":"and", "subject":"param", "param":"", "predicate":"default", "value":""}, "3":{"connective":"and", "subject":"header", "header":"", "predicate":"default", "value":""}}, "actions":{"0":{"act":"force edge to cache", "seconds":""}, "1":{"act":"redirect client", "url":""}, "2":{"act":"set response header", "header":"", "value":""}, "3":{"act":"set custom origin", "value":""}}}}'

Where:id - the ID of the HTTP caching rule you want to editname - name of the rule

BILLING PLANS - GET THE LIST OF BILLING PLANS 352

Page 354: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

conditions - the array of parameters of the conditions associated with the ruleconnective - the connective by which the conditions are bonded, either 'and' or 'or'.subject - the subject of the condition. The subject should be written using small letters only and with spaces between the words. For the list of subjects you can set for a rule refer to The List of Subjects.predicate - the predicate of the condition. The predicate should be written using small letters only and with spaces between the words. For the list of predicates you can set for a rule refer to The List of Predicates.value - the value against which the subject is compared.cookie - the subject that selects the value of a specific cookie sent by the client.param - the subject that selects the value of a specific query string parameter. If there are multiple identical keys, the last value is selected.header - the subject that selects the value of a specific client request header. If the request header does not exist, then the value “” is selected.act - the action associated with the rule. The action should be written using small letters only and with spaces between the words. For the list of actions you can set for a rule refer to The list of Actions.seconds - the time in seconds set for the action. For more information, refer to The list of Actions.url - the subject that selects the URL part of the request. It excludes the query string.

25.4 Delete HTTP Caching RuleUse the following request to delete an HTTP caching rule:DELETE /cdn_resources/:cdn_resource_id/http_caching_rules/:rule_id.xmlDELETE /cdn_resources/:cdn_resource_id/http_caching_rules/:rule_id.jsonXML Request example

curl -i -X DELETE -u user:userpass -H 'Accept: application/xml' --url 'http://onapp.test/cdn_resources/:cdn_resource_id/http_caching_rules/:rule_id.xml'

JSON Request example

curl -i -X DELETE -u user:userpass -H 'Accept: application/json' --url 'http://onapp.test/cdn_resources/:cdn_resource_id/http_caching_rules/:rule_id.json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 353

Page 355: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26 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.

26.1 Get List of CDN ResourcesTo see all CDN resources in the cloud, use the following request:GET /cdn_resources.xmlGET /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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 354

Page 356: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

curl -i -X GET -u user:userpass http://onapp.test/cdn_resources.xml?type=live_streaming

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 contentcdn_ssl_certificate_id - the ID of the custom SNI SSL certificate added to the resourcecname - CNAME record

BILLING PLANS - GET THE LIST OF BILLING PLANS 355

Page 357: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at – the date when the CDN resource was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – the resource ID in the databaseresource_type – CDN resource typeupdated_at – the date when the CDN resource was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id – the ID of the user, who owns the resourcelast_24h_cost - the amount due for the last 24 hourscdn_reference - ID of the SSL certificate on the remote Aflexi serverorigins – an array of CDN origins with the following parameters:origin – the path from which the CDN requests the contentkey – access key, if anyvalue – the path to the content

26.2 Get CDN Resource Basic DetailsTo view details of the particular CDN resource:GET /cdn_resources/:id.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 356

Page 358: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</origin></origins></cdn_resource>

Explanation of the data returned:cdn_hostname - the hostname which will serve static contentcreated_at – the date when the resource was createdid – the resource ID in the databaseresource_type – HTTP PULL or PUSHupdated_at – the date when the resource was updateduser_id – the ID of the user, who owns the resourcelast_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 createdlabel – the label of the particular edge group assignedid – the edge group idupdated_at – the date when the edge group was updatedstatus – the resource status (can be Preparing, Active, Suspended)secondary hostname – secondary CDN hostnamessl_on - whether SSL is enabled for the resource or notssl - custom SNI SSL certificate if it is added to the resourceorigins – the path from which the CDN requests the contentkey – access key, if anyvalue – the path to the content

26.3 Get CDN Resource Advanced DetailsTo view advanced details of the CDN resource, use the following request:GET /cdn_resources/:id/advanced.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 357

Page 359: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 hostnameip_access_policy – displays access policy from a range of IP addresses; either NONE (disabled), ALLOW_BY_DEFAULT or BLOCKED_BY_DEFAULTcountry_access_policy_ – displays access policy to the CDN resource's content for specified countries; either NONE (disabled), ALLOW_BY_DEFAULT or BLOCKED_BY_DEFAULTurl_signing_on – true if the access requires URL signing; otherwise falseurl_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_DEFAULTdomains - domains related to hotlink_policypassword_on – true, if the access to the resource is restricted; otherwise falsepasswords – 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 0flv_pseudo_on - 1 if FLV preudo streaming is enabled, otherwise set 0limit_rate - speed limit of a response to a client (per request) in KB/s. Maximum limit rate value - 2147483647 KB/slimit_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 358

Page 360: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.4 Add HTTP CDN ResourceTo create an HTTP resource, use the following request:POST /cdn_resources.xmlPOST /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_sert_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_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 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_certificate_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_sert_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_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 HTTP 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":"HTTP_PUSH","cdn_ssl_certificate_id":"ssl_cert_id","edge_group_ids":[7],"ftp_password":"j3x8svqybA2gmrgYOZSrOlYToQ"}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 359

Page 361: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 resourceedge_group_ids * - indicate the ID(s) of required CDN edge groupsftp_password * - specify the FTP password if you add an HTTP PUSH CDN resource type. It can consist of 6-32 alphanumeric characters.

ResponseYou 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 360

Page 362: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.4.1 Page historyOnApp 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

26.5 Add Video on Demand CDN ResourceTo create an HTTP resource, use the following request:POST /cdn_resources.xmlPOST /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</resource_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","edge_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</resource_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 361

Page 363: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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","edge_group_ids":[7],"ftp_password":"j3x8svqybA2gmrgYOZSrOlYToQ"}}'

Where:cdn_hostname * - specify the name which will serve as a label onlyresource_type* - specify the resource type - STREAM_VOD_PULL or STREAM_VOD_PUSHorigin* - the path from which the CDN requests the content (for VoD PULL request).edge_group_ids * - indicate the ID(s) of required CDN edge groupsftp_password * - specify the FTP password for VoD PUSH type. It should consist of 6-32 alphanumeric symbols.

ResponseYou 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.

26.6 Add Live Streaming CDN ResourceTo create a live streaming CDN resource, use the following request:POST /cdn_resources.xmlPOST /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_publishing_location></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example (with external publishing point )

BILLING PLANS - GET THE LIST OF BILLING PLANS 362

Page 364: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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</publishing_location><failover_publishing_location>128</failover_publishing_location></cdn_resource>' -u user:userpass http://onapp.test/cdn_resources.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example (with internal publishing point )

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","failover_publishing_location":"128"}}'

Where:cdn_hostname* - specify the name which will serve as a label onlyresource_type* - STREAM_LIVEpublishing_point* - the publishing point type: external or internalpublishing_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 publishing point for internal type.edge_group_ids* - indicate the ID(s) of required CDN edge groups

BILLING PLANS - GET THE LIST OF BILLING PLANS 363

Page 365: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ResponseYou 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.

26.7 Add HTTP Pull CDN Resource with Advanced Settings

To create an HTTP resource with advanced settings, use the following request:POST /cdn_resources.xmlPOST /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>PI-HTTPPULCDNresource.com</cdn_hostname><origin>109.123.105.178</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>test110.com</secondary_hostname><secondary_hostname>test220.com</secondary_hostname></secondary_hostnames><ip_access_policy>BLOCK_BY_DEFAULT</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_addresses><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><domains>abuse.co.ua abuse.org</domains><url_signing_on>1</url_signing_on><url_signing_key>12345qwertyyu</url_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_pass><password_unauthorized_html>YOU ARE NOT

BILLING PLANS - GET THE LIST OF BILLING PLANS 364

Page 366: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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><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_blocked><origin_policy>HTTP</origin_policy></cdn_resource>'

JSON Request example

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_hostname":"jsonPI-HTTPPULCDNresource.com","cdn_ssl_certificate_id":"ssl_cert_id","edge_group_ids":["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":"BLOCK_BY_DEFAULT","countries":["AL","AR","GT","HR"],"hotlink_policy":"ALLOW_BY_DEFAULT","domains":"mnw.netggl.com","url_signing_on":"1","url_signing_key":"12345sfdfdsfsd","cache_expiry":45,"password_on":1,"form_pass":{"user":["user190","user278"],"pass":["pass123","pass2348"]},"password_unauthorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","mp4_pseudo_on":"1","flv_pseudo_on":"1","ignore_set_cookie_on":"1","limit_rate":"150","limit_rate_after":"1","proxy_cache_key":"$host$uri","proxy_read_time_out":"60","proxy_connect_time_out":"20","http_bot_blocked":1,"origin_policy":"HTTP"}}'

Where: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. 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 365

Page 367: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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.ssl_on - set to 'true' to enable SSL, otherwise set to 'false'. See the note below for more information.

SSLIf 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.Be aware that if CDN hostname ends with 'r.worldssl.net', it can not be digit-only (for example 123456.r.worldssl.net is not applicable).

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 groupssecondary_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: 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 366

Page 368: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 367

Page 369: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o $host$request_uri

o $host$uri

o $proxy_host$request_uri

o $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.

ResponseYou 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

HTTP/1.1 201 Date: Wed, 31 Jul 2013 09:19:55 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.17X-UA-Compatible: IE=Edge,chrome=1ETag: "915066feccf0b14edaa50af485b3b705"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: f48bc47604a5784aafc5f98dab733465X-Runtime: 0.387472X-Rack-Cache: invalidate, passSet-Cookie: _session_id=2cc141e9002d8d3df5c4033dbda2a090; path=/; HttpOnlyLocation: http://onapp.test/cdn_resources/10743Status: 201Content-Length: 797Connection: closeContent-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>

BILLING PLANS - GET THE LIST OF BILLING PLANS 368

Page 370: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

26.7.1 Page historyv 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

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.

Be aware that if CDN hostname ends with 'r.worldssl.net', it can not be digit-only (for example 123456.r.worldssl.net is not applicable).

BILLING PLANS - GET THE LIST OF BILLING PLANS 369

Page 371: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.8 Add HTTP Push CDN Resource with Advanced Settings

To create an HTTP resource with advanced settings, use the following request:POST /cdn_resources.xmlPOST /cdn_resources.json XML Request example

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.com</cdn_hostname><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id><edge_group_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_DEFAULT</ip_access_policy><ip_addresses>111.111.11.111</ip_addresses><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><domains>example.com</domains><url_signing_on>1</url_signing_on><url_signing_key>12345qwertyyu</url_signing_key><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><limit_rate>150</limit_rate><limit_rate_after>1</limit_rate_after><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_pass><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html></cdn_resource>'

JSON Request example

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_PUSH","cdn_hostname":"jsoncdn.apitest.com","cdn_ssl_certificate_id":"ssl_cert_id","edge_group_ids":["225"],"storage_server_location":"816382921", "ftp_password":"qwerrtyuio","secondary_hostnames":["test122.com","test234.com"],"ip_access_policy":"ALLOW_BY_DEFAULT","ip_addresses":"111.111.11.111,222.222.22.222","country_access_polic

BILLING PLANS - GET THE LIST OF BILLING PLANS 370

Page 372: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

y":"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":["pass123","pass2348"]},"password_unauthorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","mp4_pseudo_on":"1","flv_pseudo_on":"1","limit_rate":"150","limit_rate_after":"1"}}'

Where: 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.ssl_on - set to 'true' to enable SSL, otherwise set to 'false'. See the note below for more information.

SSLIf 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.Be aware that if CDN hostname ends with 'r.worldssl.net', it can not be digit-only (for example 123456.r.worldssl.net is not applicable).

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 groupsstorage_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.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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 371

Page 373: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 372

Page 374: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

26.8.1 Page Historyv. 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

Added storage_server_location parameter.

https://docs.onapp.com/display/40API/Add+HTTP+Push+CDN+Resource+with+Advanced+Settings

26.9 Add VoD Push CDN Resource With Advanced Settings

To create new video on demand resource with advanced settings:POST /cdn_resources.xmlPOST /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.com</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_group_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries

BILLING PLANS - GET THE LIST OF BILLING PLANS 373

Page 375: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_location>4637643278</storage_server_location><token_auth_on>1</token_auth_on><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

JSON Request example

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_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","GT"],"storage_server_location":"4545566","secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdfasga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}'

Where:cdn_hostname* - specify the name which will serve as a label onlyresource_type* - STREAM_VOD_PUSHftp_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 groupsadvanced_settings* - set 1 to enable advanced settingshotlink_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 374

Page 376: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 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.

ResponseYou 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 Historyv.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

BILLING PLANS - GET THE LIST OF BILLING PLANS 375

Page 377: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.10 Add VoD Pull CDN Resource With Advanced Settings

To create new video on demand resource with advanced settings:POST /cdn_resources.xmlPOST /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_PULL</resource_type><cdn_hostname>apitest.com.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_group_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>goo.coabuse.ua</domains><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_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

JSON Request example

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_hostname":"apitest.com","edge_group_ids":["1","2"],"hotlink_policy":"BLOCK_BY_DEFAULT","domains":"test.com","country_access_policy":"ALLOW_BY_DEFAULT","countries":["AL","GT"],

BILLING PLANS - GET THE LIST OF BILLING PLANS 376

Page 378: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"secure_wowza_on":"1", "secure_wowza_token":"test123456","token_auth_on":"1","token_auth_primary_key":"zsfdfasga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}'

Where:cdn_hostname* - specify the name which will serve as a label onlyresource_type* - STREAM_VOD_PULLorigin* - 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 groupsadvanced_settings* - set 1 to enable advanced settingshotlink_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 377

Page 379: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"]

ResponseYou 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 Historyv.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

26.11 Add Live Streaming CDN Resource with Advanced Settings

POST /cdn_resources.xmlPOST /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><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>www.google.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><secure_wowza_on>1</secure_wowza_on><secure_wowza_token>4t534564tyrt</

BILLING PLANS - GET THE LIST OF BILLING PLANS 378

Page 380: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

secure_wowza_token><edge_group_ids>224</edge_group_ids><token_auth_on>1</token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

JSON Request example (with internal publishing point):

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_location":"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","token_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_LIVE</resource_type><publishing_point>external</publishing_point><publishing_location>http://www.google.com</publishing_location><failover_publishing_location>rtmp://test.com/test</failover_publishing_location><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>www.google.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</countries><secure_wowza_on>1</secure_wowza_on><secure_wowza_token>4t534564tyrt</secure_wowza_token><edge_group_ids>224</edge_group_ids></cdn_resource>'

JSON Request example (with external publishing point):

curl -i -X POST -H 'Accept: application/json' -H 'Content-type:

BILLING PLANS - GET THE LIST OF BILLING PLANS 379

Page 381: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 onlyresource_type* - STREAM_LIVEpublishing_point* - the publishing point type: external or internalpublishing_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 settingshotlink_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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 380

Page 382: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"]

ResponseYou 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 Historyv.3.3.1 adds the following parameters:

token_auth_on

token_auth_primary_key

token_auth_backup_key

token_auth_secure_paths

26.12 Edit CDN ResourceTo edit details of the CDN resource, use the following API call:PUT /cdn_resources/:id.xmlPUT /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_hostname>az.test.api</

BILLING PLANS - GET THE LIST OF BILLING PLANS 381

Page 383: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cdn_hostname><cdn_ssl_certificate_id>8</cdn_ssl_certificate_id></cdn_resource>'

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/:id.json' -d '{"cdn_resource":{"edge_group_ids":["12"],"origin":"1.1.1.1","cdn_hostname":"CORE-3606-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 contentedge_group_ids - indicate the ID(s) of required CDN edge groups

26.13 Edit HTTP Pull CDN Resource with Advanced Settings

To edit HTTP Pull CDN resource:PUT /cdn_resources/:cdn_resource_id.xmlPUT /cdn_resources/:cdn_resource_id.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 382

Page 384: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="array"><edge_group_id>225</edge_group_id></edge_group_ids><secondary_hostnames type="array"><secondary_hostname>test100.com</secondary_hostname><secondary_hostname>test200.com</secondary_hostname></secondary_hostnames><ip_access_policy>BLOCK_BY_DEFAULT</ip_access_policy><ip_addresses>111.111.11.111,222.222.22.222</ip_addresses><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries type="array"><country>AL</country><country>GT</country></countries><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><domains>abuse.co.ua abuse.org</domains><url_signing_on>1</url_signing_on><url_signing_key>newurlkey</url_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_pass><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_after><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_blocked><origin_policy>HTTP</origin_policy></cdn_resource>'

JSON Request example

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_addresses":"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_unauthorized_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","flv_pseudo_on":"1","ignore_set_cookie_on":"1","limit_rate":"150","limit_rate_after":"1","proxy_cache_key":"$host$uri","proxy_read_time_out":"60","proxy_connect_time_out":"60","http_bot_blocked":"1","origin_policy":"HTTP"}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 383

Page 385: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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: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 characters. You can specify up to 3 origins.cdn_hostname* - indicate the hostname which will serve static contentssl_on - set to 'true' to enable SSL, otherwise set to 'false'. See the note below for more information.

SSLIf 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.

Be aware that if CDN hostname ends with 'r.worldssl.net', it can not be digit-only (for example 123456.r.worldssl.net is not applicable).

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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 384

Page 386: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 (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

BILLING PLANS - GET THE LIST OF BILLING PLANS 385

Page 387: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o $host$request_uri

o $host$uri

o $proxy_host$request_uri

o $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.

26.13.1 Page historyv. 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

26.14 Edit HTTP Push CDN Resource with Advanced Settings

To edit HTTP Push CDN resource:PUT /cdn_resources/:cdn_resource_id.xmlPUT /cdn_resources/:cdn_resource_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 386

Page 388: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

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_id>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_password><secondary_hostnames type="array"><secondary_hostname>name1nedwqwtest.con</secondary_hostname><secondary_hostname>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_addresses><hotlink_policy>ALLOW_BY_DEFAULT</hotlink_policy><url_signing_on>1</url_signing_on><url_signing_key>newtest12345</url_signing_key><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_pass><password_unauthorized_html>YOU ARE NOT AUTHORIZED</password_unauthorized_html><domains>example.com</domains><country_access_policy>ALLOW_BY_DEFAULT</country_access_policy><countries>AO</countries><countries>BH</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>'

JSON Request example

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_addresses":"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_html":"<b>You are blocked!</b>","mp4_pseudo_on":"1","flv_pseudo_on":"1","limit_rate":"80","limit_rate_after":"13"}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 387

Page 389: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:origin* - the path from which the CDN requests the content

cdn_hostname* - indicate the hostname which will serve static contentssl_on - set to 'true' to enable SSL, otherwise set to 'false'. See the note below for more information.

SSLIf 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.

Be aware that if CDN hostname ends with 'r.worldssl.net', it can not be digit-only (for example 123456.r.worldssl.net is not applicable).

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.

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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 388

Page 390: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 389

Page 391: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

26.14.1 Page Historyv. 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

26.15 Edit VoD Push CDN Resource with Advanced Settings

To create new video on demand resource with advanced settings:PUT /cdn_resources/:cdn_resource_id.xmlPUT /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</ftp_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</domains><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</

BILLING PLANS - GET THE LIST OF BILLING PLANS 390

Page 392: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

token_auth_primary_key><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>

JSON Request example

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_group_ids":["1"],"hotlink_policy":"BLOCK_BY_DEFAULT","domains":"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":"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 onlyftp_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 groupsadvanced_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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 391

Page 393: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 Historyv.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

26.16 Edit VoD Pull CDN Resource with Advanced Settings

To create new video on demand resource with advanced settings:PUT /cdn_resources/:cdn_resource_id.xmlPUT /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.1

BILLING PLANS - GET THE LIST OF BILLING PLANS 392

Page 394: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

11.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</domains><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_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

JSON Request example

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_group_ids":["1","2"],"hotlink_policy":"BLOCK_BY_DEFAULT","domains":"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":"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 onlyorigin* - 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 groupsadvanced_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 393

Page 395: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 Historyv.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

BILLING PLANS - GET THE LIST OF BILLING PLANS 394

Page 396: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

26.17 Edit Live Streaming CDN Resource with Advanced Settings

PUT /cdn_resources/:id.xmlPUT /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_group_ids><hotlink_policy>BLOCK_BY_DEFAULT</hotlink_policy><domains>test.test.com</domains><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://test-stream.com</publishing_location><failover_publishing_location>rtmp://test-stream2.com</failover_publishing_location><token_auth_on>1</token_auth_on><token_auth_primary_key>zsfdfasga</token_auth_primary_key><token_auth_backup_key>fgff45788787878</token_auth_backup_key><token_auth_secure_paths type="array"><token_auth_secure_path>/Video1</token_auth_secure_path><token_auth_secure_path>/Video2</token_auth_secure_path></token_auth_secure_paths></cdn_resource>'

JSON Request example

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_policy":"BLOCK_BY_DEFAULT","domains":"test.test.com","country_access_policy":"ALLOW_BY_DEFAULT","countries":["AL","GT"],"secure_wowza_on":"1","secure_wowza_token":"test123456","publishing_point":"external", "publishing_location":"rtmp://test-stream.com","failover_publishing_location":"rtmp://test-stream2.com","token_auth_on":"1","token_auth_primary_key":"zsfdfasga","token_auth_secure_paths": ["/video1", "/video2"],"token_auth_backup_key":"fgff45788787878"}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 395

Page 397: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 onlyedge_group_ids* - indicate the ID(s) of required CDN edge groupsadvanced_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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 396

Page 398: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 Historyv.3.3.1 adds the following parameters:

token_auth_on

token_auth_primary_key

token_auth_backup_key

token_auth_secure_paths

26.18 Delete CDN ResourceTo delete a CDN resource:DELETE /cdn_resources/:id.xmlDELETE /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.

26.19 Change CDN Resource FTP PasswordUsing the following request, you can change FTP password of HTTP Push and VoD PUSH resources:

BILLING PLANS - GET THE LIST OF BILLING PLANS 397

Page 399: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /cdn_resources/:cdn_resource_id.xmlPUT /cdn_resources/:cdn_resource_id.jsonXML 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><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 IDftp_password - required FTP password

26.20 Prefetch CDN Resource ContentTo pre-populate HTTP PULL and PUSH content to the CDN, use the following API call:

POST /cdn_resources/:id/prefetch.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 398

Page 400: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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</prefetch_path><prefetch_path>/ui3/test3</prefetch_path><prefetch_path>/ui3/test4</prefetch_path></prefetch_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/prefetch.json -d '{"prefetch_paths":["/ui3/test1","/ui3/test2","/ui3/test3","/ui3/test4"]}' -H 'Accept:application/json' -H 'Content-type:application/json'

26.21 Purge CDN Resource ContentTo remove content from HTTP Pull and PUSH cache, use the following request:POST /cdn_resources/:id/purge.xmlPOST /cdn_resources/:id/purge.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 399

Page 401: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

<purge_paths>home/123.jpeg</purge_paths>

XML Request example

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 removeTo 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><purge_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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 400

Page 402: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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'

Where you have to specify a CDN resource ID.

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'

26.22 View CDN Resource Bandwidth Statistics

To get bandwidth statistics for the resources or a particular resource, use the following request:GET /cdn_resources/bandwidth.xmlGET /cdn_resources/bandwidth.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 401

Page 403: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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-11-25T18: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>725618714</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-11-27T11:43","resources":[977655738,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 formatend – the end date to generate statistics in the YYYY-MM-DD+hh:mm:ss formatresources – the identifier of the resource in Aflexi database. To get the identifier, check with cdn_reference parameter in the GET /cdn_resources/:id.{format} requestlocations – the ID of the locationtype – 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:

Status: 200 OKConnection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8

BILLING PLANS - GET THE LIST OF BILLING PLANS 402

Page 404: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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:

Status: 200 OK

BILLING PLANS - GET THE LIST OF BILLING PLANS 403

Page 405: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Connection: closeTransfer-Encoding: chunkedContent-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 cachedcached – the amount of data cacheddate – the point of time for which the statistics is generatedThe 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 Equivalent0 - 30 days 86400 1 day31 - 93 days 604800 1 weekequal 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.

26.23 View CDN Resource Streaming Statistics

To gview streaming statistics for the live streaming CDN resources or a particular resource, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 404

Page 406: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET/cdn_resources/stream_stats.xmlGET/cdn_resources/stream_stats.jsonYou 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[\]=18GET /cdn_resources/stream_stats.json?start=2011-09-01&end=2012-09-01&resources[\]=787341593&locations[\]=18

PLEASE NOTE: In Bash shell you have to use backslashes to enclose square brackets (see example below):

resources\[\]=787341593&locations\[\]

Where:start – the start date to generate statistics in the YYYY-MM-DD formatend – the end date to generate statistics in the YYYY-MM-DD formatresources – the identifier of the resource in Aflexi database. To get the identifier, check with cdn_reference parameter in the GET /cdn_resources/:id.{format} requestlocations – the ID of the location

26.24 View CDN Resource Billing Statistics

To view billing statistics for a resource:GET /cdn_resources/:id/billing.xmlGET /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:mm:ss&period[use_local_time]=1GET /cdn_resources/:id/billing.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Output example:

HTTP/1.1 200 OKDate: Thu, 01 Nov 2012 08:46:57 GMTServer: Apache/2.2.3 (CentOS)

BILLING PLANS - GET THE LIST OF BILLING PLANS 405

Page 407: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1ETag: "5639dcb4af97cc6b5614f0e7102414a6"Cache-Control: must-revalidate, private, max-age=0X-Request-Id: b4aa84f305441fa8e791a2b597ed0c8eX-Runtime: 0.064716X-Rack-Cache: missSet-Cookie: _session_id=e01cb0aac4fc66becbd5bb294966d12e; path=/; HttpOnlyStatus: 200Connection: closeTransfer-Encoding: chunkedContent-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 resourceedge_group_id – the ID of the edge groupedge_group_label – the label of the edge groupstat_time - time when the statistics was gatheredvalue - traffic value

26.25 View CDN Resource Raw Log Configuration

To view the raw log configuration, use the following request:GET /cdn_resources/raw_log.xmlGET /cdn_resources/raw_log.jsonXML Request Example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url "http://onapp.test/cdn_resources/raw_log.xml"

BILLING PLANS - GET THE LIST OF BILLING PLANS 406

Page 408: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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/raw_log.json"

XML Response Example: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 protocoluri - the hostname of the server to which the log will be delivereduser - the user name of the FTP/SFTP client on the server to which the log will be deliveredpass - 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 protocoluri - the hostname of the server to which the log will be delivered

BILLING PLANS - GET THE LIST OF BILLING PLANS 407

Page 409: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

syslog_protocol - the protocol that will be used for sending the log: TCP or UDPport - the port number of the syslog the server to which the log will be delivered

26.26 Edit CDN Resource Raw Log Configuration

To edit the raw log configuration, use the following request:POST /cdn_resources/raw_log.jsonPOST /cdn_resources/raw_log.jsonTo disable raw logs: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/></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":""}}'

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>password</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":"passw

BILLING PLANS - GET THE LIST OF BILLING PLANS 408

Page 410: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ord"}}'

Where:protocol - delivery protocoluri - the hostname of the server to which the log will be delivereduser - the user name of the FTP/SFTP client on the server to which the log will be deliveredpass - 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</syslog_protocol><port>80</port></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":"syslog","uri":"rawlog.com","syslog_protocol":"tcp","port":"80"}}'

Where:protocol - delivery protocoluri - the hostname of the server to which the log will be deliveredsyslog_protocol - the protocol that will be used for sending the log: TCP or UDPport - he port number of the syslog server to which the log will be delivered

26.27 Get Instruction for Live Streaming CDN Internal Resource

GET /cdn_resources/:cdn_resource_id/instructions.xmlGET /cdn_resources/:cdn_resource_id/instructions.json

XML Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 409

Page 411: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

<?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/

BILLING PLANS - GET THE LIST OF BILLING PLANS 410

Page 412: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

_definst_/mystream.m3u8</apple_http_live_streaming> <adobe_http_dynamic_streaming>http://video.worldcdn-beta.net/881661104/_definst_/mystream.f4m</adobe_http_dynamic_streaming> <microsoft_smooth_streaming>http://video.worldcdn-beta.net/881661104/_definst_/mystream.ism</microsoft_smooth_streaming> </urls> </publishing> </instructions></cdn_resource>

Where:cdn_hostname* - indicate the hostname which will serve the contentcname - a CNAME for the CDN Hostname which can then be used to view the contents.resource_type - the Stream Live resourceid - the ID of the resourceuser_id - the user IDlast_24h_cost - cost of the resource for the last 24 hours.cdn_reference - the ID in OnApp Dashboardpublishing_point - - the publishing point type: internalinstructions - 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 inpassword - the user passwordstream - the stream nameurls - the array with URLsfms - the FMS URLbackup - the Backup URLsmil - 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.

26.28 Search CDN ResourceTo search for a specific CDN resource, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 411

Page 413: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /cdn_resources.xml?q=search_paramGET /cdn_resources.json?q=search_paramThe 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:

<?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 contentcname - CNAME recordcreated_at - the date when the resource was createdid – the resource ID in the database

BILLING PLANS - GET THE LIST OF BILLING PLANS 412

Page 414: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

resource_type – HTTP PULL or PUSHupdated_at – the date when the resource was updateduser_id – the ID of the user, who owns the resourcelast_24h_cost – the amount of money owed for the resource for the last 24 hours.cdn_reference - the identifier in databaseorigins – the path from which the CDN requests the content

26.29 Suspend CDN ResourceTo suspend a specific CDN resource, use the following request:PUT /cdn_resources/resource_id/suspend.xmlPUT /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:

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.

26.30 Resume CDN ResourceTo resume a specific suspended CDN resource, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 413

Page 415: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /cdn_resources/resource_id/resume.xmlPUT /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.

26.31 View CDN Advanced ReportingTo view CDN advanced reporting for HTTP PULL and HTTP PUSH resources:GET /cdn_resources/resource_id/advanced_reporting.xmlGET /cdn_resources/resource_id/advanced_reporting.json

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 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 414

Page 416: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 statisticsstart- the start date of the period for which the statistics should be generatedend - the end date of the period for which the statistics should be generatedlocations - 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 'Content-type: application/xml'

Get Advanced Status Codes Reporting Json API request example:(for HTTP Pull request only)

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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 415

Page 417: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 generatedend - the end date of the period for which the statistics should be generatedlocations - the location ID for which the statistics should be generated

26.32 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.xmlGET /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=streaming&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=streaming&only_active=false"

Wheretype - the optional parameter which describes the Storage Server's type - streaming or http;

BILLING PLANS - GET THE LIST OF BILLING PLANS 416

Page 418: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

XML Response Example:

<?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 locatedcountry - the country where the storage server is locatedid - the ID of the locationstorage_server - the array of the storage server detailsid - the ID of the storage serverstatus - the status of the storage serverhttp_push_onvod_push_on

BILLING PLANS - GET THE LIST OF BILLING PLANS 417

Page 419: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

27 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)

o single certificate

o wildcard certificate (*.example.com)

o SAN certificate (any domains)

organization validation (OV) certificates

o single certificate

o wildcard certificate (*.example.com)

o SAN certificate (any domains)

extended validation (EV) certificates

o single certificate

o wildcard certificate (*.example.com)

o SAN certificate (any domains)

high-assurance certificates

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 permissions.

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 418

Page 420: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 subscribed to that resource.

27.1 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.xmlGET /cdn_ssl_certificates.jsonXML Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 419

Page 421: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - ID of the certificatename - name of the certificateupdated_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of the user who added the certificatecdn_reference - the ID of the certificate on the remote Aflexi server

27.2 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.xmlGET /cdn_ssl_certificates/:id.jsonXML Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json ' --url 'http://onapp.test/cdn_ssl_certificates/:id.json'

Where:id - ID of the certificateXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 420

Page 422: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 formatid - ID of the certificatename - name of the certificateupdated_at - the time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - ID of the user who added the certificatecdn_resources - array of parameters related to the CDN resources associated with the certificate:cdn_hostname - the hostname that will serve static content cdn_ssl_certificate_id - the ID of the custom SNI SSL certificate associated with 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 origin - the path from which the CDN requests the contentcdn_reference - ID of the certificate on the remote Aflexi server

27.3 Add Custom SNI SSL CertificateTo add a custom SNI SSL certificate, use the following request:POST /cdn_ssl_certificates.xmlPOST /cdn_ssl_certificates.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 421

Page 423: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

To add custom SNI SSL certificates, the user needs to have CDN resources in the cloud and CDN SSL Certificates permissions.

XML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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\nMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQVQgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQLExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkamekCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718qIM6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231VITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ51SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgNVHRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgEFBQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ3Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWdu\r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1CDAfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQingXy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskabV0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\nuPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsSlQ9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn1x+eDqw==\r\n-----END CERTIFICATE-----</cert><key>-----BEGIN RSA PRIVATE KEY-----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPwQE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oGIOeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWIdgdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/QyQjTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs3lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2zO/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5pY49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHYP\r\

BILLING PLANS - GET THE LIST OF BILLING PLANS 422

Page 424: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3eap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H19W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7l4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\nDz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/gd7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABVaEEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSBuXMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80vPvXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRIQs+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1JxJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+F9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----</key></cdn_ssl_certificate>'

JSON Request example

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\nMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQVQgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQLExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkamekCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718qIM6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231VITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ51SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgNVHRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgEFBQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ3Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWdu\r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1CDAfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQingXy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskabV0mLp6UXXij6Dsi\r\

BILLING PLANS - GET THE LIST OF BILLING PLANS 423

Page 425: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\nuPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsSlQ9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn1x+eDqw==\r\n-----END CERTIFICATE-----","key":"-----BEGIN RSA PRIVATE KEY-----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPwQE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oGIOeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWIdgdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/QyQjTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs3lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2zO/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5pY49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHYP\r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3eap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H19W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7l4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\nDz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/gd7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABVaEEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSBuXMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80vPvXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRIQs+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1JxJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+F9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----"}}'

Where:name - the name of the certificatecert - the certificate keykey - 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:

-----BEGIN CERTIFICATE----------END CERTIFICATE----------BEGIN RSA PRIVATE KEY----------END RSA PRIVATE KEY-----

BILLING PLANS - GET THE LIST OF BILLING PLANS 424

Page 426: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

27.4 Edit Custom SNI SSL CertificateTo update a custom SNI SSL certificate, use the following request:PUT /cdn_ssl_certificates/:id.xmlPUT /cdn_ssl_certificates/:id.xmlXML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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\nMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQVQgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQLExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkamekCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718qIM6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231VITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ51SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgNVHRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgEFBQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ3Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWdu\r\nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1CDAfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQingXy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskabV0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\nuPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsSlQ9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn1x+eDqw==\r\n-----END CERTIFICATE-----</cert><key>-----BEGIN RSA PRIVATE KEY-----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPwQE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oGIOeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWIdgdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/QyQjTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\

BILLING PLANS - GET THE LIST OF BILLING PLANS 425

Page 427: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

nslvuXa1Xs3lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2zO/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5pY49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHYP\r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3eap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H19W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7l4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\nDz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/gd7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABVaEEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSBuXMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80vPvXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRIQs+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1JxJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+F9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----</key></cdn_ssl_certificate>'

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: 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\nMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTE0MDIGA1UEAxMrR2xvYmFsU2lnbiBP\r\ncmdhbml6YXRpb24gVmFsaWRhdGlvbiBDQVQgLSBHMjAeFw0xMzExMTEwNzE0MDRa\r\nFw0xNDExMTIwNzE0MDRaME4xCzAJBgNVBAYTAk1ZMSEwHwYDVQQLExhEb21haW4g\r\nQ29udHJvbCBWYWxpZGF0ZWQxHDAaBgNVBAMTE3d3dzQuZG91YmxldWtheS5jb20w\r\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Wa8LZprvDo6ceUVLqO6O\r\n6DoFRGIAuReYztClkamekCSauwwFN4Y/BAT6kvwxofYttwLgZk19ivID6AEFDh9f\r\nUexmmzNwb9nUEAdUljy3VUdmkhlSfNHxO718qIM6rot/y7TagYg54qij9c29bYe/\r\nFpamqJC0n/YrVJxeHL2Czu9iCUtX/FgW44GdvYEDeWEvHmR1cafT231VITsQnuPU\r\nd1Yh2B0jISgqy8JLfFhfMGaSv18gLybyYl86vWQ0/Bs7of5afxl65SH4/BiaMCgZ\r\nRGZJ51SxyKVUTA/6pDP9DJCNPPngy1xC5R3aSy4yShZehR3LSsabqAasp1AytYWz\r\nAgMBAAGjggHSMIIBzjAOBgNVHQ8BAf8EBAMCBaAwSQYDVR0gBEIwQDA+BgZngQwB\r\nAgEwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xvYmFsc2lnbi5jb20vcmVw\r\nb3NpdG9yeS8wHgYDVR0RBBcwFYITd3d3NC5kb3VibGV1a2F5LmNvbTAJBgNVHRME\r\nAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBIBgNVHR8EQTA/MD2g\r\nO6A5hjdodHRwOi8vY3JsLmdsb2JhbHNpZ24uY29tL2dzL2dzb3JnYW5pemF0aW9u\r\ndmFsY2F0ZzIuY3JsMIGcBggrBgEFBQcBAQSBjzCBjDBKBggrBgEFBQcwAoY+aHR0\r\ncDovL3NlY3VyZS5nbG9iYWxzaWduLmNvbS9jYWNlcnQvZ3Nvcmdhbml6YXRpb252\r\nYWxjYXRnMi5jcnQwPgYIKwYBBQUHMAGGMmh0dHA6Ly9vY3NwMi5nbG9iYWxzaWdu\r\

BILLING PLANS - GET THE LIST OF BILLING PLANS 426

Page 428: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

nLmNvbS9nc29yZ2FuaXphdGlvbnZhbGNhdGcyMB0GA1UdDgQWBBQJ5ZbekTK8hhT6\r\nYrPt2DFhQEy1CDAfBgNVHSMEGDAWgBTAgBLvJedUyPoCSeL3b9+0qwQerzANBgkq\r\nhkiG9w0BAQUFAAOCAQEAlFvMWHMDQingXy3UzgJAsK1JjaIKkWGJf1qhN0b3guvQ\r\n91hZ8i3vxyWWXMKhqtVXYjWXVlcTDVe94zX0Y4aoSKevYskabV0mLp6UXXij6Dsi\r\n65U4dGKuKnVjgCTHYnysxnP1TS7p846UEeuphzmXp53tlR3gv2Z4M2wP73neh+jD\r\nuPxndmcgLMLa33GVqu8nZ2Rr/yIbJe9XHqaFgYiamwRiWUwPgeGeWjeY+R6VOmDh\r\nu64x0Hb5ORj7nWCsSlQ9F4Igg2e+hvUqFPLn4fMGVDDfmar8YdpdlwHdqVgYyf5O\r\nYwZRgtsTtpoxqlUgjdUSC/w+U7heA/OZSNn1x+eDqw==\r\n-----END CERTIFICATE-----","key":"-----BEGIN RSA PRIVATE KEY-----\r\nMIIEogIBAAKCAQEAuFmvC2aa7w6OnHlFS6jujug6BURiALkXmM7QpZGpnpAkmrsM\r\nBTeGPwQE+pL8MaH2LbcC4GZNfYryA+gBBQ4fX1HsZpszcG/Z1BAHVJY8t1VHZpIZ\r\nUnzR8Tu9fKiDOq6Lf8u02oGIOeKoo/XNvW2HvxaWpqiQtJ/2K1ScXhy9gs7vYglL\r\nV/xYFuOBnb2BA3lhLx5kdXGn09t9VSE7EJ7j1HdWIdgdIyEoKsvCS3xYXzBmkr9f\r\nIC8m8mJfOr1kNPwbO6H+Wn8ZeuUh+PwYmjAoGURmSedUscilVEwP+qQz/QyQjTz5\r\n4MtcQuUd2ksuMkoWXoUdy0rGm6gGrKdQMrWFswIDAQABAoIBAFxzxcCe9YZ8M3Mv\r\nslvuXa1Xs3lewROBv97HoYXXVkyKF4Ft2upm3TGPL3wG6OlvQ0nL5Wpqg+Q5IYRp\r\n/tDtMziXmkoe/Z4eygx6+WInck2zO/qpvH9Mz/D+N9pjnGR6ksVFgO6wVYRKMq7/\r\nn+2nF5PynRz5npCnREqYxU7BdR07Fooz+V4bSReejNN5pY49341u3I+p/FnzH0Aa\r\n4Eyv3HSI2qzV+1l1YfhwPjZkLnEyHSj3MatQ6LF5gYfjlz2z7hkzGkjBfxvMdHYP\r\nT/k1+C02zeIVUAukgJIvjNAlp3E8RTONK64COQ2TY4Ksf9IEA3arRbBwoSDyrZuz\r\nb+YWS/ECgYEA3eap0ZxLIwjRNS/0T5hYcvWUmyCYRpvmSgFCbx9NU3zSJ8WyoSwr\r\ngPpV5+KIFVmDLj4A+OJzfovtZDptj6H19W/fiNvME0rRS5TiXKX9iA+B7O4wpx/8\r\ngBpGjEu0l4M1MKq02HErTZ57m8IKRHVInA/LYd2B8bLtB6QY7l4qHEkCgYEA1K3R\r\nbnRBJ1Lhyw3MfM8Ky8GVvBoHx00h4F+TfWD05brP3O2/jm3MRlW6me+NXu9VY40o\r\nDz/+wH0PGcm10W7dxWwKFx/4uov9nw3e4WgvCArzlyzggvTYcUnRDkJcpvXz9Oeh\r\ncWVsJKvG7artc02T/gd7XXNu02LBAUYQt9L8OhsCgYACPdA9U8zWf8JNPTzEiQ9r\r\nqdtkbcHcBLsgyD55jOFlFH+y8yZIxn9yABVaEEm7nXnbv7iWywLLpnIxbv2oU8R+\r\nRDEH2uCG2Vyf3NMkiHC1LSLs18MaDRKp4JoR1LnwRd0FrtPA0/PSBuXMvvsHkf+3\r\nw9kUFf64CEyopRmzXrQiMQKBgEqxtVFOoSdXc5emBAB9krQXDCihF8RGcbRkvN8W\r\n80vPvXtBQLqcE1dMepnfyU3jTqEFDWG1vxoJkgkjj6i7gEX6+NxATVHvIqb+7x1J\r\nQuNXPVAF4d/8cBvxqeuRIQs+bGzCATBbR4zli5sjIfwR7f0U0Z3zkaPKFjEFU4/M\r\nGOurAoGAEizvbWrvRTjulMjy/wwSFvaSjO4i9m1JxJxZm/0EZnQBNbeOmVw/TijG\r\nWnegJxB1PlR8L/N+PcMkTpaBKYCMJsMTPRwdlpn8xWLgG5p0RxqilbkH+F9RAlcs\r\nFeZsDaTSO3y2FYIntUA43cQLjb3UMkN+pz2NEtOBKSWxPOizRWo=\r\n-----END RSA PRIVATE KEY-----"}}'

Where:id - ID of the certificatename - the name of the certificatecert - the certificate keykey - the SSL key issued by your SSL provider

Every line should be separated by \r\n.

Make sure that cert and key parameters do not contain spaces between lines. Except delimiters:

BILLING PLANS - GET THE LIST OF BILLING PLANS 427

Page 429: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

-----BEGIN CERTIFICATE----------END CERTIFICATE----------BEGIN RSA PRIVATE KEY----------END RSA PRIVATE KEY-----

27.5 Delete Custom SNI SSL CertificateTo delete a custom SNI SSL certificate, use the following request:DELETE /cdn_ssl_certificates/:id.xmlDELETE /cdn_ssl_certificates/:id.jsonXML Request example

curl -i -X DELETE -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json' --url 'http://onapp.test/cdn_ssl_certificates/:id.json'

Where:id - the ID of the certificate

27.6 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.xmlPUT /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 428

Page 430: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'<cdn_resource><cdn_ssl_certificate_id>ssl_sert_id</cdn_ssl_certificate_id></cdn_resource>'

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 429

Page 431: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28 CDN STORAGE SERVERS

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 by the edge server nearest to the customer’s geographical location. There are two types of CDN storage servers in OnApp: HTTP and Streaming.

28.1 Get List of CDN Storage ServersTo get the list of all CDN storage servers in the cloud, run:GET /storage_servers.xmlGET /storage_servers.jsonXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 430

Page 432: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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"/><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><cpu_priority type="integer">1</cpu_priority>

BILLING PLANS - GET THE LIST OF BILLING PLANS 431

Page 433: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 falseadmin_note – an optional reminder for this server created by an administratorallow_resize_without_reboot – true if adjusting resource allocation without reboot is possible; otherwise falseallowed_hot_migrate – true if hot migration is allowed; otherwise falseallowed_swap – true if swap is allowed; otherwise falsebooted – true if the server is booted; otherwise falsebuilt - true if the server is already built; otherwise falsecpu_shares – the CPU priority percentagecpus – number of CPU cores allocated to this storage servercreated_at – the date when the CDN storage server was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatedge_server_type - type of the CDN storage serverenable_autoscale – false; not available for edge serversenable_monitis - deprecated attribute; will be removed in upcoming releasehypervisor_id – the ID of the compute resource, on which the server is deployedid – the edge server ID in OnApp CP databaseidentifier – the edge server identifierinitial_root_password – the server root passwordinitial_root_password_encrypted – true, if the server root password is encrypted, otherwise falselabel – an arbitrary name of the edge serverlocal_remote_access_port – the port ID used for console accesslocked – true if locked; otherwise falsememory – the amount of RAM resources allocated to this edge servermin_disk_size – minimum disk space required by the templatenote - an optional reminder for this VS made by a user accountoperating_system – type of operating systemoperating_system_distro – the distribution of the operating systemrecovery_mode – true if the server is booted in the recovery mode; otherwise falseremote_access_password – the password for remote accessstate – deprecated attribute; will be removed in upcoming releasestrict_virtual_machine_id - the ID of a virtual server (or edge server) that will never reside on the same compute resource with this serversuspended – true if suspended; otherwise falsetemplate_id – the ID of the template, on which the edge server is basedtemplate_label – label of the template on which the server is based; currently – OnApp CDN compute resourceupdated_at – the date when the CDN edge server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 432

Page 434: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_id – the ID of the user, who is the server ownervip – true if the server has VIP status for migration; otherwise falsexen_id – the edge server ID set by the virtualization engineip_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

28.2 Get List of HTTP Storage ServersTo 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 433

Page 435: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.3 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.

28.4 Get CDN Storage Server DetailsTo view details of a particular storage server, run:

XML Request example

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 434

Page 436: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"/><xen_id type="integer">69</xen_id><ip_addresses type="array"><ip_address>

BILLING PLANS - GET THE LIST OF BILLING PLANS 435

Page 437: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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><edge_status>Active</edge_status></storage_server>

For parameters description, refer to Get List of CDN Storage Servers section.

28.5 Add CDN Storage ServerTo create new CDN storage server, run:POST /storage_servers.xmlPOST /storage_servers.jsonXML 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</required_virtual_machine_build><hypervisor_group_id>1</hypervisor_group_id><hypervisor_id>1</hypervisor_id><required_ip_address_assignment>1</required_ip_address_assignment><primary_disk_size>5</primary_disk_size><rate_limit>0</rate_limit><cdn_location>5</

BILLING PLANS - GET THE LIST OF BILLING PLANS 436

Page 438: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cdn_location><storage_server_type>http</storage_server_type></storage_server>' -u user:userpass http://onapp.test/storage_servers.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -d '{"storage_server":{"label":"az_CDN_test", "cpus":"1","data_store_group_primary_id":"2","primary_network_group_id":"3","cpu_shares":"1" ,"memory":"512","required_virtual_machine_build":"1","hypervisor_group_id":"1","hypervisor_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 '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 [ _ ]hypervisor_id - indicate the ID of the compute resource, on which the server will be deployedhypervisor_group_id - indicate the compute zone IDcpus * - the amount of CPU cores allocated to this storage servercpu_shares * - the percentage of allocated CPU priority resourcememory * - the amount of RAM, which you want to allocate to this storage serverprimary_disk_size * - the size in GB of the primary diskdata_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 capacityprimary_network_group_id – indicate the network zone IDrequired_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"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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 437

Page 439: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.5.1 Page Historyv. 3.3.1

cdn_location parameter

storage_server_type

28.6 Edit CDN Storage ServerTo edit a CDN storage server, run:PUT /storage_servers/:id.xmlPUT /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_marketplace><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","cpu_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 servercpu_shares - the percentage of allocated CPU priority resourcememory - the amount of RAM, which you want to allocate to this storage serverReturns HTTP 204 response on successful processing, and HTTP 404 when there is no storage server with a requested ID, or URL is incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 438

Page 440: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.7 Reboot CDN Storage ServerTo reboot the storage server:POST /storage_servers/:storage_server_id/reboot.xmlPOST /storage_servers/:storage_server_id/reboot.jsonXML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/reboot.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/reboot.json

28.8 Start up CDN Storage ServerPOST /storage_servers/:storage_server_id/startup.xmlPOST /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.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/startup.json

28.9 Shut down CDN Storage ServerPOST /storage_servers/:storage_server_id/shutdown.xmlPOST /storage_servers/:storage_server_id/shutdown.jsonXML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/shutdown.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 439

Page 441: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/shutdown.json

28.10 Stop CDN Storage ServerTo terminate the storage server forcefully:POST /storage_servers/:storage_server_id/stop.xmlPOST /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.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/stop.json

28.11 Rebuild CDN Storage ServerTo rebuild (or build manually) the CDN storage server, use the following request:POST /storage_servers/storage_server_id/build.xmlPOST /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></storage_server>' --url http://onapp.test/storage_servers/storage_server_id/build.xml

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 440

Page 442: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 basedrequired_startup – set "1" to start up the server automatically after build, otherwise set "0"

28.12 Suspend CDN Storage ServerTo suspend a CDN storage server, run:POST /storage_servers/:storage_server_id/suspend.xmlPOST /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.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/suspend.json

To unsuspend a storage server, run the request again.

28.13 Unlock CDN Storage ServerTo unlock CDN storage server:POST /storage_servers/:storage_server_id/unlock.xmlPOST /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.xml

JSON Request example

curl -i -X POST -u user:userpass --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 441

Page 443: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/storage_servers/:storage_server_id/unlock.json

28.14 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.xmlPOST /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.

28.15 Delete CDN Storage ServerDELETE /storage_servers/:id.xmlDELETE /storage_servers/:id.json XML Request example

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 442

Page 444: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

28.16 Migrate CDN Storage ServerTo migrate a storage server, run:POST /storage_servers/:storage_server_id/migrate.xmlPOST /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_migrate_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 servercold_migrate_on_rollback - set to 1 if you wish to switch to a cold migration if hot migration fails, otherwise set 0

28.17 Segregate CDN Storage ServerTo 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 443

Page 445: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /storage_servers/:storage_server_id/strict_vm.xmlPOST /storage_servers/:storage_server_id/strict_vm.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<virtual_machine><strict_virtual_machine_id>l615jn0d9tlv0s</strict_storage_server_id></virtual_machine>' --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 '{"virtual_machine":{"strict_virtual_machine_id":"l615jn0d9tlv0s"}}' --url http://onapp.test/storage_servers/:storage_server_id/strict_vm.json

Where:strict_virtual_machine_id * - the ID of the server you wish to segregate

28.18 Resize CDN Storage ServerTo 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 444

Page 446: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

28.19 Change CDN Storage Server OwnerTo change owner of the CDN storage server, run:POST /storage_servers/:storage_server_id/change_owner.xmlPOST /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

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/storage_servers/:storage_server_id/change_owner.json

28.20 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.xmlPOST /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&shutdown_type=hard&required_startup=1' -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 445

Page 447: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -X POST -u user:userpass --url 'http://onapp.test/storage_servers/:storage_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 storage server

shutdown_type - type of the storage server shutdown: hard, graceful or softrequired_startup - set 1 to start up the server automatically after build, otherwise set 0

28.21 CDN Storage Server DisksYou 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.xmlGET /storage_servers/:storage_server_id/disks.jsonParameters description and output example.For other possible requests, refer to corresponding sections of Disks chapter.

28.22 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.xmlGET /storage_servers/:storage_server_id/network_interfaces.jsonTo get a particular network interface details:GET /storage_servers/:storage_server_id/network_interfaces/:id.xmlGET /storage_servers/:storage_server_id/network_interfaces/:id.jsonTo edit network interface details:

BILLING PLANS - GET THE LIST OF BILLING PLANS 446

Page 448: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /storage_servers/:storage_server_id/network_interfaces/:id.xmlPUT /storage_servers/:storage_server_id/network_interfaces/:id.jsonTo add a new network interface:POST /storage_servers/:storage_server_id/network_interfaces.xmlPOST /storage_servers/:storage_server_id/network_interfaces.jsonTo delete a network interface from the storage server:DELETE /storage_servers/:storage_server_id/network_interfaces/:id.xmlDELETE /storage_servers/:storage_server_id/network_interfaces/:id.jsonParameters description and output example.

28.23 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.xmlGET /storage_servers/:storage_server_id/ip_addresses.jsonXML 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.xmlPOST /storage_servers/:storage_server_id/ip_addresses.jsonXML 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>7</ip_address_id><network_interface_id>113</network_interface_id></ip_address_join>' --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 447

Page 449: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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":"113"}}' --url http://onapp.test/storage_servers/:storage_server_id/ip_addresses.json

XML Response Example

Status: 201Content-Length: 1065Connection: closeContent-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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 448

Page 450: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</ip_address></ip_address_join>

Where:created_at - the date when the record was created in DBid - the IP address join IDip_address_id - the IP address IDnetwork_interface_id - the network interface IDupdated_at - the date when the record was updated in DBip_address - the array of IP address detailsaddress - the IP addressbroadcast - 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 networkdisallowed_primary - true if this address is not set as primary (for VS build), otherwise falsegateway - gateway addresshypervisor_id - the ID of the compute resourceip_address_pool_id - the ID of the IP address poll to which this join belongsnetwork_address - the address of a VLAN network address that will be associated with this IP address poolnetwork_id - the ID of the networkpxe - true, if this address can be used for cloudbooting a compute resourcefree - true if free, otherwise falsenetmask — 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.xmlDELETE storage_servers/:storage_server_id/ip_addresses/:id.jsonXML 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 449

Page 451: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.24 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.xmlGET /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-MM-DD+hh:mm:ss&period[use_local_time]=1GET /storage_servers/:storage_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/cpu_usage.xml

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/storage_servers/:storage_server_id/cpu_usage.json

Where you have to specify the storage server ID.

28.25 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.xmlGET /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 450

Page 452: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

/storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Request example

GET /storage_servers/:storage_server_id/vm_stats/:hourly_statistics_id.json?period[startdate]=YYYY-MM-DD+hh: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 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 createdupdated_at – the time stamp in DB when this record was updatedcurrency_code - currency in which this storage server is charged within the billing planid – the hourly statistics ID. Use this ID for retrieving the billing statistics.stat_time – the particular hour for which these statistics were generateduser_id - the ID of storage server ownervirtual_machine_id - ID of a storage servervm_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)

BILLING PLANS - GET THE LIST OF BILLING PLANS 451

Page 453: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

usage_cost – the total due for storage server usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage)

28.26 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.xmlGET /storage_servers/:storage_server_id/vm_stats.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-MM-DD+hh: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-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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 452

Page 454: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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">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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 453

Page 455: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> </costs> <label>eth0</label> </network_interface> </network_interfaces> <virtual_machines type="array">

BILLING PLANS - GET THE LIST OF BILLING PLANS 454

Page 456: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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 createdupdated_at – the time stamp in DB when this record was updatedcurrency_code - currency in which this storage server is charged within the billing planid – the ID of the storage server hourly statisticsstat_time – the particular hour for which these statistics were generateduser_id - the ID of storage server ownervirtual_machine_id - ID of a storage servervirtual_machine_billing_statistics_id -ID of a storage server billing statisticsbilling_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:o label - disk name used in UIo id - disk ID used in databaseo costs- an array of disk related resources with their total prices

for the period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be disk_size,

data_read, data_written, reads_completed and writes_completedo value - the amount of resources used (GBs of disk size, Kbs of data

read/written, the number of reads/writes)o cost - the total due for the resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 455

Page 457: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

network_interfaces - an array of network interfaces used by this storage server with their billing statistics:

o label - network interface name used in OnAppo id - network interface IDo costs- an array of network interface related resources with their

total prices for the period specified in the stat-time parameter, where:

o resource_name- the resource in question. This can be ip_addresses, rate, data_received and data_sent

o 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 )

o cost - the total due for the resource virtual_machines - an array of storage server billing details:

o label - storage server nameo costs- An array of storage server resources with their total prices

for the period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be cpu_shares,

cpus, memory, cpu_usage and templateo value - the amount of resources allocated to this storage server.

For the templates resource, this parameter means a template ID in database.

o cost - the total due for this resourceo 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)

28.27 Search CDN Storage Server by LabelTo 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 456

Page 458: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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?q=label

Where you have to specify the label of a CDN storage server you are searching for.

28.28 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.xmlGET /storage_servers/:storage_server_id/backups.jsonAn 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 457

Page 459: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 upallowed_hot_migrate – true if hot migration is allowed for the storage server backed upallowed_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 storedbackup_size – the disk space taken by this backup in kBbackup_type – disk backupbuilt – true if the storage server backed up has been builtbuilt_at – the date when the disk backup was builtcreated_at – the date when the record in the database was createdupdated_at – the date when this record in database was updateddisk_id – the id of a disk backed upid – the ID of this backupidentifier - disk identifierimage_type - backup type (currently only tar is available)locked – true if the storage server backed up has been lockedmarked_for_delete – the backup is marked for deletion (for auto-backups)min_disk_size – the minimum disk sizeoperating_system_distro – the OS distribution of the storage server backed upoperating_system – the OS of the storage server backed uptemplate_id – the ID of a template from which the storage server backed up was builtuser_id - the ID of a user the storage server belongs tovolume_id - data store IDSolidFire - related parameters:iqn - volume ISCSI quialified name

BILLING PLANS - GET THE LIST OF BILLING PLANS 458

Page 460: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

28.29 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.xmlPUT /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

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 459

Page 461: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

29 CDN USAGE STATISTICS

CDN usage statistics shows the detailed information on all the resources used by CDN.GET /cdn_usage_statistics.xmlGET /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-MM-DD+hh:mm:ss</enddate></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:

Status: 200Content-Length: 1378Connection: closeContent-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

BILLING PLANS - GET THE LIST OF BILLING PLANS 460

Page 462: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

edge_group_id - the ID of the edge group in usecached - the amount of cached data in GBnon_cached - the amount of non-cached data in GBlocation_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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 461

Page 463: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

30 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_sample

JSON Request example

curl -X GET -u user:userpass http://onapp.test/password_strength_meter.json?password=password_sample

Where you have to specify your password instead of the password_sample

BILLING PLANS - GET THE LIST OF BILLING PLANS 462

Page 464: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

31 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.

31.1 Get List of CloudBoot IP AddressesGET /cloud_boot_ip_addresses.xmlGET /cloud_boot_ip_addresses.jsonXML 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 addressesaddress – IP addressbroadcast – broadcast addresscreated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - the ID of the customer VLAN the IP address belongs to

BILLING PLANS - GET THE LIST OF BILLING PLANS 463

Page 465: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

disallowed_primary – true if not allowed to be used as primary, otherwise falsegateway – gateway addresshypervisor_id - the ID of a compute resource the IP address is associated with id –the ID of the IP addressip_address_pool_id - ID of the IP address pool the IP address is associated withnetwork_address – the address of the networknetwork_id –the ID of the networkpxe - true, if this compute resource address can be used for cloudbooting a compute resourceupdated_at — the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of the user this IP address is assigned tofree – true if free, otherwise falsenetmask — netmask for the IP address

31.2 Add CloudBoot IP AddressPOST /cloud_boot_ip_addresses.xmlPOST /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><broadcast>109.123.105.191</broadcast><disallowed_primary>true</disallowed_primary><network_address>109.123.105.176</network_address><gateway>109.123.105.177</gateway></ip_address>' --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":"109.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gateway":"109.123.105.177"}}' --url http://onapp.test/cloud_boot_ip_addresses.json*

Where:address* - IP addressnetmask* - network mask

BILLING PLANS - GET THE LIST OF BILLING PLANS 464

Page 466: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 networkgateway* - gateway addressdisallowed_primary – set true not to use this address as primary. Otherwise set false

31.3 Edit CloudBoot IP AddressPUT /cloud_boot_ip_addresses/:id.xmlPUT /cloud_boot_ip_addresses/:id.xmlXML 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><broadcast>109.123.105.191</broadcast><network_address>109.123.105.176</network_address><disallowed_primary>true</disallowed_primary><gateway>109.123.105.177</gateway></ip_address>' --url http://onapp.test/cloud_boot_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":"109.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gateway":"109.123.105.177"}}' --url http:cloud_boot_ip_addresses/:id.json*

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.

31.4 Delete Cloud Boot IP AddressDELETE /cloud_boot_ip_addresses/:id.xmlDELETE /cloud_boot_ip_addresses/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 465

Page 467: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

*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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 466

Page 468: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

32 COMPANY BILLING PLANS

This section provides the API calls you can use to manage company billing plans.

32.1 Get List of Company Billing PlansTo get the list of all company billing plans, use the following request:GET /billing/company/plans.xmlGET /billing/company/plans.jsonXML Request example

curl -i -X GET http://onapp.test/billing/company/plans.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/billing/company/plans.json -u user:userpass

XML Output example

<?xml version="1.0" encoding="UTF-8"?><company_plans type="array"> <company_plan> <created_at type="datetime">2015-11-10T16:00:57+02:00</created_at> <currency_code>USD</currency_code> <id type="integer">12</id> <label>default company billing plan</label> <updated_at type="datetime">2016-01-11T11:39:37+02:00</updated_at> </company_plan> <company_plan>...</company_plan></company_plans>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcurrency_code - the code of the currency you're going to charge inid - the ID of the billing planlabel - the name of the billing planupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 467

Page 469: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

32.2 Get Company Billing Plan DetailsTo get the details of a company billing plan, use the following method:GET /billing/company/plans/:id.xmlGET /billing/company/plans/:id.jsonThis request provides only the details of the billing plan. To view the plan's resources, refer to Get Company Billing Plan Resources.XML Request example

curl -i -X GET http://onapp.test/billing/company/plans/:id.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/billing/company/plans/:id.json -u user:userpass

XML Output example

<?xml version="1.0" encoding="UTF-8"?><company_plan> <created_at type="datetime">2015-11-10T16:00:57+02:00</created_at> <currency_code>USD</currency_code> <id type="integer">12</id> <label>example company billing plan</label> <updated_at type="datetime">2016-01-11T11:39:37+02:00</updated_at></company_plan>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcurrency_code - the code of the currency you're going to charge inid - the ID of the billing planlabel - the name of the billing planupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

32.3 Get Company Billing Plan ResourcesTo get the list of resources assigned to a company billing plan, use the following request:GET /billing/company/plans/:company_billing_plan_id/resources.xmlGET /billing/company/plans/:company_billing_plan_id/resources.jsonXML Request example

curl -i -X GET

BILLING PLANS - GET THE LIST OF BILLING PLANS 468

Page 470: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/billing/company/plans/:company_billing_plan_id/resources.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/billing/company/plans/:company_billing_plan_id/resources.json -u user:userpass

XML Output example

<?xml version="1.0" encoding="UTF-8"?><resources type="array"> <resource> <resource> <id type="integer">233</id> <limits> <limit_free_allocation_cpu_allocation type="integer">5</limit_free_allocation_cpu_allocation> <limit_free_allocation_cpu_resources_guaranteed type="integer">25</limit_free_allocation_cpu_resources_guaranteed> <limit_free_allocation_memory_allocation type="integer">100</limit_free_allocation_memory_allocation> <limit_free_allocation_memory_resources_guaranteed type="integer">25</limit_free_allocation_memory_resources_guaranteed><limit_free_allocation_vcpu_speed type="integer">0</limit_free_allocation_vcpu_speed> <limit_min_allocation_cpu_allocation type="integer">5</limit_min_allocation_cpu_allocation> <limit_min_allocation_cpu_resources_guaranteed type="integer">5</limit_min_allocation_cpu_resources_guaranteed> <limit_min_allocation_memory_allocation type="integer">5</limit_min_allocation_memory_allocation> <limit_min_allocation_memory_resources_guaranteed type="integer">5</limit_min_allocation_memory_resources_guaranteed> <limit_min_allocation_vcpu_speed nil="true"/> <limit_allocation_cpu_allocation type="integer">1000</limit_allocation_cpu_allocation> <limit_allocation_cpu_resources_guaranteed type="integer">100</limit_allocation_cpu_resources_guaranteed> <limit_allocation_memory_allocation type="integer">1000</limit_allocation_memory_allocation> <limit_allocation_memory_resources_guaranteed type="integer">100</limit_allocation_memory_resources_guaranteed><limit_allocation_vcpu_speed nil="true"/> <limit_free_reservation_cpu_allocation type="integer">75</limit_free_reservation_cpu_allocation>

BILLING PLANS - GET THE LIST OF BILLING PLANS 469

Page 471: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<limit_free_reservation_memory_allocation type="integer">100</limit_free_reservation_memory_allocation> <limit_min_reservation_cpu_allocation type="integer">5</limit_min_reservation_cpu_allocation> <limit_min_reservation_memory_allocation type="integer">5</limit_min_reservation_memory_allocation> <limit_reservation_cpu_allocation type="integer">100</limit_reservation_cpu_allocation> <limit_reservation_memory_allocation type="integer">1000</limit_reservation_memory_allocation> <limit_free_pay_as_you_go_cpu_limit type="integer">0</limit_free_pay_as_you_go_cpu_limit> <limit_free_pay_as_you_go_memory_limit type="integer">0</limit_free_pay_as_you_go_memory_limit> <limit_free_pay_as_you_go_cpu_used type="integer">0</limit_free_pay_as_you_go_cpu_used> <limit_free_pay_as_you_go_memory_used type="integer">0</limit_free_pay_as_you_go_memory_used> <limit_min_pay_as_you_go_cpu_limit nil="true"/> <limit_min_pay_as_you_go_memory_limit nil="true"/> <limit_pay_as_you_go_cpu_limit nil="true"/> <limit_pay_as_you_go_memory_limit nil="true"/></limits> <prices> <price_allocation_cpu_allocation type="float">2.0</price_allocation_cpu_allocation> <price_allocation_cpu_resources_guaranteed type="float">3.0</price_allocation_cpu_resources_guaranteed> <price_allocation_memory_allocation type="float">1.0</price_allocation_memory_allocation> <price_allocation_memory_resources_guaranteed type="float">2.0</price_allocation_memory_resources_guaranteed> <price_allocation_vcpu_speed type="integer">0</price_allocation_vcpu_speed> <price_reservation_cpu_allocation type="float">2.0</price_reservation_cpu_allocation> <price_reservation_memory_allocation type="float">1.0</price_reservation_memory_allocation> <price_pay_as_you_go_cpu_limit type="integer">0</price_pay_as_you_go_cpu_limit> <price_pay_as_you_go_memory_limit type="integer">0</price_pay_as_you_go_memory_limit> <price_pay_as_you_go_cpu_used type="integer">0</price_pay_as_you_go_cpu_used> <price_pay_as_you_go_memory_used type="integer">0</price_pay_as_you_go_memory_used> <price_pay_as_you_go_cpu_limit_unlimited type="integer">0</price_pay_as_you_go_cpu_limit_unlimited>

BILLING PLANS - GET THE LIST OF BILLING PLANS 470

Page 472: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<price_pay_as_you_go_memory_limit_unlimited type="integer">0</price_pay_as_you_go_memory_limit_unlimited></prices> <target_id type="integer">3</target_id> <billing_plan_id type="integer">48</billing_plan_id> <created_at type="datetime">2016-01-13T14:32:05+02:00</created_at> <updated_at type="datetime">2016-01-13T14:33:53+02:00</updated_at> <limit_type>hourly</limit_type> <label>Default Hypervisor Zone</label> </resource> </resource> <resource> <resource> <id type="integer">234</id> <limits> <limit_free_disk_size type="integer">100</limit_free_disk_size> <limit_free_disk_size_used type="integer">0</limit_free_disk_size_used> <limit_min_disk_size type="integer">10</limit_min_disk_size> <limit_min_disk_size_used nil="true"/> <limit_disk_size type="integer">1000</limit_disk_size> <limit_disk_size_used nil="true"/> </limits> <prices> <price_disk_size type="float">2.0</price_disk_size> <price_disk_size_used type="integer">0</price_disk_size_used> <price_disk_size_unlimited type="integer">0</price_disk_size_unlimited> </prices> <target_id type="integer">1</target_id> <billing_plan_id type="integer">48</billing_plan_id> <created_at type="datetime">2016-01-13T14:33:57+02:00</created_at> <updated_at type="datetime">2016-01-13T14:34:11+02:00</updated_at> <limit_type>hourly</limit_type> <label>Default DataStore Zone</label> </resource> </resource> <resource> <resource> <id type="integer">235</id> <limits> <limit_free_ip type="integer">10</limit_free_ip>

BILLING PLANS - GET THE LIST OF BILLING PLANS 471

Page 473: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<limit_free_data_sent type="integer">100</limit_free_data_sent> <limit_free_data_received type="integer">100</limit_free_data_received> <limit_ip type="integer">100</limit_ip> </limits> <prices> <price_ip type="float">2.0</price_ip> <price_data_sent type="float">1.0</price_data_sent> <price_data_received type="float">1.0</price_data_received> </prices> <target_id type="integer">2</target_id> <billing_plan_id type="integer">48</billing_plan_id> <created_at type="datetime">2016-01-13T14:34:13+02:00</created_at> <updated_at type="datetime">2016-01-13T14:34:31+02:00</updated_at> <limit_type>hourly</limit_type> <label>Default Network Zone</label> </resource> </resource></resources>

Where:id - ID of the resourcetarget_id - ID of a resource target (e.g. compute zone)billing_plan_id - ID of the billing plancreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlimit_type - hourly or monthly limit type set for the resourcelabel - name of the base resource targetFor allocation pool:limit_free_allocation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_allocation_cpu_resources_guaranteed - the free amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_free_allocation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_free_allocation_memory_resources_guaranteed - the free amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_cpu_allocation - the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_allocation_cpu_resources_guaranteed - the minimum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 472

Page 474: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_min_allocation_memory_resources_guaranteed - the minimum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_allocation_cpu_resources_guaranteed - the maximum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_memory_allocation - the maximum amount of memory (in GB) per limit_type users can request under this planlimit_allocation_memory_resources_guaranteed - the maximum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource pool

limit_free_allocation_vcpu_speed - the amount of vCPU speed (in MHz) per limit_type that users get for free

limit_min_allocation_vcpu_speed - the minimum amount of vCPU speed (in MHz) per limit_type users can request under this plan

limit_allocation_vcpu_speed - the maximum amount of vCPU speed (in MHz) per limit_type users can request under this planprice_allocation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_allocation_cpu_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for CPU resourcesprice_allocation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memoryprice_allocation_memory_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for memory resources

price_allocation_vcpu_speed - the price per MHz per hour or per month (depending on selected limit type) for vCPU speed

For reservation pool:

limit_free_reservation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_reservation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_min_reservation_cpu_allocation -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_reservation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_reservation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_reservation_memory_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planprice_reservation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_reservation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memory

BILLING PLANS - GET THE LIST OF BILLING PLANS 473

Page 475: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

For Pay As You Go pool:

limit_free_pay_as_you_go_cpu_limit - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_limit - the amount of memory (in GB) per limit_type that users get for freelimit_free_pay_as_you_go_cpu_used - the amount of used CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_used - the amount of used memory (in GB) per limit_type that users get for freelimit_min_pay_as_you_go_cpu_limit -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_pay_as_you_go_memory_limit - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_pay_as_you_go_cpu_limit - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_pay_as_you_go_memory_limit - the maximum amount of memory (in GB) per limit_type users can request under this planprice_pay_as_you_go_cpu_limit - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_pay_as_you_go_memory_limit - the price per GB per hour or per month (depending on selected limit type) for memoryprice_pay_as_you_go_cpu_used - the price per GHz per hour or per month (depending on selected limit type) for used CPUprice_pay_as_you_go_memory_used - the price per GB per hour or per month (depending on selected limit type) for used memoryprice_pay_as_you_go_cpu_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of CPUprice_pay_as_you_go_memory_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of memory

For Data Store Zone:limit_free_disk_size - the amount of disk size (in GB) per limit_type that users get for free

limit_free_disk_size_used - the amount of used disk size (in GB) per limit_type that users get for freelimit_min_disk_size - the minimum amount of disk size (in GB) per limit_type users can request under this plan

limit_min_disk_size_used - the minimum amount of used disk size (in GB) per limit_type users can request under this planlimit_disk_size - the maximum amount of disk size (in GB) per limit_type users can request under this plan

limit_disk_size_used - the maximum amount of used disk size (in GB) per limit_type users can request under this planprice_disk_size - the price per GB per hour or per month (depending on selected limit type) for disk size

BILLING PLANS - GET THE LIST OF BILLING PLANS 474

Page 476: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_disk_size_used - the price per GB per hour or per month (depending on selected limit type) for used disk size

price_disk_size_unlimited - the price per hour or per month (depending on selected limit type) for unlimited disk sizeFor Network Zone:limit_free_ip - the number of IP addresses per limit_type that users get for freelimit_free_data_sent - the amount of sent data (in GB) per limit_type that users get for freelimit_free_data_received - the amount of received data (in GB) per limit_type that users get for freelimit_ip - the maximum number of IP addresses per limit_type users can request under this planprice_ip - the price per IP address per hour or per month (depending on selected limit type)price_data_sent - the price over free units per GB per hour or per month (depending on selected limit type) for sent dataprice_data_received - the price over free units per GB per hour or per month (depending on selected limit type) for received data

32.3.1 Page history

v5.0:

Added parameters for Pay As You Go resource pool type, vCPU speed and for used disk size.

32.4 Get Company Billing Plan Resource Details

To view the details of a resource assigned to a company billing plan, use the following request:GET /billing/company/resources/:resource_id.xmlGET /billing/company/resources/:resource_id.json

You can check ID of the required resource with GET method:GET /billing/company/plans/:company_billing_plan_id/resources.xmlGET /billing/company/plans/:company_billing_plan_id/resources.json

XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 475

Page 477: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET http://onapp.test/billing/company/resources/:resource_id.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/billing/company/resources/:resource_id.json -u user:userpass

XML Output example

<?xml version="1.0" encoding="UTF-8"?><resource> <id type="integer">234</id> <limits> <limit_free_disk_size type="integer">100</limit_free_disk_size> <limit_min_disk_size type="integer">10</limit_min_disk_size> <limit_disk_size type="integer">1000</limit_disk_size> </limits> <prices> <price_disk_size type="float">2.0</price_disk_size> </prices> <target_id type="integer">1</target_id> <billing_plan_id type="integer">48</billing_plan_id> <created_at type="datetime">2016-01-13T14:33:57+02:00</created_at> <updated_at type="datetime">2016-01-13T14:34:11+02:00</updated_at> <limit_type>hourly</limit_type> <label>Default DataStore Zone</label></resource>

Where:id - ID of the resourcetarget_id - ID of a resource target (e.g. compute zone)billing_plan_id - ID of the billing plancreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlimit_type - hourly or monthly limit type set for the resourcelabel - name of the base resource targetFor allocation pool:limit_free_allocation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_allocation_cpu_resources_guaranteed - the free amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_free_allocation_memory_allocation - the amount of memory (in GB) per limit_type that users get for free

BILLING PLANS - GET THE LIST OF BILLING PLANS 476

Page 478: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_free_allocation_memory_resources_guaranteed - the free amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_cpu_allocation - the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_allocation_cpu_resources_guaranteed - the minimum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_min_allocation_memory_resources_guaranteed - the minimum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_allocation_cpu_resources_guaranteed - the maximum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_memory_allocation - the maximum amount of memory (in GB) per limit_type users can request under this planlimit_allocation_memory_resources_guaranteed - the maximum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource pool

limit_free_allocation_vcpu_speed - the amount of vCPU speed (in MHz) per limit_type that users get for free

limit_min_allocation_vcpu_speed - the minimum amount of vCPU speed (in MHz) per limit_type users can request under this plan

limit_allocation_vcpu_speed - the maximum amount of vCPU speed (in MHz) per limit_type users can request under this planprice_allocation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_allocation_cpu_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for CPU resourcesprice_allocation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memoryprice_allocation_memory_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for memory resources

price_allocation_vcpu_speed - the price per MHz per hour or per month (depending on selected limit type) for vCPU speedFor reservation pool:

limit_free_reservation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_reservation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_min_reservation_cpu_allocation -the minimum amount of CPU (in GHz) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 477

Page 479: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_min_reservation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_reservation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_reservation_memory_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planprice_reservation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_reservation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memory

For Pay As You Go pool:limit_free_pay_as_you_go_cpu_limit - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_limit - the amount of memory (in GB) per limit_type that users get for freelimit_free_pay_as_you_go_cpu_used - the amount of used CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_used - the amount of used memory (in GB) per limit_type that users get for freelimit_min_pay_as_you_go_cpu_limit -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_pay_as_you_go_memory_limit - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_pay_as_you_go_cpu_limit - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_pay_as_you_go_memory_limit - the maximum amount of memory (in GB) per limit_type users can request under this planprice_pay_as_you_go_cpu_limit - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_pay_as_you_go_memory_limit - the price per GB per hour or per month (depending on selected limit type) for memoryprice_pay_as_you_go_cpu_used - the price per GHz per hour or per month (depending on selected limit type) for used CPUprice_pay_as_you_go_memory_used - the price per GB per hour or per month (depending on selected limit type) for used memoryprice_pay_as_you_go_cpu_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of CPUprice_pay_as_you_go_memory_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of memory

For Data Store Zone:limit_free_disk_size - the amount of disk size (in GB) per limit_type that users get for free

limit_free_disk_size_used - the amount of used disk size (in GB) per limit_type that users get for freelimit_min_disk_size - the minimum amount of disk size (in GB) per limit_type users can request under this plan

limit_min_disk_size_used - the minimum amount of used disk size (in GB) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 478

Page 480: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_disk_size - the maximum amount of disk size (in GB) per limit_type users can request under this plan

limit_disk_size_used - the maximum amount of used disk size (in GB) per limit_type users can request under this planprice_disk_size - the price per GB per hour or per month (depending on selected limit type) for disk size

price_disk_size_used - the price per GB per hour or per month (depending on selected limit type) for used disk size

price_disk_size_unlimited - the price per hour or per month (depending on selected limit type) for unlimited disk sizeFor Network Zone:limit_free_ip - the number of IP addresses per limit_type that users get for freelimit_free_data_sent - the amount of sent data (in GB) per limit_type that users get for freelimit_free_data_received - the amount of received data (in GB) per limit_type that users get for freelimit_ip - the maximum number of IP addresses per limit_type users can request under this planprice_ip - the price per IP address per hour or per month (depending on selected limit type)price_data_sent - the price over free units per GB per hour or per month (depending on selected limit type) for sent dataprice_data_received - the price over free units per GB per hour or per month (depending on selected limit type) for received data

32.4.1 Page historyv5.0:

Added parameters for Pay As You Go resource pool type, vCPU speed and for used disk size.

32.5 Create Company Billing PlanTo add new company billing plan, use the following method:POST /billing/company/plans.xmlPOST /billing/company/plans.jsonXML Request example

curl -i -X POST http://onapp.test/billing/company/plans.xml -u user:userpass -H 'Content-Type:application/xml' -d '<company_plan><label>company_label</label><currency_code>USD</currency_code><monthly_price>15</monthly_price></company_plan>'

BILLING PLANS - GET THE LIST OF BILLING PLANS 479

Page 481: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON request example 1

curl -i -X POST http://onapp.test/billing/company/plans.json -u user:userpass -H 'Content-Type:application/json' -d '{"company_plan":{"label":"company_label", "currency_code":"USD", "monthly_price":10}}'

Where:label* - the company billing plan namecurrency_code* - the currency that users will be charged in within this billing planmonthly_price* - set a monthly fee for plan usage

32.6 Add Limits for Compute ZoneTo set limits for Compute Zones, use the following request:POST /billing/company/plans/:id/resources.xmlPOST /billing/company/plans/:id/resources.jsonXML Request example

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><resource_class>Billing::Company::Resource::VCloud::ComputeZone</resource_class><target_id>1</target_id><limit_free_cpu>4</limit_free_cpu><limit_free_cpu_share>2</limit_free_cpu_share><limit_free_cpu_units>2</limit_free_cpu_units><limit_free_memory>10</limit_free_memory><limit_default_cpu>1</limit_default_cpu><limit_min_cpu>1</limit_min_cpu><limit_min_memory>128</limit_min_memory><limit_default_cpu_share>100</limit_default_cpu_share><limit_min_cpu_priority>1</limit_min_cpu_priority><price_on_cpu>1</price_on_cpu><price_off_cpu>2</price_off_cpu><price_on_cpu_share>2</price_on_cpu_share><price_off_cpu_share>1</price_off_cpu_share><price_on_cpu_units>1</price_on_cpu_units><price_off_cpu_units>2</price_off_cpu_units><price_on_memory>1</price_on_memory><price_off_memory>1</price_off_memory></resource>'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 480

Page 482: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{ "resource_class":"Billing::Company::Resource::VCloud::ComputeZone", "target_id":"1", "limits":{"limit_free_cpu":4,"limit_free_cpu_share":2,"limit_free_cpu_units":2,"limit_free_memory":10,"limit_default_cpu":1,"limit_min_cpu":1,"limit_min_memory":128,"limit_default_cpu_share":100,"limit_min_cpu_priority":1},"prices":{"price_on_cpu":1,"price_off_cpu":2,"price_on_cpu_share":2,"price_off_cpu_share":1,"price_on_cpu_units":1,"price_off_cpu_units":2,"price_on_memory":1,"price_off_memory":1}}}'

Where:resource_class* - the name of the base resource you add to the billing plan, in this case - Billing::Company::Resource::VCloud::ComputeZonetarget_id* - ID of a resource target (compute zone)For allocation pool:limit_free_allocation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_allocation_cpu_resources_guaranteed - the free amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_free_allocation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_free_allocation_memory_resources_guaranteed - the free amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_cpu_allocation - the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_allocation_cpu_resources_guaranteed - the minimum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_min_allocation_memory_resources_guaranteed - the minimum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_allocation_cpu_resources_guaranteed - the maximum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_memory_allocation - the maximum amount of memory (in GB) per limit_type users can request under this planlimit_allocation_memory_resources_guaranteed - the maximum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource pool

BILLING PLANS - GET THE LIST OF BILLING PLANS 481

Page 483: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_free_allocation_vcpu_speed - the amount of vCPU speed (in MHz) per limit_type that users get for free

limit_min_allocation_vcpu_speed - the minimum amount of vCPU speed (in MHz) per limit_type users can request under this plan

limit_allocation_vcpu_speed - the maximum amount of vCPU speed (in MHz) per limit_type users can request under this planprice_allocation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_allocation_cpu_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for CPU resourcesprice_allocation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memoryprice_allocation_memory_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for memory resources

price_allocation_vcpu_speed - the price per MHz per hour or per month (depending on selected limit type) for vCPU speed

For reservation pool:

limit_free_reservation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_reservation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_min_reservation_cpu_allocation -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_reservation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_reservation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_reservation_memory_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planprice_reservation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_reservation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memory

For Pay As You Go pool:limit_free_pay_as_you_go_cpu_limit - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_limit - the amount of memory (in GB) per limit_type that users get for freelimit_free_pay_as_you_go_cpu_used - the amount of used CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_used - the amount of used memory (in GB) per limit_type that users get for freelimit_min_pay_as_you_go_cpu_limit -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_pay_as_you_go_memory_limit - the minimum amount of memory (in GB) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 482

Page 484: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_pay_as_you_go_cpu_limit - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_pay_as_you_go_memory_limit - the maximum amount of memory (in GB) per limit_type users can request under this planprice_pay_as_you_go_cpu_limit - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_pay_as_you_go_memory_limit - the price per GB per hour or per month (depending on selected limit type) for memoryprice_pay_as_you_go_cpu_used - the price per GHz per hour or per month (depending on selected limit type) for used CPUprice_pay_as_you_go_memory_used - the price per GB per hour or per month (depending on selected limit type) for used memoryprice_pay_as_you_go_cpu_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of CPUprice_pay_as_you_go_memory_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of memory

32.6.1 Page historyv5.0:

Added parameters for Pay As You Go resource pool type and vCPU speed.

32.7 Add Limits for Data Store ZonesTo set limits for Data Store Zones, use the following request:POST /billing/company/plans/:id/resources.xmlPOST /billing/company/plans/:id/resources.jsonXML Request example

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><resource_class>Billing::Company::Resource::VCloud::DataStoreZone</resource_class><target_id>1</target_id></resource>'

JSON Request example

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{ "resource_class":"Billing::Company::Resource::VCloud::DataStoreZone", "target_id":"1"}}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 483

Page 485: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:resource_class* - the name of the base resource you add to the billing plan, in this case - Billing::Company::Resource::VCloud::DataStoreZonetarget_id* - ID of a resource target (data store zone)limit_free_disk_size - the amount of disk size (in GB) per limit_type that users get for free

limit_free_disk_size_used - the amount of used disk size (in GB) per limit_type that users get for freelimit_min_disk_size - the minimum amount of disk size (in GB) per limit_type users can request under this plan

limit_min_disk_size_used - the minimum amount of used disk size (in GB) per limit_type users can request under this planlimit_disk_size - the maximum amount of disk size (in GB) per limit_type users can request under this plan

limit_disk_size_used - the maximum amount of used disk size (in GB) per limit_type users can request under this planprice_disk_size - the price per GB per hour or per month (depending on selected limit type) for disk size

price_disk_size_used - the price per GB per hour or per month (depending on selected limit type) for used disk size

price_disk_size_unlimited - the price per hour or per month (depending on selected limit type) for unlimited disk size

32.7.1 Page historyv5.0:

Added parameters regarding used disk size

32.8 Add Limits for Network ZoneTo set limits for Network Zones, use the following request:POST /billing/company/plans/:id/resources.xmlPOST /billing/company/plans/:id/resources.jsonXML Request example

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><resource_class>Billing::Company::Resource::VCloud::NetworkZone</resource_class><target_id>1</target_id></resource>'

BILLING PLANS - GET THE LIST OF BILLING PLANS 484

Page 486: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X POST http://onapp.test/billing/company/plans/:id/resources.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{ "resource_class":"Billing::Company::Resource::VCloud::NetworkZone", "target_id":"1"}}'

Where:resource_class* - the name of the base resource you add to the billing plan, in this case - Billing::Company::Resource::VCloud::NetworkZonetarget_id* - ID of a resource target (network zone)limit_free_ip - the number of IP addresses per limit_type that users get for freelimit_free_data_sent - the amount of sent data (in GB) per limit_type that users get for freelimit_free_data_received - the amount of received data (in GB) per limit_type that users get for freelimit_ip - the maximum number of IP addresses per limit_type users can request under this planprice_ip - the price per IP address per hour or per month (depending on selected limit type)price_data_sent - the price over free units per GB per hour or per month (depending on selected limit type) for sent dataprice_data_received - the price over free units per GB per hour or per month (depending on selected limit type) for received data

32.9 Edit Company Billing PlanTo edit a company billing plan, use the following request:PUT /billing/company/plans/:id.xmlPUT /billing/company/plans/:id.jsonXML Request example

curl -i -X PUT http://onapp.test/billing/company/plans/:id.xml -u user:userpass -H 'Content-Type:application/xml' -d '<company_plan><label>new company label</label><currency_code>USD</currency_code><monthly_price>15</monthly_price></company_plan>'

JSON Request example

curl -i -X PUT http://onapp.test/billing/company/plans/:id.json -u user:userpass -H 'Content-Type:application/json' -d '{"company_plan":{"label":"new company label", "currency_code":"USD", "monthly_price":10}}

BILLING PLANS - GET THE LIST OF BILLING PLANS 485

Page 487: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:label* - the name of the billing plancurrency_code* - the code of the currency you're going to charge inmonthly_price* - a monthly fee for plan usage

32.10 Edit Limits & Pricing for Data Store Zones in Company Billing Plan

To edit limits for a Data Store Zone, use the following request:PUT /billing/company/resources/:resource_id.xmlPUT /billing/company/resources/:resource_id.jsonXML Request example

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><limit_free_disk_size>10</limit_free_disk_size></resource>'

JSON Request example

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{"limit_free_disk_size":10}}'

Where:limit_free_disk_size - the amount of disk size (in GB) per limit_type that users get for free

limit_free_disk_size_used - the amount of used disk size (in GB) per limit_type that users get for freelimit_min_disk_size - the minimum amount of disk size (in GB) per limit_type users can request under this plan

limit_min_disk_size_used - the minimum amount of used disk size (in GB) per limit_type users can request under this planlimit_disk_size - the maximum amount of disk size (in GB) per limit_type users can request under this plan

limit_disk_size_used - the maximum amount of used disk size (in GB) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 486

Page 488: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_disk_size - the price per GB per hour or per month (depending on selected limit type) for disk size

price_disk_size_used - the price per GB per hour or per month (depending on selected limit type) for used disk size

price_disk_size_unlimited - the price per hour or per month (depending on selected limit type) for unlimited disk size

32.10.1 Page historyv5.0:

Added parameters regarding used disk size

32.11 Edit Limits & Pricing for Network Zones in Company Billing Plan

To edit limits for a Network Zone, use the following request:PUT /billing/company/resources/:resource_id.xmlPUT /billing/company/resources/:resource_id.jsonXML Request example

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><limit_free_data_received>10</limit_free_data_received></resource>'

JSON Request example

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{"limit_free_data_received":10}}'

Where:limit_free_ip - the number of IP addresses per limit_type that users get for freelimit_free_data_sent - the amount of sent data (in GB) per limit_type that users get for freelimit_free_data_received - the amount of received data (in GB) per limit_type that users get for free

BILLING PLANS - GET THE LIST OF BILLING PLANS 487

Page 489: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_ip - the maximum number of IP addresses per limit_type users can request under this planprice_ip - the price per IP address per hour or per month (depending on selected limit type)price_data_sent - the price over free units per GB per hour or per month (depending on selected limit type) for sent dataprice_data_received - the price over free units per GB per hour or per month (depending on selected limit type) for received data

32.12 Edit Limits & Pricing for Compute Zones in Company Billing Plan

To edit limits for Compute Zones, use the following request:PUT /billing/company/resources/:resource_id.xmlPUT /billing/company/resources/:resource_id.jsonXML Request example a

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.xml -u user:userpass -H 'Content-Type:application/xml' -d '<resource><limit_free_allocation_cpu_allocation>10</limit_free_allocation_cpu_allocation></resource>'

JSON Request example

curl -i -X PUT http://onapp.test/billing/company/resources/:resource_id.json -u user:userpass -H 'Content-Type:application/json' -d '{"resource":{"limit_free_allocation_cpu_allocation":10}}'

Where:For allocation pool:limit_free_allocation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_allocation_cpu_resources_guaranteed - the free amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_free_allocation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_free_allocation_memory_resources_guaranteed - the free amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_cpu_allocation - the minimum amount of CPU (in GHz) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 488

Page 490: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

limit_min_allocation_cpu_resources_guaranteed - the minimum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_min_allocation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_min_allocation_memory_resources_guaranteed - the minimum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_allocation_cpu_resources_guaranteed - the maximum amount of CPU resources (in %) per limit_type that are guaranteed to a VS running in the resource poollimit_allocation_memory_allocation - the maximum amount of memory (in GB) per limit_type users can request under this planlimit_allocation_memory_resources_guaranteed - the maximum amount of memory resources (in %) per limit_type that are guaranteed to a VS running in the resource pool

limit_free_allocation_vcpu_speed - the amount of vCPU speed (in MHz) per limit_type that users get for free

limit_min_allocation_vcpu_speed - the minimum amount of vCPU speed (in MHz) per limit_type users can request under this plan

limit_allocation_vcpu_speed - the maximum amount of vCPU speed (in MHz) per limit_type users can request under this planprice_allocation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_allocation_cpu_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for CPU resourcesprice_allocation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memoryprice_allocation_memory_resources_guaranteed - the price per % per hour or per month (depending on selected limit type) for memory resources

price_allocation_vcpu_speed - the price per MHz per hour or per month (depending on selected limit type) for vCPU speedFor reservation pool:

limit_free_reservation_cpu_allocation - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_reservation_memory_allocation - the amount of memory (in GB) per limit_type that users get for freelimit_min_reservation_cpu_allocation -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_reservation_memory_allocation - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_reservation_cpu_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_reservation_memory_allocation - the maximum amount of CPU (in GHz) per limit_type users can request under this plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 489

Page 491: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

price_reservation_cpu_allocation - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_reservation_memory_allocation - the price per GB per hour or per month (depending on selected limit type) for memory

For Pay As You Go pool:limit_free_pay_as_you_go_cpu_limit - the amount of CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_limit - the amount of memory (in GB) per limit_type that users get for freelimit_free_pay_as_you_go_cpu_used - the amount of used CPU (in GHz) per limit_type that users get for freelimit_free_pay_as_you_go_memory_used - the amount of used memory (in GB) per limit_type that users get for freelimit_min_pay_as_you_go_cpu_limit -the minimum amount of CPU (in GHz) per limit_type users can request under this planlimit_min_pay_as_you_go_memory_limit - the minimum amount of memory (in GB) per limit_type users can request under this planlimit_pay_as_you_go_cpu_limit - the maximum amount of CPU (in GHz) per limit_type users can request under this planlimit_pay_as_you_go_memory_limit - the maximum amount of memory (in GB) per limit_type users can request under this planprice_pay_as_you_go_cpu_limit - the price per GHz per hour or per month (depending on selected limit type) for CPUprice_pay_as_you_go_memory_limit - the price per GB per hour or per month (depending on selected limit type) for memoryprice_pay_as_you_go_cpu_used - the price per GHz per hour or per month (depending on selected limit type) for used CPUprice_pay_as_you_go_memory_used - the price per GB per hour or per month (depending on selected limit type) for used memoryprice_pay_as_you_go_cpu_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of CPUprice_pay_as_you_go_memory_limit_unlimited - the price per hour or per month (depending on selected limit type) for unlimited amount of memory

32.12.1 Page historyv5.0:

Added parameters for Pay As You Go resource pool type and vCPU speed.

BILLING PLANS - GET THE LIST OF BILLING PLANS 490

Page 492: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

32.13 Delete Resource From Company Billing Plan

To delete a resource from a company billing plan, use one of the following method:DELETE /billing/company/resources/:resource_id.xmlDELETE /billing/company/resources/:resource_id.jsonXML Request example

curl -i -X DELETE http://onapp.test/billing/company/resources/:resource_id.xml -u user:userpass

JSON Request example

curl -i -X DELETE http://onapp.test/billing/company/resources/:resource_id.json -u user:userpass

Where:resource_id - the ID of the resource you want to delete

32.14 Delete Company Billing PlanTo delete a company billing plan, use the following method:DELETE /billing/company/plans/:id.xmlDELETE /billing/company/plans/:id.jsonXML Request example

curl -i -X DELETE http://onapp.test/billing/company/plans/:id.xml -u user:userpass

JSON Request example

curl -i -X DELETE http://onapp.test/billing/company/plans/:id.json -u user:userpass

Where:id - the ID of the company billing plan you want to delete

BILLING PLANS - GET THE LIST OF BILLING PLANS 491

Page 493: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

33 COMPANY PAYMENTS

This section provides the API calls you can use to manage company payments.

33.1 Get List of Company PaymentsTo get the list of company payments:GET /billing/company/payments.xmlGET /billing/company/payments.json XML output example

<?xml version="1.0" encoding="UTF-8"?><billing_company_payments type="array"> <billing_company_payment> <amount type="decimal">99.0</amount> <created_at type="datetime">2016-01-06T15:30:03+02:00</created_at> <id type="integer">23</id> <invoice_number>edited</invoice_number> <payer_id type="integer">328</payer_id> <updated_at type="datetime">2016-01-08T17:21:50+02:00</updated_at> </billing_company_payment> <billing_company_payment>...</billing_company_payment> </billing_company_payments>

Where:amount — money amount in the currency set in the company billing plancreated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid — payment IDinvoice_number — optional number of invoicepayer_id — ID of the user group, whose user conducted the paymentupdated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

33.2 Get List of Company Monthly BillsTo get the list of company monthly bills:GET /user_groups/user_group_id/monthly_bills.xmlGET /user_groups/user_group_id/monthly_bills.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 492

Page 494: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

To view company monthly bills for a particular year, use the following request:XML Request example

curl -X GET -u 'user:userpass' https://onapp.test/user_groups/user_group_id/monthly_bills.xml -d '<date><year>2015</year></date>'

JSON Request example

curl -X GET -u 'user:userpass' https://onapp.test/user_groups/user_group_id/monthly_bills.json -d '{"date":{"year":"2016"}}'

XML output example

<?xml version="1.0" encoding="UTF-8"?><billing_company_statistics_monthly_stats type="array"> <billing_company_statistics_monthly_stat> <month type="integer">8</month> <cost type="decimal">1.0</cost> </billing_company_statistics_monthly_stat></billing_company_statistics_monthly_stats>

Where:month - the month for which the bill is displayedcost - the money amount for an appropriate month

33.3 Create Company PaymentTo create a company payment, use the following request:POST /billing/company/payments.xmlPOST /billing/company/payments.jsonXML Request example:

curl -i -X POST http://onapp.test/billing/company/payments.xml -H 'Content-Type:application/xml' -d '<payment><payer_id>4</payer_id><invoice_number>#333</invoice_number><amount>15</amount></payment>' -u 'user:userpass'

JSON Request example:

curl -i -X POST http://onapp.test/billing/company/payments.json -H 'Content-Type:application/json' -d '{"payment":{"payer_id":"4",

BILLING PLANS - GET THE LIST OF BILLING PLANS 493

Page 495: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"invoice_number":"#333", "amount":"15"}}' -u 'user:userpass'

Where:payer_id - ID of the user group, whose user conducted the payment. You can get the list of user groups with their IDs using the Get List of User Groups API call.invoice_number — the number of invoiceamount - money amount in the currency set in the company billing plan

33.4 Edit Company PaymentTo edit a company payment, use the following request:PUT /billing/company/payments/:id.xmlPUT /billing/company/payments/:id.jsonXML Request example:

curl -i -X PUT http://onapp.test/billing/company/payments/:id.xml -H 'Content-Type:application/xml' -d '<payment><payer_id>4</payer_id><invoice_number>#333</invoice_number><amount>25</amount></payment>' -u 'user:userpass'

JSON Request example:

curl -i -X PUT http://onapp.test/billing/company/payments/:id.json -H 'Content-Type:application/json' -d '{"payment":{"payer_id":"4", "invoice_number":"#333", "amount":"25"}}' -u 'user:userpass'

You can edit the following parameters:payer_id - ID of the user group, whose user conducted the payment. You can get the list of user groups with their IDs using the Get List of User Groups API call.invoice_number — the number of invoiceamount - money amount in the currency set in the company billing plan

33.5 Delete Company PaymentTo delete a company payment, use the following request:DELETE /billing/company/payments/:id.xmlDELETE /billing/company/payments/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 494

Page 496: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example:

curl -i -X DELETE http://onapp.test/billing/company/payments/:id.xml -u 'user:userpass'

JSON Request example:

curl -i -X DELETE http://onapp.test/billing/company/payments/:id.json -u 'user:userpass'

BILLING PLANS - GET THE LIST OF BILLING PLANS 495

Page 497: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34 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.

34.1 Get List of Compute ResourcesGET /settings/hypervisors.xmlGET /settings/hypervisors.jsonReturns 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> <list_of_logical_volumes/> <list_of_volume_groups/> <list_of_zombie_domains nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 496

Page 498: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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</onapp-fv4zl7t2h5wbeq></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> <cpu_units type="integer">282</cpu_units> <cpu_flags_type="array">...</cpu_flags></hypervisors></hypervisors>

Where:hypervisor – an array of all compute resources in the cloud and their detailsbackup - 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 falsebuilt - true if the compute resource is built, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 497

Page 499: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

called_in_at – the date when the compute resource was called in the [YYYY][MM][DD]T[hh][mm][ss]Z formatconnection_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 498

Page 500: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_info 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 499

Page 501: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

total_cpus – the number of virtual cores

free_memory – free RAM (MB) of compute resource. It is calculated as follows: total memory - memory overhead* - zombie VSs - sum of all VSs

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

cpu_flags - an array of CPU flags of the compute resource

*Memory Overhead for Compute ResourcesEach compute resource has a reserved memory overhead value. This value is pre-configured by default in info_hub.yml.

For XEN compute resource:memory_overhead = 1536

For KVM compute resource:

memory_overhead = 400 + 0,024 * total_memory

34.1.1 Page Historyv. 4.2:

cpu_flags

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 500

Page 502: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

storage_channel

total_mem

total_zombie_mem

free_disk_space

free_mem

free_memory

34.2 Get Compute Resource DetailsGET /settings/hypervisors/:id.xmlGET /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_flags type="array">...</cpu_flags> <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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 501

Page 503: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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"/> <passthrough_disks type="boolean">false</passthrough_disks> <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"/> <custom_pcis type="array"/> </storage></hypervisor>

BILLING PLANS - GET THE LIST OF BILLING PLANS 502

Page 504: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:hypervisor – an array of compute resource detailsbackup - 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 falsebuilt - 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 formatconnection_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_flags - an array of CPU flags of the compute resource

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 503

Page 505: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_info 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 504

Page 506: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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. It is calculated as follows: total memory - memory overhead* - zombie VSs - sum of all VSs

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 505

Page 507: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

*Memory Overhead for Compute ResourcesEach compute resource has a reserved memory overhead value. This value is pre-configured by default in info_hub.yml.

For XEN compute resource:memory_overhead = 1536

For KVM compute resource:

memory_overhead = 400 + 0,024 * total_memory

34.2.1 Page Historyv. 4.2:

cpu_flags

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 506

Page 508: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.3 Add Xen/KVM Compute ResourcePOST /settings/hypervisors.xmlPOST /settings/hypervisors.jsonXML 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>kvm/xen</hypervisor_type><enabled>true/false</enabled><disable_failover>true</disable_failover><collect_stats>1</collect_stats><hypervisor_group_id>HV_Group_id</hypervisor_group_id><backup_ip_address>192.168.123.1</backup_ip_address><cpu_units>1000</cpu_units></hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X POST http://onapp.test/settings/hypervisors.json -d'{"hypervisor":{"label":"HV_LABEL","ip_address":"HV_IP","backup_ip_address":"192.168.123.1","hypervisor_type":"kvm/xen","enabled":"true","disable_failover":"true/false","collect_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 addressbackup_server_ip_address - provisioning network IP addresslabel* - the name of the compute resourcehypervisor_type* - specify if this is Xen or KVM compute resourceenabled - set true to enable a compute resource, otherwise set falsehypervisor_group_id* - the ID of the group to which this compute resource is assignedcollect_stats - set 1 to collect statistics for this compute resource, otherwise set 0disable_failover - set true to disable compute resource failover, otherwise set falsecpu_units - set the amount of CPU units for this compute resource

Page Historyv. 3.3:cpu_units

BILLING PLANS - GET THE LIST OF BILLING PLANS 507

Page 509: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.4 Add CloudBoot Compute ResourceTo create a CloudBoot compute resource, use the following request:

POST /settings/assets/:asset_mac_address/hypervisors.xmlPOST /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><hypervisor_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_stats><disable_failover>0</disable_failover><format_disks>0</format_disks><passthrough_disks>0</passthrough_disks><storage><diskstype="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</selected></disk></disks><nics type="array"><nic><mac>00:30:48:fd:74:c7</mac><type>1</type></nic><nic><mac>00:1b:21:6f:3a:ff</mac><type>0</type></nic></nics><custom_pcis type="array"><custom_pci><pci>00:00.0</pci><selected>1</selected></custom_pci></custom_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/iscsirestart</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":"xen","server_type":"virtual","backup":"0","backup_ip_address":"","enabled":"1","collect_stats":"1","disable_failover":"0","format_disks":"0","passthrough_disks":"0",

BILLING PLANS - GET THE LIST OF BILLING PLANS 508

Page 510: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"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_memory_size":"640","disks_per_storage_controller":"4","cloud_boot_os":"centos5","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: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:

o xen o kvm

server_type - specify the type of servers that will be deployed on this compute resource:

o 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:

o scsi - SCSI inquiry product revision number

o selected - set 1 to select a disk , otherwise set 0

BILLING PLANS - GET THE LIST OF BILLING PLANS 509

Page 511: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

nics - network interfaces that will be used for storage, where:

o mac - network interface MAC address

o 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

o pci - NIC PCI

o 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 510

Page 512: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 511

Page 513: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 512

Page 514: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</custom_pcis> </storage></hypervisor>

34.4.1 Page historyv3.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)

34.5 Add Smart CloudBoot Compute Resource

To create a CloudBoot compute resource, use the following request:

POST /settings/assets/:asset_mac_address/hypervisors.xmlPOST /settings/assets/:asset_mac_address/hypervisors.json

XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 513

Page 515: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST http://onapp.test/settings/assets/:asset_mac_address/hypervisors.xml -d'<hypervisor><label>smartzaza</label><pxe_ip_address_id>1248</pxe_ip_address_id><hypervisor_type>kvm</hypervisor_type><server_type>smart</server_type><backup_ip_address></backup_ip_address><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_failover><format_disks>1</format_disks><passthrough_disks>0</passthrough_disks><storage><diskstype="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</selected></disk></disks><nicstype="array"><nic><mac>00:30:48:fd:74:c7</mac><type>1</type></nic><nic><mac>00:1b:21:6f:3a:ff</mac><type>3</type></nic></nics><custom_pcistype="array"><custom_pci><pci>00:00.0</pci><selected>1</selected></custom_pci></custom_pcis></storage><passthrough_custom_pcis>1</passthrough_custom_pcis><mtu>1500</mtu><storage_controller_memory_size>640</storage_controller_memory_size><disks_per_storage_controller>4</disks_per_storage_controller><allow_unsafe_assigned_interrupts>true</allow_unsafe_assigned_interrupts><custom_config></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":"smart","pxe_ip_address_id":"2","hypervisor_type":"kvm","server_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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 514

Page 516: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o 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:

o 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:

o scsi - SCSI inquiry product revision number

o selected - set 1 to select a disk , otherwise set 0

nics - network interfaces that will be used for storage, where:

o mac - network interface MAC address

o 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 515

Page 517: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

o pci - NIC PCI

o 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 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 allow_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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 516

Page 518: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <cpu_cores type="integer">0</cpu_cores>

BILLING PLANS - GET THE LIST OF BILLING PLANS 517

Page 519: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> </storage></hypervisor>

34.5.1 Page historyv3.1

Added the following parameters:

allow_unsafe_assigned_interrupts

cloud_boot_os

BILLING PLANS - GET THE LIST OF BILLING PLANS 518

Page 520: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

storage_controller_memory_size

disks_per_storage_controller

custom_pcis

passthrough_custom_pcis

server_type

type (storage parameter)

34.6 Add Baremetal CloudBoot Compute Resource

To create a CloudBoot compute resource, use the following request:

POST /settings/assets/:asset_mac_address/hypervisors.xmlPOST /settings/assets/:asset_mac_address/hypervisors.jsonXML 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><hypervisor_type>xen</hypervisor_type><server_type>baremetal</server_type><enabled>1</enabled></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":"baremetal","pxe_ip_address_id":"2","hypervisor_type":"xen","server_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 519

Page 521: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

pxe_ip_address_id* - the ID of Cloud Boot IP address that will be used for this compute resource

type - compute resource type:o xen

You can only specify the Xen type for baremetal CloudBoot compute resource provisioning.

server_type - specify the type of servers that will be deployed on this compute resource:

o 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

34.6.1 Page historyv. 3.1 RC1:

Added the following parameters:

server_type

type (storage parameter)

34.7 Add VMware Compute ResourcePOST /settings/hypervisors.xmlPOST /settings/hypervisors.jsonXML 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><backup_ip_address>10.10.10.13</backup_ip_address><hypervisor_type>vmware</hypervisor_type><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_failover><connection_options><login>login</login><password>password</password><cluster_name>OnApp</

BILLING PLANS - GET THE LIST OF BILLING PLANS 520

Page 522: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cluster_name><distributed_virtual_switch_name>dvSwitch</distributed_virtual_switch_name></connection_options></hypervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request example

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","distributed_virtual_switch_name":"dvSwitch"}}}' -uuser: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 addressbackup_server_ip_address - provisioning network IP addresslabel* - the name of the compute resourcehypervisor_type* - specify if this is Xen or KVM compute resourceenabled - optional parameter, set True to enable a compute resourcehypervisor_group_id* - the ID of the group to which this compute resource is assignedcollect_stats - set 1 to collect statistics for this compute resource, otherwise set 0disable_failover - optional parameter. Set true to disable compute resource failover, otherwise falseconnection_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

34.8 Edit Xen/KVM Compute ResourcePUT /settings/hypervisors/:id.xmlPUT /settings/hypervisors/:id.json XML Request example

curl -X PUT http://onapp.test/settings/hypervisors/:id.xml -d '<hypervisor>

BILLING PLANS - GET THE LIST OF BILLING PLANS 521

Page 523: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<label>HV_LABEL</label><ip_address>HV_IP</ip_address><hypervisor_type>kvm/xen</hypervisor_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</hypervisor_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.123.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 addresslabel - the name of the compute resourcebackup_server_ip_address - provisioning network IP addresshypervisor_type - compute resource typeenabled - set true to enable a compute resource, otherwise set falsehypervisor_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 zonedisable_failover – set true to disable compute resource failover, otherwise set falsecpu_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 historyv. 3.3: cpu_units

34.9 Edit CloudBoot Compute ResourceTo edit a virtual CloudBoot compute resource, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 522

Page 524: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /settings/assets/:asset_mac_address/hypervisors.xmlPUT /settings/assets/:asset_mac_address/hypervisors.jsonFor 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><passthrough_disks>0</passthrough_disks><storage><disks><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</selected></disks><nics><mac>00:30:48:fd:74:c7</mac><type>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><storage_controller_memory_size>640</storage_controller_memory_size><disks_per_storage_controller>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 restart</custom_config></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":"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_memory_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 523

Page 525: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o scsi - SCSI inquiry product revision number

o selected - set 1 to select a disk , otherwise set 0

nics - network interfaces that will be used for storage, where:

o mac - network interface MAC address

o type - network interface type:

0 - unassigned (is not used for storage)

1 - SAN subnet

2 - passthrough to storage

3 - passthrough to guest (for smart appliance)

custom_pcis - an array of custom PCI devices

o pci - NIC PCI

o 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 524

Page 526: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

34.10 Edit Smart CloudBoot Compute Resource

To edit a smart CloudBoot compute resource, use the following request:

PUT /settings/assets/:asset_mac_address/hypervisors.xmlPUT /settings/assets/:asset_mac_address/hypervisors.jsonXML 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</enabled><collect_stats>0</collect_stats><disable_failover>0</disable_failover><storage><diskstype="array"><disk><scsi>DC0710130DBA80013_TAII_DC0710130DBA80013</scsi><selected>1</selected></disk></disks><nics><mac>00:30:48:fd:74:c7</mac><type>1</type></nics><nics><mac>00:1b:21:6f:3a:ff</mac><type>3</type></nics></storage><mtu>1500</mtu><storage_controller_memory_size>640</storage_controller_memory_size><disks_per_storage_controller>4</disks_per_storage_controller><allow_unsafe_assigned_interrupts>0</allow_unsafe_assigned_interrupts><custom_config></custom_config></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/:hv_id.json -d '{"hypervisor":{"label":"smart","backup_ip_address":"","enabled":"1","collect_stats":"1","disable_failover":"1","passthrough_disks":"0","storage":{"disks":[{"scsi":"9VM51JELS_9VM51JEL","selected":"1"}]},"mtu":"1500","storage_controller_memory_size":"640",

BILLING PLANS - GET THE LIST OF BILLING PLANS 525

Page 527: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"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:

o scsi - SCSI inquiry product revision number

o 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 allow_unsafe_assigned_interrupts parameter enabled,

BILLING PLANS - GET THE LIST OF BILLING PLANS 526

Page 528: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

34.11 Edit Baremetal CloudBoot Compute Resource

To edit a baremetal CloudBoot compute resource, use the following request:

PUT /settings/assets/:asset_mac_address/hypervisors.xmlPUT /settings/assets/:asset_mac_address/hypervisors.jsonXML 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 'Content-type: application/json'

Where you can edit: label * - the name of the compute resource enabled - set 1 to enable this compute resource, otherwise set 0

BILLING PLANS - GET THE LIST OF BILLING PLANS 527

Page 529: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.12 Reboot Compute ResourceTo reboot the compute resource, use one of the following methods:

1. This method can be used for 4.2 OnApp version and up:PUT /settings/hypervisors/:hypervisor_id/reboot.xmlPUT /settings/hypervisors/:hypervisor_id/reboot.json

2. This method can be used for 4.2 OnApp version and older. In the nearest major release this method will be deprecated:POST /settings/hypervisors/:hypervisor_id/reboot.xmlPOST /settings/hypervisors/:hypervisor_id/reboot.json

XML Request example 1

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/reboot.xml -d '<force>1</force><schedule_failover>1</schedule_failover><confirm>1</confirm>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/reboot.json -d '{force:"1", schedule_failover:"1", confirm:"1"}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:schedule_failover - set 1 to start running virtual servers after reboot

force - set 1 to stop all virtual servers that cannot be migrated to another compute resource

confirm - set 1 to confirm the reboot of this compute resource

XML Request example 2

curl -X POST http://onapp.test/settings/hypervisors/:hypervisor_id/reboot.xml -d '<hypervisor><confirm>1</confirm><force_reboot>1</force_reboot></hyp

BILLING PLANS - GET THE LIST OF BILLING PLANS 528

Page 530: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ervisor>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

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.

34.13 Delete Compute ResourceDELETE /settings/hypervisors/:id.xmlDELETE /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'

JSON Request example

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 529

Page 531: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.14 Edit VMware Compute ResourcePUT /settings/hypervisors.xmlPUT /settings/hypervisors.jsonXML 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_type><enabled>1</enabled><collect_stats>1</collect_stats><disable_failover>1</disable_failover><connection_options><login>login</login><password>password</password><cluster_name>OnApp</cluster_name><distributed_virtual_switch_name>dvSwitch</distributed_virtual_switch_name></connection_options></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/:hypervisor_id.json -d '{"hypervisor":{"label":"zaza_fake_ware_json","ip_address":"10.10.10.2","backup_ip_address":"10.10.10.3","hypervisor":"vmware","enabled":"1", "collect_stats":"1","disable_failover":"1","connection_options":{"login":"login","password":"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 addressbackup_server_ip_address - provisioning network IP addresslabel* - the name of the compute resourcehypervisor_type* - compute resource typeenabled - optional parameter, set True to enable a compute resourcecollect_stats - set 1 to collect statistics for this compute resource, otherwise set 0disable_failover - optional parameter. Set true to disable compute resource failover, otherwise falseconnection_options - an array of the following vCenter cluster parameters: login - vCenter login password - vCenter password cluster_name - vCenter cluster name

BILLING PLANS - GET THE LIST OF BILLING PLANS 530

Page 532: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

distributed_virtual_switch_name - distributed virtual switch label

34.15 Get List of Appliances Running on Compute Resource

GET /hypervisors/:hypervisor_id/virtual_machines.xmlGET /hypervisors/:hypervisor_id/virtual_machines.json This request returns the list of all appliances deployed on the compute resource. For more information about particular appliances, see: Get List of VSs section for virtual servers Get List of ASs section for application servers Get List of Smart Servers section for smart servers Get List of Baremetal Servers section for baremetal servers Get List of Load Balancers section for load balancers Get List of Accelerators section for CDN accelerators Get List of CDN Edge Servers section for CDN edge servers

34.16 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.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 531

Page 533: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

...</data_store_joins>

Where:data_store_id - the ID of the data store, which is attached to the compute resourcehypervisor_id - the compute resource IDid - the join IDtarget_join_id - the ID of the join target; in this case it is the compute resource IDtarget_join_type - type of join target; in this case it is compute resource

34.17 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.xmlGET /settings/hypervisor_zones/:hypervisor_zone_id/data_stores.xml XML Output example

<?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 formatdata_store_size — the size of your data store shown in GB

BILLING PLANS - GET THE LIST OF BILLING PLANS 532

Page 534: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

id — the data store IDlabel — the data store labellocal_hypervisor_id — the ID of the compute resource using this Data Storeupdated_at — the date when the Data Store was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_group_id — the ID of a data store zone to which a particular data store is attachedzombie_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.

34.18 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.xmlPOST /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

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.

34.19 Remove Data Store Join from Compute Resource

DELETE /settings/hypervisors/:hypervisor_id/data_store_joins/:id.xmlDELETE /settings/hypervisors/:hypervisor_id/data_store_joins/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 533

Page 535: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/data_store_joins/:data_store_join_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_join_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.

34.20 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.xmlGET/settings/hypervisors/:hypervisor_id/network_joins.jsonXML 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:hypervisor_id – reserved parameter

BILLING PLANS - GET THE LIST OF BILLING PLANS 534

Page 536: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

id - the network join IDinterface - label of the network interface used to create a network jointarget_join_id - the ID of the join target; in this case it is the compute resource IDtarget_join_type - type of join target; in this case it is compute resource

34.21 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.xmlPOST /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></network_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 attachinterface* - the name of the appropriate network interface

34.22 Remove Network Join from Compute Resource

DELETE /settings/hypervisors/:hypervisor_id/network_joins/:id.xmlDELETE /settings/hypervisors/:hypervisor_id/network_joins/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 535

Page 537: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X DELETE http://onapp.test/settings/hypervisors/:hypervisor_id/network_joins/:network_join_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/hypervisors/:hypervisor_id/network_joins/:network_join_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 resolver with the ID specified is not found, or the URL requested is incorrect.

34.23 Enable/disable Open vSwitchTo enable the Open vSwitch:

XML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<compute resource><ovs>1</ovs></compute resource>' --url http://onapp.test/settings/compute resources/:compute resource_id.xml

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"compute resource":{"ovs":"1"}}' --url http://onapp.test/settings/compute resources/:compute resource_id.json

To disable the Open vSwitch, set the ovs parameter to 0.

Returns HTTP 204 response on successful deletion, or HTTP 404 on failure.

BILLING PLANS - GET THE LIST OF BILLING PLANS 536

Page 538: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

34.24 Power Cycle CloudBoot Compute Resource

ThisPOST /settings/hypervisors/:id/power_cycle.xmlPOST /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 'Content-type: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 'Content-type:application/json'

34.25 Enable Maintenance Mode for Xen/KVM Compute Resource

Maintenance mode is available only for Static compute resources.

PUT /settings/hypervisors/:hypervisor_id/maintenance_mode/enable.xmlPUT /settings/hypervisors/:hypervisor_id/maintenance_mode/enable.json XML Request example

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/maintenance_mode/enable.xml -d '<force>1</force>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 537

Page 539: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/maintenance_mode/enable.json -d '{force:"1"}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Returns HTTP 204 response on a success, or HTTP 422 on failure.

34.26 Disable Maintenance Mode for Xen/KVM Compute Resource

Maintenance mode is available only for Static compute resources.

Disabling maintenance mode initiates automatic compute resource reboot.

PUT /settings/hypervisors/:hypervisor_id/maintenance_mode/disable.xmlPUT /settings/hypervisors/:hypervisor_id/maintenance_mode/disable.json XML Request example

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/maintenance_mode/disable.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X PUT http://onapp.test/settings/hypervisors/:hypervisor_id/maintenance_mode/disable.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Returns HTTP 204 response on a success, or HTTP 422 on failure.

BILLING PLANS - GET THE LIST OF BILLING PLANS 538

Page 540: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

35 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.

35.1 Get List of Compute ZonesTo get an array of compute zones set up within your cloud, use the following request:GET /settings/hypervisor_zones.xmlGET /settings/hypervisor_zones.json XML Output example

<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> <preconfigured_only type="boolean">true</preconfigured_only> <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"/> <cpu_flags_enabled type="boolean">true</cpu_flags_enabled> <cpu_flags type="array"/> </hypervisor_group>

BILLING PLANS - GET THE LIST OF BILLING PLANS 539

Page 541: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</hypervisor_groups>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the compute zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_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 gatewayvlan - address of a VLAN the default gateway is located on. id - the compute zone IDlabel* - title of a compute zonelocation_group_id - ID of a location group the compute zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zonenetwork_failure - true, if all compute resources in the compute zone failedprefer_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 + switchrecovery_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.

Do not use the ballooning option if there is at least one edge or storage server within the compute zone.

BILLING PLANS - GET THE LIST OF BILLING PLANS 540

Page 542: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

cpu_flags_enabled - true if CPU flags are enabled for the compute zone; otherwise false

cpu_flags - an array of CPU flags enabled for this compute zone

35.1.1 Page historyv. 4.2:

preconfigured_only

cpu_flags_enabled

cpu_flags

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 541

Page 543: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

max_host_cpu

35.2 Get Compute Zone DetailsThe following method returns details for a particular compute zone:GET /settings/hypervisor_zones/:id.xmlGET /settings/hypervisor_zones/:id.json XML Response example

<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><preconfigured_only type="boolean">true</preconfigured_only><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"/><cpu_flags_enabled type="boolean">true</cpu_flags_enabled><cpu_flags_type="array">...</cpu_flags></hypervisor_group>

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 542

Page 544: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the compute zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_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 gatewayclosed - true, if federated zone is suspended by buyer, otherwise falsefederation_id - the ID of a compute zone at the marketfederation_enabled - true, if federation is enabled by seller, otherwise falsevlan - address of a VLAN the default gateway is located on. hypervisor_id - the ID of a compute resource id - the compute zone IDlabel* - title of a compute zonelocation_group_id - ID of a location group the compute zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.traded - true, if the zone came from the Federation and was subscribed to by the usermax_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zonenetwork_failure - true, if all compute resources in the compute zone failedprefer_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 + switchrecovery_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.

Do not use the ballooning option if there is at least one edge or storage server within

BILLING PLANS - GET THE LIST OF BILLING PLANS 543

Page 545: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

cpu_flags - an array of CPU flags enabled for this compute zone

cpu_flags_enabled - true if CPU flags are enabled for the compute zone; otherwise false

35.2.1 Page historyv. 4.2:

preconfigured_only

cpu_flags

cpu_flags_enabled

v. 4.1:

closed

BILLING PLANS - GET THE LIST OF BILLING PLANS 544

Page 546: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

35.3 Add Compute ZoneTo add a new compute zone, send the following request:POST /settings/hypervisor_zones.xmlPOST /settings/hypervisor_zones.json XML Request example

curl -i -X POST http://onapp.test/settings/hypervisor_zones.xml -d '<hypervisor_group><label>test</label><server_type>virtual</server_type><location_group_id>38</

BILLING PLANS - GET THE LIST OF BILLING PLANS 545

Page 547: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

location_group_id><preconfigured_only>true</preconfigured_only><release_resource_type>memory_guarantee</release_resource_type><max_vms_start_at_once>5</max_vms_start_at_once><recovery_type>roundrobin</recovery_type><failover_timeout>15</failover_timeout><run_sysprep>1</run_sysprep><default_gateway></default_gateway><vlan></vlan><cpu_units>1000</cpu_units><cpu_flags_enabled>true</cpu_flags_enabled></hypervisor_group>'-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.json -d '{"hypervisor_group":{"label":"test", "server_type":"virtual","location_group_id":"38","preconfigured_only":"true","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","cpu_flags_enabled":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - title of a new compute zoneserver_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

preconfigured_only - specify whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 546

Page 548: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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

cpu_flags_enabled - true if CPU flags are enabled for the compute zone; otherwise false

VMware parameters:

BILLING PLANS - GET THE LIST OF BILLING PLANS 547

Page 549: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

35.3.1 Page historyv. 4.2:

preconfigured_only

cpu_flags_enabled

v. 3.3:

cpu_units

v. 3.1:

server_type

release_resource_type

recovery_type

run_sysprep

failover_timeout

35.4 Edit Compute ZoneUse the following method to edit an existing compute zone:PUT /settings/hypervisor_zones/:id.xmlPUT /settings/hypervisor_zones/:id.jsonXML Request example

curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.xml -d '<hypervisor_group><label>apliance zone</label><location_group_id>38</location_group_id><preconfigured_only>true</preconfigured_only><release_resource_type>memory_guarantee</release_resource_type><max_vms_start_at_once>10</max_vms_start_at_once><recovery_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_guarantee>1</

BILLING PLANS - GET THE LIST OF BILLING PLANS 548

Page 550: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_guarantee><cpu_flags_enabled>true</cpu_flags_enabled></hypervisor_group>'-u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.json -d '{"hypervisor_group":{"label":"hypervisor","location_group_id":"1","preconfigured_only":"true","release_resource_type":"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","cpu_flags_enabled":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where you can edit:label* - title of a new compute zoneserver_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.

preconfigured_only - specify whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 549

Page 551: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o On provisioning, the round-robin algorithm will be used on compute resource selection.

o 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 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

cpu_flags_enabled - true if CPU flags are enabled for the compute zone; otherwise false

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 550

Page 552: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

35.4.1 Page historyv. 4.2:

preconfigured_only

cpu_flags_enabled

v. 3.3:

cpu_units

update_cpu_units

cpu_guarantee

v. 3.1:

server_type

release_resource_type

recovery_type

run_sysprep

failover_timeout

35.5 Delete Compute ZoneTo delete a compute zone, use the following API call:DELETE /settings/hypervisor_zones/:id.xmlDELETE /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 551

Page 553: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

35.6 Get List of Compute Resources Attached to Compute Zone

GET /settings/hypervisor_zones/:hypervisor_zone_id/hypervisors.xmlGET /settings/hypervisor_zones/:hypervisor_zone_id/hypervisors.json

Returns the array of all compute resources attached to a particular compute zone.

35.7 Attach Compute Resource to Compute Zone

Use the following request to attach compute resource to compute zone:

XML Request example

curl -X POST -i http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/hypervisors/:hypervisor_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/:hypervisor_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 552

Page 554: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

35.8 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/:hypervisor_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/:hypervisor_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.

35.9 Get the List of Data Store Joins Attached to Compute Zone

GET /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.xmlGET /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.json XML Response example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 553

Page 555: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 createdupdated_at - timestamp in DB when the record was updatedtarget_join_type - compute resource group for data store joinsdata_store_id - the ID of a data store attached to a compute zonehypervisor_id - the ID of an compute resource to which a data store is attachedid - the data store join IDtarget_join_id - the ID of a compute zone for which a join is created

35.10 Add Data Store Join to Compute Zone

POST /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins.xmlPOST /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.xml -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.json -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)

BILLING PLANS - GET THE LIST OF BILLING PLANS 554

Page 556: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

35.11 Remove Data Store Join from Compute Zone

DELETE /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:id.xmlDELETE /settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:id.json XML Request example

curl -i -X DELETE http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:data_store_join_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/hypervisor_zones/:hypervisor_zone_id/data_store_joins/:data_store_join_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:id* – is an ID of data store joinReturns 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.

35.12 Get List of Network Joins Attached to Compute Zone

GET /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.xmlGET /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.jsonAn 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 555

Page 557: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 creatednetwork_id - the ID of a network attached to this zonetarget_join_type - compute resource group for a network joinupdated_at - the timestamp when the record was updatedhypervisor_id - the ID of an compute resource to which this network is assignedid - the network join IDinterface - the network join interfacetarget_join_id - the ID of an compute zone to which this network join is attached

35.13 Add Network Join to Compute ZonePOST /settings/hypervisor_zones/:hypervisor_zone_id/network_joins.xmlPOST /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></network_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 556

Page 558: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

interface*- the name of the appropriate network interface

35.14 Remove Network Join from Compute Zone

DELETE /settings/hypervisor_zones/:hypervisor_zone_id/network_joins/:id.xmlDELETE /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/:network_join_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/hypervisor_zones/:hypervisor_zone_id/network_joins/:network_join_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 network join with the ID specified is not found, or the URL requested is incorrect.

35.15 Update CPU Flags for Compute ZonePUT /settings/hypervisor_zones/:hypervisor_zone_id.xmlPUT /settings/hypervisor_zones/:hypervisor_zone_id.json XML Request example

curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.xml -d '<hypervisor_group><cpu_flags>vme</cpu_flags><cpu_flags_enabled>true</cpu_flags_enabled></hypervisor_group>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT http://onapp.test/settings/hypervisor_zones/:hypervisor_zone_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 557

Page 559: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

-d '{"hypervisor_group":{"cpu_flags_enabled":true,"cpu_flags":["vme","fpu"]}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:cpu_flags_enabled - true if CPU flags are enabled for the compute zonecpu_flags - the name of a CPU flag

35.16 Get Common CPU Flags for Compute Resources of Compute Zone

To get the list of common CPU flags for compute resources of a compute zone, use the following request:GET /settings/hypervisor_zones/:hypervisor_zone_id/cpu_flags/common.xmlGET /settings/hypervisor_zones/:hypervisor_zone_id/cpu_flags/common.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><common_cpu_flags type="array"> <common_cpu_flag>vmx</common_cpu_flag> <common_cpu_flag>...</common_cpu_flag></common_cpu_flags>

Where:common_cpu_flag - the name of common CPU flag for compute resources of the compute zone

BILLING PLANS - GET THE LIST OF BILLING PLANS 558

Page 560: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

36 CONTROL PANEL MAINTENANCE

Control panel maintenance is a tool which enables administrators to block the CP. Administrators having permissions on managing Sysadmin Tools will have access to the Control Panel as usual. However, the CP will be blocked for all other users. Servers and services will remain running.

36.1 Get Control Panel Maintenance Status

To view the status of Control Panel maintenance use the following API call:GET /sysadmin_tools/maintenance_mode.xmlGET /sysadmin_tools/maintenance_mode.jsonXML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass http://onapp.test/sysadmin_tools/maintenance_mode.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/maintenance_mode.json

XML Response example:

<?xml version="1.0" encoding="UTF-8"?><maintenance-mode> <status type="symbol">disabled</status></maintenance-mode>

Where:status - the status of Control Panel maintenance. Can be "enabled" or "disabled".

BILLING PLANS - GET THE LIST OF BILLING PLANS 559

Page 561: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

36.2 Enable Control Panel MaintenanceTo enable maintenance for the Control Panel, use the following request:PUT /sysadmin_tools/maintenance_mode/enable.xmlPUT /sysadmin_tools/maintenance_mode/enable.jsonXML Request example

curl -i -X PUT -user:userpass -H 'Accept: application/xml' http://onapp.test/sysadmin_tools/maintenance_mode/enable.xml 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -user:userpass -H 'Accept: application/json' http://onapp.test/sysadmin_tools/maintenance_mode/enable.json 'Content-type: application/json'

After you enable maintenance for the Control Panel, all API requests will return the 503 error, if issued by users who do not have the 'Any actions on sysadmin tools' permission enabled. Users who have this permission will be able to operate the CP as usual.

36.3 Disable Control Panel MaintenanceTo disable maintenance for the Control Panel, use the following request:PUT /sysadmin_tools/maintenance_mode/disable.xmlPUT /sysadmin_tools/maintenance_mode/disable.jsonXML Request example

curl -i -X PUT -user:userpass -H 'Accept: application/xml' http://onapp.test/sysadmin_tools/maintenance_mode/disable.xml 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -user:userpass -H 'Accept: application/json' http://onapp.test/sysadmin_tools/maintenance_mode/disable.json 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 560

Page 562: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

37 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.

37.1 Get List of CurrenciesTo get the list of available currencies, use the following request:GET /settings/currencies.xmlGET /settings/currencies.json XML Output example

<?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>

Where:name – the currency labelformat - 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 addedupdated_at – the date when the record in DB was updatedcode - three-character currency code that is generally used to represent the currencyid – the ID of the currencyunit – a currency symbolseparator - a character used to format decimal numbers, e.g 100.99

BILLING PLANS - GET THE LIST OF BILLING PLANS 561

Page 563: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

37.2 Get Currency DetailsTo get details for a particular currency, use the following request:GET /settings/currencies/:id.xmlGET /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 labelformat - 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 addedupdated_at – the date when the record in DB was updatedcode - three-character currency code that is generally used to represent the currencyid – the ID of the currencyunit – a currency symbolseparator - a character used to format decimal numbers, e.g 100.99precision - 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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 562

Page 564: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

37.3 Add CurrencyTo add a currency, use the following request:POST /settings/currencies.xmlPOST /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>.</separator><precision>2</precision><precision_for_unit>4</precision_for_unit><delimiter>,</delimiter></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","precision_for_unit":"4","delimiter":","}}' --url http://onapp.test/settings/currencies.json

Where:name*– the currency labelunit* – 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 currencyseparator* - a character used to format decimal numbers, e.g.: 100.99precision* - the number of digits after the delimiter to display the costsprecision_for_unit – the numberof digits after the delimiter to display the prices for resourcesdelimiter* - a grouping character used to separate thousands, e.g.: 100,000,000.

JSON Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 563

Page 565: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"currency":{"name":"Polski Zloti","created_at":"2011-04-19T17:20:26+03:00","format":"%n%u","code":"POZ","updated_at":"2011-04-19T17:20:26+03:00","id":7,"unit":"§","separator":".","precision":4,"delimiter":","}}

37.4 Edit CurrencyTo edit details of a currency, use the following request:PUT /settings/currencies/:id.xmlPUT /settings/currencies/:id.json XML Request example

*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><delimiter>,</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":".","precision":"4", "precision_for_unit":"4","delimiter":","}}' --url http://onapp.test/settings/currencies/:id.json*

Where:name – the currency labelunit – 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 currencyseparator - a character used to format decimal numbers, e.g 100.99precision - the number of digits after the delimiter to display the costsprecision_for_unit – the number of digits after the delimiter to display the prices for resourcesdelimiter - a grouping character used to separate thousands, e.g: 100,000,000.

BILLING PLANS - GET THE LIST OF BILLING PLANS 564

Page 566: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

37.5 Delete CurrencyTo delete a currency, use the following request:DELETE /settings/currencies/:id.xmlDELETE /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 565

Page 567: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

38 CUSTOMER NETWORKS

Customer networks are used for isolation of customer’s virtual servers from other customers' VSs within a VLAN.

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.

38.1 Get List of Customer NetworksGET /customer_networks.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 566

Page 568: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 IDprefix_size – subnet prefix sizeis_nated – boolean indicator behind NATdefault_nat_rule_number – default NAT rule (Vyatta firewall)default_outside_ip_address_id – ID of a free IPv4 addressidentifier – auto-generated network identifierip_address_pool_id – ID of the Ip Address Poollabel – visible network identifiernetwork_group_id – network zone ID (currently null for Vmware)user_id – owner IDvlan – VLAN numbercreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

38.2 Get List of User Customer NetworksTo view customer networks of a particular user, run:GET /users/:user_id/customer_networks.xmlGET /users/:user_id/customer_networks.jsonWhere you have to specify user ID.

38.3 Add Customer NetworkPOST /users/:user_id/customer_networks.xmlPOST /users/:user_id/customer_networks.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 567

Page 569: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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></default_outside_ip_address><ip_address_pool_id>1</ip_address_pool_id><label>test</label><prefix_size>29</prefix_size><network_group_id>1</network_group_id><is_nated>true</is_nated></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

NOTE: Do not assign customer network to a network zone with other network types.

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

38.4 Delete Customer NetworkDELETE /customer_networks/:id.xmlDELETE /customer_networks/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 568

Page 570: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 569

Page 571: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

39 CUSTOMER VLANS

VLANs are used to to separate the core networks. All VMware-based virtual machines are running inside VLANs.

39.1 Get List of Customer VLANsTo get the list of customer VLANs, run:GET /settings/customer_vlans.xmlGET /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

<?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 VLANscreated_at — the date when the VLAN was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at — the date when the VLAN was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 570

Page 572: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

id - the VLAN IDuser ID - the ID of the user this VLAN is assigned to

39.2 Get Customer VLAN DetailsGET /settings/customer_vlans/:id.xmlGET /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 VLANscreated_at — the date when the VLAN was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at — the date when the VLAN was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the VLAN IDuser ID - the ID of the user this VLAN is assigned to

BILLING PLANS - GET THE LIST OF BILLING PLANS 571

Page 573: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

39.3 Add Customer VLANTo create new customer VLAN:POST /settings/customer_vlans.xmlPOST /settings/customer_vlans.jsonXML 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></customer_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 CreatedLocation: http://onapp.test/settings/customer_vlans?vlan_ends=1001&vlan_starts=1000Content-Type: application/xml; charset=utf-8X-Ua-Compatible: IE=EdgeEtag: "1b875987e64d5a0d3ea620336ef119e9"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: 5b1182d88f48f1a58cd87ff5073c49a6X-Runtime: 0.292950Content-Length: 118Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)Date: Thu, 06 Sep 2012 15:18:21 GMTConnection: Keep-AliveSet-Cookie: _session_id=6241d8a8388a9e3370b72ada9387635d; path=/; HttpOnly

<?xml version="1.0" encoding="UTF-8"?><hash> <vlan-starts>1000</vlan-starts> <vlan-ends>1001</vlan-ends>

BILLING PLANS - GET THE LIST OF BILLING PLANS 572

Page 574: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</hash>

39.4 Edit Customer VLANPUT /settings/customer_vlans/:id.xmlPUT /settings/customer_vlans/:id.json XML Request example

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 'Content-type: application/json'

Where:user_id - ID of a user the VLAN is associated withReturns 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.

39.5 Delete Customer VLANDELETE /settings/customer_vlans/:id.xmlDELETE /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 573

Page 575: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 574

Page 576: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

40 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.

40.1 Get List of Custom VariablesTo get the list of virtual server custom variables:GET /virtual_machines/:virtual_machine_id/custom_recipe_variables.xmlGET /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.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_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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 575

Page 577: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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 formatupdated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable namevalue - variable value scriptvirtual_machine_id - ID of a virtual machine the variable belongs to

40.2 Get Custom Variable DetailsTo get the list of virtual server custom variables:GET /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xmlGET /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_variable_id.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/:custom_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"?>

BILLING PLANS - GET THE LIST OF BILLING PLANS 576

Page 578: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 formatupdated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable namevalue - variable value scriptvirtual_machine_id - ID of a virtual machine the variable belongs to

40.3 Edit Custom VariableTo edit a virtual server custom recipe variable:PUT /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xmlPUT /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 '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/:custom_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",

BILLING PLANS - GET THE LIST OF BILLING PLANS 577

Page 579: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json

Where you can edit:

enabled - true, if the variable is enabled, otherwise falsename - variable namevalue - variable value script

Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found.

40.4 Add Custom VariableTo create a virtual server custom variables:POST /virtual_machines/:virtual_machine_id/custom_recipe_variables.xmlPOST /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.xml

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 falseid - variable IDname - variable namevalue - variable value scriptYou also have to specify ID of a virtual server in the URL.

BILLING PLANS - GET THE LIST OF BILLING PLANS 578

Page 580: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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> <virtual_machine_id type="integer">3992</virtual_machine_id></custom_recipe_variable>

40.5 Delete Custom VariableTo delete a custom variable:DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xmlDELETE /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/:custom_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/:custom_recipe_variable_id.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found.

BILLING PLANS - GET THE LIST OF BILLING PLANS 579

Page 581: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

40.6 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.xmlGET /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.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_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 580

Page 582: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

40.7 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.xmlGET /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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 581

Page 583: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

40.8 Get List of Baremetal Server Variables

To get the list of baremetal server custom variables:GET /baremetal_servers/:baremetal_server_id/custom_recipe_variables.xmlGET /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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 582

Page 584: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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

40.9 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.xmlGET /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_variable_id.xml

JSON Response example:

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 583

Page 585: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_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> <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 formatupdated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable namevalue - variable value scriptvirtual_machine_id - ID of a virtual machine the variable belongs to

40.10 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.xmlGET /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 584

Page 586: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_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/smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json

Where you have to specify ID of a smart 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> <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 formatupdated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable namevalue - variable value scriptparent_id - ID of a smart server the variable belongs toparent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine

BILLING PLANS - GET THE LIST OF BILLING PLANS 585

Page 587: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

40.11 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.xmlGET /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/:custom_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/:custom_recipe_variable_id.json

Where you have to specify ID of a baremetal 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> <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

BILLING PLANS - GET THE LIST OF BILLING PLANS 586

Page 588: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the time when the variable was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable namevalue - variable value scriptparent_id - ID of a baremetal server the variable belongs toparent_type - type of the server the variable is assigned to. Parent type is always equal to virtual machine

40.12 Add Virtual Server Custom VariableTo create a virtual server custom variable:POST /virtual_machines/:virtual_machine_id/custom_recipe_variables.xmlPOST /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.xml

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 falseid - variable IDname - variable namevalue - variable value scriptYou also have to specify ID of a virtual server in the URL.

XML Output example

<custom_recipe_variable>

BILLING PLANS - GET THE LIST OF BILLING PLANS 587

Page 589: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

40.13 Add Smart Server Custom VariableTo create a smart server custom variable:POST /smart_servers/:smart_server_id/custom_recipe_variables.xmlPOST /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.xml

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 falseid - variable IDname - variable namevalue - variable value scriptYou also have to specify ID of a smart server in the URL.

BILLING PLANS - GET THE LIST OF BILLING PLANS 588

Page 590: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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>

40.14 Add Baremetal Server Custom Variable

To create a baremetal server custom variable:POST /baremetal_servers/:baremetal_server_id/custom_recipe_variables.xmlPOST /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.xml

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.json

Where:

enabled - true, if the variable is enabled, otherwise falseid - variable IDname - variable name

BILLING PLANS - GET THE LIST OF BILLING PLANS 589

Page 591: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

value - variable value scriptYou also have to specify ID of a baremetal 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>

40.15 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.xmlPUT /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 '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/:custom_recipe_variable_id.xml

JSON Response example:

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 590

Page 592: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'{"custom_recipe_variable":{"name":"varname", "value":"varvalue", "enabled":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.json

Where you can edit:

enabled - true, if the variable is enabled, otherwise falsename - variable namevalue - variable value scriptReturns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found.

40.16 Edit Smart Server Custom VariableTo edit a smart server custom recipe variable:PUT /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.xmlPUT /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json XML Request example:

curl -i -X PUT -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/:custom_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/smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json

Where you can edit:

enabled - true, if the variable is enabled, otherwise falsename - variable namevalue - variable value script

BILLING PLANS - GET THE LIST OF BILLING PLANS 591

Page 593: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Returns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found.

40.17 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.xmlPUT /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 '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/:custom_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/:custom_recipe_variable_id.json

Where you can edit:

enabled - true, if the variable is enabled, otherwise falsename - variable namevalue - variable value scriptReturns HTTP 204 response on success, or HTTP 404 when a variable with the ID specified is not found.

BILLING PLANS - GET THE LIST OF BILLING PLANS 592

Page 594: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

40.18 Delete Virtual Server Custom Variable

To delete a custom variable:DELETE /virtual_machines/:virtual_machine_id/custom_recipe_variables/:custom_recipe_variable_id.xmlDELETE /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/:custom_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/:custom_recipe_variable_id.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found.

40.19 Delete Smart Server Custom Variable

To delete a custom variable:DELETE /smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.xmlDELETE /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 593

Page 595: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/smart_servers/:smart_server_id/custom_recipe_variables/:custom_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/smart_servers/:smart_server_id/custom_recipe_variables/:custom_recipe_variable_id.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found.

40.20 Delete Baremetal Server Custom Variable

To delete a custom variable:DELETE /baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_recipe_variable_id.xmlDELETE /baremetal_servers/:baremetal_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/baremetal_servers/:baremetal_server_id/custom_recipe_variables/:custom_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/:custom_recipe_variable_id.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a variable with the ID specified is not found.

BILLING PLANS - GET THE LIST OF BILLING PLANS 594

Page 596: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

41 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).

41.1 Get List of Data StoresGET /settings/data_stores.xmlGET /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 formatdata_store_size - the size of your data store shown in GB

BILLING PLANS - GET THE LIST OF BILLING PLANS 595

Page 597: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

data_store_type - data store type. Can be either lvm or vmware.id - the data store IDlabel - the data store labellocal_hypervisor_id - the ID of the compute resource using this Data Storeupdated_at - the date when the Data Store was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_group_id - the ID of a data store zone to which a particular data store is attachedzombie_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.

41.2 Get Data Store DetailsTo get details of a particular data store, use this request:GET /settings/data_stores/:id.xmlGET /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 formatdata_store_size — the size of your data store shown in GBdata_store_type - data store type. Can be either lvm or vmware.id — the data store ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 596

Page 598: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

label — the data store labellocal_hypervisor_id — IDs of the compute resources using this Data Storehypervisor_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 formatdata_store_group_id — the ID of a data store zone to which a particular data store is attachedzombie_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.

41.3 Add LVM Data StorePOST /settings/data_stores.xmlPOST /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_id>DS_zone_id</data_store_group_id><local_hypervisor_id>1</local_hypervisor_id><ip>:DS_ip</ip><enabled>true</enabled><data_store_size>40</data_store_size><data_store_type>lvm</data_store_type></data_store>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST http://onapp.test/settings/data_stores.json -d '{"data_store":{"label":"DS_label","data_store_group_id":"DS_zone_id","local_hypervisor_id":"1","ip":"DS_ip","enabled":"true","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 namedata_store_group_id* - the group to which this DS is assignedip* - the data store IPenabled* - set true if data store is enabled, otherwise set falsedata_store_size* - set size in GBdata_store_type - set lvm data store typelocal_hypervisor_id - ID of a local compute resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 597

Page 599: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

41.4 Add VMware Data StorePOST /settings/data_stores.xmlPOST /settings/data_stores.json

XML Request example

curl -i POST -d '<data_store><label>testapi</label><ip>192.168.1.27</ip><enabled>1</enabled><data_store_size>40</data_store_size><local_hypervisor_id></local_hypervisor_id><data_store_group_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

curl -i POST -d '{"data_store":{"label":"test", "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 namedata_store_group* - the group to which this DS is assignedip* - the data store IPenabled* - set 1 if data store is enabled, otherwise set 0data_store_size* - set size in GBdata_store_type - set VMware data store typelocal_hypervisor_id - ID of a local compute resource

41.5 Add SolidFire Data StorePOST /settings/data_stores.xmlPOST /settings/data_stores.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 598

Page 600: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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>solidfire</data_store_type><enabled>1</enabled><data_store_size>40</data_store_size><local_hypervisor_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>password</password></admin_attributes><account_attributes><username>onapp</username><initiator_secret>ttttt123456790</initiator_secret><target_secret>ttttt123456780</target_secret></account_attributes></data_store>'

JSON Request example

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":"solidfire","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:label* - the data store namedata_store_group* - the group to which this DS is assignedip* - the data store IPenabled* - set 1 if data store is enabled, otherwise set 0data_store_size* - set size in GBdata_store_type - set solidfire data store typelocal_hypervisor_id - ID of a local compute resourceiscsi_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)

BILLING PLANS - GET THE LIST OF BILLING PLANS 599

Page 601: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

target_secret - iSCSI target 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>

41.6 Edit LVM Data StorePUT /settings/data_stores/:id.xmlPUT /settings/data_stores/:id.jsonXML 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><local_compute resource_id>1</local_compute resource_id><ip>:DS_ip</ip><enabled>true/false</enabled><data_store_size>DS_size</data_store_size><data_store_type>lvm</data_store_type></data_store>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

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_hypervisor_id":"1","ip":"DS_ip","enabled":"true","data_store_size":"DS_size","data_store_type":"lvm"}}' -u user:userpass -H 'Accept:

BILLING PLANS - GET THE LIST OF BILLING PLANS 600

Page 602: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

application/json' -H 'Content-type: application/json'

Wherelabel - the desired label for the data storedata_store_group_id - the ID of the data store zone to which this data store is attachedlocal_hyperisor_id - the ID of the compute resource to which this data store is assignedip - the data store IP addressenabled - set true or false. Set true if the data store is enabled and you can create virtual servers on it, otherwise falsedata_store_size - the data store disk capacity in GBdata_store_type - for LVM data stores, set lvm

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.

41.7 Edit SolidFire Data StorePUT /settings/data_stores.xmlPUT /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>solidfire</data_store_type><enabled>1</enabled><data_store_size>60</data_store_size><local_hypervisor_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>password</password></admin_attributes><account_attributes><username>onapp</username><initiator_secret>ttttt123456790</

BILLING PLANS - GET THE LIST OF BILLING PLANS 601

Page 603: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

initiator_secret><target_secret>ttttt123456780</target_secret></account_attributes></data_store>'

JSON Request example

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_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 you can edit:label* - the data store namedata_store_group * - the group to which this DS is assignedip* - the data store IPenabled* - set 1 if data store is enabled, otherwise set 0data_store_size* - set size in GBdata_store_type - set solidfire data store typelocal_hypervisor_id - ID of a local compute resourceiscsi_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 target 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.

41.8 Delete Data StoreDELETE /settings/data_stores/:id.xmlDELETE /settings/data_stores/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 602

Page 604: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 603

Page 605: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

42 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.

42.1 Get List of Data Store ZonesTo get the list of available data store zones, use the following method:GET /settings/data_store_zones.xmlGET /settings/data_store_zones.jsonYou will get an array of data store zones set up within your cloud.XML Output example

<?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><preconfigured_only type="boolean">false</preconfigured_only><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 titlelocation_group_id - ID of a location group the data store zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the Data store zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the data store zone ID

42.1.1 Page historyv. 4.2:

preconfigured_only

BILLING PLANS - GET THE LIST OF BILLING PLANS 604

Page 606: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

v. 3.1:

Added the location_group_id parameter

42.2 Get Data Store Zone DetailsGET /settings/data_store_zones/:id.xmlGET /settings/data_store_zones/:id.jsonThis 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><preconfigured_only type="boolean">false</preconfigured_only><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 titlelocation_group_id - ID of a location group the data store zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the Data store zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the data store zone ID

42.2.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

BILLING PLANS - GET THE LIST OF BILLING PLANS 605

Page 607: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

42.3 Add Data Store ZoneUse the following methods to create a new data store zone:POST /settings/data_store_zones.xmlPOST /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="UTF-8"?><data_store_group><label>TEST_XML</label><location_group_id>1</location_group_id><preconfigured_only>true</preconfigured_only></data_store_group>' -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 '{"data_store_group":{"label":"TEST_JSON","location_group_id":"1","preconfigured_only":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - is new data_store_zone titlelocation_group_id - ID of a location group you wish to assign the data store zone topreconfigured_only - specify whether the zone can be used for creating Instance Package VSs only. When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

42.3.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

42.4 Edit Data Store ZoneTo edit a label of a particular data store zone:

BILLING PLANS - GET THE LIST OF BILLING PLANS 606

Page 608: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /settings/data_store_zones/:id.xmlPUT /settings/data_store_zones/:id.json XML Request example

curl -i -X PUT http://onapp.test/settings/data_store_zones/:id.xml -d '<data_store_group><label>Data_Store_Name</label><location_group_id>1</location_group_id><preconfigured_only>true</preconfigured_only></data_store_group>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT http://onapp.test/settings/data_store_zones.json -d '{"data_store_group": {"label":"Data_Store_name","location_group_id":"1","preconfigured_only":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - data_store_zone titlelocation_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.preconfigured_only - specify whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

42.4.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

42.5 Delete Data Store ZoneTo delete a particular data store zone:DELETE /settings/data_store_zones/:id.xmlDELETE /settings/data_store_zones/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 607

Page 609: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

42.6 Get the List of Data Stores Attached to Data Store Zone

GET /settings/data_store_zones/:data_store_group_id/data_stores.xmlGET /settings/data_store_zones/:data_store_group_id/data_stores.jsonOn 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_hypervisor_id type="integer" nil="true"></local_compute resource_id><data_store_size type="integer">465</data_store_size><identifier>onapp-ojgg2jk75zfzmw</identifier></data-store>

Explanation of the data returned:label - the name of the data store attached to this data store zonecreated_at - time when the DB record was createdupdated_at - time when the DB record was updateddata_store_group_id - the ID of a data store zone to which this data store is attached

BILLING PLANS - GET THE LIST OF BILLING PLANS 608

Page 610: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

enabled - true if the data store is enabled and you can create virtual servers on it, otherwise falseid - the data store IDzombie_disks_size - the disk space in GB allocated to zombie disksip - the data store IP addresslocal_hypervisor_id - the ID of the compute resource to which this data store is assigneddata_store_size - the data store disk capacity in GBidentifier - the data store identifier in DB

42.7 Attach Data Store to Data Store Zone

POST /settings/data_store_zones/:data_store_zone_id/data_stores/:id/attach.xmlPOST /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_store_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_store_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*)

42.8 Detach Data Store from Data Store Zone

POST /settings/data_store_zones/:data_store_group_id/data_stores/:id/detach.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 609

Page 611: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_store_id/detach.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_store_id/detach.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 610

Page 612: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

43 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.

43.1 Get List of DisksGET /settings/disks.xmlGET /settings/disks.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><disks type="array"><disk><mounted>true</mounted><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

BILLING PLANS - GET THE LIST OF BILLING PLANS 611

Page 613: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

add_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise false

mounted - set 'true' to mount the disk inside OS automatically, otherwise set 'false'

You can use a single mounted parameter, to substitute the two add_to_linux_fstab andadd_to_freebsd_fstab parameters.

built - true if the disk is built, otherwise falsecreated_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_id - the ID of the data store this disk is locateddisk_size - disk size in GBdisk_vm_number - the number of virtual servers using this diskfile_system - disk filesystem (ext3 or ext4)id - the disk IDidentifier - disk identifieris_swap - true if this is a swap disk, otherwise falselabel - disk's labellocked - true if the disk is locked, otherwise falsemount_point - disk mount point.primary - true if the disk is primary. Otherwise false.virtual_machine_id - the ID of the virtual server using this diskvolume_id - data store IDhas_autobackups - true if the disk has automatic backups set up, otherwise falseSolidFire - related parameters:iqn - volume ISCSI qualified nameburst_bw - maximum bandwidth allowed set in MB/secmax_bw -maximum bandwidth allowed set in MB/sec

43.2 Get List of VS DisksTo get the list of disks available for a particular VS, use the following request:GET /virtual_machines/:virtual_machine_id/disks.xmlGET /virtual_machines/:virtual_machine_id/disks.json XML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/disks.xml

JSON Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 612

Page 614: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/disks.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><disks type="array"><disk><mounted>true</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 falseadd_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise falsemounted - set 'true' to mount the disk inside OS automatically, otherwise set 'false'

You can use a single mounted parameter, to substitute the two add_to_linux_fstab andadd_to_freebsd_fstab parameters.

built - true if the disk is built, otherwise falsecreated_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 613

Page 615: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_id - the ID of the data store this disk is locateddisk_size - disk size in GBdisk_vm_number - the number of virtual servers using this diskfile_system - disk filesystem (ext3 or ext4)id - the disk IDidentifier - disk identifieris_swap - true if this is a swap disk, otherwise falselabel - disk's labellocked - true if the disk is locked, otherwise falsemount_point - disk mount point.primary - true if the disk is primary. Otherwise false.virtual_machine_id - the ID of the virtual server using this diskvolume_id - data store IDhas_autobackups - true if the disk has automatic backups set up, otherwise false.SolidFire - related parameters:iqn - volume ISCSI quialified nameburst_bw - maximum bandwidth allowed set in MB/secmax_bw -maximum bandwidth allowed set in MB/sec

43.3 Get VS Disk DetailsTo view the details of a VS disk, use the following request:GET /virtual_machines/:id/disks/:id.xmlGET /virtual_machines/:id/disks/:id.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/virtual_machines/:id/disks/:id.xml

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/virtual_machines/:id/disks/:id.json

XML Output example:

<?xml version="1.0" encoding="UTF-8"?> <disk> <add_to_freebsd_fstab nil="true"/> <add_to_linux_fstab nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 614

Page 616: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<built type="boolean">true</built> <burst_bw type="integer">1000</burst_bw> <created_at type="datetime">2015-03-31T11:15:51+00:00</created_at> <data_store_id type="integer">9</data_store_id> <disk_size type="integer">10</disk_size> <disk_vm_number type="integer">1</disk_vm_number> <file_system nil="true"/> <id type="integer">4</id> <identifier>nd6550ds78cmo0</identifier> <iqn nil="true"/> <is_swap type="boolean">false</is_swap> <label>Hard disk 1</label> <locked type="boolean">false</locked> <max_bw type="integer">1000</max_bw> <mount_point>/mnt/onapp-disk-nd6550ds78cmo0</mount_point> <primary type="boolean">false</primary> <updated_at type="datetime">2015-03-31T11:15:51+00:00</updated_at> <virtual_machine_id type="integer">4</virtual_machine_id> <volume_id nil="true"/> <has_autobackups type="boolean">false</has_autobackups> </disk>

Where:add_to_freebsd_fstab - true, if this disk is added to the FreeBSD fstab, otherwise falseadd_to_linux_fstab - true, if this disk is added to Linux fstab, otherwise falsebuilt - true if the disk is built, otherwise falsecreated_at - the date when the disk was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_store_id - the ID of the data store this disk is locateddisk_size - disk size in GBdisk_vm_number - the number of virtual servers using this diskfile_system - disk filesystem (ext3 or ext4)id - the disk IDidentifier - disk identifieris_swap - true if this is a swap disk, otherwise falselabel - disk's labellocked - true if the disk is locked, otherwise falsemount_point - disk mount point.primary - true if the disk is primary. Otherwise false.updated_at - the date when the disk was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatvirtual_machine_id - the ID of the virtual server using this diskvolume_id - data store IDhas_autobackups - true if the disk has automatic backups set up, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 615

Page 617: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

SolidFire - related parameters:iqn - volume ISCSI qualified nameburst_bw - maximum bandwidth allowed set in MB/secmax_bw -maximum bandwidth allowed set in MB/sec

43.4 Add New DiskPOST /virtual_machines/:virtual_machine_id/disks.xmlPOST /virtual_machines/:virtual_machine_id/disks.jsonXML 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><data_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_disk><mounted>true</mounted></disk>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request 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","label":"qwerq", "require_format_disk":"1","mount_point":"/mnt/aaa","hot_attach":"1","min_iops":"600","mounted":"true"}}' -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 locatedlabel - disk labelprimary - set 1 if the disk is primary, otherwise set 0disk_size* - the disk space in GBis_swap - set true if this is a swap disk, otherwise set falsemount_point - a physical location in the partition used as a root filesystemhot_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)

BILLING PLANS - GET THE LIST OF BILLING PLANS 616

Page 618: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

add_to_linux_fstab - set 'true' to add the disk to your Linux fstab file, otherwise set falseadd_to_freebsd_fstab - set 'true' to add the disk to your FreeBSD fstab file, otherwise set false

mounted - set 'true' to mount the disk inside OS automatically, otherwise set 'false'

You can use a single mounted parameter, to substitute the two add_to_linux_fstab and add_to_freebsd_fstab parameters.

require_format_disk – set 1 to format disk, otherwise set 0file_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

43.5 Edit DiskPUT /settings/disks/:id.xmlPUT /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><mounted>true</mounted><mount_point>/mnt/disk1</mount_point><file_system>ext4</file_system></disk>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON 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", "mounted":"true", "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 0add_to_freebsd_fstab - set 1 to add the disk to your FreeBSD fstab file, otherwise set 0

mounted - set 'true' to mount the disk inside OS automatically, otherwise set 'false'.

BILLING PLANS - GET THE LIST OF BILLING PLANS 617

Page 619: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

You can use a single mounted parameter, to substitute the two add_to_linux_fstab and add_to_freebsd_fstab parameters.

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 cannot decrease size of Integrated Storage data store disks. 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.

43.6 Migrate DiskTo migrate a VS disk to another data store, use the following request:POST /virtual_machines/:virtual_machine_id/disks/:disk_id/migrate.xmlPOST /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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 618

Page 620: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

43.7 Delete DiskDELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.xmlDELETE /virtual_machines/:virtual_machine_id/disks/:disk_id.jsonXML Request example

curl -i -X DELETE http://onapp.test/settings/disks/:id.xml?force=1&shutdown_type=graceful&required_startup=0 -u user:userpass -H 'Accept: application/xml' -H 'Content-type:application/xml'

JSON Request example

curl -i -X DELETE http://onapp.test/settings/disks/:id.json?force=1&shutdown_type=graceful&required_startup=0 -u user:userpass -H 'Accept: application/json' -H 'Content-type:application/json'

shutdown_type - type of the VS shutdown: hard, graceful or softrequired_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.

43.8 View Disk IOPSTo view Input/Output statistics for your disks, use the following method:GET /settings/disks/:id/usage.xmlGET /settings/disks/:id/usage.json XML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 619

Page 621: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 diskcreated_at - the timestamp in DB when the record was createdupdated_at - the timestamp in DB when the record was updateddata_read – the amount of data read (kB) from this diskdata_written - the amount of data written (kB) to the diskstat_time - the time when statistics were generatedwrites_completed - the number of completed write operations performed during the hour for which this statistics has been gatheredreads_completed - the number of completed read operations performed during the hour for which this statistics has been gathereduser_id – ID of the user whose VS is using this diskvirtual_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

43.9 Build DiskTo build a disk, use the following methods:POST /settings/disks/:id/build.xmlPOST /settings/disks/:id/build.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 620

Page 622: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

43.10 Unlock DiskTo unlock a disk, use the following methods:POST /settings/disks/:disk_id/unlock.xmlPOST /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'

43.11 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.xmlGET /settings/disks/:disk_id/backups.jsonAn array of backups with their details is returned on success.XML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 621

Page 623: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 detailsdisk_id – ID of the diskbuilt_at – time, when the disk was builtoperating_system_distro – distribution of the operating systemtemplate_id – ID of the template, used for assigned VSoperating_system – OS of the virtual server, which is allocated at this diskbackup_type – type of the backup (type of period: days/weeks/months/years)allowed_swap – true, if this is a swap disk; otherwise falseallow_resize_without_reboot – true, if VS's CPU and RAM can be resized without rebootid – ID of the backupbackup_server_id – the ID of the backup server where the backup is storedallowed_hot_migrate – true, if hot migration is allowedbackup_size - size of the backup in Kilobytesmin_disk_size – minimum disk size required in GBidentifier – identifier in the DBlocked – true, if the disk is lockedbuilt - true, if the disk is built

BILLING PLANS - GET THE LIST OF BILLING PLANS 622

Page 624: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

44 DNS SETUP

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.

44.1 Get DNS Domain DetailsTo view the DNS domain details, send the following request:GET /settings/dns_setup.xmlGET /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.

44.2 Set Up DNS DomainTo set up DNS domain, use the following methods:POST /settings/dns_setup.xmlPOST /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 623

Page 625: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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>

44.3 Edit DNS DomainTo edit DNS domain, send the following request:PUT /settings/dns_setup.xmlPUT /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 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.

44.4 Get List of Glue RecordsTo get the list of glue records, use the following request:GET /settings/dns_setup/glue_records.xmlGET /settings/dns_setup/glue_records.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 624

Page 626: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 625

Page 627: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

45 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.

45.1 Get List of Own DNS ZonesTo get the list of your own DNS zones:GET /dns_zones.xmlGET /dns_zones.json XMLResponse example

<?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 namecreated_at – the date when the DNS zone was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – DNS zone IDuser_id – the ID of a user who has created a DNS zone

45.2 Get Domain Zone DetailsThe following method returns details for a particular domain zone:GET /dns_zones/:id.xmlGET /dns_zones/:id.json XMLOutput example

BILLING PLANS - GET THE LIST OF BILLING PLANS 626

Page 628: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 namecreated_at – the date when the DNS zone was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – DNS zone IDuser_id – the ID of a user who has created a DNS zone

45.3 Get List of Users DNS ZonesTo get the list of DNS zones created by users:GET /dns_zones/user.xmlGET /dns_zones/user.json XMLOutput example

<?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 namecreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – DNS zone IDuser_id – the ID of a user who has created a DNS zone

BILLING PLANS - GET THE LIST OF BILLING PLANS 627

Page 629: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

45.4 Add DNS ZoneUse the following methods to create a new DNS zone:POST /dns_zones.xmlPOST /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 createauto_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.

45.5 Delete DNS ZoneTo delete a DNS zone, use the following API call:DELETE /dns_zones/:id.xmlDELETE /dns_zones/:id.json XML Request example

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 628

Page 630: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

45.6 Get List of Name ServersTo get the list of name servers, use the following request:GET /dns_zones/name_servers.xmlGET /dns_zones/name_servers.jsonXML 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>

45.7 Get List of DNS Zone RecordsUse the following API calls to view DNS zone records:GET /dns_zones/:dns_zone_id/records.xmlGET /dns_zones/:dns_zone_id/records.json XML Output example

<?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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 629

Page 631: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<dns_record><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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 630

Page 632: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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></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 formatupdated_at - the date when the DNS zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – DNS zone IDuser_id – the ID of a user who has created a DNS zoneThe 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 recordttl – time to live valueid – DNS zone IDtype – the type of the record. For this array, it is MXpriority - the mail server preferencehostname – DNS hostnameSRV – the array of service records with the following parameters:name – DNS domain set for the recordttl – time to live valueport – 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 hostid – DNS zone IDhostname – DNS hostnameA – the array of A host records with the following parameters:name – DNS domain set for the recordttl – time to live valueid – DNS zone IDtype – the type of the record. For this array, it is Aip – domain IPCNAME – the array of CNAME records with the following parameters:name – DNS domain set for the recordttl – time to live valueid – DNS zone IDtype – the type of the record. For this array, it is CNAME

BILLING PLANS - GET THE LIST OF BILLING PLANS 631

Page 633: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

hostname – DNS hostnameAAAA – the array of AAAA record with the following parameters:name – DNS domain set for the recordttl – time to live valueid – DNS zone IDtype – the type of the record. For this array, it is AAAAip – domain IPTXT – the array of TXT record with the following parameters:name – DNS domain set for the recordttl – time to live valueid – DNS zone IDtxt – TXT valuetype - the type of the record. For this array, it is TXTNS – the array of name server records with the following parameters:name – DNS domain set for the recordttl – time to live valueid – DNS zone IDtype – the type of the record. For this array, it is NShostname – DNS hostnameSOA – the array of start of authority record with the following parameters:name – DNS domain set for the recordserial – DNS zone serial numberprimaryNs – primary name serverretry - the amount of time your secondary name servers will wait to contact the primary name server again if the last attempt failedttl – time to live valueid – DNS zone IDrefresh – the number of seconds between update requeststype – DNS record name. For this array, it is SOAminimum – 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 serverhostmaster – a hostmaster e-mail address

45.8 Get DNS Record DetailsGET /dns_zones/:dns_zone_id/records/:record_id.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 632

Page 634: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</dns_record>

Where:name – DNS zone namettl – the time to live valuetype – the record type. This can be one of the following records: NS, A, AAAA, CNAME, MX, TXT or SRVid – DNS zone IDip – domain IP

45.9 Add DNS RecordTo create a DNS record:POST /dns_zones/:dns_zone_id/records.xmlPOST /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_record>" -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 namettl* - the time to live valuetype* - the record typeip* - 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 633

Page 635: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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.

45.10 Edit DNS RecordsTo edit a DNS record:PUT /dns_zones/:dns_zone_id/records/:record_id.xmlPUT /dns_zones/:dns_zone_id/records/:record_id.json XML Request example

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 634

Page 636: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

ttl* – time to live value

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 635

Page 637: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

45.11 Delete DNS RecordTo delete a record:DELETE /dns_zones/:dns_zone_id/records/:record_id.xmlDELETE /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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 636

Page 638: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

46 EDGE GATEWAYS

This section provides the API calls you can use to manage edge gateways imported from vCloud Director.

46.1 Get List of Edge GatewaysTo view the list of edge gateways, use the following request:GET /edge_gateways.xmlGET /edge_gateways.jsonXML Request example:

curl -i -X GET http://onapp.test/edge_gateways.xml -u user:userpass

JSON Request example:

curl -i -X GET http://onapp.test/edge_gateways.json -u user:userpass

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><edge_gateways type="array"> <edge_gateway> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <description></description> <gateway_backing_config>compact</gateway_backing_config> <ha_enabled type="boolean">false</ha_enabled> <id type="integer">22</id> <identifier>059394f3-cbbe-421f-8623-2c34b0f5a385</identifier> <label>RK5</label> <status>1</status> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> <use_default_route_for_dns_relay type="boolean">false</use_default_route_for_dns_relay> <vdc_id type="integer">124</vdc_id> <firewall_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <default_action>DROP</default_action>

BILLING PLANS - GET THE LIST OF BILLING PLANS 637

Page 639: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<enabled type="boolean">true</enabled> <id type="integer">64</id> <log_default_action type="boolean">false</log_default_action> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </firewall_service> <gateway_ipsec_vpn_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">66</id> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </gateway_ipsec_vpn_service> <nat_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">65</id> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </nat_service> </edge_gateway> <edge_gateway>...</edge_gateway> </edge_gateways>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdescription - the description of the edge gateway by the admingateway_backing_config - the configuration of the edge gateway, can be: compact, full, full-4ha_enabled - whether high availability option is enabled for this edge gateway or notid - ID of the edge gatewayidentifier - the identifier of the edge gatewaylabel - the name of the edge gatewaystatus - edge gateway statusupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuse_default_route_for_dns_relay - whether default route for dns relay is used or notvdc_id - ID of the vDC the edge gateway is associated withfirewall_service - an array of parameters related to the firewall service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_action - the default action of the firawall service: DROP or ALLOWenabled - whether the firewall rule is enabled or notid - ID of the firewall servicelog_default_action - whether the default action will be logged or notupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 638

Page 640: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

gateway_ipsec_vpn_service - an array of parameters related to the VPN service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - whether VPN service is enabled or notid - ID of the VPN serviceupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatnat_service - an array of parameters related to the NAT service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - whether NAT service is enabled or notid - ID of the NAT serviceupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

46.2 Get List of Edge Gateway Interfaces

To view the list of edge gateway interfaces, use the following request:GET /edge_gateways/:id/gateway_interfaces.xmlGET /edge_gateways/:id/gateway_interfaces.jsonXML Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/edge_gateways/:id/gateway_interfaces.xml

JSON Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/edge_gateways/:id/gateway_interfaces.json

XML Output example:

<gateway_interfaces type="array"> <gateway_interface> <created_at type="datetime">2016-05-25T02:36:24+03:00</created_at> <default_firewall_rule>ACCEPT</default_firewall_rule> <id type="integer">1628</id> <identifier>axd19u2wrhjllv</identifier> <label>Fake Ext Net DC1</label> <network_join_id type="integer">624</network_join_id> <updated_at type="datetime">2016-05-25T02:36:24+03:00</updated_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 639

Page 641: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</gateway_interface> <gateway_interface> <created_at type="datetime">2016-05-25T02:36:24+03:00</created_at> <default_firewall_rule>ACCEPT</default_firewall_rule> <id type="integer">1629</id> <identifier>i88bsaopdhsogz</identifier> <label>onapp routed net 2</label> <network_join_id type="integer">634</network_join_id> <updated_at type="datetime">2016-05-25T02:36:24+03:00</updated_at> </gateway_interface></gateway_interfaces>

Where:created_at - the date when the edge gateway interface was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_firewall_rule - set default firewall rule for the edge gateway interface – either DROP or ACCEPTid - ID of the edge gateway interfaceidentifier - the identifier of the edge gateway interfacelabel - the name of the edge gateway interfacenetwork_join_id - the ID of the network join to which this edge gateway interface belongsupdated_at - the date when the edge gateway interface was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

46.3 Get Edge Gateway DetailsTo view the details of an edge gateway, use the following request:GET /edge_gateways/:id.xmlGET /edge_gateways/:id.jsonXML Request example:

curl -i -X GET http://onapp.test/edge_gateways/:id.xml -u user:userpass

JSON Request example:

curl -i -X GET http://onapp.test/edge_gateways/:id.json -u user:userpass

XML Output example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 640

Page 642: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?xml version="1.0" encoding="UTF-8"?><edge_gateway> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <description></description> <gateway_backing_config>compact</gateway_backing_config> <ha_enabled type="boolean">false</ha_enabled> <id type="integer">22</id> <identifier>059394f3-cbbe-421f-8623-2c34b0f5a385</identifier> <label>RK5</label> <status>1</status> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> <use_default_route_for_dns_relay type="boolean">false</use_default_route_for_dns_relay> <vdc_id type="integer">124</vdc_id> <firewall_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <default_action>DROP</default_action> <enabled type="boolean">true</enabled> <id type="integer">64</id> <log_default_action type="boolean">false</log_default_action> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </firewall_service> <gateway_ipsec_vpn_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">66</id> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </gateway_ipsec_vpn_service> <nat_service> <created_at type="datetime">2016-07-22T12:50:28+03:00</created_at> <enabled type="boolean">true</enabled> <id type="integer">65</id> <updated_at type="datetime">2016-07-22T12:50:28+03:00</updated_at> </nat_service></edge_gateway>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdescription - the description of the edge gateway by the admingateway_backing_config - the configuration of the edge gateway, can be: compact, full, full-4

BILLING PLANS - GET THE LIST OF BILLING PLANS 641

Page 643: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ha_enabled - whether high availability option is enabled for this edge gateway or notid - ID of the edge gatewayidentifier - the identifier of the edge gatewaylabel - the name of the edge gatewaystatus - edge gateway statusupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuse_default_route_for_dns_relay - whether default route for dns relay is used or notvdc_id - ID of the vDC the edge gateway is associated withfirewall_service - an array of parameters related to the firewall service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_action - the default action of the firawall service: DROP or ALLOWenabled - whether the firewall rule is enabled or notid - ID of the firewall servicelog_default_action - whether the default action will be logged or notupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatgateway_ipsec_vpn_service - an array of parameters related to the VPN service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - whether VPN service is enabled or notid - ID of the VPN serviceupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatnat_service - an array of parameters related to the NAT service of the edge gateway:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - whether NAT service is enabled or notid - ID of the NAT serviceupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

46.4 Create Edge GatewayTo create an edge gateway, use the following request:POST /edge_gateways.xmlPOST /edge_gateways.jsonXML Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/edge_gateways.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<edge_gateway><vdc_id>4</vdc_id><description>Created via API</description><external_network_ids><external_network_id>2</external_network_id><external_network_id>3</external_network_id></external_network_ids><ha_enabled>1</

BILLING PLANS - GET THE LIST OF BILLING PLANS 642

Page 644: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ha_enabled><label>TestingEdgeGateway</label><use_default_route_for_dns_relay>1</use_default_route_for_dns_relay><gateway_backing_config>compact</gateway_backing_config></edge_gateway>'

JSON Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/edge_gateways.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"edge_gateway": {"vdc_id": "4", "description": "Created via API", "external_network_ids": ["2", "3"], "ha_enabled": "1", "label": "TestingEdgeGateway", "use_default_route_for_dns_relay": "1", "gateway_backing_config": "compact"}}'

Where:vdc_id - ID of the VDC the edge gateway is associated withlabel - the name of the edge gatewaydescription - the description of the edge gateway by the admingateway_backing_config - the configuration of the edge gateway, can be: compact, full, full-4ha_enabled - whether high availability option is enabled for this edge gateway or notexternal_network_ids - IDs of the external networks which will be connected to the edge gatewayuse_default_route_for_dns_relay - whether default route for dns relay is used or not

46.5 Edit Edge GatewayTo edit an edge gateway, use the following request:PUT /edge_gateways/:id.xmlPUT /edge_gateways/:id.jsonXML Request example:

curl -i -X PUT http://onapp.test/edge_gateways/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<edge_gateway><label>R1</label><description>abcde</description<ha_enabled>0</ha_enabled><external_network_ids>4</external_network_ids><use_default_route_for_dns_relay>1</use_default_route_for_dns_relay></edge_gateway><id>1</id>'

JSON Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 643

Page 645: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT http://onapp.test/edge_gateways/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"edge_gateway": {"label": "R1", "description": "abcde", "ha_enabled": "0", "external_network_ids": ["4"], "use_default_route_for_dns_relay": "1"}, "id": "1"}'

Where:label - the name of the edge gatewaydescription - the description of the edge gateway by the adminha_enabled - whether high availability option is enabled for this edge gateway or notexternal_network_ids - IDs of the external networks which will be connected to the edge gatewayuse_default_route_for_dns_relay - whether default route for dns relay is used or notid - edge gateway ID

46.6 Delete Edge GatewayTo delete an edge gateway, use the following request:DELETE /edge_gateways/:id.xmlDELETE /edge_gateways/:id.jsonXML Request example:

curl -i -X DELETE http://onapp.test/edge_gateways/:id.xml -u user:userpass

JSON Request example:

curl -i -X DELETE http://onapp.test/edge_gateways/:id.json -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 644

Page 646: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

47 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:

curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/cpu_usage.chart

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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 645

Page 647: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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: '.', 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,

BILLING PLANS - GET THE LIST OF BILLING PLANS 646

Page 648: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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></body></html>

4. Embed the HTML to your page.

BILLING PLANS - GET THE LIST OF BILLING PLANS 647

Page 649: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

48 ERRORS

OnApp produces the list of errors that occur on a Control Panel. Using API requests you can view the list of errors and the details of a particular error. If set in your system configuration, the list of errors is sent to OnApp in a form of an encrypted email. If required, you can disable the sending of the error list from your CP in your system configuration.

48.1 Get List of ErrorsUse the following API call to view the list of Control Panel errors:GET /sysadmin_tools/infrastructure/errors.xmlGET /sysadmin_tools/infrastructure/errors.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml '--url "http://onapp.test/sysadmin_tools/infrastructure/errors.xml"

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json ' --url "http://onapp.test/sysadmin_tools/infrastructure/errors.json"

XML Output example

<?xml version="1.0" encoding="UTF-8"?><infrastructure_errors type="array"> <infrastructure_error> <backtrace>/onapp/interface/lib/daemon/activity/hypervisor_stats_runner.rb:15:in `run'/onapp/interface/lib/daemon/supervisors/stats_supervisor.rb:46:in `operation'/onapp/interface/lib/core_ext/eventmachine.rb:8:in `call'/onapp/interface/lib/core_ext/eventmachine.rb:8:in `block in spawn_threadpool'</backtrace> <counter type="integer">215</counter> <created_at type="datetime">2015-10-28T13:27:26+02:00</created_at> <error_class>NoMethodError</error_class> <fingerprint>00c2afa57790ab756d637b13feff4fde2c7a7b444c9195d9144cd32

BILLING PLANS - GET THE LIST OF BILLING PLANS 648

Page 650: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

decd96b19</fingerprint> <id type="integer">5</id> <message>undefined method `id' for nil:NilClass</message> <reported type="boolean">false</reported> <updated_at type="datetime">2015-11-09T14:26:00+02:00</updated_at> </infrastructure_error> <infrastructure_error> <backtrace>/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/path_set.rb:58:in `find'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/lookup_context.rb:122:in `find'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/renderer/partial_renderer.rb:339:in `find_template'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/renderer/partial_renderer.rb:333:in `find_partial'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/renderer/partial_renderer.rb:222:in `render'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/renderer/renderer.rb:41:in `render_partial'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_view/renderer/renderer.rb:15:in `render'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/abstract_controller/rendering.rb:110:in `_render_template'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/action_controller/metal/streaming.rb:225:in `_render_template'/onapp/interface/vendor/bundle/ruby/2.1.0/gems/actionpack-3.2.22/lib/abstract_controller/rendering.rb:103:in `render_to_body'</backtrace> <counter type="integer">33</counter> <created_at type="datetime">2015-11-09T14:22:35+02:00</created_at> <error_class>ActionView::MissingTemplate</error_class> <fingerprint>a5c650d66c07e3d3396c9c4b5170b79d4fec88f441ff563b3230d8963d744961</fingerprint> <id type="integer">455</id> <message>Missing partial users/confirm_destroy, application/confirm_destroy with {:locale=&gt;[:en], :formats=&gt;[:json], :handlers=&gt;[:erb, :builder, :haml, :rabl]}. Searched in: * "/onapp/interface/app/views" * "/onapp/interface/vendor/bundle/ruby/2.1.0/gems/devise_security_extension-0.7.2/app/views" * "/onapp/interface/vendor/bundle/ruby/2.1.0/gems/devise-2.2.3/app/views"</message> <reported type="boolean">false</reported>

BILLING PLANS - GET THE LIST OF BILLING PLANS 649

Page 651: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<updated_at type="datetime">2015-11-09T15:41:26+02:00</updated_at> </infrastructure_error> <infrastructure_error>...</infrastructure_error></infrastructure_errors>

Where:backtrace - the backtrace of the error counter - how many times the error has occurred created_at - the date when this record was created in database in the [YYYY][MM][DD]T[hh][mm][ss]Z format error_class - the class of the error fingerprint - the unique identifier of the error id - ID of the error message - the message that will be sent with this error reported - whether the error has been reported or not updated_at - the date when this record was updated in database in the [YYYY][MM][DD]T[hh][mm][ss]Z format

48.2 Get Error DetailsUse the following API call to view the details of an application error:GET /sysadmin_tools/infrastructure/errors/:id.xmlGET /sysadmin_tools/infrastructure/errors/:id.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml '--url "http://onapp.test/sysadmin_tools/infrastructure/errors/:id.xml"

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json '--url "http://onapp.test/sysadmin_tools/infrastructure/errors/:id.json"

XML Output example

<?xml version="1.0" encoding="UTF-8"?> <infrastructure_error> <backtrace>/onapp/interface/lib/daemon/activity/hypervisor_stats_runner.rb:15:in `run'/onapp/interface/lib/daemon/supervisors/stats_supervisor.rb:46:in `operation'

BILLING PLANS - GET THE LIST OF BILLING PLANS 650

Page 652: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

/onapp/interface/lib/core_ext/eventmachine.rb:8:in `call'/onapp/interface/lib/core_ext/eventmachine.rb:8:in `block in spawn_threadpool'</backtrace> <counter type="integer">215</counter> <created_at type="datetime">2015-10-28T13:27:26+02:00</created_at> <error_class>NoMethodError</error_class> <fingerprint>00c2afa57790ab756d637b13feff4fde2c7a7b444c9195d9144cd32decd96b19</fingerprint> <id type="integer">5</id> <message>undefined method `id' for nil:NilClass</message> <reported type="boolean">false</reported> <updated_at type="datetime">2015-11-09T14:26:00+02:00</updated_at> </infrastructure_error>

Where:backtrace - the backtrace of the errorcounter - how many times the error has occurredcreated_at - the date when this record was created in database in the [YYYY][MM][DD]T[hh][mm][ss]Z formaterror_class - the class of the errorfingerprint - the unique identifier of the errorid - ID of the errormessage - the message that will be sent with this errorreported - whether the error has been reported or notupdated_at - the date when this record was updated in database in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 651

Page 653: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

49 FEDERATION

OnApp Federation is a central trading system that connects Suppliers, Traders and Users to create the largest federated compute resource cloud in the world and gives each OnApp Hosting Partner a global reach and almost unlimited capacity. This chapter provides requests for suppliers and traders.

49.1 Add Zone to FederationAs a supplier, you can submit a zone to Federation. To add a zone, use the following request:POST /federation/compute resource_zones/:id/add.xmlPOST /federation/compute resource_zones/:id/add.json

XML Request Example

curl -i -X POST -H 'Content-type: application/xml' http://onapp.test/federation/compute resource_zones/:id/add.xml -u user:userpass -d '<compute resource_zone><label>test</label><network_zone_label>netw</network_zone_label><data_store_zone_label>ds</data_store_zone_label><network_zone_id>146</network_zone_id><data_store_zone_id>145</data_store_zone_id><template_group_id>11</template_group_id><description>favorite group</description><compute resource_zone_pricing_attributes><cpu_max>123</cpu_max><cpu_on>12</cpu_on><cpu_off>489</cpu_off><cpu_priority_max>903</cpu_priority_max><cpu_priority_on>34</cpu_priority_on><cpu_priority_off>12</cpu_priority_off><memory_max>256</memory_max><memory_on>128</memory_on><memory_off>12</memory_off></compute resource_zone_pricing_attributes><data_store_zone_pricing_attributes><disk_size_max>99</disk_size_max><disk_size_on>22</disk_size_on><disk_size_off>22</disk_size_off><data_read>11</data_read><data_write>90</data_write><input_requests>20</input_requests><output_requests>5</output_requests></data_store_zone_pricing_attributes><network_zone_pricing_attributes><ip_addresses_max>90</ip_addresses_max><ip_addresses_on>25</ip_addresses_on><ip_addresses_off>20</ip_addresses_off><port_speed_max>100</port_speed_max><port_speed>10</port_speed><data_rxed>10</data_rxed><data_sent>1</data_sent></network_zone_pricing_attributes><user_virtual_server_pricing_attribu

BILLING PLANS - GET THE LIST OF BILLING PLANS 652

Page 654: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

tes><auto_scaling_max>11</auto_scaling_max><auto_scaling>10</auto_scaling><template_backup_store_max>100</template_backup_store_max><template_backup_store>50</template_backup_store><backup_disk_size_max>10</backup_disk_size_max><backup_disk_size>5</backup_disk_size><template_disk_size_max>100</template_disk_size_max><template_disk_size>10</template_disk_size></user_virtual_server_pricing_attributes></compute resource_zone>

Json Request Example

curl -i -X POST -H 'Content-type: application/json' http://onapp.test/federation/compute resource_zones/:id/add.json -u user:userpass -d '{"compute resource_zone":{"label": "test","network_zone_label":"netw","data_store_zone_label":"ds","network_zone_id":146,"data_store_zone_id":145,"template_group_id":11,"description":"favorite group","compute resource_zone_pricing_attributes":{"cpu_max":"243","cpu_on":"12","cpu_off":"67","cpu_priority_max":"50","cpu_priority_on":"30","cpu_priority_off":"10","memory_max":"256","memory_on":"124","memory_off":"124"},"data_store_zone_pricing_attributes":{"disk_size_max":"100","disk_size_on":"60","disk_size_off":"10","data_read":"8","data_write":"12","input_requests":"12","output_requests":"23"},"network_zone_pricing_attributes":{"ip_addresses_max":"90","ip_addresses_on":"10","ip_addresses_off":"5","port_speed_max":"100","port_speed":"6","data_rxed":"100","data_sent":"100"},"user_virtual_server_pricing_attributes":{"auto_scaling_max":"50","auto_scaling":"10","template_backup_store_max":"50","template_backup_store":"10","backup_disk_size_max":"100","backup_disk_size":"10","template_disk_size_max":"100","template_disk_size":"10"}}}'

Where:id* - hypervizor zone IDlabel* - add an optional description.network_zone_label* - give a label of the network zonedata_store_zone_label* - give a label of the data store zonenetwork_zone_id* - set ID of the network zonedata_store_zone_id* - set ID of the data store zonethe array of compute zone details:template_group_id - the ID of the template group. All the templates which are added to this group will be available to traders who sign up for this federated zone.description - add required description

BILLING PLANS - GET THE LIST OF BILLING PLANS 653

Page 655: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

the array of compute zone pricing attributescpu_max - the maximum number of CPU cores the users can request when signed up for this federated zonecpu_on - the price per CPU core per hour, for VSs powered oncpu_off - the price per CPU core per hour, for VSs powered offcpu_priority_max - the maximum CPU priority % the users can request when signed up for this federated zonecpu_priority_on - the prices per CPU priority % per hour, for VSs powered oncpu_priority_off - the prices per CPU priority % per hour, for VSs powered offmemory_max - the maximum RAM users can request when signed up for this federated zone.memory_on - the price per Mb/hour for RAM when a VS is on

memory_off - the price per Mb/hour for RAM when a VS is off

the array of data store zone pricing attributesdisk_size_max - the maximum disk size the users can request when signed up for this federated zonedisk_size_on - the price per GB of disk space for VSs powered ondisk_size_off - the price per GB of disk space for VSs powered offdata_read - the price for data read per Gbdata_write - the price for data written per GBinput_requests - the price for input requests. Input requests are measured in millions and priced per million requests.output_requests - the price for output requests. Output requests are measured in millions and priced per million requests.

the array of network zone pricing attributesip_addresses_max - the maximum number of IP addresses the users can request when signed up for this federated zone.ip_addresses_on - the price per IP address/per hour for VSs powered onip_addresses_off - the price per IP address/per hour for VSs powered offport_speed_max - the maximum port speed the users can request when signed up for this federated zone.port_speed - the price per Mb per second of port speeddata_rxed - the price per GB of data receiveddata_sent - the price per GB of data sent

the array of user virtual server pricing attributesauto_scaling_max - the number of VSs using Autoscaling that users can request when signed up for this federated zoneauto_scaling - the price for the VSs using Autoscaling (per VS)template_backup_store_max - the total amount of disk space customers can use for backups and templates when signed up for this federated zonetemplate_backup_store - set price for backups&templatesbackup_disk_size_max - the total amount of backup disk size users may usebackup_disk_size - set price for the backup disk sizetemplate_disk_size_max - the total amount of backup server space users can

BILLING PLANS - GET THE LIST OF BILLING PLANS 654

Page 656: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

requesttemplate_disk_size - set price for template disk size.

49.2 Enable Federated ZoneAs a supplier, you can enable a federated zone:POST /federation/compute resource_zones/:id/activate.xmlPOST /federation/compute resource_zones/:id/activate.json

XML Request Example

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/activate.xml -u user:userpass -d ''

Json Request Example

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/activate.json -u user:userpass -d ''

Where:id* - hypervizor zone ID

49.3 Disable Federated ZoneAs a supplier you can disablle a zone to prevent users from adding any more VSs to the federated zone. To disable a zone:POST /federation/compute resource_zones/:id/deactivate.xmlPOST /federation/compute resource_zones/:id/deactivate.json

XML Request Example

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/deactivate.xml -u user:userpass -d ''

Json Request Example

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/deactivate.json -u user:userpass -d ''

Where:id* - hypervizor zone ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 655

Page 657: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

49.4 Remove Zone from FederationAs a supplier, you can remove a zone from Federation:DELETE /federation/compute resource_zones/:id/remove.xmlDELETE /federation/compute resource_zones/:id/remove.json

XML Request Example:

curl -i -X DELETE http://onapp.test/federation/compute resource_zones/:id/remove.xml -u user:userpass

Json Request Example:

curl -i -X DELETE http://onapp.test/federation/compute resource_zones/:id/remove.json -u user:userpass

Where:id* - hypervizor zone ID

49.5 Get List of Federated ResourcesAs a trader you can get the list of all compute zones in Federation with their details:GET /federation/compute resource_zones/unsubscribed.xmlGET /federation/compute resource_zones/unsubscribed.json

XML Request Example:

curl -i -X GET http://onapp.test/federation/compute resource_zones/unsubscribed.xml -u user:userpass

Json Request Example:

curl -i -X GET http://onapp.test/federation/compute resource_zones/unsubscribed.json -u user:userpass

XML Response Example:

<?xml version="1.0" encoding="UTF-8"?>

BILLING PLANS - GET THE LIST OF BILLING PLANS 656

Page 658: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<federation_compute resource_zones type="array"> <federation_compute resource_zone> <data_store_zone_label>Label</data_store_zone_label> <data_store_zone_pricing> <data_read type="float">10.0</data_read> <data_write type="float">10.0</data_write> <disk_size_max nil="true"/> <disk_size_off type="float">10.0</disk_size_off> <disk_size_on type="float">20.0</disk_size_on> <input_requests type="float">20.0</input_requests> <output_requests type="float">40.0</output_requests> </data_store_zone_pricing> <description>a test data store</description> <compute resource_type nil="true"/> <compute resource_zone_pricing> <cpu_max nil="true"/> <cpu_off type="float">3.0</cpu_off> <cpu_on type="float">5.0</cpu_on> <cpu_priority_max nil="true"/> <cpu_priority_off type="float">10.0</cpu_priority_off> <cpu_priority_on type="float">20.0</cpu_priority_on> <memory_max nil="true"/> <memory_off type="float">10.0</memory_off> <memory_on type="float">20.0</memory_on> </compute resource_zone_pricing> <label>zonex</label> <network_zone_label>wertwert</network_zone_label> <network_zone_pricing> <data_rxed type="float">20.0</data_rxed> <data_sent type="float">30.0</data_sent> <ip_addresses_max nil="true"/> <ip_addresses_off type="float">10.0</ip_addresses_off> <ip_addresses_on type="float">30.0</ip_addresses_on> <port_speed type="float">30.0</port_speed> <port_speed_max nil="true"/> </network_zone_pricing> <template_group_id nil="true"/> <user_virtual_server_pricing> <auto_scaling type="float">10.0</auto_scaling> <auto_scaling_max nil="true"/> <backup_disk_size type="float">30.0</backup_disk_size> <backup_disk_size_max nil="true"/> <template_backup_store type="float">10.0</template_backup_store> <template_backup_store_max nil="true"/> <template_disk_size type="float">30.0</template_disk_size> <template_disk_size_max nil="true"/> </user_virtual_server_pricing>

BILLING PLANS - GET THE LIST OF BILLING PLANS 657

Page 659: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<federation_id>resource:compute resource:onapp-9QoC9BTPsFMnT2mp5rHZumHXHWg</federation_id> </federation_compute resource_zone>

49.6 Get Federated Resource DetailsAs a trader you can find a particular federated resource to see its details:GET /federation/compute resource_zones/unsubscribed.xml?q=query GET /federation/compute resource_zones/unsubscribed.json?q=query

XML Request Example:

curl -i -X GET http://onapp.test/federation/compute resource_zones/unsubscribed.xml?q=query -u user:userpass

Json Request Example:

curl -i -X GET http://onapp.test/federation/compute resource_zones/unsubscribed.json?q=query -u user:userpass

Where:query - part of the name of compute zone's label, location country or city

XML Response Example:

<?xml version="1.0" encoding="UTF-8"?><federation_compute resource_zones type="array"> <federation_compute resource_zone> <data_store_zone_label>Label</data_store_zone_label> <data_store_zone_pricing> <data_read type="float">10.0</data_read> <data_write type="float">10.0</data_write> <disk_size_max nil="true"/> <disk_size_off type="float">10.0</disk_size_off> <disk_size_on type="float">20.0</disk_size_on> <input_requests type="float">20.0</input_requests> <output_requests type="float">40.0</output_requests> </data_store_zone_pricing> <description>a test data store</description> <compute resource_type nil="true"/> <compute resource_zone_pricing>

BILLING PLANS - GET THE LIST OF BILLING PLANS 658

Page 660: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<cpu_max nil="true"/> <cpu_off type="float">3.0</cpu_off> <cpu_on type="float">5.0</cpu_on> <cpu_priority_max nil="true"/> <cpu_priority_off type="float">10.0</cpu_priority_off> <cpu_priority_on type="float">20.0</cpu_priority_on> <memory_max nil="true"/> <memory_off type="float">10.0</memory_off> <memory_on type="float">20.0</memory_on> </compute resource_zone_pricing> <label>zonex</label> <network_zone_label>wertwert</network_zone_label> <network_zone_pricing> <data_rxed type="float">20.0</data_rxed> <data_sent type="float">30.0</data_sent> <ip_addresses_max nil="true"/> <ip_addresses_off type="float">10.0</ip_addresses_off> <ip_addresses_on type="float">30.0</ip_addresses_on> <port_speed type="float">30.0</port_speed> <port_speed_max nil="true"/> </network_zone_pricing> <template_group_id nil="true"/> <user_virtual_server_pricing> <auto_scaling type="float">10.0</auto_scaling> <auto_scaling_max nil="true"/> <backup_disk_size type="float">30.0</backup_disk_size> <backup_disk_size_max nil="true"/> <template_backup_store type="float">10.0</template_backup_store> <template_backup_store_max nil="true"/> <template_disk_size type="float">30.0</template_disk_size> <template_disk_size_max nil="true"/> </user_virtual_server_pricing> <federation_id>resource:compute resource:onapp-9QoC9BTPsFMnT2mp5rHZumHXHWg</federation_id> </federation_compute resource_zone>

49.7 Subscribe to Federated ZoneAs a trader you can subscribe to compute zones available in Federation:POST /federation/compute resource_zones/:id/subscribe.xmlPOST /federation/compute resource_zones/:id/subscribe.jsonXML Request Example

BILLING PLANS - GET THE LIST OF BILLING PLANS 659

Page 661: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/subscribe.xml -u user:userpass -d ''

Json Request Example

curl -i -X POST http://onapp.test/federation/compute resource_zones/:id/subscribe.json -u user:userpass -d ''

Where

id* - federated compute zone ID which you can find using GET request (e.g. resource:compute resource:onapp-KpY4wXq2N-9FERmf-SkwI2l1kQ4)

49.8 Unsubscribe from Federated ZoneAs a trader you can unsubscribe from a federated zone so that your users could create no more VSs in a zone.DELETE /federation/compute resource_zones/:id/unsubscribe.xmlDELETE /federation/compute resource_zones/:id/unsubscribe.json

XML Request Example

curl -i -X DELETE http://onapp.test/federation/compute resource_zones/:id/unsubscribe.xml -u user:userpass -d ''

Json Request Example

curl -i -X DELETE http://onapp.test/federation/compute resource_zones/:id/unsubscribe.json -u user:userpass -d ''

id* - hypervizor zone ID

49.9 Suspend ZoneAs a trader you can prevent your users from creating any more VSs on a federated zone. For this, suspend this zone and unsuspend it at any time later.PUT /federation/compute resource_zones/:id/close.xmlPUT /federation/compute resource_zones/:id/close.json

XML Request Example

BILLING PLANS - GET THE LIST OF BILLING PLANS 660

Page 662: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT http://onapp.test/federation/compute resource_zones/:id/close.xml -u user:userpass -d ''

Json Request Example

curl -i -X PUT http://onapp.test/federation/compute resource_zones/:id/close.json -u user:userpass -d ''

Where:id* - hypervizor zone ID

49.10 Unsuspend ZoneAs a trader, you can unsuspend a suspended federated zone:PUT /federation/compute resource_zones/:id/open.xmlPUT /federation/compute resource_zones/:id/open.json

XML Request Example

curl -i -X PUT http://onapp.test/federation/compute resource_zones/:id/open.xml -u user:userpass -d ''

Json Request Example

curl -i -X PUT http://onapp.test/federation/compute resource_zones/:id/open.json -u user:userpass -d ''

Whereid* - hypervizor zone ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 661

Page 663: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

50 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.

50.1 Get List of Firewall RulesTo get the list of firewall rules assigned to a VS, use the following request:GET /virtual_machines/:virtual_machine_id/firewall_rules.xmlGET /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 priorityaddress* – 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 createdcommand – the action which will be performed with the IP specified by the address parameterupdated_at – the date when the record was updated in DBport – the port for which this rule is active. If the field is empty, the rule will apply to all portsprotocol – the IP protocol (TCP or UDP)for which this rule is activeid – the ID of this recordnetwork_interface_id – the ID of a network interface for which this rule is active

BILLING PLANS - GET THE LIST OF BILLING PLANS 662

Page 664: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

50.2 Apply Firewall Rule

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

Update own virtual server

Read own virtual server

To apply firewall rules for a virtual server:POST /virtual_machines/:virtual_machine_id/update_firewall_rules.xmlPOST /virtual_machines/:virtual_machine_id/update_firewall_rules.json XML 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.xml

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.json

50.3 Add Firewall Rule

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

BILLING PLANS - GET THE LIST OF BILLING PLANS 663

Page 665: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Update own virtual server

Read own virtual server

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.xmlPOST /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="UTF-8"?><firewall_rule><address></address><command>DROP</command><port></port><protocol>TCP</protocol><network_interface_id>105</network_interface_id></firewall_rule>' --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_id":"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, UDP, DCCP, SCTP or ICMP)

network_interface_id* - interface of the network

BILLING PLANS - GET THE LIST OF BILLING PLANS 664

Page 666: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Protocols:For IPv4, only the ICMP, IPV6-ICMP, TCP, UDP, DCCP, SCTP protocols are available by default. However, if required, you can enable other protocols for IPv4.

1. Go to the /onapp/interface/config/network_protocols.yml file.

2. The list contains all protocols available (IPv4). Set 'true' for the required protocols.

3. Restart httpd by running one of the following commands:

service httpd restart

or

/etc/init.d/httpd restart

4. The protocols you have enabled are now available while adding new firewall rules.

The following protocols can be enabled in the /onapp/interface/config/network_protocols.yml file:

BILLING PLANS - GET THE LIST OF BILLING PLANS 665

Page 667: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

IP

HOPOPT

ICMP

IGMP

GGP

IP-ENCAP

ST

TCP

CBT

EGP

IGP

BBN-RCC-MON

NVP-II

PUP

ARGUS

EMCON

XNET

CHAOS

UDP

MUX

DCN-MEAS

HMP

PRM

XNS-IDP

TRUNK-1

TRUNK-2

LEAF-1

LEAF-2

RSVP-E2E-IGNORE

FC

SCTP

IPLT

RDP

IRTP

ISO-TP4

NETBLT

MFE-NSP

MERIT-INP

DCCP

3PC

IDPR

XTP

DDP

IDPR-CMTP

TP

IL

SDRP

IDRP

RSVP

GRE

DSR

BNA

ESP

AH

I-NLSP

SWIPE

NARP

MOBILE

HIP

manet

MPLS-in-IP

UDPLite

PIPE

SSCOPMCE

TLSP

SKIP

CFTP

SAT-EXPAK

KRYPTOLAN

RVD

IPPC

SAT-MON

VISA

IPCV

CPNX

CPHB

WSN

PVP

BR-SAT-MON

SUN-ND

WB-MON

WB-EXPAK

ISO-IP

VMTP

SECURE-VMTP

VINES

TTP

NSFNET-IGP

DGP, TCF

EIGRP

OSPFIGP

Sprite-RPC

LARP

MTP

SPS

CRUDP

AX.25

IPIP

MICP

SCC-SP

ETHERIP

ENCAP

GMTP

IFMP

PNNI

PIM

ARIS

SCPS

QNX

A/N

IPComp

SNP

Compaq-Peer

IPX-in-IP

VRRP

PGM

L2TP

DDX

IATP

STP

SRP

UTI

SMP

SM

PTP

ISIS

FIRE

CRTP

BILLING PLANS - GET THE LIST OF BILLING PLANS 666

Page 668: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

50.4 Edit Firewall Rule

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

Update own virtual server

Read own virtual server

To edit a firewall rule, use the following request:PUT /virtual_machines/:virtual_machine_id/firewall_rules/:id.xmlPUT /virtual_machines/:virtual_machine_id/firewall_rules/:id.json 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</port><protocol>TCP</protocol><network_interface_id>105</network_interface_id></firewall_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","protocol":"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

BILLING PLANS - GET THE LIST OF BILLING PLANS 667

Page 669: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

Protocols:For IPv4, only the ICMP, IPV6-ICMP, TCP, UDP, DCCP, SCTP protocols are available by default. However, if required, you can enable other protocols for IPv4.

1. Go to the /onapp/interface/config/network_protocols.yml file.

2. The list contains all protocols available (IPv4). Set 'true' for the required protocols.

3. Restart httpd by running one of the following commands:

service httpd restart

or

/etc/init.d/httpd restart

4. The protocols you have enabled are now available while adding new firewall rules.

The following protocols can be enabled in the /onapp/interface/config/network_protocols.yml file:

BILLING PLANS - GET THE LIST OF BILLING PLANS 668

Page 670: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

IP

HOPOPT

ICMP

IGMP

GGP

IP-ENCAP

ST

TCP

CBT

EGP

IGP

BBN-RCC-MON

NVP-II

PUP

ARGUS

EMCON

XNET

CHAOS

UDP

MUX

DCN-MEAS

HMP

PRM

XNS-IDP

TRUNK-1

TRUNK-2

LEAF-1

LEAF-2

RSVP-E2E-IGNORE

FC

SCTP

IPLT

RDP

IRTP

ISO-TP4

NETBLT

MFE-NSP

MERIT-INP

DCCP

3PC

IDPR

XTP

DDP

IDPR-CMTP

TP

IL

SDRP

IDRP

RSVP

GRE

DSR

BNA

ESP

AH

I-NLSP

SWIPE

NARP

MOBILE

HIP

manet

MPLS-in-IP

UDPLite

PIPE

SSCOPMCE

TLSP

SKIP

CFTP

SAT-EXPAK

KRYPTOLAN

RVD

IPPC

SAT-MON

VISA

IPCV

CPNX

CPHB

WSN

PVP

BR-SAT-MON

SUN-ND

WB-MON

WB-EXPAK

ISO-IP

VMTP

SECURE-VMTP

VINES

TTP

NSFNET-IGP

DGP, TCF

EIGRP

OSPFIGP

Sprite-RPC

LARP

MTP

SPS

CRUDP

AX.25

IPIP

MICP

SCC-SP

ETHERIP

ENCAP

GMTP

IFMP

PNNI

PIM

ARIS

SCPS

QNX

A/N

IPComp

SNP

Compaq-Peer

IPX-in-IP

VRRP

PGM

L2TP

DDX

IATP

STP

SRP

UTI

SMP

SM

PTP

ISIS

FIRE

CRTP

BILLING PLANS - GET THE LIST OF BILLING PLANS 669

Page 671: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

50.5 Delete Firewall Rule

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

Update own virtual server

Read own virtual server

To delete a firewall rule, use the following request:DELETE /virtual_machines/:virtual_machine_id/firewall_rules/:id.xmlDELETE /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:DELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.xmlDELETE /virtual_machines/:virtual_machine_id/firewall_rules/destroy_batch?ids=1,2,3.jsonXML Request example

curl -X DELETE -u user:userpass http://onapp.test/virtual_machines/omxa18ecx5e5y1/firewall_rules/destroy_batch.xml?ids=24,25 -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 670

Page 672: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

50.6 Change Firewall Rule Position

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

Update own virtual server

Read own virtual server

GET /virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_id/move.xmlGET /virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_id/move.jsonXML Request example

curl -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/firewall_rules/:firewall_rule_id/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_id/move.json?position=up -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 671

Page 673: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

To change a firewall rule position, specify the following parameters:virtual_machine_id - ID of a virtual server the firewall rule belongs tofirewall_rule_id - ID of the firewall rule

position - specify the position change: up or down

50.7 Set Default Firewall Rules

Ensure that the following permissions are enabled before setting firewall rules for your virtual server:

Create own firewall rules

Destroy own firewall rules

Read own firewall rules

Update own firewall rules

Update own virtual server

Read own virtual server

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.xmlPUT /virtual_machines/:virtual_machine_id/network_interfaces/:id.json XML Request example

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_interface>' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_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

BILLING PLANS - GET THE LIST OF BILLING PLANS 672

Page 674: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_id.json

Where:default_firewall_rule* - set default firewall rule for the particular VS network interface – either DROP or ACCEPT

BILLING PLANS - GET THE LIST OF BILLING PLANS 673

Page 675: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

51 FIREWALLS

Firewalls are Vyatta Community Edition firewall used used for managing VLANs and route VS networking traffic in and out of OnApp.

51.1 Get List of FirewallsTo view the list of firewalls:GET /settings/firewalls.xmlGET /settings/firewalls.jsonXML 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 formatupdated_at — the date when the rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfirewall_cluster_id - ID of a Vyatta firewall clusterid - ID of the Vyatta Firewall ruleinside_cidr - internal IP address prefix sizeinside_interface - interface used for managing firewall via CPinside_ip_address - IP address used to manage firewall via CP

BILLING PLANS - GET THE LIST OF BILLING PLANS 674

Page 676: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

name_of_default_rule - default firewall settings for new VSs (DROP/ACCEPT)outside_cidr_type - external IP address prefix sizeoutside_gateway_address - external gateway addressoutside_interface - external firewall interfaceoutside_ip_address - external firewall IPpreshared_cluster_secret - Vyatta shared key for heartbeat authenticationpassword - password for remote Vyatta managementusername - specify username for the remote Vyatta management

51.2 Get Firewall DetailsTo get details of a particular firewall:GET /settings/firewalls/:id.xmlGET /settings/firewalls/:id.jsonXML 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 formatupdated_at — the date when the rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfirewall_cluster_id - ID of the Vyatta firewall clusterid - ID of the Vyatta Firewall ruleinside_cidr - internal CIDR notationinside_interface - interface used for managing firewall via CPinside_ip_address - IP address used to manage firewall via CPname_of_default_rule - default firewall settings for new VSs (DROP/ACCEPT)

BILLING PLANS - GET THE LIST OF BILLING PLANS 675

Page 677: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

outside_cidr_type - external CIDR notationoutside_gateway_address - external gateway addressoutside_interface - external firewall interfaceoutside_ip_address - external firewall IPpreshared_cluster_secret - Vyatta shared key for heartbeat authenticationpassword - password for remote Vyatta managementusername - specify username for the remote Vyatta management

51.3 Add FirewallPOST /settings/firewalls.xmlPOST /settings/firewalls.jsonXML 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</outside_ip_address><outside_cidr>24</outside_cidr><outside_interface>eth1</outside_interface><outside_gateway_address>192.168.0.0</outside_gateway_address><name_of_default_rule></name_of_default_rule><username>admin</username><password>tryrgfdghetrj</password></firewall>' -u user:userpass http://onapp.test/settings/firewalls.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON 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 sizeinside_interface - interface used for managing firewall via CPinside_ip_address - IP address used to manage firewall via CPname_of_default_rule - default firewall settings for new virtual servers (DROP/ACCEPT)outside_cidr_type - external IP address prefix sizeoutside_gateway_address - external gateway address

BILLING PLANS - GET THE LIST OF BILLING PLANS 676

Page 678: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

outside_interface - external firewall interfaceoutside_ip_address - external firewall IPpassword - password for remote Vyatta managementusername - specify username for the remote Vyatta management

51.4 Edit FirewallPUT /settings/firewalls/:id.xmlPUT /settings/firewalls/:id.jsonXML Request example

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</outside_ip_address><outside_cidr>24</outside_cidr><outside_interface>eth1</outside_interface><outside_gateway_address>192.168.0.0</outside_gateway_address><name_of_default_rule></name_of_default_rule><username>admin</username><password>tryrgfdghetrj</password></firewall>' -u user:userpass http://onapp.test/settings/firewalls/3.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON 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 sizeinside_interface - interface used for managing firewall via CPinside_ip_address - IP address used to manage firewall via CPname_of_default_rule - default firewall settings for new virtual servers (DROP/ACCEPT)outside_cidr_type - external IP address prefix sizeoutside_gateway_address - external gateway addressoutside_interface - external firewall interfaceoutside_ip_address - external firewall IPpassword - password for remote Vyatta management

BILLING PLANS - GET THE LIST OF BILLING PLANS 677

Page 679: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

username - specify username for the remote Vyatta management

51.5 Delete FirewallTo delete a firewall, run:DELETE /settings/firewalls/:id.xmlDELETE /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'

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 678

Page 680: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52 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 HA configuration.

52.1 Get List of ClustersTo view the list of clusters, use the following request:GET /settings/availability/clusters.xmlGET /settings/availability/clusters.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' http://onapp.test/settings/availability/clusters.xml -H 'Content-type: 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-10-28T16:11:38+02:00</created_at> <id type="integer">7</id> <name>UI</name> <net_mask>24</net_mask> <ports nil="true"/> <state>created</state> <updated_at type="datetime">2015-11-10T16:44:22+02:00</updated_at> <virtual_ip>1.1.1.1</virtual_ip> <nodes type="array"> <node>

BILLING PLANS - GET THE LIST OF BILLING PLANS 679

Page 681: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2015-10-28T16:11:38+02:00</created_at> <host_id type="integer">2</host_id> <id type="integer">7</id> <interface>eth5</interface> <ip_address>2.2.2.2</ip_address> <priority type="integer">104</priority> <state>created</state> <updated_at type="datetime">2015-10-28T16:11:38+02:00</updated_at> <hostname>onapp2.ha.host</hostname> </node> <node>...</node> </nodes> </availability_cluster> <availability_cluster>...</availability_cluster></availability_clusters>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the ID of the high availability clustername - the label of the clusternet_mask - mask of the networkports - cluster portsstate - the state of the cluster, a cluster can have the following states: created - a cluster is 'created' when it is newly added, however, the

changes to the HA configuration have not yet been saved stable - a cluster is 'stable' if it did not undergo any changes. The

cluster will not be altered when the changes to the HA configuration will be saved.

modified - a cluster is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a cluster will become 'stable'.

deactivated - a cluster is 'deactivated' if the user chosen to make it inactive.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

virtual_ip - the virtual IP address for the cluster

nodes - the array of parameters for each node, where:

created_at - the date when the node has been created

host_id - the host ID

id - the node ID

interface - the network interface of the node

ip_address - the physical IP address of the node

BILLING PLANS - GET THE LIST OF BILLING PLANS 680

Page 682: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

state - the state of the node, a node can have the following states:

o created - a node is 'created' when it is newly added, however, the changes to the HA configuration have not yet been saved

o stable - a node is 'stable' if it did not undergo any changes. The node will not be altered when the changes to the HA configuration will be saved.

o modified - a node is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a node will become 'stable'.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

hostname - the host name of the the host with which this node is associated

52.2 Get List of Cluster NodesTo view the nodes of a cluster, use one of the following requests:GET /settings/availability/clusters/:cluster_id.xmlGET /settings/availability/clusters/:cluster_id.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' http://onapp.test/settings/availability/clusters/:cluster_id.xml -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' http://onapp.test/settings/availability/clusters/:cluster_id.json 'Content-type: application/json'

orGET /settings/availability/clusters/:cluster_id/nodes.xmlGET /settings/availability/clusters/:cluster_id/nodes.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' http://onapp.test/settings/availability/clusters/:cluster_id/nodes.xml -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 681

Page 683: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' http://onapp.test/settings/availability/clusters/:cluster_id/nodes.json 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><availability_nodes type="array"> <availability_node> <created_at type="datetime">2015-10-28T16:11:38+02:00</created_at> <host_id type="integer">2</host_id> <id type="integer">7</id> <interface>eth5</interface> <ip_address>2.2.2.2</ip_address> <priority type="integer">104</priority> <state>updated</state> <updated_at type="datetime">2015-10-28T16:11:38+02:00</updated_at> <hostname>onapp2.ha.host</hostname> </availability_node> <availability_node>...</availability_node></availability_nodes>

Where:created_at - the date when the node was createdhost_id - the host IDid - the node IDinterface - the network interface of the nodeip_address - the physical IP address of the nodepriority - 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.state - the state of the node, a node can have the following states: created - a node is 'created' when it is newly added, however, the

changes to the HA configuration have not yet been saved stable - a node is 'stable' if it did not undergo any changes. The node

will not be altered when the changes to the HA configuration will be saved.

modified - a node is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a node will become 'stable'.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

hostname - the host name of the the host with which this node is associated

BILLING PLANS - GET THE LIST OF BILLING PLANS 682

Page 684: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52.3 Get Node DetailsTo view the details of a node, use the following request:GET /settings/availability/clusters/:cluster_id/nodes/:node_id.xmlGET /settings/availability/clusters/:cluster_id/nodes/:node_id.xmlXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' http://onapp.test/settings/availability/clusters/:cluster_id/nodes/:node_id.xml -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' http://onapp.test/settings/availability/clusters/:cluster_id/nodes/:node_id.json -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><availability_node> <created_at type="datetime">2015-10-28T16:11:38+02:00</created_at> <host_id type="integer">2</host_id> <id type="integer">7</id> <interface>eth5</interface> <ip_address>2.2.2.2</ip_address> <priority type="integer">104</priority> <state>updated</state> <updated_at type="datetime">2015-10-28T16:11:38+02:00</updated_at> <hostname>onapp2.ha.host</hostname></availability_node>

Where:created_at - the date when the node has been createdhost_id - the host IDid - the node IDinterface - the network interface of the nodeip_address - the physical IP address of the nodepriority - 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.state - the state of the node, a node can have the following states: created - a node is 'created' when it is newly added, however, the

changes to the HA configuration have not yet been saved

BILLING PLANS - GET THE LIST OF BILLING PLANS 683

Page 685: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

stable - a node is 'stable' if it did not undergo any changes. The node will not be altered when the changes to the HA configuration will be saved.

modified - a node is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a node will become 'stable'.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

hostname - the host name of the the host with which this node is associated

52.4 Get List of HostsTo view the list of hosts in a cluster, use the following request:GET /settings/availability/hosts.xmlGET /settings/availability/hosts.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/availability/hosts.xml -H 'Accept: application/xml' -H 'Content-type:application/xml

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/availability/hosts.json -H 'Accept: application/json' -H 'Content-type:application/json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><availability_hosts type="array"> <availability_host> <created_at type="datetime">2015-09-30T12:26:02+03:00</created_at> <hostname>onapp1.ha.host</hostname> <id type="integer">1</id> <state>stable</state> <updated_at type="datetime">2015-09-30T12:26:02+03:00</updated_at> </availability_host> <availability_host> <created_at type="datetime">2015-09-30T12:26:02+03:00</created_at> <hostname>onapp2.ha.host</hostname> <id type="integer">2</id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 684

Page 686: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<state>stable</state> <updated_at type="datetime">2015-09-30T12:26:02+03:00</updated_at> </availability_host> <availability_host>...</availability_host></availability_hosts>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formathostname - the hostname of the hostid - ID of the hoststate - the state of the host, a host can have the following states: created - a host is 'created' when it is newly added, however, the

changes to the HA configuration have not yet been saved stable - a host is 'stable' if it did not undergo any changes. The host

will not be altered when the changes to the HA configuration will be saved.

modified - a host is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a host will become 'stable'.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

52.5 Get Host NodesTo view the list of nodes within a host and their details, use the following request:GET /settings/availability/hosts/:id.xmlGET /settings/availability/hosts/:id.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/availability/hosts/:id.xml -H 'Accept: application/xml' -H 'Content-type:application/xml

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/availability/hosts/:id.json -H 'Accept: application/json' -H 'Content-type:application/json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><availability_nodes type="array"> <availability_node>

BILLING PLANS - GET THE LIST OF BILLING PLANS 685

Page 687: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2015-10-28T16:11:38+02:00</created_at> <host_id type="integer">1</host_id> <id type="integer">9</id> <interface>eth0</interface> <ip_address>000.0.0.0</ip_address> <priority type="integer">0</priority> <state>updated</state> <updated_at type="datetime">2015-10-28T16:11:38+02:00</updated_at> <hostname>onapp1.ha.host</hostname> </availability_node><availability_node>...</availability_node></availability_nodes>

Where:created_at - the date when the node has been createdhost_id - the host IDid - the node IDinterface - the network interface of the nodeip_address - the physical IP address of the nodepriority - 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.state - the state of the node, a node can have the following states: created - a node is 'created' when it is newly added, however, the

changes to the HA configuration have not yet been saved stable - a node is 'stable' if it did not undergo any changes. The node

will not be altered when the changes to the HA configuration will be saved.

modified - a node is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a node will become 'stable'.

updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

hostname - the hostname of the node

52.6 Get List of Communication RingsTo view the list of communication rings, use the following request:GET /settings/availability/communication_rings.xmlGET /settings/availability/communication_rings.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H

BILLING PLANS - GET THE LIST OF BILLING PLANS 686

Page 688: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Content-Type: application/xml' http://onapp.test/settings/availability/communication_rings.xml

JSON Request example

curl -i -X GET -u admin:changeme -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/settings/availability/communication_rings.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><infrastructure_ha_communication_rings type="array"> <infrastructure_ha_communication_ring> <bindnetaddr>000.000.000.0</bindnetaddr> <id>11111111111111111</id> <mcastaddr>000.00.0.0</mcastaddr> <mcastport>0000</mcastport> <state nil="true"/> <ttl>00</ttl> </infrastructure_ha_communication_ring> <infrastructure_ha_communication_ring>...</infrastructure_ha_communication_ring></infrastructure_ha_communication_ring>

Where:bindnetaddr - the multicast network used by the hosts to communicate with each otherid - the ID of the communication ringmcastaddr - the multicast IP addressmcastport - the multicast portstate - the state of the communication ring, a communication ring can have the following states: created - a communication ring is 'created' when it is newly added,

however, the changes to the HA configuration have not yet been saved stable - a communication ring is 'stable' if it did not undergo any

changes. The communication ring will not be altered when the changes to the HA configuration will be saved.

modified - a communication ring is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a communication ring will become 'stable'.

ttl - time to live

BILLING PLANS - GET THE LIST OF BILLING PLANS 687

Page 689: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52.7 Get Details of Communication RingTo view the details of a particular communication ring, use the following request:GET /settings/availability/communication_rings/:communication_ring_id.xmlGET /settings/availability/communication_rings/:communication_ring_id.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/settings/availability/communication_rings/:communication_ring_id.xml

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/settings/availability/communication_rings/:communication_ring_id.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><communication_ring> <bindnetaddr>000.000.00.0</bindnetaddr> <id>1111111111111111111111</id> <mcastaddr>000.00.0.0</mcastaddr> <mcastport>0000</mcastport> <ttl>00</ttl></communication_ring>

Where:bindnetaddr - the multicast network used by the hosts to communicate with each otherid - the ID of the communication ringmcastaddr - the multicast IP addressmcastport - the multicast portstate - the state of the communication ring, a communication ring can have the following states: created - a communication ring is 'created' when it is newly added,

however, the changes to the HA configuration have not yet been saved stable - a communication ring is 'stable' if it did not undergo any

changes. The communication ring will not be altered when the changes to the HA configuration will be saved.

modified - a communication ring is 'modified' if it has been edited, however, the changes to the HA configuration have not yet been saved. When the changes will be applied, the status of such a communication ring will become 'stable'.

BILLING PLANS - GET THE LIST OF BILLING PLANS 688

Page 690: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ttl - time to live

52.8 Get Status of OnApp SubsystemsTo view the status of OnApp Engine subsystems use the following API call:GET /sysadmin_tools/infrastructure/services.xmlGET /sysadmin_tools/infrastructure/services.jsonXML 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:

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 689

Page 691: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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/processpid - PID of related service/process. Can be a digit or "N/A"status - human readable status of service/process. Can be "online" or "offline"

52.9 Enable High AvailabilityTo enable high availability for your cloud, use the following request:PUT /settings/availability/enable.xmlPUT /settings/availability/enable.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/enable.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d ''

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/enable.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{}'

52.10 Disable High AvailabilityTo disable high availability for your cloud, use the following request:PUT /settings/availability/disable.xmlPUT /settings/availability/disable.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/disable.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d ''

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 690

Page 692: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/disable.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{}'

52.11 Deactivate ClusterTo deactivate a cluster, use the following request:PUT /availability/cluster/:cluster_id/deactivate.xmlPUT /availability/cluster/:cluster_id/deactivate.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/clusters/:cluster_id/deactivate.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d ''

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/clusters/:cluster_id/deactivate.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{}'

Where:cluster_id - the ID of the cluster you want to deactivate.

52.12 Activate Deactivated ClusterTo activate a cluster you have previously deactivated, use the following request:PUT /availability/cluster/:cluster_id/recreate.xmlPUT /availability/cluster/:cluster_id/recreate.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/clusters/:cluster_id/recreate.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d ''

JSON Request example

curl -i -X PUT -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 691

Page 693: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/settings/availability/clusters/:cluster_id/recreate.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{}'

Where:cluster_id - the ID of the cluster you want to deactivate.

52.13 Apply Changes to High Availability Configuration

To apply changes to your HA configuration, use the following request:PUT /settings/availability/apply_changes.xmlPUT /settings/availability/apply_changes.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/apply_changes.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d ''

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/apply_changes.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{}'

52.14 Apply Changes to Multicast Configuration

To apply changes to the multicast configuration, use the following request:PUT /settings/availability/communication_rings/apply.xmlPUT /settings/availability/communication_rings/apply.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/communication_rings/apply.xml -H 'Accept: application/xml' -H 'Content-type:application/xml' -d ''

BILLING PLANS - GET THE LIST OF BILLING PLANS 692

Page 694: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/communication_rings/apply.json -H 'Accept: application/json' -H 'Content-type:application/json' -d '{}'

52.15 Edit HostTo edit a host, use the following method:PUT /settings/availability/hosts/:host_id.xmlPUT /settings/availability/hosts/:host_id.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/hosts/:host_id.xml -d '<availability_host><hostname>new.ha.host</hostname></availability_host>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/hosts/:host_id.json -d '{"availability_host":{"hostname":"onapp.ha.host"} }' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:hostname - the hostname of the host

52.16 Edit ClusterUse the following API call to edit a cluster:PUT /settings/availability/clusters/:cluster_id.xmlPUT /settings/availability/clusters/:cluster_id.jsonXML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '<availability_cluster><virtual_ip>1.1.1.1</virtual_ip><name>UI</nam

BILLING PLANS - GET THE LIST OF BILLING PLANS 693

Page 695: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

e><nodes><id>1</id><hostname>ha-cp1</hostname><interface>eth5</interface><ip_address>2.2.2.2</ip_address><priority>104</priority></nodes></availability_cluster>' http://onapp.test/settings/availability/clusters/:cluster_id.xml

JSON Request example

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": 1, "hostname": "ha-cp1", "interface": "eth5", "ip_address": "2.2.2.2", "priority": 104}]}}' http://onapp.test/settings/availability/clusters/:cluster_id.json

Where:availability_cluster - the array of the high availability cluster parametersvirtual_ip - set the desired virtual IP address of the control panelsname - the cluster type ( UI for UI cluster, Daemon for Daemon cluster, Cloud_boot for Cloudboot cluster, Load_balancer for load balancer cluster, Redis for Redis cluster and Message_queue for message queue cluster)nodes - the array of the node's parametersid - the ID of the nodehostname - the hostname of the nodeinterface - set the network interface for the nodeip_address - the IP address of the nodepriority - set 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.

52.17 Edit NodeUse the following API call to edit a node:PUT /settings/availability/clusters/:cluster_id/nodes/:node_id.xmlPUT /settings/availability/clusters/:cluster_id/nodes/:node_id.jsonXML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d '<availability_node><host_id>5</host_id><interface>eth6</interface><ip_address>2.2.3.2</ip_address><priority>104</priority></availability_node>' http://onapp.test/settings/availability/clusters/:cluster_id/nodes/:node_id.xml

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 694

Page 696: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"availability_node": { "host_id": "5", "interface": "eth6", "ip_address": "2.2.3.2", "priority": 104 } }' http://onapp.test/settings/availability/clusters/:cluster_id/nodes/:node_id.json

Where:host_id - the host IDinterface - set the network interface of the nodeip_address - the IP address of the nodepriority - set 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.

52.18 Edit Communication RingUse the following API call to edit a communication ring:PUT /settings/availability/communication_rings/:communication_ring_id.xmlPUT /settings/availability/communication_rings/:communication_ring_id.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/communication_rings/:communication_ring_id.xml -H 'Accept: application/xml' -H 'Content-type:application/xml' -d '<ring><bindnetaddr>000.000.00.0</bindnetaddr><mcastaddr>000.00.00.0</mcastaddr><mcastport>0000</mcastport><ttl>00</ttl></ring>'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/settings/availability/communication_rings/:communication_ring_id.json -H 'Accept: application/json' -H 'Content-type:application/json' -d '{"ring":{"bindnetaddr":"000.000.00.0","mcastaddr":"000.00.00.0","mcastport":"0000","ttl":"00"}}'

Where:bindnetaddr - the multicast network used by the hosts to communicate with each othermcastaddr - the multicast IP addressmcastport - the multicast portttl - time to live

BILLING PLANS - GET THE LIST OF BILLING PLANS 695

Page 697: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52.19 Add ClusterTo create a cluster, use the following request:POST /settings/availability/clusters.xmlPOST /settings/availability/clusters.jsonXML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<availability_cluster><name>MQ</name><virtual_ip>100.0.100.100</virtual_ip></availability_cluster>' --url http://onapp.test/settings/availability/clusters.xml

JSON Request example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"availability_cluster":{"name":"MQ","virtual_ip":"100.0.100.100"}}' --url http://onapp.test/settings/availability/clusters.json

Where:name* - the label of the new cluster. The name of the cluster should be unique and should be one of the following: DAEMON, UI, CLOUD_BOOT, LB, DB, REDIS, MQvirtual_ip* - the virtual IP address of the cluster. This IP address should be unique.

52.20 Add HostTo add a new host, use the following request:POST /settings/availability/hosts.xmlPOST /settings/availability/hosts.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/settings/availability/hosts.xml -d '<availability_host><hostname>new.ha.host</hostname></availability_host>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/settings/availability/hosts.json -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 696

Page 698: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'{"availability_host":{"hostname":"new.ha.host"} }' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:hostname* - the hostname of the host. This hostname should be unique.

52.21 Add New Node to ClusterTo add a node to cluster, use the following request:POST /settings/availability/clusters/:cluster_id/nodes.xmlPOST /settings/availability/clusters/:cluster_id/nodes.jsonXML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<availability_node><host_id>8</host_id><interface>eth5</interface><ip_address>2.2.2.2</ip_address><priority>104</priority></availability_node>' --url http://onapp.test/settings/availability/clusters/:cluster_id/nodes.xml

JSON Request example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"availability_node": { "host_id": "8", "interface": "eth5", "ip_address": "2.2.2.2", "priority": 104 } }' --url http://onapp.test/settings/availability/clusters/:cluster_id/nodes.json

Where:host_id* - the host ID. This ID should be a unique within a cluster.interface* - the network interface of the nodeip_address* - the physical IP address of the nodepriority* - 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.

52.22 Add Communication InterfaceUse the following API call to create a new communication ring:

BILLING PLANS - GET THE LIST OF BILLING PLANS 697

Page 699: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /settings/availability/communication_rings.xmlPOST /settings/availability/communication_rings.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/settings/availability/communication_rings.xml -H 'Accept: application/xml' -H 'Content-type:application/xml' -d '<ring><bindnetaddr>000.000.00.0</bindnetaddr><mcastaddr>000.00.00.00</mcastaddr><mcastport>0000</mcastport><ttl>00</ttl></ring>'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/settings/availability/communication_rings.json -H 'Accept: application/json' -H 'Content-type:application/json' -d '{"ring":{"bindnetaddr":"000.000.00.0","mcastaddr":"000.00.00.00","mcastport":"0000","ttl":"00"}}'

Where:bindnetaddr* - the multicast network used by the hosts to communicate with each other. This should be a unique network.mcastaddr* - the multicast IP address. This should be a unique address.mcastport* - the multicast port. This should be a unique port.ttl* - time to live

52.23 Delete HostTo delete a host, use the following request:DELETE /settings/availability/hosts/:host_id.xmlDELETE /settings/availability/hosts/:host_id.xmlXML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/availability/hosts/:host_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/availability/hosts/:host_id.json -H 'Accept:application/json' -H 'Content-type:application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 698

Page 700: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

52.24 Delete NodeTo delete a node, use the following request:DELETE /settings/availability/clusters/:cluster_id/nodes/:node_id.xmlDELETE /settings/availability/clusters/:cluster_id/nodes/:node_id.json

You cannot delete a cluster node if the cluster to which this node is assigned has only two nodes. The minimum number of nodes in a cluster is 2.

XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/availability/clusters/:cluster_id/nodes/:node_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/availability/clusters/:cluster_id/nodes/:node_id.json -H 'Accept:application/json' -H 'Content-type:application/json'

52.25 Delete Communication RingTo delete a communication ring, use the following request:DELETE /settings/availability/communication_rings/:communication_ring_id.xmlDELETE /settings/availability/communication_rings/:communication_ring_id.jsonXML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/availability/communication_rings/:communication_ring_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/availability/communication_rings/:communication_ring_id.json -H 'Accept: application/json' -H 'Content-type:application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 699

Page 701: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

53 INSTANCE PACKAGES

Instance packages are preconfigured CPU/RAM/Disk/Bandwidth packages that can be selected during the VS creation process. You can add multiple instance packages specifying different values for the parameters to suit your customer's needs. Resources that are not set when creating an instance package, such as, for example, swap disk size, are calculated automatically.

To provide your users with ability to choose VSs resources from the predefined instance package(s), add the necessary packages to the users' billing plan(s). After that, instance packages will appear in the server creation wizard, on the Resources step.

53.1 Get List of Instance PackagesTo view the list of instance packages,use one of the following methods:

1. For OnApp 4.3 and up:GET /instance_packages.xmlGET /instance_packages.json

2. For OnApp 4.3 and below. In the nearest major release this method will be deprecated:GET /instance_types.xmlGET /instance_types.json

XML Request example 1

curl -i -X GET http://onapp.test/instance_packages.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X GET http://onapp.test/instance_packages.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

BILLING PLANS - GET THE LIST OF BILLING PLANS 700

Page 702: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 2

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_packages type="array"> <instance_package> <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_package> <instance_package>...</instance_package></instance_packages>

Where:bandwidth - the bandwidth available in this instance package

cpus - the number of CPU cores available in this instance package

created_at - time when the instance package was created, in [YYYY][MM][DD]T[hh][mm][ss]Z

disk_size - the disk size available in this instance package

id - ID of the instance package

label - the name of the instance package

memory - the RAM size (GB) available in the instance package

BILLING PLANS - GET THE LIST OF BILLING PLANS 701

Page 703: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - time when the instance package was updated, in [YYYY][MM][DD]T[hh][mm][ss]Z

53.2 Get Instance Package DetailsTo view the details of an instance package, use one of the following methods:

1. For OnApp 4.3 and up:GET /instance_packages/:instance_package_id.xmlGET /instance_packages/:instance_package_id.json

2. For OnApp 4.3 and below. In the nearest major release this method will be deprecated:GET /instance_types/:instance_type_id.xmlGET /instance_types/:instance_type_id.json

XML Request example 1

curl -i -X GET http://onapp.test/instance_packages/:instance_package_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X GET http://onapp.test/instance_packages/:instance_package_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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 2

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 702

Page 704: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?xml version="1.0" encoding="UTF-8"?><instance_package> <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_package>

Where:id - ID of the instance packagelabel - the name of the instance packagecpus - the number of CPU cores available in this instance packagedisk_size - the disk size available in this instance packagememory - the RAM size (GB) available in the instance packagebandwidth - the bandwidth available in this instance packagecreated_at - time when the instance package was created, in [YYYY][MM][DD]T[hh][mm][ss]Zupdated_at - time when the instance package was updated, in [YYYY][MM][DD]T[hh][mm][ss]Zbilling_plan_ids - the array of billing plans to which this instance package was addedfixnum - the ID of the billing plan in which the instance package was used

53.3 Add Instance PackageTo add a new instance package, use one of the following methods:

1. For OnApp 4.3 and up:POST /instance_packages.xmlPOST /instance_packages.json

2. For OnApp 4.3 and below. In the nearest major release this method will be deprecated:POST /instance_types.xmlPOST /instance_types.json

XML Request example 1

BILLING PLANS - GET THE LIST OF BILLING PLANS 703

Page 705: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -d '<instance_package><label>example</label><cpus>1</cpus><memory>1024</memory><disk_size>50</disk_size><bandwidth>100</bandwidth></instance_package>' -u user:userpass http://onapp.test/instance_packages.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X POST -d '{"instance_package": {"label":"example", "cpus":"1", "memory":"1024", "disk_size":"50", "bandwidth":"100"}}' -u user:userpass http://onapp.test/instance_packages.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

curl -i -X POST -d '<instance_type><label>example</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.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 2

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:label - the name of the instance packagecpus - the number of CPU cores available in this instance package. The maximum CPUs value is 8.memory - the RAM size (GB) available in the instance package. The maximum value is 16384 MB by default.disk_size - the disk size available in this instance package. The maximum value is 100 GB by default.bandwidth - the bandwidth available in this instance package. Set this parameter to '0' to make bandwidth in this instance package unlimited.Bandwidth calculation is based on max_network_interface_port_speed configuration parameter in on_app.yml file. Example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 704

Page 706: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

If you have max port speed equal to 2000 Mbit/second, bandwidth could not be more than 2000*3600(seconds in one hour)/(1000*8)=900 GB per hour.

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_package_min_disk_size (GB) instance_package_max_disk_size (GB) instance_package_max_memory (MB) instance_package_min_bandwidth (GB)

53.4 Edit Instance PackageTo edit an instance package, use one of the following methods:

1. For OnApp 4.3 and up:PUT /instance_packages/:instance_package_id.xmlPUT /instance_packages/:instance_package_id.json

2. For OnApp 4.3 and below. In the nearest major release this method will be deprecated:PUT /instance_types/:instance_type_id.xmlPUT /instance_types/:instance_type_id.json

XML Request example 1

curl -i -X PUT -d '<instance_package><label>new_label</label><cpus>1</cpus><memory>1024</memory><disk_size>50</disk_size><bandwidth>100</bandwidth></instance_package>' -u user:userpass http://onapp.test/instance_packages/:instance_package_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X PUT -d '{"instance_package": {"label":"new_label", "cpus":"1", "memory":"1024", "disk_size":"50", "bandwidth":"100"}}' -u user:userpass http://onapp.test/instance_packages/:instance_package_id.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

curl -i -X PUT -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 705

Page 707: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'<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 2

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 packagecpus - the number of CPU cores available in this instance package. The maximum CPUs value is 8.memory - the RAM size available in the instance package. The maximum value is 16384 MB by default.disk_size - the disk size available in this instance package. The maximum value is 100 GB by default.bandwidth - the bandwidth available in this instance package. Set this parameter to '0' to make bandwidth in this instance package unlimited.

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_package_min_disk_size (GB) instance_package_max_disk_size (GB) instance_package_max_memory (MB) instance_package_min_bandwidth (GB)

53.5 Delete Instance PackageTo delete an instance package, use one of the following methods:

1. For OnApp 4.3 and up:DELETE /instance_packages/:instance_package_id.xmlDELETE /instance_packages/:instance_package_id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 706

Page 708: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

2. For OnApp 4.3 and below. In the nearest major release this method will be deprecated:DELETE /instance_types/:instance_type_id.xmlDELETE /instance_types/:instance_type_id.xml

XML Request example 1

curl -i -X DELETE http://onapp.test/instance_packages/:instance_package_id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example 1

curl -i -X DELETE http://onapp.test/instance_packages/:instance_package_id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Request example 2

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 2

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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 707

Page 709: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

54 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.

54.1 Get List of Integrated Storage Data Stores

To get the list of integrated storage data stores, use the following request:GET /storage/:hvz_id/data_stores.xmlGET /storage/:hvz_id/data_stores.jsonXML 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

curl -X GET 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)

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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 708

Page 710: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 IDname - data store labeltotal_size - the total size of the integrated data store in bytesfree_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 storenodes - an array of nodes with their detailsid - node ID

54.2 Get Integrated Data Store DetailsTo view details of a particular integrated data store:GET /storage/:hvz_id/data_stores/:data_store_id.xmlGET /storage/:hvz_id/data_stores/:data_store_id.jsonXML 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

Where:hvz_id - compute zone ID (storage API enpoint zone)data_store_id - data store ID

XML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 709

Page 711: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?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 IDname - data store labeltotal_size - the total size of the integrated data store in bytesfree_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 storenodes - an array of nodes with their detailsid - node ID

54.3 Add Integrated Storage Data StoreTo add new integrated storage data store:POST /storage/:hvz_id/data_stores.xmlPOST /storage/:hvz_id/data_stores.json

XML Request example

curl -X POST -d '<storage_data_store><name>datastore-test-2</name><replicas>1</replicas><stripes>1</stripes><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

BILLING PLANS - GET THE LIST OF BILLING PLANS 710

Page 712: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -X POST -d'{"storage_data_store":{"name":"datastore-test-2","replicas":"1","stripes":"1","overcommit":"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 dataowners - the array of identifiers of storage nodes, that are used to store datamembers - the storage node ids that are used to store the datamembership_count - the total number of storage nodes useduuid - unique datastore identifier.

54.3.1 PAGE HISTORYv. 3.2:

The request now includes a hvz_id parameter.

v. 3.0:

An overcommit parameter has been added to this API request.

BILLING PLANS - GET THE LIST OF BILLING PLANS 711

Page 713: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

54.4 Edit Integrated Data Store

To edit the integrated data store:PUT /storage/:hvz_id/data_stores/:id.xmlPUT /storage/:hvz_id/data_stores/:id.jsonWhere:hvz_id - compute zone ID (storage API enpoint zone)id - data store ID

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.

54.4.1 PAGE HISTORYv. 3.2:

The request now includes a hvz_id parameter.

BILLING PLANS - GET THE LIST OF BILLING PLANS 712

Page 714: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

54.5 Delete Integrated Storage Data Store

To delete an integrated storage data store:DELETE /storage/:hvz_id/data_stores/:id.xmlDELETE /storage/:hvz_id/data_stores/:id.jsonXML 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 IDYou 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.

54.5.1 PAGE HISTORYv. 3.2:

The request now includes a hvz_id parameter.

54.6 Add Disk Drive to Integrated Storage Data Store

To add a new VDisk to the integrated storage data store:POST /storage/:hvz_id/data_stores/:data_store_id/disks.xmlPOST /storage/:hvz_id/data_stores/:data_store_id/disks.jsonXML Request example

curl -X POST -d '<storage_disk><name>testdisk</name><size>12</size></storage_disk>'

BILLING PLANS - GET THE LIST OF BILLING PLANS 713

Page 715: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

54.6.1 PAGE HISTORYv. 3.2:

The request now includes a hvz_id parameter.

54.7 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.xmlDELETE /storage/:hvz_id/data_stores/:data_store_id/disks/:disk_id.jsonXML 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 714

Page 716: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

hvz_id - the ID of the compute resourcedata_store_id - the ID of the data store to which the disk is attacheddisk_id - the ID of the disk you wish to removeYou 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.

54.7.1 PAGE HISTORYv. 3.2:

The request now includes a hvz_id parameter.

54.8 Get Storage Node IO StatisticsGET /storage/:hvz_id/nodes/:node_id/io_stats.xmlGET /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-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/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 IDfilter[start] - defines the start period for the statsfilter[finish] - defines the end period for which the stats should be generatedfilter[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

BILLING PLANS - GET THE LIST OF BILLING PLANS 715

Page 717: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

<?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>...

54.9 Get Integrated Storage Datastore Disk IO Statistics

GET /storage/:hvz_id/nodes/:node_id/vdisk_id/io_stats.xmlGET /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]=2014-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

BILLING PLANS - GET THE LIST OF BILLING PLANS 716

Page 718: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 IDvdisk_id - virtual disk IDfilter[start] - defines the start period for the statsfilter[finish] - defines the end period for which the stats should be generatedfilter[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

54.10 Forget Storage NodeUse the following API call when the node that is down is still visible in nodes list:POST /storage/nodes/:node_id/forget.xmlPOST /storage/nodes/:node_id/forget.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/storage/nodes/:node_id/forget.xml?storage_endpoint_zone=71

JSON Request example

curl -i -X POST -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 717

Page 719: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/storage/nodes/:node_id/forget.json?storage_endpoint_zone=71

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

54.11 Get List of Backend Nodes on Integrated Storage Data Store

To get the list of integrated storage backend nodes, use the following request:GET /storage/:hvz_id/hypervisors.xmlGET /storage/:hvz_id/hypervisors.jsonXML 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

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 718

Page 720: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:nodes - an array of nodes with their IDs

id - compute resource ID

54.12 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 /storage/:hvz_id/data_stores/:data_store_id/disks.xmlGET /storage/:hvz_id/data_stores/:data_store_id/disks.jsonXML 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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 719

Page 721: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:disks - an array of disks with the following details

id -integrated data store ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 720

Page 722: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

55 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.

55.1 Get List of Network IP AddressesGET /settings/networks/:network_id/ip_addresses.xmlGET /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 networknetmask — netmask for the IP addressdisallowed_primary – true if not allowed to be used as primary (for VS build), otherwise falseaddress – IP addresscreated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at — the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatnetwork_id –the ID of the networknetwork_address – the address of the network

BILLING PLANS - GET THE LIST OF BILLING PLANS 721

Page 723: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

broadcast – broadcast addressid –the ID of the IP addressuser_id - the ID of the user this IP address is assigned togateway – gateway addressfree – true if free, otherwise false

55.2 Add IP Address RecordPOST /settings/networks/:network_id/ip_addresses.xmlPOST /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><broadcast>109.123.105.191</broadcast><disallowed_primary>true</disallowed_primary><network_address>109.123.105.176</network_address><gateway>109.123.105.177</gateway></ip_address>' --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":"109.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gateway":"109.123.105.177"}}' --url http://onapp.test/settings/networks/:network_id/ip_addresses.json*

Parameters:address* - IP addressnetmask* - network maskbroadcast* - 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 networkgateway* - gateway addressdisallowed_primary – set true not to use this address as primary (for VS build), otherwise set falseXML Output example

<?xml version="1.0" encoding="UTF-8"?><ip-addresses type="array">

BILLING PLANS - GET THE LIST OF BILLING PLANS 722

Page 724: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

55.3 Edit IP AddressPUT /settings/networks/:network_id/ip_addresses/:id.xmlPUT /settings/networks/:network_id/ip_addresses/:id.jsonXML 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><broadcast>109.123.105.191</broadcast><network_address>109.123.105.176</network_address><disallowed_primary>true</disallowed_primary><gateway>109.123.105.177</gateway></ip_address>' --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":"109.123.105.191","disallowed_primary":"true","network_address":"109.123.105.176","gateway":"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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 723

Page 725: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

You can get the list of IPs assigned to a VS with GET /virtual_machines/:id request.

55.4 Delete IP addressDELETE /settings/networks/:network_id/ip_addresses/:id.xmlDELETE /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.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/networks/:network_id/ip_addresses/:id.json

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.

55.5 Assign IP Address to UserTo 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 /settings/networks/:network_id/ip_addresses/assign.xmlPOST /settings/networks/:network_id/ip_addresses/assign.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test//settings/networks/:network_id/ip_addresses/assign.xml -d '<ip_addresses type="array"><id>79</id><id>80</id></ip_addresses><user_id>1</user_id>'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 724

Page 726: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/settings/networks/:network_id/ip_addresses/assign.json -d '{"ip_address":["79", "80"],"user_id":"1"}'

Where:ip_addresses - send the IDs of required IP addressesuser_id - indicate ID of the user, to whom you want to assign an IP address

55.6 Unassign IP Address from UserTo unassign IP addresses from any user, use the following request:POST /settings/networks/:network_id/ip_addresses/unassign.xmlPOST /settings/networks/:network_id/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/settings/networks/:network_id/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/settings/networks/:network_id/ip_addresses/unassign.json -d '{"ip_address":["79", "80"]}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 725

Page 727: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

56 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.

56.1 Get List of IP Address JoinsTo get the list of IP address assignments for a particular VS:GET /virtual_machines/:virtual_machine_id/ip_addresses.xmlGET /virtual_machines/:virtual_machine_id/ip_addresses.json An array of IP addresses is returned:

<?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 VSip_address _id – ID of IP addresscreated_at - the timestamp in DB when this record was createdupdated_at - the timestamp in DB when this record was updated

BILLING PLANS - GET THE LIST OF BILLING PLANS 726

Page 728: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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 joinnetwork_interface_id - the ID of the network interface to which this IP address should be assigned

56.2 Assign IP Address Join to VSUse the following class to assign an IP Address to a virtual server:POST /virtual_machines/:virtual_machine_id/ip_addresses.xmlPOST /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_interface_id><used_ip>1</used_ip></ip_address_join>' --url http://onapp.test/virtual_machines/:virtual_machine_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":"13","network_interface_id":"84","used_ip":"1"}}' --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 VSnetwork_interface_id* - specify the ID of network interface this IP address should be assigned toused_ip - if set to "1", this parameter allows to assign used IP addresses

56.3 Delete IP Address JoinTo 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:

BILLING PLANS - GET THE LIST OF BILLING PLANS 727

Page 729: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xmlDELETE /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.xml

JSON Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.json

To delete an IP address and rebuild a network:DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_network=1DELETE /virtual_machines/:virtual_machine_id/ip_addresses/:id.json?rebuild_network=1XML Request example

curl -i -X DELETE -u user:userpass —url http://onapp.test/virtual_machines/:virtual_machine_id/ip_addresses/:id.xml?rebuild_network=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_network=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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 728

Page 730: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

57 IP ADDRESS POOLS

IP Address Pools are network configurations associated with customer VLANs. When configuring an IP Address Pool, you set a range of IPv4 or IPv6 addresses and specify the network address of a VLAN that this pool will be available to.

57.1 Get List of IP Address PoolsTo get the list of IP address pools:GET /settings/ip_address_pools.xmlGET /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 OKContent-Type: application/xml;charset=utf-8X-Ua-Compatible: IE=EdgeEtag:"ee2c8d9a194b9efab74bdb26af627af0"Cache-Control: max-age=0, private,must-revalidateX-Request-Id:2025e5192d7f4cafe43cf5fd14372b28X-Runtime: 0.374566Content-Length: 428Server: WEBrick/1.3.1(Ruby/1.9.3/2012-04-20)Date: Fri, 07 Sep 2012 07:10:12 GMTConnection: Keep-AliveSet-Cookie:_session_id=5b6ba8c6bbbc91de33e1df212c0b21ee; path=/;

BILLING PLANS - GET THE LIST OF BILLING PLANS 729

Page 731: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

HttpOnly<?xml version="1.0"encoding="UTF-8"?><ip_address_poolstype="array"><ip_address_pool><cidr type="integer">24</cidr><created_attype="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_attype="datetime">2012-09-06T09:15:22+00:00</updated_at></ip_address_pool></ip_address_pools>

Where:ip_address_pools - an array of IP address pools with the following details:cidr - IP address prefix sizecreated_at — the date when the IP address pool was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - IP address pool IDipv4 - IPv4 boolean indicatornetwork address - the address of a VLAN network address that will be associated with this IP address poolupdated_at — the date when the IP address pool was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

57.2 Get IP Address Pool DetailsTo get details of a particular IP address pool, run:GET /settings/ip_address_pools/:id.xmlGET /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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 730

Page 732: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

HTTP/1.1 200 OKContent-Type: application/xml; charset=utf-8X-Ua-Compatible: IE=EdgeEtag: "912d1e77bdba7d3db87055253999ff45"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: 677cdab073210a599840f9f2b3805e2dX-Runtime: 0.156851Content-Length: 362Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)Date: Fri, 07 Sep 2012 07:22:48 GMTConnection: Keep-AliveSet-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 sizecreated_at — the date when the IP address pool was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - IP address pool IDipv4 - IPv4 boolean indicatornetwork address - the address of a VLAN network address that will be associated with this IP address poolupdated_at — the date when the IP address pool was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 731

Page 733: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

57.3 Add New IP Address PoolTo add new IP address pool:POST /settings/ip_address_pools/:id.xmlPOST /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

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'

Where you have to specify the following parameters:cidr – IP address prefix sizenetwork_address – the address of a VLAN network address that will be associated with this IP address pool

57.4 Delete IP Address PoolTo delete an IP address pool, run:DELETE /settings/ip_address_pools/:id.xmlDELETE /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'

BILLING PLANS - GET THE LIST OF BILLING PLANS 732

Page 734: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 733

Page 735: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

58 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.

58.1 Get List of ISOsTo view the list of ISOs, use the following request:GET /template_isos.xmlGET /template_isos.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' --url http://onapp.test/template_isos.xml'

JSON Request example

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' --url http://onapp.test/template_isos.json'

XML Output example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 734

Page 736: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system nameoperating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISO

BILLING PLANS - GET THE LIST OF BILLING PLANS 735

Page 737: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_server cdnchecksumcreated_atdisk_target_deviceext4 file_name initial_password initial_username min_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_id smart_server state updated_at user_id

58.2 Get ISO DetailsTo view the details of the particular ISO, use the following request:GET /template_isos/:iso_id.xmlGET /template_isos/:iso_id.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json' --url http://onapp.test/template_isos/:iso_id.json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 736

Page 738: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example

<?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 titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system name

BILLING PLANS - GET THE LIST OF BILLING PLANS 737

Page 739: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

operating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISOvirtualization - 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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_servercdnchecksumcreated_atdisk_target_deviceext4file_nameinitial_passwordinitial_usernamemin_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_idsmart_serverstateupdated_atuser_id

58.3 Get List of Public ISOsTo view the list of public ISOs, use the following request:GET /template_isos/system.xmlGET /template_isos/system.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 738

Page 740: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Content-type: application/json' --url http://onapp.test/template_isos/system.json'

XML Output example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 739

Page 741: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:label - the ISO titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system nameoperating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISOvirtualization - 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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_servercdnchecksumcreated_atdisk_target_deviceext4file_nameinitial_passwordinitial_usernamemin_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_idsmart_serverstateupdated_atuser_id

58.4 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 740

Page 742: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /template_isos/user/:user_id.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json' --url http://onapp.test/template_isos/user/:user_id.json'

XML Output example

<?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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 741

Page 743: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system nameoperating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISOvirtualization - 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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_servercdnchecksumcreated_atdisk_target_deviceext4file_nameinitial_passwordinitial_usernamemin_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_idsmart_serverstateupdated_atuser_id

BILLING PLANS - GET THE LIST OF BILLING PLANS 742

Page 744: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

58.5 Get List of User ISOsTo view the list of user ISOs, apply the following request:GET /template_isos/user.xmlGET /template_isos/user.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json' --url http://onapp.test/template_isos/user.json'

XML Output example

<?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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 743

Page 745: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system nameoperating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISOvirtualization - 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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_servercdnchecksumcreated_atdisk_target_deviceext4file_nameinitial_passwordinitial_usernamemin_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_id

BILLING PLANS - GET THE LIST OF BILLING PLANS 744

Page 746: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

smart_serverstateupdated_atuser_id

58.6 Get List of Own ISOsTo view the list of own ISOs, use the following request:GET /template_isos/own.xmlGET /template_isos/own.jsonXML Request example

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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 'Content-type: application/json' --url http://onapp.test/template_isos/own.json'

XML Output example

<?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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 745

Page 747: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system nameoperating_system_distro - operating system distributionid - ID of the ISOtemplate_size - size of the ISOvirtualization - 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_rebootallowed_hot_migrateallowed_swapbackup_server_idbaremetal_servercdnchecksumcreated_atdisk_target_deviceext4file_nameinitial_passwordinitial_username

BILLING PLANS - GET THE LIST OF BILLING PLANS 746

Page 748: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

min_disk_sizeoperating_system_archoperating_system_editionoperating_system_tailparent_template_idremote_idsmart_serverstateupdated_atuser_id

58.7 Update ISOUse the following API call to update an ISO:PUT /template_isos/:id.xmlPUT /template_isos/:id.jsonXML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass -d '<image_template_iso><label>label</label><min_disk_size>10</min_disk_size><min_memory_size>320</min_memory_size><version>1.3</version><operating_system>Linux</operating_system><operating_system_distro>redhel</operating_system_distro><virtualization>xen</virtualization></image_template_iso>' --url http://onapp.test/template_isos/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type:application/json' -u user:userpass -d '{"image_template_iso":{"label":"label","version":"1.3","min_memory_size": "320","min_disk_size": "10","operating_system": "Linux", "operating_system_distro": "Fedore", "virtualization": ["xen", "kvm"]}}' --url http://onapp.test/template_isos/:id.json

Where:label – the ISO titlemin_memory_size – minimum memory size required to build a VS on this ISO (MB)version – file versionoperating_system - operating system nameoperating_system_distro - type in the operating system distribution in free formmin_disk_size - the minimum disk size required to build a VS on this ISO (GB)

BILLING PLANS - GET THE LIST OF BILLING PLANS 747

Page 749: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

virtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISO

58.8 Add New ISOTo add a new ISO, use the following request:POST /template_isos.xmlPOST /template_isos.jsonXML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: 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</operating_system> <operating_system_distro>Fedore</operating_system_distro><virtualization type="array"><virtualization>xen</virtualization><virtualization >kvm</virtualization></virtualization><min_disk_size>20<min_disk_size><file_url>http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/iso/Fedora-Server-netinst-x86_64-21.iso</file_url></image_template_iso>'

JSON 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"], "min_disk_size":"6", "file_url": "http://download.fedoraproject.org/pub/fedora/linux/releases/21/Server/x86_64/iso/Fedora-Server-netinst-x86_64-21.iso"}}'

Where:make_public - whether the ISO will be available to all userslabel - the ISO titlemin_memory_size - minimum memory size required to build a VS on this ISO (MB)version - version of the fileoperating_system - operating system name

BILLING PLANS - GET THE LIST OF BILLING PLANS 748

Page 750: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

operating_systen_distro - type in the operating system distribution in free formvirtualization - type of virtualization (xen, kvm or kvm_virtio) which is compatible with this ISOmin_disk_size - the minimum disk size required to build a VS on this ISO (GB)file_url - the URL from which the ISO file is to uploaded

58.9 Make ISO PublicUse the following API call to make an ISO public:POST /template_isos/:id/make_public.xmlPOST /template_isos/:id/make_public.jsonXML 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.

58.10 Delete ISOTo delete an ISO from the system:DELETE /template_isos/:id.xmlDELETE /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

BILLING PLANS - GET THE LIST OF BILLING PLANS 749

Page 751: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

BILLING PLANS - GET THE LIST OF BILLING PLANS 750

Page 752: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

59 LICENSE

How to show the details of the OnApp license key edit license details.

59.1 Get License DetailsTo see the license details, use the following request:GET /settings/license.xmlGET /settings/license.jsonOutput example

<?xml version="1.0" encoding="UTF-8"?><license> <core_limit>Unlimited</core_limit> <key>1111-2222-3333</key> <status>Valid</status> <supplier_allowed type="boolean">true</supplier_allowed> <supplier_status>Enabled</supplier_status> <trader_allowed type="boolean">true</trader_allowed> <trader_status>Enabled</trader_status> <type>UNKNOWN</type> <valid type="boolean">true</valid></license>

Where:core_limit – number of CPU cores allowed by licensekey - the key of the licensestatus - the status of the licensesupplier_allowed - true, if supplier is allowed to use this license (applicable for Federation)supplier_status - the status of suppliertrader_allowed - true, if trader is allowed to use this license (applicable for Federation)trader_status - the status of tradertype - type of the licensevalid – true, if license is valid

BILLING PLANS - GET THE LIST OF BILLING PLANS 751

Page 753: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

59.2 Edit License DetailsTo update license, use the following call:PUT /settings.xmlPUT /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-NNNNN-NNNNN</license_key></configuration>' --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

BILLING PLANS - GET THE LIST OF BILLING PLANS 752

Page 754: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

60 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 typeIn this case you specify which VSs (nodes) will participate in a load balancing cluster. You can add and remove clustered VSs as required.

Autoscaling typeIn 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.

60.1 Get List of Load BalancersTo get the list of available load balancers, use the following request:GET /load_balancers.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 753

Page 755: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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

BILLING PLANS - GET THE LIST OF BILLING PLANS 754

Page 756: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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> </load_balancer></load_balancers>

Parameters description:load balancer - an array of load balancer detailsadd_to_marketplace – this parameter is not applicable to load balancers

BILLING PLANS - GET THE LIST OF BILLING PLANS 755

Page 757: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

admin_note – an optional text noteallow_resize_without_reboot – true if you can resize a VS's CPU and RAM without rebooting itallowed_hot_migrate – true if hot migration is allowedallowed_swap – true if swap disks are allowed, otherwise falsebooted - true if the server is booted, otherwise falsebuilt – true if the load balancing cluster is built, otherwise falsecpu_shares – the CPU priority of this load balancing clustercpus – the number of CPU cores allocated to this load balancercreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcustomer_network_id - this parameter is not applicable to load balancers

deleted_at the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatedge_server_type - this parameter is not applicable to load balancersenable_autoscale – true if autoscaling is enabled, otherwise falsefirewall_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 clusterid – the load balancing cluster IDidentifier – identifier of the load balancer in the databaseinitial_root_password — the LB root passwordinitial_root_password_encrypted - true, if the root password is encrypted, otherwise falselabel – the load balancer name local_remote_access_ip_address - IP address used for remote accesslocal_remote_access_port – the port ID used for used for console accesslocked – true if locked, otherwise falsememory – the amount of RAM allocated to this load balancing clustermin_disk_size – the minimum disk size in GB required for a specified templatenote – an optional text, added as a noteoperating_system - the OS on which the load balancing cluster is basedoperating_system_distro – the distribution of the OSpreferred_hvs - the array of preferable compute resources based on compute zone that meet some load balancer configuration settingsrecovery_mode – true if recovery mode is allowed, otherwise falseremote_access_password – the password for remote accessservice_password – this parameter is not applicable to load balancersstate – deprecated attributestorage_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 falsetemplate_id – ID of the LB templatetemplate_label - the name of the template on which this load balancing cluster is basedupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 756

Page 758: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_id – the ID of the user who owns this load balancing cluster

vip – true if the VIP status is set, otherwise falsexen_id - the VS ID set by the virtualization engineip_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

60.2 Get Load Balancer DetailsTo get the list of load balancing clusters, use the following request:GET /load_balancing_clusters/:load_balancing_cluster_id.xmlGET /load_balancing_clusters/:load_balancing_cluster_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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 757

Page 759: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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> <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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 758

Page 760: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 759

Page 761: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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><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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 760

Page 762: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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></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 (remains empty for cluster type)

cpus – the number of CPU cores allocated to this load balancer

BILLING PLANS - GET THE LIST OF BILLING PLANS 761

Page 763: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 762

Page 764: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o address – IP address

o broadcast – broadcast address

o created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

o customer_network_id - the ID of the customer VLAN the IP address belongs to

o disallowed_primary – true if not allowed to be used as primary, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 763

Page 765: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o gateway – gateway address

o hypervisor_id - the ID of a compute resource the IP address is associated with

o id –the ID of the IP address

o ip_address_pool_id - ID of the IP address pool the IP address is associated with

o network_address – the address of the network

o network_id –the ID of the network

o 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 764

Page 766: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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.

60.3 Get the List of Load Balancing Clusters

To get the list of load balancing clusters, use the following request:GET /load_balancing_clusters.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 765

Page 767: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 766

Page 768: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 767

Page 769: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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><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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 768

Page 770: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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></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 (remains 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 769

Page 771: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

identifier – identifier of the load balancer in the database

initial_root_password — the LB root password

BILLING PLANS - GET THE LIST OF BILLING PLANS 770

Page 772: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o address – IP address

o broadcast – broadcast address

o created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

o customer_network_id - the ID of the customer VLAN the IP address belongs to

o disallowed_primary – true if not allowed to be used as primary, otherwise false

o gateway – gateway address

o hypervisor_id - the ID of a compute resource the IP address is associated with

BILLING PLANS - GET THE LIST OF BILLING PLANS 771

Page 773: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o id –the ID of the IP address

o ip_address_pool_id - ID of the IP address pool the IP address is associated with

o network_address – the address of the network

o network_id –the ID of the network

o 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 772

Page 774: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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.

60.4 Get Load Balancing Cluster DetailsTo get details for a particular load balancing cluster, use the following request:GET /load_balancing_clusters/:id.xmlGET /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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 773

Page 775: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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_i

BILLING PLANS - GET THE LIST OF BILLING PLANS 774

Page 776: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

p_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> </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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 775

Page 777: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 776

Page 778: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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></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 (remains 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

BILLING PLANS - GET THE LIST OF BILLING PLANS 777

Page 779: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 778

Page 780: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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:

o address – IP address

o broadcast – broadcast address

o created_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

o customer_network_id - the ID of the customer VLAN the IP address belongs to

o disallowed_primary – true if not allowed to be used as primary, otherwise false

o gateway – gateway address

o hypervisor_id - the ID of a compute resource the IP address is associated with

o id –the ID of the IP address

o ip_address_pool_id - ID of the IP address pool the IP address is associated with

o network_address – the address of the network

o network_id –the ID of the network

o pxe - true, if this address can be used for cloudbooting a compute resource

monthly_bandwidth_used - LB monthly bandwidth

BILLING PLANS - GET THE LIST OF BILLING PLANS 779

Page 781: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 780

Page 782: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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.

60.5 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.xmlGET /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[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Request example

GET /load_balancers/:load_balancer_id/vm_stats/hourly_statistics_id.json?period[startdate]=YYYY-MM-DD+hh: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">

BILLING PLANS - GET THE LIST OF BILLING PLANS 781

Page 783: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <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">1</value> <cost type="float">0.0</cost> <resource_name>disk_size</resource_name> </cost> <cost> <value type="integer">0</value>

BILLING PLANS - GET THE LIST OF BILLING PLANS 782

Page 784: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> </costs> <label>eth0</label>

BILLING PLANS - GET THE LIST OF BILLING PLANS 783

Page 785: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</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> <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 createdupdated_at – the time stamp in DB when this record was updatedcurrency_code - currency in which this load balancer is charged within the billing planid – the ID of the load balancer hourly statisticsstat_time – the particular hour for which these statistics were generateduser_id - the ID of VS ownervirtual_machine_id - ID of a virtual servervirtual_machine_billing_statistics_id -ID of a load balancer billing statisticsbilling_stats - an array of billing details for the resources used by this load balancer: disks - an array of disks used by this load balancer with their billing

details:o label - disk name used in UIo id - disk ID used in databaseo costs- an array of disk related resources with their total prices

for the period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be disk_size,

data_read, data_written, reads_completed and writes_completed

BILLING PLANS - GET THE LIST OF BILLING PLANS 784

Page 786: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o value - the amount of resources used (GBs of disk size, Kbs of data read/written, the number of reads/writes)

o cost - the total due for the resource network_interfaces - an array of network interfaces used by this load

balancer with their billing statistics:o label - network interface name used in OnAppo id - network interface IDo costs- an array of network interface related resources with their

total prices for the period specified in the stat-time parameter, where:

o resource_name- the resource in question. This can be ip_addresses, rate, data_received and data_sent

o 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 )

o cost - the total due for the resource virtual_machines - an array of load balancer billing details:

o label - load balancer nameo costs- An array of load balancer resources with their total prices

for the period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be cpu_shares,

cpus, memory, cpu_usage and templateo value - the amount of resources allocated to this load balancer. For

the templates resource, this parameter means a template ID in database.

o cost - the total due for this resourceo id - load balancer ID

total_cost – the total amount of money owed for the load balancer 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 load balancer resources for the particular hour specified by stat_time parameter (memory, disks, templates)

usage_cost – the total due for load balancer usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage)

60.6 Get List of Load Balancer Autoscaling Monitors

To get details of RAM and CPU autoscaling monitors, use the following request:GET /load_balancers/:load_balancer_id/monitis_monitors.xmlGET /load_balancers/:load_balancer_id/monitis_monitors.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 785

Page 787: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/monitis_monitors.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/monitis_monitors.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><monitors type="array"> <vm_monitor> <changed_at type="datetime">2013-07-31T12:38:56+03:00</changed_at> <created_at type="datetime">2013-07-31T12:38:56+03:00</created_at> <failures type="integer">0</failures> <id type="integer">7</id> <identifier>46469</identifier> <load_balancing_cluster_node_id type="integer">15</load_balancing_cluster_node_id> <name>cpu</name> <should_update type="boolean">false</should_update> <time>12:44</time> <updated_at type="datetime">2013-08-01T12:47:24+03:00</updated_at> <virtual_machine_id type="integer">1613</virtual_machine_id> <info> <id type="integer">46469</id> <kernelMax type="float">66.0</kernelMax> <tag>cluster-7b6282fb11da26865544e37186b42c24ff012647</tag> <agentPlatform>LINUX</agentPlatform> <name>yq1rlbcc8fx5sm_cpu_monitor</name> <niceMax type="float">66.0</niceMax> <agentKey>yq1rlbcc8fx5sm</agentKey> <userMax type="float">66.0</userMax> <iowaitMax type="float">66.0</iowaitMax> <idleMin type="float">0.0</idleMin> <ip>127.0.0.1</ip> </info> <stats type="array"> <stat> <idleValue type="float">99.6</idleValue> <time>14:40</time> <userValue type="float">0.2</userValue>

BILLING PLANS - GET THE LIST OF BILLING PLANS 786

Page 788: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<status>OK</status> <ioWaitValue type="float">0.0</ioWaitValue> <kernelValue type="float">0.2</kernelValue> <niceValue type="float">0.0</niceValue> <cpuIndex type="integer">0</cpuIndex> </stat> <stat> <idleValue type="float">99.6</idleValue> <time>14:40</time> <userValue type="float">0.2</userValue> <status>OK</status> <ioWaitValue type="float">0.0</ioWaitValue> <kernelValue type="float">0.2</kernelValue> <niceValue type="float">0.0</niceValue> <cpuIndex type="integer">1</cpuIndex> </stat> </stats> </vm_monitor> <vm_monitor> <changed_at type="datetime">2013-07-31T13:23:58+03:00</changed_at>

<created_at type="datetime">2013-07-31T13:23:58+03:00</created_at> <failures type="integer">0</failures> <id type="integer">8</id> <identifier>45671</identifier> <load_balancing_cluster_node_id type="integer">15</load_balancing_cluster_node_id> <name>memory</name> <should_update type="boolean">false</should_update> <time>15:09</time> <updated_at type="datetime">2013-07-31T15:11:52+03:00</updated_at> <virtual_machine_id type="integer">1613</virtual_machine_id> <info> <freeLimit type="float">200.0</freeLimit> <id type="integer">45671</id> <cachedLimit type="integer">-1</cachedLimit> <agentPlatform>LINUX</agentPlatform> <name>yq1rlbcc8fx5sm_memory_monitor</name> <agentKey>yq1rlbcc8fx5sm</agentKey> <checkInterval type="integer">100</checkInterval> <bufferedLimit type="integer">-1</bufferedLimit> <freeSwapLimit type="float">200.0</freeSwapLimit> <ip>127.0.0.1</ip> </info> <stats> <buffered type="float">4.0</buffered> <cached type="float">34.0</cached> <freeswap type="float">1023.0</freeswap>

BILLING PLANS - GET THE LIST OF BILLING PLANS 787

Page 789: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<time>15:09</time> <totalMemory type="float">364.0</totalMemory> <status>OK</status> <freeMemory type="float">279.0</freeMemory> <totalSwap type="float">1023.0</totalSwap> </stats> </vm_monitor></monitors>

Where:CPU monitor details:vm_monitor - an array of load balancer autoscaling monitor details:

changed_at - the time stamp when this record was updated created_at – the time stamp in DB when this record was created updated_at – the time stamp in DB when this record was updated failures - the number of detected failures id - monitis monitor ID identifier - monitis monitor identifier load_balancing_cluster_node_id - cluster node ID name - monitor name time - time when the monitor test was performed virtual_machine_id - ID of a load balancer on which the monitor was

performed

info - an array of autoscaling monitor details:

id - monitor ID

kernelMax - maximum CPU value for kernel

tag - CPU test tag

agentPlatform - virtual server OS

name – CPU test label

niceMax - maximum CPU value for nice

agentKey - virtual server identifier

userMax - maximum CPU value for user processes

iowaitMax - maximum CPU value for iowait

idleMin - minimum CPU value for idle mode

ip – virtual server IP address

stats - an array of statistics details:

idleValue - percentage of CPU used in idle mode

time - time when the statistics was gathered

userValue - percentage of CPU used in user mode

BILLING PLANS - GET THE LIST OF BILLING PLANS 788

Page 790: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

status - monitor status: OK, if the monitor is correct or NOK, if the autoscaling configuration does not match. Monitor status is refreshed once in 5 minutes.

ioWaitValue - percentage of time the CPU was idle during the IO request

kernelValue - percentage of CPU used by kernel

niceValue - percentage of CPU time occupied by processes with positive CPU value

cpuIndex - CPU number

Memory monitor details:

vm_monitor - an array of load balancer autoscaling monitor details:

changed_at - the time stamp when this record was updated

created_at – the time stamp in DB when this record was created

updated_at – the time stamp in DB when this record was updated

failures - the number of detected failures

id - monitis monitor ID

identifier - monitis monitor identifier

load_balancing_cluster_node_id - cluster node ID

name - monitor name

time - time when the monitor test was performed

virtual_machine_id - ID of a load balancer on which the monitor was performed

info - an array of monitor details:

freeLimit - free memory limit in MB

id - monitor ID

cachedLimit - cached memory limit in MB

agentPlatform - virtual server OS platform

name - test label

agentKey - virtual server identifier

checkInterval - monitor status refresh interval.

bufferedLimit - buffered memory limit in MB

freeSwapLimit - free swap limit in MB

stats - an array of statistics details

buffered - free virtual server memory in MB

BILLING PLANS - GET THE LIST OF BILLING PLANS 789

Page 791: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cached - cached virtual server memory in MB

freeswap - free virtual server swap memory in MB

time - time when the statistics was gathered.

totalMemory - total virtual server memory in MB

status - monitor status: OK, if the monitor is correct or NOK, if the autoscaling configuration does not match. Monitor status is refreshed once in 5 minutes

freeMemory - free virtual server memory in MB

totalSwap - total virtual server swap memory in MB

60.7 Get Load Balancer Autoscaling Monitor Details

To get details for a particular load balancer, use the following request:GET /load_balancers/:load_balancer_id/monitis_monitors/:monitis_monitor_id.xmlGET /load_balancers/:load_balancer_id/monitis_monitors/:monitis_monitor_id.jsonXML Request example

curl -i -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/monitis_monitors/:monitis_monitor_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/monitis_monitors/:monitis_monitor_id.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 790

Page 792: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Depending on the autoscaling monitor type - CPU or RAM, the output will be as follows:

XML Output example for CPU monitor

<?xml version="1.0" encoding="UTF-8"?><vm_monitor> <changed_at type="datetime">2013-07-31T12:38:56+03:00</changed_at> <created_at type="datetime">2013-07-31T12:38:56+03:00</created_at> <failures type="integer">0</failures> <id type="integer">7</id> <identifier>46469</identifier> <load_balancing_cluster_node_id type="integer">15</load_balancing_cluster_node_id> <name>cpu</name> <should_update type="boolean">false</should_update> <time>12:44</time> <updated_at type="datetime">2013-08-01T12:47:24+03:00</updated_at> <virtual_machine_id type="integer">1613</virtual_machine_id> <info> <id type="integer">46469</id> <kernelMax type="float">66.0</kernelMax> <tag>cluster-7b6282fb11da26865544e37186b42c24ff012647</tag> <agentPlatform>LINUX</agentPlatform> <name>yq1rlbcc8fx5sm_cpu_monitor</name> <niceMax type="float">66.0</niceMax> <agentKey>yq1rlbcc8fx5sm</agentKey> <userMax type="float">66.0</userMax> <iowaitMax type="float">66.0</iowaitMax> <idleMin type="float">0.0</idleMin> <ip>127.0.0.1</ip> </info> <stats type="array"> <stat> <idleValue type="float">99.6</idleValue> <time>14:40</time> <userValue type="float">0.2</userValue> <status>OK</status> <ioWaitValue type="float">0.0</ioWaitValue> <kernelValue type="float">0.2</kernelValue> <niceValue type="float">0.0</niceValue> <cpuIndex type="integer">0</cpuIndex> </stat> <stat> <idleValue type="float">99.6</idleValue> <time>14:40</time> <userValue type="float">0.2</userValue> <status>OK</status> <ioWaitValue type="float">0.0</ioWaitValue>

BILLING PLANS - GET THE LIST OF BILLING PLANS 791

Page 793: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<kernelValue type="float">0.2</kernelValue> <niceValue type="float">0.0</niceValue> <cpuIndex type="integer">1</cpuIndex> </stat> </stats></vm_monitor>

Where:

vm_monitor - an array of load balancer autoscaling monitor details:

changed_at - the time stamp when this record was updated created_at – the time stamp in DB when this record was created updated_at – the time stamp in DB when this record was updated failures - the number of detected failures id - monitis monitor ID identifier - monitis monitor identifier load_balancing_cluster_node_id - cluster node ID name - monitor name time - time when the monitor test was performed virtual_machine_id - ID of a load balancer on which the monitor was

performed

info - an array of autoscaling monitor details:

id - monitor ID

kernelMax - maximum CPU value for kernel

tag - CPU test tag

agentPlatform - virtual server OS

name – CPU test label

niceMax - maximum CPU value for nice

agentKey - virtual server identifier

userMax - maximum CPU value for user processes

iowaitMax - maximum CPU value for iowait

idleMin - minimum CPU value for idle mode

ip – virtual server IP address

stats - an array of statistics details:

idleValue - percentage of CPU used in idle mode

time - time when the statistics was gathered

userValue - percentage of CPU used in user mode

status - monitor status: OK, if the monitor is correct or NOK, if the autoscaling configuration does not match. Monitor status is refreshed once in 5 minutes.

BILLING PLANS - GET THE LIST OF BILLING PLANS 792

Page 794: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ioWaitValue - percentage of time the CPU was idle during the IO request

kernelValue - percentage of CPU used by kernel

niceValue - percentage of CPU time occupied by processes with positive CPU value

cpuIndex - CPU number

XML Output example for RAM monitor

<?xml version="1.0" encoding="UTF-8"?><vm_monitor> <changed_at type="datetime">2013-07-31T13:23:58+03:00</changed_at> <created_at type="datetime">2013-07-31T13:23:58+03:00</created_at> <failures type="integer">0</failures> <id type="integer">8</id> <identifier>45671</identifier> <load_balancing_cluster_node_id type="integer">15</load_balancing_cluster_node_id> <name>memory</name> <should_update type="boolean">false</should_update> <time>15:09</time> <updated_at type="datetime">2013-07-31T15:11:52+03:00</updated_at> <virtual_machine_id type="integer">1613</virtual_machine_id> <info> <freeLimit type="float">200.0</freeLimit> <id type="integer">45671</id> <cachedLimit type="integer">-1</cachedLimit> <agentPlatform>LINUX</agentPlatform> <name>yq1rlbcc8fx5sm_memory_monitor</name> <agentKey>yq1rlbcc8fx5sm</agentKey> <checkInterval type="integer">100</checkInterval> <bufferedLimit type="integer">-1</bufferedLimit> <freeSwapLimit type="float">200.0</freeSwapLimit> <ip>127.0.0.1</ip> </info> <stats> <buffered type="float">4.0</buffered> <cached type="float">34.0</cached> <freeswap type="float">1023.0</freeswap> <time>15:09</time> <totalMemory type="float">364.0</totalMemory> <status>OK</status> <freeMemory type="float">279.0</freeMemory> <totalSwap type="float">1023.0</totalSwap> </stats></vm_monitor>

BILLING PLANS - GET THE LIST OF BILLING PLANS 793

Page 795: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:vm_monitor - an array of load balancer autoscaling monitor details:

changed_at - the time stamp when this record was updated

created_at – the time stamp in DB when this record was created

updated_at – the time stamp in DB when this record was updated

failures - the number of detected failures

id - monitis monitor ID

identifier - monitis monitor identifier

load_balancing_cluster_node_id - cluster node ID

name - monitor name

time - time when the monitor test was performed

virtual_machine_id - ID of a load balancer on which the monitor was performed

info - an array of monitor details:

freeLimit - free memory limit in MB

id - monitor ID

cachedLimit - cached memory limit in MB

agentPlatform - virtual server OS platform

name - test label

agentKey - virtual server identifier

checkInterval - monitor status refresh interval

bufferedLimit - buffered memory limit in MB

freeSwapLimit - free swap limit in MB

stats - an array of statistics details:

buffered - free virtual server memory in MB

cached - cached virtual server memory in MB

freeswap - free virtual server swap memory in MB

time - time when the statistics was gathered

totalMemory - total virtual server memory in MB

BILLING PLANS - GET THE LIST OF BILLING PLANS 794

Page 796: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

status - monitor status: OK, if the monitor is correct or NOK, if the autoscaling configuration does not match. Monitor status is refreshed once in 5 minutes

freeMemory - free virtual server memory in MB

totalSwap - total virtual server swap memory in MB

60.8 Add Load Balancing ClusterTo add a cluster type or an autoscaling type use the following request:POST /load_balancing_clusters.xmlPOST /load_balancing_clusters.json XML Request example to add a clustertype

curl -i -X POST -H 'Content-Type: application/xml' -H 'Accept:application/xml' -d '<load_balancing_cluster><ports type="array"><port>80</port><port>32678</port></ports><nodes_attributes type="array"><nodes_attribute><ip_address_id>5</ip_address_id><virtual_machine_id>1647</virtual_machine_id></nodes_attribute></nodes_attributes><cluster_type>cluster</cluster_type><load_balancer_attributes><label>cluster_xml</label><hypervisor_group_id>15</hypervisor_group_id><hypervisor_id>3</hypervisor_id><primary_network_group_id>4</primary_network_group_id><rate_limit>0</rate_limit><hostname>cluster.xml</hostname></load_balancer_attributes></load_balancing_cluster>' -u user:password http://onapp.test/load_balancing_clusters.xml

JSON Request example

curl -i -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"load_balancing_cluster":{"load_balancer_attributes":{"label":"test","hostname":"test","hypervisor _group_id":"15","hypervisor_id":"3","primary_network_group_id":"4","rate_limit":"1"},"cluster_type":"cluster","nodes_attributes":[{"ip_address_id":"5","virtual_machine_id":"1647"}]}}' -u user:password http://onapp.test/load_balancing_clusters.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 795

Page 797: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:load_balancing_cluster* – an array with load balancing cluster details, where: load_balancer_attributes *– an array of LB instance, where:

o label* – the LB titleo hostname* – the host name of the load balancero hypervisor_group_id – the ID of a compute zoneo hypervisor_id – the ID of a compute resourceo primary_network_group_id – the ID of a network zone assigned to the

load balancer clustero rate_limit* – the port speed for the LB

cluster_type* – the type of the load balancing cluster. Input cluster for the cluster type

nodes_attributes– an array of cluster nodes, where:

o virtual_machine_id – the ID of virtual server, which is added as a node

o ip_address_id – the ID of virtual server IP

ports*- an array of ports on which an LB cluster will run

60.9 Add Autoscaling ClusterXML Request example

curl -X POST -d '<load_balancing_cluster><config><max_node_amount>4</max_node_amount><min_node_amount>2</min_node_amount></config><auto_scaling_in_cpu_attributes><for_minutes>20</for_minutes><units>1</units><enabled>true</enabled><value>60</value></auto_scaling_in_cpu_attributes><ports type="array"><port>80</port><port>25000</port></ports><auto_scaling_in_memory_attributes><for_minutes>20</for_minutes><units>1</units><enabled>true</enabled><value>200</value></auto_scaling_in_memory_attributes><auto_scaling_out_memory_attributes><for_minutes>5</for_minutes><units>1</units><enabled>true</enabled><value>100</value></auto_scaling_out_memory_attributes><load_balancer_attributes><label>test</label><hostname>aa</hostname><rate_limit>0</rate_limit><primary_network_group_id>3</primary_network_group_id><hypervisor_group_id>1</hypervisor_group_id><hypervisor_id>1</hypervisor_id></load_balancer_attributes><cluster_type>autoscaleout</cluster_type><node_attributes><cpus>1</cpus><cpu_shares>1</

BILLING PLANS - GET THE LIST OF BILLING PLANS 796

Page 798: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_shares><memory>128</memory><rate_limit>0</rate_limit></node_attributes><auto_scaling_out_cpu_attributes><for_minutes>5</for_minutes><units>1</units><enabled>true</enabled><value>80</value></auto_scaling_out_cpu_attributes><image_template_id>62</image_template_id></load_balancing_cluster>' -u user:userpass http://onapp.test/load_balancing_clusters.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X POST -d '{"load_balancing_cluster":{"config":{"max_node_amount":"4","min_node_amount":"2"},"auto_scaling_in_cpu_attributes":{"for_minutes":"20","units":"1","enabled":"true","value":"60"},"ports":[80,25000],"auto_scaling_in_memory_attributes":{"for_minutes":"20","units":"1","enabled":"true","value":"200"},"auto_scaling_out_memory_attributes":{"for_minutes":"5","units":"1","enabled":"true","value":"100"},"load_balancer_attributes":{"label":"test","hostname":"aa","rate_limit":"0","primary_network_group_id":"3","hypervisor_group_id":"1","hypervisor_id":"1"},"cluster_type":"autoscaleout","node_attributes":{"cpus":"1","cpu_shares":"1","memory":"128","rate_limit":"0"},"auto_scaling_out_cpu_attributes":{"for_minutes":"5","units":"1","enabled":"true","value":"80"},"image_template_id":"62"},"available_vms":""}' -u user:userpass http://onapp.test/load_balancing_clusters.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:Autoscaling cluster parameters:

load_balancing_cluster* - an array with load balancing cluster details, where:

config* - a configuration array, where:

o max_node_amount* - the maximum number of nodes in this cluster

o min_node_amount* - the minimum number of nodes in this cluster

ports * – the array of ports on which a load balancing cluster will run

load_balancer_attributes* - an array of LB instance, where:

o label* – the LB title

o rate_limit* - the port speed for the LB

BILLING PLANS - GET THE LIST OF BILLING PLANS 797

Page 799: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o hostname* - the hostname of the load balancer

o primary_network_group_id - the ID of a network zone assigned to the load balancer cluster

o hypervisor_id - the ID of a compute zone

o hypervisor_id – the ID of a compute resource

cluster_type* - type of load balancing cluster. Input autoscaleout for the autoscaling type

node_attributes* - an array of cluster nodes, where:

o cpus* - number of CPUs for each node

o cpu_shares* - the CPU priority of each node

o memory* - the amount of RAM for each node

o rate_limit* - the port speed for each node

auto_scaling_in_memory_attributes - an array of RAM scale in attributes, where:

o for_minutes - how long the RAM should be monitored. The for_minutes parameter must be divisible by 5.

o units - how many nodes are removed from the cluster, if the rule is met

o enabled - set 1/true if the rule is enabled. Otherwise set 0/false

o value - the amount of RAM (MB). If this value is reached by the cluster during the period specified by the for_minutes parameter, the system will remove the amount of units set by the units parameters.

auto_scaling_in_cpu_attributes - an array of CPU scale in attributes, similar to RAM scale in attributes

auto_scaling_out_memory_attributes - an array of RAM scale out attributes, where:

o for_minutes - how long the RAM should be monitored

o units - how many nodes are added to the cluster if the rule is met

o enabled - set 1/true to enable the rule. Otherwise set false/0.

o value - the amount of RAM (MB). If this value is reached by the cluster during the period specified by the for_minutes parameter, the system will add the amount of units set by the units parameters

auto_scaling_out_cpu_attributes - an array of CPU scale out attributes, similar to RAM scale out attributes

60.10 Add Nodes to Cluster TypeTo add new VSs (nodes) to a cluster type, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 798

Page 800: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /load_balancing_clusters/:id.xmlPUT /load_balancing_clusters/:id.json XML Request example

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -d '<load_balancing_cluster><nodes_attributes type="array"><node_attribute><virtual_machine_id>1647</virtual_machine_id><ip_address_id>5</ip_address_id></node_attribute><node_attribute><virtual_machine_id>1520</virtual_machine_id><ip_address_id>9</ip_address_id></node_attribute></nodes_attributes></load_balancing_cluster>'-u user:password http://onapp.test/load_balancing_clusters/22.xml

JSON Request example

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"load_balancing_cluster":{"nodes_attributes":[{"virtual_machine_id":"1647","ip_address_id":"5"},{"virtual_machine_id":"1520","ip_address_id":"9"}]}}' -u user:password http://onapp.test/load_balancing_clusters/22.json

You add new nodes by editing nodes_attributes array, where you add new nodes to already existing ones:node_attributes– an array where you may add new nodes virtual_machine_id - input the ID of the virtual server ip_address_id - the ID of virtual server IP

60.11 Remove Nodes from Cluster Type

To remove nodes from cluster type, use the following request:PUT /load_balancing_clusters/:id.xml PUT /load_balancing_clusters/:id.json XML Request example

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -d '<load_balancing_cluster><nodes_attributes type="array"><node_attribute><_destroy>true</_destroy><id>28</id></node_attribute><node_attribute><_destroy>true</_destroy><id>29</id></node_attribute></nodes_attributes></load_balancing_cluster>' -u user:password http://onapp.test/load_balancing_clusters/22.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 799

Page 801: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d {"load_balancing_cluster":{"nodes_attributes":[{"_destroy":"true","id":"26"}, {"_destroy":"true","id":"27"}]}}' -u user:password http://onapp.test/load_balancing_clusters/22.json

Where:

load_balancing_cluster – an array with load balancing cluster details: nodes_attributes– an array where you may remove node

o destroy – set 1/true to remove this node from the clustero id – cluster node id

60.12 Edit Load Balancing ClusterTo edit a particular load balancing cluster parameters, use the following request:PUT /load_balancing_clusters/:id.xmlPUT /load_balancing_clusters/:id.json XML Request example

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -d '<load_balancing_cluster><ports type="array"><port>80</port><port>623</port></ports><load_balancer_attributes><label>zaza_BB</label><rate_limit>266</rate_limit></load_balancer_attributes></load_balancing_cluster>'-u user:password http://onapp.test/load_balancing_clusters/21.xml

JSON Request example

curl -i -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"load_balancing_cluster":{"ports":[810,12623], "load_balancer_attributes":{"label":"zaza_B","rate_limit":"212"}}}' -u user:password http://onapp.test/load_balancing_clusters/21.json

Where:ports*- edit ports on which the load balancing cluster runs

load_balancer_attributes* - an array of LB instance, where: label* - the LB title rate_limit* - the port speed for the LB

Using this request you can edit the following load balancing cluster parameters: port, label and rate limit and add node to the load balancing cluster. To see how to add and remove nodes from the

BILLING PLANS - GET THE LIST OF BILLING PLANS 800

Page 802: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cluster type, see the Remove Nodes from Cluster Type and Add Nodes to Cluster Type sections.

60.13 Edit Autoscaling ClusterYou may change minimum/maximum number of nodes of autoscaling type, as well as change the autoscaling attributes for RAM and CPU.To configure autoscaling type, use the following request:PUT /load_balancing_clusters/:id.xmlPUT /load_balancing_clusters/:id.json XML Request example

curl -X PUT -d '<load_balancing_cluster><config><max_node_amount>4</max_node_amount><min_node_amount>2</min_node_amount></config><auto_scaling_in_cpu_attributes><for_minutes>20</for_minutes><units>1</units><enabled>true</enabled><value>60</value></auto_scaling_in_cpu_attributes><ports type="array"><port>80</port><port>25000</port></ports><auto_scaling_in_memory_attributes><for_minutes>20</for_minutes><units>1</units><enabled>true</enabled><value>200</value></auto_scaling_in_memory_attributes><auto_scaling_out_memory_attributes><for_minutes>5</for_minutes><units>1</units><enabled>true</enabled><value>100</value></auto_scaling_out_memory_attributes><load_balancer_attributes><label>az_AS</label><rate_limit>0</rate_limit></load_balancer_attributes><node_attributes><cpus>1</cpus><cpu_shares>1</cpu_shares><memory>128</memory><rate_limit>0</rate_limit></node_attributes><auto_scaling_out_cpu_attributes><for_minutes>5</for_minutes><units>1</units><enabled>true</enabled><value>80</value></auto_scaling_out_cpu_attributes></load_balancing_cluster>' -u user:userpass http://onapp.test/load_balancing_clusters.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X PUT -d'{"load_balancing_cluster":{"config":{"max_node_amount":"4","min_node_amount":"1"},"auto_scaling_in_cpu_attributes":{"for_minutes":"20","units":"1","enabled":"true","value":"60"},"ports":["80"],"auto_scaling_in_memory_attributes":{"for_minutes":"20","units":"1","enabled":"true","value":"200"},"auto_scaling_out_memory_attributes":{"for_minutes":"5","units":"1","enabled":"true","value":"100"},"load_balancer_attributes":

BILLING PLANS - GET THE LIST OF BILLING PLANS 801

Page 803: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"label":"az_AS","rate_limit":"0"},"node_attributes":{"cpus":"1","cpu_shares":"1","memory":"128","rate_limit":"0"},"auto_scaling_out_cpu_attributes":{"for_minutes":"5","units":"1","enabled":"true","value":"80"}},"available_vms":""}' -u user:userpass http://onapp.test/load_balancing_clusters/45.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where you may change:Number of nodes: max_node_amount – maximum number of nodes for the cluster min_node_amount – minimum number of nodes for the cluster

Autoscale in/out attributes for RAM and CPU:

for_minutes - how long the resource should be monitored. The for_minutes parameter must be divisible by 5.

units - how many nodes are removed or added to the cluster, if the rule is met

enabled - set 1/true if the rule is enabled. Otherwise set 0/false

value - the amount of resource. If this value is reached by the cluster during the period specified by the for_minutes parameter, the system will remove the amount of units set by the units parameter.

60.14 Edit Load Balancing Cluster PortsTo set the list of ports on which a load balancing cluster runs, use the following requests:PUT /load_balancing_clusters/:id.xmlPUT /load_balancing_clusters/:id.json XML Request example

curl -i -X PUT -H 'Content-Type: application/xml' -H 'Accept: application/xml' -d '<load_balancing_cluster><ports type="array"><port>8080</port><port>25025</port> *</ports></load_balancing_cluster>' -u user:userpass --url http://onapp.test/load_balancing_clusters/:id.xml*

JSON Request example

curl -X PUT -d '{"load_balancing_cluster":{"ports":[8080,25025]}}' -u onapp_user:userpass http://onapp.test/load_balancing_clusters/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 802

Page 804: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

ports* - an array of ports on which a load balancing cluster will runport* - a particular port

60.15 Delete Load Balancing ClusterTo delete a load balancing cluster, use the following request:DELETE /load_balancing_clusters/:id .xmlDELETE /load_balancing_clusters/:id .json You can also delete it using this request:DELETE /load_balancers/:id.xmlDELETE /load_balancers/:id.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/load_balancers/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/load_balancers/:id.json

Where you have to specify ID of a load balancer you want to delete.

60.16 Rebuild Load BalancerTo rebuild a load balancer, use the following request:POST /load_balancers/:load_balancer_id/rebuild.xmlPOST /load_balancers/:load_balancer_id/rebuild.json XML Request example

curl -X POST -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/rebuild.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON request example

curl -X POST -u user:userpass http://onapp.test/load_balancers/:load_balancer_id/rebuild.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 803

Page 805: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

60.17 Search Load Balancer by LabelTo search load balancer by label, run the following request

XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/load_balancers.xml?q=label

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password --url http://onapp.test/load_balancers.json?q=label

Where you have to specify the label of a load balancer you are searching for.

60.18 Start up Load BalancerTo start up a load balancer, use the following request:POST onapp.test/load_balancers/:load_balancer_id/startup.xmlPOST onapp.test/load_balancers/:load_balancer_id/startup.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/startup.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/startup.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 804

Page 806: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

60.19 Shut down Load BalancerTo shut down a load balancer, use the following request:POST /load_balancers/:load_balancer_id/shutdown.xmlPOST /load_balancers/:load_balancer_id/shutdown.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/shutdown.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/shutdown.json

60.20 Suspend Load BalancerTo suspend a load balancer:POST /load_balancers/:load_balancer_id/suspend.xmlPOST /load_balancers/:load_balancer_id/suspend.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/suspend.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/suspend.json

To unsuspend a load balancer, use the same request again.

60.21 Stop Load BalancerTo stop a load balancer, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 805

Page 807: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /load_balancers/:load_balancer_id/stop.xmlPOST /load_balancers/:load_balancer_id/stop.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/stop.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/stop.json

60.22 Unlock Load BalancerTo unlock a load balancer:POST /load_balancers/:load_balancer_id/unlock.xmlPOST /load_balancers/:load_balancer_id/unlock.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/unlock.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/load_balancers/:load_balancer_id/unlock.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 806

Page 808: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

61 LOCALES

You can see the list of locales which you can assign to a user or a group of users. The array will contain the name of locale and its code.To see the list of locales, use the following request:GET /settings/internationalization.xml GET /settings/internationalization.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><locales type="array"><locale><name>Afar</name><code>aa</code></locale><locale><name>Abkhazian</name><code>ab</code></locale><locale><name>Afrikaans</name><code>af</code></locale>...<locale></locale>...

BILLING PLANS - GET THE LIST OF BILLING PLANS 807

Page 809: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

62 LOCATION GROUPS

Location groups allow manage the Compute resource, Data store, Backup server and Network zones in geographically dispersed locations in the same cloud. Currently, this enables you to host CDN Edge Servers and Storage Servers in remote locations using a single Control panel. The multi-location option is set in OnApp Dashboard for the cloud and its availability depends on the license type.

62.1 Get List of Location GroupsTo get an array of location groups set up within your cloud, use the following request:GET /settings/location_groups.xmlGET /settings/location_groups.json

XML Output example

<location_groups type="array"> <location_group> <city>Tambov</city> <country>Russian Federation</country> <created_at type="datetime">2015-08-18T13:33:50+03:00</created_at> <federation_id nil="true"/> <id type="integer">2</id> <updated_at type="datetime">2015-08-18T13:33:50+03:00</updated_at> <cdn_enabled type="boolean">false</cdn_enabled> <federated type="boolean">false</federated> </location_group> <location_group> <city>Lviv</city> <country>Ukraine</country> <created_at type="datetime">2015-08-18T13:33:50+03:00</created_at> <federation_id nil="true"/> <id type="integer">3</id> <updated_at type="datetime">2015-08-18T13:33:50+03:00</updated_at> <cdn_enabled type="boolean">true</cdn_enabled> <federated type="boolean">false</federated> </location_group></location_groups>

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 808

Page 810: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

city - the location group citycountry - the location group countrycreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the location group IDupdated_at - the date when the location group was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcdn_enabled - true if CDN is enabled for the location group; otherwise falsefederated - true if the location group is federated; otherwise false

62.2 Get Location Group DetailsThe following method returns details for a particular location group:GET /settings/location_groups/:id.xmlGET /settings/location_groups/:id.json XML Response example

<location_group> <city>Lviv</city> <country>Ukraine</country> <created_at type="datetime">2015-08-18T13:33:50+03:00</created_at> <federation_id nil="true"/> <id type="integer">3</id> <updated_at type="datetime">2015-08-18T13:33:50+03:00</updated_at> <cdn_enabled type="boolean">true</cdn_enabled> <federated type="boolean">false</federated></location_group>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the location group was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcity - the location group Citycountry - the location group countryid - the location group IDcdn_enabled - true if CDN is enabled for the location group; otherwise falsefederated - true if the location group is federated; otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 809

Page 811: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

62.3 Refresh Location GroupsTo refresh location groups and synchronize the groups in the Control Panel and the Dashboard, use the following request:

GET /settings/location_groups/refresh.xmlGET /settings/location_groups/refresh.json

XML Request example

curl -i -u user:userpass -X GET http://onapp.test/settings/location_groups/refresh.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -u user:userpass -X GET http://onapp.com/settings/location_groups/refresh.json -H 'Accept: application/json' -H 'Content-type: application/json'

62.4 Attach Compute Zone to Location Group

POST /settings/location_groups/:location_group_id/hypervisor_groups/attach_resource.xmlPOST /settings/location_groups/:location_group_id/hypervisor_groups/attach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<attach_resource_id>1</attach_resource_id>' --url http://onapp.test/settings/location_groups/1/hypervisor_groups/attach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '

BILLING PLANS - GET THE LIST OF BILLING PLANS 810

Page 812: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"attach_resource_id":"4"}' --url http://onapp.test/settings/location_groups/1/hypervisor_groups/attach_resource.json

This request attaches a particular compute zone (attach_resource_id*) to a specific location group (:location_group_id)

62.5 Detach Compute Zone from Location Group

POST /settings/location_groups/:location_group_id/hypervisor_groups/:hypervisor_group_id/detach_resource.xmlPOST /settings/location_groups/:location_group_id/hypervisor_groups/:hypervisor_group_id/detach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/hypervisor_groups/4/detach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/hypervisor_groups/4/detach_resource.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a compute zone with the ID specified is not found, or the URL requested is incorrect.

62.6 Attach Data Store Zone to Location Group

POST /settings/location_groups/:location_group_id/data_store_groups/attach_resource.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 811

Page 813: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /settings/location_groups/:location_group_id/data_store_groups/attach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<attach_resource_id>1</attach_resource_id>' --url http://onapp.test/settings/location_groups/1/data_store_groups/attach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d ' {"attach_resource_id":"4"}' --url http://onapp.test/settings/location_groups/1/data_store_groups/attach_resource.json

This request attaches a particular data store zone (attach_resource_id*) to a specific location group (:location_group_id)

62.7 Detach Data Store Zone from Location Group

POST /settings/location_groups/:location_group_id/data_store_groups/:data_store_group_id/detach_resource.xmlPOST /settings/location_groups/:location_group_id/data_store_groups/:data_store_group_id/detach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/data_store_groups/4/detach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/data_store_groups/4/detach_resource.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 812

Page 814: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Returns HTTP/1.1 302 Found response on successful deletion, or HTTP 404 when a data store zone with the ID specified is not found, or the URL requested is incorrect.

62.8 Attach Network Zone to Location Group

POST /settings/location_groups/:location_group_id/network_groups/attach_resource.xmlPOST /settings/location_groups/:location_group_id/network_groups/attach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<attach_resource_id>1</attach_resource_id>' --url http://onapp.test/settings/location_groups/1/network_groups/attach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d ' {"attach_resource_id":"4"}' --url http://onapp.test/settings/location_groups/1/network_groups/attach_resource.json

This request attaches a particular network zone (attach_resource_id*) to a specific location group (:location_group_id)

62.9 Detach Network Zone from Location Group

POST /settings/location_groups/:location_group_id/network_groups/:network_group_id/detach_resource.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 813

Page 815: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /settings/location_groups/:location_group_id/network_groups/:network_group_id/detach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/network_groups/4/detach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/network_groups/4/detach_resource.json

Returns HTTP/1.1 302 Found response on successful deletion, or HTTP 404 when a network zone with the ID specified is not found, or the URL requested is incorrect.

62.10 Attach Backup Server Zone to Location Group

POST /settings/location_groups/:location_group_id/backup_server_groups/attach_resource.xmlPOST /settings/location_groups/:location_group_id/backup_server_groups/attach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<attach_resource_id>1</attach_resource_id>' --url http://onapp.test/settings/location_groups/1/backup_server_groups/attach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d ' {"attach_resource_id":"4"}' --url http://onapp.test/settings/location_groups/1/backup_server_groups/attach_resource.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 814

Page 816: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

This request attaches a particular backup server zone (attach_resource_id*) to a specific location group (:location_group_id)

62.11 Detach Backup Server Zone from Location Group

POST /settings/location_groups/:location_group_id/backup_server_groups/:backup_server_group_id/detach_resource.xmlPOST /settings/location_groups/:location_group_id/backup_server_groups/:backup_server_group_id/detach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/backup_server_groups/4/detach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/backup_server_groups/4/detach_resource.json

Returns HTTP/1.1 302 Found response on successful deletion, or HTTP 404 when a backup server zone with the ID specified is not found, or the URL requested is incorrect.

62.12 Get List of Compute Zones Attached to Location Group

GET /settings/location_groups/:location_group_id/hypervisor_groups.xmlGET /settings/location_groups/:location_group_id/hypervisor_groups.json

On success, an array of compute zones is returned.XML Output example

<hypervisor_groups type="array">

BILLING PLANS - GET THE LIST OF BILLING PLANS 815

Page 817: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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 Compute 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-04-02T16:47:37+03:00</updated_at> <max_host_free_memory type="integer">3819</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> ...</hypervisor_groups>

Explanation of the data returned:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfederation_enabled - not relevant to compute zonesfederation_id - not relevant to compute zonesclosed - not relevant to compute zonestraded - true, if the zone came from the Federation and was subscribed to by the userupdated_at - the date when the compute zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdefault_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 gatewayvlan - address of a VLAN the default gateway is located on. id - the compute zone IDlabel* - title of a compute zonelocation_group_id - ID of a location group the compute zone is assigned to

BILLING PLANS - GET THE LIST OF BILLING PLANS 816

Page 818: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

max_vms_start_at_once - the maximum number of virtual servers that can be started simultaneously within this compute zonenetwork_failure - true, if all compute resources in the compute zone failedprefer_local_reads - set 1 to minimize 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.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

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

BILLING PLANS - GET THE LIST OF BILLING PLANS 817

Page 819: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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

62.13 Get List of Data Store Zones Attached to Location Group

GET /settings/location_groups/:location_group_id/data_store_groups.xmlGET /settings/location_groups/:location_group_id/data_store_groups.json

On success, the array of data store zones is returned.XML Output example

<data_store_group> <closed type="boolean">false</closed> <created_at type="datetime">2013-06-10T15:09:58+03:00</created_at> <federation_enabled type="boolean">false</federation_enabled> <federation_id nil="true"/> <hypervisor_id nil="true"/> <id type="integer">86</id> <identifier nil="true"/> <label>DSZ</label> <location_group_id nil="true"/> <traded type="boolean">false</traded> <updated_at type="datetime">2013-06-10T15:09:58+03:00</updated_at> <default_burst_iops type="integer">15000</default_burst_iops> <default_max_iops type="integer">15000</default_max_iops> <min_disk_size type="integer">0</min_disk_size> </data_store_group>

Explanation of the data returned:closed - not relevant to datastore zonescreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 818

Page 820: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

federation_enabled - not relevant to datastore zonesfederation_id - not relevant to datastore zoneshypervisor_id - ID of the compute resource the data store zone is attached toid - the data store zone IDidentifier - identifier of the data store zonelabel - the data store zone titlelocation_group_id - ID of a location group the data store zone is assigned totraded - true, if the zone came from the Federation and was subscribed to by the userupdated_at - the date when the Data store zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatSolidFire related parameters:default_burst_iops - the default peak IOPS valuedefault_max_iops - the default maximum IOPS value for the data store zonemin_disk_size - minimum disk size for the data store zone

62.14 Get List of Network Zones Attached to Location Group

GET /settings/location_groups/:location_group_id/network_groups.xmlGET /settings/location_groups/:location_group_id/network_groups.json

On success, an array of network zones is returned.XML Output example

<network_groups type="array"> <network_group> <closed type="boolean">false</closed> <created_at type="datetime">2013-09-04T12:51:11+03:00</created_at> <federation_enabled type="boolean">false</federation_enabled> <federation_id nil="true"/> <hypervisor_id nil="true"/> <id type="integer">5</id> <identifier nil="true"/> <label>Network Zone 1</label> <location_group_id type="integer">1</location_group_id> <traded type="boolean">false</traded> <updated_at type="datetime">2014-08-11T12:06:11+03:00</updated_at> </network_group>

BILLING PLANS - GET THE LIST OF BILLING PLANS 819

Page 821: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

...</network_groups>

Explanation of the data returned:federation_enabled - not relevant to network zonesfederation_id - not relevant to network zonesclosed - not relevant to network zonestraded - true, if the zone came from the Federation and was subscribed to by the userlabel - the network zone titlelocation_group_id - ID of a location group the network zone is assigned tocreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the Network zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the network zone IDvlan - the VLAN this network zone belongs to

62.15 Get List of Backup Server Zones Attached to Location Group

GET /settings/location_groups/:location_group_id/backup_server_groups.xmlGET /settings/location_groups/:location_group_id/backup_server_groups.json

On success, an array of backup server zones is returned.XML Output example

<backup_server_groups><backup_server_group> <created_at type="datetime">2013-06-10T15:10:52+03:00</created_at> <id type="integer">6</id> <label>BSZ</label> <location_group_id nil="true"/> <updated_at type="datetime">2013-07-08T18:45:37+03:00</updated_at></backup_server_group></backup_server_groups>

Explanation of the data returned:label – backup server zone titlelocation_group_id - ID of a location group the backup server zone is assigned toid – backup server zone ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 820

Page 822: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

62.16 Attach CDN Location to Location Group

POST /settings/location_groups/:location_group_id/cdn_locations/attach_resource.xmlPOST /settings/location_groups/:location_group_id/cdn_locations/attach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<attach_resource_id>1</attach_resource_id>' --url http://onapp.test/settings/location_groups/1/cdn_locations/attach_resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"attach_resource_id":"4"}' --url http://onapp.test/settings/location_groups/1/cdn_locations/attach_resource.json

This request attaches a particular CDN location (attach_resource_id*) to a specific location group (:location_group_id)

62.17 Detach CDN Location from Location Group

POST /settings/location_groups/:location_group_id/cdn_locations/:cdn_location_id/detach_resource.xmlPOST /settings/location_groups/:location_group_id/cdn_locations/:cdn_location_id/detach_resource.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/cdn_locations/4/detach_

BILLING PLANS - GET THE LIST OF BILLING PLANS 821

Page 823: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

resource.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '' --url http://onapp.test/settings/location_groups/1/cdn_locations/4/detach_resource.json

Returns HTTP 204 response on successful deletion, or HTTP 404 when a CDN location with the ID specified is not found, or the URL requested is incorrect.

62.18 Get List of CDN LocationsTo get an array of CDN locations set up within your cloud, use the following request:GET /settings/cdn_locations.xmlGET /settings/cdn_locations.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><cdn_locations type="array"> <cdn_location> <city>Mexicali</city> <country>Mexico</country> <created_at type="datetime">2014-09-22T16:30:36+03:00</created_at> <id type="integer">1</id> <location_group_id type="integer">1</location_group_id> <updated_at type="datetime">2014-09-23T16:46:35+03:00</updated_at> <cdn_reference type="integer">331</cdn_reference> </cdn_location> </cdn_locations>

Where:city - the CDN location citycountry - the CDN location countrycreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the CDN location IDupdated_at - the date when the location group was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcdn_reference - the location ID in OnApp Dashboard

BILLING PLANS - GET THE LIST OF BILLING PLANS 822

Page 824: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

location_group_id - the ID of the location group to which this CDN location is attached

62.19 Get List of CDN Locations for Location Group

To get an array of CDN locations set up within your cloud for a particular Location group, use the following request:GET /settings/location_groups/location_group_id/cdn_locations.xmlGET /settings/location_groups/location_group_id/cdn_locations.json

XML Output example

Server: Apache/2.2.15 (CentOS)X-UA-Compatible: IE=Edge,chrome=1ETag: "2fed9ea2099e3dda286610d9197cedc3"Cache-Control: must-revalidate, private, max-age=0X-Request-Id: 2673aaf0dcffdbc583bc688f40186675X-Runtime: 0.129537X-Rack-Cache: missX-Powered-By: Phusion Passenger 4.0.35Set-Cookie: _session_id=5813abb313cf4219a6c0fcf3db9f4dc6; path=/; HttpOnlyStatus: 200 OKConnection: closeTransfer-Encoding: chunkedContent-Type: application/json; charset=utf-8<cdn_locations type="array"><cdn_location><city>Mexicali</city><country>Mexico</country><created_at type="datetime">2014-09-22T16:30:36+03:00</created_at><id type="integer">1</id><location_group_id type="integer">1</location_group_id><updated_at type="datetime">2014-09-23T16:46:35+03:00</updated_at><cdn_reference type="integer">331</cdn_reference></cdn_location></cdn_locations>

Where:city - the CDN location citycountry - the CDN location countrycreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 823

Page 825: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

id - the CDN location IDupdated_at - the date when the location group was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcdn_reference - the location ID in OnApp Dashboard

BILLING PLANS - GET THE LIST OF BILLING PLANS 824

Page 826: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

63 LOGS

OnApp logs all cloud management actions that take place on cloud resources, including virtual servers, disks, data stores, compute resources, templates and networks, as well as alerts and notifications.

Currently the following behavior is implemented in OnApp for VS log item lists:

GET /virtual_machines/:id/logs.xml and GET /virtual_machines/:id/logs.json requests return the last 10 transactions.

GET /virtual_machines/:id/logs.xml/page/2 and GET /virtual_machines/:id/logs.json/page/2 requests return the next 10 transactions.

Use the GET /virtual_machines/:id/logs.xml/per_page/20 and GET /virtual_machines/:id/logs.json/per_page/20 requests to change count of returned transactions.

63.1 Get List of Log ItemsGET /logs.xmlGET /logs.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><log_items type="array"><log_item><created_at type="datetime">2011-07-25T15:26:44+07:00</created_at><target_id type="integer">22386</target_id><updated_at type="datetime">2011-07-25T15:26:44+07:00</updated_at><id type="integer">22903</id><target_type>Transaction</target_type><status>Complete</status><action>RebootVirtualMachine</action></log_item>...<log_item></log_item>...</log_items>

Where:created_at – time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – log item ID

BILLING PLANS - GET THE LIST OF BILLING PLANS 825

Page 827: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

target_id – ID of the transaction (item in the transaction list. See Get List of Transactions for details)target_type – type of log item (either Transaction or Alert).action - the action namestatus - the action status (Complete, Warn, Pending, or Failed)

63.2 Get Log Item DetailsGET /logs/:id.xmlGET /logs/:id.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><log_item><created_at type="datetime">2011-07-25T15:26:44+07:00</created_at><target_id type="integer">22386</target_id><updated_at type="datetime">2011-07-25T15:26:44+07:00</updated_at><id type="integer">22903</id><target_type>Transaction</target_type><status>Complete</status><action>RebootVirtualMachine</action></log_item>

For details refer to Get List of Log Items section.

63.3 Get List of VS Log ItemsTo view the list of log items for a virtual server, use the following request:GET /virtual_machines/:id/logs.xmlGET /virtual_machines/:id/logs.jsonXML Request example:

curl -i -X GET -u 'user:userpass' --url http://onapp.test/virtual_machines/:id/logs.xml

JSON Request example:

curl -i -X GET -u 'user:userpass' --url http://onapp.test/virtual_machines/:id/logs.json

Where:id - the ID of the virtual server

BILLING PLANS - GET THE LIST OF BILLING PLANS 826

Page 828: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example:

<log_items type="array"> <log_item> <action>DestroyBackup</action> <created_at type="datetime">2015-03-10T13:34:20+02:00</created_at> <id type="integer">127772</id> <status>Complete</status> <target_id type="integer">100347</target_id> <target_type>Transaction</target_type> <updated_at type="datetime">2015-03-10T13:34:20+02:00</updated_at> </log_item> <log_item>...</log_item></log_items>

Where:action - the action namecreated_at - time in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - log item IDstatus - the action status (Complete, Warn, Pending, or Failed)target_id - ID of the transaction (item in the transaction list. See Get List of Transactions for details)target_type - type of log item: either Transaction or Alertupdated_at - time in the [YYYY][MM][DD]T[hh][mm][ss]Z format

63.4 Get VS Log Item DetailsTo view the VS log item details, use the following request:

GET /virtual_machines/:id/logs/:log_id.xml

GET /virtual_machines/:id/logs/:log_id.json

XML Request example:

curl -i -X GET -u 'user:userpass' --url http://onapp.test/virtual_machines/:id/logs/:log_id.xml

JSON Request example:

curl -i -X GET -u 'user:userpass' --url http://onapp.test/virtual_machines/:id/logs/:log_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 827

Page 829: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:id - the ID of the virtual server

log_id - log item ID

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><log_item> <action>DestroyBackup</action> <created_at type="datetime">2015-03-10T13:34:20+02:00</created_at> <id type="integer">127772</id> <status>Complete</status> <target_id type="integer">100347</target_id> <target_type>Transaction</target_type> <updated_at type="datetime">2015-03-10T13:34:20+02:00</updated_at></log_item>

Where:action - the action name

created_at - time in the [YYYY][MM][DD]T[hh][mm][ss]Z format

id - log item ID

status - the action status (Complete, Warn, Pending, or Failed)

target_id - ID of the transaction (item in the transaction list. See Get List of Transactions for details)

target_type - type of log item: either Transaction or Alert

updated_at - time in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 828

Page 830: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

64 MY TEMPLATE GROUPS

My Template Groups is the class that organizes all custom templates of the user into separate groups. Each template group can be associated with specific licensing type for Windows based templates. The user can only access and manage his own template groups.

64.1 Get My Template Groups ListTo view the list of your template groups, use the following request:GET /image_template_groups/own.xmlGET /image_template_groups/own.jsonXML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/image_template_groups/own.xml

JSON Request example:

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/image_template_groups/own.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_template_groups type="array"> <image_template_group> <id type="integer">48</id> <label>new</label> <parent_id nil="true"/> <lft type="integer">49</lft> <rgt type="integer">52</rgt> <depth type="integer">0</depth> <mak type="boolean">false</mak> <own type="boolean">false</own> <kms type="boolean">false</kms> <kms_server_label></kms_server_label> <kms_host></kms_host> <kms_port></kms_port> <created_at type="datetime">2014-04-25T11:36:36+00:00</created_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 829

Page 831: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<updated_at type="datetime">2014-04-25T11:36:36+00:00</updated_at> <system_group type="boolean">false</system_group> <hypervisor_group_id nil="true"/> <user_id type="integer">2508</user_id> <children type="array"> <child> <id type="integer">49</id> <label>child</label> <parent_id type="integer">48</parent_id> <lft type="integer">50</lft> <rgt type="integer">51</rgt> <depth type="integer">1</depth> <mak type="boolean">false</mak> <own type="boolean">true</own> <kms type="boolean">true</kms> <kms_server_label>serverlabel</kms_server_label> <kms_host>server.host</kms_host> <kms_port>2</kms_port> <created_at type="datetime">2014-04-25T11:43:56+00:00</created_at> <updated_at type="datetime">2014-04-25T12:08:26+00:00</updated_at> <system_group type="boolean">false</system_group> <hypervisor_group_id nil="true"/> <user_id type="integer">2508</user_id> <children type="array"/> <relations type="array"> <relation> <id type="integer">944</id> <template_id type="integer">1043</template_id> <image_template_group_id type="integer">49</image_template_group_id> <price type="decimal">0.0</price> <created_at type="datetime">2014-04-25T12:07:43+00:00</created_at> <updated_at type="datetime">2014-04-25T12:07:43+00:00</updated_at> <image_template> <id type="integer">1043</id> <label>win_custom_template</label> <created_at type="datetime">2014-04-15T15:21:15+00:00</created_at> <updated_at type="datetime">2014-04-15T15:36:37+00:00</updated_at> <version>3.2</version> <file_name>m3xp52x2yog50g_20140415182115</file_name> <operating_system>windows</operating_system>

BILLING PLANS - GET THE LIST OF BILLING PLANS 830

Page 832: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<operating_system_distro>2008</operating_system_distro> <allowed_swap type="boolean">false</allowed_swap> <state>active</state> <checksum>1f6e8532a3b914be5d02e5ed178396a1</checksum> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <min_disk_size type="integer">20</min_disk_size> <user_id type="integer">2508</user_id> <template_size type="integer">16131528</template_size> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <operating_system_arch>x64</operating_system_arch> <operating_system_edition>STD</operating_system_edition> <operating_system_tail>R2</operating_system_tail> <parent_template_id type="integer">36</parent_template_id> <virtualization>xen</virtualization> <min_memory_size type="integer">1024</min_memory_size> <disk_target_device>---xen: hdkvm: hd

</disk_target_device> <cdn type="boolean">false</cdn> <backup_server_id type="integer">2</backup_server_id> <ext4 type="boolean">false</ext4> <smart_server type="boolean">false</smart_server> <baremetal_server type="boolean">false</baremetal_server> <initial_password nil="true"/> <initial_username nil="true"/> <remote_id nil="true"/> <manager_id nil="true"/> </image_template> </relation> </relations> </child> </children> <relations type="array"/> </image_template_group></image_template_groups>

Where:image_template_group – the array with the template group detailsid – the ID of this template grouplabel – the name of the template groupparent_id – the ID of the parent group. Applicable to child groups only

BILLING PLANS - GET THE LIST OF BILLING PLANS 831

Page 833: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

lft - left nested set identifierrgt - right nested set identifierdepth - the depth of a given node (distance from this template group to the root)mak – MAK windows licensing typeown – user’s own license for Windows licensingkms – KMS windows licensing typekms_server_label – name of the KMS licensing serverkms_host - KMS server host namekms_port – KMS server portcreated_at – time when the template group was createdupdated_at – time of the last changes to the template groupsystem_group - true for the groups created with the OnApp installation; for Template Store groups onlyuser_id – user, to whom this group belongschildren – an array of the child groupschild – an array with child group detailsid – child group IDlabel – child group nameparent_id – the ID of the group to which this child group belongsrelations – an array with templates associated with this group/childgroupid – the relation IDtemplate_id – the ID of the assigned templateimage_template_group_id – the ID of the group/childgroup, to which the above template is assignedprice – the template’s costimage_template – an array with template detailsid – the template’s IDlabel – the name of the templateversion – the file’s versionfile_name – the name of the template fileoperating_system – operating system nameoperating_system_distro – operating system distributionallowed_swap - true, if the swap is allowed, otherwise falsestate - state of the template (active, inactive)checksum – file checksumallow_resize_without_reboot – true if resize without reboot is possible; otherwise falsemin_disk_size – minimum disk size required to build a VS on this template (GB)user_id - the ID of a user who owns this templatetemplate_size - the size of the templateallowed_hot_migrate - true, if the hot migration is allowed, otherwise falseoperating_system_arch – architecture of the operating systemoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – the ID of the template from which this custom template originatesvirtualization – virtualization type which is compatible with this templatemin_memory_size – minimal required RAM for the template

BILLING PLANS - GET THE LIST OF BILLING PLANS 832

Page 834: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

disk_target_device - the prefix indicating the method of translating the disk to a VS by compute resourcecdn - true if this template can be used for building edge servers, otherwise falsebackup_server_id - the ID of the backup server where the template is storedext4 - true if ext4 file system is supportedsmart_server - true if the smart server can be built from this templatebaremetal_server - true if the baremetal server can be built from this templateinitial_password - preset the password for the VS built on this templateinitial_username - preset the username for the VS built on this templateremote_id - ID of the template, if it came from the marketmanager_id - ID of the template on the template server

64.2 Get My Template Group DetailsTo get details of a particular template group, use the following request:GET /settings/image_template_groups/:image_template_group_id.xmlGET /settings/image_template_groups/:image_template_group_id.jsonXML Request example:

curl -i -X GET -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id.json

XML Output example

<image_template_group> <id type="integer">57</id> <label>another</label> <parent_id nil="true"/> <lft type="integer">61</lft> <rgt type="integer">62</rgt> <depth type="integer">0</depth> <mak type="boolean">false</mak> <own type="boolean">false</own> <kms type="boolean">false</kms> <kms_server_label></kms_server_label>

BILLING PLANS - GET THE LIST OF BILLING PLANS 833

Page 835: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<kms_host></kms_host> <kms_port></kms_port> <created_at type="datetime">2014-04-25T14:40:23+00:00</created_at> <updated_at type="datetime">2014-04-25T14:40:42+00:00</updated_at> <system_group type="boolean">false</system_group> <hypervisor_group_id nil="true"/> <user_id type="integer">2508</user_id> <children type="array"/> <relations type="array"/> </image_template_group>

Where:image_template_group – the array with the template group detailsid – the ID of this template grouplabel – the name of the template groupparent_id – the ID of the parent group. Applicable to child groups onlylft - left nested set identifierrgt - right nested set identifierdepth - the depth of a given node (distance from this template group to the root)mak – MAK windows licensing typeown – user’s own license for Windows licensingkms – KMS windows licensing typekms_server_label – name of the KMS licensing serverkms_host - KMS server host namekms_port – KMS server portcreated_at – time when the template group was createdupdated_at – time of the last changes to the template groupsystem_group - true for the groups created with the OnApp installation; for Template Store groups only hypervisor_group_id - compute zone IDuser_id – user, to whom this group belongschildren – an array of the child groups

64.3 Add My Template GroupTo add a template group, use the following request:POST /settings/image_template_groups.xmlPOST /settings/image_template_groups.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 834

Page 836: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'<image_template_group><user_id>2</user_id><label>zaza</label><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>wqqsasawqw</kms_server_label></image_template_group>' --urlhttp://onapp.test/settings/image_template_groups.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d '{"image_template_group":{"user_id":"2", "label":"zaza", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --urlhttp://onapp.test/settings/image_template_groups.json

Where:label * – the name of the template groupmak – MAK windows licensing typeown – user’s own license for Windows licensingkms – KMS Windows licensing typekms_server_label – name of the KMS licensing server; required parameter if the KMS licensing type was selectedkms_host - KMS server hostname; required parameter if the KMS licensing type was selectedkms_port – KMS server port; required parameter if the KMS licensing type was selecteduser_id * – user, to whom this group belongsReturns 201 HTTP response on success

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_template_group> <created_at type="datetime">2012-07-13T03:55:21-10:00</created_at> <depth type="integer">0</depth> <id type="integer">106</id> <kms type="boolean">true</kms> <kms_host>ededde.fe</kms_host> <kms_port>5453</kms_port> <kms_server_label>wqqsasawqw</kms_server_label> <label>zaza</label> <lft type="integer">85</lft> <mak type="boolean">true</mak> <own type="boolean">false</own> <parent_id nil="true"></parent_id> <rgt type="integer">86</rgt> <updated_at type="datetime">2012-07-13T03:55:21-10:00</updated_at> <system_group type="boolean">false</system_group>

BILLING PLANS - GET THE LIST OF BILLING PLANS 835

Page 837: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<hypervisor_group_id nil="true"/> <user_id type="integer">2508</user_id> <children type="array"/> <relations type="array"/></image_template_group>

64.4 Add Child Group.XML Request example:

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password -d '<image_template_group><user_id>2</user_id><label>zaza</label><parent_id>50</parent_id><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>enother</kms_server_label></image_template_group>' --urlhttp://onapp.test/settings/image_template_groups.xml

JSON Request example:

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d '{"image_template_group":{"user_id":"2", "label":"zaza_ch1", "parent_id":"51", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --urlhttp://onapp.test/settings/image_template_groups.json

Where:label * – the name of the child template groupmak – MAK windows licensing typeown – user’s own license for Windows licensingkms – KMS Windows licensing typekms_server_label – name of the KMS licensing server; required parameter if the the KMS licensing type was selectedkms_host - KMS server host name; required parameter if the the KMS licensing type was selectedkms_port – KMS server port; required parameter if the the KMS licensing type was selected

BILLING PLANS - GET THE LIST OF BILLING PLANS 836

Page 838: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_id * – user, to whom this group belongsparent_id * – the ID of the parent template group

XML Response example

HTTP/1.1 201 Created

Date: Fri, 13 Jul 2012 13:19:41 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1ETag: "6bb2b9cec5a8bd44242ebd0217ac8da5"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: eb23f46901cecec2a898a6e50454196dX-Runtime: 0.142129X-Rack-Cache: invalidate, passSet-Cookie: _session_id=b5979762702346b086aa13538e60c2e4; path=/; HttpOnlyLocation: http://83.170.110.181/settings/image_template_groups/104Status: 201Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8

To edit or delete a child group, use the same requests as for template groups.

64.5 Edit My Template GroupTo edit details of a template group:PUT /settings/image_template_groups/:id.xmlPUT /settings/image_template_groups/:id.json XML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<image_template_group><label>zaza</label><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>wqqdwwqw</kms_server_label></image_template_group>' --url http://onapp.test/settings/image_template_groups/:id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 837

Page 839: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"image_template_group":{"label":"zaza", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --url http://onapp.test/settings/image_template_groups/100.json

Where you can edit the following parameters:label – the group namekms_host – KMS server host namekms_port – KMS server portkms_server_label – KMS server namemak - MAK windows licensing typeown - user's own license

XML Response example

HTTP/1.1 204 OKDate: Tue, 28 Feb 2012 11:55:53 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.1X-UA-Compatible: IE=Edge,chrome=1X-Runtime: 0.122994Cache-Control: no-cacheSet-Cookie: _session_id=6596bf326a9a8569ba51d7e8048b28be; path=/; HttpOnlyStatus: 204Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8Delete Template Group

64.6 Delete My Template GroupDELETE /settings/image_template_groups/:id.xmlDELETE /settings/image_template_groups/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 838

Page 840: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/image_template_groups/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/image_template_groups/:id.xml

64.7 Get List of Templates Attached to Group.

To see the list of attached templates, use this request:GET /settings/image_template_groups/:image_template_group_id/relation_group_templates.xmlGET /settings/image_template_groups/:image_template_group_id/relation_group_templates.jsonXML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.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/image_template_groups/105/relation_group_templates.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><relation_group_templates type="array"> <relation_group_template> <created_at type="datetime">2014-04-25T12:07:43+00:00</created_at> <id type="integer">944</id> <image_template_group_id type="integer">49</image_template_group_id> <price type="decimal">0.0</price>

BILLING PLANS - GET THE LIST OF BILLING PLANS 839

Page 841: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<template_id type="integer">1043</template_id> <updated_at type="datetime">2014-04-25T12:07:43+00:00</updated_at> <image_template> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">false</allowed_swap> <backup_server_id type="integer">2</backup_server_id> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum>1f6e8532a3b914be5d02e5ed178396a1</checksum> <created_at type="datetime">2014-04-15T15:21:15+00:00</created_at> <disk_target_device>---xen: hdkvm: hd</disk_target_device> <ext4 type="boolean">false</ext4> <file_name>m3xp52x2yog50g_20140415182115</file_name> <id type="integer">1043</id> <initial_password>Password1</initial_password> <initial_username>Administrator</initial_username> <label>win_custom_template</label> <manager_id nil="true"/> <min_disk_size type="integer">20</min_disk_size> <min_memory_size type="integer">1024</min_memory_size> <operating_system>windows</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>2008</operating_system_distro> <operating_system_edition>STD</operating_system_edition> <operating_system_tail>R2</operating_system_tail> <parent_template_id type="integer">36</parent_template_id> <remote_id nil="true"/> <smart_server type="boolean">false</smart_server> <state>active</state> <template_size type="integer">16131528</template_size> <updated_at type="datetime">2014-04-15T15:36:37+00:00</updated_at> <user_id type="integer">2508</user_id> <version>3.2</version> <virtualization>xen</virtualization> </image_template> </relation_group_template></relation_group_templates>

BILLING PLANS - GET THE LIST OF BILLING PLANS 840

Page 842: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:relations – the array of templates associated with this group/childgroupid – the relation IDtemplate_id – the ID of the assigned templateimage_template_group_id – the ID of the group/childgroup, to which the above template is assignedprice – the template’s costimage_template – the array with template detailsid – the template’s IDlabel – the name of the templateversion – the file’s versionfile_name – the name of the template fileoperating_system – operating system nameoperating_system_distro – operating system distributionallowed_swap - true, if the swap is allowed, otherwise falsestate - state of the template (active, inactive)checksum – file checksumallow_resize_without_reboot – true if resize without reboot is possible; otherwise falsemin_disk_size – minimum disk size required to build a VS on this template (GB)user_id - the ID of a user who owns this templatetemplate_size - the size of the templateallowed_hot_migrate - true, if the hot migration is allowed, otherwise falseoperating_system_arch – architecture of the operating systemoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – the ID of the template from which this custom templarte originatesvirtualization – virtualization type which is compatible with this templatemin_memory_size – minimal required RAM for the templatedisk_target_device - the prefix indicating the method of translating the disk to a VS by compute resourcecdn - true if this template can be used for building edge servers, otherwise falsebackup_server_id - the ID of the backup server where the template is storedext4 - true if ext4 file system is supportedsmart_server- true if the smart server can be built from this templatebaremetal_server - true if the baremetal server can be built from this templateinitial_password - preset the password for the VS built on this templateinitial_username - preset the username for the VS built on this templateremote_id - ID of the template, if it came from the marketmanager_id - ID of the template on the template server

BILLING PLANS - GET THE LIST OF BILLING PLANS 841

Page 843: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

64.8 Attach Template to Group.To attach a template to a group, use the following request:POST /settings/image_template_groups/:image_template_group_id/relation_group_templates.xmlPOST /settings/image_template_groups/:image_template_group_id/relation_group_templates.json XML Request example:

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<relation_group_template><template_id>26</template_id></relation_group_template>' --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.xml

JSON Request example:

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"relation_group_template":{"template_id":"26"}}' --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.json

Where:template_id - is the ID of the template you want to attach

Returns HTTP 201 response on success.

XML Response example:

HTTP/1.1 201 CreatedDate: Fri, 13 Jul 2012 13:47:11 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1ETag: "403f2b5e3b43d9de14cfc5b270bce92d"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: a305669856a4dc3fe659a6180ee8532cX-Runtime: 0.340259X-Rack-Cache: invalidate, passSet-Cookie: _session_id=02ec3365a7e219071ab840838551661d; path=/; HttpOnlyLocation:

BILLING PLANS - GET THE LIST OF BILLING PLANS 842

Page 844: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://83.170.110.181/settings/image_template_groups/105/relation_group_templates/101Status: 201Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8

64.9 Detach Template from Group.To detach a template attached to a template group: DELETE /settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.xml DELETE /settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 843

Page 845: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

65 NETWORK INTERFACES

This class represents the methods required to manage network interfaces. Network interfaces connect virtual servers with the network. You can allocate several network interfaces to a VS.

65.1 Get List of VS Network InterfacesTo get the list of network interfaces allocated to this particular VS:GET /virtual_machines/:virtual_machine_id/network_interfaces.xmlGET /virtual_machines/:virtual_machine_id/network_interfaces.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><network_interfaces type="array"><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>...<network_interface></network_interface>...</network_interfaces>

Explanation of the data returned:label - network interface namecreated_at - the timestamp in the database when this network interface was created

BILLING PLANS - GET THE LIST OF BILLING PLANS 844

Page 846: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the timestamp in the database when this network interface was updatedprimary - true if this network interface is primary, otherwise falseid - the ID of this network interfacemac_address – network interface MAC addressrate_limit - port speed in Mbpsidentifier - the identifier in the database of this network interfacenetwork_join_id - the ID of the network join to which this network interface belongsvirtual_machine_id - the ID of a virtual server to which this network interface is attached

65.2 Get Network Interface DetailsTo get a particular network interface details:GET /virtual_machines/:virtual_machine_id/network_interfaces/:id.xmlGET /virtual_machines/:virtual_machine_id/network_interfaces/:id.json This request will output details for a network interface. The explanation of the fields is the same as for Get List of VS Network Interfaces method.

65.3 Add Network Interface to VSTo add a new network interface:POST /virtual_machines/:virtual_machine_id/network_interfaces.xmlPOST /virtual_machines/:virtual_machine_id/network_interfaces.json XML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network_interface><label>qwert</label><rate_limit>64</rate_limit><network_join_id>3</network_join_id><primary>1</primary></network_interface>' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces.xml

JSON Request example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network_interface":{"label":"qwert","rate_limit":"64","network_join_id":"3", "primary":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_inter

BILLING PLANS - GET THE LIST OF BILLING PLANS 845

Page 847: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

faces.json

Where:label* - give the label of a network interface you wish to attachrate_limit* - set the port speed of a network interface you wish to attachnetwork_join_id* - set the ID of a physical network used to attach this network interfaceprimary* – set 1 if the interface is primary. Otherwise false.

After adding the network interface, the virtual server should be power cycled for the change to take effect.

65.4 Edit Network InterfaceTo edit network interface details:PUT /virtual_machines/:virtual_machine_id/network_interfaces/:id.xmlPUT /virtual_machines/:virtual_machine_id/network_interfaces/:id.json XML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network_interface><label>eth0(test)</label><rate_limit>64</rate_limit><primary>true</primary></network_interface>' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:id.xml

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network_interface":{"label":"eth0(test 2)","rate_limit":"32","primary":"false"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:id.json

You can change rate_limit and label parameters.

65.5 Delete Network InterfaceTo delete a network interface from a virtual server:DELETE /virtual_machines/:virtual_machine_id/network_interfaces/:id.xmlDELETE /virtual_machines/:virtual_machine_id/network_interfaces/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 846

Page 848: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/virtual_machines/:virtual_machine_id/network_interfaces/:id.json

This returns an HTTP 204 response if the network interface is deleted, or HTTP 404 if the network interface with the specified ID isn't found or the requested URL is incorrect.

65.6 Get VS Network Interface Usage Statistics

To view the network interface usage statistics of a virtual server, use the following request:GET /virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_id/usage.xmlGET /virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_id/usage.json

Define a shorter period by setting Start and End time in the API call:GET /virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_id/usage.xml?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ssGET /virtual_machines/:virtual_machine_id/network_interfaces/:network_interface_id/usage.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss

XML Output example

<?xml version="1.0" encoding="UTF-8"?><net_hourly_stats type="array"> <net_hourly_stat> <created_at type="datetime">2016-01-13T14:00:21Z</created_at> <data_received type="integer">156</data_received> <data_sent type="integer">25</data_sent>

BILLING PLANS - GET THE LIST OF BILLING PLANS 847

Page 849: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<id type="integer">14510</id> <network_interface_id type="integer">952</network_interface_id> <stat_time type="datetime">2016-01-13T14:00:00Z</stat_time> <updated_at type="datetime">2016-01-13T14:00:21Z</updated_at> <user_id type="integer">7</user_id> <virtual_machine_id type="integer">690</virtual_machine_id> </net_hourly_stat> <net_hourly_stat>...</net_hourly_stat></net_hourly_stats>

Where:created_at - the timestamp in DB when the record was createddata_received - the amount of Kilobytes received by this VSdata_sent - the amount of Kilobytes sent by this VSid - the ID of the statisticsnetwork_interface_id - the ID of the network interfacestat_time - the time when statistics were generatedupdated_at - the timestamp in DB when the record was updateduser_id - the ID of the VS ownervirtual_machine_id - the ID of the VS

Use the following formula to convert network interface usage statistics data in the API output:(Sum total of Kilobytes per hour)/3600*0,008 = Mbps where 3600 = 60 minutes multiplied by 60 seconds0,008 = the coefficient to convert Kilobytes into megabits.

BILLING PLANS - GET THE LIST OF BILLING PLANS 848

Page 850: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

66 NETWORKS

The class enables you to modify network configurations. The network resources available to the entire cloud can be configured in the system Control Panel or via API. Specific network resources can be set up manually, and automatically on VS creation.

66.1 Get List of NetworksGET /settings/networks.xmlGET /settings/networks.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><networks type="array"><network><label>Public Network</label><created_at type="datetime">2011-02-11T12:46:09+02:00</created_at><network_group_id type="integer">3</network_group_id><updated_at type="datetime">2011-02-11T13:20:09+02:00</updated_at><id type="integer">1</id><vlan type="integer" nil="true"/><identifier>4ikgi2ges03kma</identifier></network></networks>

Where:created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the network IDlabel - the optional network labelupdated_at - the date when the network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatvlan - the VLAN this network belongs tonetwork_group_id - the ID of the network zone to which this network is attached

BILLING PLANS - GET THE LIST OF BILLING PLANS 849

Page 851: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

66.2 Get Network DetailsGET /settings/networks/:id.xmlGET /settings.networks/:id.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><network><label>public</label><created_at type="datetime">2010-10-28T19:55:40+07:00</created_at><updated_at type="datetime">2010-12-29T22:31:15+07:00</updated_at><network_group_id type="integer">2</network_group_id><vlan type="integer">391</vlan><id type="integer">1</id><identifier>hc9fut4iogxt7p</identifier></network>

Where:label - the optional Network labelcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the record was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatnetwork_group_id - the ID of the network zone to which this network is attachedid - the network IDvlan - the VLAN this network belongs toidentifier - network identifier

66.3 Add NetworkPOST /settings/networks.xmlPOST /settings/networks.json XML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network><label>Network API test 34</label><network_group_id>15</network_group_id><vlan>34</vlan></network>' --url http://onapp.test/settings/networks.xml

JSON Request example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network":{"label":"Network API TEST 2","network_group_id":3,"vlan":true}}' --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 850

Page 852: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/settings/networks.json

Parameters:label* - the network namevlan - the VLAN this network belongs tonetwork_group_id - the ID of the network zone to which this network is attached

66.4 Edit NetworkPUT /settings/networks/:id.xmlPUT /settings/networks/:id.json XML Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network><label>Network API test</label><network_group_id>3</network_group_id><vlan>1</vlan></network>' --url http://onapp.test/settings/networks/:id.xml

JSON Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network":{"label":"Network API TEST","network_group_id":15,"vlan":2}}' --url http://onapp.test/settings/networks/:id.json

Parameters:id – the network IDlabel - the network namevlan - the VLAN this network belongs tonetwork_group_id - the ID of the network zone to which this network is attached

66.5 Rebuild VS NetworkTo rebuild the network for a particular VS, use the following request:POST /virtual_machines/:virtual_machine_id/rebuild_network.xmlPOST /virtual_machines/:virtual_machine_id/rebuild_network.json XML Request example

curl -X POST -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 851

Page 853: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/virtual_machines/:virtual_machine_id/rebuild_network.xml?force=1&shutdown_type=hard&required_startup=1' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X POST -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/rebuild_network.json?force=1&shutdown_type=hard&required_startup=1' -H 'Accept: application/json' -H 'Content-type: application/json'

Where:virtual_machine_id - ID of the virtual server

shutdown_type - type of the VS shutdown: hard, graceful or softrequired_startup - set 1 to start up the VS automatically after build, otherwise set 0force* - set 1 to specify the VS shutdown type ("shutdown_type") and whether VS should start up automatically after the reboot ("required_startup").

PLEASE NOTE: If the force reboot option is enabled, the system tries to enter the virtual server. Then, if the transaction fails, the virtual server will be rebooted. In case the force reboot option is disabled and system can not enter the virtual server, the network rebuild operation will fail.

66.6 Delete NetworkDELETE /settings/networks/:id.xmlDELETE /settings/networks/:id.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/networks/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/networks/:id.json

Where you have to specify ID of a network you want to delete.

BILLING PLANS - GET THE LIST OF BILLING PLANS 852

Page 854: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

67 NETWORK ZONES

A network zone consists of several networks sharing the same permissions and assigned to the same billing plan. Network zones can be attached to compute zones, enabling you to create different tiers of service within your cloud. All API calls are available to this class.

67.1 Get List of Network ZonesThis method lists an array of all the network zones available in your cloud.GET /settings/network_zones.xmlGET /settings/network_zones.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><network-groups type="array"><network-group><label>net_p</label><location_group_id type="integer">1</location_group_id><preconfigured_only type="boolean">true</preconfigured_only><created_at type="datetime">2011-01-06T11:18:45Z</created_at><updated_at type="datetime">2011-01-06T11:18:45Z</updated_at><id type="integer">3</id></network-group>

Where: label - the network zone titlelocation_group_id - ID of a location group the network zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the Network zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the network zone ID

67.1.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

BILLING PLANS - GET THE LIST OF BILLING PLANS 853

Page 855: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Added the location_group_id parameter

67.2 Get Network Zone DetailsTo get a particular network zone details:GET /settings/network_zones/:id.xmlGET /settings/network_zones/:id.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><network-group><label>network_zone</label><location_group_id type="integer">1</location_group_id><preconfigured_only type="boolean">true</preconfigured_only><created_at type="datetime">2011-01-06T11:18:45Z</created_at><updated_at type="datetime">2011-01-06T11:18:45Z</updated_at><id type="integer">8</id></network-group>

Where:label - the network zone titlelocation_group_id - ID of a location group the network zone is assigned topreconfigured_only - whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the Network zone was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - the network zone ID

67.2.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

BILLING PLANS - GET THE LIST OF BILLING PLANS 854

Page 856: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

67.3 Add Network ZoneYou can add a new network zone using the following method:POST /settings/network_zones.xmlPOST /settings/network_zones.json XML Request example

curl -i -X POST http://onapp.test/settings/network_zones.xml -d '<?xml version="1.0" encoding="UTF-8"?><network_group><label>TEST_XML</label><location_group_id>1</location_group_id><preconfigured_only>true</preconfigured_only></network_group>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST http://onapp.test/settings/network_zones.json -d '{"network_group":{"label":"TEST_JSON","location_group_id":"1","preconfigured_only":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - is new data_store_zone titlelocation_group_id - ID of a location group you wish to assign the network zone topreconfigured_only - specify whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

67.3.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

67.4 Edit Network ZoneYou can edit a label and an ID of a particular network zone using the PUT method:

BILLING PLANS - GET THE LIST OF BILLING PLANS 855

Page 857: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /settings/network_zones/:id.xmlPUT /settings/network_zones/:id.json XML Request example

curl -i -X PUT http://onapp.test/settings/network_zones/:id.xml -d '<network_group><label>Network_Name</label><location_group_id>1</location_group_id><preconfigured_only>true</preconfigured_only></network_group>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT http://onapp.test/settings/network_zones/:id.json -d '{"network_group": {"label":"Network_name","location_group_id":"1","preconfigured_only":"true"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - is new data_store_zone titlelocation_group_id - ID of a location group you wish to assign the network zone to. You can change the already assigned location only if there are no network joins, IP addresses or name servers within networks in this zone.preconfigured_only - specify whether the zone can be used for creating Instance Package VSs only.When this option is enabled, the zone cannot be used during custom virtual server (VSs built by setting resources manually) creation.

67.4.1 Page historyv. 4.2:

preconfigured_only

v. 3.1:

Added the location_group_id parameter

67.5 Delete Network ZoneTo delete a network zone, use the following API call:DELETE /settings/network_zones/:id.xmlDELETE /settings/network_zones/:id.json XML Request example

curl -X DELETE http://onapp.test/settings/network_zones/:id.xml -u

BILLING PLANS - GET THE LIST OF BILLING PLANS 856

Page 858: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X DELETE http://onapp.test/settings/network_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 network zone with a requested ID or you entered incorrect URL.

67.6 Attach Network to Network ZonePOST /settings/network_zones/:network_zone_id/networks/:id/attach.xmlPOST /settings/network_zones/:network_zone_id/networks/:id/attach.json XML Request example

curl -X POST http://onapp.test/settings/network_zones/:network_zone_id/networks/:network_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/network_zones/:network_zone_id/networks/:network_id/attach.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

This request attaches network (:network_id *) to a network zone (:network_zone_id *)

Network zone must contain only one network type - either usual networks, or VMware customer networks.

BILLING PLANS - GET THE LIST OF BILLING PLANS 857

Page 859: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

67.7 Remove Network from Network ZonePOST /settings/network_zones/:network_zone_id/networks/:id/detach.xmlPOST /settings/network_zones/:network_zone_id/networks/:id/detach.json XML Request example

curl -X POST http://onapp.test/settings/network_zones/:network_zone_id/networks/:network_id/detach.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X POST http://onapp.test/settings/network_zones/:network_zone_id/networks/:network_id/detach.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 858

Page 860: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

68 ONAPP ENGINE

OnApp engine starts/stops/reloads/checks status of all background tasks that run in the system.

68.1 Get OnApp Engine StatusTo get OnApp Engine status:GET /sysadmin_tools/daemon/status.xmlGET /sysadmin_tools/daemon/status.json XML Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/status.xml

JSON Request example:

curl -i -X GET -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/status.json

To get the status of the OnApp Engine on a particular node, add the node's IP as a parameter. This request applies to clouds with High Availability enabled.XML Request example:

curl -i -X GET -u 'user:userpass' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/status.xml -d '<node>199.169.1.203</node>'

JSON Request example:

curl -i -X GET -u 'user:userpass' -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/status.json -d '{"node": "199.169.1.203"}'

XML Response example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 859

Page 861: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?xml version="1.0" encoding="UTF-8"?><daemon><status>Online</status><ip>138.0.0.2</ip></daemon>

Where:status - OnApp Engine status: Online or Offlineip - IP address of the node on which the OnApp engine is running

68.2 Start OnApp EngineTo start OnApp engine, run the following command:POST /sysadmin_tools/daemon/start.xmlPOST /sysadmin_tools/daemon/start.json XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/start.xml

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/start.json

To start the OnApp Engine on a particular node add the node's IP as a parameter. This request applies to clouds with High Availability enabled.XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/start.xml -d '<node>199.169.1.203</node>'

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/start.json -d '{"node": "199.169.1.203"}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 860

Page 862: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

68.3 Stop OnApp EngineTo stop OnApp engine:POST /sysadmin_tools/daemon/stop.xmlPOST /sysadmin_tools/daemon/stop.json XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/stop.xml

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/stop.json

To stop the OnApp Engine on a particular node add the node's IP as a parameter. This request applies to clouds with High Availability enabled.XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/stop.xml -d '<node>199.169.1.203</node>'

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/stop.json -d '{"node": "199.169.1.203"}'

68.4 Reload OnApp EngineTo reload a background task daemon:POST /sysadmin_tools/daemon/reload.xmlPOST /sysadmin_tools/daemon/reload.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 861

Page 863: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/reload.xml

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/reload.json

To reload the OnApp Engine on a particular node add the node's IP as a parameter. This request applies to clouds with High Availability enabled.XML Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/sysadmin_tools/daemon/reload.xml -d '<node>199.169.1.203</node>'

JSON Request example:

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/sysadmin_tools/daemon/reload.json -d '{"node": "199.169.1.203"}'

BILLING PLANS - GET THE LIST OF BILLING PLANS 862

Page 864: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

69 ORCHESTRATION MODELS

This section provides the API calls you can use to manage the orchestration models imported from your vCloud.

69.1 Get List of Orchestration ModelsTo get the list of orchestration models, use the following request:GET /vcloud/templates.xmlGET /vcloud/templates.jsonXML Request example:

curl -i -X GET http://onapp.test/vcloud/templates.xml -u user:userpass

JSON Request example:

curl -i -X GET http://onapp.test/vcloud/templates.json -u user:userpass

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><vcloud_templates type="array"> <vcloud_template> <cpu_allocation_customizable type="boolean">true</cpu_allocation_customizable> <cpu_allocation_default type="integer">1</cpu_allocation_default> <cpu_allocation_max type="integer">12</cpu_allocation_max> <cpu_allocation_min type="integer">1</cpu_allocation_min> <cpu_allocation_visible type="boolean">true</cpu_allocation_visible> <cpu_guaranteed_customizable type="boolean">true</cpu_guaranteed_customizable> <cpu_guaranteed_default type="integer">10</cpu_guaranteed_default> <cpu_guaranteed_max type="integer">100</cpu_guaranteed_max> <cpu_guaranteed_min type="integer">1</cpu_guaranteed_min> <cpu_guaranteed_visible type="boolean">true</cpu_guaranteed_visible> <cpu_quota_customizable

BILLING PLANS - GET THE LIST OF BILLING PLANS 863

Page 865: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="boolean">false</cpu_quota_customizable> <cpu_quota_default nil="true"/> <cpu_quota_max nil="true"/> <cpu_quota_min nil="true"/> <cpu_quota_visible type="boolean">false</cpu_quota_visible> <create_networks type="boolean">true</create_networks> <created_at type="datetime">2016-04-20T14:45:06+03:00</created_at> <data_stores_to_create type="array"> <active_support_hash_with_indifferent_access> <label>* for vCD 8</label> <id>83a2105b-47f1-4f21-a9de-43cfad2a82bd</id> <min type="integer">0</min> <max type="integer">999999</max> <default type="integer">100</default> <data_store_visible type="boolean">true</data_store_visible> <data_store_customizable type="boolean">true</data_store_customizable> <use_it type="boolean">true</use_it> </active_support_hash_with_indifferent_access> <active_support_hash_with_indifferent_access>...</active_support_hash_with_indifferent_access> </data_stores_to_create> <default_network_pool>131cfd1d-97dd-4531-96cf-ce2dc2ac426f</default_network_pool> <deploy_edge_gateway type="boolean">true</deploy_edge_gateway> <edge_gateway_name>MyEdgeGateway</edge_gateway_name> <edge_gateway_network_id nil="true"/> <edge_gateway_uplink_network_id type="integer">466</edge_gateway_uplink_network_id> <enable_fast_provisioning type="boolean">true</enable_fast_provisioning> <enable_thin_provisioning type="boolean">false</enable_thin_provisioning> <hypervisor_id type="integer">24</hypervisor_id> <id type="integer">1</id> <label>slkdjfhklsdhlf</label> <memory_customizable type="boolean">true</memory_customizable> <memory_default type="integer">8</memory_default> <memory_guaranteed_customizable type="boolean">true</memory_guaranteed_customizable> <memory_guaranteed_default type="integer">20</memory_guaranteed_default> <memory_guaranteed_max type="integer">100</memory_guaranteed_max> <memory_guaranteed_min type="integer">20</memory_guaranteed_min>

BILLING PLANS - GET THE LIST OF BILLING PLANS 864

Page 866: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<memory_guaranteed_visible type="boolean">true</memory_guaranteed_visible> <memory_max type="integer">40</memory_max> <memory_min type="integer">4</memory_min> <memory_quota_customizable type="boolean">false</memory_quota_customizable> <memory_quota_default nil="true"/> <memory_quota_max nil="true"/> <memory_quota_min nil="true"/> <memory_quota_visible type="boolean">false</memory_quota_visible> <memory_visible type="boolean">true</memory_visible> <networks_to_create type="array"> <active_support_hash_with_indifferent_access> <name>DefaultName</name> <type>routed</type> <network_address>12.12.1.1/24</network_address> <dns>8.8.8.8</dns> </active_support_hash_with_indifferent_access> </networks_to_create> <provider_vdc_id type="integer">13</provider_vdc_id> <updated_at type="datetime">2016-04-25T16:45:54+03:00</updated_at> <vcpu_speed_customizable nil="true"/> <vcpu_speed_default nil="true"/> <vcpu_speed_max nil="true"/> <vcpu_speed_min nil="true"/> <vcpu_speed_visible nil="true"/> <vdc_model_type>allocation</vdc_model_type> <vm_number_customizable type="boolean">true</vm_number_customizable> <vm_number_default type="integer">100</vm_number_default> <vm_number_max type="integer">500</vm_number_max> <vm_number_min type="integer">1</vm_number_min> <vm_number_visible type="boolean">true</vm_number_visible> </vcloud_template> <vcloud_template>...</vcloud_template></vcloud_templates>

Where: cpu_allocation_customizable - whether the CPU allocation related parameters are editable during orchestration model deployment cpu_allocation_default - the default amount of allocated CPU resources, that will be set during orchestration model deployment cpu_allocation_max - the maximum amount of allocated CPU resources, that can be set during orchestration model deployment cpu_allocation_min - the minimum amount of allocated CPU resources, that can be set during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 865

Page 867: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_allocation_visible - whether the CPU allocation related parameters will be visible during orchestration model deployment cpu_guaranteed_customizable - whether the CPU guaranteed related parameters will be editable during orchestration model deployment cpu_guaranteed_default - the default amount of guaranteed CPU, that will be set during orchestration model deployment cpu_guaranteed_max - the maximum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_min - the minimum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_visible - whether the CPU guaranteed related parameters will be visible during orchestration model deployment cpu_quota_customizable - whether the CPU quota related parameters will be editable during orchestration model deployment cpu_quota_default - the default CPU quota, that will be set during orchestration model deployment cpu_quota_max - the maximum CPU quota, that can be set during orchestration model deployment cpu_quota_min - the minimum CPU quota, that can be set during orchestration model deployment cpu_quota_visible - whether the CPU quota related parameters will be visible during orchestration model deployment create_to_networks - the array of parameters related to the networks that will be created when the orchestration model is deployedname - the label for the networktype - the type of the network: routed, isolated or directnetwork_address - the network addressdns - DNS for the network created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format data_stores_to_create - the array of parameters related to the data stores that will be created when the orchestration model is deployed label - the label of the data store zone in which a data store will be created during orchestration model deployment id - the ID of the data store zone in which a data store will be created during orchestration model deployment min - the minimum data store size that can be requested during orchestration model deployment max - the maximum data store size that can be requested during orchestration model deployment default - the default data store size that will be set during orchestration model deployment data_store_visible - whether the data store related parameters will be visible during orchestration model deployment data_store_customizable - whether the data store related parameters will be editable during orchestration model deployment use_it - whether the data store will be created during orchestration model deployment default_network_pool - the network pool deploy_edge_gateway - whether an edge gateway will be deployed during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 866

Page 868: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

edge_gateway_name - the label for the new edge gateway. The default name is MyEdgeGateway. edge_gateway_network_id - the ID of the edge gateway network edge_gateway_uplink_network_id - the external network enable_fast_provisioning - whether fast provisioning is enabled enable_thin_provisioning - whether thin provisioning is enabled hypervisor_id - the ID of the compute resource associated with the orchestration model id - the ID of the orchestration model label - the name of the orchestration model memory_customizable - whether memory related parameters are editable during orchestration model deployment memory_default - the default amount of allocated memory, that will be set during orchestration model deployment memory_guaranteed_customizable - whether memory guaranteed related parameters are editable during orchestration model deployment memory_guaranteed_default - the default amount of guaranteed memory allocation, that will be set during orchestration model deployment memory_guaranteed_max - the maximum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_min - the minimum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_visible - whether memory guaranteed related parameters are visible during orchestration model deployment memory_max - the maximum amount of allocated memory, that can be set during orchestration model deployment memory_min - the minimum amount of allocated memory, that can be set during orchestration model deployment memory_quota_customizable - whether memory quota related parameters are editable during orchestration model deployment memory_quota_default - the default amount of memory which can be used, that will be set during orchestration model deployment memory_quota_max - the maximum amount of memory which can be used, that can be set during orchestration model deployment memory_quota_min - the minimum amount of memory which can be used, that can be set during orchestration model deployment memory_quota_visible - whether memory quota related parameters are visible during orchestration model deployment memory_visible - whether memory related parameters are visible during orchestration model deployment provider_vdc_id - the ID of the provider vDC that will be used when an organization vDC will be deployed from the orchestration model updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format vcpu_speed_customizable - whether vCPU speed related parameters are editable during orchestration model deployment vcpu_speed_default - the default vCPU speed, that will be set during orchestration model deployment vcpu_speed_max - the maximum vCPU speed, that can be set during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 867

Page 869: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

vcpu_speed_min - the minimum vCPU speed, that can be set during orchestration model deployment vcpu_speed_visible - whether vCPU speed related parameters are visible during orchestration model deployment vdc_model_type - the resource pool type vm_number_customizable - whether VS number related parameters are editable during orchestration model deployment vm_number_default - the default number of VSs, that will be set during orchestration model deployment vm_number_max - the maximum number of VSs, that can be set during orchestration model deployment vm_number_min - the minimum number of VSs, that can be set during orchestration model deployment vm_number_visible - whether VS number related parameters are visible during orchestration model deployment

69.2 Get Orchestration Model DetailsTo get the details of a particular orchestration model, use the following request:GET /vcloud/templates/:template_id.xmlGET /vcloud/templates/:template_id.jsonXML Request example:

curl -i -X GET http://onapp.test/vcloud/templates/:template_id.xml -u user:userpass

JSON Request example:

curl -i -X GET http://onapp.test/vcloud/templates/:template_id.json -u user:userpass

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><vcloud_template> <cpu_allocation_customizable type="boolean">true</cpu_allocation_customizable> <cpu_allocation_default type="integer">1</cpu_allocation_default> <cpu_allocation_max type="integer">12</cpu_allocation_max> <cpu_allocation_min type="integer">1</cpu_allocation_min> <cpu_allocation_visible type="boolean">true</cpu_allocation_visible> <cpu_guaranteed_customizable type="boolean">true</cpu_guaranteed_customizable> <cpu_guaranteed_default type="integer">10</cpu_guaranteed_default> <cpu_guaranteed_max type="integer">100</cpu_guaranteed_max>

BILLING PLANS - GET THE LIST OF BILLING PLANS 868

Page 870: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<cpu_guaranteed_min type="integer">1</cpu_guaranteed_min> <cpu_guaranteed_visible type="boolean">true</cpu_guaranteed_visible> <cpu_quota_customizable type="boolean">false</cpu_quota_customizable> <cpu_quota_default nil="true"/> <cpu_quota_max nil="true"/> <cpu_quota_min nil="true"/> <cpu_quota_visible type="boolean">false</cpu_quota_visible> <create_networks type="boolean">true</create_networks> <created_at type="datetime">2016-04-25T16:44:19+03:00</created_at> <data_stores_to_create type="array"> <active_support_hash_with_indifferent_access> <label>* for vCD 8</label> <id>83a2105b-47f1-4f21-a9de-43cfad2a82bd</id> <min type="integer">0</min> <max type="integer">999999</max> <default type="integer">100</default> <data_store_visible type="boolean">true</data_store_visible> <data_store_customizable type="boolean">true</data_store_customizable> <use_it type="boolean">true</use_it> </active_support_hash_with_indifferent_access> <active_support_hash_with_indifferent_access>...</active_support_hash_with_indifferent_access> </data_stores_to_create> <default_network_pool>131cfd1d-97dd-4531-96cf-ce2dc2ac426f</default_network_pool> <deploy_edge_gateway type="boolean">true</deploy_edge_gateway> <edge_gateway_name>MyEdgeGateway</edge_gateway_name> <edge_gateway_network_id nil="true"/> <edge_gateway_uplink_network_id type="integer">466</edge_gateway_uplink_network_id> <enable_fast_provisioning type="boolean">true</enable_fast_provisioning> <enable_thin_provisioning type="boolean">false</enable_thin_provisioning> <hypervisor_id type="integer">24</hypervisor_id> <id type="integer">6</id> <label>skdjhgfjshdf</label> <memory_customizable type="boolean">true</memory_customizable> <memory_default type="integer">8</memory_default> <memory_guaranteed_customizable type="boolean">true</memory_guaranteed_customizable> <memory_guaranteed_default type="integer">20</memory_guaranteed_default>

BILLING PLANS - GET THE LIST OF BILLING PLANS 869

Page 871: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<memory_guaranteed_max type="integer">100</memory_guaranteed_max> <memory_guaranteed_min type="integer">20</memory_guaranteed_min> <memory_guaranteed_visible type="boolean">true</memory_guaranteed_visible> <memory_max type="integer">40</memory_max> <memory_min type="integer">4</memory_min> <memory_quota_customizable type="boolean">false</memory_quota_customizable> <memory_quota_default nil="true"/> <memory_quota_max nil="true"/> <memory_quota_min nil="true"/> <memory_quota_visible type="boolean">false</memory_quota_visible> <memory_visible type="boolean">true</memory_visible> <networks_to_create type="array"> <active_support_hash_with_indifferent_access> <name>DefaultName</name> <type>routed</type> <network_address>12.12.1.1/24</network_address> <dns>8.8.8.8</dns> </active_support_hash_with_indifferent_access> </networks_to_create> <provider_vdc_id type="integer">13</provider_vdc_id> <updated_at type="datetime">2016-04-25T16:45:55+03:00</updated_at> <vcpu_speed_customizable nil="true"/> <vcpu_speed_default nil="true"/> <vcpu_speed_max nil="true"/> <vcpu_speed_min nil="true"/> <vcpu_speed_visible nil="true"/> <vdc_model_type>allocation</vdc_model_type> <vm_number_customizable type="boolean">true</vm_number_customizable> <vm_number_default type="integer">100</vm_number_default> <vm_number_max type="integer">500</vm_number_max> <vm_number_min type="integer">1</vm_number_min> <vm_number_visible type="boolean">true</vm_number_visible></vcloud_template>

Where:cpu_allocation_customizable - whether the CPU allocation related parameters are editable during orchestration model deploymentcpu_allocation_default - the default amount of allocated CPU resources, that will be set during orchestration model deployment cpu_allocation_max - the maximum amount of allocated CPU resources, that can be set during orchestration model deployment cpu_allocation_min - the minimum amount of allocated CPU resources, that can be set during orchestration model deploymentcpu_allocation_visible - whether the CPU allocation related parameters will be visible during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 870

Page 872: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_guaranteed_customizable - whether the CPU guaranteed related parameters will be editable during orchestration model deploymentcpu_guaranteed_default - the default amount of guaranteed CPU, that will be set during orchestration model deployment cpu_guaranteed_max - the maximum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_min - the minimum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_visible - whether the CPU guaranteed related parameters will be visible during orchestration model deploymentcpu_quota_customizable - whether the CPU quota related parameters will be editable during orchestration model deploymentcpu_quota_default - the default CPU quota, that will be set during orchestration model deployment cpu_quota_max - the maximum CPU quota, that can be set during orchestration model deployment cpu_quota_min - the minimum CPU quota, that can be set during orchestration model deployment cpu_quota_visible - whether the CPU quota related parameters will be visible during orchestration model deploymentcreate_to_networks - the array of parameters related to the networks that will be created when the orchestration model is deployedname - the label for the networktype - the type of the network: routed, isolated or directnetwork_address - the network addressdns - DNS for the networkcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdata_stores_to_create - the array of parameters related to the data stores that will be created when the orchestration model is deployedlabel - the label of the data store zone in which a data store will be created during orchestration model deploymentid - the ID of the data store zone in which a data store will be created during orchestration model deploymentmin - the minimum data store size that can be requested during orchestration model deploymentmax - the maximum data store size that can be requested during orchestration model deploymentdefault - the default data store size that will be set during orchestration model deploymentdata_store_visible - whether the data store related parameters will be visible during orchestration model deploymentdata_store_customizable - whether the data store related parameters will be editable during orchestration model deploymentuse_it - whether the data store will be created during orchestration model deploymentdefault_network_pool - the network pooldeploy_edge_gateway - whether an edge gateway will be deployed during orchestration model deploymentedge_gateway_name - the label for the new edge gateway. The default name is MyEdgeGateway.

BILLING PLANS - GET THE LIST OF BILLING PLANS 871

Page 873: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

edge_gateway_network_id - the ID of the edge gateway networkedge_gateway_uplink_network_id - the external networkenable_fast_provisioning - whether fast provisioning is enabledenable_thin_provisioning - whether thin provisioning is enabledhypervisor_id - the ID of the compute resource associated with the orchestration modelid - the ID of the orchestration modellabel - the name of the orchestration modelmemory_customizable - whether memory related parameters are editable during orchestration model deploymentmemory_default - the default amount of allocated memory, that will be set during orchestration model deployment memory_guaranteed_customizable - whether memory guaranteed related parameters are editable during orchestration model deploymentmemory_guaranteed_default - the default amount of guaranteed memory allocation, that will be set during orchestration model deployment memory_guaranteed_max - the maximum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_min - the minimum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_visible - whether memory guaranteed related parameters are visible during orchestration model deploymentmemory_max - the maximum amount of allocated memory, that can be set during orchestration model deployment memory_min - the minimum amount of allocated memory, that can be set during orchestration model deployment memory_quota_customizable - whether memory quota related parameters are editable during orchestration model deploymentmemory_quota_default - the default amount of memory which can be used, that will be set during orchestration model deployment memory_quota_max - the maximum amount of memory which can be used, that can be set during orchestration model deployment memory_quota_min - the minimum amount of memory which can be used, that can be set during orchestration model deployment memory_quota_visible - whether memory quota related parameters are visible during orchestration model deploymentmemory_visible - whether memory related parameters are visible during orchestration model deploymentprovider_vdc_id - the ID of the provider vDC that will be used when an organization vDC will be deployed from the orchestration modelupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatvcpu_speed_customizable - whether vCPU speed related parameters are editable during orchestration model deploymentvcpu_speed_default - the default vCPU speed, that will be set during orchestration model deployment vcpu_speed_max - the maximum vCPU speed, that can be set during orchestration model deployment vcpu_speed_min - the minimum vCPU speed, that can be set during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 872

Page 874: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

vcpu_speed_visible - whether vCPU speed related parameters are visible during orchestration model deploymentvdc_model_type - the resource pool typevm_number_customizable - whether VS number related parameters are editable during orchestration model deploymentvm_number_default - the default number of VSs, that will be set during orchestration model deployment vm_number_max - the maximum number of VSs, that can be set during orchestration model deployment vm_number_min - the minimum number of VSs, that can be set during orchestration model deployment vm_number_visible - whether VS number related parameters are visible during orchestration model deployment

69.3 Create Orchestration ModelTo create an orchestration model, use the following request:POST /vcloud/templates.xmlPOST /vcloud/templates.jsonXML Request example:

curl -i -X POST http://onapp.test/vcloud/templates.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<vcloud-template><label>MyOrchestrationModel</label><hypervisor-id>11</hypervisor-id><provider-vdc-id>23</provider-vdc-id><vdc-model-type>allocation</vdc-model-type><cpu-allocation-min>1</cpu-allocation-min><cpu-allocation-max>12</cpu-allocation-max><cpu-allocation-default>1</cpu-allocation-default><cpu-allocation-customizable>1</cpu-allocation-customizable><cpu-allocation-visible>1</cpu-allocation-visible><cpu-guaranteed-min>1</cpu-guaranteed-min><cpu-guaranteed-max>100</cpu-guaranteed-max><cpu-guaranteed-default>10</cpu-guaranteed-default><cpu-guaranteed-customizable>1</cpu-guaranteed-customizable><cpu-guaranteed-visible>1</cpu-guaranteed-visible><memory-min>4</memory-min><memory-max>40</memory-max><memory-default>8</memory-default><memory-customizable>1</memory-customizable><memory-visible>1</memory-visible><memory-guaranteed-min>20</memory-guaranteed-min><memory-guaranteed-max>100</memory-guaranteed-max><memory-guaranteed-default>20</memory-guaranteed-default><memory-guaranteed-customizable>1</memory-guaranteed-customizable><memory-guaranteed-visible>1</memory-guaranteed-visible><vm-number-min>1</vm-number-min><vm-number-max>500</vm-number-max><vm-number-default>100</vm-number-default><vm-number-customizable>1</vm-number-customizable><vm-number-visible>1</vm-number-visible><default-network-pool>131cfd1d-97dd-4531-96cf-ce2dc2ac426f</default-network-pool><edge-gateway-name>MyEdgeGateway</edge-gateway-name><edge-

BILLING PLANS - GET THE LIST OF BILLING PLANS 873

Page 875: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

gateway-uplink-network-id>102</edge-gateway-uplink-network-id><networks_to_create type="array"><network_to_create><name>Network-1</name><type>routed</type><network_address>11.11.1.1/24</network_address><dns>9.9.9.9</dns></network_to_create><netw... type="array"><data_store_to_create><label>*forvCloud8</label><id>44a2105b-47f1-4f21-a9de-43cfad2a82bd</id><min>0</min><max>999999</max><default>1000</default><data_store_customizable>true</data_store_customizable><data_store_visible>true</data_store_visible><use_it>true</use_it></data_store_to_create><data_store_to_create><label>BronzeStorageforvCloud8</label><id>b5e6e041-114a-45e0-909d-ee18971a9be9</id><min>0</min><max>999999</max><default>1000</default><data_store_customizable>true</data_store_customizable><data_store_visible>true</data_store_visible><use_it>true</use_it></data_store_to_create><data_store_to_create><label>GoldStorageforvCloud8</label><id>55abf6c6-6dcb-429d-9be0-61d6d38cf3e0</id><min>0</min><max>999999</max><default>1000</default><data_store_customizable>true</data_store_customizable><data_store_visible>true</data_store_visible><use_it>true</use_it></data_store_to_create></data_stores_to_create></vcloud-template>'

JSON Request example:

curl -i -X POST http://onapp.test/vcloud/templates.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"vcloud_template":{"label":"My Orchestration Model","hypervisor_id":"11","provider_vdc_id":"23","vdc_model_type":"allocation","cpu_allocation_min":"1","cpu_allocation_max":"12","cpu_allocation_default":"1","cpu_allocation_customizable":"1","cpu_allocation_visible":"1","cpu_guaranteed_min":"1","cpu_guaranteed_max":"100","cpu_guaranteed_default":"10","cpu_guaranteed_customizable":"1","cpu_guaranteed_visible":"1","memory_min":"4","memory_max":"40","memory_default":"8","memory_customizable":"1","memory_visible":"1","memory_guaranteed_min":"20","memory_guaranteed_max":"100","memory_guaranteed_default":"20","memory_guaranteed_customizable":"1","memory_guaranteed_visible":"1","vm_number_min":"1","vm_number_max":"500","vm_number_default":"100","vm_number_customizable":"1","vm_number_visible":"1","default_network_pool":"131cfd1d-44dd-4531-96cf-ce2dc2ac426f","edge_gateway_name":"MyEdgeGateway","edge_gateway_uplink_network_id":"102","networks_to_create":[{"name":"Network-1","type":"routed","network_address":"11.11.1.1/24","dns":"9.9.9.9"}, {"name":"Network-2","type":"routed","network_address":"11.11.2.1/24","dns":"9.9.4.4"}], "enable_thin_provisioning":"1","enable_fast_provisioning":"1","data_

BILLING PLANS - GET THE LIST OF BILLING PLANS 874

Page 876: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

stores_to_create":[{"label":"* for vCloud 8","id":"44a2105b-47f1-4f21-a9de-43cfad2a82bd","min":"0","max":"999999","default":"1000","data_store_customizable":"true","data_store_visible":"true","use_it":"true"}, {"label":"Bronze Storage for vCloud 8","id":"b5e6e041-114a-45e0-909d-ee18971a9be9","min":"0","max":"999999","default":"1000","data_store_customizable":"true","data_store_visible":"true","use_it":"true"}, {"label":"Gold Storage for vCloud 8","id":"55abf6c6-6dcb-429d-9be0-61d6d38cf3e0","min":"0","max":"999999","default":"1000","data_store_customizable":"true","data_store_visible":"true","use_it":"true"}]}}'

Where:label - the name of the orchestration modelhypervisor_id - the ID of the compute resource associated with the orchestration modelprovider_vdc_id - the ID of the provider vDC that will be used when an organization vDC will be deployed from the orchestration modelvdc_model_type - the resource pool type: allocation, reservation or pay_as_you_gocpu_allocation_min - the minimum amount of allocated CPU resources, that can be set during orchestration model deployment cpu_allocation_max - the maximum amount of allocated CPU resources, that can be set during orchestration model deployment cpu_allocation_default - the default amount of allocated CPU resources, that will be set during orchestration model deployment cpu_allocation_customizable - set to "1", if you want the CPU allocation related parameters to be editable during orchestration model deployment, otherwise set to "0"cpu_allocation_visible - set to "1", if you want the CPU allocation related parameters to be visible during orchestration model deployment, otherwise set to "0"cpu_guaranteed_min - the minimum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_max - the maximum amount of guaranteed CPU, that can be set during orchestration model deployment cpu_guaranteed_default - the default amount of guaranteed CPU, that will be set during orchestration model deployment cpu_guaranteed_customizable - set to "1", if you want the CPU guaranteed related parameters to be editable during orchestration model deployment, otherwise set to "0"cpu_guaranteed_visible - set to "1", if you want the CPU guaranteed related parameters to be visible during orchestration model deployment, otherwise set to "0"memory_min - the minimum amount of allocated memory, that can be set during orchestration model deployment memory_max - the maximum amount of allocated memory, that can be set during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 875

Page 877: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

memory_default - the default amount of allocated memory, that will be set during orchestration model deployment memory_customizable - set to "1", if you want the memory related parameters to be editable during orchestration model deployment, otherwise set to "0"memory_visible - set to "1", if you want the memory related parameters to be visible during orchestration model deployment, otherwise set to "0"memory_guaranteed_min - the minimum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_max - the maximum amount of guaranteed memory allocation, that can be set during orchestration model deployment memory_guaranteed_default - the default amount of guaranteed memory allocation, that will be set during orchestration model deployment memory_guaranteed_customizable - set to "1", if you want the memory guaranteed related parameters to be editable during orchestration model deployment, otherwise set to "0"memory_guaranteed_visible - set to "1", if you want the memory guaranteed related parameters to be visible during orchestration model deployment, otherwise set to "0"vm_number_min - the minimum number of VSs, that will be set during orchestration model deployment vm_number_max - the maximum number of VSs, that will be set during orchestration model deployment vm_number_default - the default number of VSs, that will be set during orchestration model deployment vm_number_customizable - set to "1", if you want the VS number related parameters to be editable during orchestration model deployment, otherwise set to "0"vm_number_visible - set to "1", if you want the VS number related parameters to visible be during orchestration model deployment, otherwise set to "0"default_network_pool - set a network pooledge_gateway_name - fill in the label for the new edge gateway. The default name is MyEdgeGateway.edge_gateway_uplink_network_id - fill in an external networknetworks_to_create - the array of parameters related to the networks that will be created when the orchestration model is deployedname - the label for the networktype - the type of the network: routed, isolated or directnetwork_address - fill in the network addressdns - DNS for the networkenable_thin_provisioning - set to "1" to enable thin provisioning, otherwise set to "0"enable_fast_provisioning - set to "1" to enable fast provisioning, otherwise set to "0"data_stores_to_create - the array of parameters related to the data stores that will be created when the orchestration model is deployedlabel - the label of the data store zone in which a data store will be created during orchestration model deploymentid - the ID of the data store zone in which a data store will be created during orchestration model deployment

BILLING PLANS - GET THE LIST OF BILLING PLANS 876

Page 878: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

min - the minimum data store size that can be requested during orchestration model deploymentmax - the maximum data store size that can be requested during orchestration model deploymentdefault - the default data store size that will be set during orchestration model deploymentdata_store_customizable - set to "true" if you want that the the data store size can be altered during orchestration model deployment, otherwise set to "false"data_store_visible - set to "true" for the data store to be listed during orchestration model deployment, otherwise set to "false".If the data store zone is not visible, a data store will still be created in it.use_it - set to "true" for the data store to be created during orchestration model deployment, otherwise set to "false"

69.4 Deploy Orchestration ModelTo deploy an orchestration model, use the following request:POST /vcloud/templates/:template_id/deploy.xmlPOST /vcloud/templates/:template_id/deploy.jsonXML Request example:

curl -i -X POST http://onapp.test/vcloud/templates/:template_id/deploy.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<vcloud_template><user_group_id>174</user_group_id><vdc_label>MyResourcePool1</vdc_label><cpu_allocation>1</cpu_allocation><cpu_guaranteed>10</cpu_guaranteed><vcpu_speed>0</vcpu_speed><cpu_quota>0</cpu_quota><memory>8</memory><memory_guaranteed>20</memory_guaranteed><memory_quota>0</memory_quota><vm_number>100</vm_number><storage_profile>47a2105b-47f1-4f21-a9de-43cfad2a82bd</storage_profile><data_stores_created type="array"><data_store_created><id>24a2105b-47f1-4f21-a9de-43cfad2a82bd</id><label>*forvCloud8</label><disk_space>1000</disk_space></data_store_created><data_store_created><id>b5e6e041-114a-45e0-909d-ee18971a9be9</id><label>BronzeStorageforvCloud8</label><disk_space>1000</disk_space></data_store_created><data_store_created><id>55abf6c6-6dcb-429d-9be0-61d6d38cf3e0</id><label>GoldStorageforvCloud8</label><disk_space>1000</disk_space></data_store_created></data_stores_created></vcloud_template>'

JSON Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 877

Page 879: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST http://onapp.test/vcloud/templates/:template_id/deploy.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"vcloud_template":{"user_group_id":"174","vdc_label":"My Resource Pool1","cpu_allocation":"1","cpu_guaranteed":"10","vcpu_speed":"0","cpu_quota":"0","memory":"8","memory_guaranteed":"20","memory_quota":"0","vm_number":"100","storage_profile":"55a2105b-47f1-4f21-a9de-43cfad2a82bd","data_stores_created":[{"id":"44a2105b-47f1-4f21-a9de-43cfad2a82bd","label":"* for vCloud 8","disk_space":"1000"}, {"id":"b5e6e041-114a-45e0-909d-ee18971a9be9","label":"Bronze Storage for vCloud 8","disk_space":"1000"}, {"id":"55abf6c6-6dcb-429d-9be0-61d6d38cf3e0","label":"Gold Storage for vCloud 8","disk_space":"1000"}]}}'

Where:user_group_id - the ID of the organization with which the orchestration model will be associatedvdc_label - the label for a resource pool that will be created after the template is deployedcpu_allocation - amount of CPU resources (GHZ) that will be allocated after the template is deployedcpu_guaranteed - amount of guaranteed CPU allocation (%)vcpu_speed - the vCPU speed that can be consumed after the template is deployedcpu_quota - the CPU quotamemory - the amount of memory(MB) that will be allocated after the template is deployedmemory_guaranteed - amount of guaranteed memory allocation (%)memory_quota - the memory quotavm_number - the number of VSs that can be created after the template is deployedstorage_profile - the default storage policydata_stores_created - the array of parameters related to the data stores that will be allocated after the template is deployedid - id of the data store zone in which a data store will be created during the orchestration model deploymentlabel - the name of the data store zone in which a data store will be created during the orchestration model deploymentdisk_space - the disk size for the data store that will be allocated after the template is deployed

69.5 Delete Orchestration ModelTo delete an orchestration model, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 878

Page 880: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DELETE /vcloud/templates/:template_id.xmlDELETE /vcloud/templates/:template_id.jsonXML Request example:

curl -i -X DELETE http://onapp.test/vcloud/templates/:template_id.xml -u user:userpass

JSON Request example:

curl -i -X DELETE http://onapp.test/vcloud/templates/:template_id.json -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 879

Page 881: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

70 PAGINATION

Pagination lets you split large data list into several pages and specify the number of items displayed per page (the example for Users is provided).Use the following request to view the specific page:

Example 1XML Request example

curl -i -X GET -u user:password --url http://onapp.test/users.xml/page/2

JSON Request example

curl -i -X GET -u user:password --url http://onapp.test/users.json/page/2

Example 2XML Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.xml?page=2

JSON Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json?page=2

Where you have to specify the URL and the number of page to display.

To specify the number of items displayed per page, run:

Example 1

XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 880

Page 882: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET -u user:password --url http://onapp.test/users.xml/per_page/4

JSON Request example

curl -i -X GET -u user:password --url http://onapp.test/users.json/per_page/4

Example 2XML Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.xml?per_page=4

JSON Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json?per_page=4

Where you have to specify the URL and the number of items to display per page.

To specify the page number and the number of items displayed per page, run one of the requests provided below:

Example 1XML Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.xml/page/2/per_page/4

JSON Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json/page/2/per_page/4

BILLING PLANS - GET THE LIST OF BILLING PLANS 881

Page 883: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Example 2

XML Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.xml/per_page/4/page/2

JSON Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json/per_page/4/page/2

Example 3

XML Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.xml?page=2&per_page=4

JSON Request example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json?page=2&per_page=4

Where you'll have to specify the page URL, page number and amount of items displayed per page.

XML Output example

curl -i -X GET -u user:password --url http://83.170.110.181/users.json/per_page/2/page/4HTTP/1.1 200 OKDate: Mon, 25 Jun 2012 09:43:35 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-Total: 37

BILLING PLANS - GET THE LIST OF BILLING PLANS 882

Page 884: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

X-Limit: 2X-Page: 4X-UA-Compatible: IE=Edge,chrome=1ETag: "3eec8dfd2f935df854612cd39a03f49a"Cache-Control: must-revalidate, private, max-age=0X-Request-Id: bb7162179190b3f21897542495d3e72bX-Runtime: 0.187337X-Rack-Cache: missSet-Cookie: _session_id=41fdb2fe690dcd4a8ba04af1902305b6; path=/; HttpOnlyStatus: 200Connection: closeTransfer-Encoding: chunkedContent-Type: application/json; charset=utf-8

Where:X-Total – the total number of displayed items

X-Limit – the number of items displayed per page

X-Page – the page number

BILLING PLANS - GET THE LIST OF BILLING PLANS 883

Page 885: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

71 PAYMENTS

This chapter provides API for payments created in the cloud. It enables you to view the list of payments, create edit or delete payments.

71.1 Get List of All User PaymentsTo get the list of all user payments:GET /billing/user/payments.xmlGET /billing/user/payments.json XML Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML output example

<payments type="array"> <payment> <id type="integer">1</id> <amount type="decimal">2.0</amount> <payer_id type="integer">4</payer_id> <invoice_number>1</invoice_number> <created_at type="datetime">2015-12-02T13:44:24+02:00</created_at> <updated_at type="datetime">2015-12-02T13:44:24+02:00</updated_at> <type>Billing::User::Payment</type> </payment> <payment>...</payment></payments>

Where:id — payment IDamount — money amount in the currency set in the billing plan

BILLING PLANS - GET THE LIST OF BILLING PLANS 884

Page 886: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

payer_id — ID of the userinvoice_number — optional number of invoicecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formattype - the type of payment

71.2 Get List of Payments of Particular User

To get the list of payments of a particular user:GET /billing/user/payments.xmlGET /billing/user/payments.json XML Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<payer>11</payer>'

JSON Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"payer": 11}'

XML output example

<payments type="array"> <payment> <id type="integer">11</id> <amount type="decimal">20.0</amount> <payer_id type="integer">11</payer_id> <invoice_number>12</invoice_number> <created_at type="datetime">2016-02-10T17:42:22+02:00</created_at> <updated_at type="datetime">2016-02-10T17:42:22+02:00</updated_at> <type>Billing::User::Payment</type> </payment> <payment> <id type="integer">13</id> <amount type="decimal">12.55</amount> <payer_id type="integer">11</payer_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 885

Page 887: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<invoice_number>3</invoice_number> <created_at type="datetime">2016-02-15T10:43:26+02:00</created_at> <updated_at type="datetime">2016-02-15T10:48:13+02:00</updated_at> <type>Billing::User::Payment</type> </payment></payments>

Where:id — payment IDamount — money amount in the currency set in the billing planpayer_id — ID of the userinvoice_number — optional number of invoicecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formattype - the type of payment

71.3 Get User Payment DetailsTo get the user payment details:GET /billing/user/payments/:id.xmlGET /billing/user/payments/:id.json XML Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass --url http://onapp.test/billing/user/payments/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML output example

<payment> <id type="integer">1</id> <amount type="decimal">2.0</amount> <payer_id type="integer">4</payer_id> <invoice_number>1</invoice_number> <created_at type="datetime">2015-12-02T13:44:24+02:00</created_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 886

Page 888: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<updated_at type="datetime">2015-12-02T13:44:24+02:00</updated_at> <type>Billing::User::Payment</type> </payment>

Where:id — payment IDamount — money amount in the currency set in the billing planpayer_id — ID of the userinvoice_number — optional number of invoicecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formattype - the type of payment

71.4 Create User PaymentTo create a payment for a particular user, use this request:POST /billing/user/payments.xmlPOST /billing/user/payments.jsonXML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/billing/user/payments.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<payment><payer_id>11</payer_id><invoice_number>3</invoice_number><amount>12.55</amount></payment>'

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/billing/user/payments.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"payment":{"payer_id":"11", "invoice_number":"3", "amount":"12.55"}}'

Where you have to send:payer_id — ID of the userinvoice_number - optional number of the invoiceamount* - amount of the payment (should be higher than zero)

BILLING PLANS - GET THE LIST OF BILLING PLANS 887

Page 889: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

71.5 Edit User PaymentTo edit a payment, use this request:PUT /billing/user/payments/:id.xmlPUT /billing/user/payments/:id.jsonXML Request example

curl -i -X PUT -u user:userpass --url http://onapp.test/billing/user/payments/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<payment><payer_id>1</payer_id><invoice_number>1</invoice_number><amount>12.56</amount></payment>'

JSON Request example

curl -i -X PUT -u user:userpass --url http://onapp.test/billing/user/payments/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"payment":{"payer_id":"11", "invoice_number":"3", "amount":"12.55"}}'

Where you have to send:payer_id — ID of the userinvoice_number - optional number of the invoiceamount* - amount of the payment (should be higher than zero)

71.6 Delete User PaymentTo delete a payment, use this request:DELETE /billing/user/payments/:id.xmlDELETE /billing/user/payments/:id.jsonXML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/billing/user/payments/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/billing/user/payments/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 888

Page 890: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

72 PUBLISHING RULES

Publishing rules function as destination NAT, making virtual servers accessible from outside. If the virtual server is running within a customer network, it is necessary to configure to enable Internet access to this virtual server. To publish a VS port, you have to configure a publishing rule for the VS.

72.1 Get List of Publishing RulesGET /virtual_machines/:vm_id/publications.xmlGET /virtual_machines/:vm_id/publications.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/ozfdksfaf7esrx/publications.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/ozfdksfaf7esrx/publications.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><publications type="array"> <publication> <created_at type="datetime">2012-09-14T12:57:49+03:00</created_at> <id type="integer">1</id> <is_built type="boolean">false</is_built> <outside_ip_address_id nil="true"></outside_ip_address_id> <port type="integer">80</port> <protocol>UDP</protocol> <rule_number type="integer">51</rule_number> <updated_at type="datetime">2012-09-14T12:57:49+03:00</updated_at> <virtual_machine_id type="integer">66</virtual_machine_id> </publication></publications>

BILLING PLANS - GET THE LIST OF BILLING PLANS 889

Page 891: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:publications - an array of the publishing rulescreated_at - the date when the publishing rule was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid - publishing rule IDoutside_ip_address_id - ID of a free IPv4 addressport - the port for which this rule is activeprotocol - type of the protocol.rule_number -updated_at - the date when the publishing rule was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatvirtual_machine_id - ID of the virtual server

72.2 Add Publishing RulePOST /virtual_machines/:vm_id/publications.xmlPOST /virtual_machines/:vm_id/publications.json

XML Request example

curl -i -X POST -u user:userpass -d '<publication><port>8081</port><protocol>TCP</protocol><use_customer_network_address>1</use_customer_network_address></publication>' http://onapp.test/virtual_machines/ozfdksfaf7esrx/publications.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass -d '{"publication":{"port":"8080", "protocol":"TCP", "use_customer_network_address":"1"}}' http://onapp.test/virtual_machines/ozfdksfaf7esrx/publications.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where you have to specify the following parameters:port - the port for which this rule is activeprotocol - type of the protocol.use_customer_network_address - set 1 to use customer network address, otherwise set 0

XML Response example

<?xml version="1.0" encoding="UTF-8"?><publication>

BILLING PLANS - GET THE LIST OF BILLING PLANS 890

Page 892: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2012-09-14T13:17:41+03:00</created_at> <id type="integer">5</id> <is_built type="boolean">false</is_built> <outside_ip_address_id nil="true"></outside_ip_address_id> <port type="integer">8081</port> <protocol>TCP</protocol> <rule_number type="integer">55</rule_number> <updated_at type="datetime">2012-09-14T13:17:41+03:00</updated_at> <virtual_machine_id type="integer">66</virtual_machine_id></publication>

72.3 Delete Publishing RuleDELETE /virtual_machines/:vm_id/publications.xmlDELETE /virtual_machines/:vm_id/publications.jsonXML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/virtual_machines/ozfdksfaf7esrx/publications/4.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X DELETE -u user:userpass http://onap.test/virtual_machines/ozfdksfaf7esrx/publications/5.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Response example

HTTP/1.1 204 No ContentDate: Fri, 14 Sep 2012 10:45:47 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1Cache-Control: no-cacheX-Request-Id: 0fa1960416e6a84fcee571c1afdebe02X-Runtime: 0.107463X-Rack-Cache: invalidate, passSet-Cookie: _session_id=e8d6bffc3de53ba9223eabf835351cdd; path=/;

BILLING PLANS - GET THE LIST OF BILLING PLANS 891

Page 893: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

HttpOnlyStatus: 204Content-Length: 0Connection: closeContent-Type: text/plain; charset=UTF-8

BILLING PLANS - GET THE LIST OF BILLING PLANS 892

Page 894: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

73 RECIPE GROUPS

Recipe groups allow OnApp administrators to organize individual recipes into groups that can be used as a billing plan resource.

73.1 Get List of Recipe GroupsUse the following request to view the list of recipe groups:GET /recipe_groups.xmlGET /recipe_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/recipe_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/recipe_groups.json

XML Output example

<objects type="array"> <object> <id type="integer">2</id> <label>qayd</label> <parent_id nil="true"/> <lft type="integer">11</lft> <rgt type="integer">12</rgt> <depth type="integer">0</depth> <created_at type="datetime">2013-05-24T11:50:19+03:00</created_at> <updated_at type="datetime">2013-05-24T11:50:19+03:00</updated_at> <children type="array"/> <relations type="array">

BILLING PLANS - GET THE LIST OF BILLING PLANS 893

Page 895: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<relation> <id type="integer">1</id> <recipe_id type="integer">1</recipe_id> <recipe_group_id type="integer">2</recipe_group_id> <created_at type="datetime">2013-05-24T11:50:27+03:00</created_at> <updated_at type="datetime">2013-05-24T11:50:27+03:00</updated_at> <recipe> <id type="integer">1</id> <user_id type="integer">6</user_id> <created_at type="datetime">2013-04-19T10:26:41+03:00</created_at> <updated_at type="datetime">2013-05-13T13:08:00+03:00</updated_at> <label>Apache example</label> <description>Apache example</description> <script_type>bat</script_type> <compatible_with>unix</compatible_with> </recipe> </relation> </relations> </object></objects>

Where:objects - the array of recipe groups with the following parameters:

label – the group nameid - recipe group IDlabel - template group nameparent_id - id of the target recipe grouplft - left nested set identifierrgt - right nested set identifierdepth - the depth of a given node (distance from this template group to the root)created_at – the date when the recipe group was createdupdated_at – the date when the recipe group was updatedchildren - the array of child recipe groupsrelations - the array of recipes assigned to the recipe groups with the following parameters: id - relation ID user_id - ID of a recipe owner created_at – the date when the recipe group was created updated_at – the date when the recipe group was updated recipe - an array of recipe parameters:

o id - recipe IDo user_id - ID - the ID of a recipe owner

BILLING PLANS - GET THE LIST OF BILLING PLANS 894

Page 896: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o created_at – the date when the recipe was createdo updated_at – the date when the recipe was updatedo label - recipe label o script_type - script type for Windows-compatible recipes:

bat vbs powershell

o compatible_with - recipe compatibility: windows or unix

73.2 Get Recipe Group DetailsUse the following request to view the list of recipe groups:GET /recipe_groups/:recipe_group_id.xmlGET /recipe_groups/:recipe_group_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/recipe_groups/:recipe_group_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/recipe_groups/:recipe_group_id.json

Where you have to specify the recipe group ID.XML Response example

<?xml version="1.0" encoding="UTF-8"?><recipe_group> <created_at type="datetime">2013-05-24T08:54:13+00:00</created_at> <depth type="integer">1</depth> <id type="integer">6</id> <label>Decomissioning</label> <lft type="integer">8</lft> <parent_id type="integer">1</parent_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 895

Page 897: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<rgt type="integer">9</rgt> <updated_at type="datetime">2013-05-24T08:54:13+00:00</updated_at></recipe_group>

Where:label – the group nameid - recipe group IDlabel - template group nameparent_id - id of the target recipe grouplft - left nested set identifierrgt - right nested set identifierdepth - the depth of a given node (distance from this template group to the root)created_at – the date when the recipe group was createdupdated_at – the date when the recipe group was updated

73.3 Add Recipe GroupUse the following request to create a recipe group:POST /recipe_groups.xmlPOST /recipe_groups.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<recipe_group><label>test</label></recipe_group>' --url http://onapp.test/recipe_groups.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"recipe_group":{"label":"test"}}' --url http://onapp.test/recipe_groups.json

Where:label - recipe group name

BILLING PLANS - GET THE LIST OF BILLING PLANS 896

Page 898: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

73.4 Add Child Recipe GroupUse the following request to create a child recipe group:POST /recipe_groups.xmlPOST /recipe_groups.json XML Request example:

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<recipe_group><label>zaza</label><parent_id>100</parent_id></recipe_group>' --url http://onapp.test/recipe_groups.xml

JSON Request example:

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"recipe_group":{"label":"zaza_ch1", "parent_id":"100"}}' --url http://onapp.test/recipe_groups.json

Where:label - ID of a child groupparent_id - id of the target recipe group

73.5 Edit Recipe GroupUse the following request to edit recipe group's label:PUT /recipe_groups/:recipe_group_id.xmlPUT /recipe_groups/:recipe_group_id.jsonXML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<recipe_group><label>newlabel</label></recipe_group>' --url http://onapp.test/recipe_groups/:recipe_group_id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"recipe_group":

BILLING PLANS - GET THE LIST OF BILLING PLANS 897

Page 899: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"label":"new"}}' --url http://onapp.test/recipe_groups/:recipe_group_id.json

Where you can edit recipe group's label.

73.6 Delete Recipe GroupUse the following request to delete a recipe group:DELETE /recipe_groups/:recipe_group_id.xmlDELETE /recipe_groups/:recipe_group_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/recipe_groups/:recipe_group_id.xml

JSON Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/recipe_groups/:recipe_group_id.xml

Where you have to specify ID of a recipe group you want to delete.

73.7 Get List of Recipes Attached to Recipe Group

Use the following request to view the list of recipes attached to the recipe group:GET /recipe_groups/:id/recipe_group_relations.xmlGET /recipe_groups/:id/recipe_group_relations.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 898

Page 900: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/recipe_groups/:id/recipe_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/recipe_groups/:id/recipe_group_relations.json

Where you have to specify ID of the recipe group in the URL.

73.8 Attach Recipe to Recipe GroupUse the following request to attach recipe to the recipe group:POST /recipe_groups/:recipe_group_id/recipe_group_relations.xmlPOST /recipe_groups/:recipe_group_id/recipe_group_relations.json

XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<recipe_group_relation><recipe_id>id</recipe_id></recipe_group_relation>' --url http://onapp.test/recipe_groups/:recipe_group_id/recipe_group_relations.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"recipe_group_relation":{"recipe_id":"id"}}' --url http://onapp.test/recipe_groups/:recipe_group_id/recipe_group_relations.json

73.9 Remove Recipe from Recipe GroupUse the following request to remove recipe from the recipe group:

BILLING PLANS - GET THE LIST OF BILLING PLANS 899

Page 901: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /recipe_groups/:recipe_group_id/recipe_group_relations/:recipe_group_relation_id.xmlPOST /recipe_groups/:recipe_group_id/recipe_group_relations/:recipe_group_relation_id.json

XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/recipe_groups/:id/recipe_group_relations/:recipe_group_relation_id.xml

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/recipe_groups/:id/recipe_group_relations/:recipe_group_relation_id.json

Where you have to specify recipe group ID and ID of a recipe group relation in the URL.

BILLING PLANS - GET THE LIST OF BILLING PLANS 900

Page 902: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74 RECIPES

Recipes are the plugin mechanism used for adding new functionalities to the OnApp cloud. Each recipe is a set of instructions that triggers events at certain stages during the deployment of certain services.

In the 3.0.1 version you can use recipes for Unix (Linux and FreeBSD) virtual servers.

74.1 Get List of RecipesGET /recipes.xmlGET /recipes.jsonXML Output example

<?xml version="1.0" encoding="UTF-8"?><recipes> <recipe> <compatible_with>unix</compatible_with> <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at> <description>Create initial folder structure</description> <id type="integer">1</id> <label>Create folders</label> <script_type>vbs</script_type> <updated_at type="datetime">2012-10-22T12:46:49+00:00</updated_at> <user_id type="integer">2</user_id> <recipe_steps type="array"> <recipe_step> <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values/> <failure_goto_step type="integer">2</failure_goto_step> <id type="integer">1</id> <number type="integer">1</number> <on_failure>goto_step</on_failure> <on_success>proceed</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values type="boolean">true</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>mkdir /tmp</script> <success_goto_step nil="true"/> <updated_at

BILLING PLANS - GET THE LIST OF BILLING PLANS 901

Page 903: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="datetime">2012-10-22T12:46:49+00:00</updated_at> </recipe_step> </recipe_steps> </recipe></recipes>

Where:compatible_with - recipe compatibility: windows or unix

created_at — the date when the recipe was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdescription - recipe descriptionid - recipe IDlabel - recipe labelscript_type - script type for Windows-compatible recipes: bat vbs powershell (PowerShell v1.0)

updated_at — the date when the recipe was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

use_on_hv_zones - true, if the recipe can be used on compute zones, otherwise false

use_on_vms - true, if the recipe can be used on virtual servers, otherwise false

user_id — the ID of a recipe owner

recipe_steps - an array of recipe steps with the following details:

created_at — the date when the step was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at — the date when the step was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

fail_anything_else - set true, if you have specified the recipe pass value, otherwise set false

You can only specify behavior for one scenario: for example, if the fail_anything_else = false, pass_anything_else must be set to true.

fail_values - recipe fail value

failure_goto_step - if the on_failure parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

id - step ID

number - step number

on_failure - step behavior in case of failure:

o proceed - proceed to the next step.

BILLING PLANS - GET THE LIST OF BILLING PLANS 902

Page 904: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

on_success - step behavior in case of success:

o proceed - proceed to the next step.

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

pass_anything_else - set true, if you have specified the recipe fail value, otherwise set false

pass_values - recipe pass value

recipe_id - ID of a recipe the step belongs to

result_source - step result source:

o exit_code - an exit status, e.g. 0 will be returned on success

o std_out - standard output

o std_err - standard error

o std_out_and_std_err - standard output and standard error

success_goto_step - if the on_success parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

74.2 Get List of Servers Using RecipeGET /recipes/:recipe_id/applied_to_vs.xmlGET /recipes/:recipe_id/applied_to_vs.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id/applied_to_vs.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id/applied_to_vs.json -H 'Accept:

BILLING PLANS - GET THE LIST OF BILLING PLANS 903

Page 905: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><virtual_machines type="array"> <virtual_machine> <identifier>ha5iw2q1uu89vd</identifier> <template_id type="integer">594</template_id> <vm_events type="array"> <vm_event>vm_provisioning</vm_event> </vm_events> </virtual_machine> <virtual_machine> <identifier>qxhokd7mgxiw69</identifier> <template_id type="integer">111</template_id> <vm_events type="array"> <vm_event>vm_provisioning</vm_event> </vm_events> </virtual_machine></virtual_machines>

To assign recipes to multiple virtual or smart servers, see Run Recipe on Multiple Virtual Servers and Run Recipe on Multiple Smart Servers sections.

74.3 Get Recipe DetailsTo view recipe details:GET /recipes/:recipe_id.xmlGET /recipes/:recipe_id.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id.json -H 'Accept: application/json' -H 'Content-type: application/json'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id.xmml -H 'Accept: application/xml' -H 'Content-type: application/xml'

BILLING PLANS - GET THE LIST OF BILLING PLANS 904

Page 906: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example

<?xml version="1.0" encoding="UTF-8"?><recipe> <compatible_with>unix</compatible_with> <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at> <description>Create initial folder structure</description> <id type="integer">1</id> <label>Create folders</label> <script_type>vbs</script_type> <updated_at type="datetime">2012-10-22T12:46:49+00:00</updated_at> <user_id type="integer">2</user_id> <recipe_steps type="array"> <recipe_step> <created_at type="datetime">2012-10-22T12:46:49+00:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values/> <failure_goto_step type="integer">2</failure_goto_step> <id type="integer">1</id> <number type="integer">1</number> <on_failure>goto_step</on_failure> <on_success>proceed</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values type="boolean">true</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>mkdir /tmp</script> <success_goto_step nil="true"/> <updated_at type="datetime">2012-10-22T12:46:49+00:00</updated_at> </step> </steps></recipe>

Where:compatible_with - recipe compatibility: windows or unix

created_at — the date when the recipe was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdescription - recipe descriptionid - recipe IDlabel - recipe labelscript_type - script type for Windows-compatible recipes: bat vbs powershell (PowerShell v1.0)

updated_at — the date when the recipe was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 905

Page 907: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

use_on_hv_zones - true, if the recipe can be used on compute zones, otherwise false

use_on_vms - true, if the recipe can be used on virtual servers, otherwise false

user_id — the ID of a recipe owner

recipe_steps - an array of recipe steps with the following details:

created_at — the date when the step was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at — the date when the step was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

fail_anything_else - set true, if you have specified the recipe pass value, otherwise set false

You can only specify behavior for one scenario: for example, if the fail_anything_else = false, pass_anything_else must be set to true.

fail_values - recipe fail value

failure_goto_step - if the on_failure parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

id - step ID

number - step number

on_failure - step behavior in case of failure:

o proceed - proceed to the next step.

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

on_success - step behavior in case of success:

o proceed - proceed to the next step.

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

pass_anything_ else - set true, if you have specified the recipe fail value, otherwise set false

pass_values - recipe pass value

recipe_id - ID of a recipe the step belongs to

result_source - step result source:

o exit_code - an exit status, e.g. 0 will be returned on success

BILLING PLANS - GET THE LIST OF BILLING PLANS 906

Page 908: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o std_out - standard output

o std_err - standard error

o std_out_and_std_err - standard output and standard error

success_goto_step - if the on_success parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

74.4 Add RecipeTo create a recipe:POST /recipes.xmlPOST /recipes.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/recipes.xml -d '<recipe><label>New Label</label><description>New description</description><compatible_with>windows</compatible_with><script_type>bat</script_type></recipe>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/recipes.json -d '{"recipe":{"label":"New Label", "description":"New Description","compatible_with":"windows","script_type":"bat"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where you have to specify the following parameters:label - recipe labeldescription - recipe descriptioncompatible_with - recipe compatibility: windows or unixscript_type - script type for Windows-compatible recipes: bat vbs powershell (PowerShell v1.0)

This parameter is for Windows recipes only.

BILLING PLANS - GET THE LIST OF BILLING PLANS 907

Page 909: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74.5 Edit RecipeTo edit recipe:PUT /recipes/:recipe_id.xmlPUT /recipes/:recipe_id.jsonXML Request example

curl -i -X PUT -u user:userpass http://onapp.test/recipes/:recipe_id.xml -d '<recipe><label>New Label</label><description>New description</description><compatible_with>windows</compatible_with><script_type>bat</script_type></recipe>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/recipes/:recipe_id.json -d '{"recipe":{"label":"New Label","description":"New Description","compatible_with":"windows","script_type":"bat"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where you can edit the following recipe parameters:label - recipe labeldescription - recipe descriptioncompatible_with - recipe compatibility: windows or unixscript_type - script type for Windows-compatible recipes: bat vbs powershell (PowerShell v1.0)

This parameter is for Windows recipes only.

74.6 Delete RecipeTo delete a recipe:DELETE /recipes/:recipe_id.xmlDELETE /recipes/:recipe_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 908

Page 910: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -X DELETE -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass http://onapp.test/recipes/:recipe_id.xml'

JSON Request example

curl -i -X DELETE -H 'Accept: application/json' -H 'Content-type:application/json' -u user:userpass http://onapp.test/recipes/:recipe_id.json'

Where you have to specify the recipe ID.

74.7 Manage Recipe StepsUse the API calls provided in this section to create, edit and delete recipe steps.

74.7.1 Get the List of Recipe StepsGET /recipes/:recipe_id/recipe_steps.xmlGET /recipes/:recipe_id/recipe_steps.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><recipe> <compatible_with>unix</compatible_with> <created_at type="datetime">2013-04-19T10:26:41+03:00</created_at> <description>Apache example</description> <id type="integer">1</id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 909

Page 911: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<label>Apache example</label> <script_type>bat</script_type> <updated_at type="datetime">2013-05-13T13:08:00+03:00</updated_at> <user_id type="integer">6</user_id> <recipe_steps type="array"> <recipe_step> <created_at type="datetime">2013-04-19T10:29:50+03:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values></fail_values> <failure_goto_step nil="true"/> <id type="integer">1</id> <number type="integer">1</number> <on_failure>fail</on_failure> <on_success>proceed</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values>0</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>#if echo $OPERATING_SYSTEM_DISTRO |grep rhel ; then if rpm -qa |grep httpd |grep -v grep ; then yum -y update httpd else yum -y install httpd fi#else # exit 1#fi</script> <success_goto_step nil="true"/> <updated_at type="datetime">2013-04-26T12:37:28+03:00</updated_at> </recipe_step> <recipe_step> <created_at type="datetime">2013-04-23T13:54:02+03:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values></fail_values> <failure_goto_step type="integer">4</failure_goto_step> <id type="integer">2</id> <number type="integer">2</number> <on_failure>goto_step</on_failure> <on_success>goto_step</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values>0</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>echo "&lt;p&gt;&lt;a href=http://$CP_ADDRESS&gt;OnApp Cloud&lt;/a&gt;&lt;/p&gt;" &gt; /var/www/html/index.html</script>

BILLING PLANS - GET THE LIST OF BILLING PLANS 910

Page 912: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<success_goto_step type="integer">5</success_goto_step> <updated_at type="datetime">2013-04-26T13:03:26+03:00</updated_at> </recipe_step> <recipe_step> <created_at type="datetime">2013-04-26T11:42:58+03:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values></fail_values> <failure_goto_step nil="true"/> <id type="integer">19</id> <number type="integer">3</number> <on_failure>fail</on_failure> <on_success>stop</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values>0</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>service httpd restart</script> <success_goto_step nil="true"/> <updated_at type="datetime">2013-04-26T11:42:58+03:00</updated_at> </recipe_step> <recipe_step> <created_at type="datetime">2013-04-26T11:44:05+03:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values></fail_values> <failure_goto_step nil="true"/> <id type="integer">20</id> <number type="integer">4</number> <on_failure>fail</on_failure> <on_success>stop</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values>0</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>echo "Can not write to file" &gt; /var/log/recipes.log</script> <success_goto_step nil="true"/> <updated_at type="datetime">2013-04-26T12:38:51+03:00</updated_at> </recipe_step> <recipe_step> <created_at type="datetime">2013-04-26T11:52:53+03:00</created_at> <fail_anything_else type="boolean">true</fail_anything_else> <fail_values></fail_values>

BILLING PLANS - GET THE LIST OF BILLING PLANS 911

Page 913: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<failure_goto_step type="integer">4</failure_goto_step> <id type="integer">21</id> <number type="integer">5</number> <on_failure>goto_step</on_failure> <on_success>goto_step</on_success> <pass_anything_else type="boolean">false</pass_anything_else> <pass_values>0</pass_values> <recipe_id type="integer">1</recipe_id> <result_source>exit_code</result_source> <script>echo "&lt;p&gt;&lt;a href=http://$IP_ADDRESS&gt;$HOSTNAME&lt;/a&gt;&lt;/p&gt;" &gt;&gt; /var/www/html/index.html</script> <success_goto_step type="integer">3</success_goto_step> <updated_at type="datetime">2013-04-26T12:45:56+03:00</updated_at> </recipe_step> </recipe_steps></recipe>

Where:compatible_with - recipe compatibility: windows or unix

created_at — the date when the recipe was created in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdescription - recipe descriptionid - recipe IDlabel - recipe labelscript_type - script type for Windows-compatible recipes: bat vbs powershell (PowerShell v1.0)

updated_at — the date when the recipe was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

use_on_hv_zones - true, if the recipe can be used on compute zones, otherwise false

use_on_vms - true, if the recipe can be used on virtual servers, otherwise false

user_id — the ID of a recipe owner

recipe_steps - an array of recipe steps with the following details:

created_at — the date when the step was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format

updated_at — the date when the step was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

fail_anything_else - set true, if you have specified the recipe pass value, otherwise set false

BILLING PLANS - GET THE LIST OF BILLING PLANS 912

Page 914: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

You can only specify behavior for one scenario: for example, if the fail_anything_else = false, pass_anything_else must be set to true.

fail_values - recipe fail value

failure_goto_step - if the on_failure parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

id - step ID

number - step number

on_failure - step behavior in case of failure:

o proceed - proceed to the next step.

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

on_success - step behavior in case of success:

o proceed - proceed to the next step.

o fail - terminate the recipe and mark it as failed.

o stop - terminate the recipe and mark it as successful.

o go_to_step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

pass_anything_else - set true, if you have specified the recipe fail value, otherwise set false

pass_values - recipe pass value

recipe_id - ID of a recipe the step belongs to

result_source - step result source:

o exit_code - an exit status, e.g. 0 will be returned on success

o std_out - standard output

o std_err - standard error

o std_out_and_std_err - standard output and standard error

success_goto_step - if the on_success parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

BILLING PLANS - GET THE LIST OF BILLING PLANS 913

Page 915: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74.7.2 Create Recipe StepPOST /recipes/:recipe_id/recipe_steps.xmlPOST /recipes/:recipe_id/recipe_steps.jsonXML Request example

curl -i -X POST -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps.xml -d '<recipe_step><script>uptime&gt;/tmp/uptime.log</script><result_source>exit_code</result_source><pass_anything_else>0</pass_anything_else><pass_values>0</pass_values><on_success>proceed</on_success><success_goto_step></success_goto_step><fail_anything_else>1</fail_anything_else><fail_values></fail_values><on_failure>proceed</on_failure><failure_goto_step></failure_goto_step></recipe_step>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps.json -d '{"recipe_step":{"script":"uptime >/tmp/uptime.log", "result_source":"exit_code","pass_anything_else":"0","pass_values":"0","on_success":"proceed","success_goto_step":"","fail_anything_else":"1","fail_values":"","on_failure":"proceed","failure_goto_step":""}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where you can specify the following parameters:script - recipe step coderesult_source - step result source: exit_code - an exit status, e.g. 0 will be returned on success

To use exit code in the VBS or PowerShell scripts, you have to specify it directly in the script. For example:

VBSScript:WScript.Echo "test"WScript.Quit 95PowerShellScript:get-date -displayhint dateexit 227

std_out - standard output std_err - standard error std_out_and_std_err - standard output and standard error

pass_anything_else - set true, if you have specified the recipe fail value, otherwise set false

BILLING PLANS - GET THE LIST OF BILLING PLANS 914

Page 916: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

pass_values - step pass value

on_success - step behavior in case of success:

proceed - proceed to the next step.

fail - terminate the recipe and mark it as failed.

stop - terminate the recipe and mark it as successful.

go to step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

success_goto_step - if the on_success parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

fail_anything_else - set true, if you have specified the recipe pass value, otherwise set false

fail_values - step fail value

on_failure - step behavior in case of failure:

proceed - proceed to the next step.

fail - terminate the recipe and mark it as failed.

stop - terminate the recipe and mark it as successful.

go to step - specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

failure_goto_step - if the on_failure parameter = go to step, specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

You can only specify behavior for one scenario: for example, if the fail_anything_else = false, pass_anything_else must be set to true.

74.7.3 Edit Recipe StepTo edit recipe step:PUT /recipes/:recipe_id/recipe_steps/:recipe_step_id.xmlPUT /recipes/:recipe_id/recipe_steps/:recipe_step_id.jsonXML Request example

curl -i -X PUT -u user:serpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 915

Page 917: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id.xml -d '<recipe_step><script>echo "123"</script></recipe_step>' -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id.json -d '{"recipe_step":{"script":"echo abc"}}' -H 'Accept: application/json' -H 'Content-type: application/json'

Where you can edit:script - step code

74.7.4 Remove Recipe StepPUT /recipes/:recipe_id/recipe_steps/:recipe_step_id.xmlPUT /recipes/:recipe_id/recipe_steps/:recipe_step_id.jsonXML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:In the URL, specify the ID of a recipe the step belongs to and the ID of a step you want to remove.

74.7.5 Swap Recipe Steps LocationsTo interchange recipe steps, use the following API call:

XML Request example

curl -i -X PUT -u user:userpass http://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id/move_to/:recipe_step_number.xml -H 'Accept: application/xml' -H

BILLING PLANS - GET THE LIST OF BILLING PLANS 916

Page 918: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Content-type: application/xml'

JSON Request example

curl -i -X PUT -u user:userpasshttp://onapp.test/recipes/:recipe_id/recipe_steps/:recipe_step_id/move_to/:recipe_step_number.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where you need to specify the IDs of recipes you want to move in the URL.

74.8 Manage Virtual Server RecipesUse the following API calls to view, assign and delete virtual server recipes in your cloud.

74.8.1 Get the List of Virtual Server RecipesGET /virtual_machines/:virtual_machine_id/recipe_joins.xmlGET /virtual_machines/:virtual_machine_id/recipe_joins.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

74.8.2 Assign Recipe to Virtual ServerPOST /virtual_machines/:virtual_machine_id/recipe_joins.xmlPOST /virtual_machines/:virtual_machine_id/recipe_joins.jsonXML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 917

Page 919: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type></recipe_join>' -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/recipe_joins.xml

JSON Request example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}}' -u user:userpass http://onapp.test/virtual_machines/:virtual_machine_id/recipe_joins.json

Where you have to specify:recipe_join - an array of recipe join details: recipe_id - ID of a recipe you want to assign event_type - type of the event you want to assign the recipe to:

o vm_provisioning - run the recipe during VS provisioningo vm_network_rebuild - run the recipe when rebuilding a networko vm_disk_add - run the recipe when adding a disko vm_nic_add - run the recipe when adding a network interfaceo vm_disk_resize - run the recipe when resizing a VS disko vm_resize - run the recipe when resizing a VS

virtual_machine_id - ID of a virtual server you want to assign the recipe to

74.8.3 Remove Recipe from Virtual ServerDELETE /virtual_machines/:virtual_machine_id/recipe_joins/:recipe_join_id.xmlDELETE /virtual_machines/:virtual_machine_id/recipe_joins/:recipe_join_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/virtual_machines/h76rawyvwphxk6/recipe_joins/1.xml

JSON Request example

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/virtual_machines/h76rawyvwphxk6/recipe_joins/1.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 918

Page 920: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

In the URL, specify the ID of a virtual server and the ID of a recipe you want to remove.

74.8.4 Run Recipe on Multiple Virtual ServersPOST /recipes/:recipe_id/run.xmlPOST /recipes/:recipe_id/run.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass -d '<virtual_machines type="array"><virtual_machine>vm1_identifier</virtual_machine><virtual_machine>vm2_identifier</virtual_machine></virtual_machines>' --url http://onapp.test/recipes/:recipe_id/run.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d '{"virtual_machines":[":vm1_identifier",":vm2_identifier"]}' --url http://onapp/recipes/:id/run.json

Where you have to specify:vm1_identifier - replace this with the identifier of a virtual server you want to run the recipe onID of the required recipe in the URL

When applying one recipe to several servers via API, there is possibility to run the recipe incompatible with the server type (Unix recipe on Windows server or vice versa). In this case the transaction will be scheduled and completed, but the recipe will not do anything.

To view the list of server the particular recipe is applied to, see the Get List of Servers Applied to Server request.

74.9 Manage Smart Server RecipesUse the following API calls to view, assign and delete smart server recipes in your cloud.

74.9.1 Get the List of Smart Server RecipesGET /smart_servers/:smart_server_id/recipe_joins.xmlGET /smart_servers/:smart_server_id/recipe_joins.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 919

Page 921: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -X GET -u user:userpass http://onapp.test/smart_servers/:smart_server_id/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/smart_servers/:smart_server_id/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

74.9.2 Assign Recipe to Smart ServerPOST /smart_servers/:smart_server_id/recipe_joins.xmlPOST /smart_servers/:smart_server_id/recipe_joins.jsonXML Request example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type><smart_server_id>h76rawyvwphxk6</smart_server_id></recipe_join>' -u user:userpass http://onapp.test/smart_servers/:smart_server_id/recipe_joins.xml

JSON Request example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}, "smart_server_id":"h76rawyvwphxk6"}' -u user:userpass http://onapp.test/smart_servers/:smart_server_id/recipe_joins.json

Where you have to specify:recipe_join - an array of recipe join details: recipe_id - ID of a recipe you want to assign event_type - type of the event you want to assign the recipe to:

o vm_provisioning - run the recipe during VS provisioning

o vm_network_rebuild - run the recipe when rebuilding a network

o vm_disk_add - run the recipe when adding a disk

BILLING PLANS - GET THE LIST OF BILLING PLANS 920

Page 922: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

o vm_nic_add - run the recipe when adding a network interface

o vm_disk_resize - run the recipe when resizing a VS disk

o vm_resize - run the recipe when resizing a VS

smart_server_id - ID of a smart server you want to assign the recipe to

74.9.3 Remove Recipe from Smart ServerDELETE /smart_servers/:smart_server_id/recipe_joins/:recipe_join_id.xmlDELETE /smart_servers/:smart_server_id/recipe_joins/:recipe_join_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/smart_servers/h76rawyvwphxk6/recipe_joins/:recipe_join_id.xml

JSON Request example

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/smart_servers/h76rawyvwphxk6/recipe_joins/:recipe_join_id.json

In the URL, specify the ID of a smart server and the ID of a recipe you want to remove.

74.9.4 Run Recipe on Multiple Smart ServersPOST /recipes/:recipe_id/run.xmlPOST /recipes/:recipe_id/run.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass -d '<smart_servers type="array"><smart_server>identifier1</smart_server><smart_server>identifier2</smart_server></smart_servers>' --url http://onapp.test/recipes/:recipe_id/run.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d ' {"smart_servers":["identifier1","identifier2"]}' --url

BILLING PLANS - GET THE LIST OF BILLING PLANS 921

Page 923: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/recipes/:recipe_id/run.json

Where you have to specify:identifier - identifier of a smart server you want to run the recipe onID of the required recipe in the URL

When applying one recipe to several servers via API, there is possibility to run the recipe incompatible with the server type (Unix recipe on Windows server or vice versa). In this case the transaction will be scheduled and completed, but the recipe will not do anything.

To view the list of server the particular recipe is applied to, see the Get List of Recipes Applied to Server request.

74.10 Manage Baremetal Server RecipesUse the following API calls to view, assign and delete baremetal server recipes in your cloud.

74.10.1 Get the List of Baremetal Server RecipesGET /baremetal_servers/:baremetal_server_id/recipe_joins.xmlGET /baremetal_servers/:baremetal_server_id/recipe_joins.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/baremetal_servers/:baremetal_server_id/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

74.10.2 Assign Recipe to Baremetal ServerYou can only assign recipes to baremetal server during the server creation process. Refer to the Create Baremetal Server section for details.

BILLING PLANS - GET THE LIST OF BILLING PLANS 922

Page 924: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74.10.3 Remove Recipe from Baremetal ServerDELETE /baremetal_servers/:baremetal_server_id/recipe_joins/:recipe_join_id.xmlDELETE /baremetal_servers/:baremetal_server_id/recipe_joins/:recipe_join_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/baremetal_servers/h76rawyvwphxk6/recipe_joins/:recipe_join_id.xml

JSON Request example

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/baremetal_servers/h76rawyvwphxk6/recipe_joins/:recipe_join_id.json

In the URL, specify the ID of a baremetal server and the ID of a recipe you want to remove.

74.11 Manage Template RecipesUse the following API calls to view, assign and delete template recipes in your cloud.

74.11.1 Get the List of Template RecipesGET /templates/:template_id/recipe_joins.xmlGET /templates/:template_id/recipe_joins.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/templates/:template_id/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/templates/:template_id/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

BILLING PLANS - GET THE LIST OF BILLING PLANS 923

Page 925: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

74.11.2 Assign Recipe to TemplatePOST /templates/:template_id/recipe_joins.xmlPOST /templates/:template_id/recipe_joins.jsonXML Request example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type></recipe_join>' -u user:userpass http://onapp.test/templates/:template_id/recipe_joins.xml

JSON Request example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6","event_type":"vm_provisioning"},"template_id":"1"}' -u user:userpass http://onapp.test/templates/:template_id/recipe_joins.json

Where you have to specify:recipe_id - ID of a recipe you want to assignevent_type - type of the event you want to assign the recipe to: vm_provisioning - run the recipe during VS provisioning vm_network_rebuild - run the recipe when rebuilding a network vm_disk_add - run the recipe when adding a disk vm_nic_add - run the recipe when adding a network interface vm_disk_resize - run the recipe when resizing a VS disk vm_resize - run the recipe when resizing a VS

template_id - ID of a template you want to assign the recipe to

74.11.3 Remove Recipe from TemplateDELETE /templates/:template_id/recipe_joins/:recipe_join_id.xmlDELETE /templates/:template_id/recipe_joins/:recipe_join_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/templates/2/recipe_joins/:recipe_join_id.xml

JSON Request example

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/templates/2/recipe_joins/:recipe_join_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 924

Page 926: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

In the URL, specify the template ID and the ID of a recipe you want to remove.

74.12 Manage Compute Zone RecipesUse the following API calls to view, assign and delete compute zone recipes in your cloud.

74.12.1 Get the List of Compute Zone RecipesGET /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.xmlGET /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

74.12.2 Assign Recipe to Compute ZonePOST /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.xmlPOST /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.jsonXML Request example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type><template_id>h76rawyvwphxk6</template_id></recipe_join>' -u user:userpass http://onapp.test/settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.xml

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 925

Page 927: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}, "template_id":"h76rawyvwphxk6"}' -u user:userpass http://onapp.test//settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins.json

Where you have to specify:recipe_id - ID of a recipe you want to assignevent_type - type of the event you want to assign the recipe to: hv_goes_online - run the recipe when the compute resource comes online hv_goes_offline - run the recipe when the compute resource goes offline

NOTE: The recipe will be triggered when the statistics is not received from a compute resource for a certain period of time for some reason. If the compute resource is offline, the recipe will not run.

vm_provisioning - run the recipe during VS provisioning vm_network_rebuild - run the recipe when rebuilding a network vm_disk_add - run the recipe when adding a disk vm_nic_add - run the recipe when adding a network interface vm_disk_resize - run the recipe when resizing a VSs disk vm_resize - run the recipe when resizing a VS

hypervisor_zone_id - ID of a compute zone you want to assign the recipe to

74.12.3 Remove Recipe from Compute ZoneDELETE /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins/:recipe_join_id.xmlDELETE /settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins/:recipe_join_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins/:recipe_join_id.xml

JSON Request example

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/settings/:hypervisor_zones/:hypervisor_zone_id/recipe_joins/:recipe_join_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 926

Page 928: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

In the URL, specify the compute zone ID and the ID of a recipe you want to remove.

74.13 Manage Control Panel RecipesUse the following API calls to view, assign and delete control panel recipes.

74.13.1 Get the List of Control Panel RecipesGET /settings/control_panel/recipe_joins.xmlGET /settings/control_panel/recipe_joins.jsonXML Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/control_panel/recipe_joins.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/settings/control_panel/recipe_joins.json -H 'Accept: application/json' -H 'Content-type: application/json'

Shows the same recipe attributes as in the Get List of Recipes section.

74.13.2 Assign Recipe to Control PanelPOST /settings/control_panel/recipe_joins.xmlPOST /settings/control_panel/recipe_joins.jsonXML Request example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type></recipe_join>' -u user:userpass http://onapp.test/settings/control_panel/recipe_joins.xml

JSON Request example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}}' -u user:userpass http://onapp.test/settings/control_panel/recipe_joins.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 927

Page 929: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where you have to specify:recipe_id - ID of a recipe you want to assignevent_type - type of the event you want to assign the recipe to: kvm_hv_goes_online - run the recipe when the KVM compute resource comes

online kvm_hv_goes_offline - run the recipe when the KVM compute resource goes

offline xen_hv_goes_online - run the recipe when the Xen compute resource comes

online xen_hv_goes_offline - run the recipe when the Xen compute resource goes

offline vmware_hv_goes_online - run the recipe when the VMware compute resource

comes online vmware_hv_goes_offline - run the recipe when the VMware compute resource

goes offline

NOTE: The recipe will be triggered when the statistics is not received from a compute resource for a certain period of time for some reason. If the compute resource is offline, the recipe will not run.

hv_added - run the recipe when the new compute resource is added

hv_removed - run the recipe when compute resource is removed

vm_provisioning - run the recipe during VS provisioning

vm_network_rebuild - run the recipe when rebuilding a network

vm_disk_add - run the recipe when adding a disk

vm_nic_add - run the recipe when adding a network interface

vm_disk_resize - run the recipe when resizing a VS disk

vm_resize - run the recipe when resizing a VS

74.13.3 Remove Recipe from Control PanelDELETE settings/control_panel/recipe_joins/:recipe_id.xmlDELETE settings/control_panel/recipe_joins/:recipe_id.jsonXML Request example

curl -i -X DELETE -H "Accept: application/xml" -H "Content-type:application/xml" -u user:userpass http://onapp.test/settings/control_panel/recipe_joins/:recipe_id.xml

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 928

Page 930: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X DELETE -H "Accept: application/json" -H "Content-type:application/json" -u user:userpass http://onapp.test/settings/control_panel/recipe_joins/:recipe_id.json

In the URL, specify the ID of a recipe you want to remove.

BILLING PLANS - GET THE LIST OF BILLING PLANS 929

Page 931: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

75 RESOLVERS

Resolvers translate hostnames to IP addresses. At least two resolvers should be specified for each network in the system. View, edit and delete commands are available for existing resolvers.Resolvers are known as name servers in the API.

75.1 Get List of ResolversUse the following method to get the list of all available resolvers in your cloud: GET /settings/nameservers.xml GET /settings/nameservers.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><nameservers type="array"><nameserver><address>8.8.8.8</address><created_at type="datetime">2011-02-14T15:55:44+02:00</created_at><network_id type="integer">1</network_id><updated_at type="datetime">2011-02-14T15:55:44+02:00</updated_at><id type="integer">1</id></nameserver>...<nameserver></nameserver>...</nameservers>

Where:address - the resolver IP addresscreated_at - the timestamp in database when this record was creatednetwork_id - the ID of the network to which this resolver belongsupdated_at - the timestamp in database to which this resolver belongsid - the ID of this resolver

75.2 Get Resolver DetailsTo get details for a particular resolver:GET /settings/nameservers/:id.xmlGET /settings/nameservers/:id.json XML Output example

BILLING PLANS - GET THE LIST OF BILLING PLANS 930

Page 932: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<?xml version="1.0" encoding="UTF-8"?><nameserver><address>8.8.8.8</address><created_at type="datetime">2011-02-14T15:55:44+02:00</created_at><network_id type="integer">1</network_id><updated_at type="datetime">2011-02-14T15:55:44+02:00</updated_at><id type="integer">1</id></nameserver>

The parameters are the same as for Get List of Resolvers request.

75.3 Add ResolverTo add a new resolver, use the following method:POST /settings/nameservers.xmlPOST /settings/nameservers.json XML Request Example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<nameserver><address>124.123.123.123</address><network_id>1</network_id></nameserver>' --url http://onapp.test/settings/nameservers.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"nameserver":{"address":"126.123.123.123","network_id":"1"}}' --url http://onapp.test/settings/nameservers.json

Set the following parameters:address* - the resolver IP addressnetwork_id* - the ID of the network to which this resolver should belong

75.4 Edit ResolverUse the following method to edit a resolver:PUT /settings/nameservers/:id.xmlPUT /settings/nameservers/:id.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 931

Page 933: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<nameserver><adress>128.123.123.123</address><network_id>3</network_id></nameserver>' --url http://onapp.test/settings/nameservers/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"nameserver":{"address":"129.123.123.123","network_id":"6"}}' --url http://onapp.test/settings/nameservers/:id.json

You can edit the address and network_id parameters.

75.5 Delete ResolverTo delete a resolver:DELETE /settings/nameservers/:id.xmlDELETE /settings/nameservers/:id.jsonXML Request example

curl -i -X DELETE -u user:userpass --urlhttp://onapp.test/settings/nameservers/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/nameservers/:id.json

Returns HTTP 200 response on successful deletion, or HTTP 404 when a resolver with the ID specified is not found, or the URL requested is incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 932

Page 934: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

76 RESOURCE POOLS

This section provides the API calls you can use to manage resource pools imported from vCloud Director.

76.1 Get List of Resource PoolsTo view the list of resource pools, use the following request:GET /vdcs.xmlGET /vdcs.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/vdcs.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/vdcs.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vdcs type="array"> <vdc> <allocation_model>AllocationPool</allocation_model> <guaranteed_memory>0.2</guaranteed_memory> <cpu_allocated>6000</cpu_allocated> <updated_at>2016-02-02T23:00:35+00:00</updated_at> <cpu_limit>6000</cpu_limit> <cpu_used>2000</cpu_used> <guaranteed_cpu>0.11</guaranteed_cpu> <id>6</id> <vcpu_speed>1000</vcpu_speed> <label>onapp vDC 1 allocation pool</label> <thin_provisioning>true</thin_provisioning> <memory_used>1536</memory_used> <memory_limit>8192</memory_limit> <vm_quota>0</vm_quota> <memory_reserved>1638</memory_reserved> <fast_provisioning>true</fast_provisioning> <network_quota>1000</network_quota> <created_at>2016-02-01T11:43:43+00:00</created_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 933

Page 935: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<enabled>true</enabled> <cpu_reserved>660</cpu_reserved> <memory_allocated>8192</memory_allocated> <user_group_id>11</user_group_id> <identifier>9d740561-7960-4fdc-b795-c33142a6d125</identifier> </vdc> <vdc>...</vdc> </vdcs>

Where:allocation_model - the type resource poolguaranteed_memory - the amount of memory (%) guaranteed to this resource poolcpu_allocated - the amount of CPU (MHz) allocated to this resource poolupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcpu_limit - the maximum amount of CPU resources which can be usedcpu_used - the amount of used CPU resourcesguaranteed_cpu - the amount of CPU resources (%) guaranteed to this resource poolid - the ID of the resource poolvcpu_speed - the speed of vCPU ( in MHz)label - the name of the resource poolthin_provisioning - true if the thin provisioning is enabled for this resource pool; otherwise falsememory_used - the amount of used memory (MB)memory_limit - the maximum amount of memory which can be usedvm_quota - the number of virtual servers that can be created within this resource poolmemory_reserved - the amount of reserved memory (MB)fast_provisioning - true if the fast provisioning is enabled for this resource pool; otherwise falsenetwork_quota - the number of networks that can be created within this resource poolcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true if the resource pool is enabled; otherwise falsecpu_reserved - the amount of reserved CPU resourcesmemory_allocated - the amount of memory (MB) allocated to this resource pooluser_group_id - the ID of the organisation, to which the resource pool is assignedidentifier - the identifier of the resource pool

76.2 Get Resource Pool DetailsTo view the details of a resource pool, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 934

Page 936: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /vdcs/:id.xmlGET /vdcs/:id.jsonXML Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/vdcs/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -X GET -u user:userpass --url http://onapp.test/vdcs/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<vdc> <allocation_model>AllocationPool</allocation_model> <guaranteed_memory>0.2</guaranteed_memory> <cpu_allocated>6000</cpu_allocated> <updated_at>2016-02-02T23:00:35+00:00</updated_at> <cpu_limit>6000</cpu_limit> <cpu_used>2000</cpu_used> <guaranteed_cpu>0.11</guaranteed_cpu> <id>6</id> <vcpu_speed>1000</vcpu_speed> <label>onapp vDC 1 allocation pool</label> <thin_provisioning>true</thin_provisioning> <memory_used>1536</memory_used> <memory_limit>8192</memory_limit> <vm_quota>0</vm_quota> <memory_reserved>1638</memory_reserved> <fast_provisioning>true</fast_provisioning> <network_quota>1000</network_quota> <created_at>2016-02-01T11:43:43+00:00</created_at> <enabled>true</enabled> <cpu_reserved>660</cpu_reserved> <memory_allocated>8192</memory_allocated> <user_group_id>11</user_group_id> <identifier>9d740561-7960-4fdc-b795-c33142a6d125</identifier> </vdc>

Where:allocation_model - the type resource poolguaranteed_memory - the amount of memory (%) guaranteed to this resource poolcpu_allocated - the amount of CPU (MHz) allocated to this resource poolupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcpu_limit - the maximum amount of CPU resources which can be used

BILLING PLANS - GET THE LIST OF BILLING PLANS 935

Page 937: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_used - the amount of used CPU resourcesguaranteed_cpu - the amount of CPU resources (%) guaranteed to this resource poolid - the ID of the resource poolvcpu_speed - the speed of vCPU ( in MHz)label - the name of the resource poolthin_provisioning - true if the thin provisioning is enabled for this resource pool; otherwise falsememory_used - the amount of used memory (MB)memory_limit - the maximum amount of memory which can be usedvm_quota - the number of virtual servers that can be created within this resource poolmemory_reserved - the amount of reserved memory (MB)fast_provisioning - true if the fast provisioning is enabled for this resource pool; otherwise falsenetwork_quota - the number of networks that can be created within this resource poolcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true if the resource pool is enabled; otherwise falsecpu_reserved - the amount of reserved CPU resourcesmemory_allocated - the amount of memory (MB) allocated to this resource pooluser_group_id - the ID of the organisation, to which the resource pool is assignedidentifier - the identifier of the resource pool

76.3 Get Billing Statistics for Resource Pool

Use the following API call to view the billing statistics for a resource pool:GET /vdcs/:id/statistics.xmlGET /vdcs/:id/statistics.jsonXML Request example

curl -i -X GET http://onapp.test/vdcs/:id/statistics.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/vdcs/:id/statistics.json -u user:userpass

External network labels in vCloud and vCenter should be identical and unique, otherwise, network interface statistics will incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 936

Page 938: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Output example

<?xml version="1.0" encoding="UTF-8"?><vdc_stat type="array"> <vdc_stat> <id type="integer">88779</id> <company_id type="integer">89</company_id> <vdc_id type="integer">48</vdc_id> <cost type="float">0.0</cost> <currency_code>USD</currency_code> <stat_time type="datetime">2016-01-01T00:00:00Z</stat_time> <created_at type="datetime">2016-01-01T00:00:31Z</created_at> <updated_at type="datetime">2016-01-01T00:00:31Z</updated_at> <vdc_model_type>Allocation</vdc_model_type> <status type="symbol">enabled</status> <resource_elements> <cpu_allocation type="float">1.0</cpu_allocation> <cpu_resource_guaranteed type="float">10</cpu_resource_guaranteed> <cpu_used type="float">0.0</cpu_used> <deployed_edge_gateways type="float">1.0</deployed_edge_gateways> <deployed_org_networks type="float">0.0</deployed_org_networks> <fast_provisioning_set type="float">1.0</fast_provisioning_set> <memory_allocation type="float">8.0</memory_allocation> <memory_resource_guaranteed type="float">10</memory_resource_guaranteed> <memory_used type="float">0.0</memory_used> <thin_provisioning_set type="float">0.0</thin_provisioning_set> <vcpu_speed type="decimal">1000.0</vcpu_speed> <vs_count type="float">0.0</vs_count> <vs_limit type="float">100.0</vs_limit> </resource_elements> <data_stores type="array"> <data_store> <data_store_id type="integer">64</data_store_id> <allocated_amount type="float">512.0</allocated_amount> <used_amount type="float">300.0</used_amount> </data_store> </data_stores> <network_interfaces type="array"> <network_interface> <network_interface_id type="integer">117</network_interface_id> <data_sent type="float">0.0</data_sent> <data_received type="float">0.0</data_received>

BILLING PLANS - GET THE LIST OF BILLING PLANS 937

Page 939: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<ip_addresses type="float">1.0</ip_addresses> </network_interface> </network_interfaces> </vdc_stat> <vdc_stat>...</vdc_stat></vdc_stat>

Where:

id - the ID of this unit of statisticscompany_id - ID of the company with which the resource pool is associatedvdc_id - ID of the resource pool to which these statistics refercost - the total due for the resource pool, network usage and storage policy usage for the hour for which these statistics have been generatedcurrency_code - the code of the currency you're going to charge instat_time - the time when the statistics have been recordedcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatvdc_model - the type of resource pool ( allocation, reservation or Pay-As-You-Go)status - whether the resource pool is enabled or notresource_elements - an array of parameters that refer to resource pools:

cost - the total due for the resource

compute zone - ID of the compute zone

cpu_limit (for Pay-As-You-Go resource pool only) - the maximum amount of CPU resources which can be usedcpu_allocation - the amount of CPU (GHz) allocated to this resource poolcpu_resource_guaranteed - the amount of CPU resources (%) guaranteed to this resource poolcpu_used - the amount of CPU resources used during the hour for which these statistics has been generateddeployed_edge_gateways - the total number of edge gateways deployed within this resource pool

deployed_org_networks - the total number of org networks deployed within this resource poolfast_provisioning_set - 1.0 if fast provisioning is enabled for the resource pool, otherwise 0.0

memory_limit (for Pay-As-You-Go resource pool only) - the maximum amount of memory which can be usedmemory_allocation - the amount of memory (GB) allocated to this resource poolmemory_resource_guaranteed - the amount of memory (%) guaranteed to this resource poolmemory_used - the amount of memory (GB) used during the hour for which these statistics have been generated

BILLING PLANS - GET THE LIST OF BILLING PLANS 938

Page 940: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

thin_provisioning_set - 1.0 if thin provisioning is enabled for the resource pool, otherwise 0.0vcpu_speed - the vCPU speed that can be consumed after the resource pool is createdvs_count - the number of VSs deployed within the resource poolvs_limit - the number of virtual servers that can be created within this resource pool (VS quota)data_stores - an array of parameters that refer to data stores:

data_store_zone_id - the ID of the data store zone associated with the resource pooldata_store_id - the ID of the data store associated with the resource pool

cost - the total due for the resourceallocated_amount - the amount of disk size allocated to this resource pool. For Pay-as-you-go, if the allocated amount is unlimited, OnApp represents it as 99999 value.used_amount - the amount of disk size (GB) used during the hour for which these statistics have been generatednetwork_interfaces - an array of parameters that refer to network interfaces:

network_zone_id - ID of the network zone associated with the resource poolnetwork_interface_id - ID of the network interface associated with the resource pool

cost - the total due for the resourcedata_sent - the amount of data sent during the hour for which these statistics have been generateddata_received - the amount of data received during the hour for which these statistics have been generatedip_addresses - the total number of IP addresses used at the point when these statistics were generated

76.3.1 Page historyv5.0:

Added the following parameters:

cost

compute zone

deployed_org_networks

data_store_zone_id

network_zone_id

cpu_limit

memory_limit

BILLING PLANS - GET THE LIST OF BILLING PLANS 939

Page 941: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

76.4 Create Resource PoolTo create a resource pool, use the following request:POST /vdcs.xmlPOST /vdcs.jsonXML Request example:

curl -i -X POST -u user:password --url http://onapp.test/vdcs.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<vdc><label>foobar</label><user_group_id>8</user_group_id><provider_vdc_id>1</provider_vdc_id><network_pool_identifier>222and215-97dd-4531-96cf-ce2dc2ac426f</network_pool_identifier><allocation_model>AllocationPool</allocation_model><cpu_allocated>1.1</cpu_allocated><memory_allocated>10</memory_allocated><guaranteed_cpu>30</guaranteed_cpu><guaranteed_memory>20</guaranteed_memory><thin_provisioning>true</thin_provisioning><fast_provisioning>true</fast_provisioning><data_store_attributes></data_store_attributes><data_store><data_store_group_id>4</data_store_group_id><data_store_size>55</data_store_size></data_store></vdc>'

JSON Request example:

curl -i -X POST -u user:password --url http://onapp.test/vdcs.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"vdc": {"label": "foobar2", "network_pool_identifier": "222and215-97dd-4531-96cf-ce2dc2ac426f", "user_group_id": "8", "provider_vdc_id": "1", "allocation_model": "AllocationPool", "cpu_allocated": "1.1", "memory_allocated": "10", "guaranteed_cpu": "30", "guaranteed_memory": "20", "thin_provisioning": true, "fast_provisioning": true, "data_stores_attributes": [{"data_store_group_id": 4, "data_store_size": "22", "data_store_type": "vcloud"}]}}'

Where:

label - specify a name for the resource pooluser_group_id - specify the ID of a user group to which this resource pool will be assignedprovider_vdc_id - indicate the provider resource pool ID

network_pool_identifier - fill in the ID of the default network pool for the resource pool

BILLING PLANS - GET THE LIST OF BILLING PLANS 940

Page 942: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

allocation_model - choose the type of resource pool ( AllocationVApp, AllocationPool, ReservationPool). Depending on the type selected, the compute resource parameters will differ:

AllocationVApp (Pay-As-You-Go):guaranteed_cpu - specify the amount of guaranteed CPU allocation (%)guaranteed_memory - specify the amount of guaranteed memory allocation (%)vm_quota - specify the number of VSs that can be created after the resource pool is deployedcpu_limit - specify the maximum amount of CPU (in GHz) that can be requestedmemory_limit - specify the maximum amount of memory (in GB) which can be usedvcpu_speed - specify the vCPU speed that can be consumed after the resource pool is created (in MHz)

AllocationPool:cpu_allocated - specify the amount of CPU resources (GHz) that will be allocated after the resource pool is createdmemory_allocated - specify the amount of memory (in GB) allocated to this resource poolguaranteed_cpu - specify the amount of guaranteed CPU allocation (%)guaranteed_memory - specify the amount of guaranteed memory allocation (%)vm_quota - specify the number of VSs that can be created after the resource pool is deployed

ReservationPool:cpu_allocated - specify the amount of CPU resources (GHz) that will be allocated after the resource pool is created memory_allocated - specify the amount of memory (in GB) allocated to this resource poolvm_quota - specify the number of VSs that can be created after the resource pool is deployed

Data stores attributes:thin_provisioning - true if thin provisioning is enabled for this resource pool; otherwise falsefast_provisioning - true if fast provisioning is enabled for this resource pool; otherwise falsedata_store_group_id - indicate the data store group IDdata_store_size - specify the size of the data storedata_store_type - specify the type of the data store (vcloud)

Page History:v 5.0Added the following parameters: network_pool_identifier

BILLING PLANS - GET THE LIST OF BILLING PLANS 941

Page 943: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

76.5 Edit Resource PoolTo edit a resource pool, use the following request:PUT /vdcs/:id.xmlPUT /vdcs/:id.jsonXML Request example:

curl -i -X PUT -u user:userpass --url http://onapp.test/vdcs/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<vdc><cpu_allocated>3.3</cpu_allocated></vdc>'

JSON Request example:

curl -i -X PUT -u user:userpass --url http://onapp.test/vdcs/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"vdc": {"cpu_allocated": "2.2"}}'

Where:Depending on the resource pool type, the following parameters can be edited:

cpu_allocated - specify the amount of CPU resources (GHz) that will be allocated after the resource pool is createdmemory_allocated - specify the amount of memory (in GB) allocated to this resource poolguaranteed_cpu - specify the amount of guaranteed CPU allocation (%)guaranteed_memory - specify the amount of guaranteed memory allocation (%)vm_quota - specify the number of VSs that can be created after the resource pool is deployedcpu_limit - specify the maximum amount of CPU (in GHz) that can be requestedmemory_limit - specify the maximum amount of memory (in GB) which can be usedvcpu_speed - specify the vCPU speed that can be consumed after the resource pool is created (in MHz)thin_provisioning - true if thin provisioning is enabled for this resource pool; otherwise falsefast_provisioning - true if fast provisioning is enabled for this resource pool; otherwise false

76.6 Delete Resource PoolTo delete a resource pool, use the following request:DELETE /vdcs/:id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 942

Page 944: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DELETE /vdcs/:id.jsonXML Request example:

curl -i -X DELETE http://onapp.test/vdcs/:id.xml -u user:userpass

JSON Request example:

curl -i -X DELETE http://onapp.test/vdcs/:id.json -u user:userpass

76.7 Create Resource Pool Data StoreTo create a resource pool data store, use the following request:POST /vdcs/:id/data_stores.xmlPOST /vdcs/:id/data_stores.jsonXML Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/vdcs/:id/data_stores.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<data_store><data_store_group_id>29</data_store_group_id><data_store_size>100</data_store_size><data_store_type>vcloud</data_store_type></data_store>'

JSON Request example:

curl -i -X POST -u user:userpass --url http://onapp.test/vdcs/:id/data_stores.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"data_store": {"data_store_group_id": "29", "data_store_size": "100", "data_store_type": "vcloud"}}'

Where:

data_store_group_id - indicate the data store group IDdata_store_size - specify the size of the data storedata_store_type - specify the type of the data store (vcloud)

76.8 Edit Resource Pool Data StoreTo edit a resource pool data store, use the following request:PUT /vdcs/:resource_pool_id/data_stores/:data_store_id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 943

Page 945: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /vdcs/:resource_pool_id/data_stores/:data_store_id.jsonXML Request example:

curl -i -X PUT -u user:userpass --url http://onapp.test/vdcs/:resource_pool_id/data_stores/:data_store_id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<data_store><enabled>false</enabled><data_store_size>200</data_store_size></data_store>'

JSON Request example:

curl -i -X PUT -u user:userpass --url http://onapp.test/vdcs/:resource_pool_id/data_stores/:data_store_id.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"data_store": {"enabled": "false", "data_store_size": "200"}}'

Where:enabled - true if data store is enabled in vCloud; otherwise falsedata_store_size - specify the size of the data store

76.9 Delete Resource Pool Data StoreTo delete a resource pool data store, use the following request:DELETE /vdcs/:resource_pool_id/data_stores/:data_store_id.xmlDELETE /vdcs/:resource_pool_id/data_stores/:data_store_id.jsonXML Request example:

curl -i -X DELETE -u user:userpass --url http://onapp.test/vdcs/:resource_pool_id/data_stores/:data_store_id.xml

JSON Request example:

curl -i -X DELETE -u user:userpass --url http://onapp.test/vdcs/:resource_pool_id/data_stores/:data_store_id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 944

Page 946: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

76.10 Get List of Provider Resource Pools

Ensure that Provider resource pools permissions are on. For more information about permissions refer to the Permissions section of this guide.

To view the list of provider vDCs, use the following request:GET /provider_vdcs.xmlGET /provider_vdcs.jsonXML Request example:

curl -i -X GET http://onapp.test/provider_vdcs.xml -u user:userpass

JSON Request example:

curl -i -X GET http://onapp.test/provider_vdcs.json -u user:userpass

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><provider_vdcs type="array"> <provider_vdc> <id type="integer">13</id> <label>pvDC 1 Cluster1</label> <cpu_allocated type="integer">0</cpu_allocated> <cpu_total type="integer">35880</cpu_total> <cpu_used type="integer">11692</cpu_used> <created_at type="datetime">2016-04-19T12:57:27+03:00</created_at> <enabled type="boolean">true</enabled> <hypervisor_id type="integer">24</hypervisor_id> <identifier>4b5330c2-449c-4b30-b156-fb4901c1235b</identifier> <memory_allocated type="integer">0</memory_allocated> <memory_total type="integer">50683</memory_total> <memory_used type="integer">18716</memory_used> <updated_at type="datetime">2016-05-06T01:00:34+03:00</updated_at> <external_networks type="array"> <external_network> <created_at type="datetime">2016-04-19T12:58:12+03:00</created_at> <default_nat_rule_number

BILLING PLANS - GET THE LIST OF BILLING PLANS 945

Page 947: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="integer">9999</default_nat_rule_number> <default_outside_ip_address_id nil="true"/> <dns_suffix nil="true"/> <dvportgroup nil="true"/> <enabled type="boolean">false</enabled> <fence_mode>isolated</fence_mode> <gateway>69.168.237.1</gateway> <id type="integer">466</id> <identifier>00cfb7da-f5e4-4d3e-bcfd-f912aac4faf3</identifier> <ip_address_pool_id nil="true"/> <is_nated type="boolean">true</is_nated> <label>Public DC1</label> <netmask>255.255.255.0</netmask> <network_group_id type="integer">323</network_group_id> <parent_network_id nil="true"/> <prefix_size nil="true"/> <primary_dns nil="true"/> <secondary_dns nil="true"/> <shared type="boolean">false</shared> <updated_at type="datetime">2016-04-22T16:51:40+03:00</updated_at> <user_id nil="true"/> <vapp_id nil="true"/> <vdc_id nil="true"/> <vlan nil="true"/> </external_network> <external_network>...</external_network> </external_networks> <storage_policies type="array"> <storage_policy> <closed type="boolean">false</closed> <created_at type="datetime">2016-04-19T12:57:27+03:00</created_at> <draas_id nil="true"/> <federation_enabled type="boolean">false</federation_enabled> <federation_id nil="true"/> <hypervisor_id type="integer">24</hypervisor_id> <id type="integer">304</id> <identifier>83a2105b-47f1-4f21-a9de-43cfad2a82bd</identifier> <label>* for vCD 8</label> <location_group_id nil="true"/> <preconfigured_only type="boolean">false</preconfigured_only> <provider_vdc_id type="integer">13</provider_vdc_id> <traded type="boolean">false</traded>

BILLING PLANS - GET THE LIST OF BILLING PLANS 946

Page 948: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<updated_at type="datetime">2016-04-19T12:57:27+03:00</updated_at> <default_max_iops type="integer">15000</default_max_iops> <default_burst_iops type="integer">15000</default_burst_iops> <min_disk_size type="integer">1</min_disk_size> </storage_policy> <storage_policy>...<storage_policy> </storage_policies> <network_pools type="array"> <network_pool> <closed type="boolean">false</closed> <created_at type="datetime">2016-04-19T12:57:27+03:00</created_at> <draas_id nil="true"/> <federation_enabled type="boolean">false</federation_enabled> <federation_id nil="true"/> <hypervisor_id type="integer">24</hypervisor_id> <id type="integer">306</id> <identifier>routed-131cfd1d-97dd-4531-96cf-ce2dc2ac426f</identifier> <label>pvDC 1 Cluster1-VXLAN-NP Routed Networks for vCD 8</label> <location_group_id nil="true"/> <preconfigured_only type="boolean">false</preconfigured_only> <provider_vdc_id type="integer">13</provider_vdc_id> <traded type="boolean">false</traded> <updated_at type="datetime">2016-04-19T12:57:27+03:00</updated_at> </network_pool>

<network_pool>...</network_pool></network_pools>

</provider_vdc><provider_vdc>...</provider_vdc></provider_vdcs>

Where:id - the ID of the provider resource poollabel - the name of the provider resource poolcpu_allocated - the amount of CPU (MHz) allocated to this provider resource poolcpu_total - the total amount of CPU on the provider provider resource poolcpu_used - the amount of used CPU resourcescreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenabled - true if the provider resource pool is enabled; otherwise falsehypervisor_id - the ID of the compute resource

BILLING PLANS - GET THE LIST OF BILLING PLANS 947

Page 949: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

identifier - the identifier of the provider resource poolmemory_allocated - the amount of memory (MB) allocated to this provider resource poolmemory_total - the total amount of memory on the provider resource poolmemory_used - the amount of used memory (MB)updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatexternal_networks - the array of parameters related to the external network(s) associated with the provider resource poolcreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format default_nat_rule_number - default NAT rule default_outside_ip_address_id - ID of the outside IP address dns_suffix - the DNS suffix dvportgroup - the portgroup that backs this network enabled - whether the network is enabled or not fence_mode - isolation type of the network gateway - the gateway associated with the network id - the ID of the network identifier - the identifier of the network ip_address_pool_id - ID of the IP Address Pool is_nated - "true" if the NAT is used for translating the traffic. "False" if you are using your own firewall with external IP address label - the name of the network netmask - IP of the network mask network_group_id - network zone ID parent_network_id - not relevant to external networks prefix_size - subnet prefix size primary_dns - IP address of the primary domain name system (DNS) server secondary_dns - IP address of the secondary domain name system (DNS) server shared - whether this external network is shared or not updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format user_id - owner ID vapp_id - the vApp associated with the network vdc_id - the resource pool associated with the network vlan - VLAN number storage_policies - the array of parameters related to the storage policies associated with the vDC closed - not relevant to storage policies created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format draas_id - not relevant to storage policies federation_enabled - not relevant to storage policies federation_id - not relevant to storage polocies hypervisor_id - the ID of the compute resource id - the ID of the storage policy identifier - the identifier of the storage policy label - the name of the storage policy location_group_id - ID of a location group the storage policy is assigned to preconfigured_only - whether the storage policy can be used for creating Instance Package VSs only.When this option is enabled, the storage policy

BILLING PLANS - GET THE LIST OF BILLING PLANS 948

Page 950: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cannot be used during custom virtual server (VSs built by setting resources manually) creation. provider_vdc_id - the provider resource pool ID traded - not relevant to storage policies updated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format default_max_iops - the default maximum IOPS value for the data store zone default_burst_iops - the default peak IOPS value min_disk_size - minimum disk size for the data store zone network_pools - the array of parameters related to the network pool(s) associated with the vDCclosed - not relevant to network poolscreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdraas_id - not relevant to network poolsfederation_enabled - not relevant to network poolsfederation_id - not relevant to network poolshypervisor_id - the ID of the compute resourceid - the ID of the network poolidentifier - the identifier of the network poollabel - the name of the network poollocation_group_id - ID of a location group the network pool is assigned topreconfigured_only - whether the network pool can be used for creating Instance Package VSs only.When this option is enabled, the pool cannot be used during custom virtual server (VSs built by setting resources manually) creation.provider_vdc_id - the provider resource pool IDtraded - not relevant to storage policies

BILLING PLANS - GET THE LIST OF BILLING PLANS 949

Page 951: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

77 RESTRICTIONS SETS

Restrictions set is a customizable group of limitations. This tool gives cloud administrators more flexibility in limiting resources and operations available to reseller role(s). Creating a new restrictions set associates a role or number of roles with certain resources' limitations.

This section lists the API calls required for configuring restrictions sets.

77.1 Get List of Restrictions SetsUse this API call to see all restrictions sets:GET /restrictions/sets.xmlGET /restrictions/sets.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><restrictions_sets type="array"> <restrictions_set> <created_at type="datetime">2015-01-26T15:32:23+02:00</created_at> <id type="integer">7</id> <identifier>v9d4wt9f95h00k</identifier> <label>label</label> <updated_at type="datetime">2015-01-26T15:32:23+02:00</updated_at> <roles type="array"> <role> <created_at type="datetime">2015-01-26T15:29:39+02:00</created_at> <id type="integer">111</id> <identifier>hlj7q4vnxczezt</identifier> <label>label</label> <updated_at type="datetime">2015-01-29T15:36:24+02:00</updated_at> <users_count type="integer">2</users_count> </role> </roles> <restrictions_resources type="array"> <restrictions_resource>

BILLING PLANS - GET THE LIST OF BILLING PLANS 950

Page 952: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">2</id> <identifier>auto_scaling_configurations</identifier> <restriction_type>by_user_group</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Autoscaling Configuration (by User Group)</label> </restrictions_resource> </restrictions_resources> </restrictions_set> <restrictions_set>...</restrictions_set></restrictions_sets>

Where:restrictions_sets - the array of parameters associated with the restrictions set(s):created_at - the date when the restrictions set was createdid - ID of the restrictions setidentifier - identifier of the restrictions set in the DBlabel - restrictions set nameupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatroles - the array of parameters associated with role(s) assigned to the restrictions set:created_at - the date when the role was createdid - ID of the roleidentifier - identifier of the role in the DBlabel - role nameupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatusers_count - the number of users assigned to the rolerestrictions_resources - the array of parameters associated with the restrictions resource(s) limited by the restrictions set:created_at - the date when the restrictions resource was createdid - ID of the restrictions resourceidentifier - identifier of the restrictions resource in the DBrestriction_type - the type of restriction - either by user group or billing planupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format label - the restrictions resource name

77.2 Get Restrictions Set DetailsThe following API call will output the details for a particular restrictions set:GET /restrictions/sets/:id.xmlGET /restrictions/sets/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 951

Page 953: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

XML Request example

curl -i -X GET http://onapp.test/restrictions/sets/4.xml -u user:userpass

XML Request example

curl -i -X GET http://onapp.test/restrictions/sets/4.json -u user:userpass

XML output example

<?xml version="1.0" encoding="UTF-8"?><restrictions_set> <created_at type="datetime">2015-01-26T15:32:23+02:00</created_at> <id type="integer">7</id> <identifier>v9d4wt9f95h00k</identifier> <label>label</label> <updated_at type="datetime">2015-01-26T15:32:23+02:00</updated_at> <roles type="array"> <role> <created_at type="datetime">2015-01-26T15:29:39+02:00</created_at> <id type="integer">117</id> <identifier>hlj7q4vnxczezt</identifier> <label>marta.test.role</label> <updated_at type="datetime">2015-01-29T15:36:24+02:00</updated_at> <users_count type="integer">2</users_count> </role> </roles> <restrictions_resources type="array"> <restrictions_resource> <created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">2</id> <identifier>auto_scaling_configurations</identifier> <restriction_type>by_user_group</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Autoscaling Configuration (by User Group)</label> </restrictions_resource> </restrictions_resources></restrictions_set>

Where:restrictions_set - the array of parameters associated with the restrictions set:

BILLING PLANS - GET THE LIST OF BILLING PLANS 952

Page 954: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at - the date when the restrictions set was createdid - ID of the restrictions setidentifier - identifier of the restrictions set in the DBlabel - restrictions set nameupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatroles - the array of parameters associated with role(s) assigned to the restrictions set:created_at - the date when the role was createdid - ID of the roleidentifier - identifier of the role in the DBlabel - role nameupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatusers_count - the number of users assigned to the rolerestrictions_resources - the array of parameters associated with the restrictions resource(s) limited by the restrictions set:created_at - the date when the restrictions resource was createdid - ID of the restrictions resourceidentifier - identifier of the restrictions resource in the DBrestriction_type - the type of restriction - either by user group or billing planupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format label - the restrictions resource name

77.3 Get List of All Restrictions Resources

Use the following API call to see all restrictions resources:GET /restrictions/resources.xmlGET /restrictions/resources.jsonXML Request example

curl -i -X GET http://onapp.test/restrictions/resources.xml -u user:userpass

JSON Request example

curl -i -X GET http://onapp.test/restrictions/resources.json -u user:userpass

XML Output example

<?xml version="1.0" encoding="UTF-8"?><restrictions_resources type="array"> <restrictions_resource>

BILLING PLANS - GET THE LIST OF BILLING PLANS 953

Page 955: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">1</id> <identifier>activity_logs</identifier> <restriction_type>by_user_group</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Activity Logs (by User Group)</label> </restrictions_resource> <restrictions_resource> <created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">2</id> <identifier>auto_scaling_configurations</identifier> <restriction_type>by_user_group</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Autoscaling Configuration (by User Group)</label> </restrictions_resource> <restrictions_resource> <created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">3</id> <identifier>auto_scaling_configurations</identifier> <restriction_type>by_billing_plan</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Autoscaling Configuration (by Billing Plan)</label> </restrictions_resource> <restrictions_resource> <created_at type="datetime">2014-12-25T12:50:34+02:00</created_at> <id type="integer">4</id> <identifier>backup_server_groups</identifier> <restriction_type>by_billing_plan</restriction_type> <updated_at type="datetime">2014-12-25T12:50:34+02:00</updated_at> <label>Backup Server Zones (by Billing Plan)</label> </restrictions_resource> <restrictions_resource>...</restrictions_resource></restrictions_resources>

Where:restrictions_resources - the array of parameters associated with the restrictions resource(s) limited by the restrictions set:created_at - the date when the record in the database was createdid - ID of the restrictions resourceidentifier - identifier of the restrictions resource in the DB

BILLING PLANS - GET THE LIST OF BILLING PLANS 954

Page 956: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

restriction_type - the type of restriction - either by user group or billing planupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatlabel - the restrictions resource name

77.4 Create Restrictions SetUse this API call to create a restrictions set:POST /restrictions/sets.xmlPOST /restrictions/sets.jsonXML Request example

curl -i -X POST http://onapp.test/restrictions/sets.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<restrictions_set><label>label</label><role_ids type="array"><role_id>1</role_id></role_ids><resource_ids type="array"><resource_id>1</resource_id></resource_ids></restrictions_set>'

JSON Request example

curl -i -X POST http://onapp.test/restrictions/sets.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"restrictions_set":{"label":"label","role_ids":[1],"resource_ids":[1]}}'

Where:label - give the label of the restrictions setrole_ids - the array of the role IDs you wish to assign to the restrictions set:role_id - ID of the role you wish to assign to the restrictions setresource_ids - the array of resource IDs you wish to limit under the restrictions set:resource_id - ID of the resource you wish to limit under the restrictions set

77.5 Edit Restrictions SetUse the following API call to edit a restrictions set:PUT /restrictions/sets/:id.xmlPUT /restrictions/sets/:id.jsonXML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 955

Page 957: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT http://onapp.test/restrictions/sets/4.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<restrictions_set><label>new_label</label><role_ids type="array"><role_id>2</role_id></role_ids><resource_ids type="array"><resource_id>2</resource_id></resource_ids></restrictions_set>'

JSON Request example

curl -i -X PUT http://onapp.test/restrictions/sets/4.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"restrictions_set":{"label":"new_label","role_ids":[2],"resource_ids":[2]}}'

Where:label - give the label of the restrictions setrole_ids - the array of the role IDs you wish to assign to the restrictions set:role_id - ID of the role you wish to assign to the restrictions setresource_ids - the array of resource IDs you wish to limit under the restrictions set:resource_id - ID of the resource you wish to limit under the restrictions set

BILLING PLANS - GET THE LIST OF BILLING PLANS 956

Page 958: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

78 ROLES

This class manages roles assigned to users. A role itself maintains a set of permissions that gives an access to cloud resources and control panel functionality. You can easily regulate roles (and users in turn) using view/edit/delete options.

78.1 Get List of RolesThis method gets the list of all the roles available in the system:GET /roles.xmlGET /roles.jsonXML Output example

<?xml version="1.0" encoding="UTF-8"?><roles><role><label>Administrator</label><created_at>2010-05-26T13:34:58Z</created_at><updated_at>2010-07-18T21:16:14Z</updated_at><id>1</id><identifier>admin</identifier><permissions><permission><label>Any action on virtual servers</label><created_at>2010-05-26T13:34:58Z</created_at><updated_at>2010-05-26T13:34:58Z</updated_at><id>1</id><identifier>virtual_machines</identifier></permission>...<permission></permission></permissions></role></roles>

Where:roles – an array of all roles with their details and assigned permissionslabel – role titlecreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – the date when the role was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 957

Page 959: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

id – role IDidentifier – role identifierpermissions – an array with all the permissions assigned to this role, where: label – permission title (permission on an action) created_at – time in [YYYY][MM][DD]T[hh][mm][ss]Z format updated_at – time in [YYYY][MM][DD]T[hh][mm][ss]Z format id – permission ID identifier – permission identifier

78.2 Get Role DetailsThis method will output the details for a particular user role.GET /roles/:id.xmlGET /roles/:id.jsonXML Output example

<?xml version="1.0" encoding="UTF-8"?><role><label>TT</label><created_at type="datetime">2011-02-11T11:20:00Z</created_at><updated_at type="datetime">2011-02-11T13:56:44Z</updated_at><id type="integer">3</id><identifier>gkue74amkiznb7</identifier><permissions type="array"><permission><label>Any action Sysadmin Tools</label><created_at type="datetime">2011-02-11T10:35:16Z</created_at><updated_at type="datetime">2011-02-11T10:35:16Z</updated_at><id type="integer">4</id><identifier>sysadmin_tools.read</identifier></permission></permissions></role>

For details refer Get List of Roles section.

The role for a particular user is output on /users/:id request.

BILLING PLANS - GET THE LIST OF BILLING PLANS 958

Page 960: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

78.3 Add RolePOST /roles.xmlPOST /roles.jsonXML Request example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<role><label>New_role_xml</label><permission_ids type="array"><permission_id>12</permission--_id><permission_id>14</permission--_id><permission_id>16</permission_id><permission_id>11</permission_id><permission_id>10</permission_id><permission_id>35</permission_id></permission_ids></role>' --url http://onapp.test/roles.xml

JSON Request example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"role":{"label":"New_role_json","permission_ids":[12,14,16,11,10,35]}}' --url http://onapp.test/roles.json

The following parameters should be sent:label* - the new role label (required)permission_id - the ID of the permission you would like to assign to this role (optional)

78.4 Edit RoleUse the Put method to edit a role:PUT /roles/:id.xmlPUT /roles/:id.jsonXML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<role><label>changed</label><permission_ids type="array"><permissions_id>12</permissions_id><permissions_id>14</permissions_id><permissions_id>6</permissions_id><permissions_id>1</permissions_id></

BILLING PLANS - GET THE LIST OF BILLING PLANS 959

Page 961: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

permission_ids></role>' --url http://onapp.test/roles/:id.xml

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"role":{"label":"jsonchanged","permission_ids":[1,2,3,4,5,6,7,8,9]}}' --url http://onapp.test/roles/:id.json

Where you can change:label – role titlepermission_ids – ID of permissions, which you want to assign to this role

78.5 Delete RoleUse the following method to delete a user role:DELETE /roles/:id.xmlDELETE /roles/:id.jsonXML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/roles/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/roles/:id.json

This returns an HTTP 204 response if the role is deleted, or HTTP 404 if the user with the specified ID isn't found.

78.6 Edit User Role AssignmentTo change a role, assigned to the user, add new role (or set of roles), use this request:PUT/users/:id.xmlPUT/users/:id.json XML Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<user><role_ids><role_id>1</role_id><role_id>2</role_id></role_ids>

BILLING PLANS - GET THE LIST OF BILLING PLANS 960

Page 962: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</user>' --url http://onapp.test/users/:id.xml

JSON Request example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"user":{role_ids:["3","1"]}}' --url http://onapp.test/users/:id.json

Where:role_ids – ID of role(s) you want to assign to the userThis returns an HTTP 204 response if roles are changed, or HTTP 404 if the specified role ID isn't found.

78.7 Get List of All PermissionsTo get the list of all available permissions, use the following request:

GET /permissions.xmlGET /permissions.jsonOutput example

<?xml version="1.0" encoding="UTF-8"?><permissions><permission><label>Any action on virtual servers</label><created_at>2010-05-26T13:34:58Z</created_at><updated_at>2010-05-26T13:34:58Z</updated_at><id>1</id><identifier>virtual_machines</identifier></permission>...<permission></permission>...</permissions>

Where:label – permission title (permission on an action)created_at – time in [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at – time in [YYYY][MM][DD]T[hh][mm][ss]Z formatid – permission IDidentifier – permission identifier

BILLING PLANS - GET THE LIST OF BILLING PLANS 961

Page 963: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

78.8 Clone RoleUse the Post method to clone a role:POST /roles/:id/clone.xmlPOST /roles/:id/clone.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass http://onapp.test/roles/18/clone.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass http://onapp.test/roles/18/clone.json

Where:id – the role ID

Output example

<?xml version="1.0" encoding="UTF-8"?><role> <created_at type="datetime">2014-11-08T14:24:33+02:00</created_at> <id type="integer">21</id> <identifier>b99q74uao0ufw7</identifier> <label>Example role - copy(2014-11-08 12:24:33)</label> <updated_at type="datetime">2014-11-08T14:24:33+02:00</updated_at> <permissions type="array"> <permission> <created_at type="datetime">2014-11-05T13:12:10+02:00</created_at> <id type="integer">533</id> <identifier>activity_logs</identifier> <label>Any action on activity logs</label> <updated_at type="datetime">2014-11-05T13:12:10+02:00</updated_at> </permission> </permissions> </role>

Where:created_at - the date when the record in the database was createdid - the ID of the roleidentifier - the identifier in the database of the rolelabel - the label of the role, which is by default the "original" role lael with the date when the role has been cloned.

BILLING PLANS - GET THE LIST OF BILLING PLANS 962

Page 964: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

updated_at - the date when the record in the database was updatedpermissions - the array with the list of permissions for this roleid - the ID of the permissionlabel - the name of the permission

BILLING PLANS - GET THE LIST OF BILLING PLANS 963

Page 965: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79 SMART SERVERS

Smart servers are dedicated entities based on KVM CloudBoot compute resources with passthrough enabled.

NOTE: VLANs are not configured automatically on smart servers. You need to configure them manually in accordance with your OS and hardware settings.

Smart servers are billed the same way as Virtual Servers.You can set limits and prices for CPU/CPU share/memory.

To charge for smart server resources:

1. Create a smart server compute zone

2. Attach smart server compute resources to this zone

3. Add this compute zone (smart server type) to a billing plan and set the CPU/CPU share/memory limits

4. Assign user to this billing plan

5. Create a smart server under this user's account and allocate the required smart server on a compute zone that you've just added to the billing plan.

Currently, it is not possible to set limits and prices for smart server network resources.

79.1 Get List of Smart ServersTo get the list of Smart Servers, use the following request:GET /smart_servers.xmlGET /smart_servers.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><smart_server> <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">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <booted type="boolean">true</booted>

BILLING PLANS - GET THE LIST OF BILLING PLANS 964

Page 966: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<built type="boolean">true</built> <cpu_shares type="integer">1</cpu_shares> <cpus type="integer">1</cpus> <created_at type="datetime">2013-07-25T12:11:09+03:00</created_at> <customer_network_id nil="true"/> <deleted_at nil="true"/> <edge_server_type nil="true"/> <enable_autoscale type="boolean">false</enable_autoscale> <enable_monitis type="boolean">false</enable_monitis> <firewall_notrack type="boolean">false</firewall_notrack> <hostname>test</hostname> <hypervisor_id type="integer">67</hypervisor_id> <id type="integer">103</id> <identifier>on8n97e0g0gfci</identifier> <initial_root_password>qweasdzxc</initial_root_password> <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted> <label>TT</label> <local_remote_access_ip_address>83.170.81.132</local_remote_access_ip_address> <local_remote_access_port type="integer">5900</local_remote_access_port> <locked type="boolean">false</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"> <fixnum type="integer">1</fixnum> </preferred_hvs> <recovery_mode nil="true"/> <remote_access_password>M8eZXy9zJQhP</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">2</template_id> <template_label>CentOS 6.4 x64 1.3</template_label> <time_zone>Atlantic Time (Canada)</time_zone> <updated_at type="datetime">2013-07-25T12:14:15+03:00</updated_at> <user_id type="integer">6</user_id> <vip nil="true"/> <xen_id type="integer">2</xen_id> <ip_addresses type="array"> <ip_address>

BILLING PLANS - GET THE LIST OF BILLING PLANS 965

Page 967: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<address>83.170.81.146</address> <broadcast>83.170.81.159</broadcast> <created_at type="datetime">2013-06-11T10:19:46+03:00</created_at> <customer_network_id nil="true"/> <disallowed_primary type="boolean">false</disallowed_primary> <gateway>83.170.81.145</gateway> <hypervisor_id nil="true"/> <id type="integer">3</id> <ip_address_pool_id nil="true"/> <network_address>83.170.81.144</network_address> <network_id type="integer">1</network_id> <pxe type="boolean">false</pxe> <updated_at type="datetime">2013-07-25T12:11:09+03:00</updated_at> <user_id nil="true"/> <free type="boolean">false</free> <netmask>255.255.255.240</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="decimal">0.0</price_per_hour> <price_per_hour_powered_off type="decimal">0.0</price_per_hour_powered_off> <cpu_priority type="integer">1</cpu_priority></smart_server><smart_server>....</smart_server><smart_server>...</smart_server>

Where:add_to_marketplace — empty for Smart Servers; used for edge servers onlyadmin_note — an optional note of the administratorallow_resize_without_reboot — true if resize without reboot is possible; otherwise falseallowed_hot_migrate — true if the template, on which the Smart Server is based, supports hot migration; otherwise falseallowed_swap — true if swap disk is allowed (depends on the template the Smart Server is based on); otherwise falsebooted — true if the Smart Server is running, otherwise falsebuilt — true if the Smart Server is built, otherwise falsecpus — the number of allocated CPU cores

BILLING PLANS - GET THE LIST OF BILLING PLANS 966

Page 968: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_shares — CPU priority in percentscreated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatenable_autoscale — true if autoscaling is allowed for this Smart Serverhostname — the name of your hosthypervisor_id — the ID of the compute resource used by this Smart Serverid — the Smart Server IDidentifier — the Smart Server identifierinitial_root_password — the VS root passwordinitial_root_password_encrypted - true, if the root password is encrypted, otherwise false.ip_addresses — an array of ip addresses with their details assigned to this Smart Serverlabel — the Smart Server labellocal_remote_access_port — the port ID used for console accesslocked — true if the Smart Server is locked; otherwise falsemax_memory — maximum amount of RAM which can be allocated to the Smart Server by the compute resourcememory — the RAM size allocated to this Smart Servermin_disk_size — the minimum disk size required to build a Smart Server from a specified templateprimary_disk_min_iops - minimum number of IO operations per second for primary disk (this is a SolidFire related parameter)swap_disk_min_iops - minimum number of IO operations per second for swap disk (this is a SolidFire related parameter)note — an optional reminder for this Smart Server made by a user accountnetwork_address – the address of the networkoperating_system — operating system used by the Smart Serveroperating_system_distro — the distribution of the OS from which this Smart Server is builtrecovery_mode — true if recovery mode allowed. Otherwise falseremote_access_password — the password for the remote accessstate – parameter reserved for future usestrict_virtual_machine_id — the ID of a virtual server that will never reside on the same compute resource with this Smart Serversuspended — true if Smart Server is suspended, otherwise falsetemplate_id — the ID of the template the Smart Server is based ontemplate_label — the name of the template from which this Smart Server is built

time_zone - the time zone set for the smart server. This parameter is applicable only to Windows smart servers

Currently, the time zone is set at the Compute resource side only. Therefore, users need to set the target time zone inside a Windows smart server manually. Setting correct time zone at the Compute resource side helps to keep correct time inside a smart server after starting it if time synchronization is not completed for some reason.

total_disk_size — the total disk size in GB of all disks assigned to Smart Serverupdated_at — the date when the Smart Server was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 967

Page 969: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_id — the ID of a user assigned to this Smart Servervip — true if the Smart Server has VIP status (gives migration priority)xen_id — the Smart Server ID set by the virtualization enginecpu_priority - this is a new parameter reserved for future use; currently it has the same value as cpu_shares parameter

79.2 Get Smart Server DetailsGET /smart_servers/:id.xmlGET /smart_servers/:id.jsonShows the same attributes of the Smart Servers described in Get list of Smart Servers request.

79.3 Add Smart ServerPOST /smart_servers.xmlPOST /smart_servers.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' -d '<smart_server><template_id>1</template_id><licensing_key></licensing_key><label>zaza_XML</label><hostname>zaza</hostname><hypervisor_id>355</hypervisor_id><initial_root_password>qwaszx</initial_root_password><initial_root_password_confirmation>qwaszx</initial_root_password_confirmation><memory>512</memory><cpus>1</cpus><cpu_shares>1</cpu_shares><data_store_group_primary_id>14</data_store_group_primary_id><primary_disk_size>5</primary_disk_size><prefer_local_reads>1</prefer_local_reads><data_store_group_swap_id>14</data_store_group_swap_id><swap_disk_size>1</swap_disk_size><primary_network_group_id>3</primary_network_group_id><rate_limit>1</rate_limit><required_ip_address_assignment>1</required_ip_address_assignment><required_automatic_backup>0</required_automatic_backup><required_virtual_machine_build>1</required_virtual_machine_build><required_virtual_machine_startup>1</required_virtual_machine_startup><time_zone>Atlantic Time (Canada)</time_zone><enable_autoscale>0</enable_autoscale><recipe_ids type='array'><recipe_id>11</recipe_id></recipe_ids></custom_recipe_variable></custom_recipe_variables></smart_server>' -u

BILLING PLANS - GET THE LIST OF BILLING PLANS 968

Page 970: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'user^userpass' http://onapp.test/smart_servers.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type:application/json' -d '{"smart_server":{"template_id":"1","licensing_key":"","label":"zaza_JSON","hostname":"zaza","hypervisor_id":"355","initial_root_password":"qwaszx","initial_root_password_confirmation":"qwaszx","memory":"512","cpus":"1","cpu_shares":"1","data_store_group_primary_id":"14","primary_disk_size":"5","prefer_local_reads":"1","data_store_group_swap_id":"14","swap_disk_size":"1","primary_network_group_id":"3", "rate_limit":"1","required_ip_address_assignment":"1","time_zone": "Atlantic Time (Canada)","required_automatic_backup":"0","required_virtual_machine_build":"1","required_virtual_machine_startup":"1","enable_autoscale":"0","recipe_ids":["11"],"custom_recipe_variables":{"custom_recipe_variable":{"name":"varname","value":"var_value","enabled":"1"}}}}' -u 'user:userpass' http://onapp.test/smart_servers.json

The following parameters should be sent:template_id * - the ID of a template from which a smart server should be builtlicensing_key - the key of a license. This parameter is for Windows servers onlylabel * - user-friendly smart server descriptionhostname * - specify the smart server hostnamehypervisor_id - the ID of a smart compute resource where the smart server will be built. If no smart 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 smart 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 [ _ ], and the following special characters: ~ ! @ # $ * _ - + = ` \\ { } [ ] : ; ' , . ? /. You can use both lower- and uppercase letters.initial_root_password_confirmation - the root password confirmationprimary_network_group_id - the ID of the primary network group. Optional parameterrequired_ip_address_assignment - set "1" if you want IP address to be assigned automatically after creation. Otherwise set "0"memory * - amount of RAM assigned to the smart servercpus * - number of CPUs assigned to the smart server. For KVM compute resources, this parameter sets CPU sockets by default, unless CPU topology is enabled.

BILLING PLANS - GET THE LIST OF BILLING PLANS 969

Page 971: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_shares - optional parameter. For KVM compute resource the CPU priority value is always 100. For XEN, set a custom value. The default value for XEN is 1cpu_units - the amount of CPU units per core if the CPU priority is replaced with CPU units in user billing plan.cpu_sockets - the amount of CPU sockets. 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.data_store_group_primary_id - set the ID of the data store zone to which this primary disk is allocateddata_store_group_swap_id - set the ID of the data store zone to which this swap disk is allocatedprimary_disk_size * - set the disk space for this smart serverswap_disk_size * - set swap space. There is no swap disk for Windows-based smart serversprimary_network_group_id - the ID of the primary network group. Optional parameterrate_limit - set max port speed. Optional parameter: if none set, the system sets port speed to unlimited

time_zone - the time zone set for the smart server. This parameter is applicable only to Windows smart servers

Currently, the time zone is set at the Compute resource side only. Therefore, users need to set the target time zone inside a Windows smart server manually. Setting correct time zone at the Compute resource side helps to keep correct time inside a smart server after starting it if time synchronization is not completed for some reason.

required_automatic_backup - set 1 if you need automatic backups.required_virtual_machine_build * - set 1 to build smart server automaticallyrequired_virtual_machine_startup - set 1 to start up the smart server automatically, otherwise set 0 (default state is "1")enable_autoscale - set 1 to enable autoscale, otherwise set 0recipe_ids - an array of recipe ID you want to run on the smart server provisioningcustom_variables - an array of custom variables with the following details: enabled - true, if the variable is enabled, otherwise false id - variable ID name - variable name value - variable value script

BILLING PLANS - GET THE LIST OF BILLING PLANS 970

Page 972: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.4 View Encrypted Smart Server Password

If the Smart Server was created with password encryption enabled, you can use the following API call to view the password ( the request returns the decrypted password):

XML Request example:

curl -X GET -u user:userpass http://onapp.test/smart_servers/:id/with_decrypted_password.xml?initial_root_password_encryption_key=encryptionkey

JSON Request example:

curl -X GET -u user:userpass http://onapp.test/smart_servers/:id/with_decrypted_password.json?initial_root_password_encryption_key=encryptionkey

Where:id – the Smart Server ID

79.5 Build Smart ServerTo build or re-build a Smart Server, use the following methods:POST /smart_servers/:smart_server_id/build.xmlPOST /smart_servers/:smart_server_id/build.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="UTF-8"?><smart_server><template_id>1</template_id><required_startup>1</required_startup></>' --url http://onapp.test/smart_servers/:smart_server_id/build.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"smart_server":

BILLING PLANS - GET THE LIST OF BILLING PLANS 971

Page 973: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

{"template_id":"1","required_startup":"1"}}' --url http://onapp.test/smart_servers/:smart_server_id/build.json

Where:template_id* - the ID of a template from which a Smart Server should be built.required_startup - set to 1 if you wish to start a Smart Server after it is built. Otherwise set to 0.

Instead of Smart Server ID (:smart_server_id) you may use Smart Server identifier (:smart_server_identifier).

79.6 Edit Smart ServerPUT /smart_servers/:id.xmlPUT /smart_servers/: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="UTF-8"?><smart_server><label>Test_API_Edit</label><memory>512</memory><cpu_shares>40</cpu_shares><cpus>4</cpus><allow_migration>1</allow_migration><allow_cold_resize>1</allow_cold_resize><time_zone>Atlantic Time (Canada)</time_zone><primary_disk_min_iops>600</primary_disk_min_iops><swap_disk_min_iops>600</swap_disk_min_iops></smart_server>' --url http://onapp.test/smart_servers/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"smart_server":"label":"Test_API_Edit","memory":"512","cpu_shares":"40","cpus":"4","allow_migration":"1","time_zone": "Atlantic Time (Canada)","primary_disk_min_iops":"600","swap_disk_min_iops":"600","allow_cold_resize":"1"}}' --url http://onapp.test/smart_servers/:id.json

You can edit the following parameters:label - the Smart Server namememory - the amount of RAM allocated to this Smart Server in Mb

BILLING PLANS - GET THE LIST OF BILLING PLANS 972

Page 974: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpus - the number of CPUs of this Smart Servercpu_shares* - CPU priority percentageallow_migration - set 1 to migrate a Smart Server to a compute resource with sufficient resources if a compute resource has insufficient space to resize. Otherwise, set 0.allow_cold_resize – set 1 to switch to cold resize when hot resize failedtime_zone - the time zone set for the smart server. This parameter is applicable only to Windows smart servers.

After you edit the server's time zone, you need to stop and then start up the smart server.Currently, the time zone is set at the Compute resource side only. Therefore, users need to set the target time zone inside a Windows smart server manually. Setting correct time zone at the Compute resource side helps to keep correct time inside a smart server after starting it if time synchronization is not completed for some reason.

primary_disk_min_iops - minimum number of IO operations per second for primary disk (this is a SolidFire related parameter)swap_disk_min_iops - minimum number of IO operations per second for swap disk (this is a SolidFire related parameter)If the Smart Server is modified successfully, an HTTP 204 response is returned. If scheduling for changes fails, an HTTP 422 response is returned.

79.7 Change Smart Server OwnerUse the following request to reassign a Smart Server to another user:POST /smart_servers/:smart_server_id/change_owner.xmlPOST /smart_servers/:smart_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/smart_servers/:smart_server_id/change_owner.xml?user_id=2582&custom_recipes_action=move'

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/smart_servers/:smart_server_id/change_owner.json?user_id=2582&custom_recipes_action=move'

Required parameter:user_id* – input ID of a new smart server owner

BILLING PLANS - GET THE LIST OF BILLING PLANS 973

Page 975: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

custom_recipes_action - select one of the following options for smart server's recipes: no - recipes owner will not be changed move - recipes owner will be changed copy - recipes will be copied to new smart servers owner

Instead of Smart Server ID (:smart_server_id) you may use Smart Server identifier (:smart_server_identifier).

79.8 Migrate Smart ServerYou can migrate a Smart Server to another compute resource with the following method:POST /smart_servers/:smart_server_id/migrate.xml POST /smart_servers/:smart_server_id/migrate.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d "<smart_server><destination>1</destination></smart_server>" --url http://onapp.test/smart_servers/:smart_server_id/migrate.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"smart_server":{"destination":"1"}}' --url http://onapp.test/smart_servers/:smart_server_id/migrate.json

Where:destination* - the ID of a target compute resource where you migrate a Smart ServerYou can only cold migrate smart servers.

BILLING PLANS - GET THE LIST OF BILLING PLANS 974

Page 976: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.9 Delete Smart ServerDELETE /smart_servers/:id.xmlDELETE /smart_servers/:id.json XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/smart_servers/:id.xml?convert_last_backup=1&destroy_all_backups=1

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/smart_servers/:id.json?convert_last_backup=1&destroy_all_backups=1

Where:id – the ID of a Smart Server you want to deleteconvert_last_backup – set 1 to convert the last Smart Server's backup to template, otherwise set 0destroy_all_backups – set 1 to destroy all existing backups of this Smart Server, otherwise set 0

79.10 Start up Smart Server

When you start up a smart server, it might be implicitly cold migrated if the current compute resource does not have sufficient resources. For more information, refer to Server Provisioning.

To start up a Smart Server:POST /smart_servers/:smart_server_id/startup.xmlPOST /smart_servers/:smart_server_id/startup.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/startup.xml

JSON Request example

curl -i -X POST -u user:userpass --urlhttp://onapp.test/smart_servers/:smart_server_id/startup.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 975

Page 977: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.11 Reboot Smart ServerTo reboot a Smart Server:POST /smart_servers/:smart_server_id/reboot.xmlPOST /smart_servers/:smart_server_id/reboot.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/reboot.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/reboot.json

An HTTP 201 response is returned on a successful reboot. Unsuccessful reboot responses include HTTP 404 (resource not found – e.g. if the VS isn't online) and HTTP 422 (request cannot be processed – for example, if parameters were incorrect).

79.12 Reboot Smart Server in RecoveryTo reboot a Smart Server in recovery mode with a temporary login ("root") and password ("recovery"), use the following API calls:POST /smart_servers/:smart_server_id/reboot.xmlPOST /smart_servers/:smart_server_id/reboot.jsonXML Request example

curl -i -X POST -u user:userpass '<mode>recovery</mode>' --url http://onapp.test/smart_servers/:smart_server_id/reboot.xml

JSON Request example

curl -i -X POST -u user:userpass '{"mode":"recovery"}' --url http://onapp.test/smart_servers/:smart_server_id/reboot.json

79.13 Suspend Smart ServerTo suspend a Smart Server:

BILLING PLANS - GET THE LIST OF BILLING PLANS 976

Page 978: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

POST /smart_servers/:id/suspend.xmlPOST /smart_servers/:id/suspend.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/suspend.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/suspend.json

Where:smart_server_id* - ID of a Smart Server you want to suspend

79.14 Unsuspend Smart ServerTo activate a Smart Server again, use the same request as to suspend it:POST /smart_server/:id/suspend.xmlPOST /smart_server/:id/suspend.json For details refer to Suspend Smart Server section.

79.15 Unlock Smart ServerTo unlock a Smart Server:POST /smart_servers/:smart_server_id/unlock.xmlPOST /smart_servers/:smart_server_id/unlock.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/unlock.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/unlock.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 977

Page 979: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.16 Shut down Smart ServerTo shut down a Smart Server:POST /smart_servers/:smart_server_id/shutdown.xmlPOST /smart_servers/:smart_server_id/shutdown.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/shutdown.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/shutdown.json

79.17 Stop Smart ServerTo stop a Smart Server:POST /smart_servers/:smart_server_id/stop.xmlPOST /smart_servers/:smart_server_id/stop.json XML Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/stop.xml

JSON Request example

curl -i -X POST -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/stop.json

79.18 Open Smart Server ConsoleTo open a Smart Server console:

1. Run the following request:GET /smart_servers/:smart_server_id/console.xmlGET /smart_servers/:smart_server_id/console.json

2. Find and copy the value for the remote_key parameter in the response output.

BILLING PLANS - GET THE LIST OF BILLING PLANS 978

Page 980: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

3. Open the following URL in the browser: http://onapp.test/console_remote/[remote_key_parameter_value]

79.19 Smart Server AutoscalingSS autoscaling allows you to automatically increase the RAM, CPU and disk size of a smart server. SS resources autoscaling is based on the rules you specify. For example, you can set up a rule that will add 1000 MB of memory to a SS if RAM has been above 90% for the last 10 minutes - but add no more than 5000 MB in total in 24 hours.

79.19.1 Get the List of Autoscaling Rules for Smart ServerTo get the list of autoscaling rules for a particular SS:GET /smart_servers/:smart_server_id/auto_scaling.xmlGET /smart_servers/:smart_server_id/auto_scaling.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><auto_scaling_configurations type="array"><auto_scaling_configuration><up_to type="integer">9000</up_to><for_minutes type="integer">5</for_minutes><above type="integer">90</above><created_at type="datetime">2011-07-19T18:56:57+07:00</created_at><updated_at type="datetime">2011-07-19T18:56:57+07:00</updated_at><resource>memory</resource><id type="integer">1</id><virtual_machine_id type="integer">1063</virtual_machine_id><add_units type="integer">600</add_units><allow_decrease type="boolean">false</allow_decrease></auto_scaling_configuration>...<auto_scaling_configuration></auto_scaling_configuration>...</auto_scaling_configuration>

Where:up_to - the amount of resource which cannot be exceeded within 24 hours periodfor_minutes - the time threshold before scaling will be triggeredabove - the amount of the resource usage (%). If this value is reached by the VS during the period specified by the for_minutes parameter, the system will add the amount of units set by the add_units parameterscreated_at - the date when the record in DB was createdupdated_at - the date when the record in DB was updated

BILLING PLANS - GET THE LIST OF BILLING PLANS 979

Page 981: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

resource - the resource for which the rule is created (memory/cpu/disk )id - the ID of the rulevirtual_machine_id - the ID of the SS to which this rule appliesadd_units - the amount of resource units which the system should add if the rule is metallow_decrease - true, if autoscale down is enabled, otherwise false

79.19.2 Create Autoscaling Rule for SSTo create autoscaling rule for a smart server, use this request:POST /smart_servers/:smart_server_id/auto_scaling.xmlPOST /smart_servers/:smart_server_id/auto_scaling.json XML Request example

curl -X POST -u user:userpass http://onapp.test/smart_servers/:smart_server_id/auto_scaling.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<auto_scaling_configuration><up_to>22</up_to><for_minutes>10</for_minutes><above>5</above><resource>cpu</resource><allow_decrease>1</allow_decrease><add_units>22</add_units><enabled>1</enabled><allow_cold_resize>1</allow_cold_resize></auto_scaling_configuration>'

JSON Request example

curl -X POST -u user:userpass http://onapp.test/smart_servers/:smart_server_id/auto_scaling.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '"auto_scaling_configuration":{"above":5,"for_minutes":10,"up_to":11,"resource":"cpu","allow_decrease":"1","add_units":"22","enabled":"1","allow_cold_resize":"1"}'

Where:up_to* - the amount of resource which cannot be exceeded within 24 hours periodfor_minutes* - the time threshold before scaling will be triggeredabove* - the amount of the resource usage (%). If this value is reached by the VS for the period specified by the for_minutes parameter, the system will add the amount of units set by the add_units parameters.resource* - the resource for which the rule is created (memory/cpu/disk )add_units* - the amount of resource units which the system should add if the rule is metenabled* - set 1 to enable, or 0 to disableallow_cold_resize - set 1 to switch to cold resize when hot resize failedallow_decrease - set 1 to enable autoscaling down, otherwise set 0

BILLING PLANS - GET THE LIST OF BILLING PLANS 980

Page 982: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

79.19.3 Edit Autoscaling Rule for SSAt present you cannot edit separate elements of autoscaling rule. To change a rule for a SS you have to create a new rule, using the same request as in Create Autoscaling Rule section.

79.19.4 Delete Autoscaling Rule.To delete autoscaling rules, use this request:DELETE /smart_server/:smart_server_id/auto_scaling.xmlDELETE /smart_server/:smart_server_id/auto_scaling.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/auto_scaling.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/auto_scaling.json

This will delete all autoscaling rules set for this SS.

79.20 Smart Server Billing StatisticsYou can view the billing statistics for a particular Smart Server using the following request:GET /smart_servers/:smart_server_id/vm_stats.xmlGET /smart_servers/:smart_server_id/vm_stats.json

To get a shorter statistics output, add an id parameter in the URL:GET /smart_servers/:smart_server_id/vm_stats/:vm_stats_id.xmlGET /smart_servers/:smart_server_id/vm_stats/:vm_stats_id.json

Define a shorter period by setting Start and End time in the API call:

GET /smart_servers/:smart_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

XML Request example

GET /smart_servers/:smart_server_id/vm_stats.json?period[startdate]=YYYY-MM-DD+hh:mm:ss&period[enddate]=YYYY-MM-

BILLING PLANS - GET THE LIST OF BILLING PLANS 981

Page 983: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

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"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 982

Page 984: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</disk><disk> <id type="integer">2431</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">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>

BILLING PLANS - GET THE LIST OF BILLING PLANS 983

Page 985: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> </costs> <label>eth0</label> </network_interface> </network_interfaces> <smart_servers type="array"> <smart_server> <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> </smart_server> </smart_servers> </billing_stats> <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_stats>

Where:created_at – the timestamp in DB when this record was createdupdated_at – the time stamp in DB when this record was updatedcurrency_code - currency in which this virtual server is charged within the billing planid – the ID of the server hourly statistics. You can add this parameter to the request URL to get a shorter statistics output.

BILLING PLANS - GET THE LIST OF BILLING PLANS 984

Page 986: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

stat_time – the particular hour for which these statistics were generateduser_id - the ID of VS ownervirtual_machine_id - ID of a smart servervirtual_machine_billing_statistics_id -ID of a smart server billing statisticsbilling_stats - an array of billing details for the resources used by this smart server: disks - an array of disks used by this smart server with their billing

details:o label - disk name used in UIo id - disk ID used in databaseo costs- an array of disk related resources with their total prices

for the period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be disk_size,

data_read, data_written, reads_completed and writes_completedo value - the amount of resources used (GBs of disk size, Kbs of data

read/written, the number of reads/writes)o cost - the total due for the resource

network_interfaces - an array of network interfaces used by this VS with their billing statistics:

o label - network interface name used in OnAppo id - network interface IDo costs- an array of network interface related resources with their

total prices for the period specified in the stat-time parameter, where:

o resource_name- the resource in question. This can be ip_addresses, rate, data_received and data_sent

o 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 )

o cost - the total due for the resource virtual_machines - an array of virtual server billing details:

o label - VS nameo costs- An array of VS resources with their total prices for the

period specified in the stat-time parameter, where:o resource_name - the resource in question. This can be cpu_shares,

cpus, memory, cpu_usage and templateo value - the amount of resources allocated to this VS. For the

templates resource, this parameter means a template ID in database.o cost - the total due for this resourceo id - virtual server ID

total_cost – the total amount of money owed for the VS 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 VS resources for the particular hour specified by stat_time parameter (memory, disks, templates)

BILLING PLANS - GET THE LIST OF BILLING PLANS 985

Page 987: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

usage_cost – the total due for VS usage for this particular hour specified by stat_time parameter (data sent/received, bandwidth, CPU usage)

79.21 Search Smart Servers by LabelTo search smart servers 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/smart_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/smart_servers.json?q=label

Where you have to specify the label of a smart server you are searching for.

79.22 Get Smart Server CPU Usage Statistics

To view CPU usage statistics of a virtual server, run:GET /smart_servers/:smart_server_id/cpu_usage.xmlGET /smart_servers/:smart_server_id/cpu_usage.json

Define a shorter period by setting Start and End time in the API call:GET /smart_servers/:smart_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]=1GET /smart_servers/:smart_server_id/vm_stats.json?period[startdate]=YYYY-MM-

BILLING PLANS - GET THE LIST OF BILLING PLANS 986

Page 988: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

DD+hh:mm:ss&period[enddate]=YYYY-MM-DD+hh:mm:ss&period[use_local_time]=1

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/cpu_usage.xml

XML Request example:

curl -i GET -u user:userpass --url http://onapp.test/smart_servers/:smart_server_id/cpu_usage.json

Where you have to specify the smart server ID.

Use the following formula to convert CPU data received in the API output:CPU = cpu_time /10/ 3600Where cpu_time is data from API output.For example: cpu_time = 2330, then: 2330/10/3600=0.06 (6%).We use "cpu_time" * 10 to correct store fractional values.

79.23 Resize Smart ServerTo resize a Smart Server:POST /smart_servers/:smart_server_id/resize.xmlPOST /smart_servers/:smart_server_id/resize.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="UTF-8"?><smart_server><memory>512</memory><cpus>2</cpus><cpu_shares>30</cpu_shares><allow_cold_resize>1</allow_cold_resize></smart_server>' --url http://onapp.test/smart_servers/:smart_server_id/resize.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"smart_server":{"memory":"512","cpus":"2","cpu_shares":"30","allow_cold_resize":"1"}}' --url http://onapp.test/smart_servers/:smart_server_id/resize.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 987

Page 989: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

You can change the following parameters:memory - the amount of RAM allocated to your Smart Server in MBcpus - the number of CPUscpu_shares - CPU priority in %allow_cold_resize - set 1 to switch to cold resize when hot resize failedYou can also resize a Smart Server using the PUT method (see Edit Smart Server section).

79.24 Add/Edit Admin/User Note for Smart Servers

To edit/make an admin note, use the following request:PUT /smart_servers/:smart_server_id.xmlPUT /smart_servers/:smart_server_id.json Add/Edit Admin Note XML Request example

curl -i -X PUT -u user:userpass http://onapp.test/smart_servers/:smart_server_id.xml -d '<smart_server><admin_note>agfagwe tiuuytjgh yuytu</admin_note></smart_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/smart_servers/:smart_server_id.json -d '{"smart_server":{"admin_note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:admin_note – enter the text of your note.smart_server_id - the ID of the smart server to which you add/edit a note

Add/Edit User Note XML Request example

curl -i -X PUT -u user:userpass http://onapp.test/smart_servers/:smart_server_id.xml -d '<smart_server><note>agfagwe tiuuytjgh yuytu</note></smart_server>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

Add/Edit User Note JSON Request example

curl -i -X PUT -u user:userpass

BILLING PLANS - GET THE LIST OF BILLING PLANS 988

Page 990: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

http://onapp.test/smart_servers/:smart_server_id.json -d '{"smart_server":{"note":"kjfjhjtrtjt"}}' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:note – enter the text of your note.smart_server_id - the ID of the smart server to which you add/edit a noteReturns HTTP 204 response on successful processing, and HTTP 404 when there is no smart server with a requested ID, or URL is incorrect.

BILLING PLANS - GET THE LIST OF BILLING PLANS 989

Page 991: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

80 SOFTWARE LICENSES

When you create a virtual server from a template based on a licensed Operating System, or other licensed software, you need to add a valid license to the system. Use the software_licenses API class to manage licenses. All methods are available to this class.

80.1 Get List of Software LicensesTo get the list of available software licenses, use the following requests:GET /software_licenses.xmlGET /software_licenses.json Output example

<?xml version="1.0" encoding="UTF-8"?><software_licenses type="array"><software_license><created_at type="datetime">2011-02-18T01:34:33+02:00</created_at><updated_at type="datetime">2011-03-16T00:31:08+02:00</updated_at><license>TZXTC-R4GGG-9TT3V-DYDY4-T628B</license><total type="integer">20</total><arch>x64</arch><id type="integer">3</id><distro>2008</distro><count type="integer">7</count><tail> </tail><edition>ENT</edition></software_license>

Where:created_at – the date when the record in DB was createdupdated_at - the date when the record in DB was updatedlicense – the license for the software on which the template will be basedtotal – the total number of machines allowed by the licensearch – Windows OS architecture (x64 or x86)id – the ID of the recorddistro – Windows OS distribution (2003, 2008, Windows 7)count – the number of licenses used of a total allowedtail – parameter specifies the updated release of Windows OS distribution. If updated, than parameter is R2, otherwise – empty.edition – Windows OS edition or an array of editions if allowed by the license (STD – Standard, ENT –Enterprise, WEB – web and DC – Data center)

BILLING PLANS - GET THE LIST OF BILLING PLANS 990

Page 992: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

80.2 Get Software License DetailsTo get details for a particular software license, use the following method:

GET /software_licenses/:id.xmlGET /software_licenses/:id.json XML Output example

<?xml version="1.0" encoding="UTF-8"?><software_license><created_at type="datetime">2011-03-01T12:42:03+02:00</created_at><updated_at type="datetime">2011-03-08T13:54:17+02:00</updated_at><license>TTXTC-R6FFF-9FF3V-DYDY4-T628B</license><total type="integer">100</total><arch>x86</arch><id type="integer">11</id><distro>2003</distro><count type="integer">2</count><tail></tail><edition type="array"><string>STD</string></edition></software_license>

Where:created_at – the date when the record in DB was createdupdated_at - the date when the record in DB was updatedlicense – the license for the software on which the template will be basedtotal – the total number of machines allowed by the licensearch – Windows OS architecture (x64 or x86)id – the ID of the recorddistro – Windows OS distribution (2003, 2008, Windows 7)count – the number of licenses used of a total allowedtail – parameter specifies the updated release of Windows OS distribution. If updated, than parameter is R2, otherwise – empty.edition – Windows OS edition or an array of editions if allowed by the license (STD – Standard, ENT –Enterprise, WEB – web and DC – Data center)

80.3 Add Software LicenseYou can add a software license using the following request:POST /software_licenses.xmlPOST /software_licenses.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 991

Page 993: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<software_license><arch>x64</arch><total>1</total><distro>2003</distro><count>1</count><tail>R2</tail><edition type="array"><edition>WEB</edition></edition><license>RRRRR-IIIII-JJJJJ-KKKKK-EEEEE</license></software_license>' --url http://onapp.test/software_licenses.xml

To add a software license send the following parameters:arch* - Windows OS architecture (x64 or x86)total* - the total number of machines allowed by the licensedistro* - Windows OS distribution (2003, 2008, Windows 7)count*- the number of licenses used of a total allowedtail* - parameter specifies the updated release of Windows OS distribution. If updated, than parameter is R2, otherwise – emptyedition* - Windows OS edition or an array of editions if allowed by the license (STD – Standard, ENT –Enterprise, WEB – web and DC – Data center)license* - the license for the software on which the template will be based

80.4 Edit Software LicenseTo edit a software license details:PUT /software_licenses/:id.xmlPUT /software_licenses/:id.json XML Request example

*curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<software_license><arch>x64</arch><total>1</total><distro>2003</distro><count>1</count><tail>R2</tail><edition type="array"><edition>WEB</edition></edition><license>RRRRR-IIIII-JJJJJ-KKKKK-WWWWW</license></software_license>' --url http://onapp.test/software_licenses/:id.xml*

You can edit the following parameters:arch - Windows OS architecture (x64 or x86)total - the total number of machines allowed by the licensedistro - Windows OS distribution (2003, 2008, Windows 7)count - the number of licenses used of a total allowedtail - parameter specifies the updated release of Windows OS distribution. If updated, than parameter is R2, otherwise – emptyedition - Windows OS edition or an array of editions if allowed by the license (STD – Standard, ENT –Enterprise, WEB – web and DC – Data center)license - the license for the software on which the template will be based

BILLING PLANS - GET THE LIST OF BILLING PLANS 992

Page 994: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

80.5 Delete Software LicenseTo delete a software license, use the following request:DELETE /software_licenses/:id.xmlDELETE /software_licenses/:id.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/software_licenses/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/software_licenses/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 993

Page 995: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

81 SSH KEYS

81.1 Get List of SSH KeysTo see all the keys in the cloud, use the following request:GET /settings/ssh_keys.xmlGET /settings/ssh_keys.jsonXML Output example:

<?xml version="1.0" encoding="UTF-8"?><ssh_keys type="array"><ssh_key><created_at type="datetime">2011-09-13T16:10:02Z</created_at><updated_at type="datetime">2011-09-13T16:10:02Z</updated_at><id type="integer">3</id><user_id type="integer">1</user_id><key>ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc=user@onapp.test</key></ssh_key></ssh_keys>

Where:ssh_key – an array which displays the key infoid – the SSH key IDuser_id – ID of the user to whom the key belongskey – SSH key

81.2 Add SSH KeyTo add SSH keys to a user profile, use the following call:POST /users/:user_id/ssh_keys.xmlPOST /users/:user_id/ssh_keys.json XML Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 994

Page 996: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d'<ssh_key><key> ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= [email protected]</key></ssh_key>'

JSON Request example

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys.json -H 'Accept: application/json' -H 'Content-type: application/json' -d'{"ssh_key":{"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= [email protected]"}}'

Where:key* - a SSH key in the following format: ssh-[type] [ascii-symbols allowed for base64 string] [user credentials]

81.3 Edit SSH KeyTo edit a SSH key you may use both types of requests:PUT /users/:user_id/ssh_keys/:id.xmlPUT /users/:user_id/ssh_keys/:id.json orPUT /settings/ssh_keys/:id.xmlPUT /settings/ssh_keys/:id.json XML Request example

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d'<ssh_key><key> ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= [email protected]</key></ssh_key>'

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 995

Page 997: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys/:id.json -H 'Accept: application/json' -H 'Content-type: application/json' -d'{"ssh_key":{"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= [email protected]"}}'

81.4 Delete SSH KeyTo delete a SSH from the system (and from the user profile), use the following request:DELETE /settings/ssh_keys/:id.xmlDELETE /settings/ssh_keys/:id.json XML Request example

curl -X DELETE -u user:userpass http://onapp.test/settings/ssh_keys/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X DELETE -u user:userpass http://onapp.test/settings/ssh_keys/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 996

Page 998: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

82 STATISTICS

82.1 Usage Trends StatisticsTo view usage trends statistics, use the following request:GET /billing/dashboard_statistics.xmlGET /billing/dashboard_statistics.json XML Request example

curl -X GET "http://onapp.test/billing/dashboard_statistics.xml?stats_for=[cpus]&period[startdate]=2015-05-01&period[enddate]=2016-06-06" -u login:password -H 'Content-Type: application/xml' -g

Where:stats_for - leave this parameter empty to get all statistics data. To get a specific data, indicate any of these values: cpus, memory, disk_size, virtual_servers, smart_servers, baremetal_servers.period - indicate start date and end date for the period, for which you want to get the statistics.JSON Request example:

curl -i -X GET -u login:password --url http://onapp.test/billing/dashboard_statistics.json -d '{"stats_for":["cpus"], "period":{"startdate":"2016-06-22", "enddate":"2016-06-24"}}' -H 'Content-Type: application/json' -H 'Accept: application/json' {"cpus":[[1466568000000,29],[1466654400000,28],[1466740800000,26]]}

Where: [1466568000000,29] - time (in milli seconds), value array.

If period <= 24 hours the API response contains hourly statistics, else (> 24 hours) - returns daily statistics.

XML Output example

<?xml version="1.0" encoding="UTF-8"?><stats> <cpus type="array"> <cpu type="array"> <fixnum type="integer">1464667200000</fixnum>

BILLING PLANS - GET THE LIST OF BILLING PLANS 997

Page 999: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<fixnum type="integer">24</fixnum> </cpu> <cpu type="array"> <fixnum type="integer">1464753600000</fixnum> <fixnum type="integer">23</fixnum> </cpu> <cpu type="array"> ...</cpu> </cpus></stats>

82.2 Cloud Usage StatisticsCloud Usage statistics show detailed information on the resources used by virtual servers.Get daily stats (information on the resources used by virtual servers):

GET /usage_statistics.xmlGET /usage_statistics.jsonOnly the GET method is available for statistics. This method sends back usage statistics for all virtual servers in the cloud (per VS for the last 48 hours).XML Output example

<?xml version="1.0" encoding="UTF-8"?><vm_stats><vm_stat><data_sent>0.0</data_sent><reads_completed>328892.0</reads_completed><data_received>0.0</data_received><cpu_usage>2813.0</cpu_usage><virtual_machine_id>883</virtual_machine_id><writes_completed>193395.0</writes_completed><data_read>1315568.0</data_read><user_id>1</user_id><data_written>773580.0</data_written></vm_stat>...<vm_stat></vm_stat>...</vm_stats>

Explanation of the data returneddata_sent - the amount of Kilobytes sent by this VSreads_completed - the number of read operations performed by the diskdata_received - the amount of Kilobytes received by this VS

BILLING PLANS - GET THE LIST OF BILLING PLANS 998

Page 1000: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

cpu_usage - the average CPU percentage that the VS has been using during the last 72 hours or during the specified period.virtul_machine_id - the ID of the VS for which these statistics are generatedwrites_completed - the number of write operations performed by the diskdata_read - the amount of data read from a disk in Kilobytesdata_written - the amount of data written to a disk in KilobytesOther statistics generated in the system: Get User Statistics View Billing Statistics for User View Disk IOPS (Input/Output Statistics) Billing Statistics for VS Billing Statistics for CDN Edge Servers Get Load Balancer Billing Statistics

BILLING PLANS - GET THE LIST OF BILLING PLANS 999

Page 1001: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

83 STORAGE SERVER BACKUPS

The storage server backup feature enables users to create normal and incremental backups of their storage servers.

83.1 Get All Storage Server Backups Details

This method outputs the details for all server backups:GET /storage_servers/:id/backups.xmlGET /storage_servers/:id/backups.jsonXML Request example

curl -i -X GET -u user:password http://onapp.test/storage_servers/:id/backups.xml

JSON Request example

curl -i -X GET -u user:password http://onapp.test/storage_servers/:id/backups.xml

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">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">495960</backup_size> <built type="boolean">true</built> <built_at type="datetime">2014-12-24T15:47:25+02:00</built_at> <created_at type="datetime">2014-12-24T15:45:31+02:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">303</id> <identifier>iti18apbz635vr</identifier> <initiated>manual</initiated> <iqn nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1000

Page 1002: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">8087</target_id> <target_type>Disk</target_type> <template_id type="integer">2218</template_id> <updated_at type="datetime">2014-12-24T15:47:25+02:00</updated_at> <user_id type="integer">132</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">8087</disk_id> </backup> <backup>...</backup></backups>

Where:allow_resize_without_reboot - true, if storage server's CPU and RAM can be resized without reboot; a requirement, which will be applicable when the backup is converted into a templateallowed_hot_migrate - true, if hot migration is allowed; a requirement, which will be applicable when the backup is converted into a templateallowed_swap - true, if swap is allowed; a requirement, which will be applicable when the backup is converted into a templatebackup_server_id - the ID of the backup server where the backup is storedbackup_size - size of the backup in Kilobytesbuilt - true, if the storage server backup has been builtdata_store_type - data store type: lvm, vmware or SolidFireid - ID of the backupidentifier - identifier of the backup in the DBinitiated - how the backup was launched - either manually or automaticallyiqn - volume ISCSI qualified name; SolidFire - related parameterlocked - true, if the storage server backup is locked due to a running transaction and no new transactions can be initiated at the momentmarked_for_delete - true, if the backup is marked for deletion (for auto-backups)min_disk_size - minimum disk size requirement, which will be applicable when the backup is converted into a templatemin_memory_size - minimum RAM requirement, which will be applicable when the backup is converted into a templatenote - an arbitrary note to the backupoperating_system - the OS of the storage server backupoperating_system_distro - the OS distribution of the storage server backuptarget_id - ID of a backup target - either a disk or a virtual server

BILLING PLANS - GET THE LIST OF BILLING PLANS 1001

Page 1003: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

target_type - target for which the backup was taken - either a disk or a virtual servertemplate_id - the ID of a template from which the storage server was builtupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of a user the storage server belongs tovolume_id - data store IDbackup_type - normal or incremental

83.2 Get Normal Storage Server Backups Details

This method outputs the details for normal server backups:GET /storage_servers/:id/backups/images.xmlGET /storage_servers/:id/backups/images.jsonXML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/storage_servers/:id/backups/images.xml

JSON Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/storage_servers/:id/backups/images.json

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">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">495960</backup_size> <built type="boolean">true</built> <built_at type="datetime">2014-12-24T15:47:25+02:00</built_at> <created_at type="datetime">2014-12-24T15:45:31+02:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">303</id> <identifier>iti18apbz635vr</identifier>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1002

Page 1004: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<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">20</min_disk_size> <min_memory_size type="integer">2048</min_memory_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">8087</target_id> <target_type>Disk</target_type> <template_id type="integer">2218</template_id> <updated_at type="datetime">2014-12-24T15:47:25+02:00</updated_at> <user_id type="integer">132</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">8087</disk_id> </backup> <backup>...</backup></backups>

Where:allow_resize_without_reboot - true, if storage server's CPU and RAM can be resized without reboot; a requirement, which will be applicable when the backup is converted into a templateallowed_hot_migrate - true, if hot migration is allowed; a requirement, which will be applicable when the backup is converted into a templateallowed_swap - true, if swap is allowed; a requirement, which will be applicable when the backup is converted into a templatebackup_server_id - the ID of the backup server where the backup is storedbackup_size - size of the backup in Kilobytesbuilt - true, if the storage server backup has been builtdata_store_type - data store type: lvm, vmware or SolidFireid - ID of the backupidentifier - identifier of the backup in the DBinitiated - how the backup was launched - either manually or automaticallyiqn - volume ISCSI qualified name; SolidFire - related parameterlocked - true, if the storage server backup is locked due to a running transaction and no new transactions can be initiated at the momentmarked_for_delete - true, if the backup is marked for deletion (for auto-backups)min_disk_size - minimum disk size requirement, which will be applicable when the backup is converted into a templatemin_memory_size - minimum RAM requirement, which will be applicable when the backup is converted into a templatenote - an arbitrary note to the backupoperating_system - the OS of the storage server backupoperating_system_distro - the OS distribution of the storage server backup

BILLING PLANS - GET THE LIST OF BILLING PLANS 1003

Page 1005: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

target_id - ID of a backup target - either a disk or a virtual servertarget_type - target for which the backup was taken - either a disk or a virtual servertemplate_id - the ID of a template from which the storage server was builtupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of a user the storage server belongs tovolume_id - data store IDbackup_type - normal or incremental

83.3 Get Incremental Server Backups Details

This method outputs the details for incremental server backups:GET /storage_servers/:id/backups/files.xmlGET /storage-servers/:id/backups/files.jsonXML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/storage_servers/:id/backups/images.xml

JSON Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password --url http://onapp.test/storage_servers/:id/backups/images.json

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">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id> <backup_size type="integer">0</backup_size> <built type="boolean">false</built> <built_at nil="true"/> <created_at type="datetime">2014-12-25T13:32:02+02:00</created_at> <data_store_type>lvm</data_store_type>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1004

Page 1006: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<id type="integer">316</id> <identifier>bk1ntvx61p32uq</identifier> <initiated>manual</initiated> <iqn nil="true"/> <locked type="boolean">true</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">0</min_disk_size> <min_memory_size type="integer">2048</min_memory_size> <note>manual BU</note> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">7324</target_id> <target_type>VirtualMachine</target_type> <template_id type="integer">2218</template_id> <updated_at type="datetime">2014-12-25T13:32:02+02:00</updated_at> <user_id type="integer">132</user_id> <volume_id nil="true"/> <backup_type>incremental</backup_type> <disk_id nil="true"/>

</backup><backup>...</backup>

</backups>

Where:allow_resize_without_reboot - true, if storage server's CPU and RAM can be resized without reboot; a requirement, which will be applicable when the backup is converted into a templateallowed_hot_migrate - true, if hot migration is allowed; a requirement, which will be applicable when the backup is converted into a templateallowed_swap - true, if swap is allowed; a requirement, which will be applicable when the backup is converted into a templatebackup_server_id - the ID of the backup server where the backup is storedbackup_size - size of the backup in Kilobytesbuilt - true, if the storage server backup has been builtdata_store_type - data store type: lvm, vmware or SolidFireid - ID of the backupidentifier - identifier of the backup in the DBinitiated - how the backup was launched - either manually or automaticallyiqn - volume ISCSI qualified name; SolidFire - related parameterlocked - true, if the storage server backup is locked due to a running transaction and no new transactions can be initiated at the momentmarked_for_delete - true, if the backup is marked for deletion (for auto-backups)min_disk_size - minimum disk size requirement, which will be applicable when the backup is converted into a templatemin_memory_size - minimum RAM requirement, which will be applicable when the backup is converted into a templatenote - an arbitrary note to the backup

BILLING PLANS - GET THE LIST OF BILLING PLANS 1005

Page 1007: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

operating_system - the OS of the storage server backupoperating_system_distro - the OS distribution of the storage server backuptarget_id - ID of a backup target - either a disk or a virtual servertarget_type - target for which the backup was taken - either a disk or a virtual servertemplate_id - the ID of a template from which the storage server was builtupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of a user the storage server belongs tovolume_id - data store IDbackup_type - normal or incremental

83.4 Add Backup for Storage ServerTo create a backup for a storage server, send the following request:POST /storage_servers/:id/backups.xmlPOST /storage_servers/:id/backups.json

Depending on the configuration of your cloud, either a normal or an incremental backup for your storage server will be created.

XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:password --url http://onapp.test/storage_servers/: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/storage_servers/:id/backups.json -d '{"backup": { "note": "manual BU" }}'

Where:note - an arbitrary note to the backupXML Output example

<?xml version="1.0" encoding="UTF-8"?><backup_normals type="array"> <backup> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <backup_server_id type="integer">1</backup_server_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1006

Page 1008: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<backup_size type="integer">0</backup_size> <built type="boolean">false</built> <built_at nil="true"/> <created_at type="datetime">2014-12-25T12:24:55+02:00</created_at> <data_store_type>lvm</data_store_type> <id type="integer">306</id> <identifier>e3z4w271gw92y8</identifier> <initiated>manual</initiated> <iqn nil="true"/> <locked type="boolean">true</locked> <marked_for_delete type="boolean">false</marked_for_delete> <min_disk_size type="integer">0</min_disk_size> <min_memory_size type="integer">2048</min_memory_size> <note nil="true"/> <operating_system>linux</operating_system> <operating_system_distro>ubuntu</operating_system_distro> <target_id type="integer">8087</target_id> <target_type>Disk</target_type> <template_id type="integer">2218</template_id> <updated_at type="datetime">2014-12-25T12:24:55+02:00</updated_at> <user_id type="integer">132</user_id> <volume_id nil="true"/> <backup_type>normal</backup_type> <disk_id type="integer">8087</disk_id> </backup></backup_normals>

Where:allow_resize_without_reboot - true, if storage server's CPU and RAM can be resized without reboot; a requirement, which will be applicable when the backup is converted into a templateallowed_hot_migrate - true, if hot migration is allowed; a requirement, which will be applicable when the backup is converted into a templateallowed_swap - true, if swap is allowed; a requirement, which will be applicable when the backup is converted into a templatebackup_server_id - the ID of the backup server where the backup is storedbackup_size - size of the backup in Kilobytesbuilt - true, if the storage server backup has been builtdata_store_type - data store type: lvm, vmware or SolidFireid - ID of the backupidentifier - identifier of the backup in the DBinitiated - how the backup was launched - either manually or automaticallyiqn - volume ISCSI qualified name; SolidFire - related parameterlocked - true, if the storage server backup is locked due to a running transaction and no new transactions can be initiated at the momentmarked_for_delete - true, if the backup is marked for deletion (for auto-backups)

BILLING PLANS - GET THE LIST OF BILLING PLANS 1007

Page 1009: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

min_disk_size - minimum disk size requirement, which will be applicable when the backup is converted into a templatemin_memory_size - minimum RAM requirement, which will be applicable when the backup is converted into a templatenote - an arbitrary note to the backupoperating_system - the OS of the storage server backupoperating_system_distro - the OS distribution of the storage server backuptarget_id - ID of a backup target - either a disk or a virtual servertarget_type - target for which the backup was taken - either a disk or a virtual servertemplate_id - the ID of a template from which the storage server was builtupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatuser_id - the ID of a user the storage server belongs tovolume_id - data store IDbackup_type - normal or incremental

83.5 Add/Edit Storage Server Backup Note

Use the following API request to update backup with a note:

PUT /backups/:backup_id/note.xml

PUT /backups/:backup_id/note.json

XML Request example

curl -X PUT http://onapp.test/storage_servers/:storage_server_id/backups/images/:backup_id/note.xml -d '<backup><note>test note</note></backup>' -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -X PUT http://onapp.test/storage_servers/:storage_server_id/backups/images/:backup_id/note.json -d '{"backup":{"note":"test note"}}' -u user:password -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 1008

Page 1010: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where you have to specify backup ID in the URL.

83.6 Restore Storage Server BackupYou can restore a disk from a backup, using the following method:POST /backups/:backup_id/restore.xmlPOST /backups/:backup_id/restore.xmlXML 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/backups/images/:backup_id/restore.xml

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/backups/images/:backup_id/restore.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 1009

Page 1011: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

84 SYSTEM CONFIGURATION

Lists the configuration settings of your OnApp installation.

84.1 View System ConfigurationTo see all the system configuration, use the following request:GET /settings/configuration.xmlGET /settings/configuration.jsonXML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/settings/configuration.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/configuration.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><settings> <use_yubikey_login type="boolean">true</use_yubikey_login> <yubikey_api_key>00000000000000000000</yubikey_api_key> <yubikey_api_id>00000</yubikey_api_id> <allow_incremental_backups type="boolean">true</allow_incremental_backups> <use_ssh_file_transfer type="boolean">true</use_ssh_file_transfer> <ssh_file_transfer_server>109.123.105.162</ssh_file_transfer_server> <ssh_file_transfer_user>root</ssh_file_transfer_user> <ssh_file_transfer_options>-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no</ssh_file_transfer_options> <ssh_port type="integer">22</ssh_port> <template_path>/onapp/templates</template_path>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1010

Page 1012: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<backups_path>/onapp/backups</backups_path> <data_path>/onapp/data</data_path> <update_server_url>http://templates-manager.onapp.com</update_server_url> <delete_template_source_after_install type="boolean">true</delete_template_source_after_install> <license_key>FD1E0-4766C-C69E9-18A83-8CB60-1DE62</license_key> <generate_comment># Automatically generated by OnApp (3.1.0)</generate_comment> <simultaneous_backups type="integer">1</simultaneous_backups> <simultaneous_backups_per_datastore type="integer">150</simultaneous_backups_per_datastore> <simultaneous_backups_per_hypervisor type="integer">2</simultaneous_backups_per_hypervisor> <simultaneous_transactions type="integer">10</simultaneous_transactions> <guest_wait_time_before_destroy type="integer">300</guest_wait_time_before_destroy> <remote_access_session_start_port type="integer">30000</remote_access_session_start_port> <remote_access_session_last_port type="integer">30099</remote_access_session_last_port> <system_email>[email protected]</system_email> <ajax_power_update_time type="integer">10000</ajax_power_update_time> <ajax_pagination_update_time type="integer">10000</ajax_pagination_update_time> <hypervisor_live_times type="integer">12</hypervisor_live_times> <enable_huge_pages type="boolean">true</enable_huge_pages> <system_host>onapp.test</system_host> <system_notification type="boolean">false</system_notification> <system_support_email>[email protected]</system_support_email> <recovery_templates_path>/onapp/tools/recovery</recovery_templates_path> <remove_backups_on_destroy_vm type="boolean">true</remove_backups_on_destroy_vm> <disable_hypervisor_failover type="boolean">false</disable_hypervisor_failover> <ips_allowed_for_login></ips_allowed_for_login> <monitis_path>/usr/local/monitis</monitis_path> <monitis_account>[email protected]</monitis_account> <monitis_apikey>4JIA5DJUM9O01HJ550B88V73GR</monitis_apikey> <locales type="array"> <locale></locale> <locale>en</locale>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1011

Page 1013: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<locale>ja</locale> </locales> <max_memory_ratio type="integer">16</max_memory_ratio> <remove_old_root_passwords type="boolean">false</remove_old_root_passwords> <pagination_max_items_limit type="integer">99</pagination_max_items_limit> <default_image_template type="integer">19</default_image_template> <service_account_name>onapp</service_account_name> <default_firewall_policy>ACCEPT</default_firewall_policy> <app_name>DEV5 cloud</app_name> <show_ip_address_selection_for_new_vm type="boolean">true</show_ip_address_selection_for_new_vm> <backup_taker_delay type="integer">5</backup_taker_delay> <billing_stat_updater_delay type="integer">5</billing_stat_updater_delay> <cluster_monitor_delay type="integer">15</cluster_monitor_delay> <hypervisor_monitor_delay type="integer">5</hypervisor_monitor_delay> <cdn_sync_delay type="integer">1200</cdn_sync_delay> <schedule_runner_delay type="integer">5</schedule_runner_delay> <transaction_runner_delay type="integer">5</transaction_runner_delay> <zombie_transaction_time type="integer">180</zombie_transaction_time> <zombie_disk_space_updater_delay type="integer">300</zombie_disk_space_updater_delay> <run_recipe_on_vs_sleep_seconds type="integer">10</run_recipe_on_vs_sleep_seconds> <dns_enabled type="boolean">true</dns_enabled> <enabled_libvirt_anti_spoofing type="boolean">true</enabled_libvirt_anti_spoofing> <allow_start_vms_with_one_ip type="boolean">true</allow_start_vms_with_one_ip> <ip_range_limit type="integer">1000</ip_range_limit> <allow_initial_root_password_encryption type="boolean">true</allow_initial_root_password_encryption> <wipe_out_disk_on_destroy type="boolean">false</wipe_out_disk_on_destroy> <partition_align_offset type="integer">2048</partition_align_offset> <password_enforce_complexity type="boolean">false</password_enforce_complexity> <password_minimum_length type="integer">6</password_minimum_length> <password_upper_lowercase type="boolean">true</password_upper_lowercase> <password_letters_numbers

BILLING PLANS - GET THE LIST OF BILLING PLANS 1012

Page 1014: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="boolean">true</password_letters_numbers> <password_symbols type="boolean">true</password_symbols> <password_force_unique type="boolean">true</password_force_unique> <password_lockout_attempts type="integer">1</password_lockout_attempts> <password_expiry type="integer">1</password_expiry> <password_history_length type="integer">12</password_history_length> <force_windows_backups type="boolean">false</force_windows_backups> <cloud_boot_enabled type="boolean">true</cloud_boot_enabled> <nfs_root_ip>onapp.test</nfs_root_ip> <cloud_boot_target>onapp.test</cloud_boot_target> <storage_enabled type="boolean">true</storage_enabled> <prefer_local_reads type="boolean">false</prefer_local_reads> <vmware_cluster_name>OnApp</vmware_cluster_name> <allow_hypervisor_password_encryption type="boolean">false</allow_hypervisor_password_encryption> <archive_stats_period type="integer">3</archive_stats_period> <instant_stats_period type="integer">10</instant_stats_period> <is_archive_stats_enabled type="boolean">true</is_archive_stats_enabled> <system_alert_reminder_period type="integer">60</system_alert_reminder_period> <use_html5_vnc_console type="boolean">true</use_html5_vnc_console> <storage_endpoint_override nil="true"/> <max_network_interface_port_speed type="integer">10000</max_network_interface_port_speed> <url_for_custom_tools></url_for_custom_tools> <backup_convert_coefficient type="float">1.1</backup_convert_coefficient> <rsync_option_xattrs type="boolean">false</rsync_option_xattrs> <rsync_option_acls type="boolean">true</rsync_option_acls> <simultaneous_backups_per_backup_server type="integer">3</simultaneous_backups_per_backup_server> <email_delivery_method>sendmail</email_delivery_method> <smtp_address>smtp.gmail.com</smtp_address> <smtp_port type="integer">465</smtp_port> <smtp_domain>smtp.gmail.com</smtp_domain> <smtp_username>[email protected]</smtp_username> <smtp_password></smtp_password> <smtp_authentication>login</smtp_authentication> <smtp_enable_starttls_auto type="boolean">true</smtp_enable_starttls_auto> <enable_hourly_storage_report type="boolean">false</enable_hourly_storage_report> <enable_daily_storage_report type="boolean">false</enable_daily_storage_report>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1013

Page 1015: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<storage_unicast type="boolean">true</storage_unicast> <snmptrap_addresses>onapp.test</snmptrap_addresses> <snmptrap_port type="integer">3162</snmptrap_port> <infiniband_cloud_boot_enabled type="boolean">false</infiniband_cloud_boot_enabled> <cdn_max_results_per_get_page type="integer">500</cdn_max_results_per_get_page> <instance_packages_threshold_num>6</instance_packages_threshold_num>

<allow_to_collect_errors type="boolean">true</allow_to_collect_errors> <draas_enabled type="boolean">false</draas_enabled> <zabbix_host>000.000.00.00</zabbix_host> <zabbix_url>/zabbix</zabbix_url> <zabbix_user>Admin</zabbix_user> <zabbix_password>zabbix</zabbix_password> <licence_key>FD1E0-4766C-C69E9-18A83-8CB60-1DE62</licence_key> <system_theme>dark</system_theme> </settings>

Where:use_yubikey_login - whether logging in using a Yubikey is enabledyubikey_api_key - your Yubico secret keyyubikey_api_id - your Yubico client IDuse_ssh_file_transfer - set 1 to allow secure file access, transfer and management to a remote server. It is not possible to utilize SSH file transfer option when incremental backups are enabled.

Skip this option if you are using incremental backups.

ssh_file_transfer_server - the address of the remote serverssh_file_transfer_user - the login used for remote server authentication. A password is not required, as it is required that you store a host keyssh_file_transfer_options - SSH protocol options that set the rules and behavior of how to log into the remote serverssh_port– the port used for contacting SSH serverstemplate_path - path to the directory where templates will be storedbackups_path - path to the directory where backups will be storeddata_path –path to the directory where the recovery templates will be storedupdate_server_url - URL address where OnApp software updates are downloaded fromdelete_template_source_after_install - if enabled, the downloaded templates will be deleted after they are distributedlicense_key - license key of your OnApp CPgenerate_comment - this text is added by OnApp to system configuration files, such as resolv.confsimultaneous_backups - the maximum allowed number of simultaneous compute resource and data store backup processes

BILLING PLANS - GET THE LIST OF BILLING PLANS 1014

Page 1016: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

simultaneous_backups_per_datastore - the maximum number of simultaneous data store backup processessimultaneous_backups_per_hypervisor - the maximum number of simultaneous compute resource backup processessimultaneous_transactions - the number of transaction runners which the daemon will execute at the same timeguest_wait_time_before_destroy – the VS shutdown period (from 30 to 300 seconds). This allows to refuse the shutdown if the VS is booting and retry every 30 seconds till it is registered.remote_access_session_start_port - the first port in the range, which are used to remotely connect to virtual servers using the integrated VNC consoleremote_access_session_last_port - the last port in the range, which are used to remotely connect to virtual servers using the integrated VNC consolesystem_email - the email address from which help requests and email alerts are sentajax_power_update_time - how often VS status is refreshed on the Virtual Servers screen in msajax_pagination_update_time - how often the dashboard, logs and other items are refreshed in mshypervisor_live_times - determines how many times the Control Panel server will attempt to contact a compute resource before failover is initiated. 1 compute resource live time = 10 secondsenable_huge_pages - true, if hugepages are enabled, otherwise false. Huge pages are the memory pages of size 2MB. Use of hugepages allows to reduce the number of page walks as compared to a standard method of translation from a virtual address to physical 4kB page.system_host –the system host server IP or URL; email alerts link to transaction logs for alert events, and those logs are opened from the server configured heresystem_notification - set 1 to enable email alertssystem_support_email - the email address to which the system will send alerts about failed transactions and change of compute resource statusrecovery_templates_path - path to the directory where recovery templates will be storedremove_backups_on_destroy_vm - set 1 to remove all VS backups after this VS was deleteddisable_hypervisor_failover - 1, if compute resource failover will not initiate after meeting the value of the hypervisor_live_times parameterips_allowed_for_login - list of IP addresses allowed for login to OnApp CPmonitis_path - path to the directory where Monitis client (to enable autoscale) will be installedmonitis_account - name of the Monitis accountmonitis_apikey - API key to access the Monitis accountlocales - an array of locals (the locale code) available for the usersremove_old_root_passwords - 1, if old root password are removed, otherwise 0

pagination_max_items_limit – the maximum number of items after which the Show All option can not be applied.default_image_template - default VS template to create a new virtual server

BILLING PLANS - GET THE LIST OF BILLING PLANS 1015

Page 1017: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

service account name - service account name that is automatically created on VMware virtual servers to be able to communicate with them.

default_firewall_policy - default firewall policy for all VSs (unless set otherwise for a particular VS)app_name - application name displayed on the login screenshow_ip_address_selection_for_new_vm - set 1 to enable IP address assignment during VS creationbackup_taker_delay - frequency in seconds for launching the Backup Taker taskbilling_stat_updater_delay - frequency in seconds for launching the Billing Stats Monitor taskcluster_monitor_delay - frequency in seconds for launching the Cluster Monitor taskhypervisor_monitor_delay - frequency in seconds for launching the compute resource Monitor taskcdn_sync_delay - frequency in seconds for launching the CDN sync taskschedule_runner_delay - frequency in seconds for launching the Schedule Runner tasktransaction_runner_delay - frequency in seconds for launching the Transaction Runner taskzombie_transaction_time – the duration in minutes for the system to consider a task as "pending" before it can be relegated to zombie statuszombie_disk_space_updater_delay – the duration in minutes for the system to check the size of a zombie diskdns_enabled – 1, if DNS is enabled, otherwise 0enabled_libvirt_anti_spoofing - 1, if the anti-spoofing protection is enabled, otherwise 0allow_start_vms_with_one_ip - true, if it is allowed to start up virtual servers with one IP address, otherwise false

ip_range_limit - the number of IPs that can be added as a range at the same timeallow_initial_root_password_encryption - set 1 to allow password encryption, otherwise set 0allow_hypervisor_password_encryption - set 1 to allow VMware compute resource password encryption, otherwise set 0wipe_out_disk_on_destroy – 1, if the disk wipeout is allowed when deleting or migrating a disk, otherwise 0password_minimum_length type - the minimum required password length

password_letters_numbers - 1, if the user is enforced to use both letters and numbers in their password, otherwise 0

password_symbols type - 1, if the user is enforced to use symbols in their password, otherwise 0

password_force_unique - 1, if the user is enforced to enter unique password configuration each time they change the password, otherwise 0. This refers

BILLING PLANS - GET THE LIST OF BILLING PLANS 1016

Page 1018: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

to the user account passwords only.

password_lockout_attempts - the number of unsuccessful logon attempts that are allowed before user's account is locked out

password_lockout_response - the message displayed to the user after they exceed the number of unsuccessful logon attempts

password_expiry type - password expiry period in months

password_history_length - the number of last passwords saved in OnApp configuration

force_windows_backups - 1, if forced backup feature is enabled for Windows-based virtual servers, otherwise 0

cloud_boot_enabled - 1, if CloudBoot system is enabled on the cloud, otherwise 0nfs_root_ip - IP address of the NFS server where templates for creating PXE compute resources are storedcloud_boot_target - IP of the server where the CP is installedstorage_enabled - true, if OnApp storage is enabled, otherwise falseprefer_local_reads - true, if the local read path is enabled, otherwise falsevmware_cluster_name - name of the VMware clusterlicense_key - license key of your OnApp CParchive_stats_period - hourly statistics storage time set in months. For example, if you set that parameter to 10, the hourly statistics will be stored for the current month and the 10 previous months. And everything older than 10 months will be sent to archive (that is converted into monthly statistics). If this parameter is set as 1, then you can view the detailed hourly statistics for both the current and the previous month.instant_stats_period - the number of days the instant (raw) statistics will be storedis_archive_stats_enabled - true, if the hourly statistics archiving is enabled, otherwise falseuse_html5_vnc_console - true, if the use of HTML 5 console is enabled, otherwise false

NOTE: It is only possible to use HTML 5 console if the Control Panel server is based on CentOS6.

backup_convert_coefficient - This parameter is for incremental backups only. During the backup conversion to template, backup’s size is multiplied by this coefficient to make sure that template will be slightly bigger than the actual size for correct performance.url_for_custom_tools - path to custom recovery ISO images. Specify the full URL to the tools file packed with GNU Tar + Gzip, like http://domain.com/file.tgz.email_delivery_method - delivery method: either SNMPT or Sendmailsmtp_address - address of the SMTP server

BILLING PLANS - GET THE LIST OF BILLING PLANS 1017

Page 1019: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

smtp_authentication - select an authentication mechanism: login, plain, or cram_md5smtp_domain - associated domainsmtp_enable_starttls_auto - enable or disable StartTLS extensionsmtp_password - password to login into SMTP server smtp_port - port of the SMTP serversmtp_username - user name to login into SMTP serversnmptrap_addresses* - a set of IPv4 addresses separated by coma. These IP addresses will be used for communication between Control Panel and compute resourcessnmptrap_port* - port used for snmptrap. This must be greater than 1024

We recommend that you do not to change the default value.In case you change the port value on your OnApp CP - the corresponding change of the port VM_STATUS_SNMP_PORT should be made for all Compute resources in /etc/onapp.conf file.

allow_incremental_backups - true, if incremental backups are allowed, otherwise false. Incremental backups are not available for Windows virtual servers, as well as under VMware and Solid Fire.rsync_option_xattrs - true if storing extended attributes is enabled when taking incremental backups.rsync_option_acls - true if storing access control lists is enabled.dashboard_api_access_token - the Access token from OnApp Dashboard which is used to synchronize locations between OnApp CP and OnApp Dashboard.system_theme - the global look and feel theme which is used for the whole cloud by default.cdn_max_results_per_get_page - the maximum number of results per page delivered when OnApp data are synchronized with Aflexi. The default value is 500.instance_packages_threshold_num - when the specified number is reached, instance packages are shown in list view in the virtual server creation wizard for easier instance package selection. The default value is 3.transaction_standby_period - the time which a transaction spends in stand-by period. The default value is 30.allow_to_collect_errors - 'true' if the Control Panel is allowed to collect, aggregate, encrypt and send crash reports, otherwise 'false'. If this feature is enabled, the error list from your Control Panel will be sent to OnApp in a form of an encrypted API call. By default, this option is disabled.

log_level - log detalization level: debug, info, warn, error and fatal. This parameter is available only for CPs in development mode. It is not displayed for Control Panels in staging or production modes. By default, this parameter is set to 'info'.

graceful_stop_timeout - if the OnApp Engine is stopped, running transactions will fail after the amount of time (seconds) indicated by this parameter. By default, this parameter is set to 300 seconds.draas_enabled - 'true' if DRaaS is enabled for the Cloud; otherwise falsezabbix_host - the IP address of your Zabbix serverzabbix_url - the path to the Zabbix web-interface

BILLING PLANS - GET THE LIST OF BILLING PLANS 1018

Page 1020: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

zabbix_user - your Zabbix userzabbix_password - your Zabbix passwordamount_of_service_instances - the number of system processes that perform the OnApp engine tasks simultaneously. Each of the system processes performs the task using a separate CPU core. The default value is 1. Currently, the maximum value is 5. If you input a value larger than five, the number of system process will still be five.

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.

84.1.1 Page historyv. 5.0

Added the following parameters:

log_level

graceful_stop_timeout

v. 4.2

Added the following parameters:

use_yubikey_login

yubikey_api_id

yubikey_api_key

allow_to_collect_errors

draas_enabled

zabbix_host

zabbix_url

zabbix_user

zabbix_password

v. 4.1

Added the following parameters:

instance_packages_threshold_num

cdn_max_results_per_get_page

BILLING PLANS - GET THE LIST OF BILLING PLANS 1019

Page 1021: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

transaction_standby_period

amount_of_service_instances

v. 3.5

Added the following parameter:

system_theme

v. 3.3.1

Added the following parameter:

dashboard_api_access_token

v. 3.3

Added the following parameter:

instant_stats_period

v. 3.2.2:

Added the following parameters:

rsync_option_xattrs

rsync_option_acls

v. 3.2:

Added the following parameters:

allow_incremental_backups

backup_convert_coefficient

url_for_custom_tools

Removed wrong_activated_logical_volume_minutes parameter

v. 3.1:

allow_start_vms_with_one_ip

archive_stats_period

is_archive_stats_enabled

BILLING PLANS - GET THE LIST OF BILLING PLANS 1020

Page 1022: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

service_account_name

system_alert_reminder_period

use_html5_vnc_console

wrong_activated_logical_volume_minutes

v. 3.0 :

enable_huge_pages

use_nbd

84.2 Edit System ConfigurationUse the following request to edit the system configuration parameters (System, Backups/Templates, Interface, Defaults) on the /settings/edit page:PUT /settings.xmlPUT /settings.jsonXML Request example:

curl -i -X PUT http://onapp.test/settings.xml?restart=1 -d '<configuration><rsync_option_xattrs>false</rsync_option_xattrs><rsync_option_acls>true</rsync_option_acls><use_yubikey_login>true</use_yubikey_login><yubikey_api_key>000000000000000000</yubikey_api_key><yubikey_api_id>00000</yubikey_api_id><allow_incremental_backups>false</allow_incremental_backups><use_ssh_file_transfer>true</use_ssh_file_transfer><ssh_file_transfer_server>109.123.105.162</ssh_file_transfer_server><ssh_file_transfer_user>root</ssh_file_transfer_user><ssh_file_transfer_options>-oStrictHostKeyChecking=no-oUserKnownHostsFile=/dev/null-oPasswordAuthentication=no</ssh_file_transfer_options><ssh_port>22</ssh_port><template_path>/onapp/templates</template_path><backups_path>/onapp/backups</backups_path><data_path>/onapp/data</data_path><update_server_url>http://repo.onapp.com/</update_server_url><generate_comment>#AutomaticallygeneratedbyOnApp(3.0.GA)</generate_comment><simultaneous_backups>2</simultaneous_backups><simultaneous_backups_per_datastore>2</simultaneous_backups_per_datastore><simultaneous_backups_per_hypervisor>1</

BILLING PLANS - GET THE LIST OF BILLING PLANS 1021

Page 1023: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

simultaneous_backups_per_hypervisor><simultaneous_transactions>16</simultaneous_transactions><simultaneous_backups_per_backup_server type="integer">2</simultaneous_backups_per_backup_server><guest_wait_time_before_destroy>55</guest_wait_time_before_destroy><remote_access_session_start_port>30000</remote_access_session_start_port><remote_access_session_last_port>30099</remote_access_session_last_port><system_email>[email protected]</system_email><ajax_power_update_time>8000</ajax_power_update_time><ajax_pagination_update_time>9000</ajax_pagination_update_time><hypervisor_live_times>12</hypervisor_live_times><enable_huge_pages>false</enable_huge_pages><system_host>onapp.com</system_host><system_notification>true</system_notification><system_support_email>[email protected]</system_support_email><recovery_templates_path>/onapp/tools/recovery</recovery_templates_path><remove_backups_on_destroy_vm>true</remove_backups_on_destroy_vm><disable_hypervisor_failover>false</disable_hypervisor_failover><ips_allowed_for_login></ips_allowed_for_login><monitis_path>/usr/local/monitis</monitis_path><monitis_account>[email protected]</monitis_account><monitis_apikey>4JIA5DJUM9O01HJ550B88V73GR</monitis_apikey><locales></locales><locales>en</locales><max_memory_ratio>16</max_memory_ratio><pagination_max_items_limit>100</pagination_max_items_limit><default_image_template>1</default_image_template><service_account_name>onapp</service_account_name><default_firewall_policy>DROP</default_firewall_policy><app_name>OnApp</app_name><show_ip_address_selection_for_new_vm>true</show_ip_address_selection_for_new_vm><backup_taker_delay>5</backup_taker_delay><billing_stat_updater_delay>5</billing_stat_updater_delay><cluster_monitor_delay>15</cluster_monitor_delay><hypervisor_monitor_delay>5</hypervisor_monitor_delay><cdn_sync_delay>1200</cdn_sync_delay><schedule_runner_delay>5</schedule_runner_delay><transaction_runner_delay>5</transaction_runner_delay><zombie_transaction_time>20</zombie_transaction_time><zombie_disk_space_updater_delay>300</zombie_disk_space_updater_delay><enabled_libvirt_anti_spoofing>true</enabled_libvirt_anti_spoofing><allow_start_vms_with_one_ip>false</allow_start_vms_with_one_ip><ip_range_limit>1000</ip_range_limit><allow_initial_root_password_encryption>false</allow_initial_root_password_encryption><wipe_out_disk_on_destroy>false</wipe_out_disk_on_destroy><password_enforce_complexity>false</password_enforce_complexity><password_minimum_length>6</password_minimum_length><password_upper_lowercase>false</

BILLING PLANS - GET THE LIST OF BILLING PLANS 1022

Page 1024: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

password_upper_lowercase><password_letters_numbers>false</password_letters_numbers><password_symbols>false</password_symbols><password_force_unique>false</password_force_unique><password_lockout_attempts>3</password_lockout_attempts><password_expiry>1</password_expiry><password_history_length>12</password_history_length><force_windows_backups>false</force_windows_backups><cloud_boot_enabled>false</cloud_boot_enabled><nfs_root_ip>192.168.1.1</nfs_root_ip><cloud_boot_target>192.168.1.1</cloud_boot_target><storage_enabled>false</storage_enabled><prefer_local_reads>false</prefer_local_reads><vmware_cluster_name>OnApp</vmware_cluster_name><allow__hypervisor_password_encryption>false</allow_hypervisor_password_encryption><archive_stats_period>7776000</archive_stats_period><instant_stats_period>10</instant_stats_period><is_archive_stats_enabled>false</is_archive_stats_enabled><system_alert_reminder_period>60</system_alert_reminder_period><use_html5_vnc_console>false</use_html5_vnc_console><backup_convert_coefficient>1.1</backup_convert_coefficient><delete_template_source_after_install>1</delete_template_source_after_install><email_delivery_method>sendmail</email_delivery_method><instant_stats_period>10</instant_stats_period><smtp_address>smtp.gmail.com</smtp_address><smtp_authentication>login</smtp_authentication><smtp_domain>smtp.gmail.com</smtp_domain><smtp_enable_starttls_auto>1</smtp_enable_starttls_auto><smtp_password>pass</smtp_password><smtp_port>465</smtp_port><smtp_username>name</smtp_username><snmptrap_addresses>111.111.111.111</snmptrap_addresses><snmptrap_port>3162</snmptrap_port><url_for_custom_tools>www.sample.com</url_for_custom_tools><license_key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</license_key><dashboard_api_access_token>fgfhhkkoopjjhjggdfg</dashboard_api_access_token><cdn_max_results_per_get_page type="integer">500</cdn_max_results_per_get_page><instance_packages_threshold_num>6</instance_packages_threshold_num><transaction_standby_period>30</transaction_standby_period><draas_enabled type="boolean">false</draas_enabled><allow_to_collect_errors>true</allow_to_collect_errors><zabbix_host>000.000.00.00</zabbix_host><zabbix_url>/zabbix</zabbix_url><zabbix_user>Admin</zabbix_user><zabbix_password>zabbix</zabbix_password><amount_of_service_instances>1</amount_of_service_instances><system_theme>dark</system_theme></configuration>' -u user:userpass -H 'Accept: application/xml' -H

BILLING PLANS - GET THE LIST OF BILLING PLANS 1023

Page 1025: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'Content-type: application/xml'

JSON Request example

curl -i -X PUT http://onapp.test/settings.json?restart=1 -d '{"configuration":{"use_yubikey_login":false,"yubikey_api_key":"000000000000000000000000","yubikey_api_id":"00000","archive_stats_period": 33,"instant_stats_period": 103,"is_archive_stats_enabled": true,"rsync_option_xattr":true,"rsync_option_acls": false,"allow_incremental_backups": false,"use_ssh_file_transfer":true,"ssh_file_transfer_server":"109.123.105.162","ssh_file_transfer_user":"root","ssh_file_transfer_options":"-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o PasswordAuthentication=no","ssh_port":22,"template_path":"/onapp/templates","backups_path":"/onapp/backups","data_path":"/onapp/data","update_server_url":"http://repo.onapp.com/","license_key":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","generate_comment":"# Automatically generated by OnApp (3.0.GA)","simultaneous_backups":2,"simultaneous_backups_per_datastore":2,"simultaneous_backups_per_hypervisor":1,"simultaneous_transactions":16,"simultaneous_backups_per_backup_server":2,"guest_wait_time_before_destroy":55,"remote_access_session_start_port":30000,"remote_access_session_last_port":30099,"system_email":"[email protected]","ajax_power_update_time":8000,"ajax_pagination_update_time":9000,"hypervisor_live_times":12,"enable_huge_pages":false,"system_host":"onapp.com","system_notification":true,"system_support_email":"[email protected]","recovery_templates_path":"/onapp/tools/recovery","remove_backups_on_destroy_vm":true,"disable_hypervisor_failover":false,"ips_allowed_for_login":"","monitis_path":"/usr/local/monitis","monitis_account":"[email protected]","monitis_apikey":"4JIA5DJUM9O01HJ550B88V73GR","locales":["","en"],"max_memory_ratio":16,"pagination_max_items_limit":100,"default_image_template":"1","service_account_name":"onapp","default_firewall_policy":"DROP","app_name":"OnApp","show_ip_address_selection_for_new_vm":true,"backup_taker_delay":5,"billing_stat_updater_delay":5,"cluster_monitor_delay":15,"hypervisor_monitor_delay":5,"cdn_sync_delay":1200,"schedule_runner_delay":5,"transaction_runner_delay":5,"zombie_transaction_time":"20","zombie_disk_space_updater_delay":300,"enabled_libvirt_anti_spoofing":true,"allow_start_vms_with_one_ip":false,"ip_range_limit":1000,"allow_initial_root_password_encryption":false,"wipe_out_disk_on_destroy":false,"password_enforce_complexity":false,"password_minimum_length":6,"password_upper_lowercase":false,"password_letters_numbers":false,"password_symbols":false,"password

BILLING PLANS - GET THE LIST OF BILLING PLANS 1024

Page 1026: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

_force_unique":false,"password_lockout_attempts":"3","password_expiry":1,"password_history_length":12,"force_windows_backups":false,"cloud_boot_enabled":false,"nfs_root_ip":"192.168.1.1","cloud_boot_target":"192.168.1.1","storage_enabled":false,"prefer_local_reads":false,"vmware_cluster_name":"OnApp","allow_hypervisor_password_encryption":false,"archive_stats_period":7776000,"is_archive_stats_enabled":false,"system_alert_reminder_period":60,"use_html5_vnc_console":false,"backup_convert_coefficient":"1.1","instant_stats_period":10,"email_delivery_method":sendmail,"smtp_address":smtp.gmail.com,"smtp_authentication":login,"smtp_domain":smtp.gmail.com,"smtp_enable_starttls_auto":1,"smtp_password":pass,"smtp_port":465,"smtp_username":name,"snmptrap_addresses":111.111.111.111,"snmptrap_port":3162,"delete_template_source_after_install":1,"url_for_custom_tools":"www.sample.com","system_theme":"dark","dashboard_api_access_token":"dfgdfghjhjjkjkljl", "cdn_max_results_per_get_page":500,"instance_packages_threshold_num":6,"allow_to_collect_errors":true,"zabbix_host":"000.000.00.00","zabbix_url":"/zabbix","zabbix_user":"Admin","zabbix_password":"zabbix","transaction_standby_period":30,"amount_of_service_instances":30}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where you can edit:use_yubikey_login - whether logging in using a Yubikey is enabledyubikey_api_key - your Yubico secret keyyubikey_api_id - your Yubico client IDuse_ssh_file_transfer - set 1 to allow secure file access, transfer and management to a remote server. It is not possible to utilize SSH file transfer option when incremental backups are enabled.

Skip this option if you are using incremental backups.

ssh_file_transfer_server - the address of the remote serverssh_file_transfer_user - the login used for remote server authentication. A password is not required, as it is required that you store a host keyssh_file_transfer_options - SSH protocol options that set the rules and behavior of how to log into the remote serverssh_port– the port used for contacting SSH serverstemplate_path - path to the directory where templates will be storedbackups_path - path to the directory where backups will be storeddata_path –path to the directory where the recovery templates will be storedupdate_server_url - URL address where OnApp software updates are downloaded fromdelete_template_source_after_install - if enabled, the downloaded templates will be deleted after they are distributedgenerate_comment - this text is added by OnApp to system configuration files, such as resolv.conf

BILLING PLANS - GET THE LIST OF BILLING PLANS 1025

Page 1027: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

simultaneous_backups - the maximum allowed number of simultaneous compute resource and data store backup processessimultaneous_backups_per_datastore - the maximum number of simultaneous data store backup processessimultaneous_backups_per_hypervisor - the maximum number of simultaneous compute resource backup processessimultaneous_transactions - the number of transaction runners which the daemon will execute at the same timesimultaneous_backups_per_backup_server - the maximum number of simultaneous backup processes per backup serverguest_wait_time_before_destroy – the VS shutdown period (from 30 to 300 seconds). This allows to refuse the shutdown if the VS is booting and retry every 30 seconds till it is registered.remote_access_session_start_port - the first port in the range, which are used to remotely connect to virtual servers using the integrated VNC consoleremote_access_session_last_port - the last port in the range, which are used to remotely connect to virtual servers using the integrated VNC consolesystem_email - the email address from which help requests and email alerts are sentajax_power_update_time - how often VS status is refreshed on the Virtual Servers screen in msajax_pagination_update_time - how often the dashboard, logs and other items are refreshed in mshypervisor_live_times - determines how many times the Control Panel server will attempt to contact a compute resource before failover is initiated. 1 compute resource live time = 10 secondsenable_huge_pages - true, if hugepages are enabled, otherwise false. Huge pages are the memory pages of size 2MB. Use of hugepages allows to reduce the number of page walks as compared to a standard method of translation from a virtual address to physical 4kB page.system_host –the system host server IP or URL; email alerts link to transaction logs for alert events, and those logs are opened from the server configured heresystem_notification - set 1 to enable email alertssystem_support_email - the email address to which the system will send alerts about failed transactions and change of compute resource statusrecovery_templates_path - path to the directory where recovery templates will be storedremove_backups_on_destroy_vm - set 1 to remove all VS backups after this VS was deleteddisable_hypervisor_failover - 1, if compute resource failover will not initiate after meeting the value of the compute resource_live_times parameterips_allowed_for_login - list of IP addresses allowed for login to OnApp CPmonitis_path - path to the directory where Monitis client (to enable autoscale) will be installedmonitis_account - name of the Monitis accountmonitis_apikey - API key to access the Monitis accountlocales - an array of locals (the locale code) available for the users

BILLING PLANS - GET THE LIST OF BILLING PLANS 1026

Page 1028: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

remove_old_root_passwords - 1, if old root password are removed, otherwise 0

pagination_max_items_limit – the maximum number of items after which the Show All option can not be applied.default_image_template - default VS template to create a new virtual serverservice account name - service account name that is automatically created on VMware virtual servers to be able to communicate with them.

default_firewall_policy - default firewall policy for all VSs (unless set otherwise for a particular VS)app_name - application name displayed on the login screenshow_ip_address_selection_for_new_vm - set 1 to enable IP address assignment during VS creationbackup_taker_delay - frequency in seconds for launching the Backup Taker taskbilling_stat_updater_delay - frequency in seconds for launching the Billing Stats Monitor taskcluster_monitor_delay - frequency in seconds for launching the Cluster Monitor taskhypervisor_monitor_delay - frequency in seconds for launching the compute resource Monitor taskcdn_sync_delay - frequency in seconds for launching the CDN sync taskschedule_runner_delay - frequency in seconds for launching the Schedule Runner tasktransaction_runner_delay - frequency in seconds for launching the Transaction Runner taskzombie_transaction_time – the duration in minutes for the system to consider a task as "pending" before it can be relegated to zombie statuszombie_disk_space_updater_delay – the duration in minutes for the system to check the size of a zombie diskdns_enabled – 1, if DNS is enabled, otherwise 0enabled_libvirt_anti_spoofing - 1, if the anti-spoofing protection is enabled, otherwise 0allow_start_vms_with_one_ip - true, if it is allowed to start up virtual servers with one IP address, otherwise false

ip_range_limit - the number of IPs that can be added as a range at the same timeallow_initial_root_password_encryption - set 1 to allow password encryption, otherwise set 0allow_hypervisor_password_encryption - set 1 to allow VMware compute resource password encryption, otherwise set 0wipe_out_disk_on_destroy – 1, if the disk wipeout is allowed when deleting or migrating a disk, otherwise 0password_minimum_length - specify minimum required password length (0-99). The default value is 6.

password_letters_numbers - 1, if the user is enforced to use both letters and numbers in their password, otherwise 0

BILLING PLANS - GET THE LIST OF BILLING PLANS 1027

Page 1029: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

password_symbols type - 1, if the user is enforced to use symbols in their password, otherwise 0

password_force_unique - 1, if the user is enforced to enter unique password configuration each time they change the password, otherwise 0. This refers to the user account passwords only.

password_lockout_attempts - the number of unsuccessful logon attempts that are allowed before user's account is locked out

password_lockout_response - the message displayed to the user after they exceed the number of unsuccessful logon attempts

password_expiry type - password expiry period in months

password_history_length - the number of last passwords saved in OnApp configuration

force_windows_backups - 1, if forced backup feature is enabled for Windows-based virtual servers, otherwise 0

cloud_boot_enabled - 1, if CloudBoot system is enabled on the cloud, otherwise 0nfs_root_ip - IP address of the NFS server where templates for creating PXE compute resources are storedcloud_boot_target - IP of the server where the CP is installedstorage_enabled - true, if OnApp storage is enabled, otherwise falseprefer_local_reads - true, if the local read path is enabled, otherwise falsevmware_cluster_name - name of the VMware clusterlicense_key - license key of your OnApp CP (required parameter)archive_stats_period - set the time in months for hourly statistics storage. For example, if you set this parameter to 10, the hourly statistics will be stored for the current month and the 10 previous months. And everything older than 10 months will be sent to archive (that is converted into monthly statistics). If this parameter is set as 1, then you can view the detailed hourly statistics for both the current and the previous month.instant_stats_period - set the number of days the instant (raw) statistics will be stored. Starting with OnApp version 5.0, the default value for new installations is 1. For the clouds that have been upgraded from OnApp version 4.3, the default value is 10.is_archive_stats_enabled - set this parameter true to enable archiving of hourly statistics; if false - the statistics will be archived on monthly basisuse_html5_vnc_console - true, if the use of HTML 5 console is enabled, otherwise false

NOTE: It is only possible to use HTML 5 console if the Control Panel server is based on CentOS6.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1028

Page 1030: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

backup_convert_coefficient - This parameter is for incremental backups only. During the backup conversion to template, backup’s size is multiplied by this coefficient to make sure that template will be slightly bigger than the actual size for correct performance.email_delivery_method - delivery method: either SNMPT or Sendmailsmtp_address - address of the SMTP serversmtp_authentication - select an authentication mechanism: login, plain, or cram_md5smtp_domain - enter associated domainsmtp_enable_starttls_auto - enable or disable StartTLS extensionsmtp_password - password to login into SMTP server smtp_port - port of the SMTP serversmtp_username - user name to login into SMTP serversnmptrap_addresses* - a set of IPv4 addresses separated by coma. These IP addresses will be used for communication between Control Panel and compute resourcessnmptrap_port* - port used for snmptrap. This must be greater than 1024

We recommend that you do not to change the default value.In case you change the port value on your OnApp CP - the corresponding change of the port VM_STATUS_SNMP_PORT should be made for all Compute resources in /etc/onapp.conf file.

system_theme - specify the look and feel theme which should be used in the cloud by default. You can set dark or light parameters.

url_for_custom_tools - path to custom recovery ISO images. Specify the full URL to the tools file packed with GNU Tar + Gzip, like http://domain.com/file.tgz.allow_incremental_backups - true, if incremental backups are allowed, otherwise false. Incremental backups are not available for Windows virtual servers, as well as under VMware and Solid Fire. rsync_option_xattrs - true if storing extended attributes is enabled when taking incremental backups.rsync_option_acls - true if storing access control lists is enabled.dashboard_api_access_token - the Access token from OnApp Dashboard used to synchronize locations between OnApp CP and OnApp Dashboard.cdn_max_results_per_get_page - the maximum number of results per page delivered when OnApp data are synchronized with Aflexi. The default value is 500.instance_packages_threshold_num - when the specified number is reached, instance packages are shown in list view in the virtual server creation wizard for easier instance package selection. The default value is 3.transaction_standby_period - the time which a transaction spends in stand-by period. The default value is 30.allow_to_collect_errors - 'true' if the Control Panel is allowed to collect, aggregate, encrypt and send crash reports, otherwise 'false'. If you enable this feature, the error list from your Control Panel will be sent to OnApp in a form of an encrypted API call. By default, this option is disabled.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1029

Page 1031: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

log_level - log detalization level: debug, info, warn, error and fatal. This parameter is available only for CPs in development mode. It is not displayed for Control Panels in staging or production modes. By default, this parameter is set to 'info'.

graceful_stop_timeout - if the OnApp Engine is stopped, running transactions will fail after the amount of time (seconds) indicated by this parameter. By default, this parameter is set to 300 seconds.draas_enabled - 'true' if DRaaS is enabled for the Cloud; otherwise falsezabbix_host - the IP address of your Zabbix serverzabbix_url - the path to the Zabbix web-interfacezabbix_user - your Zabbix userzabbix_password - your Zabbix passwordamount_of_service_instances - the number of system processes that perform the OnApp engine tasks simultaneously. Each of the system processes performs the task using a separate CPU core. The default value is 1. Currently, the maximum value is 5. If you input a value larger than five, the number of system process will still be five.

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.

84.2.1 Page history

v. 5.0

Added the following parameters:

log_level

graceful_stop_timeout

v. 4.2

Added the following parameters:

use_yubikey_login

yubikey_api_id

yubikey_api_key

allow_to_collect_errors

draas_enabled

zabbix_host

zabbix_url

BILLING PLANS - GET THE LIST OF BILLING PLANS 1030

Page 1032: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

zabbix_user

zabbix_password

v. 4.1

Added the following parameters:

instance_packages_threshold_num

cdn_max_results_per_get_page

transaction_standby_period

amount_of_service_instances

allow_to_collect_errors

v. 3.5

Added the following parameter:

system_theme

v. 3.3.1

Added the following parameter:

dashboard_api_access_token

v. 3.3

Added the following parameter:

delete_template_source_after_install

instant_stats_period

email_delivery_method

smtp_address

smtp_authentication

BILLING PLANS - GET THE LIST OF BILLING PLANS 1031

Page 1033: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

smtp_domain

smtp_enable_starttls_auto

smtp_password

smtp_port

smtp_username

snmptrap_addresses

snmptrap_port

cpu_guarantee parameter was removed from general system settings and now can be set for a compute zone

v. 3.2.2:

Added the following parameters:

rsync_option_xattrs

rsync_option_acls

v. 3.2:

Added the following parameters:

allow_incremental_backups

backup_convert_coefficient

url_for_custom_tools

Removed wrong_activated_logical_volume_minutes parameter

v. 3.1:

allow_start_vms_with_one_ip

archive_stats_period

is_archive_stats_enabled

BILLING PLANS - GET THE LIST OF BILLING PLANS 1032

Page 1034: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

service_account_name

system_alert_reminder_period

use_html5_vnc_console

wrong_activated_logical_volume_minutes

v. 3.0 :

enable_huge_pages

use_nbd

BILLING PLANS - GET THE LIST OF BILLING PLANS 1033

Page 1035: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

85 TEMPLATES

A template is a pre-configured operating system image that contains the root directory of an operating system. There are two different kinds of template: system templates and custom templates. System templates are downloaded from the online library. Custom templates are created by backing up an existing virtual server, and converting that backup to a template.

85.1 Get List of All TemplatesTo get the list of all templates, run:GET /templates.xmlGET /templates.json ORGET /templates/all.xmlGET /templates/all.json XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates.xml

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"><image_template><allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot><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">true</baremetal_server><cdn type="boolean">false</cdn><checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1034

Page 1036: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2012-04-03T14:30:59+00:00</created_at><disk_target_device>---xen: xvda kvm: hd</disk_target_device><ext4 type="boolean">false</ext4><file_name>centos-6.2-x64-1.0.tar.gz</file_name><id type="integer">1</id><initial_password>Password1</initial_password><initial_username>root</initial_username><label>CentOS 6.2 x64</label><manager_id>centos5.11x64</manager_id><min_disk_size type="integer">5</min_disk_size><min_memory_size type="integer">128</min_memory_size><operating_system>linux</operating_system><operating_system_arch>x64</operating_system_arch><operating_system_distro>rhel</operating_system_distro><operating_system_edition nil="true"/><operating_system_tail nil="true"/><parent_template_id nil="true"/><remote_id nil="true"/><resize_without_reboot_policy></resize_without_reboot_policy><smart_server type="boolean">true</smart_server><state>inactive</state><template_size type="integer">271308</template_size><updated_at nil="true"/><user_id nil="true"/><version>1.0</version><virtualization>xen,kvm</virtualization><type>ImageTemplate</type><virtualization_array type="array"><virtualization_array>xen</virtualization_array><virtualization_array>kvm</virtualization_array></virtualization_array></image_template><image_template>...</image_template></image_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 1035

Page 1037: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

disk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB) min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – true if this is a system templateremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

updated_at — the date when the Network was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format

BILLING PLANS - GET THE LIST OF BILLING PLANS 1036

Page 1038: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

user_id - the ID of a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template. This parameter will become an array of strings in the OnApp 5.1 release.

virtualization_array – an array of virtualization types (xen, kvm or kvm_virtio) which is compatible with this template. This parameter will be deprecated in the OnApp 5.1 release.

85.2 Get List of System TemplatesGET /templates/system.xmlGET /templates/system.jsonReturns the array of all templates.XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/system.xml

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/system.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"> <image_template> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <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">true</baremetal_server> <cdn type="boolean">false</cdn> <checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum> <created_at type="datetime">2012-04-03T14:30:59+00:00</created_at> <disk_target_device>---xen: xvda kvm: hd</disk_target_device> <ext4 type="boolean">false</ext4> <file_name>centos-6.2-x64-1.0.tar.gz</file_name> <id type="integer">1</id> <initial_password>Password1</initial_password>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1037

Page 1039: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<initial_username>root</initial_username> <label>CentOS 6.2 x64</label> <manager_id>centos5.11x64</manager_id> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>rhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <resize_without_reboot_policy></resize_without_reboot_policy> <smart_server type="boolean">true</smart_server> <state>inactive</state> <template_size type="integer">271308</template_size> <updated_at nil="true"/> <user_id nil="true"/> <version>1.0</version> <virtualization>xen,kvm</virtualization> </image_template> <image_template>...</image_template></image_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)

BILLING PLANS - GET THE LIST OF BILLING PLANS 1038

Page 1040: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – true if this is a system templateremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.3 Get List of Own TemplatesGET /templates/own.xmlGET /templates/own.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 1039

Page 1041: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Returns the array of your own templates. And empty array is returned if there are no templates.XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/own.xml

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/own.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"> <image_template> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <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">true</baremetal_server> <cdn type="boolean">false</cdn> <checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum> <created_at type="datetime">2012-04-03T14:30:59+00:00</created_at> <disk_target_device>---xen: xvda kvm: hd</disk_target_device> <ext4 type="boolean">false</ext4> <file_name>centos-6.2-x64-1.0.tar.gz</file_name> <id type="integer">1</id> <initial_password>Password1</initial_password> <initial_username>root</initial_username> <label>CentOS 6.2 x64</label> <manager_id>centos5.11x64</manager_id> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>rhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <parent_template_id nil="true"/> <remote_id nil="true"/> <resize_without_reboot_policy></resize_without_reboot_policy> <smart_server type="boolean">true</smart_server> <state>inactive</state>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1040

Page 1042: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<template_size type="integer">271308</template_size> <updated_at nil="true"/> <user_id nil="true"/> <version>1.0</version> <virtualization>xen,kvm</virtualization> </image_template> <image_template>...</image_template></image_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – true if this is a system templateremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1041

Page 1043: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.4 Get List of User TemplatesGET /templates/user.xmlGET /templates/user.json The request returns the array of custom templates created by your users. An empty array is returned if there are no user templates.

Contrary to the System templates, the Custom templates parent_template_id parameter indicates the ID of a system template, which has been converted into custom one.

XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/user.xml

JSON Request example

BILLING PLANS - GET THE LIST OF BILLING PLANS 1042

Page 1044: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/user.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"><image_template><allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot><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">true</baremetal_server><cdn type="boolean">false</cdn><checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum><created_at type="datetime">2012-04-03T14:30:59+00:00</created_at><disk_target_device>---xen: xvda kvm: hd</disk_target_device><ext4 type="boolean">false</ext4><file_name>centos-6.2-x64-1.0.tar.gz</file_name><id type="integer">1</id><initial_password>Password1</initial_password><initial_username>root</initial_username><label>CentOS 6.2 x64</label><manager_id>centos5.11x64</manager_id><min_disk_size type="integer">5</min_disk_size><min_memory_size type="integer">128</min_memory_size><operating_system>linux</operating_system><operating_system_arch>x64</operating_system_arch><operating_system_distro>rhel</operating_system_distro><operating_system_edition nil="true"/><operating_system_tail nil="true"/><parent_template_id nil="true"/><remote_id nil="true"/><resize_without_reboot_policy></resize_without_reboot_policy><smart_server type="boolean">true</smart_server><state>inactive</state><template_size type="integer">271308</template_size><updated_at nil="true"/><user_id nil="true"/><version>1.0</version><virtualization>xen,kvm</virtualization></image_template><image_template>...</image_template></image_templates>

Where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 1043

Page 1045: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – ID of a system template, which has been converted into custom oneremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where:

BILLING PLANS - GET THE LIST OF BILLING PLANS 1044

Page 1046: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.5 Get List of Templates of Particular User

To view templates of a particular user:GET /templates/user/:user_id.xmlGET /templates/user/:user_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/templates/user/:user_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/templates/user/:user_id.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"><image_template><allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot><allowed_hot_migrate type="boolean">false</allowed_hot_migrate><allowed_swap type="boolean">true</allowed_swap><backup_server_id nil="true"/>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1045

Page 1047: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<baremetal_server type="boolean">true</baremetal_server><cdn type="boolean">false</cdn><checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum><created_at type="datetime">2012-04-03T14:30:59+00:00</created_at><disk_target_device>---xen: xvda kvm: hd</disk_target_device><ext4 type="boolean">false</ext4><file_name>centos-6.2-x64-1.0.tar.gz</file_name><id type="integer">1</id><initial_password>Password1</initial_password><initial_username>root</initial_username><label>CentOS 6.2 x64</label><manager_id>centos5.11x64</manager_id><min_disk_size type="integer">5</min_disk_size><min_memory_size type="integer">128</min_memory_size><operating_system>linux</operating_system><operating_system_arch>x64</operating_system_arch><operating_system_distro>rhel</operating_system_distro><operating_system_edition nil="true"/><operating_system_tail nil="true"/><parent_template_id nil="true"/><remote_id nil="true"/><resize_without_reboot_policy></resize_without_reboot_policy><smart_server type="boolean">true</smart_server><state>inactive</state><template_size type="integer">271308</template_size><updated_at nil="true"/><user_id nil="true"/><version>1.0</version><virtualization>xen,kvm</virtualization></image_template><image_template>...</image_template></image_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supported

BILLING PLANS - GET THE LIST OF BILLING PLANS 1046

Page 1048: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

file_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – ID of a system template, which has been converted into custom oneremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

BILLING PLANS - GET THE LIST OF BILLING PLANS 1047

Page 1049: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.6 Get List of Inactive TemplatesGET /templates/inactive.xmlGET /templates/inactive.json The array of inactive templates is returned. An empty array is returned if there are no inactive user templates.XML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/inactive.xml

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/inactive.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_templates type="array"><image_template><allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot><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">true</baremetal_server><cdn type="boolean">false</cdn><checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum><created_at type="datetime">2012-04-03T14:30:59+00:00</created_at><disk_target_device>---xen: xvda kvm: hd</disk_target_device><ext4 type="boolean">false</ext4><file_name>centos-6.2-x64-1.0.tar.gz</file_name><id type="integer">1</id><initial_password>Password1</initial_password><initial_username>root</initial_username><label>CentOS 6.2 x64</label><manager_id>centos5.11x64</manager_id><min_disk_size type="integer">5</min_disk_size><min_memory_size type="integer">128</min_memory_size><operating_system>linux</operating_system><operating_system_arch>x64</operating_system_arch>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1048

Page 1050: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<operating_system_distro>rhel</operating_system_distro><operating_system_edition nil="true"/><operating_system_tail nil="true"/><parent_template_id nil="true"/><remote_id nil="true"/><resize_without_reboot_policy></resize_without_reboot_policy><smart_server type="boolean">true</smart_server><state>inactive</state><template_size type="integer">271308</template_size><updated_at nil="true"/><user_id nil="true"/><version>1.0</version><virtualization>xen,kvm</virtualization></image_template><image_template>...</image_template></image_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – true if this is a system templateremote_id - ID of the template, if it came from the market

BILLING PLANS - GET THE LIST OF BILLING PLANS 1049

Page 1051: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

resize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.7 Get Template DetailsGET /templates/:template_id.xmlGET /templates/: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/templates/template_id.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 1050

Page 1052: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/template_id.json

XML output example

<?xml version="1.0" encoding="UTF-8"?><image_template><allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot><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">true</baremetal_server><cdn type="boolean">false</cdn><checksum>f24aece694ffa125eaf72e9fb13e8dbd</checksum><created_at type="datetime">2012-04-03T14:30:59+00:00</created_at><disk_target_device>---xen: xvda kvm: hd</disk_target_device><ext4 type="boolean">false</ext4><file_name>centos-6.2-x64-1.0.tar.gz</file_name><id type="integer">1</id><initial_password>Password1</initial_password><initial_username>root</initial_username><label>CentOS 6.2 x64</label><manager_id>centos5.11x64</manager_id><min_disk_size type="integer">5</min_disk_size><min_memory_size type="integer">128</min_memory_size><operating_system>linux</operating_system><operating_system_arch>x64</operating_system_arch><operating_system_distro>rhel</operating_system_distro><operating_system_edition nil="true"/><operating_system_tail nil="true"/><parent_template_id nil="true"/><remote_id nil="true"/><resize_without_reboot_policy></resize_without_reboot_policy><smart_server type="boolean">true</smart_server><state>inactive</state><template_size type="integer">271308</template_size><updated_at nil="true"/><user_id nil="true"/><version>1.0</version><virtualization>xen,kvm</virtualization><type>ImageTemplate</type><virtualization_array type="array"><virtualization_array>xen</virtualization_array><virtualization_array>kvm</virtualization_array></virtualization_array>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1051

Page 1053: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</image_template>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebackup_server_id – the ID of the backup server where the template is storedbaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumcreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template fileid – ID of templateinitial_password - the password set for the VS built on this templateinitial_username - the username set for the VS built on this templatelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSparent_template_id – true if this is a system templateremote_id - ID of the template, if it came from the marketresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1052

Page 1054: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

state – state of the template (active, inactive)

template_size- the size of the template

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 a user who owns this template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template. This parameter will become an array of strings in the OnApp 5.1 release.

virtualization_array – an array of virtualization types (xen, kvm or kvm_virtio) which is compatible with this template. This parameter will be deprecated in the OnApp 5.1 release.

85.8 Make Template PublicPOST /templates/:id/make_public.xmlPOST /templates/:id/make_public.jsonXML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/: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/templates/:id/make_public.json

If a template is queued to be moved to a public list successfully, an HTTP 201 response is returned.

Only Custom templates can be made public.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1053

Page 1055: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

85.9 Delete TemplateTo delete a template from the system:DELETE /templates/:id.xmlDELETE /templates/:id.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/templates/: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/templates/:id.json -H'Content-type: application/json' -H'Accept: application/json'

The system won't delete the template if it is used by any VSs.

85.10 Edit TemplatePUT /templates/:id.xmlPUT /templates/:id.jsonXML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type:application/xml' -u user:userpass -d '<image_template><label>zaza_loc12</label><file_name>vmwsyfugaqwq6r_20130613175624</file_name><version>1.3</version><min_disk_size>10</min_disk_size><min_memory_size>512</min_memory_size></image_template>' --url http://onapp.test/templates/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type:application/json' -u user:userpass -d '{"image_template":{"label":"zaza_loc12","file_name":"vmwsyfugaqwq6r_20130613175624","version":"1.3","min_disk_size": "10","min_memory_size": "512"}}' --url http://onapp.test/templates/:id.json

Where you can edit:label – the template title

BILLING PLANS - GET THE LIST OF BILLING PLANS 1054

Page 1056: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

file_name – the name of the template fileversion – file versionmin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size - minimum memory size required to build a VS on this template (MB)

85.11 Get List of Available for Installation Templates

To get the list of all available for the installation system templates, use the following request:GET /templates/available.xmlGET /templates/available.jsonXML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/available.xml

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/available.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><?xml version="1.0" encoding="UTF-8"?><remote_templates type="array"> <remote_template> <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> <baremetal_server type="boolean">true</baremetal_server> <cdn type="boolean">false</cdn> <checksum>0996d78608582803b57baae672b43664</checksum> <disk_target_device>---xen: xvdakvm: hd

BILLING PLANS - GET THE LIST OF BILLING PLANS 1055

Page 1057: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</disk_target_device> <ext4 type="boolean">true</ext4> <file_name>archlinux-2012.08-x64-1.4-xen.kvm.kvm_virtio.tar.gz</file_name> <label>Arch Linux 2012.08 x64</label> <manager_id>archlinux2012.08x64</manager_id> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>archlinux</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <resize_without_reboot_policy>---:xen: :centos5: 10 :centos6: 10:kvm: :centos5: 0 :centos6: 0</resize_without_reboot_policy> <smart_server type="boolean">true</smart_server> <template_size type="integer">360588383</template_size> <version>1.4</version> <virtualization>xen,kvm,kvm_virtio</virtualization> </remote_template><remote_template>...</remote_template></remote_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise falseallowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template filelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)

BILLING PLANS - GET THE LIST OF BILLING PLANS 1056

Page 1058: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy><xen>

<centos5 type="integer">14</centos5><centos6 type="integer">14</centos6>

</xen><kvm>

<centos5 type="integer">12</centos5><centos6 type="integer">0</centos6>

</kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

template_size- the size of the template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

85.12 Get List of Available for Update Templates

To get the list of all available for the update system templates, use the following request:GET /templates/upgrades.xmlGET /templates/upgrades.jsonXML Request example

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/templates/upgrades.xml

BILLING PLANS - GET THE LIST OF BILLING PLANS 1057

Page 1059: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

JSON Request example

curl -i -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://onapp.test/templates/updates.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><remote_templates type="array"> <remote_template> <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> <baremetal_server type="boolean">true</baremetal_server> <cdn type="boolean">false</cdn> <checksum>978523101ef89278ae59275bdece4b42</checksum> <disk_target_device>---xen: sdakvm: hd</disk_target_device> <ext4 type="boolean">true</ext4> <file_name>ubuntu-13.04-LAMP-x64-1.2-xen.kvm.kvm_virtio.tar.gz</file_name> <label>Ubuntu 13.04 x64 LAMP</label> <manager_id>ubuntu13.04lampx64</manager_id> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">256</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>ubuntu</operating_system_distro> <operating_system_edition></operating_system_edition> <operating_system_tail></operating_system_tail> <resize_without_reboot_policy>--- {}</resize_without_reboot_policy> <smart_server type="boolean">true</smart_server> <template_size type="integer">350452322</template_size> <version>1.2</version> <virtualization>xen,kvm,kvm_virtio</virtualization> </remote_template> <remote_template>...</remote_template></remote_templates>

Where:allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise false

BILLING PLANS - GET THE LIST OF BILLING PLANS 1058

Page 1060: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

allowed_hot_migrate – true if hot migration is allowed, otherwise falseallowed_swap – true if swap is allowed, otherwise falsebaremetal_server - true if the baremetal server can be built from this templatecdn – true if this template can be used for building edge servers. Otherwise false.checksum – file checksumdisk_target_device – the prefix indicating the method of translating the disk to a VS by compute resourceext4 - true if ext4 file system is supportedfile_name – the name of the template filelabel – the template titlemanager_id - ID of the template on the template servermin_disk_size – minimum disk size required to build a VS on this template (GB)min_memory_size – minimum memory size required to build a VS on this template (MB)operating_system – operating system nameoperating_system_arch – architecture of the operating systemoperating_system_distro – operating system distributionoperating_system_edition – edition of the OSoperating_system_tail – tail of the OSresize_without_reboot_policy - all specifically tested templates (all newly added templates and some of the most frequently used ones) will have this parameter which indicates the hot resize possibility for a particular template considering its OS version and virtualization type:

<resize_without_reboot_policy> <xen> <centos5 type="integer">14</centos5> <centos6 type="integer">14</centos6> </xen> <kvm> <centos5 type="integer">12</centos5> <centos6 type="integer">0</centos6> </kvm>

The indicated integer is a decimal representation of a 4-bit binary code, which indicates whether CPU or RAM can (1) or cannot (0) be resized without reboot, where: 1st bit defines the ability to increase cpu 2nd bit defines the ability to decrease cpu 3rd bit defines the ability to increase RAM 4th bit defines the ability to decrease RAM

smart_server - true if a smart server can be built from this template

template_size- the size of the template

version – version of the file

virtualization – type of virtualization (xen, kvm or kvm_virtio) which is compatible with this template

BILLING PLANS - GET THE LIST OF BILLING PLANS 1059

Page 1061: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

85.13 Install TemplateTo download and install the available templates, use the following requests.

XML Request Example:

curl -i -X POST -u 'user:userpass' http://onapp.test/templates.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<image_template><manager_id>debian5.0x86</manager_id><backup_server_id></backup_server_id></image_template>'

Json Request example:

curl -i -X POST -u 'user:userpass' http://onapp.test/templates.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"image_template"=>{"manager_id"=>"debian5.0x86", "backup_server_id"=>""}}'

Where: backup_server_id - particular backup server id or use this parameter as empty to install template for all backup servers ("Use ssh file transfer" parameter should be disabled in settings).manager_id - the remote template attribute

85.14 Update TemplateTo update the already installed templates, use the following request.PUT /templates/:id/upgrade.xmlPUT /templates/:id/upgrade.json

XML Request Example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 1060

Page 1062: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X PUT -u 'user:userpass' http://onapp.test/templates/:id/upgrade.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request Example:

curl -i -X PUT -u 'user:userpass' http://onapp.test/templates/:id/upgrade.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:id - the ID of the required template

85.15 Search for Particular Available for Installation Template

To search for a particular available for the installation template, use the requests described below. You can also use regular expressions in your query.

XML Request Example:

curl -i -X GET -u user:userpass 'http://onapp.test/templates/available.xml?search_filter\[query\]=1.5&search_filter\[os\]=FreeBSD&search_filter\[virtualization\]=XEN&search_filter\[arch\]=x64'

JSON Request Example:

curl -i -X GET -u user:userpass 'http://onapp.test/templates/available.json?search_filter\[query\]=bsd&search_filter\[os\]=FreeBSD&search_filter\[virtualization\]=XEN&search_filter\[arch\]=x64'

BILLING PLANS - GET THE LIST OF BILLING PLANS 1061

Page 1063: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:query - any information from the template label

os - specify the operating system: Linux, Windows, FreeBSD

virtualization - specify the virtualization type: XEN, KVM, Virtio

arch - x64, x86

Output example:

<remote_templates type="array"> <remote_template> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot> <allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <baremetal_server type="boolean">false</baremetal_server> <cdn type="boolean">false</cdn> <checksum>9446aa5e8d02758191ba62d49f659b0a</checksum> <disk_target_device>--- xen: hd kvm: hd </disk_target_device> <ext4 type="boolean">false</ext4> <file_name>freebsd-9.1-x64-1.5-xen.kvm.kvm_virtio.tar.gz</file_name> <label>FreeBSD 9.1 x64</label> <manager_id>freebsd9.1x64</manager_id> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">256</min_memory_size> <operating_system>freebsd</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>freebsd</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <smart_server type="boolean">true</smart_server> <template_size type="integer">309741781</template_size> <url>http://templates.repo.onapp.com/FreeBSD/freebsd-9.1-x64-1.5-xen.kvm.kvm_virtio.tar.gz</url> <version>1.5</version> <virtualization>xen,kvm,kvm_virtio</virtualization> </remote_template></remote_templates>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1062

Page 1064: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

85.16 Search for Particular Available for Upgrade Template

To search for a particular available for the upgrade template, use the requests described below. You can also use regular expressions in your query.

XML Request Example:

curl -i -X GET -u user:userpass 'http://onapp.test/templates/upgrades.xml?search_filter\[query\]=panel&search_filter\[os\]=Linux&search_filter\[virtualization\]=XEN&search_filter\[arch\]=x64'

JSON Request Example:

curl -i -X GET -u user:userpass 'http://onapp.test/templates/upgrades.json?search_filter\[query\]=red&search_filter\[os\]=Linux&search_filter\[virtualization\]=XEN&search_filter\[arch\]=x64'

Where:query - any information from the template label

os - specify the operating system: Linux, Windows, FreeBSD

virtualization - specify the virtualization type: XEN, KVM, Virtio

arch - x64, x86

Output example:

<remote_templates type="array"> <remote_template> <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1063

Page 1065: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<allowed_hot_migrate type="boolean">false</allowed_hot_migrate> <allowed_swap type="boolean">true</allowed_swap> <baremetal_server type="boolean">true</baremetal_server> <cdn type="boolean">false</cdn> <checksum>c9230d12ef1391a01e7e39d1ebbf300f</checksum> <disk_target_device>---xen: xvdakvm: hd</disk_target_device> <ext4 type="boolean">true</ext4> <file_name>cloudlinux-6.4-cPanel-x64-1.3-xen.kvm.kvm_virtio.tar.gz</file_name> <label>CloudLinux Server 6.4 x64 cPanel</label> <manager_id>cloudlinux6.4cpanelx64</manager_id> <min_disk_size type="integer">9</min_disk_size> <min_memory_size type="integer">512</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>rhel</operating_system_distro> <operating_system_edition nil="true"/> <operating_system_tail nil="true"/> <smart_server type="boolean">true</smart_server> <template_size type="integer">2329118640</template_size> <url>http://templates.repo.onapp.com/Linux/cloudlinux-6.4-cPanel-x64-1.3-xen.kvm.kvm_virtio.tar.gz</url> <version>1.3</version> <virtualization>xen,kvm,kvm_virtio</virtualization> </remote_template></remote_templates>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1064

Page 1066: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

86 TEMPLATE STORE

Template Store is the class that organizes all VS templates into separate groups. Each template group can be associated with a billing plan, in order to control which templates are available to different users.

86.1 Get Template Store DetailsTo view the list of template groups in the template store, run:

XML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/template_store.xml

JSON Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/template_store.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><objects type="array"> <object> <created_at type="datetime">2012-05-28T06:02:00-10:00</created_at> <depth type="integer">0</depth> <id type="integer">1</id> <kms type="boolean">false</kms> <kms_host></kms_host> <kms_port></kms_port> <kms_server_label></kms_server_label> <label>Linux</label> <lft type="integer">1</lft>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1065

Page 1067: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<mak type="boolean">true</mak> <own type="boolean">false</own> <parent_id nil="true"></parent_id> <rgt type="integer">28</rgt> <updated_at type="datetime">2012-07-13T02:51:56-10:00</updated_at> </object></objects>

Where:objects - the array with the following parameters:

label – the group name

created_at – the date when the template group was created

id - template group id

kms_host – KMS server host name

kms_port – KMS server port

kms_server_label – KMS server name

label - template group name

mak - MAK windows licensing type

own - user's own license

parent_id - id of the target template group

depth - the depth of a given node (distance from this template group to the root)

lft - left nested set identifier

rgt - right nested set identifier

updated_at – the date when the template group was updated

86.2 Get Template Group DetailsTo get details of a particular template group, use the following request:GET /settings/image_template_groups/:image_template_group_id.xmlGET /settings/image_template_groups/:image_template_group_id.jsonXML Request example:

BILLING PLANS - GET THE LIST OF BILLING PLANS 1066

Page 1068: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

curl -i -X GET -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_template_group> <created_at type="datetime">2012-07-13T03:25:48-10:00</created_at> <depth type="integer">2</depth> <id type="integer">105</id> <kms type="boolean">false</kms> <kms_host></kms_host> <kms_port></kms_port> <kms_server_label></kms_server_label> <label>qweqwe</label> <lft type="integer">77</lft> <mak type="boolean">false</mak> <own type="boolean">false</own> <parent_id type="integer">102</parent_id> <rgt type="integer">78</rgt> <updated_at type="datetime">2012-07-13T03:25:48-10:00</updated_at></image_template_group>

Where:image_template_group - the image template array with the following parameters:

label – the group namecreated_at – the date when the template group was createdid - template group idkms_host – KMS server host namekms_port – KMS server portkms_server_label – KMS server namelabel - template group namemak - MAK windows licensing typeown - user's own licenseparent_id - id of the target template groupdepth - the depth of a given node (distance from this template group to the root)lft - left nested set identifier

BILLING PLANS - GET THE LIST OF BILLING PLANS 1067

Page 1069: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

rgt - right nested set identifierupdated_at – the date when the template group was updated

86.3 Add Template GroupTo add a template group, use the following request:POST /settings/image_template_groups.xmlPOST /settings/image_template_groups.json XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<image_template_group><label>zaza</label><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>wqqsasawqw</kms_server_label></image_template_group>' --url http://onapp.test/settings/image_template_groups.xml

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"image_template_group":{"label":"zaza", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --url http://onapp.test/settings/image_template_groups.json

Returns 201 HTTP response on success

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_template_group> <created_at type="datetime">2012-07-13T03:55:21-10:00</created_at> <depth type="integer">0</depth> <id type="integer">106</id> <kms type="boolean">true</kms> <kms_host>ededde.fe</kms_host> <kms_port>5453</kms_port> <kms_server_label>wqqsasawqw</kms_server_label> <label>zaza</label> <lft type="integer">85</lft> <mak type="boolean">true</mak> <own type="boolean">false</own> <parent_id nil="true"></parent_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1068

Page 1070: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<rgt type="integer">86</rgt> <updated_at type="datetime">2012-07-13T03:55:21-10:00</updated_at></image_template_group>

Where:image_template_group - the image template array with the following parameters:

label – the group namecreated_at – the date when the template group was createdid - template group idkms_host – KMS server host namekms_port – KMS server portkms_server_label – KMS server namelabel - template group namemak - MAK windows licensing typeown - user's own licenseparent_id - id of the target template groupdepth - the depth of a given node (distance from this template group to the root)lft - left nested set identifierrgt - right nested set identifierupdated_at – the date when the template group was updated

86.4 Add Child GroupXML Request example:

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<image_template_group><label>zaza</label><parent_id>100</parent_id><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>enother</kms_server_label></image_template_group>' --url http://onapp.test/settings/image_template_groups.xml

JSON Request example:

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"image_template_group":{"label":"zaza_ch1", "parent_id":"100",

BILLING PLANS - GET THE LIST OF BILLING PLANS 1069

Page 1071: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

"mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --url http://onapp.test/settings/image_template_groups.json

XML Response example

HTTP/1.1 201 Created

Date: Fri, 13 Jul 2012 13:19:41 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1ETag: "6bb2b9cec5a8bd44242ebd0217ac8da5"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: eb23f46901cecec2a898a6e50454196dX-Runtime: 0.142129X-Rack-Cache: invalidate, passSet-Cookie: _session_id=b5979762702346b086aa13538e60c2e4; path=/; HttpOnlyLocation: http://83.170.110.181/settings/image_template_groups/104Status: 201Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8

XML Output example

<?xml version="1.0" encoding="UTF-8"?><image_template_group> <created_at type="datetime">2012-07-13T03:19:41-10:00</created_at> <depth type="integer">1</depth> <id type="integer">104</id> <kms type="boolean">true</kms> <kms_host>ededde.fe</kms_host> <kms_port>5453</kms_port> <kms_server_label>enother</kms_server_label> <label>zaza</label> <lft type="integer">80</lft>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1070

Page 1072: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<mak type="boolean">true</mak> <own type="boolean">false</own> <parent_id type="integer">100</parent_id> <rgt type="integer">81</rgt> <updated_at type="datetime">2012-07-13T03:19:41-10:00</updated_at></image_template_group>

Where:image_template_group - the image template array with the following parameters:

label – the group name

created_at – the date when the group was created

id - template group id

kms_host – KMS server host name

kms_port – KMS server port

kms_server_label – KMS server name

mak - MAK windows licensing type

own - user's own license

parent_id - id of the target template group

depth - the depth of a given node (distance from this group to the root)

lft - left nested set identifier

rgt - right nested set identifier

updated_at – the date when the template group was updated

To edit or delete a child group, use the same requests as for template groups.

86.5 Edit Template GroupTo edit details of a template group:PUT /settings/image_template_groups/:id.xmlPUT /settings/image_template_groups/:id.json XML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d

BILLING PLANS - GET THE LIST OF BILLING PLANS 1071

Page 1073: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

'<image_template_group><label>zaza</label><mak>1</mak><kms_host>ededde.fe</kms_host><kms_port>5453</kms_port><kms>1</kms><own>0</own><kms_server_label>wqqdwwqw</kms_server_label></image_template_group>' --url http://onapp.test/settings/image_template_groups/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"image_template_group":{"label":"zaza", "mak":"1","kms_host":"ededde.fe", "kms_port":"5453", "kms":"1", "own":"1", "kms_server_label":"wqwqw"}}' --url http://onapp.test/settings/image_template_groups/100.json

Where you can edit the following parameters:label – the group namekms_host – KMS server host namekms_port – KMS server portkms_server_label – KMS server namemak - MAK windows licensing typeown - user's own license

XML Response example

HTTP/1.1 204 OKDate: Tue, 28 Feb 2012 11:55:53 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.1X-UA-Compatible: IE=Edge,chrome=1X-Runtime: 0.122994Cache-Control: no-cacheSet-Cookie: _session_id=6596bf326a9a8569ba51d7e8048b28be; path=/; HttpOnlyStatus: 204Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8Delete Template Group

BILLING PLANS - GET THE LIST OF BILLING PLANS 1072

Page 1074: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

86.6 Delete Template GroupDELETE /settings/image_template_groups/:id.xmlDELETE /settings/image_template_groups/:id.json XML Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/image_template_groups/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass --url http://onapp.test/settings/image_template_groups/:id.xml

86.7 Get List of Templates Attached to Group

XML Request example:

curl -i -X GET -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.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/image_template_groups/105/relation_group_templates.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><relation_group_templates type="array"> <relation_group_template> <created_at

BILLING PLANS - GET THE LIST OF BILLING PLANS 1073

Page 1075: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

type="datetime">2012-07-13T03:27:32-10:00</created_at> <id type="integer">98</id> <image_template_group_id type="integer">105</image_template_group_id> <price type="decimal">60.0</price> <template_id type="integer">26</template_id> <updated_at type="datetime">2012-07-13T03:48:15-10:00</updated_at> <image_template> <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_server_id> <cdn type="boolean">false</cdn> <checksum>0330b86693ac90ddac6001dfa61d6ba0</checksum> <created_at type="datetime">2012-06-06T22:17:49-10:00</created_at> <disk_target_device>---xen: xvdakvm: hd</disk_target_device> <ext4 type="boolean">true</ext4> <file_name>archlinux-2011.08-x64-1.0-xen.kvm.kvm_virtio.tar.gz</file_name> <id type="integer">26</id> <label>Arch Linux 2011.08 x64</label> <min_disk_size type="integer">5</min_disk_size> <min_memory_size type="integer">128</min_memory_size> <operating_system>linux</operating_system> <operating_system_arch>x64</operating_system_arch> <operating_system_distro>archlinux</operating_system_distro> <operating_system_edition nil="true"></operating_system_edition> <operating_system_tail nil="true"></operating_system_tail> <parent_template_id nil="true"></parent_template_id> <state>active</state> <template_size type="integer">306940</template_size> <updated_at nil="true"></updated_at> <user_id nil="true"></user_id> <version>1.0</version> <virtualization>xen,kvm,kvm_virtio</virtualization> </image_template> </relation_group_template></relation_group_templates>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1074

Page 1076: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Where:created_at – the date when the template was created

id – the ID of this relation

image_template_group_id– the ID of template group to which this template is attached

price – the price for the template attached to this template group

template_id – the ID of a template attached to this template group

updated_at – the date when the template group was updated

allow_resize_without_reboot — true if resize without reboot is possible; otherwise false

image_template - an array of image template with the following parameters:

allow_resize_without_reboot - true, if the resize without reboot is allowed, otherwise false

allowed_hot_migrate - true, if the hot migration is allowed, otherwise false

allowed_swap - true, if the swap is allowed, otherwise false

backup_server_id – the ID of the backup server where the template is stored

cdn – true if this template can be used for building edge servers, otherwise false.

checksum – file checksum

disk_target_device – the prefix indicating the method of translating the disk to a VS by compute resource

file_name – the name of the template fileid - the template ID

label - template label

min_disk_size – minimum disk size required to build a VS on this template (GB)

operating_system – operating system name

operating_system_distro – operating system distribution

operating_system_arch – architecture of the operating system

operating_system_edition – edition of the OS

operating_system_tail – tail of the OS

parent_template_id – true if this is a system template

state – state of the template (active, inactive)

template size - the size of the template

updated_at – the date when the template was updated

user_id - the ID of a user who owns this template

version – version of the file

BILLING PLANS - GET THE LIST OF BILLING PLANS 1075

Page 1077: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

virtualization – type of virtualization (xen or kvm) which is compatible with this template

86.8 Attach Template to GroupTo attach a template to a group, use the following request:POST /settings/image_template_groups/:image_template_group_id/relation_group_templates.xmlPOST /settings/image_template_groups/:image_template_group_id/relation_group_templates.json XML Request example:

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<relation_group_template><template_id>26</template_id><price>50</price></relation_group_template>' --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.xml

JSON Request example:

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"relation_group_template":{"template_id":"26", "price":"50"}}' --url http://onapp.test/settings/image_template_groups/105/relation_group_templates.json

Returns HTTP 201 response on success.

XML Response example:

HTTP/1.1 201 CreatedDate: Fri, 13 Jul 2012 13:47:11 GMTServer: Apache/2.2.3 (CentOS)X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.9X-UA-Compatible: IE=Edge,chrome=1ETag: "403f2b5e3b43d9de14cfc5b270bce92d"Cache-Control: max-age=0, private, must-revalidateX-Request-Id: a305669856a4dc3fe659a6180ee8532cX-Runtime: 0.340259X-Rack-Cache: invalidate, pass

BILLING PLANS - GET THE LIST OF BILLING PLANS 1076

Page 1078: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Set-Cookie: _session_id=02ec3365a7e219071ab840838551661d; path=/; HttpOnlyLocation: http://83.170.110.181/settings/image_template_groups/105/relation_group_templates/101Status: 201Connection: closeTransfer-Encoding: chunkedContent-Type: application/xml; charset=utf-8

86.9 Detach Template from GroupTo detach a template attached to a template group: DELETE /settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.xml DELETE /settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json XML Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.xml

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json

86.10 Change Price for Template in the Group

You can change the price for a template in a particular template group using the following request: PUT /settings/image_template_groups/:image_template_group_id/relation_group_temp

BILLING PLANS - GET THE LIST OF BILLING PLANS 1077

Page 1079: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

lates/:id.xml PUT /settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json XML Request example

curl -i -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u user:userpass -d '<relation_group_template><price>2</price></relation_group_template>' --url http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.xml

JSON Request example

curl -i -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -u user:userpass -d '{"relation_group_template":{"price":"2"}}' --url http://onapp.test/settings/image_template_groups/:image_template_group_id/relation_group_templates/:id.json

BILLING PLANS - GET THE LIST OF BILLING PLANS 1078

Page 1080: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

87 TOP IOPS DISKS

Top IOPS statistics returns 10 disks with top IOPS usage. To view top IOPS statistics, use the Get TOP IOPS Disks request.

87.1 Get TOP IOPS DisksUse the following request to view 10 disks with top IOPS usage for the last hour:

XML Request example

curl -i -X GET -u user:userpass http://onapp.test/top_iops_statistics.xml

JSON Request example

curl -i -X GET -u user:userpass http://onapp.test/top_iops_statistics.json

XML Output example

<disk_usage_statistics type="array"><disk_usage_statistic><data_read type="integer">889321</data_read><data_written type="integer">90987</data_written><disk_id type="integer">1099</disk_id></disk_usage_statistic>...<disk_usage_statistic><data_read type="integer">8</data_read><data_written type="integer">0</data_written><disk_id type="integer">166</disk_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1079

Page 1081: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

</disk_usage_statistic></disk_usage_statistics>

Where:disk_id - ID of a disk

data_read - number of read I/O operations per second.

data_written - number of written I/O operations per second

BILLING PLANS - GET THE LIST OF BILLING PLANS 1080

Page 1082: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

88 TRANSACTIONS

This class represents all the operations happening in your cloud, such as VS provisioning, OS configuring, VS start up, operations with disks, and so on.

Currently the following behavior is implemented in OnApp:

GET /transactions.xml and GET /transactions.json requests return the last 10 transactions without "log_output" parameter.

GET /transactions.xml/page/2 and GET /transactions.json/page/2 requests return the next 10 transactions.

Use the GET /transactions.xml/per_page/20 and GET /transactions.json/per_page/20 requests to change count of returned transaction ( in other words - use pagination).

Use the GET /transactions.xml?detailed and GET /transactions.json?detailed requests to see "log_output" details (pagination also works here).

88.1 Get List of TransactionsTo view the list of transactions without log output, run:GET /transactions.xmlGET /transactions.json XML Request example

curl -i -X GET http://onapp.test/transactions.xml -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET http://onapp.test/transactions.json -u user:password -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><transactions type="array"> <transaction> <action>stop_virtual_machine</action> <actor nil="true"/> <allowed_cancel type="boolean">true</allowed_cancel> <associated_object_id type="integer">7390</associated_object_id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1081

Page 1083: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<associated_object_type>VirtualMachine</associated_object_type> <created_at type="datetime">2015-03-19T17:33:58+03:00</created_at> <dependent_transaction_id nil="true"/> <id type="integer">101666</id> <identifier>o6fl3xq65pk699</identifier> <params> <shutdown_type type="symbol">soft</shutdown_type> </params> <parent_id type="integer">7390</parent_id> <parent_type>VirtualMachine</parent_type> <pid type="integer">9671</pid> <priority type="integer">10</priority> <start_after type="datetime">2015-03-19T17:33:58+03:00</start_after> <started_at type="datetime">2015-03-19T17:33:59+03:00</started_at> <status>complete</status> <updated_at type="datetime">2015-03-19T17:34:10+03:00</updated_at> <user_id type="integer">45</user_id> </transaction> ... <transaction> <action>destroy_user</action> <actor nil="true"/> <allowed_cancel type="boolean">true</allowed_cancel> <associated_object_id nil="true"/> <associated_object_type nil="true"/> <created_at type="datetime">2015-03-19T15:12:19+03:00</created_at> <dependent_transaction_id nil="true"/> <id type="integer">101607</id> <identifier>kae7h1vxt2sp89</identifier> <params> <with_destroy type="boolean">false</with_destroy> </params> <parent_id type="integer">75</parent_id> <parent_type>User</parent_type> <pid type="integer">9671</pid> <priority type="integer">10</priority> <start_after type="datetime">2015-03-19T15:12:19+03:00</start_after> <started_at type="datetime">2015-03-19T15:12:20+03:00</started_at> <status>complete</status> <updated_at type="datetime">2015-03-19T15:16:33+03:00</updated_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1082

Page 1084: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<user_id nil="true"/> </transaction></transactions>

Where:pid — external process IDcreated_at — the time when the record of transaction was made in the database, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatstart_after — the time after which the transaction may start, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfinished_at — reserved detailupdated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatactor — reserved detailpriority — priority of the transaction (reserved detail)parent_type — the type of the transaction target (virtual server, disk or compute resource)action — the type of transaction performedid —transaction IDuser_id —ID of the user who performed the transactiondependent_transaction_id —ID of the transaction that the current transaction depends on. For independent transactions this remains empty.allowed_cancel —true if cancellation is allowed. Otherwise false.parent_id — ID of the target VS, disk or compute resourcestarted_at —time when the transaction was started, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatparams —parameters of the transactionlog_output —an array with log output detailsstatus —status of the transaction (complete, failed, pending, etc)identifier —identifier of the virtual server

88.2 Get List of VS Transactions without Log Output

GET /virtual_machines/:virtual_machine_id/transactions.xmlGET /virtual_machines/:virtual_machine_id/transactions.jsonXML Output example

<?xml version="1.0" encoding="UTF-8"?><transactions type="array"><transaction><pid type="integer">2632</pid><created_at type="datetime">2011-07-20T08:28:54Z</created_at><start_after type="datetime">2011-07-20T08:28:54Z</start_after><updated_at type="datetime">2011-07-20T08:28:59Z</updated_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1083

Page 1085: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<actor nil="true"></actor><priority type="integer">10</priority><parent_type>VirtualMachine</parent_type><action>startup_virtual_machine</action><id type="integer">1547</id><user_id type="integer">13</user_id><dependent_transaction_id nil="true"></dependent_transaction_id><allowed_cancel type="boolean">true</allowed_cancel><parent_id type="integer">34</parent_id><started_at type="datetime">2011-07-20T08:28:56Z</started_at><params></params><log_output></log_output><status>complete</status><identifier>huilp6uzskz8rr</identifier></transaction>...<transaction></transaction>...</transactions>

Where:pid — external process IDcreated_at — the time when the record of transaction was made in the database, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatstart_after — the time after which the transaction may start, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfinished_at — reserved detailupdated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatactor — reserved detailpriority — priority of the transaction (reserved detail)parent_type — type of the transaction target (virtual server, disk or compute resource)action — the type of transaction performedid —transaction IDuser_id —ID of the user who performed the transactiondependent_transaction_id —ID of the transaction that the current transaction depends on. For independent transactions this remains empty.allowed_cancel —true if cancellation is allowed. Otherwise false.parent_id — ID of the target virtual server, disk or compute resourcestarted_at —time when the transaction was started in the [YYYY][MM][DD]T[hh][mm][ss]Z formatparams —parameters of the transactionlog_output —an array with log output detailsstatus —status of the transaction (complete, failed, pending, etc)identifier —identifier of the virtual server

BILLING PLANS - GET THE LIST OF BILLING PLANS 1084

Page 1086: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

88.3 Get List of Transactions with Log Output

To view the list of transactions with log output, run:GET /transactions.xml?detailedGET /transactions.json?detailedXML Request example

curl -i -X GET http://onapp.test/transactions.xml?detailed -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET http://onapp.test/transactions.json?detailed -u user:password -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example:

<?xml version="1.0" encoding="UTF-8"?><transactions type="array"> <transaction> <action>destroy_virtual_machine</action> <actor nil="true"/> <allowed_cancel type="boolean">true</allowed_cancel> <associated_object_id type="integer">7390</associated_object_id> <associated_object_type>VirtualMachine</associated_object_type> <created_at type="datetime">2015-03-19T18:04:44+03:00</created_at> <dependent_transaction_id nil="true"/> <id type="integer">101673</id> <identifier>o6fl3xq65pk699</identifier> <log_output># Logfile created on 2015-03-19 11:04:47 -0400 by logger.rb/41954Remote Server: 192.168.7.41Running: Storage API Call: PUT 192.168.7.41:8080/lvm/Datastore/onapp-qm20jnver40vmz/VDisk/pmh0g4dm6o2ypt "{\"state\":3}"{"result"=&gt;"SUCCESS"}Remote Server: 192.168.7.41...Running: rm -f /onapp/config/o6fl3xq65pk699*

Running: rm -f /onapp/firewall-rules/odamguc5ndbp44*

BILLING PLANS - GET THE LIST OF BILLING PLANS 1085

Page 1087: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

Running: rm -f /onapp/firewall-rules/ip6-odamguc5ndbp44*

</log_output> <params> <remote_ip>194.44.160.178</remote_ip> <destroy_msg>Destroy from Web interface</destroy_msg> <skip_notification type="boolean">true</skip_notification> </params> <parent_id type="integer">7390</parent_id> <parent_type>VirtualMachine</parent_type> <pid type="integer">9671</pid> <priority type="integer">10</priority> <start_after type="datetime">2015-03-19T18:04:44+03:00</start_after> <started_at type="datetime">2015-03-19T18:04:47+03:00</started_at> <status>complete</status> <updated_at type="datetime">2015-03-19T18:05:00+03:00</updated_at> <user_id type="integer">45</user_id> </transaction> ... <transaction> ... </transaction></transactions>

Where:pid — external process IDcreated_at — the time when the record of transaction was made in the database, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatstart_after — the time after which the transaction may start, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatfinished_at — reserved detailupdated_at — the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatactor — reserved detailpriority — priority of the transaction (reserved detail)parent_type — the type of the transaction target (virtual server, disk or compute resource)action — the type of transaction performedid —transaction IDuser_id —ID of the user who performed the transactiondependent_transaction_id —ID of the transaction that the current transaction depends on. For independent transactions this remains empty.allowed_cancel —true if cancellation is allowed. Otherwise false.parent_id — ID of the target VS, disk or compute resourcestarted_at —time when the transaction was started, in the [YYYY][MM][DD]T[hh][mm][ss]Z formatparams —parameters of the transaction

BILLING PLANS - GET THE LIST OF BILLING PLANS 1086

Page 1088: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

log_output —an array with log output detailsstatus —status of the transaction (complete, failed, pending, etc)identifier —identifier of the virtual server

88.4 Get Transaction DetailsTo view transaction's details with log output:GET /transactions/:id.jsonGET /transactions/:id.xmlXML Request example

curl -i -X GET http://onapp.test/transactions/:id.xml?detailed -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET http://onapp.test/transactions/:id.json?detailed -u user:password -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><transaction> <action>create_edge_server</action> <actor nil="true"/> <allowed_cancel type="boolean">true</allowed_cancel> <associated_object_id type="integer">7427</associated_object_id> <associated_object_type>VirtualMachine</associated_object_type> <created_at type="datetime">2015-03-19T18:05:42+03:00</created_at> <dependent_transaction_id type="integer">101682</dependent_transaction_id> <id type="integer">101683</id> <identifier>ipj39mncfnlc8l</identifier> <log_output># Logfile created on 2015-03-19 11:06:30 -0400 by logger.rb/41954Remote Server: 109.123.91.23</log_output> <params> <add_to_marketplace type="boolean">true</add_to_marketplace> <skip_notification type="boolean">true</skip_notification> </params> <parent_id type="integer">7427</parent_id> <parent_type>VirtualMachine</parent_type>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1087

Page 1089: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<pid type="integer">9671</pid> <priority type="integer">10</priority> <start_after type="datetime">2015-03-19T18:05:42+03:00</start_after> <started_at type="datetime">2015-03-19T18:06:30+03:00</started_at> <status>running</status> <updated_at type="datetime">2015-03-19T18:06:30+03:00</updated_at> <user_id type="integer">45</user_id></transaction>

For details refer to the Get List of Transactions section.

88.5 Get Transaction Details without Log Output

To view transaction's details without log output, run:GET /transactions/:id.json?shortGET /transactions/:id.xml?shortXML Request example

curl -i -X GET http://onapp.test/transactions/:id.xml?short -u user:password -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X GET http://onapp.test/transactions/:id.json?short -u user:password -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output example

<?xml version="1.0" encoding="UTF-8"?><transaction> <action>create_edge_server</action> <actor nil="true"/> <allowed_cancel type="boolean">true</allowed_cancel> <associated_object_id type="integer">7427</associated_object_id> <associated_object_type>VirtualMachine</associated_object_type> <created_at type="datetime">2015-03-19T18:05:42+03:00</created_at> <dependent_transaction_id type="integer">101682</dependent_transaction_id> <id type="integer">101683</id>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1088

Page 1090: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<identifier>ipj39mncfnlc8l</identifier> <params> <add_to_marketplace type="boolean">true</add_to_marketplace> <skip_notification type="boolean">true</skip_notification> </params> <parent_id type="integer">7427</parent_id> <parent_type>VirtualMachine</parent_type> <pid type="integer">9671</pid> <priority type="integer">10</priority> <start_after type="datetime">2015-03-19T18:05:42+03:00</start_after> <started_at type="datetime">2015-03-19T18:06:30+03:00</started_at> <status>running</status> <updated_at type="datetime">2015-03-19T18:06:30+03:00</updated_at> <user_id type="integer">45</user_id></transaction>

For details refer to the Get List of Transactions section.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1089

Page 1091: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

89 USER ADDITIONAL FIELDS

User Additional Fields allow administrators to create custom fields and use them to create/edit additional information in a user's profile.

89.1 Get List of Additional FieldsGET /user_additional_fields.xmlGET /user_additional_fields.json XML Request example

curl -u user:userpass http://onapp_test/user_additional_fields.xml

JSON Request example

curl -u user:userpass http://onapp_test/user_additional_fields.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><user_additional_fields type="array"><user_additional_field><name>test_edited_by_api</name><default_value>0</default_value><data_type>integer</data_type><id type="integer">1</id></user_additional_field>

Where:name – the additional field namedefault value – information which will be displayed if the user hasn't specified information for this field, or if they enter information that doesn't match the preset data typedata type - integer/string additional field data typeid – the additional field id

89.2 Get Additional Field DetailsTo get details of a particular additional field, use the following request:

BILLING PLANS - GET THE LIST OF BILLING PLANS 1090

Page 1092: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

GET /user_additional_fields/:id.xmlGET /user_additional_fields/:id.jsonXML Output example

<?xml version="1.0" encoding="UTF-8"?><user_additional_fields type="array"><user_additional_field><name>test_edited_by_api</name><default_value>0</default_value><data_type>integer</data_type><id type="integer">1</id></user_additional_field>

For details refer to Get List of Additional Fields section.

89.3 Add Additional FieldTo create a user additional field – use this request:POST /user_additional_fields.xmlPOST /user_additional_fields.json XML Request example

curl -i -X POST -d '<user_additional_field><name>TestField</name><data_type>string</data_type><default_value>testvalue</default_value></user_additional_field>' -u user:userpass http://onapp_test/user_additional_fields.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST -d '{"user_additional_field":{"name":"TestField","data_type":"string","default_value":"TestName"}}' -u user:userpass http://onapp_test/user_additional_fields.json -H 'Accept: application/json' -H 'Content-type: application/json'

Where:name* - the unique Additional Field name. (maximum length 256 characters)data_type* - integer/string additional field data typedefault_value* - information which will be displayed if the user hasn't specified information for this field, or if they enter information that doesn't match the preset data type.(maximum length 256 symbols.)

BILLING PLANS - GET THE LIST OF BILLING PLANS 1091

Page 1093: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

89.4 Edit Additional FieldPUT /user_additional_fields.xmlPUT /user_additional_fields.jsonXML Request example

curl -i -X PUT -d '<user_additional_field><name>TestField</name><data_type>string</data_type><default_value>CHANGEDvalue</default_value></user_additional_field>' -u user:userpass http://onapp_test/user_additional_fields/<field_id>.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X PUT -d '{"user_additional_field":{"name":"TestField","data_type":"string","default_value":"TestName"}}' -u user:userpass http://onapp_test/user_additional_fields/:field_id.json -H 'Accept: application/json' -H 'Content-type: application/json'

You can edit the following parameters: name, data type and default value.

89.5 Delete Additional FieldDELETE /user_additional_fields.xmlDELETE /user_additional_fields.json XML Request example

curl -i -X DELETE -u user:userpass http://onapp_test/user_additional_fields/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X DELETE -u user:userpass http://onapp_test/user_additional_fields/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

BILLING PLANS - GET THE LIST OF BILLING PLANS 1092

Page 1094: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

89.6 Search User by Additional Field Parameter

To find a user who is assigned a particular additional field, use the following request:GET /users/field_name=field_value.xmlGET /users/field_name=field_value.json XML Request example:

curl -i -X GET -u user:userpass http://onapp.test/users/field_name=field_value.xml

JSON Request example:

curl -i -X GET -u user:userpass http://onapp.test/users/field_name=field_value.json

Where:field_name – the name of the additional field which is assigned to the user in searchfield_value – the value set for the specified additional field for this particular user

The result of the search request will be the list of users with their details who are assigned the additional field field_name with the values starting with field_value.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1093

Page 1095: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

90 USER GROUPS

User groups enable you to associate users into groups. So far user groups are used to apply a particular theme to a group of users.

90.1 Get List of User GroupsTo get the list of user groups:GET /user_groups.xmlGET /user_groups.json XML Request example

curl -i -u user:userpass -X GET http://onapp.test/user_groups.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -u user:userpass -X GET http://onapp.test/user_groups.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output request

<user_groups type="array"><user_group><closed type="boolean">false</closed><created_at type="datetime">2015-04-15T16:02:20+03:00</created_at><federation_enabled type="boolean">false</federation_enabled><federation_id nil="true"/><hypervisor_id nil="true"/><id type="integer">56</id><identifier>abywglogotbqza</identifier><label>test</label><traded type="boolean">false</traded><updated_at type="datetime">2015-04-15T16:02:20+03:00</updated_at><billing_plans type="array"><billing_plan><id type="integer">1</id><label>default billing</label><created_at type="datetime">2013-09-03T15:31:30+03:00</created_at><updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1094

Page 1096: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<currency_code>USD</currency_code><show_price nil="true"/><monthly_price type="decimal">0.0</monthly_price><allows_mak type="boolean">true</allows_mak><allows_kms type="boolean">false</allows_kms><allows_own type="boolean">false</allows_own></billing_plan></billing_plans><roles type="array"><role><id type="integer">1</id><label>Administrator</label><identifier>admin</identifier><created_at type="datetime">2013-09-03T15:31:13+03:00</created_at><updated_at type="datetime">2015-04-15T15:26:46+03:00</updated_at><users_count type="integer">24</users_count></role></roles></user_group><user_group>...</user_group></user_groups>

Where:closed - not relevant to user groupscreated_at – the date when this record was created in databasefederation_enabled - not relevant to user groupsfederation_id - not relevant to user groupsid – the group IDidentifier —identifier of the user grouplabel – the group nametraded - not relevant to user groupsupdated_at – the date when this record was updated in databasebilling_plans — an array of billing plans to which this account is assigned to, whereid - the billing type IDlabel - the billing plan namecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the billing plan was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcurrency_code - the currency in which the users are charged show_price - true, if users can see the prices set up for them, otherwise falsemonthly_price - monthly fee for plan usageallows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise falseallows_mak - true, if the MAK licensing is allowed, otherwise falseallows_own - true, if adding own licenses is allowed for this billing plan, otherwise falseroles — an array of user roles to which this account is assigned to, where

BILLING PLANS - GET THE LIST OF BILLING PLANS 1095

Page 1097: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – role ID label – role title

identifier – role identifiercreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatusers_count - the number of users assigned to the role

90.2 Get User Group DetailsTo get details for a particular user group:GET /user_groups/:id.xmlGET /user_groups/:id.json XML Request example:

curl -i -u user:userpass -X GET http://onapp.test/user_groups/:id.xml -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example:

curl -i -u user:userpass -X GET http://onapp.test/user_groups/:id.json -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output request

<user_group><closed type="boolean">false</closed><created_at type="datetime">2015-04-15T16:02:20+03:00</created_at><federation_enabled type="boolean">false</federation_enabled><federation_id nil="true"/><hypervisor_id nil="true"/><id type="integer">56</id><identifier>abywglogotbqza</identifier><label>test</label><traded type="boolean">false</traded><updated_at type="datetime">2015-04-15T16:02:20+03:00</updated_at><billing_plans type="array"><billing_plan><id type="integer">1</id><label>default billing</label>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1096

Page 1098: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<created_at type="datetime">2013-09-03T15:31:30+03:00</created_at><updated_at type="datetime">2013-09-03T15:31:30+03:00</updated_at><currency_code>USD</currency_code><show_price nil="true"/><monthly_price type="decimal">0.0</monthly_price><allows_mak type="boolean">true</allows_mak><allows_kms type="boolean">false</allows_kms><allows_own type="boolean">false</allows_own></billing_plan></billing_plans><roles type="array"><role><id type="integer">1</id><label>Administrator</label><identifier>admin</identifier><created_at type="datetime">2013-09-03T15:31:13+03:00</created_at><updated_at type="datetime">2015-04-15T15:26:46+03:00</updated_at><users_count type="integer">24</users_count></role></roles></user_group>

Where:closed - not relevant to user groupscreated_at – the date when this record was created in databasefederation_enabled - whether Federation is enabled for the compute zonefederation_id - not relevant to user groupsid – the group IDidentifier —identifier of the user grouplabel – the group nametraded - not relevant to user groupsupdated_at – the date when this record was updated in databasebilling plans — an array of billing plans to which this account is assigned to, whereid - the billing type IDlabel - the billing plan namecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date when the billing plan was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z formatcurrency_code - the currency in which the users are chargedshow_price - true, if users can see the prices set up for them, otherwise falsemonthly_price - monthly fee for plan usageallows_kms - true, if the KMS licensing is allowed for this billing plan, otherwise falseallows_mak - true, if the MAK licensing is allowed, otherwise falseallows_own - true, if adding own licenses is allowed for this billing plan, otherwise falseroles — an array of user roles to which this account is assigned to, where

BILLING PLANS - GET THE LIST OF BILLING PLANS 1097

Page 1099: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

created_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – role ID label – role title

identifier – role identifiercreated_at – the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatusers_count - the number of users assigned to the role

90.3 Add User GroupTo create a user group use this request:POST /user_groups.xmlPOST /user_groups.json XML Request example

curl -i -X POST http://onapp.test/user_groups.xml -d '<?xml version="1.0" encoding="UTF-8"?><user_group><label>TEST_XML</label></user_group>' -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X POST http://onapp.test/user_groups.json -d '{"user_group":{"label":"TEST_JSON"}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Where:label* - the name of the user groupParameters for vCloud user group creation:assign_to_vcloud - put 1 to assign this user group to vCloud compute resource and create an organization in vCloudhypervisor_id - ID of a compute resourcecompany_billing_plan_id - ID of a company billing plan which will be assigned to this user groupbilling_plan_ids - IDs of billing plans which will be available to users of this user group

90.4 Edit User GroupThis API call allows you to edit a user group. It can also be used to assign a role and/or a billing plan to the user group.

BILLING PLANS - GET THE LIST OF BILLING PLANS 1098

Page 1100: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

PUT /user_groups/:id.xmlPUT /user_groups/:id.json XML Request example

curl -i -X PUT http://onapp.test/user_groups/4.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<user_group><label>new_label</label><role_ids type="array"><role_id>2</role_id></role_ids><billing_plan_ids type="array"><billing_plan_id>1</billing_plan_id></billing_plan_ids></user_group>'

JSON Request example

curl -i -X PUT http://onapp.test/user_groups/4.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"user_group":{"label":"new_label","role_ids":[1],"billing_plan_ids":[2]}}'

Where:label - choose user group namerole_id - ID of the role(s) you wish to assign to the user groupbilling_plan_id - ID of the billing plan(s) you wish to assign to the user groupcompany_billing_plan_id (in case of vCloud user group)- ID of a company billing plan which will be assigned to this user group

90.5 Delete User GroupTo delete a user group:DELETE /user_groups/:user_group_id.xmlDELETE /user_groups/:user_group_id.json XML Request example

curl -i -X DELETE http://onapp.test/user_groups/:id.xml -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml'

JSON Request example

curl -i -X DELETE http://onapp.test/user_groups/:id.json -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

Returns 204 response on successful deletion, or 404 response if no user group with such ID exists in the DB

BILLING PLANS - GET THE LIST OF BILLING PLANS 1099

Page 1101: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

91 USERS

This class manages user accounts created in the cloud. It enables you to set up different types of user and allocate their role. Roles define user access to cloud resources and functions, including managing virtual servers andappliances, performing actions on templates and backups, and configuring data stores and networks.

91.1 Get List of UsersThere are several ways to request the list of users. Below you can find the following examples:

the list of users registered in the cloud with their detailed information

the list of users without deleted users

the list of users with short and fast output ( without users' roles and permissions)

To see all the users registered in the cloud with their detailed information, use the following request:GET /users.xmlGET /users.json XML Request example:

curl -i -X GET -u user:password --url http://onapp.test/users.xml

JSON Request example:

curl -i -X GET -u user:password --urlhttp://onapp.test/users.json

XML Output example

<?xml version="1.0" encoding="UTF-8"?><users type="array"><user><activated_at type="datetime">2012-04-03T14:30:34+00:00</activated_at><avatar nil="true"/><billing_plan_id type="integer">201</billing_plan_id><cdn_account_status>ACTIVE</cdn_account_status><cdn_status>ACTIVE</cdn_status><created_at type="datetime">2012-04-03T14:30:34+00:00</created_at><deleted_at nil="true"/><email>[email protected]</email><firewall_id type="integer">4</firewall_id><first_name>John</first_name>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1100

Page 1102: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<group_id nil="true"/><id type="integer">1</id><identifier>cjximrxmt3yjbs</identifier><image_template_group_id nil="true"/><infoboxes><hidden_infoboxes type="array"><hidden_infobox>4840313084eef1f8e1dada293eb1b1ae</hidden_infobox></hidden_infoboxes><display_infoboxes type="boolean">true</display_infoboxes></infoboxes><last_name>Smith</last_name><locale>en</locale><login>admin</login><password_changed_at type="datetime">2014-08-21T16:00:15+03:00</password_changed_at><registered_yubikey>aaaaaaaaaa</registered_yubikey><status>active</status><supplied type="boolean">false</supplied><suspend_at nil="true"/><system_theme>dark</system_theme><time_zone/><total_amount type="float">83787.4296875</total_amount><updated_at type="datetime">2012-05-21T11:30:20+00:00</updated_at><use_gravatar type="boolean">false</use_gravatar><user_group_id nil="true"/><outstanding_amount type="float">925.13000972271</outstanding_amount><payment_amount type="decimal">0.0</payment_amount><roles type="array"><role><created_at type="datetime">2012-04-03T14:30:31+00:00</created_at><id type="integer">1</id><identifier>admin</identifier><label>Administrator</label><updated_at type="datetime">2012-04-20T10:28:32+00:00</updated_at><permissions type="array"><permission><created_at type="datetime">2012-04-03T14:30:31+00:00</created_at><id type="integer">110</id><identifier>autobackup_templates</identifier><updated_at type="datetime">2012-04-03T14:30:31+00:00</updated_at></permission></permissions></role><role></roles><used_cpus type="integer">0</used_cpus><used_memory type="integer">0</used_memory>

BILLING PLANS - GET THE LIST OF BILLING PLANS 1101

Page 1103: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

<used_cpu_shares type="integer">0</used_cpu_shares><used_disk_size type="integer">0</used_disk_size><used_ip_addresses type="array"/><ip_address><address>109.123.105.147</address><broadcast>109.123.105.159</broadcast><created_at type="datetime">2012-07-25T21:49:41-10: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">652</id><ip_address_pool_id nil="true"/><network_address>109.123.105.144</network_address><network_id type="integer">36</network_id><pxe type="boolean">false</pxe><updated_at type="datetime">2012-07-26T02:32:13-10:00</updated_at><user_id nil="true"/><free type="boolean">false</free><netmask>255.255.255.240</netmask></ip_address></used_ip_addresses><memory_available type="integer">3091</memory_available><disk_space_available type="integer">278</disk_space_available><cdn_reference type="integer">945453445</cdn_reference><additional_fields type="array"><additional_field><name>add_field1</name><value>0</value></additional_field></additional_fields></user>...<user>...</user></users>

Where:activated_at – time when the user was activatedavatar - user's avatarbilling_plan_id – ID of the billing plan assigned to this usercdn_account_status – always returns ACTIVE status; but it is actually activated when CDN was enabled for particular usercdn_status - whether CDN resources are enabled for this user or notcreated_at – time when the user was created, in [YYYY][MM][DD]T[hh][mm][ss]Zdeleted_at – time when the user was deletedemail – user's email

BILLING PLANS - GET THE LIST OF BILLING PLANS 1102

Page 1104: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00

OnApp 5.0 API Guide v3

firewall_id - the ID of the firewall the user is associated withfirst_name – user's first namegroup_id - deprecated attribute; will be removed in upcoming releaseid — the ID of a user in the databaseidentifier - identifier of the userimage_template_group – the ID of associated template group, if anyinfoboxes - an array of infoboxes with the following details:hidden_infoboxes - an array of hidden infoboxeshidden_infobox - hash of a hidden inoboxdisplay_infoboxes - true, if the infoboxes are displayed for this user, otherwise falselast_name – the user's last namelocale – locale (language) associated with userlogin – user's login name

Login parameter is not returned when API key is used for authentication instead of a login/password combination.

password_changed_at - the date when the user's password was changed in the [YYYY][MM][DD]T[hh][mm][ss]Z formatregistered_yubikey - user's Yubikeystatus – status of the user's account (active, suspended or deleted)supplied - whether the user was created for the supplier when he published a zone to the Federation. If true, no actions can be performed on this usersuspend_at – time when the system should suspend a usersystem_theme - color scheme of the interface: light or darktime_zone – the time zone of the usertotal_amount - sum total of outstanding and payment amountupdated_at – time when user's profile data was updateduse_gravatar – true, if avatar is enabled for the user, otherwise false

user_group_id – ID of the user group assigned to this useroutstanding_amount – the amount of money the user is due to paypayment_amount – amount of money the user has actually paidroles — an array of user roles to which this account is assigned to, wherecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – role ID

identifier – role identifierlabel – role titleupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatpermissions– an array with permissions assigned to this rolecreated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatid – permission IDidentifier – permission identifierupdated_at - the date in the [YYYY][MM][DD]T[hh][mm][ss]Z formatused_cpus – number of CPU cores allocated to all virtual servers and edge servers of the userused_memory - the amount of RAM used by the user (MB)used_cpu_shares - the amount of CPU shares usedused_disk_size – size of all user disks in GB

BILLING PLANS - GET THE LIST OF BILLING PLANS 1103

Page 1105: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1106: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1107: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1108: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1109: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1110: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1111: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1112: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1113: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1114: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1115: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1116: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1117: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1118: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1119: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1120: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1121: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1122: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1123: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1124: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1125: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1126: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1127: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1128: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1129: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1130: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1131: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1132: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1133: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1134: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1135: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1136: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1137: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1138: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1139: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1140: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1141: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1142: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1143: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1144: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1145: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1146: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1147: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1148: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1149: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1150: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1151: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1152: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1153: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1154: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1155: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1156: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1157: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1158: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1159: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1160: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1161: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1162: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1163: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1164: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1165: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1166: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1167: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1168: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1169: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1170: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1171: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1172: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1173: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1174: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1175: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1176: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1177: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1178: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1179: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1180: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1181: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1182: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1183: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1184: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1185: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1186: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1187: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1188: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1189: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1190: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1191: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1192: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1193: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1194: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1195: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1196: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1197: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1198: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1199: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1200: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1201: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1202: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1203: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1204: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1205: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1206: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1207: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1208: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1209: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1210: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1211: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1212: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1213: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1214: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1215: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1216: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1217: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1218: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1219: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1220: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1221: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1222: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1223: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1224: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1225: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1226: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1227: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1228: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1229: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1230: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1231: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1232: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1233: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1234: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1235: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1236: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1237: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1238: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1239: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1240: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1241: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1242: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1243: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1244: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1245: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1246: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1247: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00
Page 1248: OnApp · Web view 10 1 2015-06-23T15:33:36+03:00