From: Marcin Siodelski Date: Tue, 30 Oct 2018 07:07:18 +0000 (+0100) Subject: [64-client-class-cmds-hook] Documented class_cmds in API docs. X-Git-Tag: 66-authoritative-flag-in-kea_base~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=879072603d09d2f2eb334e96b0e526c8706b6d0b;p=thirdparty%2Fkea.git [64-client-class-cmds-hook] Documented class_cmds in API docs. --- diff --git a/doc/api/class-add.json b/doc/api/class-add.json new file mode 100644 index 0000000000..86fef27765 --- /dev/null +++ b/doc/api/class-add.json @@ -0,0 +1,23 @@ +{ + "name": "class-add", + "brief": "This command is used to create and add a new class to the existing server configuration.", + "description": "See ", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "avail": "1.5.0", + "hook": "class_cmds", + "cmd-syntax": "{ + \"command\": \"class-add\", + \"arguments\": { + \"client-classes\": [ { + \"name\": \"ipxe_efi_x64\", + \"test\": \"option[93].hex == 0x0009\", + ... + } ] + } +}", + "cmd-comment": "Only one client class can be added with a single command.", + "resp-syntax": "{ + \"result\": 0, + \"text\": \"Class 'ipxe_efi_x64' added.\" +}" +} diff --git a/doc/api/class-del.json b/doc/api/class-del.json new file mode 100644 index 0000000000..35dc4003da --- /dev/null +++ b/doc/api/class-del.json @@ -0,0 +1,18 @@ +{ + "name": "class-del", + "brief": "This command is used to remove a client class from the server configuration.", + "description": "See ", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "avail": "1.5.0", + "hook": "class_cmds", + "cmd-syntax": "{ + \"command\": \"class-del\", + \"arguments\": { + \"name\": \"ipxe_efi_x64\", + } +}", + "resp-syntax": "{ + \"result\": 0, + \"text\": \"Class 'ipxe_efi_x64' deleted.\" +}" +} diff --git a/doc/api/class-get.json b/doc/api/class-get.json new file mode 100644 index 0000000000..f631a72327 --- /dev/null +++ b/doc/api/class-get.json @@ -0,0 +1,39 @@ +{ + "name": "class-get", + "brief": "This command is used to return detailed information about an existing client class.", + "description": "See ", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "avail": "1.5.0", + "hook": "class_cmds", + "cmd-syntax": "{ + \"command\": \"class-get\", + \"arguments\": { + \"name\": \"pxeclient\" + } +}", + "resp-syntax": "{ + \"result\": 0, + \"text\": \"Class 'pxeclient' definition returned\", + \"arguments\": { + \"client-classes\": [ + { + \"name\": \"pxeclient\", + \"only-if-required\": true, + \"test\": \"option[vendor-class-identifier].text == 'PXEClient'\", + \"option-def\": [ + { + \"name\": \"configfile\", + \"code\": 209, + \"type\": \"string\" + } + ], + \"option-data\": [ ], + \"next-server\": \"0.0.0.0\", + \"server-hostname\": \"xfce\", + \"boot-file-name\": \"/dev/null\" + } + ] + } +}", + "resp-comment": "The returned information depends on the DHCP server type, i.e. some parameters are specific to DHCPv4 server. Also, some parameters may not be returned if they are not set for the client class. If the class with specified name doesn't exist a result of 3 is returned." +} diff --git a/doc/api/class-list.json b/doc/api/class-list.json new file mode 100644 index 0000000000..6d501be3a0 --- /dev/null +++ b/doc/api/class-list.json @@ -0,0 +1,27 @@ +{ + "name": "class-list", + "brief": "This command is used to retrieve a list of all client classes from the server configuration.", + "description": "See ", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "avail": "1.5.0", + "hook": "class_cmds", + "cmd-syntax": "{ + \"command\": \"class-list\" +}", + "cmd-comment": "This command includes no arguments.", + "resp-syntax": "{ + \"result\": 0, + \"text\": \"2 classes found\", + \"arguments\": { + \"client-classes\": [ + { + \"name\": \"ipxe_efi_x64\" + }, + { + \"name\": \"pxeclient\" + } + ] + } +}", + "resp-comment": "The returned list of classes merely contains their names. In order to retrieve full information about one of these classes use ." +} diff --git a/doc/api/class-update.json b/doc/api/class-update.json new file mode 100644 index 0000000000..c0ea96e989 --- /dev/null +++ b/doc/api/class-update.json @@ -0,0 +1,23 @@ +{ + "name": "class-update", + "brief": "This command is used to update an existing client class in the server configuration.", + "description": "See ", + "support": [ "kea-dhcp4", "kea-dhcp6" ], + "avail": "1.5.0", + "hook": "class_cmds", + "cmd-syntax": "{ + \"command\": \"class-update\", + \"arguments\": { + \"client-classes\": [ { + \"name\": \"ipxe_efi_x64\", + \"test\": \"option[93].hex == 0x0009\", + ... + } ] + } +}", + "cmd-comment": "Only one client class can be updated with a single command..", + "resp-syntax": "{ + \"result\": 0, + \"text\": \"Class 'ipxe_efi_x64' updated.\" +}" +} diff --git a/doc/docgen/cmds-list b/doc/docgen/cmds-list index be78abba5f..64408e552b 100644 --- a/doc/docgen/cmds-list +++ b/doc/docgen/cmds-list @@ -5,6 +5,11 @@ cache-insert cache-load cache-remove cache-write +class-add +class-del +class-get +class-list +class-update config-get config-reload config-set diff --git a/doc/guide/api.xml b/doc/guide/api.xml index 67b82676e7..d0e49f580c 100644 --- a/doc/guide/api.xml +++ b/doc/guide/api.xml @@ -9,7 +9,7 @@ API Reference - Kea currently supports 66 commands: + Kea currently supports 71 commands: build-report , cache-clear , cache-get @@ -17,6 +17,11 @@ , cache-load , cache-remove , cache-write +, class-add +, class-del +, class-get +, class-list +, class-update , config-get , config-reload , config-set @@ -92,6 +97,11 @@ , cache-load , cache-remove , cache-write +, class-add +, class-del +, class-get +, class-list +, class-update , config-get , config-reload , config-set @@ -142,6 +152,11 @@ , cache-load , cache-remove , cache-write +, class-add +, class-del +, class-get +, class-list +, class-update , config-get , config-reload , config-set @@ -185,6 +200,12 @@ , subnet6-list , version-get . +Commands supported by class_cmds hook library: class-add +, class-del +, class-get +, class-list +, class-update +. Commands supported by high_availability hook library: ha-continue , ha-heartbeat , ha-scopes @@ -524,6 +545,212 @@ Result is an integer representation of the status. Currently supported statuses + +
+class-add reference +class-add - This command is used to create and add a new class to the existing server configuration. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.5.0 (class_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "class-add", + "arguments": { + "client-classes": [ { + "name": "ipxe_efi_x64", + "test": "option[93].hex == 0x0009", + ... + } ] + } +} +Only one client class can be added with a single command. + +Response syntax: + { + "result": 0, + "text": "Class 'ipxe_efi_x64' added." +} +Result is an integer representation of the status. Currently supported statuses are: + + 0 - success + 1 - error + 2 - unsupported + 3 - empty (command was completed successfully, but no data was affected or returned) + + + +
+ + + +
+class-del reference +class-del - This command is used to remove a client class from the server configuration. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.5.0 (class_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "class-del", + "arguments": { + "name": "ipxe_efi_x64", + } +} + + +Response syntax: + { + "result": 0, + "text": "Class 'ipxe_efi_x64' deleted." +} +Result is an integer representation of the status. Currently supported statuses are: + + 0 - success + 1 - error + 2 - unsupported + 3 - empty (command was completed successfully, but no data was affected or returned) + + + +
+ + + +
+class-get reference +class-get - This command is used to return detailed information about an existing client class. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.5.0 (class_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "class-get", + "arguments": { + "name": "pxeclient" + } +} + + +Response syntax: + { + "result": 0, + "text": "Class 'pxeclient' definition returned", + "arguments": { + "client-classes": [ + { + "name": "pxeclient", + "only-if-required": true, + "test": "option[vendor-class-identifier].text == 'PXEClient'", + "option-def": [ + { + "name": "configfile", + "code": 209, + "type": "string" + } + ], + "option-data": [ ], + "next-server": "0.0.0.0", + "server-hostname": "xfce", + "boot-file-name": "/dev/null" + } + ] + } +} +The returned information depends on the DHCP server type, i.e. some parameters are specific to DHCPv4 server. Also, some parameters may not be returned if they are not set for the client class. If the class with specified name doesn't exist a result of 3 is returned. + +
+ + + +
+class-list reference +class-list - This command is used to retrieve a list of all client classes from the server configuration. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.5.0 (class_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "class-list" +} +This command includes no arguments. + +Response syntax: + { + "result": 0, + "text": "2 classes found", + "arguments": { + "client-classes": [ + { + "name": "ipxe_efi_x64" + }, + { + "name": "pxeclient" + } + ] + } +} +The returned list of classes merely contains their names. In order to retrieve full information about one of these classes use . + +
+ + + +
+class-update reference +class-update - This command is used to update an existing client class in the server configuration. + +Supported by: kea-dhcp4, kea-dhcp6 + +Availability: 1.5.0 (class_cmds hook) + +Description and examples: See + +Command syntax: + { + "command": "class-update", + "arguments": { + "client-classes": [ { + "name": "ipxe_efi_x64", + "test": "option[93].hex == 0x0009", + ... + } ] + } +} +Only one client class can be updated with a single command.. + +Response syntax: + { + "result": 0, + "text": "Class 'ipxe_efi_x64' updated." +} +Result is an integer representation of the status. Currently supported statuses are: + + 0 - success + 1 - error + 2 - unsupported + 3 - empty (command was completed successfully, but no data was affected or returned) + + + +
+ +
config-get reference diff --git a/doc/guide/hooks-class-cmds.xml b/doc/guide/hooks-class-cmds.xml index 7201621ac2..2792eb6aab 100644 --- a/doc/guide/hooks-class-cmds.xml +++ b/doc/guide/hooks-class-cmds.xml @@ -25,7 +25,7 @@ customers only -
+
class-add command The class-add command is used to add a new client class to the DHCP server configuration. This class is appended at the @@ -69,7 +69,7 @@
-
+
class-update command The class-update command is used to update an existing @@ -120,7 +120,7 @@
-
+
class-del command The class-del is used to remove a particular class from the server configuration. The class to be removed is identified by name. @@ -151,7 +151,7 @@ If the class doesn't exist, the result of 3 is returned.
-
+
class-list command The class-list is used to retrieve a list of all client classes. This command includes no arguments: @@ -188,7 +188,7 @@
-
+
class-get command The class-get is used to retrieve detail information about specified class. The command structure is very simple: