-
Notifications
You must be signed in to change notification settings - Fork 2
/
osc_sdk.h
14817 lines (14385 loc) · 489 KB
/
osc_sdk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* BSD 3-Clause License
*
* Copyright (c) 2022, Outscale SAS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
/*
* This code is autogenerated, don't edit it directely
*/
#ifndef __SDK_C__
#define __SDK_C__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <curl/curl.h>
#ifdef __GNUC__
/*
* note that thoses attribute work, on the struct, not the pointer
* so, use it with "auto_osc_env struct osc_env e;"
* note the absence of '*' before e; (and same with osc_str)
*/
#define auto_osc_str __attribute__((cleanup(osc_deinit_str)))
#define auto_osc_env __attribute__((cleanup(osc_deinit_sdk)))
/*
* Helper for json C
*/
#define auto_osc_json_c __attribute__((cleanup(osc_deinit_json_c)))
#endif
struct osc_str {
int len;
char *buf;
};
#define OSC_ENV_FREE_AK (1 << 0)
#define OSC_ENV_FREE_REGION (1 << 1)
#define OSC_VERBOSE_MODE (1 << 2) /* curl verbose mode + print request content */
#define OSC_INSECURE_MODE (1 << 3) /* see --insecure option of curl */
#define OSC_ENV_FREE_CERT (1 << 4)
#define OSC_ENV_FREE_SSLKEY (1 << 5)
#define OSC_ENV_FREE_SK (1 << 6)
#define OSC_ENV_FREE_PROXY (1 << 7)
#define OSC_ENV_FREE_ENDPOINT (1 << 8)
#define OSC_ENV_FREE_AK_SK (OSC_ENV_FREE_AK | OSC_ENV_FREE_SK)
#define OSC_API_VERSION "1.33.1"
#define OSC_SDK_VERSION 0X001200
enum osc_auth_method {
OSC_AKSK_METHOD,
OSC_PASSWORD_METHOD,
OSC_NONE_METHOD
};
struct osc_env_conf {
char *login;
char *password;
enum osc_auth_method auth_method;
};
struct osc_env {
char *ak;
char *sk;
char *region;
char *cert;
char *sslkey;
char *proxy;
char *endpoint_allocated_;
int flag;
enum osc_auth_method auth_method;
struct curl_slist *headers;
struct osc_str endpoint;
CURL *c;
};
#define OSC_SDK_VERSON_L (sizeof "00.11.22" - 1)
static const char *osc_sdk_version_str(void)
{
static char ret[OSC_SDK_VERSON_L + 1];
if (OSC_SDK_VERSION == 0xC061AC)
return "unstable";
ret[1] = (OSC_SDK_VERSION & 0x00000F) + '0';
ret[0] = ((OSC_SDK_VERSION & 0x0000F0) >> 4) + '0';
ret[2] = '.';
ret[4] = ((OSC_SDK_VERSION & 0x000F00) >> 8) + '0';
ret[3] = ((OSC_SDK_VERSION & 0x00F000) >> 12) + '0';
ret[5] = '.';
ret[7] = ((OSC_SDK_VERSION & 0x0F0000) >> 16) + '0';
ret[6] = ((OSC_SDK_VERSION & 0xF00000) >> 20) + '0';
ret[8] = 0;
return ret;
}
struct osc_additional_strings {
char *key;
char *val;
};
struct accepter_net {
/*
* The account ID of the owner of the accepter Net.
*/
char *account_id;
/*
* The IP range for the accepter Net, in CIDR notation (for example,
* `10.0.0.0/16`).
*/
char *ip_range;
/*
* The ID of the accepter Net.
*/
char *net_id;
};
struct access_key {
/*
* The ID of the access key.
*/
char *access_key_id;
/*
* The date and time (UTC) at which the access key was created.
*/
char *creation_date;
/*
* The date and time (UTC) at which the access key expires.
*/
char *expiration_date;
/*
* The date and time (UTC) at which the access key was last modified.
*/
char *last_modification_date;
/*
* The state of the access key (`ACTIVE` if the key is valid for API
* calls, or `INACTIVE` if not).
*/
char *state;
};
struct access_key_secret_key {
/*
* The ID of the access key.
*/
char *access_key_id;
/*
* The date and time (UTC) at which the access key was created.
*/
char *creation_date;
/*
* The date and time (UTC) at which the access key expires.
*/
char *expiration_date;
/*
* The date and time (UTC) at which the access key was last modified.
*/
char *last_modification_date;
/*
* The secret key that enables you to send requests.
*/
char *secret_key;
/*
* The state of the access key (`ACTIVE` if the key is valid for API
* calls, or `INACTIVE` if not).
*/
char *state;
};
struct access_log {
/*
* If true, access logs are enabled for your load balancer. If false,
* they are not. If you set this to true in your request, the
* `OsuBucketName` parameter is required.
*/
int is_set_is_enabled;
int is_enabled;
/*
* The name of the OOS bucket for the access logs.
*/
char *osu_bucket_name;
/*
* The path to the folder of the access logs in your OOS bucket (by
* default, the `root` level of your bucket).
*/
char *osu_bucket_prefix;
/*
* The time interval for the publication of access logs in the OOS
* bucket, in minutes. This value can be either `5` or `60` (by default,
* `60`).
*/
int is_set_publication_interval;
long long int publication_interval;
};
struct account {
/*
* The ID of the account.
*/
char *account_id;
/*
* One or more additional email addresses for the account. These
* addresses are used for notifications only.
*/
char *additional_emails_str;
char **additional_emails;
/*
* The city of the account owner.
*/
char *city;
/*
* The name of the company for the account.
*/
char *company_name;
/*
* The country of the account owner.
*/
char *country;
/*
* The ID of the customer.
*/
char *customer_id;
/*
* The main email address for the account. This address is used for your
* credentials and for notifications.
*/
char *email;
/*
* The first name of the account owner.
*/
char *first_name;
/*
* The job title of the account owner.
*/
char *job_title;
/*
* The last name of the account owner.
*/
char *last_name;
/*
* The mobile phone number of the account owner.
*/
char *mobile_number;
/*
* The landline phone number of the account owner.
*/
char *phone_number;
/*
* The state/province of the account.
*/
char *state_province;
/*
* The value added tax (VAT) number for the account.
*/
char *vat_number;
/*
* The ZIP code of the city.
*/
char *zip_code;
};
struct api_access_policy {
/*
* The maximum possible lifetime for your access keys, in seconds. If
* `0`, your access keys can have unlimited lifetimes.
*/
int is_set_max_access_key_expiration_seconds;
long long int max_access_key_expiration_seconds;
/*
* If true, a trusted session is activated, allowing you to bypass
* Certificate Authorities (CAs) enforcement. For more information, see
* [About Your API Access
* Policy](https://docs.outscale.com/en/userguide/About-Your-API-Access-P
* olicy.html).<br />\nIf this is enabled, it is required that you and
* all your users log in to Cockpit v2 using the WebAuthn method for
* multi-factor authentication. For more information, see [About
* Authentication > Multi-Factor
* Authentication](https://docs.outscale.com/en/userguide/About-Authentic
* ation.html#_multi_factor_authentication).
*/
int is_set_require_trusted_env;
int require_trusted_env;
};
struct api_access_rule {
/*
* The ID of the API access rule.
*/
char *api_access_rule_id;
/*
* One or more IDs of Client Certificate Authorities (CAs) used for the
* API access rule.
*/
char *ca_ids_str;
char **ca_ids;
/*
* One or more Client Certificate Common Names (CNs).
*/
char *cns_str;
char **cns;
/*
* The description of the API access rule.
*/
char *description;
/*
* One or more IP ranges used for the API access rule, in CIDR notation
* (for example, `192.0.2.0/16`).
*/
char *ip_ranges_str;
char **ip_ranges;
};
struct application_sticky_cookie_policy {
/*
* The name of the application cookie used for stickiness.
*/
char *cookie_name;
/*
* The mnemonic name for the policy being created. The name must be
* unique within a set of policies for this load balancer.
*/
char *policy_name;
};
struct backend_vm_health {
/*
* The description of the state of the backend VM.
*/
char *description;
/*
* The state of the backend VM (`InService` \\| `OutOfService` \\|
* `Unknown`).
*/
char *state;
/*
* Information about the cause of `OutOfService` VMs.<br
* />\nSpecifically, whether the cause is Elastic Load Balancing or the
* VM (`ELB` \\| `Instance` \\| `N/A`).
*/
char *state_reason;
/*
* The ID of the backend VM.
*/
char *vm_id;
};
struct bsu_created {
/*
* If true, the volume is deleted when terminating the VM. If false, the
* volume is not deleted when terminating the VM.
*/
int is_set_delete_on_vm_deletion;
int delete_on_vm_deletion;
/*
* The date and time (UTC) at which the volume was attached to the VM,
* in ISO 8601 date-time format.
*/
char *link_date;
/*
* The state of the volume.
*/
char *state;
/*
* The ID of the volume.
*/
char *volume_id;
};
struct block_device_mapping_created {
/*
* Information about the created BSU volume.
* --Bsu.DeleteOnVmDeletion: bool
* If true, the volume is deleted when terminating the VM. If false,
* the
* volume is not deleted when terminating the VM.
* --Bsu.LinkDate: string
* The date and time (UTC) at which the volume was attached to the
* VM, in
* ISO 8601 date-time format.
* --Bsu.State: string
* The state of the volume.
* --Bsu.VolumeId: string
* The ID of the volume.
*/
char *bsu_str;
int is_set_bsu;
struct bsu_created bsu;
/*
* The name of the device.
*/
char *device_name;
};
struct bsu_to_create {
/*
* By default or if set to true, the volume is deleted when terminating
* the VM. If false, the volume is not deleted when terminating the VM.
*/
int is_set_delete_on_vm_deletion;
int delete_on_vm_deletion;
/*
* The number of I/O operations per second (IOPS). This parameter must
* be specified only if you create an `io1` volume. The maximum number
* of IOPS allowed for `io1` volumes is `13000` with a maximum
* performance ratio of 300 IOPS per gibibyte.
*/
int is_set_iops;
long long int iops;
/*
* The ID of the snapshot used to create the volume.
*/
char *snapshot_id;
/*
* The size of the volume, in gibibytes (GiB).<br />\nIf you specify a
* snapshot ID, the volume size must be at least equal to the snapshot
* size.<br />\nIf you specify a snapshot ID but no volume size, the
* volume is created with a size similar to the snapshot one.
*/
int is_set_volume_size;
long long int volume_size;
/*
* The type of the volume (`standard` \\| `io1` \\| `gp2`). If not
* specified in the request, a `standard` volume is created.<br />\nFor
* more information about volume types, see [About Volumes > Volume
* Types and
* IOPS](https://docs.outscale.com/en/userguide/About-Volumes.html#_volum
* e_types_and_iops).
*/
char *volume_type;
};
struct block_device_mapping_image {
/*
* Information about the BSU volume to create.
* --Bsu.DeleteOnVmDeletion: bool
* By default or if set to true, the volume is deleted when
* terminating the
* VM. If false, the volume is not deleted when terminating the VM.
* --Bsu.Iops: long long int
* The number of I/O operations per second (IOPS). This parameter
* must be
* specified only if you create an `io1` volume. The maximum number
* of IOPS
* allowed for `io1` volumes is `13000` with a maximum performance
* ratio of
* 300 IOPS per gibibyte.
* --Bsu.SnapshotId: string
* The ID of the snapshot used to create the volume.
* --Bsu.VolumeSize: long long int
* The size of the volume, in gibibytes (GiB).<br />\nIf you specify
* a
* snapshot ID, the volume size must be at least equal to the
* snapshot
* size.<br />\nIf you specify a snapshot ID but no volume size, the
* volume
* is created with a size similar to the snapshot one.
* --Bsu.VolumeType: string
* The type of the volume (`standard` \\| `io1` \\| `gp2`). If not
* specified in the request, a `standard` volume is created.<br
* />\nFor more
* information about volume types, see [About Volumes > Volume Types
* and
*
* IOPS](https://docs.outscale.com/en/userguide/About-Volumes.html#_volum
* e_ty
* pes_and_iops).
*/
char *bsu_str;
int is_set_bsu;
struct bsu_to_create bsu;
/*
* The device name for the volume. For a root device, you must use
* `/dev/sda1`. For other volumes, you must use `/dev/sdX`, `/dev/sdXX`,
* `/dev/xvdX`, or `/dev/xvdXX` (where the first `X` is a letter between
* `b` and `z`, and the second `X` is a letter between `a` and `z`).
*/
char *device_name;
/*
* The name of the virtual device (`ephemeralN`).
*/
char *virtual_device_name;
};
struct block_device_mapping_vm_creation {
/*
* Information about the BSU volume to create.
* --Bsu.DeleteOnVmDeletion: bool
* By default or if set to true, the volume is deleted when
* terminating the
* VM. If false, the volume is not deleted when terminating the VM.
* --Bsu.Iops: long long int
* The number of I/O operations per second (IOPS). This parameter
* must be
* specified only if you create an `io1` volume. The maximum number
* of IOPS
* allowed for `io1` volumes is `13000` with a maximum performance
* ratio of
* 300 IOPS per gibibyte.
* --Bsu.SnapshotId: string
* The ID of the snapshot used to create the volume.
* --Bsu.VolumeSize: long long int
* The size of the volume, in gibibytes (GiB).<br />\nIf you specify
* a
* snapshot ID, the volume size must be at least equal to the
* snapshot
* size.<br />\nIf you specify a snapshot ID but no volume size, the
* volume
* is created with a size similar to the snapshot one.
* --Bsu.VolumeType: string
* The type of the volume (`standard` \\| `io1` \\| `gp2`). If not
* specified in the request, a `standard` volume is created.<br
* />\nFor more
* information about volume types, see [About Volumes > Volume Types
* and
*
* IOPS](https://docs.outscale.com/en/userguide/About-Volumes.html#_volum
* e_ty
* pes_and_iops).
*/
char *bsu_str;
int is_set_bsu;
struct bsu_to_create bsu;
/*
* The device name for the volume. For a root device, you must use
* `/dev/sda1`. For other volumes, you must use `/dev/sdX`, `/dev/sdXX`,
* `/dev/xvdX`, or `/dev/xvdXX` (where the first `X` is a letter between
* `b` and `z`, and the second `X` is a letter between `a` and `z`).
*/
char *device_name;
/*
* Removes the device which is included in the block device mapping of
* the OMI.
*/
char *no_device;
/*
* The name of the virtual device (`ephemeralN`).
*/
char *virtual_device_name;
};
struct bsu_to_update_vm {
/*
* If set to true, the volume is deleted when terminating the VM. If set
* to false, the volume is not deleted when terminating the VM.
*/
int is_set_delete_on_vm_deletion;
int delete_on_vm_deletion;
/*
* The ID of the volume.
*/
char *volume_id;
};
struct block_device_mapping_vm_update {
/*
* Information about the BSU volume.
* --Bsu.DeleteOnVmDeletion: bool
* If set to true, the volume is deleted when terminating the VM. If
* set to
* false, the volume is not deleted when terminating the VM.
* --Bsu.VolumeId: string
* The ID of the volume.
*/
char *bsu_str;
int is_set_bsu;
struct bsu_to_update_vm bsu;
/*
* The device name for the volume. For a root device, you must use
* `/dev/sda1`. For other volumes, you must use `/dev/sdX`, `/dev/sdXX`,
* `/dev/xvdX`, or `/dev/xvdXX` (where the first `X` is a letter between
* `b` and `z`, and the second `X` is a letter between `a` and `z`).
*/
char *device_name;
/*
* Removes the device which is included in the block device mapping of
* the OMI.
*/
char *no_device;
/*
* The name of the virtual device (`ephemeralN`).
*/
char *virtual_device_name;
};
struct ca {
/*
* The fingerprint of the CA.
*/
char *ca_fingerprint;
/*
* The ID of the CA.
*/
char *ca_id;
/*
* The description of the CA.
*/
char *description;
};
struct catalog {
/*
* One or more catalog entries.
* Information about the catalog entry.
* --Entries.INDEX.Category: string
* The category of the catalog entry (for example, `network`).
* --Entries.INDEX.Flags: string
* When returned and equal to `PER_MONTH`, the price of the catalog
* entry
* is calculated on a monthly basis.
* --Entries.INDEX.Operation: string
* The API call associated with the catalog entry (for example,
* `CreateVms`
* or `RunInstances`).
* --Entries.INDEX.Service: string
* The service associated with the catalog entry (`TinaOS-FCU`,
* `TinaOS-LBU`, `TinaOS-DirectLink`, or `TinaOS-OOS`).
* --Entries.INDEX.SubregionName: string
* The Subregion associated with the catalog entry.
* --Entries.INDEX.Title: string
* The description of the catalog entry.
* --Entries.INDEX.Type: string
* The type of resource associated with the catalog entry.
* --Entries.INDEX.UnitPrice: double
* The unit price of the catalog entry in the currency of your
* account, in
* the ISO-4217 format (for example, `EUR`).
*/
char *entries_str;
int nb_entries;
struct catalog_entry *entries;
};
struct catalog_entry {
/*
* The category of the catalog entry (for example, `network`).
*/
char *category;
/*
* When returned and equal to `PER_MONTH`, the price of the catalog
* entry is calculated on a monthly basis.
*/
char *flags;
/*
* The API call associated with the catalog entry (for example,
* `CreateVms` or `RunInstances`).
*/
char *operation;
/*
* The service associated with the catalog entry (`TinaOS-FCU`,
* `TinaOS-LBU`, `TinaOS-DirectLink`, or `TinaOS-OOS`).
*/
char *service;
/*
* The Subregion associated with the catalog entry.
*/
char *subregion_name;
/*
* The description of the catalog entry.
*/
char *title;
/*
* The type of resource associated with the catalog entry.
*/
char *type;
/*
* The unit price of the catalog entry in the currency of your account,
* in the ISO-4217 format (for example, `EUR`).
*/
int is_set_unit_price;
double unit_price;
};
struct catalogs {
/*
* One or more catalog entries.
* Information about the catalog entry.
* --Entries.INDEX.Category: string
* The category of the catalog entry (for example, `network`).
* --Entries.INDEX.Flags: string
* When returned and equal to `PER_MONTH`, the price of the catalog
* entry
* is calculated on a monthly basis.
* --Entries.INDEX.Operation: string
* The API call associated with the catalog entry (for example,
* `CreateVms`
* or `RunInstances`).
* --Entries.INDEX.Service: string
* The service associated with the catalog entry (`TinaOS-FCU`,
* `TinaOS-LBU`, `TinaOS-DirectLink`, or `TinaOS-OOS`).
* --Entries.INDEX.SubregionName: string
* The Subregion associated with the catalog entry.
* --Entries.INDEX.Title: string
* The description of the catalog entry.
* --Entries.INDEX.Type: string
* The type of resource associated with the catalog entry.
* --Entries.INDEX.UnitPrice: double
* The unit price of the catalog entry in the currency of your
* account, in
* the ISO-4217 format (for example, `EUR`).
*/
char *entries_str;
int nb_entries;
struct catalog_entry *entries;
/*
* The beginning of the time period (UTC).
*/
char *from_date;
/*
* The state of the catalog (`CURRENT` \\| `OBSOLETE`).
*/
char *state;
/*
* The end of the time period (UTC).
*/
char *to_date;
};
struct client_gateway {
/*
* The Autonomous System Number (ASN) used by the Border Gateway
* Protocol (BGP) to find the path to your client gateway through the
* Internet.
*/
int is_set_bgp_asn;
long long int bgp_asn;
/*
* The ID of the client gateway.
*/
char *client_gateway_id;
/*
* The type of communication tunnel used by the client gateway (always
* `ipsec.1`).
*/
char *connection_type;
/*
* The public IPv4 address of the client gateway (must be a fixed
* address into a NATed network).
*/
char *public_ip;
/*
* The state of the client gateway (`pending` \\| `available` \\|
* `deleting` \\| `deleted`).
*/
char *state;
/*
* One or more tags associated with the client gateway.
* Information about the tag.
* --Tags.INDEX.Key: string
* The key of the tag, with a minimum of 1 character.
* --Tags.INDEX.Value: string
* The value of the tag, between 0 and 255 characters.
*/
char *tags_str;
int nb_tags;
struct resource_tag *tags;
};
struct consumption_entry {
/*
* The ID of your TINA account.
*/
char *account_id;
/*
* The category of the resource (for example, `network`).
*/
char *category;
/*
* The beginning of the time period (UTC).
*/
char *from_date;
/*
* The API call that triggered the resource consumption (for example,
* `RunInstances` or `CreateVolume`).
*/
char *operation;
/*
* The ID of the TINA account which is billed for your consumption. It
* can be different from your account in the `AccountId` parameter.
*/
char *paying_account_id;
/*
* The total price of the consumed resource during the specified time
* period, in the currency of the Region's catalog.
*/
int is_set_price;
double price;
/*
* The service of the API call (`TinaOS-FCU`, `TinaOS-LBU`,
* `TinaOS-DirectLink`, `TinaOS-OOS`, or `TinaOS-OSU`).
*/
char *service;
/*
* The name of the Subregion.
*/
char *subregion_name;
/*
* A description of the consumed resource.
*/
char *title;
/*
* The end of the time period (UTC).
*/
char *to_date;
/*
* The type of resource, depending on the API call.
*/
char *type;
/*
* The unit price of the consumed resource in the currency of your
* account, in the ISO-4217 format (for example, `EUR`).
*/
int is_set_unit_price;
double unit_price;
/*
* The consumed amount for the resource. The unit depends on the
* resource type. For more information, see the `Title` element.
*/
int is_set_value;
double value;
};
struct dedicated_group {
/*
* The account ID of the owners of the dedicated group.
*/
char *account_id;
/*
* The processor generation.
*/
int is_set_cpu_generation;
long long int cpu_generation;
/*
* The ID of the dedicated group.
*/
char *dedicated_group_id;
/*
* The name of the dedicated group.
*/
char *name;
/*
* The IDs of the Nets in the dedicated group.
*/
char *net_ids_str;
char **net_ids;
/*
* The name of the Subregion in which the dedicated group is located.
*/
char *subregion_name;
/*
* The IDs of the VMs in the dedicated group.
*/
char *vm_ids_str;
char **vm_ids;
};
struct dhcp_options_set {
/*
* If true, the DHCP options set is a default one. If false, it is not.
*/
int is_set_default_arg;
int default_arg;
/*
* The ID of the DHCP options set.
*/
char *dhcp_options_set_id;
/*
* The domain name.
*/
char *domain_name;
/*
* One or more IPs for the domain name servers.
*/
char *domain_name_servers_str;
char **domain_name_servers;
/*
* One or more IPs for the log servers.
*/
char *log_servers_str;
char **log_servers;
/*
* One or more IPs for the NTP servers.
*/
char *ntp_servers_str;
char **ntp_servers;
/*
* One or more tags associated with the DHCP options set.
* Information about the tag.
* --Tags.INDEX.Key: string
* The key of the tag, with a minimum of 1 character.
* --Tags.INDEX.Value: string
* The value of the tag, between 0 and 255 characters.
*/
char *tags_str;
int nb_tags;
struct resource_tag *tags;
};
struct direct_link {
/*
* The account ID of the owner of the DirectLink.
*/
char *account_id;
/*
* The physical link bandwidth (either 1 Gbps or 10 Gbps).
*/
char *bandwidth;
/*
* The ID of the DirectLink (for example, `dxcon-xxxxxxxx`).
*/
char *direct_link_id;
/*
* The name of the DirectLink.
*/
char *direct_link_name;
/*
* The datacenter where the DirectLink is located.
*/
char *location;
/*
* The Region in which the DirectLink has been created.
*/
char *region_name;
/*
* The state of the DirectLink.<br />\n* `requested`: The DirectLink is
* requested but the request has not been validated yet.<br />\n*
* `pending`: The DirectLink request has been validated. It remains in
* the `pending` state until you establish the physical link.<br />\n*
* `available`: The physical link is established and the connection is
* ready to use.<br />\n* `deleting`: The deletion process is in
* progress.<br />\n* `deleted`: The DirectLink is deleted.
*/
char *state;
};
struct direct_link_interface {
/*
* The BGP (Border Gateway Protocol) ASN (Autonomous System Number) on
* the customer's side of the DirectLink interface. This number must be
* between `64512` and `65534`.
*/
int is_set_bgp_asn;
long long int bgp_asn;
/*
* The BGP authentication key.
*/
char *bgp_key;
/*
* The IP on the customer's side of the DirectLink interface.
*/
char *client_private_ip;
/*
* The name of the DirectLink interface.
*/
char *direct_link_interface_name;
/*
* The IP on the OUTSCALE side of the DirectLink interface.
*/
char *outscale_private_ip;
/*
* The ID of the target virtual gateway.
*/
char *virtual_gateway_id;
/*
* The VLAN number associated with the DirectLink interface. This number
* must be unique and be between `2` and `4094`.
*/
int is_set_vlan;