Следующие команды предназначены для получения, обновления и публикации данных об инцидентах в HP SM 9.
Каждая команда содержит XPOST. У меня есть сомнения относительно того, почему XPOST используется для всех команд. Таким образом. Я хочу знать, правильны ли команды curl
ниже.
1. Получите список инцидентов, где воздействие = 2 по скручиванию SOAP:
curl -XPOST -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: "RetrieveKeysList"" -H "Authorization: Basic ZmFsY29uOjE="-d "<soapenv:Envelopexmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns='http://schemas.hp.com/SM/7' xmlns:com='http://schemas.hp.com/SM/7/Common' xmlns:xm='http://www.w3.org/2005/05/xmlmime'> <soapenv:Header/> <soapenv:Body> <ns:RetrieveIncidentKeysListRequest ignoreEmptyElements='true'> <ns:model> <ns:keys> </ns:keys> <ns:instance> <Impact>2</Impact> </ns:instance> </ns:model> </ns:RetrieveIncidentKeysListRequest> </soapenv:Body> </soapenv:Envelope>" "http://localhost:13941/SM/7/"
Ответ:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><RetrieveIncidentKeysListResponse message="Success" query="" returnCode="0" schemaRevisionDate="2014-12-07" schemaRevisionLevel="6" status="SUCCESS" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.hp.com/SM/7 /Incident.xsd"><keys><IncidentID type="String">IM10004</IncidentID></keys><keys><IncidentID type="String">IM10036</IncidentID></keys><keys><IncidentID type="String">IM10060</IncidentID></keys><keys><IncidentID type="String">IM10205</IncidentID></keys><keys><IncidentID type="String">IM10206</IncidentID></keys></RetrieveIncidentKeysListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
2. Получить инцидент IM10002 подробно curl SOAP:
curl -XPOST -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: "Retrieve"" -H "Authorization: Basic ZmFsY29uOjE=" -d "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns='http://schemas.hp.com/SM/7' xmlns:com='http://schemas.hp.com/SM/7/Common' xmlns:xm='http://www.w3.org/2005/05/xmlmime'> <soapenv:Header/> <soapenv:Body> <ns:RetrieveIncidentRequest attachmentData='false' attachmentInfo='false' ignoreEmptyElements='true'> <ns:model> <ns:keys query='number="IM10001"'/> </ns:model> <ns:instance /> </ns:RetrieveIncidentRequest> </soapenv:Body> </soapenv:Envelope>" "http://localhost:13941/SM/7/"
Ответ:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><RetrieveIncidentResponse message="Success" returnCode="0" schemaRevisionDate="2014-12-07" schemaRevisionLevel="6" status="SUCCESS" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.hp.com/SM/7 /Incident.xsd"><model><keys><IncidentID type="String">IM10001</IncidentID></keys><instance recordid="IM10001 - Cannot add attachment to OneNote Shared directory." uniquequery="number="IM10001""><IncidentID type="String">IM10001</IncidentID><Category type="String">incident</Category><OpenTime type="DateTime">2013-12-30T03:02:55+00:00</OpenTime><OpenedBy type="String">falcon</OpenedBy><Urgency type="String">3</Urgency><UpdatedTime type="DateTime">2014-11-11T22:08:41+00:00</UpdatedTime><AssignmentGroup type="String">Application</AssignmentGroup><ClosedTime type="DateTime">2014-08-15T04:08:17+00:00</ClosedTime><ClosedBy type="String">Incident.Analyst</ClosedBy><ClosureCode type="String">Diagnosed Successfully</ClosureCode><Description type="Array"><Description type="String">Cannot add attachment to OneNote Shared directory.</Description></Description><Solution type="Array"><Solution type="String">Cleanup the backups in document server, free spaces.</Solution></Solution><Assignee type="String">Change.Analyst</Assignee><Contact type="String">CAFFREY, AARON</Contact><JournalUpdates type="Array"><JournalUpdates type="String">01/15/14 21:05:22 US/Mountain (Jennifer Falcon):</JournalUpdates><JournalUpdates type="String">Assign to Lopez</JournalUpdates></JournalUpdates><Company type="String">advantage</Company><Title type="String">Cannot add attachment to OneNote Shared directory.</Title><UpdatedBy type="String">falcon</UpdatedBy><Status type="String">Closed</Status><Phase type="String">Closure</Phase><Area type="String">failure</Area><Subarea type="String">function or feature not working</Subarea><Impact type="String">3</Impact><Service display="Applications" type="String">Applications</Service></instance></model></RetrieveIncidentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
3. Обновление инцидента IM10002 curl SOAP:
curl -XPOST -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: "Update"" -H "Authorization: Basic ZmFsY29uOjE=" -d "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns='http://schemas.hp.com/SM/7'> <soapenv:Header/> <soapenv:Body> <ns:UpdateIncidentRequest attachmentInfo='false' attachmentData='false' ignoreEmptyElements='true'> <ns:model> <ns:keys> <ns:IncidentID>IM10002</ns:IncidentID> </ns:keys> <ns:instance> <Urgency type='String'>2</Urgency> <ns:JournalUpdates> <ns:JournalUpdates>Another update to the activity log, but reassigning back to the raising group</ns:JournalUpdates> </ns:JournalUpdates> </ns:instance> </ns:model> </ns:UpdateIncidentRequest> </soapenv:Body> </soapenv:Envelope>" "http://localhost:13941/SM/7/"
Ответ:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<UpdateIncidentResponse xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" message="Success" returnCode="0" schemaRevisionDate="2014-12-07" schemaRevisionLevel="6" status="SUCCESS" xsi:schemaLocation="http://schemas.hp.com/SM/7 /Incident.xsd">
<model>
<keys>
<IncidentID type="String">IM10002</IncidentID>
</keys>
<instance recordid="IM10002 - Not able to print due to lack of ink in printer." uniquequery="number="IM10002"">
<IncidentID type="String">IM10002</IncidentID>
<Category type="String">incident</Category>
<OpenTime type="DateTime">2013-12-30T03:07:46+00:00</OpenTime>
<OpenedBy type="String">falcon</OpenedBy>
<Urgency type="String">2</Urgency>
<UpdatedTime type="DateTime">2016-04-22T06:53:09+00:00</UpdatedTime>
<AssignmentGroup type="String">Office Supplies (North America)</AssignmentGroup>
<Description type="Array">
<Description type="String">Seldom ink exist in printer, there's alway error, when printing.111</Description>
</Description>
<Assignee type="String">Change.Coordinator</Assignee>
<Contact type="String">AARON, JIM</Contact>
<JournalUpdates type="Array">
<JournalUpdates type="String">04/22/16 00:53:09 US/Mountain (Jennifer Falcon):</JournalUpdates>
<JournalUpdates type="String">Another update to the activity log, but reassigning back to the raising group</JournalUpdates>
<JournalUpdates type="String">The Incident will be automatically unsuspended at 04/13/16 00:00:00</JournalUpdates>
</JournalUpdates>
<AlertStatus type="String">SLA BREACH</AlertStatus>
<Company type="String">advantage</Company>
<Title type="String">Not able to print due to lack of ink in printer.</Title>
<UpdatedBy type="String">falcon</UpdatedBy>
<Status type="String">Assign</Status>
<Phase type="String">Categorization</Phase>
<Area type="String">access</Area>
<Subarea type="String">authorization error</Subarea>
<Impact type="String">3</Impact>
<Service display="Printing (North America)" type="String">Printing (North America)</Service>
</instance>
</model>
<messages>
<cmn:message type="String">US/Mountain 04/22/16 00:53:09: Incident IM10002 has been updated by falcon</cmn:message>
<cmn:message type="String">Incident record updated.</cmn:message>
</messages>
</UpdateIncidentResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
4. Создать новый инцидент curl SOAP:
curl -XPOST -H "Content-Type: text/xml;charset=UTF-8" -H "SOAPAction: "Create"" -H "Authorization: Basic ZmFsY29uOjE=" -d "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns='http://schemas.hp.com/SM/7' xmlns:com='http://schemas.hp.com/SM/7/Common' xmlns:xm='http://www.w3.org/2005/05/xmlmime'> <soapenv:Header/> <soapenv:Body> <ns:CreateIncidentRequest attachmentInfo='?' attachmentData='?' ignoreEmptyElements='true'> <ns:model> <ns:keys> </ns:keys> <ns:instance> <ns:Category type='String'>incident</ns:Category> <ns:OpenTime type='DateTime'>2013-12-30T03:07:46+00:00</ns:OpenTime> <ns:OpenedBy type='String'>falcon</ns:OpenedBy> <ns:Urgency type='String'>2</ns:Urgency> <ns:AssignmentGroup type='String'>Office Supplies (North America)</ns:AssignmentGroup> <ns:Description type='Array'> <ns:Description type='String'>Seldom ink exist in printer, there's alway error, when printing.11</ns:Description> </ns:Description> <ns:Assignee type='String'>Change.Coordinator</ns:Assignee> <ns:Contact type='String'>AARON, JIM</ns:Contact> <ns:AlertStatus type='String'>SLA BREACH</ns:AlertStatus> <ns:Company type='String'>advantage</ns:Company> <ns:Title type='String'>Not able to print due to lack of ink in printer.</ns:Title> <ns:UpdatedBy type='String'>falcon</ns:UpdatedBy> <ns:Status type='String'>Assign</ns:Status> <ns:Phase type='String'>Categorization</ns:Phase> <ns:Area type='String'>access</ns:Area> <ns:Subarea type='String'>authorization error</ns:Subarea> <ns:Impact type='String'>3</ns:Impact> <ns:Service display='Printing (North America)' type='String'>Printing (North America)</ns:Service> </ns:instance> </ns:model> </ns:CreateIncidentRequest> </soapenv:Body> </soapenv:Envelope>" "http://localhost:13941/SM/7/"
Ответ:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<CreateIncidentResponse xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" message="Success" returnCode="0" schemaRevisionDate="2014-12-07" schemaRevisionLevel="6" status="SUCCESS" xsi:schemaLocation="http://schemas.hp.com/SM/7 /Incident.xsd">
<model>
<keys>
<IncidentID type="String">IM10216</IncidentID>
</keys>
<instance recordid="IM10216 - Not able to print due to lack of ink in printer." uniquequery="number="IM10216"">
<IncidentID type="String">IM10216</IncidentID>
<Category type="String">incident</Category>
<OpenTime type="DateTime">2013-12-30T03:07:46+00:00</OpenTime>
<OpenedBy type="String">falcon</OpenedBy>
<Urgency type="String">2</Urgency>
<UpdatedTime type="DateTime">2016-04-22T06:54:55+00:00</UpdatedTime>
<AssignmentGroup type="String">Office Supplies (North America)</AssignmentGroup>
<Description type="Array">
<Description type="String">Seldom ink exist in printer, there's alway error, when printing.11</Description>
</Description>
<Assignee type="String">Change.Coordinator</Assignee>
<Contact type="String">AARON, JIM</Contact>
<AlertStatus type="String">SLA BREACH</AlertStatus>
<Company type="String">advantage</Company>
<Title type="String">Not able to print due to lack of ink in printer.</Title>
<UpdatedBy type="String">falcon</UpdatedBy>
<Status type="String">Assign</Status>
<Phase type="String">Categorization</Phase>
<Area type="String">access</Area>
<Subarea type="String">authorization error</Subarea>
<Impact type="String">3</Impact>
<Service display="Printing (North America)" type="String">Printing (North America)</Service>
</instance>
</model>
<messages>
<cmn:message type="String">US/Mountain 04/22/16 00:54:55: Incident IM10216 has been opened by falcon</cmn:message>
<cmn:message type="String">Incident "IM10216" added.</cmn:message>
</messages>
</CreateIncidentResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>*