Cisco Unity Connection Provisioning Interface (CUPI) API -- Port Groups and Ports

From DocWiki

(Difference between revisions)
Jump to: navigation, search
m (1 revision)
 

Latest revision as of 00:05, 14 December 2010

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation

Contents



About Port Groups and Ports

This page contains information on how to use the API to:

  • List, view, and update port groups
  • List and view ports

Note that ports are read-only resources and cannot be created, updated, or deleted via the API. Port groups also cannot be created or deleted via the API, and only two fields (MwiOnCode & MwiOffCode) can be updated by using the PUT method.


Listing and Viewing

The following is an example of a GET that lists all port groups:

GET http://<connection-server>/vmrest/portgroups


The following is the response from the above GET request:

200
OK
<?xml version="1.0" encoding="UTF-8"?>
<PortGroups total="1">
  <PortGroup>
    <URI>/vmrest/portgroups/035853ce-f4e6-4de2-bda2-84acf827a555</URI>
    <MediaPortGroupTemplateObjectId>90dd306f-b8af-46b6-8289-f13437cc1e5e</MediaPortGroupTemplateObjectId>
    <MediaSwitchObjectId>05186ad4-572c-48d1-aaa6-ac22280c8702</MediaSwitchObjectId>
    <PhoneSystemURI>/vmrest/phonesystems/05186ad4-572c-48d1-aaa6-ac22280c8702</PhoneSystemURI>
    <TelephonyIntegrationMethodEnum>1</TelephonyIntegrationMethodEnum>
    <EnableMWI>true</EnableMWI>
    <DisplayName>PhoneSystem-1</DisplayName>
    <CcmDoAutoFailback>true</CcmDoAutoFailback>
    <MwiOnCode/>
    <MwiOffCode/>
    <MwiRetryCountOnSuccess>0</MwiRetryCountOnSuccess>
    <MwiRetryIntervalOnSuccessMs>5</MwiRetryIntervalOnSuccessMs>
    <ObjectId>035853ce-f4e6-4de2-bda2-84acf827a555</ObjectId>
    <SipTransportProtocolEnum>10</SipTransportProtocolEnum>
    <SipRegisterWithProxyServer>false</SipRegisterWithProxyServer>
    <SipDoAuthenticate>false</SipDoAuthenticate>
    <SkinnyDevicePrefix>test-VI</SkinnyDevicePrefix>
    <MwiMinRequestIntervalMs>0</MwiMinRequestIntervalMs>
    <MwiMaxConcurrentRequests>0</MwiMaxConcurrentRequests>
    <MediaSwitchDisplayName>PhoneSystem</MediaSwitchDisplayName>
    <PortCount>2</PortCount>
    <SipDoSRTP>true</SipDoSRTP>
    <SipTLSModeEnum>11</SipTLSModeEnum>
    <ResetStatusEnum>0</ResetStatusEnum>
  </PortGroup>
</PortGroups>

Sorting can be done on columns that are indexed, such as display name. To retrieve a sorted list of all port groups, add the following query parameter: sort=(column [asc|desc])

For example, to retrieve a list of all port groups sorted by display name in descending order:

GET http://<connection-server>/vmrest/portgroups?sort=(DisplayName%20desc)

To retrieve a specific port group by its object ID:

GET http://<connection-server>/vmrest/portgroups/<objectid>

Similarly, to retrieve a list of all ports, use:

GET http://<connection-server>/vmrest/ports

The following is the response from the above GET request:

200
OK
<?xml version="1.0" encoding="UTF-8"?>
<Ports total="2">
  <Port>
    <URI>/vmrest/ports/2806ecdc-0a3d-43f3-a2c8-93d786fa506b</URI>
    <ObjectId>2806ecdc-0a3d-43f3-a2c8-93d786fa506b</ObjectId>
    <MediaPortGroupObjectId>035853ce-f4e6-4de2-bda2-84acf827a555</MediaPortGroupObjectId>
    <PortGroupURI>/vmrest/portgroups/035853ce-f4e6-4de2-bda2-84acf827a555</PortGroupURI>
    <TelephonyIntegrationMethodEnum>1</TelephonyIntegrationMethodEnum>
    <PortNumInGroup>1</PortNumInGroup>
    <SkinnySecurityModeEnum>0</SkinnySecurityModeEnum>
    <SkinnyDoMediaEncryption>false</SkinnyDoMediaEncryption>
    <VmsServerObjectId>a7ba129e-6420-4d44-b060-93b638ba866a</VmsServerObjectId>
    <HuntOrder>0</HuntOrder>
    <DisplayName>PhoneSystem-1-001</DisplayName>
    <SkinnyDeviceName>test-VI1</SkinnyDeviceName>
    <PimgPortNumber>1</PimgPortNumber>
    <CapAnswer>true</CapAnswer>
    <CapNotification>true</CapNotification>
    <CapMWI>true</CapMWI>
    <CapEnabled>true</CapEnabled>
    <CapDeliverAmis>false</CapDeliverAmis>
    <CapTrapConnection>true</CapTrapConnection>
    <MediaSwitchDisplayName>PhoneSystem</MediaSwitchDisplayName>
    <MediaSwitchObjectId>05186ad4-572c-48d1-aaa6-ac22280c8702</MediaSwitchObjectId>
    <PhoneSystemURI>/vmrest/phonesystems/05186ad4-572c-48d1-aaa6-ac22280c8702</PhoneSystemURI>
    <MediaPortGroupDisplayName>PhoneSystem-1</MediaPortGroupDisplayName>
    <MediaPortGroupEnableMWI>true</MediaPortGroupEnableMWI>
    <MediaPortGroupMwiReqPortSpecific>true</MediaPortGroupMwiReqPortSpecific>
    <SipSendPort>0</SipSendPort>
    <VmsServerName>cuc-install-55</VmsServerName>
  </Port>
  <Port>
    <URI>/vmrest/ports/f87ad180-7d06-48c9-b9bd-e6b5cd2311bc</URI>
    <ObjectId>f87ad180-7d06-48c9-b9bd-e6b5cd2311bc</ObjectId>
    <MediaPortGroupObjectId>035853ce-f4e6-4de2-bda2-84acf827a555</MediaPortGroupObjectId>
    <PortGroupURI>/vmrest/portgroups/035853ce-f4e6-4de2-bda2-84acf827a555</PortGroupURI>
    <TelephonyIntegrationMethodEnum>1</TelephonyIntegrationMethodEnum>
    <PortNumInGroup>2</PortNumInGroup>
    <SkinnySecurityModeEnum>0</SkinnySecurityModeEnum>
    <SkinnyDoMediaEncryption>false</SkinnyDoMediaEncryption>
    <VmsServerObjectId>a7ba129e-6420-4d44-b060-93b638ba866a</VmsServerObjectId>
    <HuntOrder>0</HuntOrder>
    <DisplayName>PhoneSystem-1-002</DisplayName>
    <SkinnyDeviceName>test-VI2</SkinnyDeviceName>
    <PimgPortNumber>2</PimgPortNumber>
    <CapAnswer>true</CapAnswer>
    <CapNotification>true</CapNotification>
    <CapMWI>true</CapMWI>
    <CapEnabled>true</CapEnabled>
    <CapDeliverAmis>false</CapDeliverAmis>
    <CapTrapConnection>true</CapTrapConnection>
    <MediaSwitchDisplayName>PhoneSystem</MediaSwitchDisplayName>
    <MediaSwitchObjectId>05186ad4-572c-48d1-aaa6-ac22280c8702</MediaSwitchObjectId>
    <PhoneSystemURI>/vmrest/phonesystems/05186ad4-572c-48d1-aaa6-ac22280c8702</PhoneSystemURI>
    <MediaPortGroupDisplayName>PhoneSystem-1</MediaPortGroupDisplayName>
    <MediaPortGroupEnableMWI>true</MediaPortGroupEnableMWI>
    <MediaPortGroupMwiReqPortSpecific>true</MediaPortGroupMwiReqPortSpecific>
    <SipSendPort>0</SipSendPort>
    <VmsServerName>cuc-install-55</VmsServerName>
  </Port>
</Ports>

Finally, to retrieve a specific port by its object ID, use:

GET http://<connection-server>/vmrest/ports/<objectid>

Searching

To retrieve a list of port groups or ports that meet a specified search criteria, add the following query parameter to a GET: query=(column [is|startswith] value)

Note that the search column must either be an indexed column or contain boolean values.

For example, to find all port groups with a display name that starts with "PhoneSystem":

GET http://<connection-server>/vmrest/portgroups?query=(displayname%20startswith%20PhoneSystem)


The next example finds all port groups with a EnableMwi that is set to 1 (i.e., enabled):

GET http://<connection-server>/vmrest/portgroups?query=(EnableMWI%20is%201)

Updating

Ports are read-only resources and cannot be updated. Port groups, however, contain two fields, MwiOnCode and MwiOffCode, that can be updated.

The following is an example of a PUT request that modifies these fields of an existing port group:

PUT https://<connection-server>/vmrest/portgroups/<objectid>

<PortGroup>
	<MwiOnCode>678</MwiOnCode>
	<MwiOffCode>876</MwiOffCode>
</PortGroup>


The following is the response from the above PUT request:

204
No Content
null

Rating: 0.0/5 (0 votes cast)

Personal tools