Skip to content

Commit 2d5aef9

Browse files
Add Session and Key param to Get-CouchDBConfiguration
1 parent de37891 commit 2d5aef9

8 files changed

Lines changed: 21 additions & 5 deletions

File tree

PSCouchDB/PSCouchDB.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'PSCouchDB.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.12.9'
15+
ModuleVersion = '1.13.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

PSCouchDB/PSCouchDB.psm1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,12 +2603,18 @@ function Get-CouchDBConfiguration () {
26032603
.NOTES
26042604
CouchDB API:
26052605
GET /_node/{node-name}/_config
2606+
GET /_node/{node-name}/_config/{section}
2607+
GET /_node/{node-name}/_config/{section}/{key}
26062608
.PARAMETER Server
26072609
The CouchDB server name. Default is localhost.
26082610
.PARAMETER Port
26092611
The CouchDB server port. Default is 5984.
26102612
.PARAMETER Node
26112613
The CouchDB node of cluster. Default is couchdb@localhost.
2614+
.PARAMETER Session
2615+
The CouchDB configuration section name.
2616+
.PARAMETER Key
2617+
The CouchDB configuration option name.
26122618
.PARAMETER Authorization
26132619
The CouchDB authorization form; user and password.
26142620
Authorization format like this: user:password
@@ -2628,11 +2634,21 @@ function Get-CouchDBConfiguration () {
26282634
[string] $Server,
26292635
[int] $Port,
26302636
[string] $Node = $(if ((Get-CouchDBNode -Server $Server -Port $Port -Authorization $Authorization -Ssl:$Ssl).all_nodes -contains "couchdb@localhost") { "couchdb@localhost" } else { "couchdb@127.0.0.1" }),
2637+
[string] $Session,
2638+
[string] $Key,
26312639
[string] $Authorization,
26322640
[switch] $Ssl
26332641
)
26342642
$Database = "_node"
26352643
$Document = "$Node/_config"
2644+
# Check Session parameter
2645+
if ($Session) {
2646+
$Document += "/$Session"
2647+
}
2648+
# Check Key parameter
2649+
if ($Session -and $Key) {
2650+
$Document += "/$Key"
2651+
}
26362652
Send-CouchDBRequest -Server $Server -Port $Port -Method "GET" -Database $Database -Document $Document -Authorization $Authorization -Ssl:$Ssl
26372653
}
26382654

34 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

docs/build/html/_sources/cmdlets.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Configuration
6161

6262
.. code-block:: powershell
6363
64-
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Database] <String>] [[-Node] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
64+
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Node] <String>] [[-Session] <String>] [[-Key] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
6565
6666
**Set-CouchDBConfiguration**
6767

docs/build/html/cmdlets.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ <h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to
206206
</pre></div>
207207
</div>
208208
<p><strong>Get-CouchDBConfiguration</strong></p>
209-
<div class="highlight-powershell notranslate"><div class="highlight"><pre><span></span><span class="nb">Get-CouchDBConfiguration</span> <span class="p">[[</span><span class="n">-Server</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Port</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">Int32</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Database</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Node</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Authorization</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[</span><span class="n">-Ssl</span><span class="p">]</span> <span class="p">[&lt;</span><span class="n">CommonParameters</span><span class="p">&gt;]</span>
209+
<div class="highlight-powershell notranslate"><div class="highlight"><pre><span></span><span class="nb">Get-CouchDBConfiguration</span> <span class="p">[[</span><span class="n">-Server</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Port</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">Int32</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Node</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Session</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Key</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[[</span><span class="n">-Authorization</span><span class="p">]</span> <span class="p">&lt;</span><span class="n">String</span><span class="p">&gt;]</span> <span class="p">[</span><span class="n">-Ssl</span><span class="p">]</span> <span class="p">[&lt;</span><span class="n">CommonParameters</span><span class="p">&gt;]</span>
210210
</pre></div>
211211
</div>
212212
<p><strong>Set-CouchDBConfiguration</strong></p>

docs/build/html/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/source/cmdlets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Configuration
6161

6262
.. code-block:: powershell
6363
64-
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Database] <String>] [[-Node] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
64+
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Node] <String>] [[-Session] <String>] [[-Key] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
6565
6666
**Set-CouchDBConfiguration**
6767

0 commit comments

Comments
 (0)