Skip to content

about_Appliance_Connections

Chris Lynch edited this page Jan 18, 2016 · 3 revisions
TOPIC

    about_Appliance_Connections

SHORT DESCRIPTION

    Explains how Multiple Appliance Connections are handled with the 
    HPE OneView2.00 PowerShell Library.
	
LONG DESCRIPTION

    New in the HPE OneView2.0 PowerShell library is the ability to initiate 
    multiple appliance connections to script or automate operations.  To 
    support this capability, the library utilizes two new features:
    
    -- When using Connect-HPOVMgmt, an HPOneView.Appliance.Connection object 
       is returned to the caller.
    
    -- The HPOneView.ApplianceConnection object is stored in a global variable
       accessible by any caller: $ConnectedSessions
    
GLBOAL CONNECTION TRACKING OBJECT
    
    Contained in the $ConnectedSessions Global varilable, will be each 
    successful appliance connection object, HPOneView.Appliance.Connection.
    The object contains the following properties:
    
    -- ConnectID - Unique per PowerShell library session
    -- Name - Hostname of the appliance connection, specified by the
       'Hostname' parameter in Connect-HPOVMgmt.
    -- SessionID - Appliance API Auth session ID
    -- UserName - Username that was authenticated with to the appliance
    -- AuthLoginDomain - Authentication Directory resource used to
       authenticate user.
    -- SSLChecked - library specific property to handle SSL certificate
       verification.
    
    After successfully authenticating to an appliance, the
    HPOneView.Appliance.Connection object is added to the global session
    tracker, $ConnectedSessions.
    
HOW TO USE CONNECTION IN CMDLETS
    
    The PowerShell user can store the returned HPOneView.Appliance.Connection
    object in their own local, script-runspace variable, and pass it as the 
    ApplianceConnection parameter value in supported CMDLETs.
    
    Some CMDLETs will default to using all connections within $ConnectedSessions,
    and can be overridden by referencing the specific connection Name or
    object.
    
    For instance, Get-HPOVNetwork will default to processing all appliance
    connections, as the -ApplianceConnection parameter default value is
    $ConnectedSessions.  To override its default value, you can either specify
    the object, or the appliance connection Name property value.   
    

    This example shows how to use the connection 'object':
    
	PS C:\> $Connection1 = Connect-HPOVMgmt hpov1.domain.com administrator MyPassw0rd
	PS C:\> $Connection2 = Connect-HPOVMgmt hpov2.domain.com administrator MyPassw0rd
	PS C:\> $ConnectedSessions
	
	ConnectionID Name             UserName      AuthLoginDomain
	------------ ----             --------      ---------------
	1            hpov1.domain.com Administrator LOCAL
	2            hpov2.domain.com Administrator LOCAL
	
	PS C:\> Get-HPOVNetwork -ApplianceConnection $Connection1
    ...


    This example shows how to use the connection 'name':
    
	PS C:\> $Connection1 = Connect-HPOVMgmt hpov1.domain.com administrator MyPassw0rd
	PS C:\> $Connection2 = Connect-HPOVMgmt hpov2.domain.com administrator MyPassw0rd
	PS C:\> $ConnectedSessions
	
	ConnectionID Name             UserName      AuthLoginDomain
	------------ ----             --------      ---------------
	1            hpov1.domain.com Administrator LOCAL
	2            hpov2.domain.com Administrator LOCAL
	
	PS C:\> Get-HPOVNetwork -ApplianceConnection hpov1.domain.com
	...

CUSTOM NOTEPROPERTY VALUE IN OBJECTS

    When using the various CMDLETs, the returned resource object(s) will contain a custom 
	NoteProperty, called ApplianceConnection:

	-----------------------
	| ApplianceConnection |
	-----------------------
			|
			|   ----------------------
			|---| [int] ConnectionID |
			|   ----------------------
			|   -----------------
			|---| [string] Name |
			|   -----------------

    The 'ConnectionID' and 'Name' sub-properties reference the Appliance Connection
    contained within ${Global:ConnectedSessions}.  These are used to identify resources
    that originate from the correct appliance, as each object is unique per appliance.  
    To use these properties with Send-HPOVRequest, they can be referenced with their dot 
    name reference (e.g. $ServerProfile.ApplianceConnection.Name).

SEE ALSO

    https://github.com/HewlettPackard/POSH-HPOneView
    http://hp.com/go/oneviewcommunity
    Help about_HPOneView.200

Wiki Table of Contents

Clone this wiki locally