openwsman 2.4.1 → 2.4.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/openwsman/extconf.rb +6 -0
- data/ext/openwsman/openwsman.i +595 -0
- data/ext/openwsman/version.i +11 -0
- data/ext/openwsman/wsman-client.i +603 -0
- data/ext/openwsman/wsman-client_opt.i +649 -0
- data/ext/openwsman/wsman-epr.i +288 -0
- data/ext/openwsman/wsman-filter.i +190 -0
- data/ext/openwsman/wsman-names.i +61 -0
- data/ext/openwsman/wsman-soap.i +733 -0
- data/ext/openwsman/wsman-transport.i +636 -0
- data/ext/openwsman/wsman-xml.i +851 -0
- data/lib/openwsman/version.rb +1 -1
- metadata +50 -35
- data/ext/openwsman/openwsman_wrap.c +0 -13912
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
* wsman-names.i
|
3
|
+
* constant definitions for openwsman swig bindings
|
4
|
+
*
|
5
|
+
*/
|
6
|
+
|
7
|
+
%include "wsman-names.h"
|
8
|
+
|
9
|
+
/* redefine enums here, these aren't recognized as constants by swig */
|
10
|
+
|
11
|
+
#define FLAG_NONE 0x0000
|
12
|
+
#define FLAG_ENUMERATION_COUNT_ESTIMATION 0x0001
|
13
|
+
/* Optimize enumeration, return actual data instead of context */
|
14
|
+
#define FLAG_ENUMERATION_OPTIMIZATION 0x0002
|
15
|
+
/* Return endpoint references in enumeration */
|
16
|
+
#define FLAG_ENUMERATION_ENUM_EPR 0x0004
|
17
|
+
#define FLAG_ENUMERATION_ENUM_OBJ_AND_EPR 0x0008
|
18
|
+
/* Dump the request XML to stderr (debug) */
|
19
|
+
#define FLAG_DUMP_REQUEST 0x0010
|
20
|
+
#define FLAG_INCLUDESUBCLASSPROPERTIES 0x0020
|
21
|
+
#define FLAG_EXCLUDESUBCLASSPROPERTIES 0x0040
|
22
|
+
#define FLAG_POLYMORPHISM_NONE 0x0080
|
23
|
+
#define FLAG_MUND_MAX_ESIZE 0x0100
|
24
|
+
#define FLAG_MUND_LOCALE 0x0200
|
25
|
+
#define FLAG_MUND_OPTIONSET 0x0400
|
26
|
+
#define FLAG_MUND_FRAGMENT 0x0800
|
27
|
+
#define FLAG_CIM_EXTENSIONS 0x1000
|
28
|
+
#define FLAG_CIM_REFERENCES 0x2000
|
29
|
+
#define FLAG_CIM_ASSOCIATORS 0x4000
|
30
|
+
#define FLAG_EVENT_SENDBOOKMARK 0X8000
|
31
|
+
#define FLAG_CIM_SCHEMA_OPT 0X10000
|
32
|
+
|
33
|
+
/* Indication delivery modes */
|
34
|
+
|
35
|
+
#define WSMAN_DELIVERY_PUSH 0
|
36
|
+
#define WSMAN_DELIVERY_PUSHWITHACK 1
|
37
|
+
#define WSMAN_DELIVERY_EVENTS 2
|
38
|
+
#define WSMAN_DELIVERY_PULL 3
|
39
|
+
|
40
|
+
/* Authentication methods */
|
41
|
+
|
42
|
+
#define WS_NO_AUTH 0
|
43
|
+
#define WS_BASIC_AUTH 1
|
44
|
+
#define WS_DIGEST_AUTH 2
|
45
|
+
#define WS_PASS_AUTH 3
|
46
|
+
#define WS_NTLM_AUTH 4
|
47
|
+
#define WS_GSSNEGOTIATE_AUTH 5
|
48
|
+
#define WS_MAX_AUTH 6
|
49
|
+
|
50
|
+
/* delivery security mode */
|
51
|
+
#define WSMAN_DELIVERY_SEC_AUTO 0
|
52
|
+
#define WSMAN_DELIVERY_SEC_HTTP_BASIC 1
|
53
|
+
#define WSMAN_DELIVERY_SEC_HTTP_DIGEST 2
|
54
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_BASIC 3
|
55
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_DIGEST 4
|
56
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_MUTUAL 5
|
57
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_MUTUAL_BASIC 6
|
58
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_MUTUAL_DIGEST 7
|
59
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_SPNEGO_KERBEROS 8
|
60
|
+
#define WSMAN_DELIVERY_SEC_HTTPS_MUTUAL_SPNEGO_KERBEROS 9
|
61
|
+
#define WSMAN_DELIVERY_SEC_HTTP_SPNEGO_KERBEROS 10
|
@@ -0,0 +1,733 @@
|
|
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
|
+
* Document-class: EnumerateInfo
|
20
|
+
*
|
21
|
+
* EnumerateInfo contains all information related to an enumeration
|
22
|
+
* request.
|
23
|
+
*
|
24
|
+
* The initial client.enumerate operation only returns a +context+
|
25
|
+
* (String) which can be used to +pull+ the next enumeration item.
|
26
|
+
* This item contains the next context in the chain.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
%extend __WsEnumerateInfo {
|
30
|
+
~__WsEnumerateInfo() {
|
31
|
+
}
|
32
|
+
/*
|
33
|
+
* Return the maximum number of items that will be returned by this enumeration
|
34
|
+
* call-seq:
|
35
|
+
* enumerate_info.max_items -> Integer
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
int max_items() { return $self->maxItems; }
|
39
|
+
#if defined(SWIGRUBY)
|
40
|
+
%rename("max_items=") set_max_items(int mi);
|
41
|
+
#endif
|
42
|
+
/*
|
43
|
+
* Set the maximum number of items returned by this enumeration
|
44
|
+
* call-seq:
|
45
|
+
* enumerate_info.max_items = 100
|
46
|
+
*
|
47
|
+
*/
|
48
|
+
void set_max_items(int mi) { $self->maxItems = mi; }
|
49
|
+
|
50
|
+
/*
|
51
|
+
* enumeration flags
|
52
|
+
* call-seq:
|
53
|
+
* enumerate_info.flags -> Integer
|
54
|
+
*
|
55
|
+
*/
|
56
|
+
int flags() {
|
57
|
+
return $self->flags;
|
58
|
+
}
|
59
|
+
|
60
|
+
/*
|
61
|
+
* The URL of the endpoint receiving the enumeration
|
62
|
+
* call-seq:
|
63
|
+
* enumerate_info.epr_to -> String
|
64
|
+
*
|
65
|
+
*/
|
66
|
+
const char *epr_to() {
|
67
|
+
return $self->epr_to;
|
68
|
+
}
|
69
|
+
/*
|
70
|
+
* The URI of the end point reference
|
71
|
+
* call-seq:
|
72
|
+
* enumerate_info.epr_uri -> String
|
73
|
+
*
|
74
|
+
*/
|
75
|
+
const char *epr_uri() {
|
76
|
+
return $self->epr_uri;
|
77
|
+
}
|
78
|
+
/*
|
79
|
+
* The current encoding (defaults to 'utf-8')
|
80
|
+
* call-seq:
|
81
|
+
* enumerate_info.encoding -> String
|
82
|
+
*
|
83
|
+
*/
|
84
|
+
const char *encoding() {
|
85
|
+
return $self->encoding;
|
86
|
+
}
|
87
|
+
/*
|
88
|
+
* The Filter for this enumeration
|
89
|
+
* call-seq:
|
90
|
+
* enumerate_info.filter -> Openwsman::Filter
|
91
|
+
*
|
92
|
+
*/
|
93
|
+
const filter_t *filter() {
|
94
|
+
return $self->filter;
|
95
|
+
}
|
96
|
+
/*
|
97
|
+
* The current index (number of the last returned item)
|
98
|
+
* call-seq:
|
99
|
+
* enumerate_info.index -> Integer
|
100
|
+
*
|
101
|
+
*/
|
102
|
+
int index() {
|
103
|
+
return $self->index;
|
104
|
+
}
|
105
|
+
#if defined(SWIGRUBY)
|
106
|
+
%rename("index=") set_index(int i);
|
107
|
+
#endif
|
108
|
+
/*
|
109
|
+
* Set a specific index (used to skip ahead)
|
110
|
+
* call-seq:
|
111
|
+
* enumerate_info.index = 42
|
112
|
+
*
|
113
|
+
*/
|
114
|
+
void set_index(int i) {
|
115
|
+
$self->index = i;
|
116
|
+
}
|
117
|
+
/*
|
118
|
+
* The total number of items in this enumeration
|
119
|
+
*
|
120
|
+
* index is the number already returned, this is the total number
|
121
|
+
* call-seq:
|
122
|
+
* enumerate_info.total_items -> Integer
|
123
|
+
*
|
124
|
+
*/
|
125
|
+
int total_items() {
|
126
|
+
return $self->totalItems;
|
127
|
+
}
|
128
|
+
#if defined(SWIGRUBY)
|
129
|
+
%rename("total_items=") set_total_items(int i);
|
130
|
+
#endif
|
131
|
+
/*
|
132
|
+
* Set the total number of items in this enumeration
|
133
|
+
* call-seq:
|
134
|
+
* enumerate_info.total_items = 10
|
135
|
+
*
|
136
|
+
*/
|
137
|
+
void set_total_items(int i) {
|
138
|
+
$self->totalItems = i;
|
139
|
+
}
|
140
|
+
|
141
|
+
/*
|
142
|
+
* XmlDoc representing the result pulled last
|
143
|
+
* call-seq:
|
144
|
+
* enumerate_info.pull_result -> Openwsman::XmlDoc
|
145
|
+
*
|
146
|
+
*/
|
147
|
+
WsXmlDocH pull_result() {
|
148
|
+
return (WsXmlDocH)$self->pullResultPtr;
|
149
|
+
}
|
150
|
+
#if defined(SWIGRUBY)
|
151
|
+
%rename("pull_result=") set_pull_result(WsXmlDocH result);
|
152
|
+
#endif
|
153
|
+
/*
|
154
|
+
* Set the pull result (XmlDoc)
|
155
|
+
*
|
156
|
+
* Used for server-side plugin extensions
|
157
|
+
* call-seq:
|
158
|
+
* enumerate_info.pull_result = xml_doc
|
159
|
+
*
|
160
|
+
*/
|
161
|
+
void set_pull_result(WsXmlDocH result) {
|
162
|
+
$self->pullResultPtr = (void *)result;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
|
167
|
+
/*
|
168
|
+
* __SoapOp -> SoapOp
|
169
|
+
*/
|
170
|
+
|
171
|
+
%nodefault __SoapOp;
|
172
|
+
%rename(SoapOp) __SoapOp;
|
173
|
+
struct __SoapOp {};
|
174
|
+
|
175
|
+
/*
|
176
|
+
* Document-class: SoapOp
|
177
|
+
*
|
178
|
+
* SoapOp represents a SOAP operation
|
179
|
+
*
|
180
|
+
*/
|
181
|
+
%extend __SoapOp {
|
182
|
+
/*
|
183
|
+
* The incoming XmlDoc
|
184
|
+
* call-seq:
|
185
|
+
* soap_op.indoc -> Openwsman::XmlDoc
|
186
|
+
*
|
187
|
+
*/
|
188
|
+
WsXmlDocH indoc() {
|
189
|
+
return soap_get_op_doc($self, 1);
|
190
|
+
}
|
191
|
+
#if defined(SWIGRUBY)
|
192
|
+
%rename("indoc=") set_indoc( WsXmlDocH doc );
|
193
|
+
#endif
|
194
|
+
/*
|
195
|
+
* Set the incoming XmlDoc
|
196
|
+
* call-seq:
|
197
|
+
* soap_op.indoc = xml_doc
|
198
|
+
*
|
199
|
+
*/
|
200
|
+
void set_indoc( WsXmlDocH doc ) {
|
201
|
+
soap_set_op_doc( $self, doc, 1 );
|
202
|
+
}
|
203
|
+
/*
|
204
|
+
* The outgoing XmlDoc
|
205
|
+
* call-seq:
|
206
|
+
* soap_op.outdoc -> Openwsman::XmlDoc
|
207
|
+
*
|
208
|
+
*/
|
209
|
+
WsXmlDocH outdoc() {
|
210
|
+
return soap_get_op_doc($self, 0);
|
211
|
+
}
|
212
|
+
#if defined(SWIGRUBY)
|
213
|
+
%rename("outdoc=") set_outdoc( WsXmlDocH doc );
|
214
|
+
#endif
|
215
|
+
/*
|
216
|
+
* Set the outgoing XmlDoc
|
217
|
+
* call-seq:
|
218
|
+
* soap_op.outdoc = xml_doc
|
219
|
+
*
|
220
|
+
*/
|
221
|
+
void set_outdoc( WsXmlDocH doc ) {
|
222
|
+
soap_set_op_doc( $self, doc, 0 );
|
223
|
+
}
|
224
|
+
/*
|
225
|
+
* The Soap instance of this operation
|
226
|
+
* call-seq:
|
227
|
+
* soap_op.soap -> Openwsman::Soap
|
228
|
+
*
|
229
|
+
*/
|
230
|
+
struct __Soap *soap() {
|
231
|
+
return soap_get_op_soap($self);
|
232
|
+
}
|
233
|
+
/*
|
234
|
+
* The raw (SOAP) message for this operation
|
235
|
+
* call-seq:
|
236
|
+
* soap_op.msg -> Openwsman::Message
|
237
|
+
*
|
238
|
+
*/
|
239
|
+
WsmanMessage *msg() {
|
240
|
+
return wsman_get_msg_from_op($self);
|
241
|
+
}
|
242
|
+
/*
|
243
|
+
* The maximum size (on the wire) of this operation
|
244
|
+
* call-seq:
|
245
|
+
* soap_op.maxsize -> Integer
|
246
|
+
*
|
247
|
+
*/
|
248
|
+
unsigned long maxsize(){
|
249
|
+
return wsman_get_maxsize_from_op($self);
|
250
|
+
}
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
/*
|
255
|
+
* __Soap -> Soap
|
256
|
+
*/
|
257
|
+
|
258
|
+
%nodefault __Soap;
|
259
|
+
%rename(Soap) __Soap;
|
260
|
+
struct __Soap {};
|
261
|
+
|
262
|
+
/*
|
263
|
+
* Document-class: Soap
|
264
|
+
*
|
265
|
+
* Soap represents a part of a SoapOp used to create and reference
|
266
|
+
* context information.
|
267
|
+
*
|
268
|
+
* There is no constructor for Soap, use SoapOp.soap to access the
|
269
|
+
* Soap instance associated with a SOAP operation.
|
270
|
+
*
|
271
|
+
*/
|
272
|
+
%extend __Soap {
|
273
|
+
~__Soap() {
|
274
|
+
soap_destroy($self);
|
275
|
+
}
|
276
|
+
%typemap(newfree) WsContextH "free($1);";
|
277
|
+
|
278
|
+
/*
|
279
|
+
* Create a new Context
|
280
|
+
* call-seq:
|
281
|
+
* soap.create_context -> Openwsman::Context
|
282
|
+
*
|
283
|
+
*/
|
284
|
+
WsContextH create_context() {
|
285
|
+
return ws_create_context($self);
|
286
|
+
}
|
287
|
+
/*
|
288
|
+
* Get the current Context
|
289
|
+
* call-seq:
|
290
|
+
* soap.context -> Openwsman::Context
|
291
|
+
*
|
292
|
+
*/
|
293
|
+
WsContextH context() {
|
294
|
+
return ws_get_soap_context($self);
|
295
|
+
}
|
296
|
+
|
297
|
+
/*
|
298
|
+
* Create a new endpoint Context
|
299
|
+
* call-seq:
|
300
|
+
* soap.create_ep_context -> Openwsman::Context
|
301
|
+
*
|
302
|
+
*/
|
303
|
+
WsContextH create_ep_context( WsXmlDocH doc ) {
|
304
|
+
return ws_create_ep_context( $self, doc );
|
305
|
+
}
|
306
|
+
}
|
307
|
+
|
308
|
+
|
309
|
+
/*
|
310
|
+
* WsContext -> Context
|
311
|
+
*/
|
312
|
+
|
313
|
+
%rename(Context) _WS_CONTEXT;
|
314
|
+
%nodefault _WS_CONTEXT;
|
315
|
+
struct _WS_CONTEXT {};
|
316
|
+
typedef struct _WS_CONTEXT* WsContextH;
|
317
|
+
|
318
|
+
|
319
|
+
/*
|
320
|
+
* Document-class: Context
|
321
|
+
*
|
322
|
+
* Context contains all information of an ongoing SOAP operation
|
323
|
+
*
|
324
|
+
* There is no constructor for Context, use Soap.context to get the
|
325
|
+
* current one.
|
326
|
+
*
|
327
|
+
*/
|
328
|
+
%extend _WS_CONTEXT {
|
329
|
+
~_WS_CONTEXT() {
|
330
|
+
ws_destroy_context($self);
|
331
|
+
}
|
332
|
+
%typemap(newfree) WsXmlDocH "ws_xml_destroy_doc($1);";
|
333
|
+
/*
|
334
|
+
* The incoming XmlDoc
|
335
|
+
* call-seq:
|
336
|
+
* context.indox -> Openwsman::XmlDoc
|
337
|
+
*
|
338
|
+
*/
|
339
|
+
WsXmlDocH indoc() {
|
340
|
+
return $self->indoc;
|
341
|
+
}
|
342
|
+
/*
|
343
|
+
* Get the Soap runtime environment
|
344
|
+
* call-seq:
|
345
|
+
* context.runtime -> Openwsman::Soap
|
346
|
+
*
|
347
|
+
*/
|
348
|
+
struct __Soap *runtime() {
|
349
|
+
return ws_context_get_runtime($self);
|
350
|
+
}
|
351
|
+
#if defined(SWIGRUBY)
|
352
|
+
%rename("enum_idle_timeout=") set_enumIdleTimeout(unsigned long timeout);
|
353
|
+
#endif
|
354
|
+
/*
|
355
|
+
* Set the idle timeout for enumerations
|
356
|
+
* call-seq:
|
357
|
+
* context.enum_idle_timeout = 60
|
358
|
+
*
|
359
|
+
*/
|
360
|
+
void set_enumIdleTimeout(unsigned long timeout) {
|
361
|
+
ws_set_context_enumIdleTimeout($self, timeout);
|
362
|
+
}
|
363
|
+
/*
|
364
|
+
* The class name
|
365
|
+
* call-seq:
|
366
|
+
* context.classname -> String
|
367
|
+
*
|
368
|
+
*/
|
369
|
+
const char *classname() {
|
370
|
+
return wsman_get_class_name($self);
|
371
|
+
}
|
372
|
+
/*
|
373
|
+
* The method name
|
374
|
+
* call-seq:
|
375
|
+
* context.method -> String
|
376
|
+
*
|
377
|
+
*/
|
378
|
+
const char *method() {
|
379
|
+
return wsman_get_method_name($self);
|
380
|
+
}
|
381
|
+
/*
|
382
|
+
* The method arguments
|
383
|
+
* call-seq:
|
384
|
+
* context.method -> Hash
|
385
|
+
*
|
386
|
+
*/
|
387
|
+
hash_t *method_args(const char *resource_uri) {
|
388
|
+
return wsman_get_method_args($self, resource_uri);
|
389
|
+
}
|
390
|
+
/*
|
391
|
+
* The maximum elements of the document
|
392
|
+
* call-seq:
|
393
|
+
* context.max_elements -> Integer
|
394
|
+
* context.max_elements(xmldoc) -> Integer
|
395
|
+
*
|
396
|
+
*/
|
397
|
+
int max_elements(WsXmlDocH doc = NULL) {
|
398
|
+
return wsman_get_max_elements($self, doc);
|
399
|
+
}
|
400
|
+
/*
|
401
|
+
* The maximum envelope size of the document
|
402
|
+
* call-seq:
|
403
|
+
* context.max_envelope_size -> Integer
|
404
|
+
* context.max_envelope_size(xmldoc) -> Integer
|
405
|
+
*
|
406
|
+
*/
|
407
|
+
unsigned long max_envelope_size(WsXmlDocH doc = NULL) {
|
408
|
+
return wsman_get_max_envelope_size($self, doc);
|
409
|
+
}
|
410
|
+
/*
|
411
|
+
* The fragment of the document
|
412
|
+
* call-seq:
|
413
|
+
* context.fragment_string -> String
|
414
|
+
* context.fragment_string(xmldoc) -> String
|
415
|
+
*
|
416
|
+
*/
|
417
|
+
const char *fragment_string(WsXmlDocH doc = NULL) {
|
418
|
+
return wsman_get_fragment_string($self, doc);
|
419
|
+
}
|
420
|
+
/*
|
421
|
+
* The selector for an element
|
422
|
+
* call-seq:
|
423
|
+
* context.selector(xml_doc, "Name", 1) -> String
|
424
|
+
*
|
425
|
+
*/
|
426
|
+
const char *selector(WsXmlDocH doc, const char *name, int index) {
|
427
|
+
return wsman_get_selector($self, doc, name, index);
|
428
|
+
}
|
429
|
+
/*
|
430
|
+
* The selectors from an endpoint reference
|
431
|
+
* call-seq:
|
432
|
+
* context.selectors_from_epr(epr_node_as_xml_doc) -> Hash
|
433
|
+
*
|
434
|
+
*/
|
435
|
+
hash_t *selectors_from_epr(WsXmlNodeH epr_node) {
|
436
|
+
return wsman_get_selectors_from_epr($self, epr_node);
|
437
|
+
}
|
438
|
+
/*
|
439
|
+
* The selectors for a document
|
440
|
+
* call-seq:
|
441
|
+
* context.selectors -> Hash
|
442
|
+
* context.selectors(xml_doc) -> Hash
|
443
|
+
*
|
444
|
+
*/
|
445
|
+
hash_t *selectors(WsXmlDocH doc = NULL) {
|
446
|
+
return wsman_get_selector_list($self, doc);
|
447
|
+
}
|
448
|
+
/*
|
449
|
+
* The selectors from a filter
|
450
|
+
* call-seq:
|
451
|
+
* context.selectors_from_filter -> Hash
|
452
|
+
* context.selectors_from_filter(xml_doc) -> Hash
|
453
|
+
*
|
454
|
+
*/
|
455
|
+
hash_t *selectors_from_filter(WsXmlDocH doc = NULL) {
|
456
|
+
return wsman_get_selector_list_from_filter($self, doc);
|
457
|
+
}
|
458
|
+
/*
|
459
|
+
* The action
|
460
|
+
* call-seq:
|
461
|
+
* context.action -> String
|
462
|
+
* context.action(xml_doc) -> String
|
463
|
+
*
|
464
|
+
*/
|
465
|
+
const char *action(WsXmlDocH doc = NULL) {
|
466
|
+
return wsman_get_action($self, doc);
|
467
|
+
}
|
468
|
+
/*
|
469
|
+
* The resource uri
|
470
|
+
* call-seq:
|
471
|
+
* context.resource_uri -> String
|
472
|
+
* context.resource_uri(xml_doc) -> String
|
473
|
+
*
|
474
|
+
*/
|
475
|
+
const char *resource_uri(WsXmlDocH doc = NULL) {
|
476
|
+
return wsman_get_resource_uri($self, doc);
|
477
|
+
}
|
478
|
+
/*
|
479
|
+
* The option set
|
480
|
+
* call-seq:
|
481
|
+
* context.option_set(xml_doc, "op") -> String
|
482
|
+
*
|
483
|
+
*/
|
484
|
+
const char *option_set(WsXmlDocH doc, const char *op) {
|
485
|
+
return wsman_get_option_set($self, doc, op);
|
486
|
+
}
|
487
|
+
/*
|
488
|
+
* Parse enumeration request
|
489
|
+
* call-seq:
|
490
|
+
* context.parse_enum_request(enumerate_info) -> Integer
|
491
|
+
*
|
492
|
+
*/
|
493
|
+
int parse_enum_request(WsEnumerateInfo *enumInfo) {
|
494
|
+
WsmanStatus status;
|
495
|
+
wsman_status_init(&status);
|
496
|
+
return wsman_parse_enum_request( $self, enumInfo, &status);
|
497
|
+
/* FIXME: return status */
|
498
|
+
}
|
499
|
+
|
500
|
+
}
|
501
|
+
|
502
|
+
|
503
|
+
/*
|
504
|
+
* WsmanStatus -> Status
|
505
|
+
*/
|
506
|
+
|
507
|
+
%rename(Status) _WsmanStatus;
|
508
|
+
%nodefault _WsmanStatus;
|
509
|
+
struct _WsmanStatus {};
|
510
|
+
typedef struct _WsmanStatus WsmanStatus;
|
511
|
+
|
512
|
+
/*
|
513
|
+
* Document-class: Status
|
514
|
+
*
|
515
|
+
* Status represents the detailed status of a (failed) WS-Management
|
516
|
+
* operation.
|
517
|
+
*
|
518
|
+
* Its primarily used implementing server-side plugins to report a Fault
|
519
|
+
* back to the calling client.
|
520
|
+
*
|
521
|
+
*/
|
522
|
+
%extend _WsmanStatus {
|
523
|
+
/*
|
524
|
+
* Create a new Status object
|
525
|
+
*
|
526
|
+
* call-seq:
|
527
|
+
* Openwsman::Status.new # create 'good' status
|
528
|
+
* Openwsman::Status.new error_code
|
529
|
+
* Openwsman::Status.new error_code, error_detail
|
530
|
+
* Openwsman::Status.new error_code, error_detail, "Error message"
|
531
|
+
*
|
532
|
+
*/
|
533
|
+
_WsmanStatus(int code = 0, int detail = 0, const char *msg = NULL) {
|
534
|
+
WsmanStatus *s = (WsmanStatus *)malloc(sizeof(WsmanStatus));
|
535
|
+
wsman_status_init(s);
|
536
|
+
if (code)
|
537
|
+
s->fault_code = code;
|
538
|
+
if (msg)
|
539
|
+
s->fault_msg = strdup(msg);
|
540
|
+
if (detail < 0
|
541
|
+
|| detail > OWSMAN_SYSTEM_ERROR) {
|
542
|
+
SWIG_exception( SWIG_ValueError, "Bad fault detail" );
|
543
|
+
}
|
544
|
+
else {
|
545
|
+
s->fault_detail_code = detail;
|
546
|
+
}
|
547
|
+
#if defined(SWIGPYTHON) || defined(SWIGPERL) || defined(SWIGJAVA)
|
548
|
+
fail:
|
549
|
+
#endif
|
550
|
+
return s;
|
551
|
+
}
|
552
|
+
~_WsmanStatus() {
|
553
|
+
if ($self->fault_msg) free($self->fault_msg);
|
554
|
+
free($self);
|
555
|
+
}
|
556
|
+
/*
|
557
|
+
* String representation (returns the fault message)
|
558
|
+
*
|
559
|
+
* call-seq:
|
560
|
+
* status.to_s -> String
|
561
|
+
*
|
562
|
+
*/
|
563
|
+
const char *to_s() {
|
564
|
+
return $self->fault_msg;
|
565
|
+
}
|
566
|
+
#if defined(SWIGRUBY)
|
567
|
+
%rename("code=") set_code(int code);
|
568
|
+
#endif
|
569
|
+
/*
|
570
|
+
* Set the fault code
|
571
|
+
*
|
572
|
+
* call-seq:
|
573
|
+
* status.code = 1
|
574
|
+
*
|
575
|
+
*/
|
576
|
+
void set_code(int code) { $self->fault_code = code; }
|
577
|
+
/*
|
578
|
+
* Get the fault code
|
579
|
+
*
|
580
|
+
* call-seq:
|
581
|
+
* status.code -> Integer
|
582
|
+
*
|
583
|
+
*/
|
584
|
+
int code() {
|
585
|
+
return $self->fault_code;
|
586
|
+
}
|
587
|
+
#if defined(SWIGRUBY)
|
588
|
+
%rename("detail=") set_detail(int detail);
|
589
|
+
#endif
|
590
|
+
/*
|
591
|
+
* Set the fault detail code
|
592
|
+
*
|
593
|
+
* call-seq:
|
594
|
+
* status.detail = 42
|
595
|
+
*
|
596
|
+
*/
|
597
|
+
void set_detail(int detail) {
|
598
|
+
if (detail < 0
|
599
|
+
|| detail > OWSMAN_SYSTEM_ERROR) {
|
600
|
+
SWIG_exception( SWIG_ValueError, "Bad fault detail" );
|
601
|
+
}
|
602
|
+
else {
|
603
|
+
$self->fault_detail_code = detail;
|
604
|
+
}
|
605
|
+
#if defined(SWIGPYTHON) || defined(SWIGPERL) || defined(SWIGJAVA)
|
606
|
+
fail:
|
607
|
+
return;
|
608
|
+
#endif
|
609
|
+
}
|
610
|
+
/*
|
611
|
+
* Get the fault detail code
|
612
|
+
*
|
613
|
+
* call-seq:
|
614
|
+
* status.detail -> Integer
|
615
|
+
*
|
616
|
+
*/
|
617
|
+
int detail() {
|
618
|
+
return $self->fault_detail_code;
|
619
|
+
}
|
620
|
+
#if defined(SWIGRUBY)
|
621
|
+
%rename("msg=") set_msg(const char *msg);
|
622
|
+
#endif
|
623
|
+
/*
|
624
|
+
* Set the fault message
|
625
|
+
*
|
626
|
+
* call-seq:
|
627
|
+
* status.msg = "This is a fault message"
|
628
|
+
*
|
629
|
+
*/
|
630
|
+
void set_msg(const char *msg) {
|
631
|
+
if ($self->fault_msg)
|
632
|
+
free($self->fault_msg);
|
633
|
+
if (msg)
|
634
|
+
$self->fault_msg = strdup(msg);
|
635
|
+
else
|
636
|
+
$self->fault_msg = NULL;
|
637
|
+
}
|
638
|
+
/*
|
639
|
+
* Get the fault message
|
640
|
+
*
|
641
|
+
* call-seq:
|
642
|
+
* status.msg -> String
|
643
|
+
*
|
644
|
+
*/
|
645
|
+
const char *msg() {
|
646
|
+
return $self->fault_msg;
|
647
|
+
}
|
648
|
+
|
649
|
+
%typemap(newfree) WsXmlDocH "ws_xml_destroy_doc($1);";
|
650
|
+
/*
|
651
|
+
* Create a new fault XmlDoc based on Status information
|
652
|
+
*
|
653
|
+
* call-seq:
|
654
|
+
* status.generate_fault(xml_doc) -> XmlDoc
|
655
|
+
*
|
656
|
+
*/
|
657
|
+
WsXmlDocH generate_fault(WsXmlDocH doc) {
|
658
|
+
return wsman_generate_fault( doc, $self->fault_code, $self->fault_detail_code, $self->fault_msg);
|
659
|
+
}
|
660
|
+
}
|
661
|
+
|
662
|
+
/*
|
663
|
+
* WsManFault -> Fault
|
664
|
+
*/
|
665
|
+
|
666
|
+
%rename(Fault) _WsManFault;
|
667
|
+
%nodefault _WsManFault;
|
668
|
+
struct _WsManFault {};
|
669
|
+
typedef struct _WsManFault WsManFault;
|
670
|
+
|
671
|
+
/*
|
672
|
+
* Document-class: Fault
|
673
|
+
*
|
674
|
+
* Fault represents details of a failed WS-Management operation
|
675
|
+
*
|
676
|
+
*/
|
677
|
+
%extend _WsManFault {
|
678
|
+
/*
|
679
|
+
* Create a Fault representation of a failed WS-Management result doc
|
680
|
+
*
|
681
|
+
* call-seq:
|
682
|
+
* Openwsman::Fault.new result -> Openwsman::Fault
|
683
|
+
*
|
684
|
+
*/
|
685
|
+
_WsManFault(WsXmlDocH doc) {
|
686
|
+
WsManFault *fault = wsmc_fault_new();
|
687
|
+
wsmc_get_fault_data(doc, fault);
|
688
|
+
return fault;
|
689
|
+
}
|
690
|
+
~_WsManFault() {
|
691
|
+
wsmc_fault_destroy($self);
|
692
|
+
}
|
693
|
+
/*
|
694
|
+
* Fault code
|
695
|
+
*
|
696
|
+
* call-seq:
|
697
|
+
* fault.code -> String
|
698
|
+
*
|
699
|
+
*/
|
700
|
+
const char *code() {
|
701
|
+
return $self->code;
|
702
|
+
}
|
703
|
+
/*
|
704
|
+
* Fault subcode
|
705
|
+
*
|
706
|
+
* call-seq:
|
707
|
+
* fault.subcode -> String
|
708
|
+
*
|
709
|
+
*/
|
710
|
+
const char *subcode() {
|
711
|
+
return $self->subcode;
|
712
|
+
}
|
713
|
+
/*
|
714
|
+
* Fault reason
|
715
|
+
*
|
716
|
+
* call-seq:
|
717
|
+
* fault.reason -> String
|
718
|
+
*
|
719
|
+
*/
|
720
|
+
const char *reason() {
|
721
|
+
return $self->reason;
|
722
|
+
}
|
723
|
+
/*
|
724
|
+
* Fault detail
|
725
|
+
*
|
726
|
+
* call-seq:
|
727
|
+
* fault.detail -> String
|
728
|
+
*
|
729
|
+
*/
|
730
|
+
const char *detail() {
|
731
|
+
return $self->fault_detail;
|
732
|
+
}
|
733
|
+
}
|