Hi,
To activate or deactivate a service I am using PAWS API for ControlCenterServices. If I use a wrong node name in the request, the service is responding success. The correct node name is "ciscart23" but I am sending "AAAAciscart23BBBB".
My Question is :
how do I validate the NOdeName if it is wrong ?
Here is my request and response :
POST /controlcenterservice2/services/ControlCenterServices HTTP/1.0
Host:localhost:8443
Authorization: Basic YWRtaW5pc3RyYXRvcjpjMXNjMDEyMw==
Accept: text/*
Content-Length: 501
Content-Type: text/xml
<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'>
<s11:Body>
<ns1:soapDoServiceDeployment xmlns:ns1='http://schemas.cisco.com/ast/soap'>
<ns1:DeploymentServiceRequest>
<ns1:NodeName>AAAAciscart23BBBB</ns1:NodeName>
<ns1:DeployType>UnDeploy</ns1:DeployType>
<ns1:ServiceList>
<ns1:item>Cisco Tftp</ns1:item>
</ns1:ServiceList>
</ns1:DeploymentServiceRequest>
</ns1:soapDoServiceDeployment>
</s11:Body>
</s11:Envelope>
HTTP/1.1 200 OK
Set-Cookie: JSESSIONIDSSO=758C5E55F57735B7B306865F1B662F11; Path=/; Secure; HttpOnly
Set-Cookie: JSESSIONID=D509DE03D95BB8474759AC42F5C47BD5; Path=/controlcenterservice2/; Secure; HttpOnly
X-Frame-Options: SAMEORIGIN
Set-Cookie: SoapSession.id=F291874CAD73F5C1AC1490873662436
Content-Type: text/xml;charset=UTF-8
Date: Thu, 30 Mar 2017 11:34:28 GMT
Connection: close
Server:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:soapDoServiceDeploymentResponse xmlns:ns1="http://schemas.cisco.com/ast/soap">
<ns1:soapDoServiceDeploymentReturn>
<ns1:ReturnCode>0</ns1:ReturnCode>
<ns1:ReasonCode>-1</ns1:ReasonCode>
<ns1:ReasonString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
<ns1:ServiceInfoList>
<ns1:item>
<ns1:ServiceName>Cisco Tftp</ns1:ServiceName>
<ns1:ServiceStatus>Stopped</ns1:ServiceStatus>
<ns1:ReasonCode>-1068</ns1:ReasonCode>
<ns1:ReasonCodeString>Service Not Activated</ns1:ReasonCodeString>
<ns1:StartTime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="1" />
<ns1:UpTime>-1</ns1:UpTime>
</ns1:item>
</ns1:ServiceInfoList>
</ns1:soapDoServiceDeploymentReturn>
</ns1:soapDoServiceDeploymentResponse>
</soapenv:Body>
</soapenv:Envelope>
Regards,
Sitansu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In reality, this is Serviceability XML... And from the way I have always understood it, the APIs for Control Center Services only work on the node that you target with the API call. In other words, the node name is in essence _ignored_ and the action always happens on the node the message is sent to. Not saying, I'm an expert, but that's the way I believe it works and why you don't get an error if the node name doesn't match...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
0 comments
Please sign in to leave a comment.