| 1 |
/* |
|---|
| 2 |
* wsman-epr.i |
|---|
| 3 |
* |
|---|
| 4 |
* end point reference declarations for openwsman swig bindings |
|---|
| 5 |
* |
|---|
| 6 |
* EndPointReference |
|---|
| 7 |
* |
|---|
| 8 |
*/ |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
%rename(EndPointReference) epr_t; |
|---|
| 12 |
%nodefault epr_t; |
|---|
| 13 |
typedef struct { |
|---|
| 14 |
char * address; |
|---|
| 15 |
} epr_t; |
|---|
| 16 |
|
|---|
| 17 |
/* |
|---|
| 18 |
* EndPointReference |
|---|
| 19 |
* |
|---|
| 20 |
* The EndPointReference is a stub to proxy server-side operations |
|---|
| 21 |
* |
|---|
| 22 |
* Each WS-Management operation (Get, Enumerate, Invoke, ...) has an |
|---|
| 23 |
* associated end point reference, providing the actual implementation of |
|---|
| 24 |
* the operation. |
|---|
| 25 |
* |
|---|
| 26 |
*/ |
|---|
| 27 |
%extend epr_t { |
|---|
| 28 |
epr_t( const char *uri, const char *address) { |
|---|
| 29 |
return epr_create( uri, NULL, address); |
|---|
| 30 |
} |
|---|
| 31 |
|
|---|
| 32 |
~epr_t() { |
|---|
| 33 |
epr_destroy( $self ); |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
/* |
|---|
| 37 |
* Add selector as key/value pair |
|---|
| 38 |
* |
|---|
| 39 |
*/ |
|---|
| 40 |
void add_selector(const char *name, const char *text) { |
|---|
| 41 |
epr_add_selector_text($self, name, text); |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
/* |
|---|
| 45 |
* Serialization |
|---|
| 46 |
* |
|---|
| 47 |
*/ |
|---|
| 48 |
int serialize( WsXmlNodeH node, const char *ns, const char *epr_node_name, int embedded) { |
|---|
| 49 |
return epr_serialize(node, ns, epr_node_name, $self, embedded); |
|---|
| 50 |
} |
|---|
| 51 |
|
|---|
| 52 |
/* |
|---|
| 53 |
* Compare two EndPointReferences |
|---|
| 54 |
* |
|---|
| 55 |
*/ |
|---|
| 56 |
int cmp(epr_t *epr2) { |
|---|
| 57 |
return epr_cmp($self, epr2); |
|---|
| 58 |
} |
|---|
| 59 |
|
|---|
| 60 |
/* |
|---|
| 61 |
* String representation (XML syntax) |
|---|
| 62 |
* |
|---|
| 63 |
*/ |
|---|
| 64 |
char *to_xml( const char *ns, const char *epr_node_name) { |
|---|
| 65 |
return epr_to_txt($self, ns, epr_node_name); |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
/* |
|---|
| 69 |
* Number of selectors |
|---|
| 70 |
*/ |
|---|
| 71 |
int selector_count(void) { |
|---|
| 72 |
return epr_selector_count($self); |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
/* |
|---|
| 76 |
* The resource URI associated to this EndPointReference |
|---|
| 77 |
* |
|---|
| 78 |
*/ |
|---|
| 79 |
char *resource_uri(void) { |
|---|
| 80 |
return epr_get_resource_uri($self); |
|---|
| 81 |
} |
|---|
| 82 |
|
|---|
| 83 |
/* |
|---|
| 84 |
* get value of selector by name |
|---|
| 85 |
* |
|---|
| 86 |
*/ |
|---|
| 87 |
char *selector(const char* name) { |
|---|
| 88 |
return wsman_epr_selector_by_name($self, name); |
|---|
| 89 |
} |
|---|
| 90 |
|
|---|
| 91 |
} |
|---|
| 92 |
|
|---|