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.
@@ -0,0 +1,649 @@
1
+ /*
2
+ *
3
+ * ClientOptions
4
+ *
5
+ * client option declarations for openwsman swig bindings
6
+ *
7
+ */
8
+
9
+ %rename(ClientOptions) client_opt_t;
10
+ %nodefault client_opt_t;
11
+ typedef struct {} client_opt_t;
12
+
13
+
14
+ /*
15
+ * Document-class: ClientOptions
16
+ *
17
+ * ClientOptions control the behaviour of the Client connection
18
+ *
19
+ * The primary use of ClientOptions in normal operations is adding
20
+ * selectors - key/value pairs added to the request URL.
21
+ *
22
+ * For WS-CIM operations, selectors define the key attributes for
23
+ * the selected CIM class to address a specific instance of the class.
24
+ *
25
+ */
26
+
27
+ %extend client_opt_t {
28
+ client_opt_t() {
29
+ client_opt_t *options = wsmc_options_init();
30
+ return options;
31
+ }
32
+
33
+ ~client_opt_t() {
34
+ wsmc_options_destroy( $self );
35
+ }
36
+
37
+ /*
38
+ * Request to dump all operations to the dumpfile
39
+ *
40
+ * Used for debugging on the wire-level
41
+ *
42
+ * See also: clear_dump_request
43
+ *
44
+ * call-seq:
45
+ * options.set_dump_request
46
+ *
47
+ */
48
+ void set_dump_request(void) {
49
+ wsmc_set_action_option($self, FLAG_DUMP_REQUEST );
50
+ }
51
+
52
+ /*
53
+ * Reset dump all operations to the dumpfile
54
+ *
55
+ * Used for debugging on the wire-level
56
+ *
57
+ * See also: set_dump_request
58
+ *
59
+ * call-seq:
60
+ * options.clear_dump_request
61
+ *
62
+ */
63
+ void clear_dump_request(void) {
64
+ wsmc_clear_action_option($self, FLAG_DUMP_REQUEST );
65
+ }
66
+
67
+ #if defined(SWIGRUBY)
68
+ %rename( "flags=" ) set_flags(int flags);
69
+ #endif
70
+ /*
71
+ * set option flag(s)
72
+ *
73
+ * adds new flag(s) to options
74
+ *
75
+ * call-seq:
76
+ * options.flags = Openwsman::FLAG_ENUMERATION_OPTIMIZATION
77
+ *
78
+ */
79
+ void set_flags(int flags) {
80
+ wsmc_set_action_option($self, flags);
81
+ }
82
+
83
+ #if defined(SWIGRUBY)
84
+ %rename( "flags" ) get_flags();
85
+ #endif
86
+ /*
87
+ * get option flag(s)
88
+ *
89
+ * return current flags bitmask
90
+ *
91
+ * call-seq:
92
+ * optins.flags -> Integer
93
+ *
94
+ */
95
+ unsigned int get_flags() {
96
+ return wsmc_get_action_option($self);
97
+ }
98
+
99
+ /*
100
+ * clear option flag(s)
101
+ *
102
+ * clears specific flag(s) from options
103
+ *
104
+ * call-seq:
105
+ * options.clear_flags Openwsman::FLAG_ENUMERATION_OPTIMIZATION
106
+ *
107
+ */
108
+ void clear_flags(int flags) {
109
+ wsmc_clear_action_option($self, flags);
110
+ }
111
+
112
+ /*
113
+ * reset option flags
114
+ *
115
+ * sets option flags bitmask to FLAG_NONE
116
+ *
117
+ * call-seq:
118
+ * options.reset_flags
119
+ *
120
+ */
121
+ void reset_flags() {
122
+ wsmc_clear_action_option($self, ~FLAG_NONE);
123
+ }
124
+
125
+ #if defined(SWIGRUBY)
126
+ %rename( "max_envelope_size=" ) set_max_envelope_size(unsigned long size);
127
+ #endif
128
+ /*
129
+ * Limit size of result document
130
+ *
131
+ * call-seq:
132
+ * options.max_envelope_size = 10240
133
+ *
134
+ */
135
+ void set_max_envelope_size(unsigned long size) {
136
+ $self->max_envelope_size = size;
137
+ }
138
+
139
+ #if defined(SWIGRUBY)
140
+ %rename( "max_envelope_size" ) get_max_envelope_size();
141
+ #endif
142
+ /*
143
+ * Return size limit of result document
144
+ *
145
+ * call-seq:
146
+ * options.max_envelope_size -> Integer
147
+ *
148
+ */
149
+ unsigned long get_max_envelope_size() {
150
+ return $self->max_envelope_size;
151
+ }
152
+
153
+ #if defined(SWIGRUBY)
154
+ %rename( "max_elements=" ) set_max_elements(int elements);
155
+ #endif
156
+ /*
157
+ * Limit number of elements returned by enumeration
158
+ *
159
+ * call-seq:
160
+ * options.max_elements = 42
161
+ *
162
+ */
163
+ void set_max_elements(int elements) {
164
+ $self->max_elements = elements;
165
+ }
166
+
167
+ #if defined(SWIGRUBY)
168
+ %rename( "max_elements" ) get_max_elements();
169
+ #endif
170
+ /*
171
+ * Return enumeration elements limit
172
+ *
173
+ * call-seq:
174
+ * options.max_elements -> Integer
175
+ *
176
+ */
177
+ int get_max_elements() {
178
+ return $self->max_elements;
179
+ }
180
+
181
+ #if defined(SWIGRUBY)
182
+ %rename( "timeout=" ) set_timeout(unsigned long timeout);
183
+ #endif
184
+ /*
185
+ * Operation timeout in milliseconds
186
+ * See Openwsman::Transport.timeout for transport timeout
187
+ *
188
+ * call-seq:
189
+ * options.timeout = 60*1000 # 60 seconds
190
+ *
191
+ */
192
+ void set_timeout(unsigned long timeout) {
193
+ $self->timeout = timeout;
194
+ }
195
+
196
+ #if defined(SWIGRUBY)
197
+ %rename( "timeout" ) get_timeout();
198
+ #endif
199
+ /*
200
+ * Return operation timeout in milliseconds
201
+ * See Openwsman::Transport.timeout for transport timeout
202
+ *
203
+ * call-seq:
204
+ * options.timeout -> Integer
205
+ *
206
+ */
207
+ unsigned long get_timeout() {
208
+ return $self->timeout;
209
+ }
210
+
211
+ #if defined(SWIGRUBY)
212
+ %rename( "fragment=" ) set_fragment(char *fragment);
213
+ #endif
214
+ /*
215
+ * Set fragment filter
216
+ * See DSP0226, section 7.7.
217
+ * (Supported Dialects: XPATH)
218
+ *
219
+ * call-seq:
220
+ * options.fragment = "xpath/expression"
221
+ *
222
+ */
223
+ void set_fragment(char *fragment) {
224
+ wsmc_set_fragment(fragment, $self);
225
+ }
226
+
227
+ #if defined(SWIGRUBY)
228
+ %rename( "fragment" ) get_fragment();
229
+ #endif
230
+ /*
231
+ * Get fragment filter
232
+ * See DSP0226, section 7.7.
233
+ *
234
+ * call-seq:
235
+ * options.fragment -> String
236
+ *
237
+ */
238
+ const char *get_fragment() {
239
+ return $self->fragment;
240
+ }
241
+
242
+ #if defined(SWIGRUBY)
243
+ %rename( "cim_namespace=" ) set_cim_namespace(char *cim_namespace);
244
+ #endif
245
+ /*
246
+ * Set CIM Namespace for Openwsman
247
+ * (default is root/cimv2)
248
+ * Note:
249
+ * Microsoft WinRM set the resource namespace by attaching it
250
+ * to the resource URI
251
+ *
252
+ * See also: Openwsman.epr_prefix_for
253
+ *
254
+ * call-seq:
255
+ * options.cim_namespace = "root/interop"
256
+ *
257
+ */
258
+ void set_cim_namespace(char *cim_namespace) {
259
+ wsmc_set_cim_ns(cim_namespace, $self);
260
+ }
261
+
262
+ #if defined(SWIGRUBY)
263
+ %rename( "cim_namespace" ) get_cim_namespace();
264
+ #endif
265
+ /*
266
+ * Get CIM Namespace for Openwsman
267
+ * Note:
268
+ * Microsoft WinRM set the resource namespace by attaching it
269
+ * to the resource URI
270
+ *
271
+ * See also: Openwsman.epr_prefix_for
272
+ *
273
+ * call-seq:
274
+ * options.cim_namespace -> String
275
+ *
276
+ */
277
+ const char *get_cim_namespace() {
278
+ return $self->cim_ns;
279
+ }
280
+
281
+ #if defined(SWIGRUBY)
282
+ %rename( "reference=" ) set_reference(const char *reference);
283
+ #endif
284
+ /*
285
+ * Set WS-Addressing reference properties
286
+ * Argument must the string representation of a valid XML document
287
+ *
288
+ * call-seq:
289
+ * options.reference = "<xml ...>"
290
+ *
291
+ */
292
+ void set_reference(const char *reference) {
293
+ wsmc_set_reference(reference, $self);
294
+ }
295
+
296
+ #if defined(SWIGRUBY)
297
+ %rename( "reference" ) get_reference();
298
+ #endif
299
+ /*
300
+ * Get WS-Addressing reference properties
301
+ * Returns the string representation of a valid XML document
302
+ *
303
+ * call-seq:
304
+ * options.reference -> String
305
+ *
306
+ */
307
+ const char *get_reference() {
308
+ return $self->reference;
309
+ }
310
+
311
+ #if defined(SWIGRUBY)
312
+ /*
313
+ * Add an option (for OptionSet) as key/value pair
314
+ *
315
+ * NOTE:
316
+ * the value must be properly escaped (replace & with &amp;, etc.)
317
+ * in Ruby use CGI::escapeHTML()
318
+ *
319
+ * call-seq:
320
+ * options.add_option "Name", "Value"
321
+ *
322
+ */
323
+ void add_option(VALUE k, VALUE v)
324
+ {
325
+ const char *key = as_string(k);
326
+ const char *value = as_string(v);
327
+ #else
328
+ void add_option(const char *key, const char *value)
329
+ {
330
+ #endif
331
+ wsmc_add_option($self, key, value);
332
+ }
333
+
334
+ #if defined(SWIGRUBY)
335
+ %rename( "options=" ) set_options(VALUE hash);
336
+ /*
337
+ * Set options (for OptionSet) from Hash
338
+ *
339
+ * NOTE:
340
+ * the values must be properly escaped (replace & with &amp;, etc.)
341
+ * in Ruby use CGI::escapeHTML()
342
+ *
343
+ * call-seq:
344
+ * options.options = { "Name" => "Value", ... }
345
+ *
346
+ */
347
+ void set_options(VALUE hash)
348
+ {
349
+ $self->options = value2hash(NULL, hash, 0);
350
+ }
351
+
352
+ %rename( "options" ) get_options(void);
353
+ /*
354
+ * Get options (for OptionSet) as Hash
355
+ *
356
+ * call-seq:
357
+ * options.options -> Hash
358
+ *
359
+ */
360
+ VALUE get_options(void)
361
+ {
362
+ return hash2value($self->options);
363
+ }
364
+ #endif
365
+
366
+ #if defined(SWIGRUBY)
367
+ /*
368
+ * Add a selector as key/value pair
369
+ *
370
+ * NOTE:
371
+ * the value must be properly escaped (replace & with &amp;, etc.)
372
+ * in Ruby use CGI::escapeHTML()
373
+ *
374
+ * call-seq:
375
+ * options.add_selector "Key", "Value"
376
+ *
377
+ */
378
+ void add_selector(VALUE k, VALUE v)
379
+ {
380
+ const char *key = as_string(k);
381
+ const char *value = as_string(v);
382
+ #else
383
+ void add_selector(const char *key, const char *value)
384
+ {
385
+ #endif
386
+ wsmc_add_selector($self, key, value);
387
+ }
388
+
389
+ #if defined(SWIGRUBY)
390
+ %rename( "selectors=" ) set_selectors(VALUE hash);
391
+ /*
392
+ * Set selectors from Hash
393
+ *
394
+ * NOTE:
395
+ * the values must be properly escaped (replace & with &amp;, etc.)
396
+ * in Ruby use CGI::escapeHTML()
397
+ *
398
+ * call-seq:
399
+ * options.selectors = { "Key" => "Value", ... }
400
+ *
401
+ */
402
+ void set_selectors(VALUE hash)
403
+ {
404
+ $self->selectors = value2hash(NULL, hash, 0);
405
+ }
406
+
407
+ %rename( "selectors" ) get_selectors(void);
408
+ /*
409
+ * Get selectors as Hash
410
+ *
411
+ * call-seq:
412
+ * options.selectors -> Hash
413
+ *
414
+ */
415
+ VALUE get_selectors(void)
416
+ {
417
+ return hash2value($self->selectors);
418
+ }
419
+ #endif
420
+
421
+ #if defined(SWIGRUBY)
422
+ /*
423
+ * Add a property as key/value pair
424
+ * * Input parameters to 'invoke'd methods are represented as ClientOption properties
425
+ * * Key is evaluated as String
426
+ * * Value is evaluated as String or EndPointReference
427
+ *
428
+ * call-seq:
429
+ * options.add_property "Key", "Value"
430
+ * options.add_property "Key", EndPointReference.new(...)
431
+ *
432
+ */
433
+ void add_property(VALUE k, VALUE v)
434
+ {
435
+ const char *key = as_string(k);
436
+ KLASS_DECL(SwigClassEndPointReference,SWIGTYPE_p_epr_t);
437
+
438
+ if (CLASS_OF(v) == KLASS_OF(SwigClassEndPointReference)) {
439
+ const epr_t *epr;
440
+ SWIG_ConvertPtr(v, (void **)&epr, SWIGTYPE_p_epr_t, 0);
441
+ wsmc_add_property_epr($self, key, epr);
442
+ }
443
+ else {
444
+ const char *value = as_string(v);
445
+ wsmc_add_property($self, key, value);
446
+ }
447
+ }
448
+ #else
449
+ /*
450
+ * Add a string property as key/value pair
451
+ * * Input parameters to 'invoke'd methods are represented as ClientOption properties
452
+ *
453
+ * call-seq:
454
+ * options.add_property( "Key", "Value" )
455
+ *
456
+ */
457
+ void add_property(const char *key, const char *value)
458
+ {
459
+ wsmc_add_property($self, key, value);
460
+ }
461
+
462
+ /*
463
+ * Add an EndPointReference property as key/value pair
464
+ * Input parameters to 'invoke'd methods are represented as ClientOption properties
465
+ *
466
+ * call-seq:
467
+ * options.add_property( String, EndPointReference )
468
+ *
469
+ */
470
+ void add_property(const char *key, const epr_t *epr)
471
+ {
472
+ wsmc_add_property_epr($self, key, epr);
473
+ }
474
+ #endif
475
+
476
+ #if defined(SWIGRUBY)
477
+ %rename( "properties=" ) set_properties(VALUE hash);
478
+ /*
479
+ * Set properties from Hash
480
+ * * Input parameters to 'invoke'd methods are represented as ClientOption properties
481
+ *
482
+ * call-seq:
483
+ * options.properties = { "Key" => "Value", ...}
484
+ *
485
+ */
486
+ void set_properties(VALUE hash)
487
+ {
488
+ $self->properties = value2hash(NULL, hash, 0);
489
+ }
490
+
491
+ %rename( "properties" ) get_properties(void);
492
+ /*
493
+ * Get properties as Hash
494
+ * * Input parameters to 'invoke'd methods are represented as ClientOption properties
495
+ *
496
+ * call-seq:
497
+ * options.properties -> Hash
498
+ *
499
+ */
500
+ VALUE get_properties(void)
501
+ {
502
+ return hash2value($self->properties);
503
+ }
504
+ #endif
505
+
506
+ #if defined(SWIGRUBY)
507
+ %rename( "delivery_uri=" ) set_delivery_uri(const char *delivery_uri);
508
+ #endif
509
+ /*
510
+ * Set delivery uri
511
+ *
512
+ * call-seq:
513
+ * options.delivery_uri = "http://..."
514
+ *
515
+ */
516
+ void set_delivery_uri( const char *delivery_uri ) {
517
+ wsmc_set_delivery_uri(delivery_uri, $self);
518
+ }
519
+
520
+ /*
521
+ * Get delivery uri
522
+ *
523
+ * call-seq:
524
+ * options.delivery_uri -> String
525
+ *
526
+ */
527
+ const char *delivery_uri() {
528
+ return $self->delivery_uri;
529
+ }
530
+
531
+ #if defined(SWIGRUBY)
532
+ %rename( "sub_expiry=" ) set_sub_expiry(unsigned int event_subscription_expire);
533
+ #endif
534
+ /*
535
+ * Set subscription expiry timeout (in seconds)
536
+ *
537
+ * call-seq:
538
+ * options.sub_expiry = 600 # 10 mins
539
+ *
540
+ */
541
+ void set_sub_expiry(unsigned int event_subscription_expire) {
542
+ wsmc_set_sub_expiry(event_subscription_expire, $self);
543
+ }
544
+
545
+ /*
546
+ * Get subscription expiry timeout (in seconds)
547
+ *
548
+ * call-seq:
549
+ * options.sub_expiry -> Integer
550
+ *
551
+ */
552
+ int sub_expiry() {
553
+ return $self->expires;
554
+ }
555
+
556
+ #if defined(SWIGRUBY)
557
+ %rename("heartbeat_interval=") set_heartbeat_interval(unsigned int heartbeat_interval);
558
+ #endif
559
+ /*
560
+ * Set subscription heartbeat interval (in seconds)
561
+ *
562
+ * call-seq:
563
+ * options.heartbeat_interval = 60 # every minute
564
+ *
565
+ */
566
+ void set_heartbeat_interval(unsigned int heartbeat_interval) {
567
+ wsmc_set_heartbeat_interval(heartbeat_interval, $self);
568
+ }
569
+
570
+ /*
571
+ * Get subscription heartbeat interval (in seconds)
572
+ *
573
+ * call-seq:
574
+ * options.heartbeat_interval -> Integer
575
+ *
576
+ */
577
+ int heartbeat_interval() {
578
+ return $self->heartbeat_interval;
579
+ }
580
+
581
+ #if defined(SWIGRUBY)
582
+ %rename( "delivery_mode=" ) set_delivery_mode(unsigned int delivery_mode);
583
+ #endif
584
+ /*
585
+ * Set subscription delivery mode (push, pushwithack,events,pull)
586
+ *
587
+ * call-seq:
588
+ * options.delivery_mode = Openwsman::WSMAN_DELIVERY_PUSH
589
+ *
590
+ */
591
+ void set_delivery_mode(unsigned int delivery_mode) {
592
+ if (delivery_mode > WSMAN_DELIVERY_PULL)
593
+ SWIG_exception( SWIG_ValueError, "Bad delivery mode" );
594
+
595
+ wsmc_set_delivery_mode(delivery_mode, $self);
596
+ #if defined(SWIGPYTHON) || defined(SWIGPERL) || defined(SWIGJAVA)
597
+ fail:
598
+ return;
599
+ #endif
600
+ }
601
+
602
+ /*
603
+ * Get subscription delivery mode (push, pushwithack,events,pull)
604
+ *
605
+ * call-seq:
606
+ * options.delivery_mode -> Integer
607
+ *
608
+ */
609
+ int delivery_mode() {
610
+ return $self->delivery_mode;
611
+ }
612
+
613
+ #if defined(SWIGRUBY)
614
+ %rename( "delivery_security_mode=" ) set_delivery_security_mode(unsigned int delivery_mode);
615
+ #endif
616
+ /*
617
+ * Set subscription delivery security mode
618
+ *
619
+ * (auto, http basic, http digest, https basic, https digest,
620
+ * https mutual, https mutual basic, https mutual digest,
621
+ * http spnego kerberos, https spnego kerberos,
622
+ * https mutual spnego kerberos)
623
+ *
624
+ * call-seq:
625
+ * options.delivery_security_mode = Openwsman::WSMAN_DELIVERY_SEC_HTTPS_BASIC
626
+ *
627
+ */
628
+ void set_delivery_security_mode(unsigned int delivery_sec_mode) {
629
+ if (delivery_sec_mode > WSMAN_DELIVERY_SEC_HTTP_SPNEGO_KERBEROS)
630
+ SWIG_exception( SWIG_ValueError, "Bad delivery security mode" );
631
+ wsmc_set_delivery_security_mode(delivery_sec_mode, $self);
632
+ #if defined(SWIGPYTHON) || defined(SWIGPERL) || defined(SWIGJAVA)
633
+ fail:
634
+ return;
635
+ #endif
636
+ }
637
+
638
+ /*
639
+ * Get subscription delivery security mode
640
+ *
641
+ * call-seq:
642
+ * options.delivery_security_mode -> Integer
643
+ *
644
+ */
645
+ int delivery_sec_mode() {
646
+ return $self->delivery_sec_mode;
647
+ }
648
+
649
+ }