diff --git a/osc_sdk.c b/osc_sdk.c
index 797ec7c..92b5178 100644
--- a/osc_sdk.c
+++ b/osc_sdk.c
@@ -74,6 +74,8 @@ static inline char* stpcpy(char *dest, const char *src)
static const char *calls_name[] = {
"UpdateVpnConnection",
"UpdateVolume",
+ "UpdateVmTemplate",
+ "UpdateVmGroup",
"UpdateVm",
"UpdateSubnet",
"UpdateSnapshot",
@@ -105,6 +107,8 @@ static const char *calls_name[] = {
"StopVms",
"StartVms",
"SendResetPasswordEmail",
+ "ScaleUpVmGroup",
+ "ScaleDownVmGroup",
"ResetAccountPassword",
"RejectNetPeering",
"RegisterVmsInLoadBalancer",
@@ -115,6 +119,8 @@ static const char *calls_name[] = {
"ReadVmsHealth",
"ReadVms",
"ReadVmTypes",
+ "ReadVmTemplates",
+ "ReadVmGroups",
"ReadVirtualGateways",
"ReadTags",
"ReadSubregions",
@@ -153,6 +159,7 @@ static const char *calls_name[] = {
"ReadConsumptionAccount",
"ReadConsoleOutput",
"ReadClientGateways",
+ "ReadCatalogs",
"ReadCatalog",
"ReadCas",
"ReadApiLogs",
@@ -175,6 +182,8 @@ static const char *calls_name[] = {
"DeleteVpnConnection",
"DeleteVolume",
"DeleteVms",
+ "DeleteVmTemplate",
+ "DeleteVmGroup",
"DeleteVirtualGateway",
"DeleteTags",
"DeleteSubnet",
@@ -211,6 +220,8 @@ static const char *calls_name[] = {
"CreateVpnConnection",
"CreateVolume",
"CreateVms",
+ "CreateVmTemplate",
+ "CreateVmGroup",
"CreateVirtualGateway",
"CreateTags",
"CreateSubnet",
@@ -254,6 +265,10 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli UpdateVpnConnection [options]\n" "Modifies the specified attributes of a VPN connection.\n" "\nRequired Argument: VpnConnectionId \n"
,
"Usage: oapi-cli UpdateVolume [options]\n" "Modifies the specified attributes of a volume.\nCold volumes are volumes that \n" "are attached to stopped or stopping VMs, or that are detached. Hot volumes are \n" "volumes that are attached to running VMs.\n\n**[NOTE]**\nWhen the modification \n" "is not instantaneous, the response displays the previous value. You can use the \n" "[ReadVolumes](#readvolumes) method to see the new value.\n" "\nRequired Argument: VolumeId \n"
+,
+ "Usage: oapi-cli UpdateVmTemplate [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nModifies the specified attributes of a template of virtual \n" "machines (VMs).\n" "\nRequired Argument: VmTemplateId \n"
+,
+ "Usage: oapi-cli UpdateVmGroup [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nModifies the specified attributes of a group of virtual machines \n" "(VMs).\n" "\nRequired Argument: VmGroupId \n"
,
"Usage: oapi-cli UpdateVm [options]\n" "Modifies the specified attributes of a virtual machine (VM).\nYou must stop the \n" "VM before modifying the following attributes:\n* `NestedVirtualization`\n* \n" "`Performance`\n* `UserData`\n* `VmType`\n" "\nRequired Argument: VmId \n"
,
@@ -316,6 +331,10 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli StartVms [options]\n" "Start one or more virtual machines (VMs).\nYou can start only VMs that are \n" "valid and that belong to you.\n" "\nRequired Argument: VmIds \n"
,
"Usage: oapi-cli SendResetPasswordEmail [options]\n" "Sends an email to the email address provided for the account with a token to \n" "reset your password.\nYou need to provide this token when updating the account \n" "password using the ResetAccountPassword method.\n**[NOTE]**\nTo protect against \n" "brute force attacks, the number of requests allowed for this method in a given \n" "time period is limited.\n" "\nRequired Argument: Email \n"
+,
+ "Usage: oapi-cli ScaleUpVmGroup [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nCreates additional virtual machines (VMs) in a VM group.\nThe new \n" "VMs use the current version of the VM template.\n" "\nRequired Argument: VmGroupId, VmAddition \n"
+,
+ "Usage: oapi-cli ScaleDownVmGroup [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nDeletes virtual machines (VMs) from a VM group.\nThe oldest VMs \n" "are the first to be deleted.\n" "\nRequired Argument: VmGroupId, VmSubtraction \n"
,
"Usage: oapi-cli ResetAccountPassword [options]\n" "Replaces the account password with the new one you provide.\nYou must also \n" "provide the token you received by email when asking for a password reset using \n" "the SendResetPasswordEmail method.\nPassword strength is tested through \n" "heuristic algorithms. For more information, see the [zxcvbn \n" "GitHub](https://github.com/dropbox/zxcvbn).\n**[NOTE]**\nTo protect against \n" "brute force attacks, the number of requests allowed for this method in a given \n" "time period is limited.\n" "\nRequired Argument: Password, Token \n"
,
@@ -336,6 +355,10 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli ReadVms [options]\n" "Lists one or more of your virtual machines (VMs).\nIf you provide one or more \n" "VM IDs, this action returns a description for all of these VMs. If you do not \n" "provide any VM ID, this action returns a description for all of the VMs that \n" "belong to you. If you provide an invalid VM ID, an error is returned. If you \n" "provide the ID of a VM that does not belong to you, the description of this VM \n" "is not included in the response. The refresh interval for data returned by this \n" "action is one hour, meaning that a terminated VM may appear in the \n" "response.\n\n**[NOTE]**\nIf you exceed the number of identical requests allowed \n" "for a configured time period, the `RequestLimitExceeded` error message is \n" "returned.\n" "\nRequired Argument: none \n"
,
"Usage: oapi-cli ReadVmTypes [options]\n" "Lists one or more predefined VM types.\n\n**[NOTE]**\nIf you exceed the number \n" "of identical requests allowed for a configured time period, the \n" "`RequestLimitExceeded` error message is returned.\n" "\nRequired Argument: none \n"
+,
+ "Usage: oapi-cli ReadVmTemplates [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nLists one or more virtual machine (VM) templates.\n" "\nRequired Argument: none \n"
+,
+ "Usage: oapi-cli ReadVmGroups [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nLists one or more group of virtual machines (VMs).\n" "\nRequired Argument: none \n"
,
"Usage: oapi-cli ReadVirtualGateways [options]\n" "Lists one or more virtual gateways.\n\n**[NOTE]**\nIf you exceed the number of \n" "identical requests allowed for a configured time period, the \n" "`RequestLimitExceeded` error message is returned.\n" "\nRequired Argument: none \n"
,
@@ -412,6 +435,8 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli ReadConsoleOutput [options]\n" "Gets the console output for a virtual machine (VM). This console provides the \n" "most recent 64 KiB output.\n\n**[NOTE]**\nOn Windows VMs, the console is \n" "handled only on the first boot. It returns no output after the first boot.\n" "\nRequired Argument: VmId \n"
,
"Usage: oapi-cli ReadClientGateways [options]\n" "Lists one or more of your client gateways.\n\n**[NOTE]**\nIf you exceed the \n" "number of identical requests allowed for a configured time period, the \n" "`RequestLimitExceeded` error message is returned.\n" "\nRequired Argument: none \n"
+,
+ "Usage: oapi-cli ReadCatalogs [options]\n" "Returns the price list of OUTSCALE products and services for the current Region \n" "within a specific time period.\n" "\nRequired Argument: none \n"
,
"Usage: oapi-cli ReadCatalog [options]\n" "Returns the price list of OUTSCALE products and services for the current Region.\n" "\nRequired Argument: none \n"
,
@@ -456,6 +481,10 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli DeleteVolume [options]\n" "Deletes a specified Block Storage Unit (BSU) volume.\nYou can delete available \n" "volumes only, that is, volumes that are not attached to a virtual machine (VM).\n" "\nRequired Argument: VolumeId \n"
,
"Usage: oapi-cli DeleteVms [options]\n" "Terminates one or more virtual machines (VMs).\nThis operation is idempotent, \n" "that means that all calls succeed if you terminate a VM more than once.\n" "\nRequired Argument: VmIds \n"
+,
+ "Usage: oapi-cli DeleteVmTemplate [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nDeletes a virtual machine (VM) template.\nYou cannot delete a \n" "template currently used by a VM group.\n" "\nRequired Argument: VmTemplateId \n"
+,
+ "Usage: oapi-cli DeleteVmGroup [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nDeletes a specified VM group.\n" "\nRequired Argument: VmGroupId \n"
,
"Usage: oapi-cli DeleteVirtualGateway [options]\n" "Deletes a specified virtual gateway.\nBefore deleting a virtual gateway, we \n" "recommend to detach it from the Net and delete the VPN connection.\n" "\nRequired Argument: VirtualGatewayId \n"
,
@@ -528,6 +557,10 @@ static const char *calls_descriptions[] = {
"Usage: oapi-cli CreateVolume [options]\n" "Creates a Block Storage Unit (BSU) volume in a specified Region.\nBSU volumes \n" "can be attached to a virtual machine (VM) in the same Subregion. You can create \n" "an empty volume or restore a volume from an existing snapshot.\nYou can create \n" "the following volume types: Enterprise (`io1`) for provisioned IOPS SSD \n" "volumes, Performance (`gp2`) for general purpose SSD volumes, or Magnetic \n" "(`standard`) volumes.\n" "\nRequired Argument: SubregionName \n"
,
"Usage: oapi-cli CreateVms [options]\n" "Creates virtual machines (VMs), and then launches them.\nThis action enables \n" "you to create a specified number of VMs using an OUTSCALE machine image (OMI) \n" "that you are allowed to use, and then to automatically launch them.\nThe VMs \n" "remain in the `pending` state until they are created and ready to be used. Once \n" "automatically launched, they are in the `running` state.\nTo check the state of \n" "your VMs, call the [ReadVms](#readvms) method.\nIf not specified, the security \n" "group used by the service is the default one.\nThe metadata server enables you \n" "to get the public key provided when the VM is launched. Official OMIs contain a \n" "script to get this public key and put it inside the VM to provide secure access \n" "without password.\n" "\nRequired Argument: ImageId \n"
+,
+ "Usage: oapi-cli CreateVmTemplate [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nCreates a virtual machine (VM) template. You can then use the VM \n" "template to create VM groups.\nYou can create up to 50 VM templates in your \n" "account.\n" "\nRequired Argument: CpuCores, CpuGeneration, ImageId, Ram, VmTemplateName \n"
+,
+ "Usage: oapi-cli CreateVmGroup [options]\n" "> [WARNING]\n> This feature is currently under development and may not function \n" "properly.\n\nCreates a group of virtual machines (VMs) containing the same \n" "characteristics as a specified VM template, and then launches them.\nYou can \n" "create up to 100 VM groups in your account.\n" "\nRequired Argument: SecurityGroupIds, SubnetId, VmGroupName, VmTemplateId, VmCount \n"
,
"Usage: oapi-cli CreateVirtualGateway [options]\n" "Creates a virtual gateway.\nA virtual gateway is the access point on the Net \n" "side of a VPN connection.\n" "\nRequired Argument: ConnectionType \n"
,
@@ -636,6 +669,32 @@ static const char *calls_args_descriptions[] = {
" (cold volume only) The new type of the volume (`standard` \\| `io1` \n"
" \\| `gp2`). This modification is instantaneous. If you update to an \n"
" `io1` volume, you must also specify the `Iops` parameter.\n"
+,
+ "Description: string\n"
+ " A new description for the VM template.\n"
+"DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"Tags: array ref ResourceTag\n"
+ " New tags for your VM template.\n"
+"VmTemplateId: string\n"
+ " The ID of the VM template you want to update.\n"
+"VmTemplateName: string\n"
+ " A new name for your VM template.\n"
+,
+ "Description: string\n"
+ " A new description for the VM group.\n"
+"DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"Tags: array ref ResourceTag\n"
+ " New tags for your VM group.\n"
+"VmGroupId: string\n"
+ " The ID of the VM group you want to update.\n"
+"VmGroupName: string\n"
+ " A new name for your VM group.\n"
+"VmTemplateId: string\n"
+ " A new VM template ID for your VM group.\n"
,
"BlockDeviceMappings: array ref BlockDeviceMappingVmUpdate\n"
" One or more block device mappings of the VM.\n"
@@ -925,9 +984,10 @@ static const char *calls_args_descriptions[] = {
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
"ExpirationDate: string\n"
- " The date and time at which you want the access key to expire, in ISO \n"
- " 8601 format (for example, `2017-06-14` or `2017-06-14T00:00:00Z`). If \n"
- " not specified, the access key is set to not expire.\n"
+ " The date and time, or the date, at which you want the access key to \n"
+ " expire, in ISO 8601 format (for example, `2020-06-14T00:00:00.000Z` \n"
+ " or `2020-06-14`). If not specified, the access key is set to not \n"
+ " expire.\n"
"State: string\n"
" The new state for the access key (`ACTIVE` \\| `INACTIVE`). When set \n"
" to `ACTIVE`, the access key is enabled and can be used to send \n"
@@ -1028,6 +1088,22 @@ static const char *calls_args_descriptions[] = {
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
+"VmAddition: int\n"
+ " The number of VMs you want to add to the VM group.\n"
+"VmGroupId: string\n"
+ " The ID of the VM group you want to scale up.\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"VmGroupId: string\n"
+ " The ID of the VM group you want to scale down.\n"
+"VmSubtraction: int\n"
+ " The number of VMs you want to delete from the VM group.\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
"Password: string\n"
" The new password for the account.\n"
"Token: string\n"
@@ -1098,6 +1174,18 @@ static const char *calls_args_descriptions[] = {
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
+"Filters: ref FiltersVmTemplate\n"
+ " null\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"Filters: ref FiltersVmGroup\n"
+ " ReadVmGroupsRequest_Filters\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
"Filters: ref FiltersVirtualGateway\n"
" null\n"
,
@@ -1299,8 +1387,10 @@ static const char *calls_args_descriptions[] = {
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
"FromDate: string\n"
- " The beginning of the time period, in ISO 8601 date-time format (for \n"
- " example, `2017-06-14` or `2017-06-14T00:00:00Z`).\n"
+ " The beginning of the time period, in ISO 8601 date format (for \n"
+ " example, `2020-06-14`). The date-time format is also accepted, but \n"
+ " only with a time set to midnight (for example, \n"
+ " `2020-06-14T00:00:00.000Z`).\n"
"Overall: bool\n"
" By default or if false, returns only the consumption of the specific \n"
" account that sends this request. If true, returns either the overall \n"
@@ -1308,8 +1398,9 @@ static const char *calls_args_descriptions[] = {
" account that sends this request is a paying account) or returns \n"
" nothing (if the account that sends this request is a linked account).\n"
"ToDate: string\n"
- " The end of the time period, in ISO 8601 date-time format (for \n"
- " example, `2017-06-30` or `2017-06-30T00:00:00Z`).\n"
+ " The end of the time period, in ISO 8601 date format (for example, \n"
+ " `2020-06-30`). The date-time format is also accepted, but only with a \n"
+ " time set to midnight (for example, `2020-06-30T00:00:00.000Z`).\n"
,
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
@@ -1326,6 +1417,12 @@ static const char *calls_args_descriptions[] = {
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
+"Filters: ref FiltersCatalogs\n"
+ " ReadCatalogsRequest_Filters\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
,
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
@@ -1520,6 +1617,18 @@ static const char *calls_args_descriptions[] = {
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
+"VmTemplateId: string\n"
+ " The ID of the VM template you want to delete. \n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"VmGroupId: string\n"
+ " The ID of the VM group you want to delete.\n"
+,
+ "DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
"VirtualGatewayId: string\n"
" The ID of the virtual gateway you want to delete.\n"
,
@@ -1868,6 +1977,54 @@ static const char *calls_args_descriptions[] = {
" regardless of the value you may have provided in the `Performance` \n"
" parameter. For more information, see [Instance \n"
" Types](https://docs.outscale.com/en/userguide/Instance-Types.html).\n"
+,
+ "CpuCores: int\n"
+ " The number of vCores to use for each VM.\n"
+"CpuGeneration: string\n"
+ " The processor generation to use for each VM (for example, `v4`).\n"
+"CpuPerformance: string\n"
+ " The performance of the VMs (`medium` \\| `high` \\| `highest`). \n"
+"Description: string\n"
+ " A description for the VM template.\n"
+"DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"ImageId: string\n"
+ " The ID of the OMI to use for each VM. You can find a list of OMIs by \n"
+ " calling the [ReadImages](#readimages) method.\n"
+"KeypairName: string\n"
+ " The name of the keypair to use for each VM.\n"
+"Ram: int\n"
+ " The amount of RAM to use for each VM.\n"
+"Tags: array ref ResourceTag\n"
+ " One or more tags to add to the VM template.\n"
+"VmTemplateName: string\n"
+ " The name of the VM template.\n"
+,
+ "Description: string\n"
+ " A description for the VM group.\n"
+"DryRun: bool\n"
+ " If true, checks whether you have the required permissions to perform \n"
+ " the action.\n"
+"PositioningStrategy: string\n"
+ " The positioning strategy of VMs on hypervisors. By default, or if set \n"
+ " to `no-strategy` our orchestrator determines the most adequate \n"
+ " position for your VMs. If set to `attract`, your VMs are deployed on \n"
+ " the same hypervisor, which improves network performance. If set to \n"
+ " `repulse`, your VMs are deployed on a different hypervisor, which \n"
+ " improves fault tolerance.\n"
+"SecurityGroupIds: array string\n"
+ " One or more IDs of security groups for the VM group.\n"
+"SubnetId: string\n"
+ " The ID of the Subnet in which you want to create the VM group.\n"
+"Tags: array ref ResourceTag\n"
+ " One or more tags to add to the VM group.\n"
+"VmCount: int\n"
+ " The number of VMs deployed in the VM group.\n"
+"VmGroupName: string\n"
+ " The name of the VM group.\n"
+"VmTemplateId: string\n"
+ " The ID of the VM template used to launch VMs in the VM group.\n"
,
"ConnectionType: string\n"
" The type of VPN connection supported by the virtual gateway (only \n"
@@ -2214,6 +2371,8 @@ static const char *calls_args_descriptions[] = {
"NoReboot: bool\n"
" If false, the VM shuts down before creating the OMI and then reboots. \n"
" If true, the VM does not.\n"
+"ProductCodes: array string\n"
+ " The product codes associated with the OMI.\n"
"RootDeviceName: string\n"
" The name of the root device. You must specify only one of the \n"
" following parameters: `FileLocation`, `RootDeviceName`, \n"
@@ -2366,10 +2525,10 @@ static const char *calls_args_descriptions[] = {
" If true, checks whether you have the required permissions to perform \n"
" the action.\n"
"ExpirationDate: string\n"
- " The date and time at which you want the access key to expire, in ISO \n"
- " 8601 format (for example, `2017-06-14` or `2017-06-14T00:00:00Z`). To \n"
- " remove an existing expiration date, use the method without specifying \n"
- " this parameter.\n"
+ " The date and time, or the date, at which you want the access key to \n"
+ " expire, in ISO 8601 format (for example, `2020-06-14T00:00:00.000Z`, \n"
+ " or `2020-06-14`). To remove an existing expiration date, use the \n"
+ " method without specifying this parameter.\n"
,
"DryRun: bool\n"
" If true, checks whether you have the required permissions to perform \n"
@@ -2715,6 +2874,7 @@ static int bsu_to_update_vm_setter(struct bsu_to_update_vm *args, struct osc_str
static int ca_setter(struct ca *args, struct osc_str *data);
static int catalog_setter(struct catalog *args, struct osc_str *data);
static int catalog_entry_setter(struct catalog_entry *args, struct osc_str *data);
+static int catalogs_setter(struct catalogs *args, struct osc_str *data);
static int client_gateway_setter(struct client_gateway *args, struct osc_str *data);
static int consumption_entry_setter(struct consumption_entry *args, struct osc_str *data);
static int dhcp_options_set_setter(struct dhcp_options_set *args, struct osc_str *data);
@@ -2726,6 +2886,7 @@ static int filters_access_keys_setter(struct filters_access_keys *args, struct o
static int filters_api_access_rule_setter(struct filters_api_access_rule *args, struct osc_str *data);
static int filters_api_log_setter(struct filters_api_log *args, struct osc_str *data);
static int filters_ca_setter(struct filters_ca *args, struct osc_str *data);
+static int filters_catalogs_setter(struct filters_catalogs *args, struct osc_str *data);
static int filters_client_gateway_setter(struct filters_client_gateway *args, struct osc_str *data);
static int filters_dhcp_options_setter(struct filters_dhcp_options *args, struct osc_str *data);
static int filters_direct_link_setter(struct filters_direct_link *args, struct osc_str *data);
@@ -2755,6 +2916,8 @@ static int filters_subregion_setter(struct filters_subregion *args, struct osc_s
static int filters_tag_setter(struct filters_tag *args, struct osc_str *data);
static int filters_virtual_gateway_setter(struct filters_virtual_gateway *args, struct osc_str *data);
static int filters_vm_setter(struct filters_vm *args, struct osc_str *data);
+static int filters_vm_group_setter(struct filters_vm_group *args, struct osc_str *data);
+static int filters_vm_template_setter(struct filters_vm_template *args, struct osc_str *data);
static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str *data);
static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data);
static int filters_volume_setter(struct filters_volume *args, struct osc_str *data);
@@ -2835,8 +2998,10 @@ static int tag_setter(struct tag *args, struct osc_str *data);
static int vgw_telemetry_setter(struct vgw_telemetry *args, struct osc_str *data);
static int virtual_gateway_setter(struct virtual_gateway *args, struct osc_str *data);
static int vm_setter(struct vm *args, struct osc_str *data);
+static int vm_group_setter(struct vm_group *args, struct osc_str *data);
static int vm_state_setter(struct vm_state *args, struct osc_str *data);
static int vm_states_setter(struct vm_states *args, struct osc_str *data);
+static int vm_template_setter(struct vm_template *args, struct osc_str *data);
static int vm_type_setter(struct vm_type *args, struct osc_str *data);
static int volume_setter(struct volume *args, struct osc_str *data);
static int vpn_connection_setter(struct vpn_connection *args, struct osc_str *data);
@@ -3677,6 +3842,57 @@ static int catalog_entry_setter(struct catalog_entry *args, struct osc_str *data
}
return !!ret;
}
+static int catalogs_setter(struct catalogs *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->entries) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Entries\":[" ));
+ for (int i = 0; i < args->nb_entries; ++i) {
+ struct catalog_entry *p = &args->entries[i];
+ if (p != args->entries)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(catalog_entry_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->entries_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Entries\":" ));
+ STRY(osc_str_append_string(data, args->entries_str));
+ ret += 1;
+ }
+ if (args->from_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"FromDate\":\"" ));
+ STRY(osc_str_append_string(data, args->from_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->state) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"State\":\"" ));
+ STRY(osc_str_append_string(data, args->state));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->to_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ToDate\":\"" ));
+ STRY(osc_str_append_string(data, args->to_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ return !!ret;
+}
static int client_gateway_setter(struct client_gateway *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
@@ -4622,6 +4838,34 @@ static int filters_ca_setter(struct filters_ca *args, struct osc_str *data) {
}
return !!ret;
}
+static int filters_catalogs_setter(struct filters_catalogs *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->is_set_current_catalog_only) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CurrentCatalogOnly\":" ));
+ STRY(osc_str_append_bool(data, args->current_catalog_only));
+ ret += 1;
+ }
+ if (args->from_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"FromDate\":\"" ));
+ STRY(osc_str_append_string(data, args->from_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->to_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ToDate\":\"" ));
+ STRY(osc_str_append_string(data, args->to_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ return !!ret;
+}
static int filters_client_gateway_setter(struct filters_client_gateway *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
@@ -8639,6 +8883,14 @@ static int filters_snapshot_setter(struct filters_snapshot *args, struct osc_str
STRY(osc_str_append_string(data, args->descriptions_str));
ret += 1;
}
+ if (args->from_creation_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"FromCreationDate\":\"" ));
+ STRY(osc_str_append_string(data, args->from_creation_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
if (args->permissions_to_create_volume_account_ids) {
char **as;
@@ -8798,6 +9050,14 @@ static int filters_snapshot_setter(struct filters_snapshot *args, struct osc_str
STRY(osc_str_append_string(data, args->tags_str));
ret += 1;
}
+ if (args->to_creation_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ToCreationDate\":\"" ));
+ STRY(osc_str_append_string(data, args->to_creation_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
if (args->volume_ids) {
char **as;
@@ -9437,64 +9697,61 @@ static int filters_vm_setter(struct filters_vm *args, struct osc_str *data) {
}
return !!ret;
}
-static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str *data) {
+static int filters_vm_group_setter(struct filters_vm_group *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
- if (args->is_set_bsu_optimized) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BsuOptimized\":" ));
- STRY(osc_str_append_bool(data, args->bsu_optimized));
- ret += 1;
- }
- if (args->memory_sizes) {
- double *ip;
+ if (args->descriptions) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MemorySizes\":[" ));
- for (ip = args->memory_sizes; *ip > 0; ++ip) {
- if (ip != args->memory_sizes)
+ STRY(osc_str_append_string(data, "\"Descriptions\":[" ));
+ for (as = args->descriptions; *as > 0; ++as) {
+ if (as != args->descriptions)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_double(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->memory_sizes_str) {
+ } else if (args->descriptions_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MemorySizes\":" ));
- STRY(osc_str_append_string(data, args->memory_sizes_str));
+ STRY(osc_str_append_string(data, "\"Descriptions\":" ));
+ STRY(osc_str_append_string(data, args->descriptions_str));
ret += 1;
}
- if (args->vcore_counts) {
- int *ip;
+ if (args->security_group_ids) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VcoreCounts\":[" ));
- for (ip = args->vcore_counts; *ip > 0; ++ip) {
- if (ip != args->vcore_counts)
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":[" ));
+ for (as = args->security_group_ids; *as > 0; ++as) {
+ if (as != args->security_group_ids)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_int(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->vcore_counts_str) {
+ } else if (args->security_group_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VcoreCounts\":" ));
- STRY(osc_str_append_string(data, args->vcore_counts_str));
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":" ));
+ STRY(osc_str_append_string(data, args->security_group_ids_str));
ret += 1;
}
- if (args->vm_type_names) {
+ if (args->subnet_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmTypeNames\":[" ));
- for (as = args->vm_type_names; *as > 0; ++as) {
- if (as != args->vm_type_names)
+ STRY(osc_str_append_string(data, "\"SubnetIds\":[" ));
+ for (as = args->subnet_ids; *as > 0; ++as) {
+ if (as != args->subnet_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9502,110 +9759,65 @@ static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str *
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->vm_type_names_str) {
+ } else if (args->subnet_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmTypeNames\":" ));
- STRY(osc_str_append_string(data, args->vm_type_names_str));
+ STRY(osc_str_append_string(data, "\"SubnetIds\":" ));
+ STRY(osc_str_append_string(data, args->subnet_ids_str));
ret += 1;
}
- if (args->volume_counts) {
- int *ip;
+ if (args->tag_keys) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeCounts\":[" ));
- for (ip = args->volume_counts; *ip > 0; ++ip) {
- if (ip != args->volume_counts)
+ STRY(osc_str_append_string(data, "\"TagKeys\":[" ));
+ for (as = args->tag_keys; *as > 0; ++as) {
+ if (as != args->tag_keys)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_int(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_counts_str) {
+ } else if (args->tag_keys_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeCounts\":" ));
- STRY(osc_str_append_string(data, args->volume_counts_str));
+ STRY(osc_str_append_string(data, "\"TagKeys\":" ));
+ STRY(osc_str_append_string(data, args->tag_keys_str));
ret += 1;
}
- if (args->volume_sizes) {
- int *ip;
+ if (args->tag_values) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeSizes\":[" ));
- for (ip = args->volume_sizes; *ip > 0; ++ip) {
- if (ip != args->volume_sizes)
+ STRY(osc_str_append_string(data, "\"TagValues\":[" ));
+ for (as = args->tag_values; *as > 0; ++as) {
+ if (as != args->tag_values)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_int(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_sizes_str) {
+ } else if (args->tag_values_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeSizes\":" ));
- STRY(osc_str_append_string(data, args->volume_sizes_str));
+ STRY(osc_str_append_string(data, "\"TagValues\":" ));
+ STRY(osc_str_append_string(data, args->tag_values_str));
ret += 1;
}
- return !!ret;
-}
-static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data) {
- int count_args = 0;
- int ret = 0;
- if (args->maintenance_event_codes) {
- char **as;
-
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":[" ));
- for (as = args->maintenance_event_codes; *as > 0; ++as) {
- if (as != args->maintenance_event_codes)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else if (args->maintenance_event_codes_str) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":" ));
- STRY(osc_str_append_string(data, args->maintenance_event_codes_str));
- ret += 1;
- }
- if (args->maintenance_event_descriptions) {
- char **as;
-
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":[" ));
- for (as = args->maintenance_event_descriptions; *as > 0; ++as) {
- if (as != args->maintenance_event_descriptions)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else if (args->maintenance_event_descriptions_str) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":" ));
- STRY(osc_str_append_string(data, args->maintenance_event_descriptions_str));
- ret += 1;
- }
- if (args->maintenance_events_not_after) {
+ if (args->tags) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":[" ));
- for (as = args->maintenance_events_not_after; *as > 0; ++as) {
- if (as != args->maintenance_events_not_after)
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (as = args->tags; *as > 0; ++as) {
+ if (as != args->tags)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9613,43 +9825,41 @@ static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_s
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->maintenance_events_not_after_str) {
+ } else if (args->tags_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":" ));
- STRY(osc_str_append_string(data, args->maintenance_events_not_after_str));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
ret += 1;
}
- if (args->maintenance_events_not_before) {
- char **as;
+ if (args->vm_counts) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":[" ));
- for (as = args->maintenance_events_not_before; *as > 0; ++as) {
- if (as != args->maintenance_events_not_before)
+ STRY(osc_str_append_string(data, "\"VmCounts\":[" ));
+ for (ip = args->vm_counts; *ip > 0; ++ip) {
+ if (ip != args->vm_counts)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->maintenance_events_not_before_str) {
+ } else if (args->vm_counts_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":" ));
- STRY(osc_str_append_string(data, args->maintenance_events_not_before_str));
+ STRY(osc_str_append_string(data, "\"VmCounts\":" ));
+ STRY(osc_str_append_string(data, args->vm_counts_str));
ret += 1;
}
- if (args->subregion_names) {
+ if (args->vm_group_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionNames\":[" ));
- for (as = args->subregion_names; *as > 0; ++as) {
- if (as != args->subregion_names)
+ STRY(osc_str_append_string(data, "\"VmGroupIds\":[" ));
+ for (as = args->vm_group_ids; *as > 0; ++as) {
+ if (as != args->vm_group_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9657,21 +9867,21 @@ static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_s
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->subregion_names_str) {
+ } else if (args->vm_group_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionNames\":" ));
- STRY(osc_str_append_string(data, args->subregion_names_str));
+ STRY(osc_str_append_string(data, "\"VmGroupIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_group_ids_str));
ret += 1;
}
- if (args->vm_ids) {
+ if (args->vm_group_names) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":[" ));
- for (as = args->vm_ids; *as > 0; ++as) {
- if (as != args->vm_ids)
+ STRY(osc_str_append_string(data, "\"VmGroupNames\":[" ));
+ for (as = args->vm_group_names; *as > 0; ++as) {
+ if (as != args->vm_group_names)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9679,21 +9889,21 @@ static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_s
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->vm_ids_str) {
+ } else if (args->vm_group_names_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":" ));
- STRY(osc_str_append_string(data, args->vm_ids_str));
+ STRY(osc_str_append_string(data, "\"VmGroupNames\":" ));
+ STRY(osc_str_append_string(data, args->vm_group_names_str));
ret += 1;
}
- if (args->vm_states) {
+ if (args->vm_template_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmStates\":[" ));
- for (as = args->vm_states; *as > 0; ++as) {
- if (as != args->vm_states)
+ STRY(osc_str_append_string(data, "\"VmTemplateIds\":[" ));
+ for (as = args->vm_template_ids; *as > 0; ++as) {
+ if (as != args->vm_template_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9701,55 +9911,46 @@ static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_s
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->vm_states_str) {
+ } else if (args->vm_template_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmStates\":" ));
- STRY(osc_str_append_string(data, args->vm_states_str));
+ STRY(osc_str_append_string(data, "\"VmTemplateIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_template_ids_str));
ret += 1;
}
return !!ret;
}
-static int filters_volume_setter(struct filters_volume *args, struct osc_str *data) {
+static int filters_vm_template_setter(struct filters_vm_template *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
- if (args->creation_dates) {
- char **as;
+ if (args->cpu_cores) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"CreationDates\":[" ));
- for (as = args->creation_dates; *as > 0; ++as) {
- if (as != args->creation_dates)
+ STRY(osc_str_append_string(data, "\"CpuCores\":[" ));
+ for (ip = args->cpu_cores; *ip > 0; ++ip) {
+ if (ip != args->cpu_cores)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->creation_dates_str) {
+ } else if (args->cpu_cores_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"CreationDates\":" ));
- STRY(osc_str_append_string(data, args->creation_dates_str));
+ STRY(osc_str_append_string(data, "\"CpuCores\":" ));
+ STRY(osc_str_append_string(data, args->cpu_cores_str));
ret += 1;
}
- if (args->is_set_link_volume_delete_on_vm_deletion) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeDeleteOnVmDeletion\":" ));
- STRY(osc_str_append_bool(data, args->link_volume_delete_on_vm_deletion));
- ret += 1;
- }
- if (args->link_volume_device_names) {
+ if (args->cpu_generations) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeDeviceNames\":[" ));
- for (as = args->link_volume_device_names; *as > 0; ++as) {
- if (as != args->link_volume_device_names)
+ STRY(osc_str_append_string(data, "\"CpuGenerations\":[" ));
+ for (as = args->cpu_generations; *as > 0; ++as) {
+ if (as != args->cpu_generations)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9757,21 +9958,21 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->link_volume_device_names_str) {
+ } else if (args->cpu_generations_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeDeviceNames\":" ));
- STRY(osc_str_append_string(data, args->link_volume_device_names_str));
+ STRY(osc_str_append_string(data, "\"CpuGenerations\":" ));
+ STRY(osc_str_append_string(data, args->cpu_generations_str));
ret += 1;
}
- if (args->link_volume_link_dates) {
+ if (args->cpu_performances) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeLinkDates\":[" ));
- for (as = args->link_volume_link_dates; *as > 0; ++as) {
- if (as != args->link_volume_link_dates)
+ STRY(osc_str_append_string(data, "\"CpuPerformances\":[" ));
+ for (as = args->cpu_performances; *as > 0; ++as) {
+ if (as != args->cpu_performances)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9779,21 +9980,21 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->link_volume_link_dates_str) {
+ } else if (args->cpu_performances_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeLinkDates\":" ));
- STRY(osc_str_append_string(data, args->link_volume_link_dates_str));
+ STRY(osc_str_append_string(data, "\"CpuPerformances\":" ));
+ STRY(osc_str_append_string(data, args->cpu_performances_str));
ret += 1;
}
- if (args->link_volume_link_states) {
+ if (args->descriptions) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeLinkStates\":[" ));
- for (as = args->link_volume_link_states; *as > 0; ++as) {
- if (as != args->link_volume_link_states)
+ STRY(osc_str_append_string(data, "\"Descriptions\":[" ));
+ for (as = args->descriptions; *as > 0; ++as) {
+ if (as != args->descriptions)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9801,21 +10002,21 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->link_volume_link_states_str) {
+ } else if (args->descriptions_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeLinkStates\":" ));
- STRY(osc_str_append_string(data, args->link_volume_link_states_str));
+ STRY(osc_str_append_string(data, "\"Descriptions\":" ));
+ STRY(osc_str_append_string(data, args->descriptions_str));
ret += 1;
}
- if (args->link_volume_vm_ids) {
+ if (args->image_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeVmIds\":[" ));
- for (as = args->link_volume_vm_ids; *as > 0; ++as) {
- if (as != args->link_volume_vm_ids)
+ STRY(osc_str_append_string(data, "\"ImageIds\":[" ));
+ for (as = args->image_ids; *as > 0; ++as) {
+ if (as != args->image_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9823,21 +10024,21 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->link_volume_vm_ids_str) {
+ } else if (args->image_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"LinkVolumeVmIds\":" ));
- STRY(osc_str_append_string(data, args->link_volume_vm_ids_str));
+ STRY(osc_str_append_string(data, "\"ImageIds\":" ));
+ STRY(osc_str_append_string(data, args->image_ids_str));
ret += 1;
}
- if (args->snapshot_ids) {
+ if (args->keypair_names) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SnapshotIds\":[" ));
- for (as = args->snapshot_ids; *as > 0; ++as) {
- if (as != args->snapshot_ids)
+ STRY(osc_str_append_string(data, "\"KeypairNames\":[" ));
+ for (as = args->keypair_names; *as > 0; ++as) {
+ if (as != args->keypair_names)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9845,33 +10046,31 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->snapshot_ids_str) {
+ } else if (args->keypair_names_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SnapshotIds\":" ));
- STRY(osc_str_append_string(data, args->snapshot_ids_str));
+ STRY(osc_str_append_string(data, "\"KeypairNames\":" ));
+ STRY(osc_str_append_string(data, args->keypair_names_str));
ret += 1;
}
- if (args->subregion_names) {
- char **as;
+ if (args->rams) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionNames\":[" ));
- for (as = args->subregion_names; *as > 0; ++as) {
- if (as != args->subregion_names)
+ STRY(osc_str_append_string(data, "\"Rams\":[" ));
+ for (ip = args->rams; *ip > 0; ++ip) {
+ if (ip != args->rams)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->subregion_names_str) {
+ } else if (args->rams_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionNames\":" ));
- STRY(osc_str_append_string(data, args->subregion_names_str));
+ STRY(osc_str_append_string(data, "\"Rams\":" ));
+ STRY(osc_str_append_string(data, args->rams_str));
ret += 1;
}
if (args->tag_keys) {
@@ -9940,14 +10139,14 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
STRY(osc_str_append_string(data, args->tags_str));
ret += 1;
}
- if (args->volume_ids) {
+ if (args->vm_template_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeIds\":[" ));
- for (as = args->volume_ids; *as > 0; ++as) {
- if (as != args->volume_ids)
+ STRY(osc_str_append_string(data, "\"VmTemplateIds\":[" ));
+ for (as = args->vm_template_ids; *as > 0; ++as) {
+ if (as != args->vm_template_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -9955,154 +10154,162 @@ static int filters_volume_setter(struct filters_volume *args, struct osc_str *da
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_ids_str) {
+ } else if (args->vm_template_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeIds\":" ));
- STRY(osc_str_append_string(data, args->volume_ids_str));
+ STRY(osc_str_append_string(data, "\"VmTemplateIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_template_ids_str));
ret += 1;
}
- if (args->volume_sizes) {
- int *ip;
+ if (args->vm_template_names) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeSizes\":[" ));
- for (ip = args->volume_sizes; *ip > 0; ++ip) {
- if (ip != args->volume_sizes)
+ STRY(osc_str_append_string(data, "\"VmTemplateNames\":[" ));
+ for (as = args->vm_template_names; *as > 0; ++as) {
+ if (as != args->vm_template_names)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_int(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_sizes_str) {
+ } else if (args->vm_template_names_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeSizes\":" ));
- STRY(osc_str_append_string(data, args->volume_sizes_str));
+ STRY(osc_str_append_string(data, "\"VmTemplateNames\":" ));
+ STRY(osc_str_append_string(data, args->vm_template_names_str));
ret += 1;
}
- if (args->volume_states) {
- char **as;
+ return !!ret;
+}
+static int filters_vm_type_setter(struct filters_vm_type *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->is_set_bsu_optimized) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"BsuOptimized\":" ));
+ STRY(osc_str_append_bool(data, args->bsu_optimized));
+ ret += 1;
+ }
+ if (args->memory_sizes) {
+ double *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeStates\":[" ));
- for (as = args->volume_states; *as > 0; ++as) {
- if (as != args->volume_states)
+ STRY(osc_str_append_string(data, "\"MemorySizes\":[" ));
+ for (ip = args->memory_sizes; *ip > 0; ++ip) {
+ if (ip != args->memory_sizes)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_double(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_states_str) {
+ } else if (args->memory_sizes_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeStates\":" ));
- STRY(osc_str_append_string(data, args->volume_states_str));
+ STRY(osc_str_append_string(data, "\"MemorySizes\":" ));
+ STRY(osc_str_append_string(data, args->memory_sizes_str));
ret += 1;
}
- if (args->volume_types) {
- char **as;
+ if (args->vcore_counts) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeTypes\":[" ));
- for (as = args->volume_types; *as > 0; ++as) {
- if (as != args->volume_types)
+ STRY(osc_str_append_string(data, "\"VcoreCounts\":[" ));
+ for (ip = args->vcore_counts; *ip > 0; ++ip) {
+ if (ip != args->vcore_counts)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->volume_types_str) {
+ } else if (args->vcore_counts_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeTypes\":" ));
- STRY(osc_str_append_string(data, args->volume_types_str));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"VcoreCounts\":" ));
+ STRY(osc_str_append_string(data, args->vcore_counts_str));
+ ret += 1;
}
- return !!ret;
-}
-static int filters_vpn_connection_setter(struct filters_vpn_connection *args, struct osc_str *data) {
- int count_args = 0;
- int ret = 0;
- if (args->bgp_asns) {
- int *ip;
+ if (args->vm_type_names) {
+ char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BgpAsns\":[" ));
- for (ip = args->bgp_asns; *ip > 0; ++ip) {
- if (ip != args->bgp_asns)
+ STRY(osc_str_append_string(data, "\"VmTypeNames\":[" ));
+ for (as = args->vm_type_names; *as > 0; ++as) {
+ if (as != args->vm_type_names)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_int(data, *ip));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->bgp_asns_str) {
+ } else if (args->vm_type_names_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BgpAsns\":" ));
- STRY(osc_str_append_string(data, args->bgp_asns_str));
+ STRY(osc_str_append_string(data, "\"VmTypeNames\":" ));
+ STRY(osc_str_append_string(data, args->vm_type_names_str));
ret += 1;
}
- if (args->client_gateway_ids) {
- char **as;
+ if (args->volume_counts) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ClientGatewayIds\":[" ));
- for (as = args->client_gateway_ids; *as > 0; ++as) {
- if (as != args->client_gateway_ids)
+ STRY(osc_str_append_string(data, "\"VolumeCounts\":[" ));
+ for (ip = args->volume_counts; *ip > 0; ++ip) {
+ if (ip != args->volume_counts)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->client_gateway_ids_str) {
+ } else if (args->volume_counts_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ClientGatewayIds\":" ));
- STRY(osc_str_append_string(data, args->client_gateway_ids_str));
+ STRY(osc_str_append_string(data, "\"VolumeCounts\":" ));
+ STRY(osc_str_append_string(data, args->volume_counts_str));
ret += 1;
}
- if (args->connection_types) {
- char **as;
+ if (args->volume_sizes) {
+ int *ip;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ConnectionTypes\":[" ));
- for (as = args->connection_types; *as > 0; ++as) {
- if (as != args->connection_types)
+ STRY(osc_str_append_string(data, "\"VolumeSizes\":[" ));
+ for (ip = args->volume_sizes; *ip > 0; ++ip) {
+ if (ip != args->volume_sizes)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_int(data, *ip));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->connection_types_str) {
+ } else if (args->volume_sizes_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ConnectionTypes\":" ));
- STRY(osc_str_append_string(data, args->connection_types_str));
+ STRY(osc_str_append_string(data, "\"VolumeSizes\":" ));
+ STRY(osc_str_append_string(data, args->volume_sizes_str));
ret += 1;
}
- if (args->route_destination_ip_ranges) {
+ return !!ret;
+}
+static int filters_vms_state_setter(struct filters_vms_state *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->maintenance_event_codes) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"RouteDestinationIpRanges\":[" ));
- for (as = args->route_destination_ip_ranges; *as > 0; ++as) {
- if (as != args->route_destination_ip_ranges)
+ STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":[" ));
+ for (as = args->maintenance_event_codes; *as > 0; ++as) {
+ if (as != args->maintenance_event_codes)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10110,21 +10317,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->route_destination_ip_ranges_str) {
+ } else if (args->maintenance_event_codes_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"RouteDestinationIpRanges\":" ));
- STRY(osc_str_append_string(data, args->route_destination_ip_ranges_str));
+ STRY(osc_str_append_string(data, "\"MaintenanceEventCodes\":" ));
+ STRY(osc_str_append_string(data, args->maintenance_event_codes_str));
ret += 1;
}
- if (args->states) {
+ if (args->maintenance_event_descriptions) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"States\":[" ));
- for (as = args->states; *as > 0; ++as) {
- if (as != args->states)
+ STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":[" ));
+ for (as = args->maintenance_event_descriptions; *as > 0; ++as) {
+ if (as != args->maintenance_event_descriptions)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10132,28 +10339,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->states_str) {
+ } else if (args->maintenance_event_descriptions_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"States\":" ));
- STRY(osc_str_append_string(data, args->states_str));
+ STRY(osc_str_append_string(data, "\"MaintenanceEventDescriptions\":" ));
+ STRY(osc_str_append_string(data, args->maintenance_event_descriptions_str));
ret += 1;
}
- if (args->is_set_static_routes_only) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"StaticRoutesOnly\":" ));
- STRY(osc_str_append_bool(data, args->static_routes_only));
- ret += 1;
- }
- if (args->tag_keys) {
+ if (args->maintenance_events_not_after) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"TagKeys\":[" ));
- for (as = args->tag_keys; *as > 0; ++as) {
- if (as != args->tag_keys)
+ STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":[" ));
+ for (as = args->maintenance_events_not_after; *as > 0; ++as) {
+ if (as != args->maintenance_events_not_after)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10161,21 +10361,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->tag_keys_str) {
+ } else if (args->maintenance_events_not_after_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"TagKeys\":" ));
- STRY(osc_str_append_string(data, args->tag_keys_str));
+ STRY(osc_str_append_string(data, "\"MaintenanceEventsNotAfter\":" ));
+ STRY(osc_str_append_string(data, args->maintenance_events_not_after_str));
ret += 1;
}
- if (args->tag_values) {
+ if (args->maintenance_events_not_before) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"TagValues\":[" ));
- for (as = args->tag_values; *as > 0; ++as) {
- if (as != args->tag_values)
+ STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":[" ));
+ for (as = args->maintenance_events_not_before; *as > 0; ++as) {
+ if (as != args->maintenance_events_not_before)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10183,21 +10383,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->tag_values_str) {
+ } else if (args->maintenance_events_not_before_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"TagValues\":" ));
- STRY(osc_str_append_string(data, args->tag_values_str));
+ STRY(osc_str_append_string(data, "\"MaintenanceEventsNotBefore\":" ));
+ STRY(osc_str_append_string(data, args->maintenance_events_not_before_str));
ret += 1;
}
- if (args->tags) {
+ if (args->subregion_names) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Tags\":[" ));
- for (as = args->tags; *as > 0; ++as) {
- if (as != args->tags)
+ STRY(osc_str_append_string(data, "\"SubregionNames\":[" ));
+ for (as = args->subregion_names; *as > 0; ++as) {
+ if (as != args->subregion_names)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10205,21 +10405,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->tags_str) {
+ } else if (args->subregion_names_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Tags\":" ));
- STRY(osc_str_append_string(data, args->tags_str));
+ STRY(osc_str_append_string(data, "\"SubregionNames\":" ));
+ STRY(osc_str_append_string(data, args->subregion_names_str));
ret += 1;
}
- if (args->virtual_gateway_ids) {
+ if (args->vm_ids) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VirtualGatewayIds\":[" ));
- for (as = args->virtual_gateway_ids; *as > 0; ++as) {
- if (as != args->virtual_gateway_ids)
+ STRY(osc_str_append_string(data, "\"VmIds\":[" ));
+ for (as = args->vm_ids; *as > 0; ++as) {
+ if (as != args->vm_ids)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10227,21 +10427,21 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->virtual_gateway_ids_str) {
+ } else if (args->vm_ids_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VirtualGatewayIds\":" ));
- STRY(osc_str_append_string(data, args->virtual_gateway_ids_str));
+ STRY(osc_str_append_string(data, "\"VmIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_ids_str));
ret += 1;
}
- if (args->vpn_connection_ids) {
+ if (args->vm_states) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnConnectionIds\":[" ));
- for (as = args->vpn_connection_ids; *as > 0; ++as) {
- if (as != args->vpn_connection_ids)
+ STRY(osc_str_append_string(data, "\"VmStates\":[" ));
+ for (as = args->vm_states; *as > 0; ++as) {
+ if (as != args->vm_states)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10249,86 +10449,26 @@ static int filters_vpn_connection_setter(struct filters_vpn_connection *args, st
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->vpn_connection_ids_str) {
+ } else if (args->vm_states_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnConnectionIds\":" ));
- STRY(osc_str_append_string(data, args->vpn_connection_ids_str));
+ STRY(osc_str_append_string(data, "\"VmStates\":" ));
+ STRY(osc_str_append_string(data, args->vm_states_str));
ret += 1;
}
return !!ret;
}
-static int flexible_gpu_setter(struct flexible_gpu *args, struct osc_str *data) {
- int count_args = 0;
- int ret = 0;
- if (args->is_set_delete_on_vm_deletion) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"DeleteOnVmDeletion\":" ));
- STRY(osc_str_append_bool(data, args->delete_on_vm_deletion));
- ret += 1;
- }
- if (args->flexible_gpu_id) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"FlexibleGpuId\":\"" ));
- STRY(osc_str_append_string(data, args->flexible_gpu_id));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->generation) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Generation\":\"" ));
- STRY(osc_str_append_string(data, args->generation));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->model_name) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ModelName\":\"" ));
- STRY(osc_str_append_string(data, args->model_name));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->state) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"State\":\"" ));
- STRY(osc_str_append_string(data, args->state));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->subregion_name) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionName\":\"" ));
- STRY(osc_str_append_string(data, args->subregion_name));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->vm_id) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmId\":\"" ));
- STRY(osc_str_append_string(data, args->vm_id));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- return !!ret;
-}
-static int flexible_gpu_catalog_setter(struct flexible_gpu_catalog *args, struct osc_str *data) {
+static int filters_volume_setter(struct filters_volume *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
- if (args->generations) {
+ if (args->creation_dates) {
char **as;
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Generations\":[" ));
- for (as = args->generations; *as > 0; ++as) {
- if (as != args->generations)
+ STRY(osc_str_append_string(data, "\"CreationDates\":[" ));
+ for (as = args->creation_dates; *as > 0; ++as) {
+ if (as != args->creation_dates)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"" ));
STRY(osc_str_append_string(data, *as));
@@ -10336,14 +10476,622 @@ static int flexible_gpu_catalog_setter(struct flexible_gpu_catalog *args, struct
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->generations_str) {
+ } else if (args->creation_dates_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Generations\":" ));
- STRY(osc_str_append_string(data, args->generations_str));
+ STRY(osc_str_append_string(data, "\"CreationDates\":" ));
+ STRY(osc_str_append_string(data, args->creation_dates_str));
ret += 1;
}
- if (args->is_set_max_cpu || args->max_cpu) {
+ if (args->is_set_link_volume_delete_on_vm_deletion) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeDeleteOnVmDeletion\":" ));
+ STRY(osc_str_append_bool(data, args->link_volume_delete_on_vm_deletion));
+ ret += 1;
+ }
+ if (args->link_volume_device_names) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeDeviceNames\":[" ));
+ for (as = args->link_volume_device_names; *as > 0; ++as) {
+ if (as != args->link_volume_device_names)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->link_volume_device_names_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeDeviceNames\":" ));
+ STRY(osc_str_append_string(data, args->link_volume_device_names_str));
+ ret += 1;
+ }
+ if (args->link_volume_link_dates) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeLinkDates\":[" ));
+ for (as = args->link_volume_link_dates; *as > 0; ++as) {
+ if (as != args->link_volume_link_dates)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->link_volume_link_dates_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeLinkDates\":" ));
+ STRY(osc_str_append_string(data, args->link_volume_link_dates_str));
+ ret += 1;
+ }
+ if (args->link_volume_link_states) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeLinkStates\":[" ));
+ for (as = args->link_volume_link_states; *as > 0; ++as) {
+ if (as != args->link_volume_link_states)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->link_volume_link_states_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeLinkStates\":" ));
+ STRY(osc_str_append_string(data, args->link_volume_link_states_str));
+ ret += 1;
+ }
+ if (args->link_volume_vm_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeVmIds\":[" ));
+ for (as = args->link_volume_vm_ids; *as > 0; ++as) {
+ if (as != args->link_volume_vm_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->link_volume_vm_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"LinkVolumeVmIds\":" ));
+ STRY(osc_str_append_string(data, args->link_volume_vm_ids_str));
+ ret += 1;
+ }
+ if (args->snapshot_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SnapshotIds\":[" ));
+ for (as = args->snapshot_ids; *as > 0; ++as) {
+ if (as != args->snapshot_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->snapshot_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SnapshotIds\":" ));
+ STRY(osc_str_append_string(data, args->snapshot_ids_str));
+ ret += 1;
+ }
+ if (args->subregion_names) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubregionNames\":[" ));
+ for (as = args->subregion_names; *as > 0; ++as) {
+ if (as != args->subregion_names)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->subregion_names_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubregionNames\":" ));
+ STRY(osc_str_append_string(data, args->subregion_names_str));
+ ret += 1;
+ }
+ if (args->tag_keys) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagKeys\":[" ));
+ for (as = args->tag_keys; *as > 0; ++as) {
+ if (as != args->tag_keys)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tag_keys_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagKeys\":" ));
+ STRY(osc_str_append_string(data, args->tag_keys_str));
+ ret += 1;
+ }
+ if (args->tag_values) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagValues\":[" ));
+ for (as = args->tag_values; *as > 0; ++as) {
+ if (as != args->tag_values)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tag_values_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagValues\":" ));
+ STRY(osc_str_append_string(data, args->tag_values_str));
+ ret += 1;
+ }
+ if (args->tags) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (as = args->tags; *as > 0; ++as) {
+ if (as != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tags_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
+ }
+ if (args->volume_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeIds\":[" ));
+ for (as = args->volume_ids; *as > 0; ++as) {
+ if (as != args->volume_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->volume_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeIds\":" ));
+ STRY(osc_str_append_string(data, args->volume_ids_str));
+ ret += 1;
+ }
+ if (args->volume_sizes) {
+ int *ip;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeSizes\":[" ));
+ for (ip = args->volume_sizes; *ip > 0; ++ip) {
+ if (ip != args->volume_sizes)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_int(data, *ip));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->volume_sizes_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeSizes\":" ));
+ STRY(osc_str_append_string(data, args->volume_sizes_str));
+ ret += 1;
+ }
+ if (args->volume_states) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeStates\":[" ));
+ for (as = args->volume_states; *as > 0; ++as) {
+ if (as != args->volume_states)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->volume_states_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeStates\":" ));
+ STRY(osc_str_append_string(data, args->volume_states_str));
+ ret += 1;
+ }
+ if (args->volume_types) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeTypes\":[" ));
+ for (as = args->volume_types; *as > 0; ++as) {
+ if (as != args->volume_types)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->volume_types_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeTypes\":" ));
+ STRY(osc_str_append_string(data, args->volume_types_str));
+ ret += 1;
+ }
+ return !!ret;
+}
+static int filters_vpn_connection_setter(struct filters_vpn_connection *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->bgp_asns) {
+ int *ip;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"BgpAsns\":[" ));
+ for (ip = args->bgp_asns; *ip > 0; ++ip) {
+ if (ip != args->bgp_asns)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_int(data, *ip));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->bgp_asns_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"BgpAsns\":" ));
+ STRY(osc_str_append_string(data, args->bgp_asns_str));
+ ret += 1;
+ }
+ if (args->client_gateway_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ClientGatewayIds\":[" ));
+ for (as = args->client_gateway_ids; *as > 0; ++as) {
+ if (as != args->client_gateway_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->client_gateway_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ClientGatewayIds\":" ));
+ STRY(osc_str_append_string(data, args->client_gateway_ids_str));
+ ret += 1;
+ }
+ if (args->connection_types) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ConnectionTypes\":[" ));
+ for (as = args->connection_types; *as > 0; ++as) {
+ if (as != args->connection_types)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->connection_types_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ConnectionTypes\":" ));
+ STRY(osc_str_append_string(data, args->connection_types_str));
+ ret += 1;
+ }
+ if (args->route_destination_ip_ranges) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"RouteDestinationIpRanges\":[" ));
+ for (as = args->route_destination_ip_ranges; *as > 0; ++as) {
+ if (as != args->route_destination_ip_ranges)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->route_destination_ip_ranges_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"RouteDestinationIpRanges\":" ));
+ STRY(osc_str_append_string(data, args->route_destination_ip_ranges_str));
+ ret += 1;
+ }
+ if (args->states) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"States\":[" ));
+ for (as = args->states; *as > 0; ++as) {
+ if (as != args->states)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->states_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"States\":" ));
+ STRY(osc_str_append_string(data, args->states_str));
+ ret += 1;
+ }
+ if (args->is_set_static_routes_only) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"StaticRoutesOnly\":" ));
+ STRY(osc_str_append_bool(data, args->static_routes_only));
+ ret += 1;
+ }
+ if (args->tag_keys) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagKeys\":[" ));
+ for (as = args->tag_keys; *as > 0; ++as) {
+ if (as != args->tag_keys)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tag_keys_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagKeys\":" ));
+ STRY(osc_str_append_string(data, args->tag_keys_str));
+ ret += 1;
+ }
+ if (args->tag_values) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagValues\":[" ));
+ for (as = args->tag_values; *as > 0; ++as) {
+ if (as != args->tag_values)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tag_values_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"TagValues\":" ));
+ STRY(osc_str_append_string(data, args->tag_values_str));
+ ret += 1;
+ }
+ if (args->tags) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (as = args->tags; *as > 0; ++as) {
+ if (as != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->tags_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
+ }
+ if (args->virtual_gateway_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VirtualGatewayIds\":[" ));
+ for (as = args->virtual_gateway_ids; *as > 0; ++as) {
+ if (as != args->virtual_gateway_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->virtual_gateway_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VirtualGatewayIds\":" ));
+ STRY(osc_str_append_string(data, args->virtual_gateway_ids_str));
+ ret += 1;
+ }
+ if (args->vpn_connection_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnConnectionIds\":[" ));
+ for (as = args->vpn_connection_ids; *as > 0; ++as) {
+ if (as != args->vpn_connection_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->vpn_connection_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnConnectionIds\":" ));
+ STRY(osc_str_append_string(data, args->vpn_connection_ids_str));
+ ret += 1;
+ }
+ return !!ret;
+}
+static int flexible_gpu_setter(struct flexible_gpu *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->is_set_delete_on_vm_deletion) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DeleteOnVmDeletion\":" ));
+ STRY(osc_str_append_bool(data, args->delete_on_vm_deletion));
+ ret += 1;
+ }
+ if (args->flexible_gpu_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"FlexibleGpuId\":\"" ));
+ STRY(osc_str_append_string(data, args->flexible_gpu_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->generation) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Generation\":\"" ));
+ STRY(osc_str_append_string(data, args->generation));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->model_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ModelName\":\"" ));
+ STRY(osc_str_append_string(data, args->model_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->state) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"State\":\"" ));
+ STRY(osc_str_append_string(data, args->state));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->subregion_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubregionName\":\"" ));
+ STRY(osc_str_append_string(data, args->subregion_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vm_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ return !!ret;
+}
+static int flexible_gpu_catalog_setter(struct flexible_gpu_catalog *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->generations) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Generations\":[" ));
+ for (as = args->generations; *as > 0; ++as) {
+ if (as != args->generations)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->generations_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Generations\":" ));
+ STRY(osc_str_append_string(data, args->generations_str));
+ ret += 1;
+ }
+ if (args->is_set_max_cpu || args->max_cpu) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "\"MaxCpu\":" ));
@@ -14898,16 +15646,158 @@ static int vm_setter(struct vm *args, struct osc_str *data) {
if (args->vm_initiated_shutdown_behavior) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmInitiatedShutdownBehavior\":\"" ));
- STRY(osc_str_append_string(data, args->vm_initiated_shutdown_behavior));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"VmInitiatedShutdownBehavior\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_initiated_shutdown_behavior));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vm_type) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmType\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_type));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ return !!ret;
+}
+static int vm_group_setter(struct vm_group *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->creation_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CreationDate\":\"" ));
+ STRY(osc_str_append_string(data, args->creation_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->description) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->positioning_strategy) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"PositioningStrategy\":\"" ));
+ STRY(osc_str_append_string(data, args->positioning_strategy));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->security_group_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":[" ));
+ for (as = args->security_group_ids; *as > 0; ++as) {
+ if (as != args->security_group_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->security_group_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":" ));
+ STRY(osc_str_append_string(data, args->security_group_ids_str));
+ ret += 1;
+ }
+ if (args->state) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"State\":\"" ));
+ STRY(osc_str_append_string(data, args->state));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->subnet_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubnetId\":\"" ));
+ STRY(osc_str_append_string(data, args->subnet_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->tags) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(resource_tag_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->tags_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
+ }
+ if (args->is_set_vm_count || args->vm_count) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmCount\":" ));
+ STRY(osc_str_append_int(data, args->vm_count));
+ ret += 1;
+ }
+ if (args->vm_group_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmGroupId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vm_group_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmGroupName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vm_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":[" ));
+ for (as = args->vm_ids; *as > 0; ++as) {
+ if (as != args->vm_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->vm_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_ids_str));
+ ret += 1;
}
- if (args->vm_type) {
+ if (args->vm_template_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmType\":\"" ));
- STRY(osc_str_append_string(data, args->vm_type));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -14993,6 +15883,111 @@ static int vm_states_setter(struct vm_states *args, struct osc_str *data) {
}
return !!ret;
}
+static int vm_template_setter(struct vm_template *args, struct osc_str *data) {
+ int count_args = 0;
+ int ret = 0;
+ if (args->is_set_cpu_cores || args->cpu_cores) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CpuCores\":" ));
+ STRY(osc_str_append_int(data, args->cpu_cores));
+ ret += 1;
+ }
+ if (args->cpu_generation) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CpuGeneration\":\"" ));
+ STRY(osc_str_append_string(data, args->cpu_generation));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->cpu_performance) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CpuPerformance\":\"" ));
+ STRY(osc_str_append_string(data, args->cpu_performance));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->creation_date) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"CreationDate\":\"" ));
+ STRY(osc_str_append_string(data, args->creation_date));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->description) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->image_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ImageId\":\"" ));
+ STRY(osc_str_append_string(data, args->image_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->keypair_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"KeypairName\":\"" ));
+ STRY(osc_str_append_string(data, args->keypair_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->is_set_ram || args->ram) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Ram\":" ));
+ STRY(osc_str_append_int(data, args->ram));
+ ret += 1;
+ }
+ if (args->tags) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(resource_tag_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->tags_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
+ }
+ if (args->vm_template_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vm_template_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmTemplateName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ return !!ret;
+}
static int vm_type_setter(struct vm_type *args, struct osc_str *data) {
int count_args = 0;
int ret = 0;
@@ -15455,10 +16450,170 @@ static int with_setter(struct with *args, struct osc_str *data) {
STRY(osc_str_append_bool(data, args->response_status_code));
ret += 1;
}
- return !!ret;
+ return !!ret;
+}
+
+static int update_vpn_connection_data(struct osc_update_vpn_connection_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->client_gateway_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ClientGatewayId\":\"" ));
+ STRY(osc_str_append_string(data, args->client_gateway_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->virtual_gateway_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VirtualGatewayId\":\"" ));
+ STRY(osc_str_append_string(data, args->virtual_gateway_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vpn_connection_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnConnectionId\":\"" ));
+ STRY(osc_str_append_string(data, args->vpn_connection_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->vpn_options_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnOptions\":" ));
+ STRY(osc_str_append_string(data, args->vpn_options_str));
+ ret += 1;
+ } else if (args->is_set_vpn_options) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnOptions\": { " ));
+ STRY(vpn_options_setter(&args->vpn_options, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_update_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_update_vpn_connection_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = update_vpn_connection_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/UpdateVpnConnection");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int update_volume_data(struct osc_update_volume_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->is_set_iops || args->iops) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Iops\":" ));
+ STRY(osc_str_append_int(data, args->iops));
+ ret += 1;
+ }
+ if (args->is_set_size || args->size) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Size\":" ));
+ STRY(osc_str_append_int(data, args->size));
+ ret += 1;
+ }
+ if (args->volume_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeId\":\"" ));
+ STRY(osc_str_append_string(data, args->volume_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->volume_type) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VolumeType\":\"" ));
+ STRY(osc_str_append_string(data, args->volume_type));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_update_volume(struct osc_env *e, struct osc_str *out, struct osc_update_volume_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = update_volume_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/UpdateVolume");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
}
-
-static int update_vpn_connection_data(struct osc_update_vpn_connection_arg *args, struct osc_str *data)
+static int update_vm_template_data(struct osc_update_vm_template_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -15466,11 +16621,11 @@ static int update_vpn_connection_data(struct osc_update_vpn_connection_arg *arg
if (!args)
return 0;
osc_str_append_string(data, "{");
- if (args->client_gateway_id) {
+ if (args->description) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ClientGatewayId\":\"" ));
- STRY(osc_str_append_string(data, args->client_gateway_id));
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -15481,41 +16636,49 @@ static int update_vpn_connection_data(struct osc_update_vpn_connection_arg *arg
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->virtual_gateway_id) {
+ if (args->tags) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(resource_tag_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->tags_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VirtualGatewayId\":\"" ));
- STRY(osc_str_append_string(data, args->virtual_gateway_id));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
}
- if (args->vpn_connection_id) {
+ if (args->vm_template_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnConnectionId\":\"" ));
- STRY(osc_str_append_string(data, args->vpn_connection_id));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->vpn_options_str) {
+ if (args->vm_template_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnOptions\":" ));
- STRY(osc_str_append_string(data, args->vpn_options_str));
- ret += 1;
- } else if (args->is_set_vpn_options) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnOptions\": { " ));
- STRY(vpn_options_setter(&args->vpn_options, data) < 0);
- STRY(osc_str_append_string(data, "}" ));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"VmTemplateName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_name));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
}
osc_str_append_string(data, "}");
return !!ret;
}
-int osc_update_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_update_vpn_connection_arg *args)
+int osc_update_vm_template(struct osc_env *e, struct osc_str *out, struct osc_update_vm_template_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -15524,12 +16687,12 @@ int osc_update_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc
osc_init_str(&data);
osc_init_str(&end_call);
- r = update_vpn_connection_data(args, &data);
+ r = update_vm_template_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/UpdateVpnConnection");
+ osc_str_append_string(&end_call, "/api/v1/UpdateVmTemplate");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -15542,7 +16705,7 @@ int osc_update_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc
osc_deinit_str(&data);
return res;
}
-static int update_volume_data(struct osc_update_volume_arg *args, struct osc_str *data)
+static int update_vm_group_data(struct osc_update_vm_group_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -15550,6 +16713,14 @@ static int update_volume_data(struct osc_update_volume_arg *args, struct osc_st
if (!args)
return 0;
osc_str_append_string(data, "{");
+ if (args->description) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
if (args->is_set_dry_run) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
@@ -15557,33 +16728,49 @@ static int update_volume_data(struct osc_update_volume_arg *args, struct osc_st
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->is_set_iops || args->iops) {
+ if (args->tags) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(resource_tag_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->tags_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Iops\":" ));
- STRY(osc_str_append_int(data, args->iops));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
+ ret += 1;
}
- if (args->is_set_size || args->size) {
+ if (args->vm_group_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Size\":" ));
- STRY(osc_str_append_int(data, args->size));
+ STRY(osc_str_append_string(data, "\"VmGroupId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_id));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->volume_id) {
+ if (args->vm_group_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeId\":\"" ));
- STRY(osc_str_append_string(data, args->volume_id));
+ STRY(osc_str_append_string(data, "\"VmGroupName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_name));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->volume_type) {
+ if (args->vm_template_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeType\":\"" ));
- STRY(osc_str_append_string(data, args->volume_type));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -15591,7 +16778,7 @@ static int update_volume_data(struct osc_update_volume_arg *args, struct osc_st
return !!ret;
}
-int osc_update_volume(struct osc_env *e, struct osc_str *out, struct osc_update_volume_arg *args)
+int osc_update_vm_group(struct osc_env *e, struct osc_str *out, struct osc_update_vm_group_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -15600,12 +16787,12 @@ int osc_update_volume(struct osc_env *e, struct osc_str *out, struct osc_update_
osc_init_str(&data);
osc_init_str(&end_call);
- r = update_volume_data(args, &data);
+ r = update_vm_group_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/UpdateVolume");
+ osc_str_append_string(&end_call, "/api/v1/UpdateVmGroup");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -17268,10 +18455,9 @@ static int update_access_key_data(struct osc_update_access_key_arg *args, struc
if (args->expiration_date) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ExpirationDate\":\"" ));
+ STRY(osc_str_append_string(data, "\"ExpirationDate\":" ));
STRY(osc_str_append_string(data, args->expiration_date));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ ret += 1;
}
if (args->state) {
if (count_args++ > 0)
@@ -17868,7 +19054,150 @@ static int unlink_flexible_gpu_data(struct osc_unlink_flexible_gpu_arg *args, s
return !!ret;
}
-int osc_unlink_flexible_gpu(struct osc_env *e, struct osc_str *out, struct osc_unlink_flexible_gpu_arg *args)
+int osc_unlink_flexible_gpu(struct osc_env *e, struct osc_str *out, struct osc_unlink_flexible_gpu_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = unlink_flexible_gpu_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/UnlinkFlexibleGpu");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int stop_vms_data(struct osc_stop_vms_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->is_set_force_stop) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ForceStop\":" ));
+ STRY(osc_str_append_bool(data, args->force_stop));
+ ret += 1;
+ }
+ if (args->vm_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":[" ));
+ for (as = args->vm_ids; *as > 0; ++as) {
+ if (as != args->vm_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->vm_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_ids_str));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_stop_vms(struct osc_env *e, struct osc_str *out, struct osc_stop_vms_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = stop_vms_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/StopVms");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int start_vms_data(struct osc_start_vms_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->vm_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":[" ));
+ for (as = args->vm_ids; *as > 0; ++as) {
+ if (as != args->vm_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->vm_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmIds\":" ));
+ STRY(osc_str_append_string(data, args->vm_ids_str));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_start_vms(struct osc_env *e, struct osc_str *out, struct osc_start_vms_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -17877,12 +19206,12 @@ int osc_unlink_flexible_gpu(struct osc_env *e, struct osc_str *out, struct osc_u
osc_init_str(&data);
osc_init_str(&end_call);
- r = unlink_flexible_gpu_data(args, &data);
+ r = start_vms_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/UnlinkFlexibleGpu");
+ osc_str_append_string(&end_call, "/api/v1/StartVms");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -17895,7 +19224,7 @@ int osc_unlink_flexible_gpu(struct osc_env *e, struct osc_str *out, struct osc_u
osc_deinit_str(&data);
return res;
}
-static int stop_vms_data(struct osc_stop_vms_arg *args, struct osc_str *data)
+static int send_reset_password_email_data(struct osc_send_reset_password_email_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -17910,40 +19239,19 @@ static int stop_vms_data(struct osc_stop_vms_arg *args, struct osc_str *data)
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->is_set_force_stop) {
+ if (args->email) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ForceStop\":" ));
- STRY(osc_str_append_bool(data, args->force_stop));
+ STRY(osc_str_append_string(data, "\"Email\":\"" ));
+ STRY(osc_str_append_string(data, args->email));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->vm_ids) {
- char **as;
-
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":[" ));
- for (as = args->vm_ids; *as > 0; ++as) {
- if (as != args->vm_ids)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else if (args->vm_ids_str) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":" ));
- STRY(osc_str_append_string(data, args->vm_ids_str));
- ret += 1;
- }
osc_str_append_string(data, "}");
return !!ret;
}
-int osc_stop_vms(struct osc_env *e, struct osc_str *out, struct osc_stop_vms_arg *args)
+int osc_send_reset_password_email(struct osc_env *e, struct osc_str *out, struct osc_send_reset_password_email_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -17952,12 +19260,12 @@ int osc_stop_vms(struct osc_env *e, struct osc_str *out, struct osc_stop_vms_arg
osc_init_str(&data);
osc_init_str(&end_call);
- r = stop_vms_data(args, &data);
+ r = send_reset_password_email_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/StopVms");
+ osc_str_append_string(&end_call, "/api/v1/SendResetPasswordEmail");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -17970,7 +19278,7 @@ int osc_stop_vms(struct osc_env *e, struct osc_str *out, struct osc_stop_vms_arg
osc_deinit_str(&data);
return res;
}
-static int start_vms_data(struct osc_start_vms_arg *args, struct osc_str *data)
+static int scale_up_vm_group_data(struct osc_scale_up_vm_group_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -17985,33 +19293,26 @@ static int start_vms_data(struct osc_start_vms_arg *args, struct osc_str *data)
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->vm_ids) {
- char **as;
-
+ if (args->is_set_vm_addition || args->vm_addition) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":[" ));
- for (as = args->vm_ids; *as > 0; ++as) {
- if (as != args->vm_ids)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else if (args->vm_ids_str) {
+ STRY(osc_str_append_string(data, "\"VmAddition\":" ));
+ STRY(osc_str_append_int(data, args->vm_addition));
+ ret += 1;
+ }
+ if (args->vm_group_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmIds\":" ));
- STRY(osc_str_append_string(data, args->vm_ids_str));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"VmGroupId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
}
osc_str_append_string(data, "}");
return !!ret;
}
-int osc_start_vms(struct osc_env *e, struct osc_str *out, struct osc_start_vms_arg *args)
+int osc_scale_up_vm_group(struct osc_env *e, struct osc_str *out, struct osc_scale_up_vm_group_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -18020,12 +19321,12 @@ int osc_start_vms(struct osc_env *e, struct osc_str *out, struct osc_start_vms_a
osc_init_str(&data);
osc_init_str(&end_call);
- r = start_vms_data(args, &data);
+ r = scale_up_vm_group_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/StartVms");
+ osc_str_append_string(&end_call, "/api/v1/ScaleUpVmGroup");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -18038,7 +19339,7 @@ int osc_start_vms(struct osc_env *e, struct osc_str *out, struct osc_start_vms_a
osc_deinit_str(&data);
return res;
}
-static int send_reset_password_email_data(struct osc_send_reset_password_email_arg *args, struct osc_str *data)
+static int scale_down_vm_group_data(struct osc_scale_down_vm_group_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -18053,19 +19354,26 @@ static int send_reset_password_email_data(struct osc_send_reset_password_email_
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->email) {
+ if (args->vm_group_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Email\":\"" ));
- STRY(osc_str_append_string(data, args->email));
+ STRY(osc_str_append_string(data, "\"VmGroupId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_id));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
+ if (args->is_set_vm_subtraction || args->vm_subtraction) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmSubtraction\":" ));
+ STRY(osc_str_append_int(data, args->vm_subtraction));
+ ret += 1;
+ }
osc_str_append_string(data, "}");
return !!ret;
}
-int osc_send_reset_password_email(struct osc_env *e, struct osc_str *out, struct osc_send_reset_password_email_arg *args)
+int osc_scale_down_vm_group(struct osc_env *e, struct osc_str *out, struct osc_scale_down_vm_group_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -18074,12 +19382,12 @@ int osc_send_reset_password_email(struct osc_env *e, struct osc_str *out, struct
osc_init_str(&data);
osc_init_str(&end_call);
- r = send_reset_password_email_data(args, &data);
+ r = scale_down_vm_group_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/SendResetPasswordEmail");
+ osc_str_append_string(&end_call, "/api/v1/ScaleDownVmGroup");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -18735,6 +20043,126 @@ int osc_read_vm_types(struct osc_env *e, struct osc_str *out, struct osc_read_vm
osc_deinit_str(&data);
return res;
}
+static int read_vm_templates_data(struct osc_read_vm_templates_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->filters_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\":" ));
+ STRY(osc_str_append_string(data, args->filters_str));
+ ret += 1;
+ } else if (args->is_set_filters) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\": { " ));
+ STRY(filters_vm_template_setter(&args->filters, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_read_vm_templates(struct osc_env *e, struct osc_str *out, struct osc_read_vm_templates_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = read_vm_templates_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/ReadVmTemplates");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int read_vm_groups_data(struct osc_read_vm_groups_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->filters_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\":" ));
+ STRY(osc_str_append_string(data, args->filters_str));
+ ret += 1;
+ } else if (args->is_set_filters) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\": { " ));
+ STRY(filters_vm_group_setter(&args->filters, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_read_vm_groups(struct osc_env *e, struct osc_str *out, struct osc_read_vm_groups_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = read_vm_groups_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/ReadVmGroups");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
static int read_virtual_gateways_data(struct osc_read_virtual_gateways_arg *args, struct osc_str *data)
{
int ret = 0;
@@ -20785,10 +22213,9 @@ static int read_consumption_account_data(struct osc_read_consumption_account_ar
if (args->from_date) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"FromDate\":\"" ));
+ STRY(osc_str_append_string(data, "\"FromDate\":" ));
STRY(osc_str_append_string(data, args->from_date));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ ret += 1;
}
if (args->is_set_overall) {
if (count_args++ > 0)
@@ -20800,10 +22227,9 @@ static int read_consumption_account_data(struct osc_read_consumption_account_ar
if (args->to_date) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ToDate\":\"" ));
+ STRY(osc_str_append_string(data, "\"ToDate\":" ));
STRY(osc_str_append_string(data, args->to_date));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ ret += 1;
}
osc_str_append_string(data, "}");
return !!ret;
@@ -20932,12 +22358,72 @@ int osc_read_client_gateways(struct osc_env *e, struct osc_str *out, struct osc_
osc_init_str(&data);
osc_init_str(&end_call);
- r = read_client_gateways_data(args, &data);
+ r = read_client_gateways_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/ReadClientGateways");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int read_catalogs_data(struct osc_read_catalogs_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->filters_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\":" ));
+ STRY(osc_str_append_string(data, args->filters_str));
+ ret += 1;
+ } else if (args->is_set_filters) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Filters\": { " ));
+ STRY(filters_catalogs_setter(&args->filters, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_read_catalogs(struct osc_env *e, struct osc_str *out, struct osc_read_catalogs_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = read_catalogs_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/ReadClientGateways");
+ osc_str_append_string(&end_call, "/api/v1/ReadCatalogs");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -22393,6 +23879,114 @@ int osc_delete_vms(struct osc_env *e, struct osc_str *out, struct osc_delete_vms
osc_deinit_str(&data);
return res;
}
+static int delete_vm_template_data(struct osc_delete_vm_template_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->vm_template_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_delete_vm_template(struct osc_env *e, struct osc_str *out, struct osc_delete_vm_template_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = delete_vm_template_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/DeleteVmTemplate");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int delete_vm_group_data(struct osc_delete_vm_group_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->vm_group_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VmGroupId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_delete_vm_group(struct osc_env *e, struct osc_str *out, struct osc_delete_vm_group_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = delete_vm_group_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/DeleteVmGroup");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
static int delete_virtual_gateway_data(struct osc_delete_virtual_gateway_arg *args, struct osc_str *data)
{
int ret = 0;
@@ -24340,15 +25934,176 @@ static int create_vpn_connection_route_data(struct osc_create_vpn_connection_ro
if (args->is_set_dry_run) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"DryRun\":" ));
- STRY(osc_str_append_bool(data, args->dry_run));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->vpn_connection_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VpnConnectionId\":\"" ));
+ STRY(osc_str_append_string(data, args->vpn_connection_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_create_vpn_connection_route(struct osc_env *e, struct osc_str *out, struct osc_create_vpn_connection_route_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = create_vpn_connection_route_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/CreateVpnConnectionRoute");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int create_vpn_connection_data(struct osc_create_vpn_connection_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->client_gateway_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ClientGatewayId\":\"" ));
+ STRY(osc_str_append_string(data, args->client_gateway_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->connection_type) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ConnectionType\":\"" ));
+ STRY(osc_str_append_string(data, args->connection_type));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->is_set_static_routes_only) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"StaticRoutesOnly\":" ));
+ STRY(osc_str_append_bool(data, args->static_routes_only));
+ ret += 1;
+ }
+ if (args->virtual_gateway_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"VirtualGatewayId\":\"" ));
+ STRY(osc_str_append_string(data, args->virtual_gateway_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_create_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_create_vpn_connection_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = create_vpn_connection_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/CreateVpnConnection");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int create_volume_data(struct osc_create_volume_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->is_set_dry_run) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->is_set_iops || args->iops) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Iops\":" ));
+ STRY(osc_str_append_int(data, args->iops));
+ ret += 1;
+ }
+ if (args->is_set_size || args->size) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Size\":" ));
+ STRY(osc_str_append_int(data, args->size));
+ ret += 1;
+ }
+ if (args->snapshot_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SnapshotId\":\"" ));
+ STRY(osc_str_append_string(data, args->snapshot_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->subregion_name) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubregionName\":\"" ));
+ STRY(osc_str_append_string(data, args->subregion_name));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->vpn_connection_id) {
+ if (args->volume_type) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VpnConnectionId\":\"" ));
- STRY(osc_str_append_string(data, args->vpn_connection_id));
+ STRY(osc_str_append_string(data, "\"VolumeType\":\"" ));
+ STRY(osc_str_append_string(data, args->volume_type));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -24356,7 +26111,7 @@ static int create_vpn_connection_route_data(struct osc_create_vpn_connection_ro
return !!ret;
}
-int osc_create_vpn_connection_route(struct osc_env *e, struct osc_str *out, struct osc_create_vpn_connection_route_arg *args)
+int osc_create_volume(struct osc_env *e, struct osc_str *out, struct osc_create_volume_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -24365,12 +26120,12 @@ int osc_create_vpn_connection_route(struct osc_env *e, struct osc_str *out, stru
osc_init_str(&data);
osc_init_str(&end_call);
- r = create_vpn_connection_route_data(args, &data);
+ r = create_volume_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/CreateVpnConnectionRoute");
+ osc_str_append_string(&end_call, "/api/v1/CreateVolume");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -24383,7 +26138,7 @@ int osc_create_vpn_connection_route(struct osc_env *e, struct osc_str *out, stru
osc_deinit_str(&data);
return res;
}
-static int create_vpn_connection_data(struct osc_create_vpn_connection_arg *args, struct osc_str *data)
+static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -24391,22 +26146,57 @@ static int create_vpn_connection_data(struct osc_create_vpn_connection_arg *arg
if (!args)
return 0;
osc_str_append_string(data, "{");
- if (args->client_gateway_id) {
+ if (args->block_device_mappings) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":[" ));
+ for (int i = 0; i < args->nb_block_device_mappings; ++i) {
+ struct block_device_mapping_vm_creation *p = &args->block_device_mappings[i];
+ if (p != args->block_device_mappings)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(block_device_mapping_vm_creation_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->block_device_mappings_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ClientGatewayId\":\"" ));
- STRY(osc_str_append_string(data, args->client_gateway_id));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":" ));
+ STRY(osc_str_append_string(data, args->block_device_mappings_str));
+ ret += 1;
+ }
+ if (args->is_set_boot_on_creation) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"BootOnCreation\":" ));
+ STRY(osc_str_append_bool(data, args->boot_on_creation));
ret += 1;
}
- if (args->connection_type) {
+ if (args->is_set_bsu_optimized) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ConnectionType\":\"" ));
- STRY(osc_str_append_string(data, args->connection_type));
+ STRY(osc_str_append_string(data, "\"BsuOptimized\":" ));
+ STRY(osc_str_append_bool(data, args->bsu_optimized));
+ ret += 1;
+ }
+ if (args->client_token) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ClientToken\":\"" ));
+ STRY(osc_str_append_string(data, args->client_token));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
+ if (args->is_set_deletion_protection) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"DeletionProtection\":" ));
+ STRY(osc_str_append_bool(data, args->deletion_protection));
+ ret += 1;
+ }
if (args->is_set_dry_run) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
@@ -24414,102 +26204,182 @@ static int create_vpn_connection_data(struct osc_create_vpn_connection_arg *arg
STRY(osc_str_append_bool(data, args->dry_run));
ret += 1;
}
- if (args->is_set_static_routes_only) {
+ if (args->image_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"StaticRoutesOnly\":" ));
- STRY(osc_str_append_bool(data, args->static_routes_only));
+ STRY(osc_str_append_string(data, "\"ImageId\":\"" ));
+ STRY(osc_str_append_string(data, args->image_id));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->virtual_gateway_id) {
+ if (args->keypair_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VirtualGatewayId\":\"" ));
- STRY(osc_str_append_string(data, args->virtual_gateway_id));
+ STRY(osc_str_append_string(data, "\"KeypairName\":\"" ));
+ STRY(osc_str_append_string(data, args->keypair_name));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- osc_str_append_string(data, "}");
- return !!ret;
-}
-
-int osc_create_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_create_vpn_connection_arg *args)
-{
- CURLcode res = CURLE_OUT_OF_MEMORY;
- struct osc_str data;
- struct osc_str end_call;
- int r;
-
- osc_init_str(&data);
- osc_init_str(&end_call);
- r = create_vpn_connection_data(args, &data);
- if (r < 0)
- goto out;
-
- osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/CreateVpnConnection");
- curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
- curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
- curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
- if (e->flag & OSC_VERBOSE_MODE) {
- printf("\n%s\n\n", data.buf);
+ if (args->is_set_max_vms_count || args->max_vms_count) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"MaxVmsCount\":" ));
+ STRY(osc_str_append_int(data, args->max_vms_count));
+ ret += 1;
}
- res = curl_easy_perform(e->c);
-out:
- osc_deinit_str(&end_call);
- osc_deinit_str(&data);
- return res;
-}
-static int create_volume_data(struct osc_create_volume_arg *args, struct osc_str *data)
-{
- int ret = 0;
- int count_args = 0;
-
- if (!args)
- return 0;
- osc_str_append_string(data, "{");
- if (args->is_set_dry_run) {
+ if (args->is_set_min_vms_count || args->min_vms_count) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"DryRun\":" ));
- STRY(osc_str_append_bool(data, args->dry_run));
+ STRY(osc_str_append_string(data, "\"MinVmsCount\":" ));
+ STRY(osc_str_append_int(data, args->min_vms_count));
ret += 1;
}
- if (args->is_set_iops || args->iops) {
+ if (args->is_set_nested_virtualization) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Iops\":" ));
- STRY(osc_str_append_int(data, args->iops));
+ STRY(osc_str_append_string(data, "\"NestedVirtualization\":" ));
+ STRY(osc_str_append_bool(data, args->nested_virtualization));
ret += 1;
}
- if (args->is_set_size || args->size) {
+ if (args->nics) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Nics\":[" ));
+ for (int i = 0; i < args->nb_nics; ++i) {
+ struct nic_for_vm_creation *p = &args->nics[i];
+ if (p != args->nics)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(nic_for_vm_creation_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else
+ if (args->nics_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Size\":" ));
- STRY(osc_str_append_int(data, args->size));
+ STRY(osc_str_append_string(data, "\"Nics\":" ));
+ STRY(osc_str_append_string(data, args->nics_str));
+ ret += 1;
+ }
+ if (args->performance) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Performance\":\"" ));
+ STRY(osc_str_append_string(data, args->performance));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->snapshot_id) {
+ if (args->placement_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Placement\":" ));
+ STRY(osc_str_append_string(data, args->placement_str));
+ ret += 1;
+ } else if (args->is_set_placement) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Placement\": { " ));
+ STRY(placement_setter(&args->placement, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
+ ret += 1;
+ }
+ if (args->private_ips) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"PrivateIps\":[" ));
+ for (as = args->private_ips; *as > 0; ++as) {
+ if (as != args->private_ips)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->private_ips_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"PrivateIps\":" ));
+ STRY(osc_str_append_string(data, args->private_ips_str));
+ ret += 1;
+ }
+ if (args->security_group_ids) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":[" ));
+ for (as = args->security_group_ids; *as > 0; ++as) {
+ if (as != args->security_group_ids)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->security_group_ids_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroupIds\":" ));
+ STRY(osc_str_append_string(data, args->security_group_ids_str));
+ ret += 1;
+ }
+ if (args->security_groups) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroups\":[" ));
+ for (as = args->security_groups; *as > 0; ++as) {
+ if (as != args->security_groups)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->security_groups_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SecurityGroups\":" ));
+ STRY(osc_str_append_string(data, args->security_groups_str));
+ ret += 1;
+ }
+ if (args->subnet_id) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"SubnetId\":\"" ));
+ STRY(osc_str_append_string(data, args->subnet_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->user_data) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SnapshotId\":\"" ));
- STRY(osc_str_append_string(data, args->snapshot_id));
+ STRY(osc_str_append_string(data, "\"UserData\":\"" ));
+ STRY(osc_str_append_string(data, args->user_data));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->subregion_name) {
+ if (args->vm_initiated_shutdown_behavior) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubregionName\":\"" ));
- STRY(osc_str_append_string(data, args->subregion_name));
+ STRY(osc_str_append_string(data, "\"VmInitiatedShutdownBehavior\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_initiated_shutdown_behavior));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->volume_type) {
+ if (args->vm_type) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VolumeType\":\"" ));
- STRY(osc_str_append_string(data, args->volume_type));
+ STRY(osc_str_append_string(data, "\"VmType\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_type));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -24517,7 +26387,7 @@ static int create_volume_data(struct osc_create_volume_arg *args, struct osc_st
return !!ret;
}
-int osc_create_volume(struct osc_env *e, struct osc_str *out, struct osc_create_volume_arg *args)
+int osc_create_vms(struct osc_env *e, struct osc_str *out, struct osc_create_vms_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -24526,12 +26396,12 @@ int osc_create_volume(struct osc_env *e, struct osc_str *out, struct osc_create_
osc_init_str(&data);
osc_init_str(&end_call);
- r = create_volume_data(args, &data);
+ r = create_vms_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/CreateVolume");
+ osc_str_append_string(&end_call, "/api/v1/CreateVms");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -24544,7 +26414,7 @@ int osc_create_volume(struct osc_env *e, struct osc_str *out, struct osc_create_
osc_deinit_str(&data);
return res;
}
-static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *data)
+static int create_vm_template_data(struct osc_create_vm_template_arg *args, struct osc_str *data)
{
int ret = 0;
int count_args = 0;
@@ -24552,55 +26422,35 @@ static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *dat
if (!args)
return 0;
osc_str_append_string(data, "{");
- if (args->block_device_mappings) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":[" ));
- for (int i = 0; i < args->nb_block_device_mappings; ++i) {
- struct block_device_mapping_vm_creation *p = &args->block_device_mappings[i];
- if (p != args->block_device_mappings)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "{ " ));
- STRY(block_device_mapping_vm_creation_setter(p, data) < 0);
- STRY(osc_str_append_string(data, "}" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else
- if (args->block_device_mappings_str) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BlockDeviceMappings\":" ));
- STRY(osc_str_append_string(data, args->block_device_mappings_str));
- ret += 1;
- }
- if (args->is_set_boot_on_creation) {
+ if (args->is_set_cpu_cores || args->cpu_cores) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BootOnCreation\":" ));
- STRY(osc_str_append_bool(data, args->boot_on_creation));
+ STRY(osc_str_append_string(data, "\"CpuCores\":" ));
+ STRY(osc_str_append_int(data, args->cpu_cores));
ret += 1;
}
- if (args->is_set_bsu_optimized) {
+ if (args->cpu_generation) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"BsuOptimized\":" ));
- STRY(osc_str_append_bool(data, args->bsu_optimized));
+ STRY(osc_str_append_string(data, "\"CpuGeneration\":\"" ));
+ STRY(osc_str_append_string(data, args->cpu_generation));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->client_token) {
+ if (args->cpu_performance) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ClientToken\":\"" ));
- STRY(osc_str_append_string(data, args->client_token));
+ STRY(osc_str_append_string(data, "\"CpuPerformance\":\"" ));
+ STRY(osc_str_append_string(data, args->cpu_performance));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->is_set_deletion_protection) {
+ if (args->description) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"DeletionProtection\":" ));
- STRY(osc_str_append_bool(data, args->deletion_protection));
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
+ STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
if (args->is_set_dry_run) {
@@ -24626,92 +26476,104 @@ static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *dat
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->is_set_max_vms_count || args->max_vms_count) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MaxVmsCount\":" ));
- STRY(osc_str_append_int(data, args->max_vms_count));
- ret += 1;
- }
- if (args->is_set_min_vms_count || args->min_vms_count) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"MinVmsCount\":" ));
- STRY(osc_str_append_int(data, args->min_vms_count));
- ret += 1;
- }
- if (args->is_set_nested_virtualization) {
+ if (args->is_set_ram || args->ram) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"NestedVirtualization\":" ));
- STRY(osc_str_append_bool(data, args->nested_virtualization));
+ STRY(osc_str_append_string(data, "\"Ram\":" ));
+ STRY(osc_str_append_int(data, args->ram));
ret += 1;
}
- if (args->nics) {
+ if (args->tags) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Nics\":[" ));
- for (int i = 0; i < args->nb_nics; ++i) {
- struct nic_for_vm_creation *p = &args->nics[i];
- if (p != args->nics)
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
STRY(osc_str_append_string(data, "," ));
STRY(osc_str_append_string(data, "{ " ));
- STRY(nic_for_vm_creation_setter(p, data) < 0);
+ STRY(resource_tag_setter(p, data) < 0);
STRY(osc_str_append_string(data, "}" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
} else
- if (args->nics_str) {
+ if (args->tags_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Nics\":" ));
- STRY(osc_str_append_string(data, args->nics_str));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
ret += 1;
}
- if (args->performance) {
+ if (args->vm_template_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Performance\":\"" ));
- STRY(osc_str_append_string(data, args->performance));
+ STRY(osc_str_append_string(data, "\"VmTemplateName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_name));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->placement_str) {
+ osc_str_append_string(data, "}");
+ return !!ret;
+}
+
+int osc_create_vm_template(struct osc_env *e, struct osc_str *out, struct osc_create_vm_template_arg *args)
+{
+ CURLcode res = CURLE_OUT_OF_MEMORY;
+ struct osc_str data;
+ struct osc_str end_call;
+ int r;
+
+ osc_init_str(&data);
+ osc_init_str(&end_call);
+ r = create_vm_template_data(args, &data);
+ if (r < 0)
+ goto out;
+
+ osc_str_append_string(&end_call, e->endpoint.buf);
+ osc_str_append_string(&end_call, "/api/v1/CreateVmTemplate");
+ curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
+ curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
+ curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
+ if (e->flag & OSC_VERBOSE_MODE) {
+ printf("\n%s\n\n", data.buf);
+ }
+ res = curl_easy_perform(e->c);
+out:
+ osc_deinit_str(&end_call);
+ osc_deinit_str(&data);
+ return res;
+}
+static int create_vm_group_data(struct osc_create_vm_group_arg *args, struct osc_str *data)
+{
+ int ret = 0;
+ int count_args = 0;
+
+ if (!args)
+ return 0;
+ osc_str_append_string(data, "{");
+ if (args->description) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Placement\":" ));
- STRY(osc_str_append_string(data, args->placement_str));
- ret += 1;
- } else if (args->is_set_placement) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"Placement\": { " ));
- STRY(placement_setter(&args->placement, data) < 0);
- STRY(osc_str_append_string(data, "}" ));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"Description\":\"" ));
+ STRY(osc_str_append_string(data, args->description));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
}
- if (args->private_ips) {
- char **as;
-
+ if (args->is_set_dry_run) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"PrivateIps\":[" ));
- for (as = args->private_ips; *as > 0; ++as) {
- if (as != args->private_ips)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
- }
- STRY(osc_str_append_string(data, "]" ));
- ret += 1;
- } else if (args->private_ips_str) {
+ STRY(osc_str_append_string(data, "\"DryRun\":" ));
+ STRY(osc_str_append_bool(data, args->dry_run));
+ ret += 1;
+ }
+ if (args->positioning_strategy) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"PrivateIps\":" ));
- STRY(osc_str_append_string(data, args->private_ips_str));
- ret += 1;
+ STRY(osc_str_append_string(data, "\"PositioningStrategy\":\"" ));
+ STRY(osc_str_append_string(data, args->positioning_strategy));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
}
if (args->security_group_ids) {
char **as;
@@ -24735,57 +26597,56 @@ static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *dat
STRY(osc_str_append_string(data, args->security_group_ids_str));
ret += 1;
}
- if (args->security_groups) {
- char **as;
-
+ if (args->subnet_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SecurityGroups\":[" ));
- for (as = args->security_groups; *as > 0; ++as) {
- if (as != args->security_groups)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"" ));
- STRY(osc_str_append_string(data, *as));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, "\"SubnetId\":\"" ));
+ STRY(osc_str_append_string(data, args->subnet_id));
+ STRY(osc_str_append_string(data, "\"" ));
+ ret += 1;
+ }
+ if (args->tags) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"Tags\":[" ));
+ for (int i = 0; i < args->nb_tags; ++i) {
+ struct resource_tag *p = &args->tags[i];
+ if (p != args->tags)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "{ " ));
+ STRY(resource_tag_setter(p, data) < 0);
+ STRY(osc_str_append_string(data, "}" ));
}
STRY(osc_str_append_string(data, "]" ));
ret += 1;
- } else if (args->security_groups_str) {
+ } else
+ if (args->tags_str) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SecurityGroups\":" ));
- STRY(osc_str_append_string(data, args->security_groups_str));
+ STRY(osc_str_append_string(data, "\"Tags\":" ));
+ STRY(osc_str_append_string(data, args->tags_str));
ret += 1;
}
- if (args->subnet_id) {
- if (count_args++ > 0)
- STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"SubnetId\":\"" ));
- STRY(osc_str_append_string(data, args->subnet_id));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
- }
- if (args->user_data) {
+ if (args->is_set_vm_count || args->vm_count) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"UserData\":\"" ));
- STRY(osc_str_append_string(data, args->user_data));
- STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, "\"VmCount\":" ));
+ STRY(osc_str_append_int(data, args->vm_count));
ret += 1;
}
- if (args->vm_initiated_shutdown_behavior) {
+ if (args->vm_group_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmInitiatedShutdownBehavior\":\"" ));
- STRY(osc_str_append_string(data, args->vm_initiated_shutdown_behavior));
+ STRY(osc_str_append_string(data, "\"VmGroupName\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_group_name));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
- if (args->vm_type) {
+ if (args->vm_template_id) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"VmType\":\"" ));
- STRY(osc_str_append_string(data, args->vm_type));
+ STRY(osc_str_append_string(data, "\"VmTemplateId\":\"" ));
+ STRY(osc_str_append_string(data, args->vm_template_id));
STRY(osc_str_append_string(data, "\"" ));
ret += 1;
}
@@ -24793,7 +26654,7 @@ static int create_vms_data(struct osc_create_vms_arg *args, struct osc_str *dat
return !!ret;
}
-int osc_create_vms(struct osc_env *e, struct osc_str *out, struct osc_create_vms_arg *args)
+int osc_create_vm_group(struct osc_env *e, struct osc_str *out, struct osc_create_vm_group_arg *args)
{
CURLcode res = CURLE_OUT_OF_MEMORY;
struct osc_str data;
@@ -24802,12 +26663,12 @@ int osc_create_vms(struct osc_env *e, struct osc_str *out, struct osc_create_vms
osc_init_str(&data);
osc_init_str(&end_call);
- r = create_vms_data(args, &data);
+ r = create_vm_group_data(args, &data);
if (r < 0)
goto out;
osc_str_append_string(&end_call, e->endpoint.buf);
- osc_str_append_string(&end_call, "/api/v1/CreateVms");
+ osc_str_append_string(&end_call, "/api/v1/CreateVmGroup");
curl_easy_setopt(e->c, CURLOPT_URL, end_call.buf);
curl_easy_setopt(e->c, CURLOPT_POSTFIELDS, r ? data.buf : "");
curl_easy_setopt(e->c, CURLOPT_WRITEDATA, out);
@@ -26838,6 +28699,28 @@ static int create_image_data(struct osc_create_image_arg *args, struct osc_str
STRY(osc_str_append_bool(data, args->no_reboot));
ret += 1;
}
+ if (args->product_codes) {
+ char **as;
+
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ProductCodes\":[" ));
+ for (as = args->product_codes; *as > 0; ++as) {
+ if (as != args->product_codes)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"" ));
+ STRY(osc_str_append_string(data, *as));
+ STRY(osc_str_append_string(data, "\"" ));
+ }
+ STRY(osc_str_append_string(data, "]" ));
+ ret += 1;
+ } else if (args->product_codes_str) {
+ if (count_args++ > 0)
+ STRY(osc_str_append_string(data, "," ));
+ STRY(osc_str_append_string(data, "\"ProductCodes\":" ));
+ STRY(osc_str_append_string(data, args->product_codes_str));
+ ret += 1;
+ }
if (args->root_device_name) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
@@ -27677,10 +29560,9 @@ static int create_access_key_data(struct osc_create_access_key_arg *args, struc
if (args->expiration_date) {
if (count_args++ > 0)
STRY(osc_str_append_string(data, "," ));
- STRY(osc_str_append_string(data, "\"ExpirationDate\":\"" ));
+ STRY(osc_str_append_string(data, "\"ExpirationDate\":" ));
STRY(osc_str_append_string(data, args->expiration_date));
- STRY(osc_str_append_string(data, "\"" ));
- ret += 1;
+ ret += 1;
}
osc_str_append_string(data, "}");
return !!ret;
diff --git a/osc_sdk.h b/osc_sdk.h
index c6ebe8a..fdb08b4 100644
--- a/osc_sdk.h
+++ b/osc_sdk.h
@@ -70,7 +70,7 @@ struct osc_str {
#define OSC_ENV_FREE_AK_SK (OSC_ENV_FREE_AK | OSC_ENV_FREE_SK)
-#define OSC_API_VERSION "1.25"
+#define OSC_API_VERSION "1.26"
#define OSC_SDK_VERSION 0xC061AC
enum osc_auth_method {
@@ -364,7 +364,8 @@ struct bsu_created {
int is_set_delete_on_vm_deletion;
int delete_on_vm_deletion; /* bool */
/*
- * The time and date of attachment of the volume to the VM.
+ * The date and time of attachment of the volume to the VM, in ISO 8601
+ * date-time format.
*/
char *link_date; /* string */
/*
@@ -575,6 +576,27 @@ struct catalog_entry {
double unit_price; /* double */
};
+struct catalogs {
+ /*
+ * One or more catalog entries.
+ */
+ char *entries_str;
+ int nb_entries;
+ struct catalog_entry *entries; /* array ref CatalogEntry */
+ /*
+ * The beginning of the time period, in ISO 8601 date-time format.
+ */
+ char *from_date; /* string */
+ /*
+ * The state of the catalog (`CURRENT` \\| `OBSOLETE`).
+ */
+ char *state; /* string */
+ /*
+ * The end of the time period, in ISO 8601 date-time format.
+ */
+ char *to_date; /* string */
+};
+
struct client_gateway {
/*
* The Autonomous System Number (ASN) used by the Border Gateway
@@ -620,7 +642,7 @@ struct consumption_entry {
*/
char *category; /* string */
/*
- * The beginning of the time period.
+ * The beginning of the time period, in ISO 8601 date-time format.
*/
char *from_date; /* string */
/*
@@ -647,7 +669,7 @@ struct consumption_entry {
*/
char *title; /* string */
/*
- * The end of the time period.
+ * The end of the time period, in ISO 8601 date-time format.
*/
char *to_date; /* string */
/*
@@ -911,15 +933,17 @@ struct filters_api_log {
char *query_call_names_str;
char **query_call_names; /* array string */
/*
- * The date after which you want to retrieve logged calls, in ISO 8601
- * format (for example, `2020-06-14`). By default, this date is set to
- * 48 hours before the `QueryDateBefore` parameter value.
+ * The date and time, or the date, after which you want to retrieve
+ * logged calls, in ISO 8601 format (for example,
+ * `2020-06-14T00:00:00.000Z` or `2020-06-14`). By default, this date is
+ * set to 48 hours before the `QueryDateBefore` parameter value.
*/
char *query_date_after; /* string */
/*
- * The date before which you want to retrieve logged calls, in ISO 8601
- * format (for example, `2020-06-30`). By default, this date is set to
- * now, or 48 hours after the `QueryDateAfter` parameter value.
+ * The date and time, or the date, before which you want to retrieve
+ * logged calls, in ISO 8601 format (for example,
+ * `2020-06-30T00:00:00.000Z` or `2020-06-14`). By default, this date is
+ * set to now, or 48 hours after the `QueryDateAfter` parameter value.
*/
char *query_date_before; /* string */
/*
@@ -962,6 +986,27 @@ struct filters_ca {
char **descriptions; /* array string */
};
+struct filters_catalogs {
+ /*
+ * By default or if set to true, only returns the current catalog. If
+ * false, returns the current catalog and past catalogs.
+ */
+ int is_set_current_catalog_only;
+ int current_catalog_only; /* bool */
+ /*
+ * The beginning of the time period, in ISO 8601 date format (for
+ * example, `2020-06-14`). This date cannot be older than 3 years. You
+ * must specify the parameters `FromDate` and `ToDate` together.
+ */
+ char *from_date; /* string */
+ /*
+ * The end of the time period, in ISO 8601 date format (for example,
+ * `2020-06-30`). You must specify the parameters `FromDate` and
+ * `ToDate` together.
+ */
+ char *to_date; /* string */
+};
+
struct filters_client_gateway {
/*
* The Border Gateway Protocol (BGP) Autonomous System Numbers (ASNs) of
@@ -1211,8 +1256,7 @@ struct filters_image {
int is_set_permissions_to_launch_global_permission;
int permissions_to_launch_global_permission; /* bool */
/*
- * The product code associated with the OMI (`0001` Linux/Unix \\|
- * `0002` Windows \\| `0004` Linux/Oracle \\| `0005` Windows 10).
+ * The product codes associated with the OMI.
*/
char *product_codes_str;
char **product_codes; /* array string */
@@ -2010,6 +2054,11 @@ struct filters_snapshot {
*/
char *descriptions_str;
char **descriptions; /* array string */
+ /*
+ * The beginning of the time period, in ISO 8601 date-time format (for
+ * example, `2020-06-14T00:00:00.000Z`).
+ */
+ char *from_creation_date; /* string */
/*
* The account IDs of one or more users who have permissions to create
* volumes.
@@ -2054,6 +2103,11 @@ struct filters_snapshot {
*/
char *tags_str;
char **tags; /* array string */
+ /*
+ * The end of the time period, in ISO 8601 date-time format (for
+ * example, `2020-06-30T00:00:00.000Z`).
+ */
+ char *to_creation_date; /* string */
/*
* The IDs of the volumes used to create the snapshots.
*/
@@ -2232,6 +2286,126 @@ struct filters_vm {
char **vm_ids; /* array string */
};
+struct filters_vm_group {
+ /*
+ * The descriptions of the VM groups.
+ */
+ char *descriptions_str;
+ char **descriptions; /* array string */
+ /*
+ * The IDs of the security groups.
+ */
+ char *security_group_ids_str;
+ char **security_group_ids; /* array string */
+ /*
+ * The IDs of the Subnets.
+ */
+ char *subnet_ids_str;
+ char **subnet_ids; /* array string */
+ /*
+ * The keys of the tags associated with the VM groups.
+ */
+ char *tag_keys_str;
+ char **tag_keys; /* array string */
+ /*
+ * The values of the tags associated with the VM groups.
+ */
+ char *tag_values_str;
+ char **tag_values; /* array string */
+ /*
+ * The key/value combination of the tags associated with the VMs, in the
+ * following format:
+ * "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.
+ */
+ char *tags_str;
+ char **tags; /* array string */
+ /*
+ * The number of VMs in the VM group.
+ */
+ char *vm_counts_str;
+ int *vm_counts; /* array integer */
+ /*
+ * The IDs of the VM groups.
+ */
+ char *vm_group_ids_str;
+ char **vm_group_ids; /* array string */
+ /*
+ * The names of the VM groups.
+ */
+ char *vm_group_names_str;
+ char **vm_group_names; /* array string */
+ /*
+ * The IDs of the VM templates.
+ */
+ char *vm_template_ids_str;
+ char **vm_template_ids; /* array string */
+};
+
+struct filters_vm_template {
+ /*
+ * The number of vCores.
+ */
+ char *cpu_cores_str;
+ int *cpu_cores; /* array integer */
+ /*
+ * The processor generations (for example, `v4`).
+ */
+ char *cpu_generations_str;
+ char **cpu_generations; /* array string */
+ /*
+ * The performances of the VMs.
+ */
+ char *cpu_performances_str;
+ char **cpu_performances; /* array string */
+ /*
+ * The descriptions of the VM templates.
+ */
+ char *descriptions_str;
+ char **descriptions; /* array string */
+ /*
+ * The IDs of the OMIs.
+ */
+ char *image_ids_str;
+ char **image_ids; /* array string */
+ /*
+ * The names of the keypairs.
+ */
+ char *keypair_names_str;
+ char **keypair_names; /* array string */
+ /*
+ * The amount of RAM.
+ */
+ char *rams_str;
+ int *rams; /* array integer */
+ /*
+ * The keys of the tags associated with the VM templates.
+ */
+ char *tag_keys_str;
+ char **tag_keys; /* array string */
+ /*
+ * The values of the tags associated with the VM templates.
+ */
+ char *tag_values_str;
+ char **tag_values; /* array string */
+ /*
+ * The key/value combination of the tags associated with the VM
+ * templates, in the following format:
+ * \Filters\:{\Tags\:[\TAGKEY=TAGVALUE\]}.
+ */
+ char *tags_str;
+ char **tags; /* array string */
+ /*
+ * The IDs of the VM templates.
+ */
+ char *vm_template_ids_str;
+ char **vm_template_ids; /* array string */
+ /*
+ * The names of the VM templates.
+ */
+ char *vm_template_names_str;
+ char **vm_template_names; /* array string */
+};
+
struct filters_vm_type {
/*
* This parameter is not available. It is present in our API for the
@@ -2309,7 +2483,8 @@ struct filters_vms_state {
struct filters_volume {
/*
- * The dates and times of creation of the volumes.
+ * The dates and times of creation of the volumes, in ISO 8601 date-time
+ * format (for example, `2020-06-30T00:00:00.000Z`).
*/
char *creation_dates_str;
char **creation_dates; /* array string */
@@ -2324,7 +2499,8 @@ struct filters_volume {
char *link_volume_device_names_str;
char **link_volume_device_names; /* array string */
/*
- * The dates and times of creation of the volumes.
+ * The dates and times of creation of the volumes, in ISO 8601 date-time
+ * format (for example, `2020-06-30T00:00:00.000Z`).
*/
char *link_volume_link_dates_str;
char **link_volume_link_dates; /* array string */
@@ -2606,7 +2782,8 @@ struct image {
int nb_block_device_mappings;
struct block_device_mapping_image *block_device_mappings; /* array ref BlockDeviceMappingImage */
/*
- * The date and time of creation of the OMI.
+ * The date and time of creation of the OMI, in ISO 8601 date-time
+ * format.
*/
char *creation_date; /* string */
/*
@@ -2636,8 +2813,7 @@ struct image {
int is_set_permissions_to_launch;
struct permissions_on_resource permissions_to_launch; /* ref PermissionsOnResource */
/*
- * The product code associated with the OMI (`0001` Linux/Unix \\|
- * `0002` Windows \\| `0004` Linux/Oracle \\| `0005` Windows 10).
+ * The product codes associated with the OMI.
*/
char *product_codes_str;
char **product_codes; /* array string */
@@ -3262,7 +3438,7 @@ struct log {
*/
char *query_call_name; /* string */
/*
- * The date of the logged call, in ISO 8601 format.
+ * The date and time of the logged call, in ISO 8601 date-time format.
*/
char *query_date; /* string */
/*
@@ -4632,9 +4808,7 @@ struct vm {
*/
char *private_ip; /* string */
/*
- * The product code associated with the OMI used to create the VM
- * (`0001` Linux/Unix \\| `0002` Windows \\| `0004` Linux/Oracle \\|
- * `0005` Windows 10).
+ * The product codes associated with the OMI used to create the VM.
*/
char *product_codes_str;
char **product_codes; /* array string */
@@ -4704,6 +4878,68 @@ struct vm {
char *vm_type; /* string */
};
+struct vm_group {
+ /*
+ * The date and time of creation of the VM group.
+ */
+ char *creation_date; /* string */
+ /*
+ * The description of the VM group.
+ */
+ char *description; /* string */
+ /*
+ * The positioning strategy of the VMs on hypervisors. By default, or if
+ * set to `no-strategy`, TINA determines the most adequate position for
+ * the VMs. If set to `attract`, the VMs are deployed on the same
+ * hypervisor, which improves network performance. If set to `repulse`,
+ * the VMs are deployed on a different hypervisor, which improves fault
+ * tolerance.
+ */
+ char *positioning_strategy; /* string */
+ /*
+ * One or more IDs of security groups for the VM group.
+ */
+ char *security_group_ids_str;
+ char **security_group_ids; /* array string */
+ /*
+ * The state of the VM group (`pending` \\| `available` \\| `scaling up`
+ * \\| `scaling down` \\| `deleting` \\| `deleted`).
+ */
+ char *state; /* string */
+ /*
+ * The ID of the Subnet for the VM group.
+ */
+ char *subnet_id; /* string */
+ /*
+ * One or more tags associated with the VM group.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The number of VMs in the VM group.
+ */
+ int is_set_vm_count;
+ int vm_count; /* int */
+ /*
+ * The ID of the VM group.
+ */
+ char *vm_group_id; /* string */
+ /*
+ * The name of the VM group.
+ */
+ char *vm_group_name; /* string */
+ /*
+ * The IDs of the VMs in the VM group.
+ */
+ char *vm_ids_str;
+ char **vm_ids; /* array string */
+ /*
+ * The ID of the VM template used by the VM group.
+ */
+ char *vm_template_id; /* string */
+};
+
struct vm_state {
/*
* The current state of the VM (`InService` \\| `OutOfService` \\|
@@ -4743,6 +4979,57 @@ struct vm_states {
char *vm_state; /* string */
};
+struct vm_template {
+ /*
+ * The number of vCores.
+ */
+ int is_set_cpu_cores;
+ int cpu_cores; /* int */
+ /*
+ * The processor generation.
+ */
+ char *cpu_generation; /* string */
+ /*
+ * The performance of the VMs.
+ */
+ char *cpu_performance; /* string */
+ /*
+ * The date and time of creation of the VM template.
+ */
+ char *creation_date; /* string */
+ /*
+ * The description of the VM template.
+ */
+ char *description; /* string */
+ /*
+ * The ID of the OMI.
+ */
+ char *image_id; /* string */
+ /*
+ * The name of the keypair.
+ */
+ char *keypair_name; /* string */
+ /*
+ * The amount of RAM.
+ */
+ int is_set_ram;
+ int ram; /* int */
+ /*
+ * One or more tags associated with the VM template.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The ID of the VM template.
+ */
+ char *vm_template_id; /* string */
+ /*
+ * The name of the VM template.
+ */
+ char *vm_template_name; /* string */
+};
+
struct vm_type {
/*
* This parameter is not available. It is present in our API for the
@@ -5069,6 +5356,66 @@ struct osc_update_volume_arg {
char *volume_type; /* string */
};
+struct osc_update_vm_template_arg {
+ /* Required: vm_template_id */
+ /*
+ * A new description for the VM template.
+ */
+ char *description; /* string */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * New tags for your VM template.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The ID of the VM template you want to update.
+ */
+ char *vm_template_id; /* string */
+ /*
+ * A new name for your VM template.
+ */
+ char *vm_template_name; /* string */
+};
+
+struct osc_update_vm_group_arg {
+ /* Required: vm_group_id */
+ /*
+ * A new description for the VM group.
+ */
+ char *description; /* string */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * New tags for your VM group.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The ID of the VM group you want to update.
+ */
+ char *vm_group_id; /* string */
+ /*
+ * A new name for your VM group.
+ */
+ char *vm_group_name; /* string */
+ /*
+ * A new VM template ID for your VM group.
+ */
+ char *vm_template_id; /* string */
+};
+
struct osc_update_vm_arg {
/* Required: vm_id */
/*
@@ -5662,11 +6009,12 @@ struct osc_update_access_key_arg {
int is_set_dry_run;
int dry_run; /* bool */
/*
- * The date and time at which you want the access key to expire, in ISO
- * 8601 format (for example, `2017-06-14` or `2017-06-14T00:00:00Z`). If
- * not specified, the access key is set to not expire.
+ * The date and time, or the date, at which you want the access key to
+ * expire, in ISO 8601 format (for example, `2020-06-14T00:00:00.000Z`
+ * or `2020-06-14`). If not specified, the access key is set to not
+ * expire.
*/
- char *expiration_date; /* string */
+ char *expiration_date; /* string string */
/*
* The new state for the access key (`ACTIVE` \\| `INACTIVE`). When set
* to `ACTIVE`, the access key is enabled and can be used to send
@@ -5886,6 +6234,44 @@ struct osc_send_reset_password_email_arg {
char *email; /* string */
};
+struct osc_scale_up_vm_group_arg {
+ /* Required: vm_group_id, vm_addition */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The number of VMs you want to add to the VM group.
+ */
+ int is_set_vm_addition;
+ int vm_addition; /* int */
+ /*
+ * The ID of the VM group you want to scale up.
+ */
+ char *vm_group_id; /* string */
+};
+
+struct osc_scale_down_vm_group_arg {
+ /* Required: vm_group_id, vm_subtraction */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The ID of the VM group you want to scale down.
+ */
+ char *vm_group_id; /* string */
+ /*
+ * The number of VMs you want to delete from the VM group.
+ */
+ int is_set_vm_subtraction;
+ int vm_subtraction; /* int */
+};
+
struct osc_reset_account_password_arg {
/* Required: password, token */
/*
@@ -6058,6 +6444,38 @@ struct osc_read_vm_types_arg {
struct filters_vm_type filters; /* ref FiltersVmType */
};
+struct osc_read_vm_templates_arg {
+ /* Required:none */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * See 'filters' type documentation
+ */
+ char *filters_str;
+ int is_set_filters;
+ struct filters_vm_template filters; /* ref FiltersVmTemplate */
+};
+
+struct osc_read_vm_groups_arg {
+ /* Required:none */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * ReadVmGroupsRequest_Filters
+ */
+ char *filters_str;
+ int is_set_filters;
+ struct filters_vm_group filters; /* ref FiltersVmGroup */
+};
+
struct osc_read_virtual_gateways_arg {
/* Required:none */
/*
@@ -6594,10 +7012,12 @@ struct osc_read_consumption_account_arg {
int is_set_dry_run;
int dry_run; /* bool */
/*
- * The beginning of the time period, in ISO 8601 date-time format (for
- * example, `2017-06-14` or `2017-06-14T00:00:00Z`).
+ * The beginning of the time period, in ISO 8601 date format (for
+ * example, `2020-06-14`). The date-time format is also accepted, but
+ * only with a time set to midnight (for example,
+ * `2020-06-14T00:00:00.000Z`).
*/
- char *from_date; /* string */
+ char *from_date; /* string string */
/*
* By default or if false, returns only the consumption of the specific
* account that sends this request. If true, returns either the overall
@@ -6608,10 +7028,11 @@ struct osc_read_consumption_account_arg {
int is_set_overall;
int overall; /* bool */
/*
- * The end of the time period, in ISO 8601 date-time format (for
- * example, `2017-06-30` or `2017-06-30T00:00:00Z`).
+ * The end of the time period, in ISO 8601 date format (for example,
+ * `2020-06-30`). The date-time format is also accepted, but only with a
+ * time set to midnight (for example, `2020-06-30T00:00:00.000Z`).
*/
- char *to_date; /* string */
+ char *to_date; /* string string */
};
struct osc_read_console_output_arg {
@@ -6644,6 +7065,22 @@ struct osc_read_client_gateways_arg {
struct filters_client_gateway filters; /* ref FiltersClientGateway */
};
+struct osc_read_catalogs_arg {
+ /* Required:none */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * ReadCatalogsRequest_Filters
+ */
+ char *filters_str;
+ int is_set_filters;
+ struct filters_catalogs filters; /* ref FiltersCatalogs */
+};
+
struct osc_read_catalog_arg {
/* Required:none */
/*
@@ -7074,6 +7511,34 @@ struct osc_delete_vms_arg {
char **vm_ids; /* array string */
};
+struct osc_delete_vm_template_arg {
+ /* Required: vm_template_id */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The ID of the VM template you want to delete.
+ */
+ char *vm_template_id; /* string */
+};
+
+struct osc_delete_vm_group_arg {
+ /* Required: vm_group_id */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The ID of the VM group you want to delete.
+ */
+ char *vm_group_id; /* string */
+};
+
struct osc_delete_virtual_gateway_arg {
/* Required: virtual_gateway_id */
/*
@@ -7827,6 +8292,108 @@ struct osc_create_vms_arg {
char *vm_type; /* string */
};
+struct osc_create_vm_template_arg {
+ /* Required: cpu_cores, cpu_generation, image_id, ram, vm_template_name */
+ /*
+ * The number of vCores to use for each VM.
+ */
+ int is_set_cpu_cores;
+ int cpu_cores; /* int */
+ /*
+ * The processor generation to use for each VM (for example, `v4`).
+ */
+ char *cpu_generation; /* string */
+ /*
+ * The performance of the VMs (`medium` \\| `high` \\| `highest`).
+ */
+ char *cpu_performance; /* string */
+ /*
+ * A description for the VM template.
+ */
+ char *description; /* string */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The ID of the OMI to use for each VM. You can find a list of OMIs by
+ * calling the [ReadImages](#readimages) method.
+ */
+ char *image_id; /* string */
+ /*
+ * The name of the keypair to use for each VM.
+ */
+ char *keypair_name; /* string */
+ /*
+ * The amount of RAM to use for each VM.
+ */
+ int is_set_ram;
+ int ram; /* int */
+ /*
+ * One or more tags to add to the VM template.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The name of the VM template.
+ */
+ char *vm_template_name; /* string */
+};
+
+struct osc_create_vm_group_arg {
+ /* Required: security_group_ids, subnet_id, vm_group_name, vm_template_id, vm_count */
+ /*
+ * A description for the VM group.
+ */
+ char *description; /* string */
+ /*
+ * If true, checks whether you have the required permissions to perform
+ * the action.
+ */
+ int is_set_dry_run;
+ int dry_run; /* bool */
+ /*
+ * The positioning strategy of VMs on hypervisors. By default, or if set
+ * to `no-strategy` our orchestrator determines the most adequate
+ * position for your VMs. If set to `attract`, your VMs are deployed on
+ * the same hypervisor, which improves network performance. If set to
+ * `repulse`, your VMs are deployed on a different hypervisor, which
+ * improves fault tolerance.
+ */
+ char *positioning_strategy; /* string */
+ /*
+ * One or more IDs of security groups for the VM group.
+ */
+ char *security_group_ids_str;
+ char **security_group_ids; /* array string */
+ /*
+ * The ID of the Subnet in which you want to create the VM group.
+ */
+ char *subnet_id; /* string */
+ /*
+ * One or more tags to add to the VM group.
+ */
+ char *tags_str;
+ int nb_tags;
+ struct resource_tag *tags; /* array ref ResourceTag */
+ /*
+ * The number of VMs deployed in the VM group.
+ */
+ int is_set_vm_count;
+ int vm_count; /* int */
+ /*
+ * The name of the VM group.
+ */
+ char *vm_group_name; /* string */
+ /*
+ * The ID of the VM template used to launch VMs in the VM group.
+ */
+ char *vm_template_id; /* string */
+};
+
struct osc_create_virtual_gateway_arg {
/* Required: connection_type */
/*
@@ -8522,6 +9089,11 @@ struct osc_create_image_arg {
*/
int is_set_no_reboot;
int no_reboot; /* bool */
+ /*
+ * The product codes associated with the OMI.
+ */
+ char *product_codes_str;
+ char **product_codes; /* array string */
/*
* The name of the root device. You must specify only one of the
* following parameters: `FileLocation`, `RootDeviceName`,
@@ -8819,12 +9391,12 @@ struct osc_create_access_key_arg {
int is_set_dry_run;
int dry_run; /* bool */
/*
- * The date and time at which you want the access key to expire, in ISO
- * 8601 format (for example, `2017-06-14` or `2017-06-14T00:00:00Z`). To
- * remove an existing expiration date, use the method without specifying
- * this parameter.
+ * The date and time, or the date, at which you want the access key to
+ * expire, in ISO 8601 format (for example, `2020-06-14T00:00:00.000Z`,
+ * or `2020-06-14`). To remove an existing expiration date, use the
+ * method without specifying this parameter.
*/
- char *expiration_date; /* string */
+ char *expiration_date; /* string string */
};
struct osc_check_authentication_arg {
@@ -8936,6 +9508,8 @@ const char *osc_find_args_description(const char *call_name);
int osc_update_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_update_vpn_connection_arg *args);
int osc_update_volume(struct osc_env *e, struct osc_str *out, struct osc_update_volume_arg *args);
+int osc_update_vm_template(struct osc_env *e, struct osc_str *out, struct osc_update_vm_template_arg *args);
+int osc_update_vm_group(struct osc_env *e, struct osc_str *out, struct osc_update_vm_group_arg *args);
int osc_update_vm(struct osc_env *e, struct osc_str *out, struct osc_update_vm_arg *args);
int osc_update_subnet(struct osc_env *e, struct osc_str *out, struct osc_update_subnet_arg *args);
int osc_update_snapshot(struct osc_env *e, struct osc_str *out, struct osc_update_snapshot_arg *args);
@@ -8967,6 +9541,8 @@ int osc_unlink_flexible_gpu(struct osc_env *e, struct osc_str *out, struct osc_u
int osc_stop_vms(struct osc_env *e, struct osc_str *out, struct osc_stop_vms_arg *args);
int osc_start_vms(struct osc_env *e, struct osc_str *out, struct osc_start_vms_arg *args);
int osc_send_reset_password_email(struct osc_env *e, struct osc_str *out, struct osc_send_reset_password_email_arg *args);
+int osc_scale_up_vm_group(struct osc_env *e, struct osc_str *out, struct osc_scale_up_vm_group_arg *args);
+int osc_scale_down_vm_group(struct osc_env *e, struct osc_str *out, struct osc_scale_down_vm_group_arg *args);
int osc_reset_account_password(struct osc_env *e, struct osc_str *out, struct osc_reset_account_password_arg *args);
int osc_reject_net_peering(struct osc_env *e, struct osc_str *out, struct osc_reject_net_peering_arg *args);
int osc_register_vms_in_load_balancer(struct osc_env *e, struct osc_str *out, struct osc_register_vms_in_load_balancer_arg *args);
@@ -8977,6 +9553,8 @@ int osc_read_vms_state(struct osc_env *e, struct osc_str *out, struct osc_read_v
int osc_read_vms_health(struct osc_env *e, struct osc_str *out, struct osc_read_vms_health_arg *args);
int osc_read_vms(struct osc_env *e, struct osc_str *out, struct osc_read_vms_arg *args);
int osc_read_vm_types(struct osc_env *e, struct osc_str *out, struct osc_read_vm_types_arg *args);
+int osc_read_vm_templates(struct osc_env *e, struct osc_str *out, struct osc_read_vm_templates_arg *args);
+int osc_read_vm_groups(struct osc_env *e, struct osc_str *out, struct osc_read_vm_groups_arg *args);
int osc_read_virtual_gateways(struct osc_env *e, struct osc_str *out, struct osc_read_virtual_gateways_arg *args);
int osc_read_tags(struct osc_env *e, struct osc_str *out, struct osc_read_tags_arg *args);
int osc_read_subregions(struct osc_env *e, struct osc_str *out, struct osc_read_subregions_arg *args);
@@ -9015,6 +9593,7 @@ int osc_read_dhcp_options(struct osc_env *e, struct osc_str *out, struct osc_rea
int osc_read_consumption_account(struct osc_env *e, struct osc_str *out, struct osc_read_consumption_account_arg *args);
int osc_read_console_output(struct osc_env *e, struct osc_str *out, struct osc_read_console_output_arg *args);
int osc_read_client_gateways(struct osc_env *e, struct osc_str *out, struct osc_read_client_gateways_arg *args);
+int osc_read_catalogs(struct osc_env *e, struct osc_str *out, struct osc_read_catalogs_arg *args);
int osc_read_catalog(struct osc_env *e, struct osc_str *out, struct osc_read_catalog_arg *args);
int osc_read_cas(struct osc_env *e, struct osc_str *out, struct osc_read_cas_arg *args);
int osc_read_api_logs(struct osc_env *e, struct osc_str *out, struct osc_read_api_logs_arg *args);
@@ -9037,6 +9616,8 @@ int osc_delete_vpn_connection_route(struct osc_env *e, struct osc_str *out, stru
int osc_delete_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_delete_vpn_connection_arg *args);
int osc_delete_volume(struct osc_env *e, struct osc_str *out, struct osc_delete_volume_arg *args);
int osc_delete_vms(struct osc_env *e, struct osc_str *out, struct osc_delete_vms_arg *args);
+int osc_delete_vm_template(struct osc_env *e, struct osc_str *out, struct osc_delete_vm_template_arg *args);
+int osc_delete_vm_group(struct osc_env *e, struct osc_str *out, struct osc_delete_vm_group_arg *args);
int osc_delete_virtual_gateway(struct osc_env *e, struct osc_str *out, struct osc_delete_virtual_gateway_arg *args);
int osc_delete_tags(struct osc_env *e, struct osc_str *out, struct osc_delete_tags_arg *args);
int osc_delete_subnet(struct osc_env *e, struct osc_str *out, struct osc_delete_subnet_arg *args);
@@ -9073,6 +9654,8 @@ int osc_create_vpn_connection_route(struct osc_env *e, struct osc_str *out, stru
int osc_create_vpn_connection(struct osc_env *e, struct osc_str *out, struct osc_create_vpn_connection_arg *args);
int osc_create_volume(struct osc_env *e, struct osc_str *out, struct osc_create_volume_arg *args);
int osc_create_vms(struct osc_env *e, struct osc_str *out, struct osc_create_vms_arg *args);
+int osc_create_vm_template(struct osc_env *e, struct osc_str *out, struct osc_create_vm_template_arg *args);
+int osc_create_vm_group(struct osc_env *e, struct osc_str *out, struct osc_create_vm_group_arg *args);
int osc_create_virtual_gateway(struct osc_env *e, struct osc_str *out, struct osc_create_virtual_gateway_arg *args);
int osc_create_tags(struct osc_env *e, struct osc_str *out, struct osc_create_tags_arg *args);
int osc_create_subnet(struct osc_env *e, struct osc_str *out, struct osc_create_subnet_arg *args);
diff --git a/sdk_version b/sdk_version
index 1d0ba9e..8f0916f 100644
--- a/sdk_version
+++ b/sdk_version
@@ -1 +1 @@
-0.4.0
+0.5.0