Skip to content

Commit

Permalink
Add Session and Key param to Get-CouchDBConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGuadrini committed Sep 17, 2019
1 parent de37891 commit 2d5aef9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PSCouchDB/PSCouchDB.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSCouchDB.psm1'

# Version number of this module.
ModuleVersion = '1.12.9'
ModuleVersion = '1.13.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
16 changes: 16 additions & 0 deletions PSCouchDB/PSCouchDB.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2603,12 +2603,18 @@ function Get-CouchDBConfiguration () {
.NOTES
CouchDB API:
GET /_node/{node-name}/_config
GET /_node/{node-name}/_config/{section}
GET /_node/{node-name}/_config/{section}/{key}
.PARAMETER Server
The CouchDB server name. Default is localhost.
.PARAMETER Port
The CouchDB server port. Default is 5984.
.PARAMETER Node
The CouchDB node of cluster. Default is couchdb@localhost.
.PARAMETER Session
The CouchDB configuration section name.
.PARAMETER Key
The CouchDB configuration option name.
.PARAMETER Authorization
The CouchDB authorization form; user and password.
Authorization format like this: user:password
Expand All @@ -2628,11 +2634,21 @@ function Get-CouchDBConfiguration () {
[string] $Server,
[int] $Port,
[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" }),
[string] $Session,
[string] $Key,
[string] $Authorization,
[switch] $Ssl
)
$Database = "_node"
$Document = "$Node/_config"
# Check Session parameter
if ($Session) {
$Document += "/$Session"
}
# Check Key parameter
if ($Session -and $Key) {
$Document += "/$Key"
}
Send-CouchDBRequest -Server $Server -Port $Port -Method "GET" -Database $Database -Document $Document -Authorization $Authorization -Ssl:$Ssl
}

Expand Down
Binary file modified docs/build/doctrees/cmdlets.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/_sources/cmdlets.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Configuration

.. code-block:: powershell
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Database] <String>] [[-Node] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Node] <String>] [[-Session] <String>] [[-Key] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
**Set-CouchDBConfiguration**

Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/cmdlets.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to
</pre></div>
</div>
<p><strong>Get-CouchDBConfiguration</strong></p>
<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>
<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>
</pre></div>
</div>
<p><strong>Set-CouchDBConfiguration</strong></p>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/cmdlets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Configuration

.. code-block:: powershell
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Database] <String>] [[-Node] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
Get-CouchDBConfiguration [[-Server] <String>] [[-Port] <Int32>] [[-Node] <String>] [[-Session] <String>] [[-Key] <String>] [[-Authorization] <String>] [-Ssl] [<CommonParameters>]
**Set-CouchDBConfiguration**

Expand Down

0 comments on commit 2d5aef9

Please sign in to comment.