Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/HewlettPackard/POSH-HPEOneView/llms.txt

Use this file to discover all available pages before exploring further.

Synopsis

Creates a new resource on an HPE OneView appliance by sending an HTTP POST to the specified URI.

Syntax

New-OVResource
    [-Uri] <String>
    [-InputObject] <Object>
    [-ApplianceConnection <Object>]
    [<CommonParameters>]

Description

New-OVResource is a low-level cmdlet that issues an HTTP POST to a specified URI with the provided object as the request body. It is the underlying mechanism used by higher-level creation cmdlets such as New-OVNetwork, New-OVStorageVolume, and similar. Use New-OVResource directly when you need to create a resource type that does not have a dedicated named cmdlet.
For most resource types, a dedicated New-OV* or Add-OV* cmdlet exists and is the recommended approach. Use New-OVResource when no dedicated cmdlet is available.

Parameters

Uri
String
required
The REST API URI endpoint to POST to. Must start with /. For example, /rest/ethernet-networks.
InputObject
Object
required
The resource object to create. Accepts pipeline input. Alias: Resource. The object is serialized to JSON and sent as the request body.
ApplianceConnection
Object
The appliance connection object or name. Alias: Appliance. Defaults to the default connection in $ConnectedSessions.

Examples

Create a resource from a hashtable

$networkBody = @{
    type           = 'NetworkV4'
    name           = 'Dev-VLAN-200'
    vlanId         = 200
    purpose        = 'General'
    smartLink      = $true
    privateNetwork = $false
    ethernetNetworkType = 'Tagged'
}

New-OVResource -Uri '/rest/ethernet-networks' -InputObject $networkBody

Create a resource via pipeline

$body = [PSCustomObject]@{
    name        = 'MyScope'
    description = 'Created via New-OVResource'
    type        = 'ScopeV3'
}

$body | New-OVResource -Uri '/rest/scopes'

Output

Returns the created resource object as returned by the appliance (the POST response body).

Build docs developers (and LLMs) love