| 1 |
/* |
|---|
| 2 |
* wsman-filter.i |
|---|
| 3 |
* |
|---|
| 4 |
* filter declarations for openwsman swig bindings |
|---|
| 5 |
* |
|---|
| 6 |
*/ |
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
%rename(Filter) filter_t; |
|---|
| 10 |
%nodefault filter_t; |
|---|
| 11 |
typedef struct { |
|---|
| 12 |
char *resultClass; |
|---|
| 13 |
char *assocClass; |
|---|
| 14 |
} filter_t; |
|---|
| 15 |
|
|---|
| 16 |
/* |
|---|
| 17 |
* Filter are evaluated on the server side and help to reduce the amount |
|---|
| 18 |
* of processing and information transport. |
|---|
| 19 |
* |
|---|
| 20 |
* There are five basic ways to filter |
|---|
| 21 |
* * associations |
|---|
| 22 |
* * references |
|---|
| 23 |
* * XPath |
|---|
| 24 |
* * CQL (CIM query language) |
|---|
| 25 |
* * WQL (WS-Management query language) |
|---|
| 26 |
* |
|---|
| 27 |
* Openwsman does not do any filter processing by itself but passes it |
|---|
| 28 |
* to the backend CIMOM. Support for filters and query languages thus |
|---|
| 29 |
* depends on the used CIMOM. |
|---|
| 30 |
* |
|---|
| 31 |
*/ |
|---|
| 32 |
%extend filter_t { |
|---|
| 33 |
filter_t() { |
|---|
| 34 |
return filter_initialize(); |
|---|
| 35 |
} |
|---|
| 36 |
~filter_t() { |
|---|
| 37 |
filter_destroy( $self ); |
|---|
| 38 |
} |
|---|
| 39 |
/* |
|---|
| 40 |
* Set associators filter |
|---|
| 41 |
*/ |
|---|
| 42 |
int associators( epr_t *epr, const char *assocClass, const char *resultClass, |
|---|
| 43 |
const char *role, const char *resultRole, char **resultProp, const int propNum) |
|---|
| 44 |
{ |
|---|
| 45 |
return filter_set_assoc($self, epr, 0, assocClass, resultClass, role, resultRole, resultProp, propNum); |
|---|
| 46 |
} |
|---|
| 47 |
/* |
|---|
| 48 |
* Set references filter |
|---|
| 49 |
*/ |
|---|
| 50 |
int references( epr_t *epr, const char *assocClass, |
|---|
| 51 |
const char *resultClass, const char *role, const char *resultRole, char **resultProp, const int propNum) |
|---|
| 52 |
{ |
|---|
| 53 |
return filter_set_assoc($self, epr, 1, assocClass, resultClass, role, resultRole, resultProp, propNum); |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
/* |
|---|
| 57 |
* Set simple dialect/query filter |
|---|
| 58 |
*/ |
|---|
| 59 |
int simple(const char *dialect, const char *query) { |
|---|
| 60 |
return filter_set_simple($self, dialect, query ); |
|---|
| 61 |
} |
|---|
| 62 |
/* |
|---|
| 63 |
* Set XPath filter |
|---|
| 64 |
*/ |
|---|
| 65 |
int xpath(const char *query) { |
|---|
| 66 |
return filter_set_simple($self, WSM_XPATH_FILTER_DIALECT, query ); |
|---|
| 67 |
} |
|---|
| 68 |
/* |
|---|
| 69 |
* Set CQL (CIM query language) filter |
|---|
| 70 |
*/ |
|---|
| 71 |
int cql(const char *query) { |
|---|
| 72 |
return filter_set_simple($self, WSM_CQL_FILTER_DIALECT, query ); |
|---|
| 73 |
} |
|---|
| 74 |
/* |
|---|
| 75 |
* Set WQL (WS-Management query language) filter |
|---|
| 76 |
*/ |
|---|
| 77 |
int wql(const char *query) { |
|---|
| 78 |
return filter_set_simple($self, WSM_WQL_FILTER_DIALECT, query ); |
|---|
| 79 |
} |
|---|
| 80 |
|
|---|
| 81 |
} |
|---|