< Back

Start-CBOrder

Mon Jan 13, 2020 3:31 am

NAME Start-CBOrder



SYNOPSIS

Starts an order in CloudBolt.





SYNTAX

Start-CBOrder [-Session] <Object> [-GroupID] <Int32> [-BlueprintID] <Int32> [[-BuildItemParameter] <Hashtable>]

[[-Name] <String>] [[-ResourceName] <String>] [[-ResourceParameter] <Hashtable>] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

The `Start-CBOrder` function creates an order in CloudBolt and submits/starts it. You can use `Wait-CBOrder` to

wait for the order to complete.



Pass a session object to the CloudBolt instance to use to the `Session` parameter (use `New-CBSession` to create a

session object). Pass the ID of the group making the order to the `GroupID` parameter. Pass the blueprint ID to

order to the `BlueprintID` parameter. If the build item being run by the blueprint has any parameters, pass them

as a hashtable to the `BuildItemParameter`. Pass a name for the order to the `Name` parameter. Pass the name of

the blueprint's resource (if any) to the `ResourceName` parameter. Pass any resource parameters as a hashtable to

the `ResourceParameter` function.



The request body generated by this function is visible in debug output. Set `$DebugPreference = 'Continue'` to see

it.



This function returns an order object that you can pass to `Wait-CBOrder` to block/wait for the order to complet

before continuing your script.





PARAMETERS

-Session <Object>

The session/connecton to the CloudBolt instance to use. Use `New-CBSession` to create a session object.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-GroupID <Int32>

The group ID making the order.



Required? true

Position? 2

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-BlueprintID <Int32>

The blueprint ID to order.



Required? true

Position? 3

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-BuildItemParameter <Hashtable>

Any build item parameters. The keys should be the names of the items (without the `build-item` prefix). The

values should be a hashtable of name/value pairs to send to that action/item.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

A name for the order.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceName <String>

The resource name used by the blueprint, if any.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceParameter <Hashtable>

The resource parameter for the blueprint's resource, if any.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



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



PS C:\\>Start-CBOrder -Session $session -GroupID 389 -BlueprintID 392



Demonstrates how to create and start an order by group `389` that uses bluerint `392`. This blueprint has no

parameters/resources.



Start-CBOrder -Session $session -GroupID 389 -BlueprintID 393 -BuildItemParameter @{ 'fubar' = @{ 'snafu' =

'ufans' } } -ResourceName 'some_resource' -ResourceParameter @{ 'fizz' = 'buzz' }



Demonstrates how co create and submit an order that requires build and resource parameters. In this example, the

request body will look something like this:



{

"group": "/api/v2/groups/389",

"items": {

"deploy-items": [

{

"blueprint": "/api/v2/blueprints/393",

"blueprint-items-arguments": {

"build-item-fubar": {

"parameters": {

"snafu": "ufans"

}

}

},

"resource-name": "some_resource",

"resource-parameters": {

"fizz": "buzz"

}

}

]

},

"submit-now": "true"

}











RELATED LINKS