1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Remove diff and request data. Add more return docs. (#34230)

This commit is contained in:
Chris Houseknecht 2017-12-25 21:50:58 -05:00 committed by GitHub
parent 32f963aa0f
commit d73be7f461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 33 deletions

View file

@ -167,9 +167,6 @@ class KubernetesAnsibleModule(AnsibleModule):
return_attributes = dict(changed=False, result=dict())
if self._diff:
return_attributes['request'] = self.helper.request_body_from_params(self.params)
if self.helper.base_model_name_snake.endswith('list'):
k8s_obj = self._read(name, namespace)
return_attributes['result'] = k8s_obj.to_dict()
@ -225,8 +222,6 @@ class KubernetesAnsibleModule(AnsibleModule):
if match:
return_attributes['result'] = existing.to_dict()
self.exit_json(**return_attributes)
elif self._diff:
return_attributes['differences'] = diff
# Differences exist between the existing obj and requested params
if not self.check_mode:
try:

View file

@ -29,7 +29,7 @@ description:
files and using Jinja templates.
- Access to the full range of K8s APIs.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode, and the diff option.
- Supports check mode.
extends_documentation_fragment:
- k8s_state_options
@ -124,18 +124,31 @@ result:
description:
- The created, patched, or otherwise present object. Will be empty in the case of a deletion.
returned: success
type: dict
request:
description:
- The object sent to the API. Useful for troubleshooting unexpected differences and 404 errors.
returned: when diff is true
type: dict
diff:
description:
- List of differences found when determining if an existing object will be patched. A copy of the existing object
is updated with the requested options, and the updated object is then compared to the original. If there are
differences, they will appear here.
returned: when diff is true
type: complex
contains:
api_version:
description: The versioned schema of this representation of an object.
returned: success
type: str
kind:
description: Represents the REST resource this object represents.
returned: success
type: str
metadata:
description: Standard object metadata. Includes name, namespace, annotations, labels, etc.
returned: success
type: complex
spec:
description: Specific attributes of the object. Will vary based on the I(api_version) and I(kind).
returned: success
type: complex
status:
description: Current status details for the object.
returned: success
type: complex
items:
description: Returned only when the I(kind) is a List type resource. Contains a set of objects.
returned: when resource is a List
type: list
'''

View file

@ -29,7 +29,7 @@ description:
files and using Jinja templates.
- Access to the full range of K8s and OpenShift APIs.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode, and the diff option.
- Supports check mode.
extends_documentation_fragment:
- k8s_state_options
@ -165,18 +165,31 @@ result:
description:
- The created, patched, or otherwise present object. Will be empty in the case of a deletion.
returned: success
type: dict
request:
description:
- The object sent to the API. Useful for troubleshooting unexpected differences and 404 errors.
returned: when diff is true
type: dict
diff:
description:
- List of differences found when determining if an existing object will be patched. A copy of the existing object
is updated with the requested options, and the updated object is then compared to the original. If there are
differences, they will appear here.
returned: when diff is true
type: complex
contains:
api_version:
description: The versioned schema of this representation of an object.
returned: success
type: str
kind:
description: Represents the REST resource this object represents.
returned: success
type: str
metadata:
description: Standard object metadata. Includes name, namespace, annotations, labels, etc.
returned: success
type: complex
spec:
description: Specific attributes of the object. Will vary based on the I(api_version) and I(kind).
returned: success
type: complex
status:
description: Current status details for the object.
returned: success
type: complex
items:
description: Returned only when the I(kind) is a List type resource. Contains a set of objects.
returned: when resource is a List
type: list
'''