cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5254
Views
0
Helpful
1
Replies

How to use wildcards in REST filter for subscription items

devmandan
Level 1
Level 1

I am following this documentation:

String column filters

Support % (starts with) operator.

Support * (Contains) operator.

Does not support (ends with) operator.

Examples:

Name=service*

Name=*g*

Name=*g -- not allowed

REST URL:

http://<ServerURL>/RequestCenter/nsapi/serviceitems/serviceitemsubscription/<columnName>=<wildcardValue>

I can get filters to work without wildcards, but have had no success using '*' or '%' characters.  Please provide a properly encoded sample URL for

ServiceItemTypeName starting with 'Virtual'.  I have not been able to get any data returned when using wildcards in a filter.

Here is what I have tried:

ServiceItemTypeName=Virtual Server Snapshot

http://10.8.0.46:8080/RequestCenter/nsapi/serviceitems/serviceitemsubscription/ServiceItemTypeName=Virtual%20Server%20Snapshot

response: 200

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AllServiceItems totalCount="1" recordSize="1" startRow="1">

literal works as expected

ServiceItemTypeName=Virtual%

http://10.8.0.46:8080/RequestCenter/nsapi/serviceitems/serviceitemsubscription/ServiceItemTypeName=Virtual%25

Application-Type=application/xml

response: 200

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><AllServiceItems totalCount="0" recordSize="0" startRow="1"/>

expected result not returned

ServiceItemTypeName=Virtual*

http://10.8.0.46:8080/RequestCenter/nsapi/serviceitems/serviceitemsubscription/ServiceItemTypeName=Virtual*

Application-Type=application/xml

500

<nsapi-error-response>Internal Error: Invalid parameter values specified or unexpected error.</nsapi-error-response>

fails with error response

1 Accepted Solution

Accepted Solutions

Mark Swanborough
Cisco Employee
Cisco Employee

Hi Dan,

I don't think you can use wild cards here.

Please see the Integration Guide for 9.4. Section: "REST API -> Quick Reference".

Here you'll find a table of what features are supported for the different resources exposed by the API. In there you will find a row for "All Service Items", and you'll see that: Get All, Sorting, Paging and All Filters are supported; Wildcards Name Search are not...

When I came accross this same situation, I assumed that I am trying to do a Wildcard Name Search here... and it's not supported. It does, however, work for the other (SI Designer created) columns, which is what I believe the documentation is trying to describe. (Though, personally, I feel this is a bug).

View solution in original post

1 Reply 1

Mark Swanborough
Cisco Employee
Cisco Employee

Hi Dan,

I don't think you can use wild cards here.

Please see the Integration Guide for 9.4. Section: "REST API -> Quick Reference".

Here you'll find a table of what features are supported for the different resources exposed by the API. In there you will find a row for "All Service Items", and you'll see that: Get All, Sorting, Paging and All Filters are supported; Wildcards Name Search are not...

When I came accross this same situation, I assumed that I am trying to do a Wildcard Name Search here... and it's not supported. It does, however, work for the other (SI Designer created) columns, which is what I believe the documentation is trying to describe. (Though, personally, I feel this is a bug).