| 1 |
/* |
|---|
| 2 |
* wsman-soap.i |
|---|
| 3 |
* |
|---|
| 4 |
* soap structure accessors for openwsman swig bindings |
|---|
| 5 |
* |
|---|
| 6 |
*/ |
|---|
| 7 |
|
|---|
| 8 |
%ignore __WsmanFaultCodeTable; |
|---|
| 9 |
%ignore __WsmanFaultDetailTable; |
|---|
| 10 |
|
|---|
| 11 |
%include "wsman-faults.h" |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
%nodefault __WsEnumerateInfo; |
|---|
| 15 |
%rename(EnumerateInfo) __WsEnumerateInfo; |
|---|
| 16 |
struct __WsEnumerateInfo {}; |
|---|
| 17 |
|
|---|
| 18 |
/* |
|---|
| 19 |
* EnumerateInfo contains all information related to an enumeration |
|---|
| 20 |
* request. |
|---|
| 21 |
* |
|---|
| 22 |
* The initial client.enumerate operation only returns a +context+ |
|---|
| 23 |
* which can be used to +pull+ the next enumeration item. This item |
|---|
| 24 |
* contains the next context in the chain. |
|---|
| 25 |
* |
|---|
| 26 |
*/ |
|---|
| 27 |
%extend __WsEnumerateInfo { |
|---|
| 28 |
~__WsEnumerateInfo() { |
|---|
| 29 |
} |
|---|
| 30 |
int max_items() { return $self->maxItems; } |
|---|
| 31 |
#if defined(SWIGRUBY) |
|---|
| 32 |
%rename("max_items=") set_max_items(int mi); |
|---|
| 33 |
#endif |
|---|
| 34 |
/* |
|---|
| 35 |
* Set the maximum number of items returned by this enumeration |
|---|
| 36 |
*/ |
|---|
| 37 |
void set_max_items(int mi) { $self->maxItems = mi; } |
|---|
| 38 |
|
|---|
| 39 |
/* |
|---|
| 40 |
* flags |
|---|
| 41 |
*/ |
|---|
| 42 |
int flags() { |
|---|
| 43 |
return $self->flags; |
|---|
| 44 |
} |
|---|
| 45 |
|
|---|
| 46 |
/* |
|---|
| 47 |
* The URL of the endpoint receiving the enumeration (String) |
|---|
| 48 |
*/ |
|---|
| 49 |
const char *epr_to() { |
|---|
| 50 |
return $self->epr_to; |
|---|
| 51 |
} |
|---|
| 52 |
/* |
|---|
| 53 |
* The URI of the end point reference (String) |
|---|
| 54 |
*/ |
|---|
| 55 |
const char *epr_uri() { |
|---|
| 56 |
return $self->epr_uri; |
|---|
| 57 |
} |
|---|
| 58 |
/* |
|---|
| 59 |
* The current encoding (defaults to 'utf-8') |
|---|
| 60 |
*/ |
|---|
| 61 |
const char *encoding() { |
|---|
| 62 |
return $self->encoding; |
|---|
| 63 |
} |
|---|
| 64 |
/* |
|---|
| 65 |
* The Filter for this enumeration |
|---|
| 66 |
*/ |
|---|
| 67 |
const filter_t *filter() { |
|---|
| 68 |
return $self->filter; |
|---|
| 69 |
} |
|---|
| 70 |
/* |
|---|
| 71 |
* The current index (number of the last returned item) |
|---|
| 72 |
*/ |
|---|
| 73 |
int index() { |
|---|
| 74 |
return $self->index; |
|---|
| 75 |
} |
|---|
| 76 |
#if defined(SWIGRUBY) |
|---|
| 77 |
%rename("index=") set_index(int i); |
|---|
| 78 |
#endif |
|---|
| 79 |
/* |
|---|
| 80 |
* Set a specific index (used to skip ahead) |
|---|
| 81 |
*/ |
|---|
| 82 |
void set_index(int i) { |
|---|
| 83 |
$self->index = i; |
|---|
| 84 |
} |
|---|
| 85 |
/* |
|---|
| 86 |
* The total number of items in this enumeration |
|---|
| 87 |
* |
|---|
| 88 |
* index is the number already returned, this is the total number |
|---|
| 89 |
* |
|---|
| 90 |
*/ |
|---|
| 91 |
int total_items() { |
|---|
| 92 |
return $self->totalItems; |
|---|
| 93 |
} |
|---|
| 94 |
#if defined(SWIGRUBY) |
|---|
| 95 |
%rename("total_items=") set_total_items(int i); |
|---|
| 96 |
#endif |
|---|
| 97 |
void set_total_items(int i) { |
|---|
| 98 |
$self->totalItems = i; |
|---|
| 99 |
} |
|---|
| 100 |
|
|---|
| 101 |
#if defined(SWIGRUBY) |
|---|
| 102 |
VALUE enum_results() { |
|---|
| 103 |
return (VALUE)$self->enumResults; |
|---|
| 104 |
} |
|---|
| 105 |
%rename("enum_results=") set_enum_results(VALUE result); |
|---|
| 106 |
void set_enum_results(VALUE result) { |
|---|
| 107 |
$self->enumResults = (void *)result; |
|---|
| 108 |
} |
|---|
| 109 |
VALUE enum_context() { |
|---|
| 110 |
return (VALUE)$self->appEnumContext; |
|---|
| 111 |
} |
|---|
| 112 |
%rename("enum_context=") set_enum_context(VALUE context); |
|---|
| 113 |
void set_enum_context(VALUE context) { |
|---|
| 114 |
$self->appEnumContext = (void *)context; |
|---|
| 115 |
} |
|---|
| 116 |
#endif |
|---|
| 117 |
/* |
|---|
| 118 |
* XmlDoc representing the result pulled last |
|---|
| 119 |
*/ |
|---|
| 120 |
WsXmlDocH pull_result() { |
|---|
| 121 |
return (WsXmlDocH)$self->pullResultPtr; |
|---|
| 122 |
} |
|---|
| 123 |
#if defined(SWIGRUBY) |
|---|
| 124 |
%rename("pull_result=") set_pull_result(WsXmlDocH result); |
|---|
| 125 |
#endif |
|---|
| 126 |
/* |
|---|
| 127 |
* Set the pull result (XmlDoc) |
|---|
| 128 |
* |
|---|
| 129 |
* Used for server-side plugin extensions |
|---|
| 130 |
* |
|---|
| 131 |
*/ |
|---|
| 132 |
void set_pull_result(WsXmlDocH result) { |
|---|
| 133 |
$self->pullResultPtr = (void *)result; |
|---|
| 134 |
} |
|---|
| 135 |
} |
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
/* |
|---|
| 139 |
* __SoapOp -> SoapOp |
|---|
| 140 |
*/ |
|---|
| 141 |
|
|---|
| 142 |
%nodefault __SoapOp; |
|---|
| 143 |
%rename(SoapOp) __SoapOp; |
|---|
| 144 |
struct __SoapOp {}; |
|---|
| 145 |
|
|---|
| 146 |
/* |
|---|
| 147 |
* SoapOp represents a SOAP operation |
|---|
| 148 |
* |
|---|
| 149 |
*/ |
|---|
| 150 |
%extend __SoapOp { |
|---|
| 151 |
/* |
|---|
| 152 |
* The incoming XmlDoc |
|---|
| 153 |
*/ |
|---|
| 154 |
WsXmlDocH indoc() { |
|---|
| 155 |
return soap_get_op_doc($self, 1); |
|---|
| 156 |
} |
|---|
| 157 |
#if defined(SWIGRUBY) |
|---|
| 158 |
%rename("indoc=") set_indoc( WsXmlDocH doc ); |
|---|
| 159 |
#endif |
|---|
| 160 |
/* |
|---|
| 161 |
* Set the incoming XmlDoc |
|---|
| 162 |
*/ |
|---|
| 163 |
void set_indoc( WsXmlDocH doc ) { |
|---|
| 164 |
soap_set_op_doc( $self, doc, 1 ); |
|---|
| 165 |
} |
|---|
| 166 |
/* |
|---|
| 167 |
* The outgoing XmlDoc |
|---|
| 168 |
*/ |
|---|
| 169 |
WsXmlDocH outdoc() { |
|---|
| 170 |
return soap_get_op_doc($self, 0); |
|---|
| 171 |
} |
|---|
| 172 |
#if defined(SWIGRUBY) |
|---|
| 173 |
%rename("outdoc=") set_outdoc( WsXmlDocH doc ); |
|---|
| 174 |
#endif |
|---|
| 175 |
/* |
|---|
| 176 |
* Set the outgoing XmlDoc |
|---|
| 177 |
*/ |
|---|
| 178 |
void set_outdoc( WsXmlDocH doc ) { |
|---|
| 179 |
soap_set_op_doc( $self, doc, 0 ); |
|---|
| 180 |
} |
|---|
| 181 |
/* |
|---|
| 182 |
* The Soap instance of this operation |
|---|
| 183 |
*/ |
|---|
| 184 |
struct __Soap *soap() { |
|---|
| 185 |
return soap_get_op_soap($self); |
|---|
| 186 |
} |
|---|
| 187 |
/* |
|---|
| 188 |
* The raw (SOAP) message for this operation (opaque pointer |
|---|
| 189 |
* currently) |
|---|
| 190 |
*/ |
|---|
| 191 |
WsmanMessage *msg() { |
|---|
| 192 |
return wsman_get_msg_from_op($self); |
|---|
| 193 |
} |
|---|
| 194 |
/* |
|---|
| 195 |
* The maximum size (on the wire) of this operation |
|---|
| 196 |
*/ |
|---|
| 197 |
unsigned long maxsize(){ |
|---|
| 198 |
return wsman_get_maxsize_from_op($self); |
|---|
| 199 |
} |
|---|
| 200 |
} |
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
/* |
|---|
| 204 |
* __Soap -> Soap |
|---|
| 205 |
*/ |
|---|
| 206 |
|
|---|
| 207 |
%nodefault __Soap; |
|---|
| 208 |
%rename(Soap) __Soap; |
|---|
| 209 |
struct __Soap {}; |
|---|
| 210 |
|
|---|
| 211 |
/* |
|---|
| 212 |
* Soap represents a part of a SoapOp used to create and reference |
|---|
| 213 |
* context information. |
|---|
| 214 |
* |
|---|
| 215 |
* There is no constructor for Soap, use SoapOp.soap to access the |
|---|
| 216 |
* Soap instance associated with a SOAP operation. |
|---|
| 217 |
* |
|---|
| 218 |
*/ |
|---|
| 219 |
%extend __Soap { |
|---|
| 220 |
~__Soap() { |
|---|
| 221 |
soap_destroy($self); |
|---|
| 222 |
} |
|---|
| 223 |
%typemap(newfree) WsContextH "free($1);"; |
|---|
| 224 |
|
|---|
| 225 |
/* |
|---|
| 226 |
* Create a new Context |
|---|
| 227 |
* |
|---|
| 228 |
*/ |
|---|
| 229 |
WsContextH create_context() { |
|---|
| 230 |
return ws_create_context($self); |
|---|
| 231 |
} |
|---|
| 232 |
/* |
|---|
| 233 |
* Get the current Context |
|---|
| 234 |
* |
|---|
| 235 |
*/ |
|---|
| 236 |
WsContextH context() { |
|---|
| 237 |
return ws_get_soap_context($self); |
|---|
| 238 |
} |
|---|
| 239 |
|
|---|
| 240 |
/* |
|---|
| 241 |
* Create a new endpoint Context |
|---|
| 242 |
* |
|---|
| 243 |
*/ |
|---|
| 244 |
WsContextH create_ep_context( WsXmlDocH doc ) { |
|---|
| 245 |
return ws_create_ep_context( $self, doc ); |
|---|
| 246 |
} |
|---|
| 247 |
} |
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 |
/* |
|---|
| 251 |
* WsContext -> Context |
|---|
| 252 |
*/ |
|---|
| 253 |
|
|---|
| 254 |
%rename(Context) _WS_CONTEXT; |
|---|
| 255 |
%nodefault _WS_CONTEXT; |
|---|
| 256 |
struct _WS_CONTEXT {}; |
|---|
| 257 |
typedef struct _WS_CONTEXT* WsContextH; |
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
/* |
|---|
| 261 |
* Context contains all information of an ongoing SOAP operation |
|---|
| 262 |
* |
|---|
| 263 |
* There is no constructor for Context, use Soap.context to get the |
|---|
| 264 |
* current one. |
|---|
| 265 |
* |
|---|
| 266 |
*/ |
|---|
| 267 |
%extend _WS_CONTEXT { |
|---|
| 268 |
~_WS_CONTEXT() { |
|---|
| 269 |
ws_destroy_context($self); |
|---|
| 270 |
} |
|---|
| 271 |
%typemap(newfree) WsXmlDocH "ws_xml_destroy_doc($1);"; |
|---|
| 272 |
/* |
|---|
| 273 |
* The incoming XmlDoc |
|---|
| 274 |
*/ |
|---|
| 275 |
WsXmlDocH indoc() { |
|---|
| 276 |
return $self->indoc; |
|---|
| 277 |
} |
|---|
| 278 |
/* |
|---|
| 279 |
* Get the Soap runtime environment |
|---|
| 280 |
* |
|---|
| 281 |
*/ |
|---|
| 282 |
struct __Soap *runtime() { |
|---|
| 283 |
return ws_context_get_runtime($self); |
|---|
| 284 |
} |
|---|
| 285 |
#if defined(SWIGRUBY) |
|---|
| 286 |
%rename("enum_idle_timeout=") set_enumIdleTimeout(unsigned long timeout); |
|---|
| 287 |
#endif |
|---|
| 288 |
/* |
|---|
| 289 |
* Set the idle timeout for enumerations |
|---|
| 290 |
*/ |
|---|
| 291 |
void set_enumIdleTimeout(unsigned long timeout) { |
|---|
| 292 |
ws_set_context_enumIdleTimeout($self, timeout); |
|---|
| 293 |
} |
|---|
| 294 |
/* |
|---|
| 295 |
* The class name (String) |
|---|
| 296 |
*/ |
|---|
| 297 |
const char *classname() { |
|---|
| 298 |
return wsman_get_class_name($self); |
|---|
| 299 |
} |
|---|
| 300 |
/* |
|---|
| 301 |
* The method name (String) |
|---|
| 302 |
*/ |
|---|
| 303 |
const char *method() { |
|---|
| 304 |
return wsman_get_method_name($self); |
|---|
| 305 |
} |
|---|
| 306 |
/* |
|---|
| 307 |
* The method arguments (Hash) |
|---|
| 308 |
*/ |
|---|
| 309 |
hash_t *method_args(const char *resource_uri) { |
|---|
| 310 |
return wsman_get_method_args($self, resource_uri); |
|---|
| 311 |
} |
|---|
| 312 |
int max_elements(WsXmlDocH doc = NULL) { |
|---|
| 313 |
return wsman_get_max_elements($self, doc); |
|---|
| 314 |
} |
|---|
| 315 |
unsigned long max_envelope_size(WsXmlDocH doc = NULL) { |
|---|
| 316 |
return wsman_get_max_envelope_size($self, doc); |
|---|
| 317 |
} |
|---|
| 318 |
const char *fragment_string(WsXmlDocH doc = NULL) { |
|---|
| 319 |
return wsman_get_fragment_string($self, doc); |
|---|
| 320 |
} |
|---|
| 321 |
const char *selector(WsXmlDocH doc, const char *name, int index) { |
|---|
| 322 |
return wsman_get_selector($self, doc, name, index); |
|---|
| 323 |
} |
|---|
| 324 |
hash_t *selectors_from_epr(WsXmlNodeH epr_node) { |
|---|
| 325 |
return wsman_get_selectors_from_epr($self, epr_node); |
|---|
| 326 |
} |
|---|
| 327 |
hash_t *selectors(WsXmlDocH doc = NULL) { |
|---|
| 328 |
return wsman_get_selector_list($self, doc); |
|---|
| 329 |
} |
|---|
| 330 |
hash_t *selectors_from_filter(WsXmlDocH doc = NULL) { |
|---|
| 331 |
return wsman_get_selector_list_from_filter($self, doc); |
|---|
| 332 |
} |
|---|
| 333 |
const char *action(WsXmlDocH doc = NULL) { |
|---|
| 334 |
return wsman_get_action($self, doc); |
|---|
| 335 |
} |
|---|
| 336 |
const char *resource_uri(WsXmlDocH doc = NULL) { |
|---|
| 337 |
return wsman_get_resource_uri($self, doc); |
|---|
| 338 |
} |
|---|
| 339 |
const char *option_set(WsXmlDocH doc, const char *op) { |
|---|
| 340 |
return wsman_get_option_set($self, doc, op); |
|---|
| 341 |
} |
|---|
| 342 |
int parse_enum_request(WsEnumerateInfo *enumInfo) { |
|---|
| 343 |
return wsman_parse_enum_request( $self, enumInfo); |
|---|
| 344 |
} |
|---|
| 345 |
|
|---|
| 346 |
} |
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
/* |
|---|
| 350 |
* WsmanStatus -> Status |
|---|
| 351 |
*/ |
|---|
| 352 |
|
|---|
| 353 |
%nodefault _WsmanStatus; |
|---|
| 354 |
%rename(Status) _WsmanStatus; |
|---|
| 355 |
struct _WsmanStatus {}; |
|---|
| 356 |
|
|---|
| 357 |
/* |
|---|
| 358 |
* Status |
|---|
| 359 |
* |
|---|
| 360 |
*/ |
|---|
| 361 |
%extend _WsmanStatus { |
|---|
| 362 |
/* |
|---|
| 363 |
* Create an empty status |
|---|
| 364 |
* |
|---|
| 365 |
*/ |
|---|
| 366 |
_WsmanStatus() { |
|---|
| 367 |
WsmanStatus *s = (WsmanStatus *)malloc(sizeof(WsmanStatus)); |
|---|
| 368 |
wsman_status_init(s); |
|---|
| 369 |
return s; |
|---|
| 370 |
} |
|---|
| 371 |
~_WsmanStatus() { |
|---|
| 372 |
if ($self->fault_msg) free($self->fault_msg); |
|---|
| 373 |
free($self); |
|---|
| 374 |
} |
|---|
| 375 |
/* |
|---|
| 376 |
* String representation (returns the fault message) |
|---|
| 377 |
*/ |
|---|
| 378 |
const char *to_s() { |
|---|
| 379 |
return $self->fault_msg; |
|---|
| 380 |
} |
|---|
| 381 |
#if defined(SWIGRUBY) |
|---|
| 382 |
%rename("code=") set_code(int code); |
|---|
| 383 |
#endif |
|---|
| 384 |
/* |
|---|
| 385 |
* Set the fault code |
|---|
| 386 |
*/ |
|---|
| 387 |
void set_code(int code) { $self->fault_code = code; } |
|---|
| 388 |
/* |
|---|
| 389 |
* Get the fault code |
|---|
| 390 |
*/ |
|---|
| 391 |
int code() { |
|---|
| 392 |
return $self->fault_code; |
|---|
| 393 |
} |
|---|
| 394 |
#if defined(SWIGRUBY) |
|---|
| 395 |
%rename("detail=") set_detail(int detail); |
|---|
| 396 |
#endif |
|---|
| 397 |
/* |
|---|
| 398 |
* Set the fault detail code |
|---|
| 399 |
* |
|---|
| 400 |
*/ |
|---|
| 401 |
void set_detail(int detail) { $self->fault_detail_code = detail; } |
|---|
| 402 |
int detail() { |
|---|
| 403 |
return $self->fault_detail_code; |
|---|
| 404 |
} |
|---|
| 405 |
#if defined(SWIGRUBY) |
|---|
| 406 |
%rename("msg=") set_msg(const char *msg); |
|---|
| 407 |
#endif |
|---|
| 408 |
/* |
|---|
| 409 |
* Set the fault message |
|---|
| 410 |
* |
|---|
| 411 |
*/ |
|---|
| 412 |
void set_msg(const char *msg) { |
|---|
| 413 |
if (msg) |
|---|
| 414 |
$self->fault_msg = strdup(msg); |
|---|
| 415 |
else |
|---|
| 416 |
$self->fault_msg = NULL; |
|---|
| 417 |
} |
|---|
| 418 |
const char *msg() { |
|---|
| 419 |
return $self->fault_msg; |
|---|
| 420 |
} |
|---|
| 421 |
|
|---|
| 422 |
%typemap(newfree) WsXmlDocH "ws_xml_destroy_doc($1);"; |
|---|
| 423 |
/* |
|---|
| 424 |
* Create a new fault XmlDoc |
|---|
| 425 |
* |
|---|
| 426 |
*/ |
|---|
| 427 |
WsXmlDocH generate_fault(WsXmlDocH doc) { |
|---|
| 428 |
return wsman_generate_fault( doc, $self->fault_code, $self->fault_detail_code, $self->fault_msg); |
|---|
| 429 |
} |
|---|
| 430 |
} |
|---|
| 431 |
|
|---|
| 432 |
/* |
|---|
| 433 |
* WsManFault -> Fault |
|---|
| 434 |
*/ |
|---|
| 435 |
|
|---|
| 436 |
%nodefault _WsManFault; |
|---|
| 437 |
%rename(Fault) _WsManFault; |
|---|
| 438 |
struct _WsManFault {}; |
|---|
| 439 |
|
|---|
| 440 |
/* |
|---|
| 441 |
* Fault |
|---|
| 442 |
* |
|---|
| 443 |
*/ |
|---|
| 444 |
%extend _WsManFault { |
|---|
| 445 |
_WsManFault() { |
|---|
| 446 |
return wsmc_fault_new(); |
|---|
| 447 |
} |
|---|
| 448 |
~_WsManFault() { |
|---|
| 449 |
wsmc_fault_destroy($self); |
|---|
| 450 |
} |
|---|
| 451 |
const char *code() { |
|---|
| 452 |
return $self->code; |
|---|
| 453 |
} |
|---|
| 454 |
const char *subcode() { |
|---|
| 455 |
return $self->subcode; |
|---|
| 456 |
} |
|---|
| 457 |
const char *reason() { |
|---|
| 458 |
return $self->reason; |
|---|
| 459 |
} |
|---|
| 460 |
const char *detail() { |
|---|
| 461 |
return $self->fault_detail; |
|---|
| 462 |
} |
|---|
| 463 |
} |
|---|