[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] [ocamldoc] Docs for remaining xapi licensing modules


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Wed, 2 Dec 2009 16:28:13 +0000
  • Delivery-date: Wed, 02 Dec 2009 08:28:14 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
[ocamldoc] Docs for remaining xapi licensing modules

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 2ee0c8e9169b ocaml/doc/ocamldoc.js
--- a/ocaml/doc/ocamldoc.js     Wed Dec 02 15:20:41 2009 +0000
+++ b/ocaml/doc/ocamldoc.js     Wed Dec 02 16:24:38 2009 +0000
@@ -146,11 +146,15 @@
 
 function transform_type(t)
 {
-       params = t.split('->');
-       for (i in params) {
-               params[i] = '<span class="type">' + params[i] + '</span>';
+       if (t != '') {
+               params = t.split('->');
+               for (i in params) {
+                       params[i] = '<span class="type">' + params[i] + 
'</span>';
+               }
+               html = params.join('<span class="arrow">\u2192</span>');
        }
-       html = params.join('<span class="arrow">\u2192</span>');
+       else
+               html = '[none]';
        return html;
 }
 
diff -r 2ee0c8e9169b ocaml/doc/odoc_json.ml
--- a/ocaml/doc/odoc_json.ml    Wed Dec 02 15:20:41 2009 +0000
+++ b/ocaml/doc/odoc_json.ml    Wed Dec 02 16:24:38 2009 +0000
@@ -266,24 +266,24 @@
 
        method t_of_Ref name ref_opt =
                let code = node "span" ~atts:["class", "code"] [Leaf name] in
-               match ref_opt with
-               | None -> node "a" ~atts: ["name", name] [code]
-               | Some kind ->
-                       let k =
-                       match kind with
-                       | Odoc_info.RK_module -> "module"
-                       | Odoc_info.RK_module_type -> "module_type"
-                       | Odoc_info.RK_class -> "class"
-                       | Odoc_info.RK_class_type -> "class_type"
-                       | Odoc_info.RK_value -> "value"
-                       | Odoc_info.RK_type -> "type"
-                       | Odoc_info.RK_exception -> "exception"
-                       | Odoc_info.RK_attribute -> "attribute"
-                       | Odoc_info.RK_method -> "method"
-                       | Odoc_info.RK_section t -> "section"
-                       in
-                       (* node "a" ~atts: [("name", name) ; ("kind", k)] [] *)
-                       node "a" ~atts:[("href", "{" ^ k ^ "|" ^ name ^ "}")] 
[code]
+               let k =
+                       match ref_opt with
+                       | None ->
+                               "none"
+                       | Some kind ->
+                               match kind with
+                               | Odoc_info.RK_module -> "module"
+                               | Odoc_info.RK_module_type -> "module_type"
+                               | Odoc_info.RK_class -> "class"
+                               | Odoc_info.RK_class_type -> "class_type"
+                               | Odoc_info.RK_value -> "value"
+                               | Odoc_info.RK_type -> "type"
+                               | Odoc_info.RK_exception -> "exception"
+                               | Odoc_info.RK_attribute -> "attribute"
+                               | Odoc_info.RK_method -> "method"
+                               | Odoc_info.RK_section t -> "section"
+               in
+               node "a" ~atts:[("href", "{" ^ k ^ "|" ^ name ^ "}")] [code]
          
        (* JSON *)
        
diff -r 2ee0c8e9169b ocaml/doc/style.css
--- a/ocaml/doc/style.css       Wed Dec 02 15:20:41 2009 +0000
+++ b/ocaml/doc/style.css       Wed Dec 02 16:24:38 2009 +0000
@@ -128,10 +128,6 @@
 a, a:link, a:visited, a:active, a:hover { color : inherit; text-decoration: 
none;}
 a:hover { color : inherit; text-decoration : underline }
 
-p a {
-       font-weight: bold;
-}
-
 hr {
        border: 1px thin #666;
 }
@@ -207,8 +203,9 @@
        background-color: orange;
 }
 
-tt {
-       font:1.2em monospace
+tt, .code {
+       font: 1.2em monospace;
+       font-weight: inherit;
 }
 
 .comment {
@@ -263,7 +260,6 @@
 }
 
 .type {
-//     font:1.2em monospace;
 }
 
 .arrow {
diff -r 2ee0c8e9169b ocaml/license/restrictions.mli
--- a/ocaml/license/restrictions.mli    Wed Dec 02 15:20:41 2009 +0000
+++ b/ocaml/license/restrictions.mli    Wed Dec 02 16:24:38 2009 +0000
@@ -11,19 +11,27 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *)
-(** Module that controls license entitlements
+(** Module that controls license entitlements.
  * @group Licensing
  *)
 
-(** Licensing mode *)
-type sku = Express | Enterprise
+(** Licensing mode. *)
+type sku =
+| Express              (** Express (free) license *)
+| Enterprise   (** Enterprise (paid-for) license *)
 
-(* used by CLI: *)
+(* the following three functions are used by the CLI *)
+
+(** Convert a string to a {!sku}. *)
 val sku_of_string : string -> sku
+
+(** Whether whether the given {!sku} corresponds to the free edition. *)
 val is_floodgate_free : sku -> bool
+
+(** Convert a {!sku} to a cryptic abbreviation. *)
 val obfuscated_string_of_sku : sku -> string
 
-(** Holding the flags that control which features are enabled or not *)
+(** Holding the flags that control which features are enabled or not. *)
 type restrictions = {
   enable_vlans : bool;                 (** not used anymore *)
   enable_qos : bool;                   (** not used anymore *)
@@ -42,16 +50,19 @@
   regular_nag_dialog : bool;   (** used by XenCenter *)
 }
 
-(** Returns a compact list of the current restrictions *)
+(** Returns a compact list of the current restrictions. *)
 val to_compact_string : restrictions -> string
 
 (** Return the 'pool_restrictions' being the greatest set of permissions 
allowed by all licenses. *)
 val pool_restrictions_of_list : restrictions list -> restrictions
 
+(** Convert a {!restrictions} value into an association list. *)
 val to_assoc_list : restrictions -> (string * string) list
+
+(** Convert and association list of restictions into a {!restrictions} value. 
*)
 val of_assoc_list : (string * string) list -> restrictions
 
-(** Get the current restrictions *)
+(** Get the current restrictions. *)
 val get : unit -> restrictions
 
 (** Return cache of pool restrictions, always updated at least once when the 
master reads its license.
@@ -59,12 +70,13 @@
 val get_pool : unit -> restrictions
 
 (* called by xapi_host *)
-(** Called whenever a slave resets its Host.license_params after reading in a 
license *)
+(** Called whenever a slave resets its Host.license_params after reading in a 
license. *)
 val update_pool_restrictions : __context:'a -> unit
 
+(** Object the {!restrictions} for a given {!sku}. *)
 val restrictions_of_sku : sku -> restrictions
 
-(** Checks whether we are entitled to enable Workload Balancing (WLB) in the 
pool *)
+(** Checks whether we are entitled to enable Workload Balancing (WLB) in the 
pool. *)
 val license_ok_for_wlb : __context:'a -> bool
 
 (** Checks whether we are entitled to enable Role-Based Access Control (RBAC) 
in the pool *)
diff -r 2ee0c8e9169b ocaml/xapi/license_check.mli
--- a/ocaml/xapi/license_check.mli      Wed Dec 02 15:20:41 2009 +0000
+++ b/ocaml/xapi/license_check.mli      Wed Dec 02 16:24:38 2009 +0000
@@ -15,7 +15,11 @@
  * Verifying whether the current license is still valid
  * @group Licensing
  *)
- 
+
+(** Raises {!Api_errors.license_expired} if the current license has expired.
+ *  The consequence would be that the VM is not allowed to start. *)
 val vm : __context:'a -> API.ref_VM -> unit
 
-val with_vm_license_check : __context:'a -> [`VM] Ref.t -> (unit -> 'b) -> 'b 
+(** Executes function [f] only if the current license has not yet expired.
+ *  If it has expired, it raises {!Api_errors.license_expired}. *)
+val with_vm_license_check : __context:'a -> [`VM] Ref.t -> (unit -> 'b) -> 'b

Attachment: doc-licensing
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.