Skip to content
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

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

lixue323
Copy link
Contributor

No description provided.


DOCUMENTATION = """
---
module: ali_tags
Copy link
Collaborator

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"
Copy link
Collaborator

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参考对应的帮助文档

@lixue323 lixue323 changed the title Add new module ali_tags. Add new modules ali_ecs_tag ali_slb_tag ali_vpc_tag. Feb 21, 2020
@lixue323 lixue323 changed the title Add new modules ali_ecs_tag ali_slb_tag ali_vpc_tag. Add new modules ali_ecs_tag /ali_slb_tag /ali_vpc_tag. Feb 21, 2020
- A list of ECS instance ids.
resource_type:
description:
- The type of ECS instance resource.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

支持哪些类型,要在这个地方展示出来,然后要设置一个defualt:instance

"""

RETURN = '''
instances:
Copy link
Collaborator

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)
Copy link
Collaborator

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:
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他的tag也需要根据上面的review来做

@lixue323 lixue323 force-pushed the addtag branch 4 times, most recently from f1fb608 to 333a4ab Compare February 22, 2020 15:17
resource_type:
description:
- The type of resource.
choices: ['VPC', 'VSWITCH', 'EIP']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不管API是否统一,我们的module要统一,都改成小写吧

@xiaozhu36 xiaozhu36 merged commit c1b35d0 into alibaba:master Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants