[chef] Re: Re: Re: [Chef] PowerShell or *.bat file with REST API.


Chronological Thread 
  • From: Leonid Medvedev < >
  • To:
  • Subject: [chef] Re: Re: Re: [Chef] PowerShell or *.bat file with REST API.
  • Date: Thu, 26 Feb 2015 23:05:36 +0200

Hello

I tried to write simple scripts which will use REST API and communicate with Chef Server, something like that:

$username = "adminaccount"
$password = "adminaccount"

$basicAuth = ("{0}:{1}" -f $username,$password)
$basicAuth = [System.Text.Encoding]::UTF8.GetBytes($basicAuth)
$basicAuth = [System.Convert]::ToBase64String($basicAuth)
$headers = @{Authorization=("Basic {0}" -f $basicAuth)}

Invoke-RestMethod -Uri https://10.11.48.102/organizations/NAME/license -headers $headers -Method Get

Please suggest examples.
Leonid.


2015-02-23 16:39 GMT+02:00 Mark Pimentel < " target="_blank"> >:
You may be interested in the chef powershell api client POSHChef

On Mon, Feb 23, 2015 at 9:09 AM, Leonid Medvedev < " target="_blank"> > wrote:
Dear all

Do you have any suggestions and examples?

Thanks
Leonid

2015-02-20 23:11 GMT+02:00 Leonid Medvedev < " target="_blank"> >:
Dear all

I am "junior" :) and only start to use Chef. I surprised that this is really smart tool.

I would like to ask you to send me the examples of the scripts in PowerShell or *.bat files with examples of the communication with Chef Server via REST API.

I will be grateful for the support.

Š•hanks in advance
Leonid




--
Thanks,

Mark




Archive powered by MHonArc 2.6.16.

§