VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

rest apis for appliance _powercli

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)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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
Jump to solution

That seems to be correct.

Doesn't it work for you?


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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

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.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

jvm2016
Hot Shot
Hot Shot
Jump to solution

thanks .actually using get-ciservice ...

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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

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

pastedImage_0.png

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

just thpught of asking where should be http in this diagram

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

thanks Luc.

Reply
0 Kudos