Commit Graph

55 Commits (9d2d364a386dc385207a1bca820a6414d8e7aa62)

Author SHA1 Message Date
René Moser a6f887ce6e cloudstack: cs_portforward: implement vpc support (#19044)
* cloudstack: cs_portforward: implement vpc support

* cloudstack: cs_portforward: add vpc and network to returns

* cloudstack: cs_portforward: networkid must not be used for rule listing

* cloudstack: fail for get_network when vpc but no network name

This seem to be a global pattern for get_network, we want to enforce a
network name to be set if a vpn param is given.

This is used for cs_portforward.

* cloudstack: cs_portforward: doc: fix defaults for vpc, network
2017-02-08 07:57:36 +01:00
Andrea Tartaglia 59227d8c31 Removed dict.iteritems() in several other files.
This is for py3 compatibility #18506
2016-12-14 08:01:45 -08:00
René Moser 18b7852940 cloudstack: utils: fail friendlier if no zones available (#19332) 2016-12-14 11:37:26 +01:00
René Moser 72f75fd9e0 cloudstack: add helpers to distinguish VMs not in VPC (#18560)
VMs in VPC and not in VPC can have an identical name. As a result VMs in a VPC must be sorted out if no VPC is given.
Due the API limitation, the only way is to check if the network of the VM is in a VPC.
2016-11-20 23:51:50 +01:00
René Moser ff7051bab4 cloudstack: fix distinguish VPC and other networks (#18515) 2016-11-19 11:50:02 +01:00
René Moser b08ef44da0 cloudstack: extend support for VPC (#18434) 2016-11-14 09:03:46 +01:00
René Moser 80af461178 cloudstack: add additional CLOUDSTACK_VPC env var (#18467) 2016-11-11 14:03:43 +01:00
Daniel Menet 19fdb58948 fix iteritems for python 3 2016-11-01 09:38:03 -07:00
René Moser 44bdc6fb79 cloudstack: implement diff support (#18254) 2016-10-30 17:05:24 +01:00
René Moser 01af859090 cloudstack: add support for defining some args as ENV vars (#17946)
These ENV vars are:
  - CLOUDSTACK_ZONE
  - CLOUDSTACK_DOMAIN
  - CLOUDSTACK_ACCOUNT
  - CLOUDSTACK_PROJECT

help to DRY on every task, args still have precedence.
2016-10-30 12:24:03 +01:00
René Moser 6247e7bc38 cloudstack: move common code to module_utils (#17635) 2016-09-19 14:47:03 +02:00
René Moser 3f6f4617dc cloudstack: fix has_changed dict values comparsion (#17632)
In some rare situations, the CloudStack API returns string for numbers
when we expected int.

With this fix, we ensure we compare the types expected.
2016-09-19 14:02:29 +02:00
René Moser 0f5f5fffee cloudstack: handle unicode API results in has_changed (#16601)
* cloudstack: handle unicode API results in has_changed

* cloudstack: add more case sensitve keys
2016-07-06 20:27:31 +02:00
René Moser 7aca70b4b0 cloudstack: simplify tag handling (#16188)
Fixes tag support in projects.
2016-06-13 08:27:27 +02:00
Rene Moser 62c424797a cloudstack: add common network code
Also used for VPC support.
2016-05-24 23:18:17 +02:00
Rene Moser fe05c5e35a cloudstack: add VPC support 2016-05-23 23:01:31 +02:00
Rene Moser 65e61e340a cloudstack: fix bug, api_secret always None
In case if api args are used, api_secret is None in every cloudstack module.
2016-03-31 00:04:42 +02:00
Rene Moser 6c641fb6a8 cloudstack: add CS_HYPERVISORS constant 2016-03-01 08:05:32 +01:00
Rene Moser 766738ef7c cloudstack: fix case insensitivity
cloudstack: fix has_change reports changed for case insensitivity values
2016-01-10 22:38:18 +01:00
Rene Moser 1d59caed07 cloudstack: change order of tags handling, fixes update of tag value does not work 2015-11-08 20:27:01 +01:00
Rene Moser 3410a855b0 cloudstack: use jop polling in tag handling, fixes outdated tags returned.
In some cases the async job did not finish fast enough, causing returning an unexpeded result.
2015-11-08 20:23:06 +01:00
Toshio Kuratomi 1bc75374dc Add imports for stdlib modules that are used.
This is cleanup that will aid us when we get ziploader implemented for 2.1
2015-11-02 12:02:26 -08:00
Rene Moser c09a34bb10 cloudstack: clean up unneeded ";" 2015-11-01 17:13:46 +01:00
gduke 744679601f Remove mutable default arguments. 2015-10-20 22:13:23 -07:00
Rene Moser b43939dfd6 cloudstack: make tags handling idempotence
Credits to @jeffersongirao, who provided the patch.
2015-09-22 16:12:35 +02:00
Rene Moser efd122c2f0 cloudstack: add returns_to_int return handling into utils
It is not uncommon that the API returns string for int values e.g. ports in listFirewallRules or listPortForwardings,
2015-09-22 14:44:08 +02:00
Rene Moser c9a3801a25 cloudstack: common argument_spec and requried_together to utils 2015-09-22 14:36:43 +02:00
Rene Moser 3db4039ad1 cloudstack: implement general api_region support, update docs 2015-08-25 13:54:21 +02:00
Rene Moser d16429b59c cloudstack: rename returns for consistency 2015-08-19 21:25:19 +02:00
Rene Moser 2913d2b44d cloudstack: add more common returns 2015-08-17 08:21:37 +02:00
Rene Moser 4f3c863b42 cloudstack: refactor get_result()
* A commen dict of keys has been defined, which we look in results returned from the API.
* self.returns dict can be use in subclass to extend this dict.
* Optionally the key name can be replaced with a new key name, often used to make the return keys identical to the arguments passed.
* Use new style class
2015-08-12 23:14:17 +02:00
Rene Moser e62fbf5fba cloudstack: add get_result() in utils to return common results 2015-08-11 18:03:50 +02:00
Rene Moser 7952723530 cloudstack: fix domain name is not unique, use full path 2015-06-26 09:25:26 +02:00
Rene Moser b9b1e294d7 cloudstack: add get_or_failback() 2015-06-26 09:25:26 +02:00
Rene Moser 0b074c449b cloudstack: methods renaming 2015-06-10 17:31:46 +02:00
Rene Moser 7b3dd55c3d cloudstack: remove unused methods used for backward compatibility 2015-06-10 17:28:45 +02:00
Rene Moser fc3020c57a cloudstack: prevent getting the wrong project.
Since we use domain and account data to filter the project, listall is not needed and can return the wrong identical named project of another account if root admin permissions are used.

Fixed projects names are not case insensitive.
2015-06-09 16:16:58 +02:00
Rene Moser caf3cf6930 cloudstack: add timeout to utils 2015-06-02 14:51:25 +02:00
Rene Moser 62ccc1b9b6 cloudstack: fix typo in variable, fixes get_domain() 2015-05-08 16:42:07 +02:00
Rene Moser 333c623b35 cloudstack: implement account und domain support in utils 2015-05-03 14:59:44 +02:00
Rene Moser af74d7f1a9 cloudstack: add get_domain() and get_account() to utils 2015-05-03 14:34:25 +02:00
Rene Moser 034ac8ae78 cloudstack: _has_changed() should not compare None values 2015-05-01 17:25:06 +02:00
Rene Moser b11cd73df1 cloudstack: add tag support in utils 2015-04-29 21:06:58 +02:00
Rene Moser 2f255f5b96 cloudstack: get_vm(): fix missing zone
Fixes returning wrong VM having identical name in different zone.
2015-04-26 23:09:33 +02:00
Rene Moser ca88189bf7 cloudstack: add method to to get infos of API
get_capabilities() allows you to get infos e.g. `cloudstackversion`
to compare functionality of the API in your modules.
2015-04-25 18:32:02 +02:00
Rene Moser 3c0e406f5d cloudstack: fix missing self. in cloudstack utils 2015-04-24 20:25:19 +02:00
Rene Moser 6354ca0718 cloudstack: add _has_changed() to utils
Generic method to compare values in dict.
2015-04-24 19:16:42 +02:00
Rene Moser 765c8fe368 cloudstack: use _get_by_key in get_...() methods in utils
But also add backward compatibility for existing modules in extras.
2015-04-24 19:09:49 +02:00
Rene Moser 88540d3cdc cloudstack: add _get_by_key() to utils
Generic method to get the whole dict or just a singe value by key if found.
2015-04-24 19:06:33 +02:00
Rene Moser 31520cdd17 cloudstack: fix other projects not found 2015-04-24 18:58:57 +02:00