< Back

Invoke-BMNativeApiMethod

Sun Jan 12, 2020 7:09 pm

NAME Invoke-BMNativeApiMethod



SYNOPSIS

Calls a method on BuildMaster's "native" API.





SYNTAX

Invoke-BMNativeApiMethod [-Session] <Object> [-Name] <String> [[-Method] {Default | Get | Head | Post | Put |

Delete | Trace | Options | Merge | Patch}] [[-Parameter] <Hashtable>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

The `Invoke-BMNativeApiMethod` calls a method on BuildMaster's "native" API. From Inedo:



> This API endpoint should be avoided if there is an alternate API endpoint available, as those are much easier to

use and will likely not change.



In other words, use a native API at your own peril.



When using the `WhatIf` parameter, only web requests that use the `Get` HTTP method are made.





PARAMETERS

-Session <Object>

A session object that represents the BuildMaster instance to use. Use the `New-BMSession` function to create

session objects.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

The name of the API method to use. The list can be found at

http://inedo.com/support/documentation/ ... api/native, or under your local BuildMaster

instance at /reference/api



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Method

The HTTP/web method to use. The default is `GET`.



Required? false

Position? 3

Default value Get

Accept pipeline input? false

Accept wildcard characters? false



-Parameter <Hashtable>

Any parameters to pass to the endpoint. The keys/values are sent in the body of the request as a JSON object.



Required? false

Position? 4

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:\\>Invoke-BMNativeApiMethod -Session $session -Name 'Applications_CreateApplication' -Parameter @{

Application_Name = 'fubar' }



Demonstrates how to call `Invoke-BMNativeApiMethod`. In this example, it is calling the

`Applications_CreateApplication` method to create a new application named `fubar`.











RELATED LINKS