From c6d09e6d3fee1c72bb056fb17590896eca75a69f Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 16:33:39 +0100 Subject: [PATCH 1/7] Update links to Query Settings REST API --- .../pages/services-and-indexes/indexes/query-without-index.adoc | 2 +- modules/n1ql/pages/n1ql-manage/query-settings.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/learn/pages/services-and-indexes/indexes/query-without-index.adoc b/modules/learn/pages/services-and-indexes/indexes/query-without-index.adoc index 057cd9154..dd00c0b54 100644 --- a/modules/learn/pages/services-and-indexes/indexes/query-without-index.adoc +++ b/modules/learn/pages/services-and-indexes/indexes/query-without-index.adoc @@ -316,7 +316,7 @@ You can get or set the N1QL Feature Controller setting in any of the following w |REST API |Cluster-level -|xref:rest-api:rest-cluster-query-settings.adoc[] +|xref:n1ql-rest-settings:index.adoc[] |`queryN1qlFeatCtrl` |REST API diff --git a/modules/n1ql/pages/n1ql-manage/query-settings.adoc b/modules/n1ql/pages/n1ql-manage/query-settings.adoc index b57888f2e..251ebcd1b 100644 --- a/modules/n1ql/pages/n1ql-manage/query-settings.adoc +++ b/modules/n1ql/pages/n1ql-manage/query-settings.adoc @@ -4,7 +4,7 @@ :page-partial: // External cross-references -:rest-cluster-query-settings: xref:rest-api:rest-cluster-query-settings.adoc +:rest-cluster-query-settings: xref:n1ql-rest-settings:index.adoc :general-settings-query-settings: xref:manage:manage-settings/general-settings.adoc#query-settings :couchbase-cli-setting-query: xref:cli:cbcli/couchbase-cli-setting-query.adoc :n1ql-rest-api-admin: xref:n1ql-rest-admin:index.adoc From f1cd28ec286e516d3c4348639ecf7cdf417c3b62 Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 16:42:53 +0100 Subject: [PATCH 2/7] Update includes of Query Settings REST API --- modules/n1ql/pages/n1ql-language-reference/curl.adoc | 2 +- modules/n1ql/pages/n1ql-manage/query-settings.adoc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/n1ql/pages/n1ql-language-reference/curl.adoc b/modules/n1ql/pages/n1ql-language-reference/curl.adoc index 01e8084fa..6e5329614 100644 --- a/modules/n1ql/pages/n1ql-language-reference/curl.adoc +++ b/modules/n1ql/pages/n1ql-language-reference/curl.adoc @@ -239,7 +239,7 @@ include::rest-api:example$query-settings-post-access.sh[] The access list file command structure is described in the following table. .Structure of Access List for CURL() -include::rest-api:partial$query-settings/definitions.adoc[tag=access] +include::n1ql-rest-settings:index.adoc[tag=Access] == Design Considerations diff --git a/modules/n1ql/pages/n1ql-manage/query-settings.adoc b/modules/n1ql/pages/n1ql-manage/query-settings.adoc index 251ebcd1b..27c7c8d01 100644 --- a/modules/n1ql/pages/n1ql-manage/query-settings.adoc +++ b/modules/n1ql/pages/n1ql-manage/query-settings.adoc @@ -370,11 +370,11 @@ http://localhost:8091/settings/querySettings \ The table below contains details of all cluster-level query settings. .Cluster-Level Query Settings -include::rest-api:partial$query-settings/definitions.adoc[tag=settings] +include::n1ql-rest-settings:index.adoc[tag=Settings] -[[_access]] +[[Access,Access]] **Access** -include::rest-api:partial$query-settings/definitions.adoc[tag=access] +include::n1ql-rest-settings:index.adoc[tag=Access] [[service-level-query-settings]] == Node-Level Query Settings From 3088c10250fcf8e6a58715e4fbdee0bbe2f92af8 Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 16:46:23 +0100 Subject: [PATCH 3/7] Driveby fixes for CURL() function [BACKPORT] --- modules/n1ql/pages/n1ql-language-reference/curl.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/n1ql/pages/n1ql-language-reference/curl.adoc b/modules/n1ql/pages/n1ql-language-reference/curl.adoc index 6e5329614..4b30b0a81 100644 --- a/modules/n1ql/pages/n1ql-language-reference/curl.adoc +++ b/modules/n1ql/pages/n1ql-language-reference/curl.adoc @@ -227,13 +227,13 @@ Click btn:[+] to add another URL to the list. Click btn:[-] to remove a URL from the list. -==== From CBQ +==== From the Query Settings REST API -From a CBQ prompt, you can send a CURL() command to allow or disallow specific URLs, for example: +You can send a call to the Query Settings REST API to allow or disallow specific URLs, for example: [source,sh] ---- -include::rest-api:example$query-settings-post-access.sh[] +include::rest-api:example$query-settings-post-access.sh[tags=request] ---- The access list file command structure is described in the following table. From 6df26beb92e4fcb0aef9cea41f457fb9cfc7d60a Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 18:21:13 +0100 Subject: [PATCH 4/7] Update links to Query Settings examples --- modules/n1ql/pages/n1ql-language-reference/curl.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/n1ql/pages/n1ql-language-reference/curl.adoc b/modules/n1ql/pages/n1ql-language-reference/curl.adoc index 4b30b0a81..61531d811 100644 --- a/modules/n1ql/pages/n1ql-language-reference/curl.adoc +++ b/modules/n1ql/pages/n1ql-language-reference/curl.adoc @@ -233,7 +233,7 @@ You can send a call to the Query Settings REST API to allow or disallow specific [source,sh] ---- -include::rest-api:example$query-settings-post-access.sh[tags=request] +include::n1ql-rest-settings:example$query-settings-post-access.sh[tags=request] ---- The access list file command structure is described in the following table. From 4deafb080fe7b2268d09eab4e055c687fd584f8d Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 21:51:54 +0100 Subject: [PATCH 5/7] Add table-style partial --- .../n1ql-language-reference/table-style.adoc | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 modules/n1ql/partials/n1ql-language-reference/table-style.adoc diff --git a/modules/n1ql/partials/n1ql-language-reference/table-style.adoc b/modules/n1ql/partials/n1ql-language-reference/table-style.adoc new file mode 100644 index 000000000..d121d0a31 --- /dev/null +++ b/modules/n1ql/partials/n1ql-language-reference/table-style.adoc @@ -0,0 +1,51 @@ +// FIXME: Temporary pass-through CSS for REST API tables with Markdown blocks + +ifdef::basebackend-html[] +++++ + +++++ +endif::[] \ No newline at end of file From a1e8b2a21623842bd54875732d160379f3e64ce1 Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 21:52:08 +0100 Subject: [PATCH 6/7] Add table-style for CURL() reference --- modules/n1ql/pages/n1ql-language-reference/curl.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/n1ql/pages/n1ql-language-reference/curl.adoc b/modules/n1ql/pages/n1ql-language-reference/curl.adoc index 61531d811..ee781df9d 100644 --- a/modules/n1ql/pages/n1ql-language-reference/curl.adoc +++ b/modules/n1ql/pages/n1ql-language-reference/curl.adoc @@ -8,6 +8,9 @@ :url-yahoo-api: https://developer.yahoo.com/api/ :url-google-geo: https://developers.google.com/maps/documentation/geocoding/intro +// TEMP +include::partial$n1ql-language-reference/table-style.adoc[] + The `CURL()` function implements a subset of {url-wiki-curl}[cURL^] functionality and enables {sqlpp} queries to interact and integrate with external JSON data sources available over HTTP/REST. This allows federated queries against external data sources, such as the {url-google-maps}[Google geocoding API^], {url-yahoo-api}[Yahoo API^], or other Couchbase clusters. The federated queries can leverage full querying capabilities of {sqlpp}, including functions, expressions, sub-queries, JOINs, NESTs, UNNESTs etc. From 6b90ddc56f12e0fdfa55e633f64902fd02be09c4 Mon Sep 17 00:00:00 2001 From: Simon Dew Date: Mon, 21 Oct 2024 22:05:11 +0100 Subject: [PATCH 7/7] Minor CURL() updates [BACKPORT] --- .../n1ql/pages/n1ql-language-reference/curl.adoc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/n1ql/pages/n1ql-language-reference/curl.adoc b/modules/n1ql/pages/n1ql-language-reference/curl.adoc index ee781df9d..cae21eff4 100644 --- a/modules/n1ql/pages/n1ql-language-reference/curl.adoc +++ b/modules/n1ql/pages/n1ql-language-reference/curl.adoc @@ -640,7 +640,7 @@ WHERE to_number(hdp_low) < min_threshold; ==== [[Ex6]] -.Use CURL() to allow two URLs and disallow one URL +.Allow two URLs and disallow one URL ==== .Request [source,sh] @@ -655,7 +655,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex7]] -.Use CURL() to allow all access to all endpoints +.Allow all access to all endpoints ==== .Request [source,sh] @@ -668,7 +668,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex8]] -.Use CURL() to turn off access to all endpoints and clear the Allowed and Disallowed lists +.Turn off access to all endpoints and clear the Allowed and Disallowed lists ==== .Request [source,sh] @@ -683,7 +683,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex9]] -.Use CURL() to turn off access to all endpoints but make no changes to the Allowed and Disallowed lists +.Turn off access to all endpoints but make no changes to the Allowed and Disallowed lists ==== .Request [source,sh] @@ -696,7 +696,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex10]] -.Use CURL() to turn off access to all endpoints, allow one URL, and clear the Disallowed list +.Turn off access to all endpoints, allow one URL, and clear the Disallowed list ==== .Request [source,sh] @@ -711,7 +711,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex11]] -.Use CURL() to turn off access to all endpoints, disallow one URL, and clear the Allowed list +.Turn off access to all endpoints, disallow one URL, and clear the Allowed list ==== .Request [source,sh] @@ -726,7 +726,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex12]] -.Use CURL() to allow an IP address and port instead of a website name +.Allow an IP address and port instead of a website name ==== .Request [source,sh] @@ -741,7 +741,7 @@ curl -X POST -u Administrator:password \ ==== [[Ex13]] -.Use CURL() to allow and disallow the same URL -- and get an error +.Allow and disallow the same URL -- and get an error ==== .Request [source,sh]