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

Adding "name" to Cloud Build resource #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions plugins/modules/gcp_cloudbuild_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
- The unique identifier for the trigger.
required: false
type: str
name:
description:
- Name of the trigger. Must be unique within the project.
required: false
type: str
version_added: '2.10'
description:
description:
- Human-readable description of the trigger.
Expand Down Expand Up @@ -370,6 +376,11 @@
- The unique identifier for the trigger.
returned: success
type: str
name:
description:
- Name of the trigger. Must be unique within the project.
returned: success
type: str
description:
description:
- Human-readable description of the trigger.
Expand Down Expand Up @@ -629,6 +640,7 @@ def main():
argument_spec=dict(
state=dict(default='present', choices=['present', 'absent'], type='str'),
id=dict(type='str'),
name=dict(type='str'),
description=dict(type='str'),
disabled=dict(type='bool'),
substitutions=dict(type='dict'),
Expand Down Expand Up @@ -679,10 +691,7 @@ def main():

state = module.params['state']

if module.params['id']:
fetch = fetch_resource(module, self_link(module))
else:
fetch = {}
fetch = fetch_resource(module, self_link(module))
Copy link

@chrisst chrisst Oct 29, 2019

Choose a reason for hiding this comment

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

@rambleraptor should I be concerned with this bit?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine!

changed = False

if fetch:
Expand Down Expand Up @@ -725,6 +734,7 @@ def delete(module, link):
def resource_to_request(module):
request = {
u'id': module.params.get('id'),
u'name': module.params.get('name'),
u'description': module.params.get('description'),
u'disabled': module.params.get('disabled'),
u'substitutions': module.params.get('substitutions'),
Expand Down Expand Up @@ -799,6 +809,7 @@ def is_different(module, response):
def response_to_hash(module, response):
return {
u'id': response.get(u'id'),
u'name': response.get(u'name'),
u'description': response.get(u'description'),
u'disabled': response.get(u'disabled'),
u'createTime': response.get(u'createTime'),
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/gcp_cloudbuild_trigger_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
- The unique identifier for the trigger.
returned: success
type: str
name:
description:
- Name of the trigger. Must be unique within the project.
returned: success
type: str
description:
description:
- Human-readable description of the trigger.
Expand Down