1
+
2
+ <#
3
+ Copyright $CopyrightYear $Author
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ #>
17
+
18
+ function Get-NSHANode {
19
+ <#
20
+ . SYNOPSIS
21
+ Gets the specified HA Node object(s).
22
+
23
+ . DESCRIPTION
24
+ Gets the specified HA Node object(s).
25
+ Either returns a single object identified by its identifier (-ID parameter)
26
+ or a collection of objects filtered by the other parameters. Those
27
+ filter parameters accept either a literal value or a regexp in the form
28
+ "/someregexp/".
29
+
30
+ . EXAMPLE
31
+ Get-NSHANode
32
+
33
+ Get all HA Node objects.
34
+
35
+ . EXAMPLE
36
+ Get-NSHANode -ID 'foobar'
37
+
38
+ Get the HA Node named 'foobar'.
39
+
40
+ . PARAMETER Session
41
+ The NetScaler session object.
42
+
43
+ . PARAMETER ID
44
+ The identifier/name or identifiers/names of the HA Nodes to get.
45
+
46
+ . PARAMETER IPAddress
47
+ A filter to apply to the ipaddress property.
48
+
49
+ . PARAMETER HASync
50
+ A filter to apply to the hasync property.
51
+
52
+ . PARAMETER Name
53
+ A filter to apply to the name property.
54
+
55
+ . PARAMETER HAStatus
56
+ A filter to apply to the hastatus property.
57
+
58
+ . PARAMETER State
59
+ A filter to apply to the state property.
60
+
61
+ . NOTES
62
+ Nitro implementation status: partial
63
+
64
+ #>
65
+ [CmdletBinding (DefaultParameterSetName = ' get' )]
66
+ Param (
67
+ $Session = $Script :Session ,
68
+
69
+ [Parameter (Position = 0 , ParameterSetName = ' get' )]
70
+ [string []]$ID = @ (),
71
+
72
+ [Parameter (ParameterSetName = ' search' )]
73
+ [string ]$IPAddress ,
74
+
75
+ [Parameter (ParameterSetName = ' search' )]
76
+ [string ]$HASync ,
77
+
78
+ [Parameter (ParameterSetName = ' search' )]
79
+ [string ]$Name ,
80
+
81
+ [Parameter (ParameterSetName = ' search' )]
82
+ [string ]$HAStatus ,
83
+
84
+ [Parameter (ParameterSetName = ' search' )]
85
+ [string ]$State
86
+
87
+ )
88
+ Begin {
89
+ _AssertSessionActive
90
+ }
91
+
92
+ Process {
93
+ # Contruct a filter hash if we specified any filters
94
+ $Filters = @ {}
95
+ if ($PSBoundParameters.ContainsKey (' IPAddress' )) {
96
+ $Filters [' ipaddress' ] = $IPAddress
97
+ }
98
+ if ($PSBoundParameters.ContainsKey (' HASync' )) {
99
+ $Filters [' hasync' ] = $HASync
100
+ }
101
+ if ($PSBoundParameters.ContainsKey (' Name' )) {
102
+ $Filters [' name' ] = $Name
103
+ }
104
+ if ($PSBoundParameters.ContainsKey (' HAStatus' )) {
105
+ $Filters [' hastatus' ] = $HAStatus
106
+ }
107
+ if ($PSBoundParameters.ContainsKey (' State' )) {
108
+ $Filters [' state' ] = $State
109
+ }
110
+ _InvokeNSRestApiGet - Session $Session - Type hanode - Name $ID - Filters $Filters
111
+
112
+ }
113
+ }
0 commit comments