jvm2016
Hot Shot
Hot Shot

rest apis for appliance _powercli

Jump to solution

Hi Luc,

below is the screenshot from restapi documentation to stop service .do yu think its the correct representation below

pastedImage_0.png

as it shoudbe

$services=get-cisservice -name "com.vmware.appliance.services"

$services.stop("service")

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

No, that is correct.

With POST you are using an URI where the servicename is part of that URI

When using Get-CisService, you are using a method.

Where the name of the service is a parameter to that method.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

9 Replies
LucD
Leadership
Leadership

That seems to be correct.

Doesn't it work for you?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot

pastedImage_0.png

i think it should be like below

POST https://{server}/rest/appliance/services/stop{service}

as stop method needs "service" as parh parameter.

0 Kudos
LucD
Leadership
Leadership

No, that is correct.

With POST you are using an URI where the servicename is part of that URI

When using Get-CisService, you are using a method.

Where the name of the service is a parameter to that method.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

jvm2016
Hot Shot
Hot Shot

thanks .actually using get-ciservice ...

as yu mentioned with post it should be part of uri so it should be correct.

0 Kudos
jvm2016
Hot Shot
Hot Shot

is it  correct to represent in picture wherein the connection from client to server is established using connect-cisserver over http.??

pastedImage_0.png

0 Kudos
LucD
Leadership
Leadership

That is correct.

The Connect-CisServer connects to the vSphere Automation SDK server, which is an endpoint on the vCenter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot

just thpught of asking where should be http in this diagram

0 Kudos
LucD
Leadership
Leadership

Since the calls to the REST API start from your station, it is between your station and the vSphere Automation SDK server endpoint on the vCenter

Note that it is HTTPS not HTTP


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot

thanks Luc.

0 Kudos