Send HPOVRequest - HewlettPackard/POSH-HPEOneView GitHub Wiki

HPE OneView 4.10 Library

Send-HPOVRequest

Sends a request to the management appliance

SYNTAX

Send-HPOVRequest [-uri] <String> [-method] <String> [-body] <Object> [-start] <Int32> [-count] <Int32> [-AddHeader] <Hashtable>[ [-OverrideContentType] <String>][ [-OverrideTimeout] <Int>] [-Hostname] <Object> [<CommonParameters>]

Detailed Description

Receives the request input, properly constructs and formats the request header and body and sends the request to the management appliance. This is the main cmdlet that interacts with the appliance.

The message body can contain valid JSON data, with the correct URI and accepted HTTP method accepted by the target resource manager. Please see the on-appliance Resource Model for more information (https://[appliance_IP]/help/cic/en/content/images/api/.)

Parameters

-AddHeader <Hashtable>

If additional headers are needed/required than the defaults, include header names and values within a Hashtable.

Aliases None
Required? true
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-Hostname <Object>

The destination appliance to process the request. When specifying a Value, it must match the HostName attribute of a valid HPOneView.Appliance.Connection object within the Global $ConnectedSessions variable. If no match is found, or no HPOneView.Appliance.Connection objects exist, an error will be thrown.

Default Value: All valid Appliance Connections within $Global:ConnectedSessions

Aliases Appliance, ApplianceConnection
Required? true
Position? named
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? false
Accept wildcard characters?    False

-OverrideContentType <String>

Workaround to override ContentType where needed (e.g. PATCH /rest/scopes/{GUID}.

Aliases None
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-OverrideTimeout <Int>

Specify to override the HttpWebRequest syncronous timeout being made.

Aliases None
Required? false
Position? 7
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-body <Object>

Body for the request. Required if the method is POST or PUT.

Aliases None
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-count <Int32>

For GETs on resource collections, this specifies the number of collection members to return. If not specified, all members of the collection are returned from this function.

Aliases None
Required? true
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters?    False

-method <String>

The request HTTP Method.

* "GET" (default) to get a resource from the appliance (read)
* "POST" to create a new resource
* "PUT" to modify a resource (write)
* "PATCH" to modify a resource (write), with specific attributes set to values, other attributes should be set to $null.
* "DELETE" to delete a resource
Aliases None
Required? true
Position? 1
Default value GET
Accept pipeline input? false
Accept wildcard characters?    False

-start <Int32>

For GETs on resource collections, this specifies the starting index in the collection. If not specified, collection members starting from the beginning are returned.

Aliases None
Required? true
Position? 3
Default value 0
Accept pipeline input? false
Accept wildcard characters?    False

-uri <String>

The uri that identifies the required resource on the appliance.

Aliases None
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters?    False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

None. You cannot pipe objects to this cmdlet.

Return Values

System.Collections.ArrayList

If collection of resources (.i.e. GET /rest/ethernet-networks)

System.Management.Automation.PSCustomObject

Single object returned from appliance

 If Async task, a Hashtable is returned with the following contents:

     @{
         uri = TaskUri;
         category = "tasks";
         type = "TaskResourceV2";
         taskState = "New";
         resource = @{};
     }

System.Management.Automation.PSCustomObject

If no resources are found, a PsCustomObject is returned that contains:

     @{
         statusCode = [int]HTTP Status Code;
         statusMessage = [string]HTTP Status Message;
         lastCall = [string]URI;
     }

Examples

 -------------------------- EXAMPLE 1 --------------------------

Send-HPOVRequest "/rest/enclosures"

Returns all the enclosure objects managed by the appliance.

 -------------------------- EXAMPLE 2 --------------------------

$e = Send-HPOVRequest "/rest/enclosures/SGH2X6J1" -Appliance MyAppliance.domain.com $e.name = "New Name" Send-HPOVRequest $e.uri "PUT" $e -Appliance MyAppliance.domain.com

Updates the name of the enclosure object specified by the uri and Appliance Connection name.

Related Links


Top

HPE OneView 4.00 Library

Send-HPOVRequest

Sends a request to the management appliance

SYNTAX

Send-HPOVRequest [-uri] <String> [-method] <String> [-body] <Object> [-start] <Int32> [-count] <Int32> [-AddHeader] <Hashtable>[ [-OverrideContentType] <String>][ [-OverrideTimeout] <Int>] [-Hostname] <Object> [<CommonParameters>]

Detailed Description

Receives the request input, properly constructs and formats the request header and body and sends the request to the management appliance. This is the main cmdlet that interacts with the appliance.

The message body can contain valid JSON data, with the correct URI and accepted HTTP method accepted by the target resource manager. Please see the on-appliance Resource Model for more information (https://[appliance_IP]/help/cic/en/content/images/api/.)

Parameters

-AddHeader <Hashtable>

If additional headers are needed/required than the defaults, include header names and values within a Hashtable.

Aliases None
Required? true
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-Hostname <Object>

The destination appliance to process the request. When specifying a Value, it must match the HostName attribute of a valid HPOneView.Appliance.Connection object within the Global $ConnectedSessions variable. If no match is found, or no HPOneView.Appliance.Connection objects exist, an error will be thrown.

Default Value: All valid Appliance Connections within $Global:ConnectedSessions

Aliases Appliance, ApplianceConnection
Required? true
Position? named
Default value (${Global:ConnectedSessions} | ? Default)
Accept pipeline input? false
Accept wildcard characters?    False

-OverrideContentType <String>

Workaround to override ContentType where needed (e.g. PATCH /rest/scopes/{GUID}.

Aliases None
Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-OverrideTimeout <Int>

Specify to override the HttpWebRequest syncronous timeout being made.

Aliases None
Required? false
Position? 7
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-body <Object>

Body for the request. Required if the method is POST or PUT.

Aliases None
Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters?    False

-count <Int32>

For GETs on resource collections, this specifies the number of collection members to return. If not specified, all members of the collection are returned from this function.

Aliases None
Required? true
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters?    False

-method <String>

The request HTTP Method.

* "GET" (default) to get a resource from the appliance (read)
* "POST" to create a new resource
* "PUT" to modify a resource (write)
* "PATCH" to modify a resource (write), with specific attributes set to values, other attributes should be set to $null.
* "DELETE" to delete a resource
Aliases None
Required? true
Position? 1
Default value GET
Accept pipeline input? false
Accept wildcard characters?    False

-start <Int32>

For GETs on resource collections, this specifies the starting index in the collection. If not specified, collection members starting from the beginning are returned.

Aliases None
Required? true
Position? 3
Default value 0
Accept pipeline input? false
Accept wildcard characters?    False

-uri <String>

The uri that identifies the required resource on the appliance.

Aliases None
Required? true
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters?    False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)

Input Types

None. You cannot pipe objects to this cmdlet.

Return Values

System.Collections.ArrayList

If collection of resources (.i.e. GET /rest/ethernet-networks)

System.Management.Automation.PSCustomObject

Single object returned from appliance

 If Async task, a Hashtable is returned with the following contents:

     @{
         uri = TaskUri;
         category = "tasks";
         type = "TaskResourceV2";
         taskState = "New";
         resource = @{};
     }

System.Management.Automation.PSCustomObject

If no resources are found, a PsCustomObject is returned that contains:

     @{
         statusCode = [int]HTTP Status Code;
         statusMessage = [string]HTTP Status Message;
         lastCall = [string]URI;
     }

Examples

 -------------------------- EXAMPLE 1 --------------------------

Send-HPOVRequest "/rest/enclosures"

Returns all the enclosure objects managed by the appliance.

 -------------------------- EXAMPLE 2 --------------------------

$e = Send-HPOVRequest "/rest/enclosures/SGH2X6J1" -Appliance MyAppliance.domain.com $e.name = "New Name" Send-HPOVRequest $e.uri "PUT" $e -Appliance MyAppliance.domain.com

Updates the name of the enclosure object specified by the uri and Appliance Connection name.

Related Links


Top
⚠️ **GitHub.com Fallback** ⚠️