From: Marcin Siodelski Date: Sat, 17 Jul 2021 13:55:47 +0000 (+0200) Subject: [#1977] Added API files to class commands in CB X-Git-Tag: Kea-1.9.10~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=718f95d304bf0bd0cb4c59f5b8cdc12ec6f89fdb;p=thirdparty%2Fkea.git [#1977] Added API files to class commands in CB --- diff --git a/doc/sphinx/api-files.txt b/doc/sphinx/api-files.txt index 3e23c5a27d..a0fca97656 100644 --- a/doc/sphinx/api-files.txt +++ b/doc/sphinx/api-files.txt @@ -66,6 +66,14 @@ src/share/api/network6-get.json src/share/api/network6-list.json src/share/api/network6-subnet-add.json src/share/api/network6-subnet-del.json +src/share/api/remote-class4-del.json +src/share/api/remote-class4-get.json +src/share/api/remote-class4-get-all.json +src/share/api/remote-class4-set.json +src/share/api/remote-class6-del.json +src/share/api/remote-class6-get.json +src/share/api/remote-class6-get-all.json +src/share/api/remote-class6-set.json src/share/api/remote-global-parameter4-del.json src/share/api/remote-global-parameter4-get-all.json src/share/api/remote-global-parameter4-get.json diff --git a/src/share/api/api_files.mk b/src/share/api/api_files.mk index 8bfb37cda4..eaec3142f8 100644 --- a/src/share/api/api_files.mk +++ b/src/share/api/api_files.mk @@ -66,6 +66,14 @@ api_files += $(top_srcdir)/src/share/api/network6-get.json api_files += $(top_srcdir)/src/share/api/network6-list.json api_files += $(top_srcdir)/src/share/api/network6-subnet-add.json api_files += $(top_srcdir)/src/share/api/network6-subnet-del.json +api_files += $(top_srcdir)/src/share/api/remote-class4-del.json +api_files += $(top_srcdir)/src/share/api/remote-class4-get.json +api_files += $(top_srcdir)/src/share/api/remote-class4-get-all.json +api_files += $(top_srcdir)/src/share/api/remote-class4-set.json +api_files += $(top_srcdir)/src/share/api/remote-class6-del.json +api_files += $(top_srcdir)/src/share/api/remote-class6-get.json +api_files += $(top_srcdir)/src/share/api/remote-class6-get-all.json +api_files += $(top_srcdir)/src/share/api/remote-class6-set.json api_files += $(top_srcdir)/src/share/api/remote-global-parameter4-del.json api_files += $(top_srcdir)/src/share/api/remote-global-parameter4-get-all.json api_files += $(top_srcdir)/src/share/api/remote-global-parameter4-get.json diff --git a/src/share/api/remote-class4-del.json b/src/share/api/remote-class4-del.json new file mode 100644 index 0000000000..af73605a9a --- /dev/null +++ b/src/share/api/remote-class4-del.json @@ -0,0 +1,39 @@ +{ + "access": "write", + "avail": "1.9.10", + "brief": [ + "This command deletes a DHCPv4 client class from the configuration database." + ], + "cmd-comment": [ + "This command includes a list with exactly one name of the client class to be deleted. The ``server-tags`` parameter must not be specified for this command." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class4-del\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " }", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class4-del", + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"1 DHCPv4 client class(es) deleted.\",", + " \"arguments\": {", + " \"count\": 1", + " }", + "}" + ], + "support": [ + "kea-dhcp4" + ] +} diff --git a/src/share/api/remote-class4-get-all.json b/src/share/api/remote-class4-get-all.json new file mode 100644 index 0000000000..639fc369cf --- /dev/null +++ b/src/share/api/remote-class4-get-all.json @@ -0,0 +1,52 @@ +{ + "access": "read", + "avail": "1.9.10", + "brief": [ + "This command fetches all DHCPv4 client classes for specified servers from the configuration database." + ], + "cmd-comment": [ + "The ``server-tags`` list is required for this command, and must not be empty." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class4-get-all\",", + " \"arguments\": {", + " \"remote\": {", + " ", + " },", + " \"server-tags\": [ , , ... ]", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class4-get-all", + "resp-comment": [ + "The returned response contains a list of maps. Each map contains a client class name and the metadata, which provides database-specific information associated with the client class." + ], + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"2 DHCPv4 client class(es) found.\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " ,", + " \"metadata\": {", + " \"server-tags\": [ , , ... ]", + " }", + " },", + " {", + " ,", + " \"metadata\": {", + " \"server-tags\": [ , ... ]", + " }", + " }", + " ],", + " \"count\": 2", + " }", + "}" + ], + "support": [ + "kea-dhcp4" + ] +} diff --git a/src/share/api/remote-class4-get.json b/src/share/api/remote-class4-get.json new file mode 100644 index 0000000000..5dfdcb568c --- /dev/null +++ b/src/share/api/remote-class4-get.json @@ -0,0 +1,51 @@ +{ + "access": "read", + "avail": "1.9.10", + "brief": [ + "This command fetches a selected DHCPv4 client class by name from the specified database." + ], + "cmd-comment": [ + "This command includes a list with exactly one name of the client class to be returned. The ``server-tags`` parameter must not be specified for this command." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class4-get\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " }", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class4-get", + "resp-comment": [ + "The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object." + ], + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"DHCPv4 client class found.\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ,", + " \"metadata\": {", + " \"server-tags\": [ , , ... ]", + " },", + " ", + " }", + " ],", + " \"count\": 1", + " }", + "}" + ], + "support": [ + "kea-dhcp4" + ] +} diff --git a/src/share/api/remote-class4-set.json b/src/share/api/remote-class4-set.json new file mode 100644 index 0000000000..b978496948 --- /dev/null +++ b/src/share/api/remote-class4-set.json @@ -0,0 +1,44 @@ +{ + "access": "write", + "avail": "1.9.10", + "brief": [ + "This command creates or replaces a DHCPv4 client class in the configuration database." + ], + "cmd-comment": [ + "The provided list must contain exactly one client class specification. It may contain an optional parameter \"follow-class-name\" which can specify an existing class name to indicate that the class from the command is placed right after this existing class in the hierarchy. This parameter can be ommitted or set to \"null\" to indicate that the new client class should be appended at the end of the hierarchy or an updated class should remain at the current position. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the client class with one or more user-defined servers. It may include the special server tag \"all\" to associate the class with all servers." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class4-set\",", + " \"arguments\": {", + " \"client-class\": [", + " {", + " ", + " \"follow-class-name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " },", + " \"server-tags\": [ , , ... ]", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class4-set", + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"DHCPv4 shared network successfully set.\"", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ]", + "}" + ], + "support": [ + "kea-dhcp4" + ] +} diff --git a/src/share/api/remote-class6-del.json b/src/share/api/remote-class6-del.json new file mode 100644 index 0000000000..f74578da94 --- /dev/null +++ b/src/share/api/remote-class6-del.json @@ -0,0 +1,39 @@ +{ + "access": "write", + "avail": "1.9.10", + "brief": [ + "This command deletes a DHCPv6 client class from the configuration database." + ], + "cmd-comment": [ + "This command includes a list with exactly one name of the client class to be deleted. The ``server-tags`` parameter must not be specified for this command." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class6-del\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " }", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class6-del", + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"1 DHCPv6 client class(es) deleted.\",", + " \"arguments\": {", + " \"count\": 1", + " }", + "}" + ], + "support": [ + "kea-dhcp6" + ] +} diff --git a/src/share/api/remote-class6-get-all.json b/src/share/api/remote-class6-get-all.json new file mode 100644 index 0000000000..216611c77b --- /dev/null +++ b/src/share/api/remote-class6-get-all.json @@ -0,0 +1,52 @@ +{ + "access": "read", + "avail": "1.9.10", + "brief": [ + "This command fetches all DHCPv6 client classes for specified servers from the configuration database." + ], + "cmd-comment": [ + "The ``server-tags`` list is required for this command, and must not be empty." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class6-get-all\",", + " \"arguments\": {", + " \"remote\": {", + " ", + " },", + " \"server-tags\": [ , , ... ]", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class6-get-all", + "resp-comment": [ + "The returned response contains a list of maps. Each map contains a client class name and the metadata, which provides database-specific information associated with the client class." + ], + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"2 DHCPv6 client class(es) found.\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " ,", + " \"metadata\": {", + " \"server-tags\": [ , , ... ]", + " }", + " },", + " {", + " ,", + " \"metadata\": {", + " \"server-tags\": [ , ... ]", + " }", + " }", + " ],", + " \"count\": 2", + " }", + "}" + ], + "support": [ + "kea-dhcp6" + ] +} diff --git a/src/share/api/remote-class6-get.json b/src/share/api/remote-class6-get.json new file mode 100644 index 0000000000..bf90fbeb5b --- /dev/null +++ b/src/share/api/remote-class6-get.json @@ -0,0 +1,51 @@ +{ + "access": "read", + "avail": "1.9.10", + "brief": [ + "This command fetches a selected DHCPv6 client class by name from the specified database." + ], + "cmd-comment": [ + "This command includes a list with exactly one name of the client class to be returned. The ``server-tags`` parameter must not be specified for this command." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class6-get\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " }", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class6-get", + "resp-comment": [ + "The metadata is included in the returned shared network definition and provides the database-specific information associated with the returned object." + ], + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"DHCPv6 client class found.\",", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ,", + " \"metadata\": {", + " \"server-tags\": [ , , ... ]", + " },", + " ", + " }", + " ],", + " \"count\": 1", + " }", + "}" + ], + "support": [ + "kea-dhcp6" + ] +} diff --git a/src/share/api/remote-class6-set.json b/src/share/api/remote-class6-set.json new file mode 100644 index 0000000000..37e66b9011 --- /dev/null +++ b/src/share/api/remote-class6-set.json @@ -0,0 +1,44 @@ +{ + "access": "write", + "avail": "1.9.10", + "brief": [ + "This command creates or replaces a DHCPv6 client class in the configuration database." + ], + "cmd-comment": [ + "The provided list must contain exactly one client class specification. It may contain an optional parameter \"follow-class-name\" which can specify an existing class name to indicate that the class from the command is placed right after this existing class in the hierarchy. This parameter can be ommitted or set to \"null\" to indicate that the new client class should be appended at the end of the hierarchy or an updated class should remain at the current position. The ``server-tags`` list is mandatory and must contain one or more server tags as strings to explicitly associate the client class with one or more user-defined servers. It may include the special server tag \"all\" to associate the class with all servers." + ], + "cmd-syntax": [ + "{", + " \"command\": \"remote-class6-set\",", + " \"arguments\": {", + " \"client-class\": [", + " {", + " ", + " \"follow-class-name\": ", + " }", + " ],", + " \"remote\": {", + " ", + " },", + " \"server-tags\": [ , , ... ]", + " }", + "}" + ], + "hook": "cb_cmds", + "name": "remote-class6-set", + "resp-syntax": [ + "{", + " \"result\": 0,", + " \"text\": \"DHCPv6 shared network successfully set.\"", + " \"arguments\": {", + " \"client-classes\": [", + " {", + " \"name\": ", + " }", + " ]", + "}" + ], + "support": [ + "kea-dhcp6" + ] +}