Skip to content

API docs in Hugo #5625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ ocaml/xenopsd/xentoollog_flags

ocaml/idl/gen_lifecycle.exe

# hugo
.hugo_build.lock
go.sum
doc/public

.DS_Store
115 changes: 115 additions & 0 deletions doc/assets/css/xenapi.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Copyright (C) 2006-2011 Citrix Systems Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/

#content a {
color: #35383d
}

table {
font-size: 100%;
width: 100%;
border-collapse: collapse;
}

tr {
background-color: inherit;
}

td {
vertical-align: top;
padding: 3px 1em 3px 0;
}

th { text-align: left;
border-bottom: 1px solid black;
}

.description {
margin-bottom: 1em;
}

.field, .field2 {
margin: 0em 0;
padding: .5em .7em .7em;
background-color: #dddddd;
cursor: pointer;
font-size: 15px;
}

.field2 {
background-color: #e8e8e8;
}

.field-type {
font-size: 80%;
}

.field-name {
font-weight: bold;
}

.field-head {
font-style: italic;
}

.field-description {
margin: .7em 0;
}

.field-table {
border: 0;
background-color: transparent;
}

.field-table td {
padding: .3em 1.5em .3em 0;
border: 0;
}

.inline-type {
margin-right: .5em;
}

.inline-qualifier {
font-size: 70%;
vertical-align: top;
margin-left: .5em;
}

.inline-params {
margin-left: .5em;
}

.lifecycle {
font-size: 12px;
float: right;
font-variant:small-caps;
color: #306580;
margin: auto 0.5em;
}

.button {
float: right;
color: #fff;
background-color: #337ab7;
border-color: #2e6da4;
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
display: inline-block;
font-weight: 400;
margin: 0;
vertical-align: middle;
}
5 changes: 5 additions & 0 deletions doc/content/xen-api/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "XenAPI"
+++

{{% children %}}
118 changes: 118 additions & 0 deletions doc/content/xen-api/basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
+++
title = "XenAPI Basics"
weight = 10
+++

This document contains a description of the Xen Management API – an interface for
remotely configuring and controlling virtualised guests running on a
Xen-enabled host.

The XenAPI is presented here as a set of Remote Procedure Calls, with a wire
format based upon [XML-RPC](http://xmlrpc.scripting.com).
No specific language bindings are prescribed,
although examples will be given in the python programming language.

Although we adopt some terminology from object-oriented programming,
future client language bindings may or may not be object oriented.
The API reference uses the terminology _classes_ and _objects_.
For our purposes a _class_ is simply a hierarchical namespace;
an _object_ is an instance of a class with its fields set to
specific values. Objects are persistent and exist on the server-side.
Clients may obtain opaque references to these server-side objects and then
access their fields via get/set RPCs.

For each class we specify a list of fields along with their _types_ and _qualifiers_. A
qualifier is one of:

- _RO/runtime_: the field is Read
Only. Furthermore, its value is automatically computed at runtime.
For example: current CPU load and disk IO throughput.
- _RO/constructor_: the field must be manually set
when a new object is created, but is then Read Only for
the duration of the object's life.
For example, the maximum memory addressable by a guest is set
before the guest boots.
- _RW_: the field is Read/Write. For example, the name of a VM.

Types
-----

The following types are used to specify methods and fields in the API Reference:

- `string`: Text strings.
- `int`: 64-bit integers.
- `float`: IEEE double-precision floating-point numbers.
- `bool`: Boolean.
- `datetime`: Date and timestamp.
- `c ref`: Reference to an object of class `c`.
- `t set`: Arbitrary-length set of values of type `t`.
- `(k → v) map`: Mapping from values of type `k` to values of type `v`.
- `e enum`: Enumeration type with name `e`. Enums are defined in the API Reference together with classes that use them.

Note that there are a number of cases where `ref`s are _doubly
linked_ – e.g. a VM has a field called `VIFs` of type
`VIF ref set`; this field lists
the network interfaces attached to a particular VM. Similarly, the VIF
class has a field called `VM` of type `VM ref` which references the VM to which the interface is connected.
These two fields are _bound together_, in the sense that
creating a new VIF causes the `VIFs` field of the corresponding
VM object to be updated automatically.

The API reference explicitly lists the fields that are
bound together in this way. It also contains a diagram that shows
relationships between classes. In this diagram an edge signifies the
existance of a pair of fields that are bound together, using standard
crows-foot notation to signify the type of relationship (e.g.
one-many, many-many).

RPCs associated with fields
---------------------------

Each field, `f`, has an RPC accessor associated with it
that returns `f`'s value:

- `get_f (r)`: Takes a `ref`, `r`, that refers to an object and returns the value of `f`.

Each field, `f`, with attribute `RW` and whose outermost type is `set` has the following
additional RPCs associated with it:

- `add_f (r, v)`: Adds a new element `v` to the set. Since sets cannot contain duplicate values this operation has no action in the case
that `v` was already in the set.

- `remove_f (r, v)`: Removes element `v` from the set.

Each field, `f`, with attribute RW and whose outermost type is `map` has the following
additional RPCs associated with it:

- `add_to_f (r, k, v)`: Adds new pair `(k → v)` to the mapping stored in `f` in object `r`. Attempting to add a new pair for duplicate
key, `k`, fails with an `MAP_DUPLICATE_KEY` error.
- `remove_from_f (r, k)`: Removes the pair with key `k` from the mapping stored in `f` in object `r`.

Each field whose outermost type is neither `set` nor `map`,
but whose attribute is RW has an RPC accessor associated with it
that sets its value:

- `set_f (r, v)`: Sets field `f` on object `r` to value `v`.

RPCs associated with classes
----------------------------

- Most classes have a _constructor_ RPC named `create` that
takes as parameters all fields marked RW and
RO/constructor. The result of this RPC is that a new _persistent_ object is
created on the server-side with the specified field values.
- Each class has a `get_by_uuid (uuid)` RPC that returns the object
of that class that has the specified UUID.
- Each class that has a `name_label` field has a `get_by_name_label (name_label)` RPC that returns a set of objects of that
class that have the specified `name_label`.
- Most classes have a `destroy (r)` RPC that explicitly deletes the persistent object specified by `r` from the system. This is a
non-cascading delete – if the object being removed is referenced by another
object then the `destroy` call will fail.

Additional RPCs
---------------

As well as the RPCs enumerated above, most classes have additional RPCs
associated with them. For example, the VM class has RPCs for cloning,
suspending, starting etc. Such additional RPCs are described explicitly
in the API reference.
59 changes: 59 additions & 0 deletions doc/content/xen-api/classes/_index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
+++
title = "XenAPI Reference"
layout = "class"
type = "xenapi"
+++

<div>
<h2 class="title">XenAPI Classes</h2>
<p>Click on a class to view the associated fields and messages.</p>

<img src="classes.png" alt="Xen-api class diagram" usemap="#graph" border="0" />
<map id="graph" name="graph">
<area shape="poly" href="task" title="an asynchronous server&#45;side task" alt="" coords="408,233 406,227 402,222 395,217 387,214 378,213 369,214 360,217 354,222 349,227 348,233 349,240 354,245 360,250 369,252 378,253 387,252 395,250 402,245 406,240"/>
<area shape="poly" href="event" title="allows event registration and reading" alt="" coords="408,296 406,289 402,284 395,279 387,277 378,276 369,277 360,279 354,284 349,289 348,296 349,302 354,307 360,312 369,315 378,316 387,315 395,312 402,307 406,302"/>
<area shape="poly" href="pool" title="a Resource Pool" alt="" coords="470,78 469,72 464,66 458,62 449,59 440,58 431,59 422,62 416,66 411,72 410,78 411,84 416,90 422,94 431,97 440,98 449,97 458,94 464,90 469,84"/>
<area shape="rect" href="session" title="an authenticated session" alt="" coords="92,211,152,251"/>
<area shape="rect" href="user" title="a user" alt="" coords="6,201,66,241"/>
<area shape="rect" href="host" title="a physical host" alt="" coords="187,223,247,263"/>
<area shape="rect" href="vm" title="a Virtual Machine" alt="" coords="508,279,568,319"/>
<area shape="poly" href="vm_metrics" title="dynamic VM configuration information" alt="" coords="673,301 671,295 665,289 656,285 644,282 631,281 618,282 607,285 597,289 591,295 589,301 591,307 597,313 607,317 618,320 631,321 644,320 656,317 665,313 671,307"/>
<area shape="poly" href="vm_guest_metrics" title="dynamic information from inside the guest" alt="" coords="670,360 667,354 658,348 645,344 628,341 610,340 592,341 575,344 562,348 553,354 550,360 553,366 562,372 575,376 592,379 610,380 628,379 645,376 658,372 667,366"/>
<area shape="poly" href="crashdump" title="VM crashdump" alt="" coords="650,246 648,239 642,234 633,229 622,227 609,226 596,227 585,229 576,234 570,239 568,246 570,252 576,257 585,262 596,265 609,266 622,265 633,262 642,257 648,252"/>
<area shape="poly" href="console" title="location information for a guest&#39;s console" alt="" coords="590,387 589,380 584,375 577,370 569,368 559,367 549,368 540,370 533,375 529,380 527,387 529,393 533,398 540,403 549,406 559,407 569,406 577,403 584,398 589,393"/>
<area shape="rect" href="pbd" title="the connection between an SR and a host" alt="" coords="244,147,304,187"/>
<area shape="poly" href="host_metrics" title="dynamic host information" alt="" coords="202,307 199,300 193,295 183,290 170,288 156,287 141,288 128,290 118,295 112,300 109,307 112,313 118,318 128,323 141,326 156,327 170,326 183,323 193,318 199,313"/>
<area shape="poly" href="host_cpu" title="a physical CPU on a host" alt="" coords="206,164 204,158 199,153 191,148 182,145 171,144 160,145 151,148 143,153 138,158 136,164 138,171 143,176 151,181 160,183 171,184 182,183 191,181 199,176 204,171"/>
<area shape="rect" href="network" title="an ethernet network" alt="" coords="331,331,391,371"/>
<area shape="rect" href="vif" title="a network interface for a Virtual Machine" alt="" coords="423,334,483,374"/>
<area shape="poly" href="vif_metrics" title="IO stats and configuration information for a virtual interface" alt="" coords="498,451 496,445 490,439 481,435 470,432 457,431 444,432 432,435 423,439 417,445 415,451 417,457 423,463 432,467 444,470 457,471 470,470 481,467 490,463 496,457"/>
<area shape="rect" href="pif" title="a network interface for a physical host" alt="" coords="241,306,301,346"/>
<area shape="poly" href="pif_metrics" title="IO stats and configuration information for a physical interface" alt="" coords="274,412 272,406 266,400 257,396 245,393 232,392 219,393 208,396 198,400 193,406 191,412 193,418 198,424 208,428 219,431 232,432 245,431 257,428 266,424 272,418"/>
<area shape="rect" href="sr" title="Storage Repository, a container for virtual disk images (VDIs)" alt="" coords="323,97,383,137"/>
<area shape="rect" href="vdi" title="a virtual disk image" alt="" coords="412,124,472,164"/>
<area shape="poly" href="sm" title="storage manager plugin module" alt="" coords="377,26 375,19 371,14 364,9 356,7 347,6 337,7 329,9 322,14 318,19 317,26 318,32 322,37 329,42 337,45 347,46 356,45 364,42 371,37 375,32"/>
<area shape="rect" href="vbd" title="a virtual block device" alt="" coords="486,181,546,221"/>
<area shape="poly" href="vbd_metrics" title="IO stats and configuration information for a virtual block device" alt="" coords="623,128 620,122 614,116 604,112 592,109 578,108 564,109 551,112 541,116 535,122 533,128 535,134 541,140 551,144 564,147 578,148 592,147 604,144 614,140 620,134"/>
</map>
<h2>Classes, Fields and Messages</h2>
<p>Classes have both <i>fields</i> and <i>messages.</i> Messages are either <i>implicit</i> or <i>explicit</i> where an implicit message is one of:</p>
<ul>
<li> a constructor (usually called &quot;create&quot;);</li>
<li> a destructor (usually called &quot;destroy&quot;);</li>
<li> &quot;get_by_name_label&quot;;</li>
<li> &quot;get_by_uuid&quot;;</li>
<li> &quot;get_record&quot;;</li>
<li> &quot;get_all&quot;; and</li>
<li> &quot;get_all_records&quot;.</li>
</ul>
<p>Explicit messages include all the rest, more class-specific messages (e.g. &quot;VM.start&quot;, &quot;VM.clone&quot;)</p>
<p>Every field has at least one <i>accessor</i> depending both on its type and whether it is read-only or read-write. Accessors for a field named &quot;X&quot; would be a proper subset of:</p>
<ul>
<li> set_X: change the value of field X (only if it is read-write);</li>
<li> get_X: retrieve the value of field X;</li>
<li> add_X: add a key/value pair (for fields of type set);</li>
<li> remove_X: remove a key (for fields of type set);</li>
<li> add_to_X: add a key/value pair (for fields of type map); and</li>
<li> remove_from_X: remove a key (for fields of type map).</li>
</ul>
</div>
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "auth"
layout = "class"
type = "xenapi"
class = "auth"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/blob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "blob"
layout = "class"
type = "xenapi"
class = "blob"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/bond.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Bond"
layout = "class"
type = "xenapi"
class = "Bond"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Certificate"
layout = "class"
type = "xenapi"
class = "Certificate"
+++
Binary file added doc/content/xen-api/classes/classes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Cluster"
layout = "class"
type = "xenapi"
class = "Cluster"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/cluster_host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Cluster_host"
layout = "class"
type = "xenapi"
class = "Cluster_host"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/console.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "console"
layout = "class"
type = "xenapi"
class = "console"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/crashdump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "crashdump"
layout = "class"
type = "xenapi"
class = "crashdump"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/data_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "data_source"
layout = "class"
type = "xenapi"
class = "data_source"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/dr_task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "DR_task"
layout = "class"
type = "xenapi"
class = "DR_task"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "event"
layout = "class"
type = "xenapi"
class = "event"
+++
6 changes: 6 additions & 0 deletions doc/content/xen-api/classes/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "Feature"
layout = "class"
type = "xenapi"
class = "Feature"
+++
Loading
Loading