-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new modules ali_ecs_tag /ali_slb_tag /ali_vpc_tag. #235
Conversation
|
||
DOCUMENTATION = """ | ||
--- | ||
module: ali_tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名改成 ali_ecs_tag,这个tag只支持对ecs资源的操作,总共有四个参数 state,resource_ids, resource_type, tags: https://help.aliyun.com/document_detail/110424.html?spm=a2c4g.11174283.6.1365.43dd52feMsOmOz
DOCUMENTATION = """ | ||
--- | ||
module: ali_tags | ||
version_added: "2.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同理,再增加三个module:ali_vpc_tag, ali_slb_tag, ali_rds_tag,参数都一样,具体的API参考对应的帮助文档
- A list of ECS instance ids. | ||
resource_type: | ||
description: | ||
- The type of ECS instance resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
支持哪些类型,要在这个地方展示出来,然后要设置一个defualt:instance
""" | ||
|
||
RETURN = ''' | ||
instances: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
返回值就输出tags就行
module.fail_json(msg='footmark required for the module ali_ecs_tag.') | ||
|
||
ecs_conn = ecs_connect(module) | ||
instances = ecs_exists(module, ecs_conn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个查询要根据具体的数据类型来调用不同的api来判断
@@ -881,29 +881,25 @@ def main(): | |||
module.fail_json(msg='Reboot instances got an error: {0}'.format(e)) | |||
|
|||
tags = module.params['tags'] | |||
if tags or module.params['purge_tags']: | |||
if module.params['purge_tags']: | |||
for inst in instances: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个module为什么要变
@@ -0,0 +1,303 @@ | |||
#!/usr/bin/python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其他的tag也需要根据上面的review来做
f1fb608
to
333a4ab
Compare
resource_type: | ||
description: | ||
- The type of resource. | ||
choices: ['VPC', 'VSWITCH', 'EIP'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不管API是否统一,我们的module要统一,都改成小写吧
No description provided.