Руководство Разработчика для Cisco Cisco Prime Network Services Controller 3.0
Page 14
OL-28369-01
Cookie Response
The response from Prime Network Services Controller will include XML message with the following Xpath
information:
information:
<aaaLogin cookie="testCookie" commCookie="" srcExtSys="0.0.0.0"
destExtSys="0.0.0.0" srcSvc="" destSvc="" response="yes"
outCookie="<real_cookie>" outRefreshPeriod="600" outPriv="admin,read-only"
outDomains="" outChannel="fullssl" outEvtChannel="fullssl"
outSessionId="web_46649" outVersion="3.0(1c)" />
destExtSys="0.0.0.0" srcSvc="" destSvc="" response="yes"
outCookie="<real_cookie>" outRefreshPeriod="600" outPriv="admin,read-only"
outDomains="" outChannel="fullssl" outEvtChannel="fullssl"
outSessionId="web_46649" outVersion="3.0(1c)" />
The response from Prime Network Services Controller will need to be filtered to get the session cookie value, this
is held in the //aaaLogin/@outCookie value.
is held in the //aaaLogin/@outCookie value.
This information for example can be held in a variable called ‘Cookie-Value’ .
This value can then be used on all further session API calls.
For example a call to /service-reg can be made with the following cookie embedded:
<configConfMo cookie="Cookie-Value" inHierarchical="false">
<inConfig>
<orgTenant dn="org-root/org-coke" status="created"/>
</inConfig>
</configConfMo>
<inConfig>
<orgTenant dn="org-root/org-coke" status="created"/>
</inConfig>
</configConfMo>
Data Validation
Prime Network Services Controller validates all configuration information that is entered via the API for each
property, including the data type (such as integer, boolean, or string) and any additional constraints (such as an
integer range or string regular expression). If the information supplied via the API does not meet the requirements
for the specified property, Prime Network Services Controller stops the transaction and issues a failure response.
property, including the data type (such as integer, boolean, or string) and any additional constraints (such as an
integer range or string regular expression). If the information supplied via the API does not meet the requirements
for the specified property, Prime Network Services Controller stops the transaction and issues a failure response.
Event Subscription Methods
When an object is created, changed, or deleted because of a user- or system-initiated action, an event is
generated. Applications can receive Prime Network Services Controller state change information by regular polling
or subscribing to events. Because polling is resource-expensive, event subscription is the preferred method of
notification.
generated. Applications can receive Prime Network Services Controller state change information by regular polling
or subscribing to events. Because polling is resource-expensive, event subscription is the preferred method of
notification.
Event subscription allows a client application to register for event notification from Prime Network Services
Controller. When an event occurs, Prime Network Services Controller sends a notification of the event and its type
to the subscribing client applications. Only
Controller. When an event occurs, Prime Network Services Controller sends a notification of the event and its type
to the subscribing client applications. Only
actual change events are sent, not the object’s unaffected attributes.
This process applies to all object changes in the system.
Subscribing to Event Notification
To subscribe to event notification:
Step 1. Log into Prime Network Services Controller to obtain a valid cookie for event subscription. If you are not
logged in, the event subscription request will be rejected with an error response.
Step 2. Open an HTTP session and keep the session open.
Step 3. Post the eventSubcribe request through the HTTP session as follows:
<eventSubscribe cookie="<real_cookie>"></eventSubscribe>
After Prime Network Services Controller accepts the eventSubscribe request, Prime Network Services
Controller sends all new events as they occur through the HTTP session.
Controller sends all new events as they occur through the HTTP session.
Each event has a unique event identifier (ID). Event IDs operate as counters and are included in all event
notifications. When an event is generated, the event ID counter increments and a new event is assigned a new
event ID. This process enables tracking of events and ensures that no event is missed. If an event is missed by the
client, you can use loggingSyncOcns to retrieve the missed event.
notifications. When an event is generated, the event ID counter increments and a new event is assigned a new
event ID. This process enables tracking of events and ensures that no event is missed. If an event is missed by the
client, you can use loggingSyncOcns to retrieve the missed event.